:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --card: #ffffff;
  --text: #1f2a36;
  --muted: #4f5b68;
  --line: #d7dee6;
  --accent: #1aa6b1;
  --accent-soft: rgba(26, 166, 177, 0.12);
  --shadow: 0 18px 40px rgba(28, 39, 51, 0.08);
  --rail-w: 200px;
  --gutter: 20px;
  --outer-pad: 12px;
  --slot-top-h: 90px;
  --header-h: 64px;
  --scale: 0.92;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(180deg, #f9fafc 0%, #eef2f7 100%);
  color: var(--text);
  line-height: 1.5;
  font-size: calc(16px * var(--scale));
}

a {
  color: inherit;
  text-decoration: none;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 12px;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  z-index: 1000;
}

.skip-link:focus {
  left: 12px;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

main {
  padding: 0 clamp(12px, 4vw, 24px) 4rem;
  max-width: 1080px;
  margin: 0 auto;
}

.page-header {
  position: sticky;
  top: var(--slot-top-h);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.75rem clamp(12px, 4vw, 24px);
  min-height: var(--header-h);
  background: rgba(247, 248, 251, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand.centered {
  flex-direction: column;
  justify-content: center;
  text-align: center;
  gap: 0.15rem;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  justify-content: center;
}

.brand-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.brand-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.logo {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--accent);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 1px;
}

.brand-name {
  font-weight: 600;
  font-size: 1rem;
}

.brand-sub {
  font-size: 0.8rem;
  color: var(--muted);
}

.primary-nav {
  display: none;
  gap: 1.2rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.primary-nav a:hover {
  color: var(--text);
}

.hero {
  display: grid;
  gap: 1.1rem;
  padding: 1rem 0 2.8rem;
}

.hero-title {
  text-align: center;
}

.hero-intro {
  max-width: 68ch;
  margin: 0.35rem auto 0;
  color: var(--muted);
  font-size: 1rem;
}

.hero-title .lead {
  max-width: 46ch;
  margin: 0.35rem auto 0;
}

.hero-about {
  max-width: 58ch;
  margin: 0.35rem auto 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--muted);
}

h1 {
  font-size: clamp(0.95rem, 2.9vw, 2.1rem);
  letter-spacing: -0.02em;
  white-space: nowrap;
  margin: 0 0 0.4rem;
}

.lead {
  font-size: 1rem;
  color: var(--muted);
}

.tool-switch {
  display: flex;
  gap: 0.5rem;
  margin: 0.4rem 0 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
}

.tab-btn {
  border: 1px solid var(--line);
  background: transparent;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  color: var(--muted);
  transition: 0.2s ease;
}

.tab-btn.active {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--text);
}

.hero-card {
  background: var(--card);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 1.2rem;
}

.tool {
  display: none;
}

.tool.active {
  display: block;
}

.input-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.input-row {
  display: flex;
  gap: 0.6rem;
  margin: 0.5rem 0 1rem;
}

.clock-grid {
  display: grid;
  gap: 1.2rem;
}

.clock-input {
  align-self: start;
}

.city-input {
  position: relative;
}

.suggestions {
  position: absolute;
  top: calc(100% - 0.2rem);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.4rem;
  display: none;
  z-index: 5;
}

.suggestions.show {
  display: grid;
  gap: 0.3rem;
}

.suggestion {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: #f7f9fd;
  font-size: 0.9rem;
}

.suggestion .muted {
  color: var(--muted);
  font-size: 0.8rem;
  margin-left: 0.6rem;
  text-align: right;
}

.suggestion.online {
  background: #f2f6ff;
}

.suggestion.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.suggestion.hint {
  color: var(--muted);
  background: transparent;
  border: 1px dashed var(--line);
  justify-content: center;
}

.suggestions-attribution {
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0.3rem 0.4rem 0.1rem;
}

.tz-chooser {
  margin-top: 0.5rem;
  display: none;
}

.tz-chooser.active {
  display: block;
}

.inline-note {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.6rem 0.7rem;
  background: #fbfcfe;
}

.input-clearable {
  position: relative;
  flex: 1;
  width: 100%;
  display: block;
}

.input-clearable input {
  padding-right: 2.2rem;
}

.clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0;
}

.clear-btn.is-visible {
  display: inline-flex;
}

.primary-btn {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 0.65rem 1.05rem;
  font-weight: 600;
}

.ghost-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.9rem;
}

.link-btn {
  background: transparent;
  border: none;
  color: var(--accent);
  padding: 0.5rem 0.3rem;
}

.clock-cta {
  margin-top: 1rem;
  font-size: 0.95rem;
}

.ghost-btn:disabled,
.primary-btn:disabled,
.link-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.quick-cities {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.quick-cities button {
  border: 1px solid var(--line);
  background: #f3f5f9;
  border-radius: 10px;
  padding: 0.4rem 0.7rem;
  font-size: 0.85rem;
}

.time-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.2rem;
  background: #fbfdff;
}

.time-display {
  font-size: 2.35rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.time-label {
  font-size: 1rem;
  color: var(--text);
  margin-top: 0.2rem;
}

.time-meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.timeline {
  margin-top: 1.1rem;
}

.timeline-bar {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #1c2b3a 0 50%, #d8e2ef 50% 100%);
  border: 1px solid var(--line);
}

.timeline-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.4rem;
}

.inline-error {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.6rem;
}

.inline-error button {
  margin-left: 0.3rem;
  margin-top: 0.3rem;
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.planner-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.host-tz {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-start;
}

.follow-btn {
  font-size: 0.78rem;
  padding: 0;
}

.planner-strip {
  margin-bottom: 0.8rem;
}

.planner-preferences {
  display: grid;
  gap: 0.8rem;
  margin: 1rem 0 0.6rem;
  grid-template-columns: 1.2fr 1fr;
}

.pref-stack {
  display: grid;
  gap: 0.6rem;
}

.planner-preferences .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.planner-actions {
  display: flex;
  gap: 0.5rem;
}

.participant {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  margin-top: 1rem;
  background: #f9fbfe;
}

.participant-row {
  display: grid;
  gap: 0.6rem;
}

.participant-row .row {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: 1fr 1fr;
}

.participant-row .row.three {
  grid-template-columns: 1fr 1fr 1fr;
}

/* Prevent grid children from overflowing on mobile */
.participant-row .row > div {
  min-width: 0;
}

/* Time inputs can overflow on iOS unless forced */
.participant-row input[type="time"] {
  width: 100%;
  max-width: 100%;
}

.participant-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.participant-title {
  font-weight: 600;
}

.remove-btn {
  border: none;
  background: transparent;
  color: var(--muted);
}

.planner-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.2rem 0;
  flex-wrap: wrap;
}

.results {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.results-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.results-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.results-actions.hidden {
  display: none;
}

.results-body {
  margin-top: 1rem;
  display: grid;
  gap: 0.8rem;
}

.results-actions .inline-note {
  width: 100%;
}

.date-filter {
  margin: 0.6rem 0 0.2rem;
}

.date-strip {
  gap: 0.5rem;
  display: flex;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 0.2rem;
}

.date-strip::-webkit-scrollbar {
  height: 0;
  width: 0;
  display: none;
}

.scroll-strip {
  scroll-behavior: smooth;
}

.date-chip {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.5rem 0.6rem;
  text-align: center;
  background: #f7f9fd;
  font-size: 0.85rem;
  cursor: pointer;
  flex: 0 0 auto;
}

.date-chip.active {
  background: var(--accent-soft);
  border-color: transparent;
  font-weight: 600;
}

.result-card {
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 14px;
  padding: 1rem;
  display: grid;
  gap: 0.5rem;
  text-align: left;
  width: 100%;
}

.result-card.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.result-title {
  font-weight: 600;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.result-meta {
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.result-times {
  display: grid;
  gap: 0.4rem;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.empty-state {
  color: var(--muted);
  font-size: 0.95rem;
}

.share-hint {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.how,
.faq,
.cta {
  margin: 4.5rem 0;
}

.how p,
.faq p {
  max-width: 60ch;
}

.how-steps {
  display: grid;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.step {
  display: inline-flex;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.faq details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.8rem;
}

.cta {
  background: var(--card);
  border-radius: 18px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
}

.resources {
  background: var(--card);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.resource-list {
  list-style: none;
  padding: 0;
  margin: 0.8rem 0 0;
  display: grid;
  gap: 0.5rem;
}

.resource-list a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.page-nav {
  margin-top: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.page-nav a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal {
  padding: 1rem 0 3rem;
}

.legal-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.2rem;
}

.legal-card h1,
.legal-card h2 {
  margin-top: 0;
}

.legal-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.contact-form {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.contact-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.contact-form textarea {
  min-height: 140px;
  resize: vertical;
}

.form-status {
  min-height: 1.2rem;
  color: var(--muted);
}

.footer {
  padding: 2.6rem 6vw 1.8rem;
  border-top: 1px solid var(--line);
  background: #f4f6fa;
}

.micro-resources {
  border-top: 1px solid var(--line);
  padding: 1.25rem clamp(12px, 4vw, 24px) 0;
  margin: 1.5rem auto 0;
  max-width: 1080px;
}

.micro-resources__label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.micro-resources__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f7f9fd;
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
}

.chip-link:hover {
  color: var(--text);
  border-color: #c6d0de;
}

.footer-grid {
  display: grid;
  gap: 1.5rem;
}

.footer h4,
.footer h3 {
  margin-bottom: 0.4rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.35rem;
}

.footer-links a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-bottom {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-meta {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.4rem;
  line-height: 1.4;
}

.slot {
  border: 1px dashed #c8d2e1;
  color: #7a8795;
  text-align: center;
  background: #f0f3f8;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.4rem 0.6rem;
}

.slot-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  padding: 0.4rem 0;
}

.slot-placeholder {
  padding: 1rem 0;
  font-weight: 600;
}

.slot-ad {
  display: block;
  margin: 0 auto;
  max-width: 100%;
}

.slot.ad-collapsed {
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  height: 0;
  overflow: hidden;
  background: transparent;
}

.slot-top {
  position: sticky;
  top: 0;
  z-index: 60;
  background: #f0f3f8;
  min-height: 90px;
  margin-bottom: 0.6rem;
}

.slot-bottom {
  min-height: 90px;
  margin-top: 1rem;
}

.inline-ad {
  margin: 1.8rem auto;
  width: 100%;
  min-height: 140px;
  display: grid;
  align-content: center;
  border-radius: 14px;
}

.rail {
  position: sticky;
  top: calc(var(--slot-top-h) + 12px);
  width: var(--rail-w);
  min-height: 400px;
  display: none;
  z-index: 10;
}

.print-summary {
  display: none;
}

@media (min-width: 900px) {
  .primary-nav {
    display: flex;
  }

  .hero {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .clock-grid {
    grid-template-columns: 1.05fr 1fr;
    align-items: start;
  }

  .how-steps {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .rail {
    display: block;
  }

  .desk-grid {
    display: grid;
    grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--rail-w);
    gap: var(--gutter);
    align-items: start;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 var(--outer-pad);
  }

  .content {
    min-width: 0;
  }
}

@media (max-width: 720px) {
  h1 {
    white-space: normal;
  }

  .input-row {
    flex-direction: column;
  }

  .participant-row .row,
  .participant-row .row.three {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-wrap: wrap;
  }

  .tab-btn,
  .primary-btn,
  .ghost-btn,
  .quick-cities button {
    min-height: 44px;
  }

  .planner-preferences {
    grid-template-columns: 1fr;
  }

  /* Make sure select/time/input never overflow their grid cell */
  .participant input,
  .participant select {
    min-width: 0;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }
}

@media (max-width: 420px) {
  :root {
    --scale: 0.88;
    --outer-pad: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  body {
    background: white;
    color: #000;
  }

  .slot,
  .rail,
  .page-header,
  .hero-copy,
  .how,
  .faq,
  .cta,
  .footer,
  .tool-switch,
  .tool,
  .results,
  .planner-head,
  .planner-footer {
    display: none !important;
  }

  main {
    display: none;
  }

  .print-summary {
    display: block;
    margin: 1rem 0;
    color: #000;
  }

  .print-summary h2,
  .print-summary h3 {
    margin: 0 0 0.5rem;
  }

  .print-summary p,
  .print-summary ul,
  .print-summary ol {
    margin: 0 0 0.8rem;
  }

  .print-summary ul,
  .print-summary ol {
    padding-left: 1.2rem;
  }

  .print-summary li {
    break-inside: avoid;
  }
}
