:root {
  color-scheme: light;
  --paper: #f3f0ea;
  --surface: #fcfaf5;
  --ink: #292c27;
  --muted: #625c52;
  --line: #d9d3c8;
  --focus: #886025;
  --gutter: clamp(16px, 5vw, 64px);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: var(--gutter);
  padding-top: max(var(--gutter), env(safe-area-inset-top));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
  padding-bottom: max(var(--gutter), env(safe-area-inset-bottom));
  padding-left: max(var(--gutter), env(safe-area-inset-left));
}

.arrival {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  width: 100%;
  max-width: 1080px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 12px 48px #292c2706;
}

.arrival-image {
  display: block;
  width: 100%;
  height: auto;
  align-self: center;
  border-radius: 3px 0 0 3px;
}

.arrival-details {
  min-width: 0;
  align-self: center;
  padding: clamp(26px, 3.8vw, 48px);
}

h1, h2 { margin: 0; font-weight: 400; }
h1 {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  font-size: clamp(2.35rem, 3.8vw, 3.3rem);
  line-height: 1.12;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.location {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.actions { display: grid; gap: 8px; margin-top: 32px; }
.control {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 3px;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: #88602526;
  touch-action: manipulation;
}

.control-primary { color: var(--surface); background: var(--ink); }
.control-quiet { background: transparent; color: var(--muted); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: #aaa193; }
.control-option { background: var(--paper); border-color: var(--line); color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
@media (hover: hover) {
  .control-primary:hover { background: #41463c; }
  .control-quiet:hover { color: var(--ink); text-decoration-color: currentColor; }
  .control-option:hover { background: #e9e4db; border-color: #aba293; }
}
.control:active { filter: brightness(0.94); }
.status { margin: 0; color: var(--muted); font-size: 0.875rem; line-height: 1.5; }
.status:not(:empty) { margin-top: 12px; }

.contacts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 7rem), 1fr));
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.contact-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 44px;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.4;
  text-decoration: none;
  touch-action: manipulation;
}
.contact-label { font-weight: 500; }
.contact-number, .contact-address {
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: #aaa193;
}
.contact-number { white-space: nowrap; }
.contact-email {
  grid-column: 1 / -1;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
}
.contact-address { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
@media (hover: hover) {
  .contact-link:hover { color: var(--ink); }
  .contact-link:hover .contact-number, .contact-link:hover .contact-address { text-decoration-color: currentColor; }
}

html:has(dialog[open]) { overflow: hidden; }
dialog {
  width: min(420px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 16px 64px #151a1933;
}
dialog:not([open]) { display: none; }
dialog::backdrop { background: #151a1973; }
.sheet-content { padding: 28px; }
h2 { font-size: 1.1875rem; line-height: 1.4; }
#copy-help { margin: 18px 0; color: var(--muted); font-size: 0.9375rem; line-height: 1.6; }
label { display: block; margin: 0 0 8px; font-size: 0.875rem; line-height: 1.5; }
#location-value {
  display: block;
  width: 100%;
  min-height: 88px;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid #aaa193;
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
  resize: vertical;
  overflow-wrap: anywhere;
}
.clipboard-buffer {
  position: fixed;
  inset: 0 auto auto 0;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 900px) {
  .arrival { max-width: 520px; grid-template-columns: minmax(0, 1fr); }
  .arrival-image { border-radius: 3px 3px 0 0; }
  .arrival-details { padding: 30px; }
  h1 { font-size: clamp(2.35rem, 9.5vw, 2.875rem); }
  .actions { margin-top: 26px; }
}

@media (max-width: 600px) {
  dialog {
    inset: auto 0 max(12px, env(safe-area-inset-bottom));
    margin: 0 auto;
    max-height: calc(100vh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    border-radius: 12px;
  }
  .sheet-content { padding: 24px; }
}

@media (max-width: 360px) {
  .arrival-details { padding: 26px 22px; }
}

@media (forced-colors: active) {
  .control { border: 1px solid ButtonText; }
  dialog::backdrop { background: Canvas; opacity: 0.75; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
