:root {
  color-scheme: light;
  --bg: #0f172a;
  --ink: #0f172a;
  --muted: #526179;
  --panel: #f8fafc;
  --line: #d7deea;
  --soft: #eef4fb;
  --blue: #2563eb;
  --blue-dark: #0f172a;
  --green: #22d3ee;
  --gold: #f59e0b;
  --red: #ba3f55;
  --night: #172f52;
  --morning: #dff9ff;
  --day: #fff3ff;
  --evening: #f8edf5;
  --hover: rgba(37, 101, 235, .2);
  --selected: #2563eb;
  --amber: #f59e0b;
  --fog: #f8fafc;
  --smoke: #4a4a44;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% -8%, rgba(37, 101, 235, .48), transparent 34rem),
    radial-gradient(circle at 84% 10%, rgba(245, 158, 11, .34), transparent 30rem),
    radial-gradient(circle at 56% 28%, rgba(34, 211, 238, .18), transparent 34rem),
    linear-gradient(180deg, #091222 0, #101f37 24rem, #13213a 56rem, #142338 100%);
  color: var(--ink);
  font-family: "Poppins", "Avenir Next", "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px clamp(16px, 4vw, 48px);
  background:
    radial-gradient(circle at 18% 0%, rgba(34, 211, 238, .28), transparent 40%),
    radial-gradient(circle at 88% 0%, rgba(245, 158, 11, .28), transparent 36%),
    linear-gradient(120deg, #0f172a 0%, #2563eb 52%, #22d3ee 100%);
  color: white;
  box-shadow: 0 20px 44px rgba(8, 16, 34, .45);
}

.brand,
.header-actions,
.add-row,
.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  box-shadow: 0 0 18px rgba(34, 211, 238, .42);
  flex: none;
}

.eyebrow {
  margin: 0 0 4px;
  color: #bfd3e8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1;
}

.brand-title {
  margin: 0;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1;
  letter-spacing: 0;
  color: var(--fog);
  text-shadow: 0 0 18px rgba(34, 211, 238, .38);
}

.brand-main,
.brand-accent {
  display: inline-block;
}

.brand-main {
  color: #22d3ee;
  background: linear-gradient(90deg, #2563eb 0%, #22d3ee 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-accent {
  color: #f59e0b;
  background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-size: 16px;
}

.page-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px clamp(10px, 3vw, 32px) 38px;
}

.toolbar,
.planner,
.panel {
  background: linear-gradient(180deg, rgba(251, 250, 252, .97), rgba(244, 250, 255, .95));
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 20px 42px rgba(6, 15, 35, .2);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  padding: 14px;
}

.ad-unit {
  display: grid;
  gap: 6px;
  align-items: center;
  justify-items: center;
  width: 100%;
  margin: 16px 0;
  padding: 10px;
  border: 1px dashed rgba(200, 216, 239, .9);
  border-radius: 8px;
  background: rgba(248, 250, 252, .82);
  color: #5b6a82;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.ad-unit ins {
  display: block;
  width: 100%;
  min-height: 90px;
}

.ad-unit-leaderboard ins {
  min-height: 90px;
}

.ad-unit-responsive ins {
  min-height: 120px;
}

.control {
  display: grid;
  gap: 6px;
  min-width: 142px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.control.grow {
  flex: 1 1 320px;
  position: relative;
}

input,
select {
  height: 39px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 0 10px;
}

input:focus,
select:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(37, 99, 235, .14);
}

.add-row input {
  flex: 1;
}

.city-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.city-chip {
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #c8d8ef;
  background: #f4f8ff;
  color: #1f3556;
  font-size: 12px;
  font-weight: 800;
}

.city-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 15;
  display: none;
  max-height: 300px;
  overflow: auto;
  border: 1px solid #c9dbf5;
  border-radius: 10px;
  background: #f8fafc;
  box-shadow: 0 14px 34px rgba(10, 24, 50, .24);
}

.city-results.open {
  display: block;
}

.city-result-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #e2ebf8;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 10px 12px;
}

.city-result-item:last-child {
  border-bottom: 0;
}

.city-result-item:hover,
.city-result-item:focus-visible {
  background: #eaf3ff;
}

.city-result-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  font-weight: 900;
}

.city-result-meta {
  margin-top: 4px;
  color: #4f6077;
  font-size: 12px;
  font-weight: 700;
}

.map-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(10, 23, 42, .62);
  backdrop-filter: blur(4px);
}

.map-picker-modal.open {
  display: grid;
}

.map-picker-card {
  width: min(1120px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid #b8d1f8;
  background: linear-gradient(180deg, #f8fbff, #f1f7ff);
  box-shadow: 0 20px 44px rgba(7, 20, 42, .4);
}

.map-picker-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.map-picker-note {
  margin: 8px 0 14px;
  color: #3c5372;
  font-size: 14px;
}

.map-picker-layout {
  display: grid;
  grid-template-columns: 1.25fr 1fr .8fr;
  gap: 14px;
}

.map-picker-map,
.map-picker-results,
.map-picker-selected {
  border: 1px solid #cdddf4;
  border-radius: 12px;
  background: #fff;
}

.map-picker-map {
  position: relative;
  min-height: 360px;
  background:
    radial-gradient(circle at 22% 30%, rgba(37, 99, 235, .25), transparent 26%),
    radial-gradient(circle at 64% 27%, rgba(34, 211, 238, .25), transparent 24%),
    radial-gradient(circle at 83% 66%, rgba(245, 158, 11, .24), transparent 24%),
    linear-gradient(170deg, #e9f2ff, #f7fbff);
}

.region-pin {
  position: absolute;
  border: 1px solid #b9cdf0;
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 800;
  color: #12345c;
  background: #f3f8ff;
}

.region-pin:hover,
.region-pin.active {
  border-color: #2563eb;
  color: #0f172a;
  background: linear-gradient(120deg, #d6e6ff, #dcfbff);
}

.region-pin.na { top: 17%; left: 8%; }
.region-pin.sa { top: 52%; left: 20%; }
.region-pin.eu { top: 19%; left: 47%; }
.region-pin.af { top: 46%; left: 48%; }
.region-pin.me { top: 35%; left: 60%; }
.region-pin.as { top: 23%; left: 70%; }
.region-pin.oc { top: 62%; left: 79%; }

.map-picker-results,
.map-picker-selected {
  padding: 12px;
}

.map-picker-results h3,
.map-picker-selected h3 {
  margin: 0 0 10px;
}

.map-city-cards,
.map-selected-cities {
  display: grid;
  gap: 8px;
}

.map-city-card,
.map-selected-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid #d4e1f5;
  border-radius: 10px;
  background: #f7fbff;
}

.map-city-card strong,
.map-selected-item strong {
  font-size: 14px;
}

.map-city-card span,
.map-selected-item span {
  color: #4e6180;
  font-size: 12px;
}

.primary-button,
.ghost-button,
.icon-button {
  height: 39px;
  border-radius: 6px;
  font-weight: 850;
}

.primary-button {
  padding: 0 14px;
  color: white;
  background: linear-gradient(120deg, var(--blue) 0%, #22d3ee 100%);
  box-shadow: 0 10px 24px rgba(37, 101, 235, .35);
}

.ghost-button {
  padding: 0 12px;
  color: var(--ink);
  background: #e7effc;
}

.app-header .ghost-button {
  color: white;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .24);
}

.app-header .primary-button {
  background: linear-gradient(135deg, #22d3ee, #f59e0b);
  color: #0f172a;
}

.header-link {
  display: inline-flex;
  align-items: center;
  height: 39px;
  padding: 0 12px;
  border-radius: 8px;
  color: white;
  background: rgba(255, 255, 255, .1);
  font-weight: 850;
  text-decoration: none;
}

.header-link:hover {
  background: rgba(255, 255, 255, .18);
}

.small {
  height: 30px;
}

.icon-button {
  width: 39px;
  color: white;
  background: linear-gradient(120deg, #2563eb 0%, #22d3ee 100%);
  font-size: 22px;
  line-height: 1;
}

.planner {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  margin-top: 16px;
  overflow: hidden;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
}

.compact-action {
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.calendar-action {
  height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  color: white;
  background: linear-gradient(135deg, #2563eb 0%, #22d3ee 55%, #f59e0b 100%);
  box-shadow: 0 12px 24px rgba(25, 86, 209, .32);
  font-weight: 900;
}

.calendar-action:hover {
  filter: brightness(1.04);
}

.location-column {
  border-right: 1px solid var(--line);
  background: #fbfdff;
}

.column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.location-card {
  display: grid;
  grid-template-columns: 24px 24px minmax(0, 1fr) auto 28px;
  gap: 6px;
  align-items: center;
  height: 74px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}

.move,
.remove {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
}

.move:hover,
.remove:hover {
  color: var(--ink);
  background: var(--soft);
}

.place,
.clock {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.place strong,
.place span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.place strong {
  font-size: 15px;
}

.place span,
.clock span {
  color: var(--muted);
  font-size: 12px;
}

.clock {
  text-align: right;
}

.clock strong {
  font-size: 18px;
}

.timeline-wrap {
  overflow: auto;
}

.timeline-header,
.time-row {
  display: grid;
  grid-auto-columns: 54px;
  grid-auto-flow: column;
  min-width: max-content;
}

.timeline-header {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 44px;
  background: #f4f9ff;
  border-bottom: 1px solid var(--line);
}

.header-cell,
.slot {
  width: 54px;
  border-right: 1px solid var(--line);
}

.header-cell {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.header-cell.column-hover,
.slot.column-hover {
  position: relative;
  background-image: linear-gradient(90deg, transparent 0, var(--hover) 18%, var(--hover) 82%, transparent 100%);
  box-shadow: inset 2px 0 0 rgba(18, 100, 207, .52), inset -2px 0 0 rgba(18, 100, 207, .52);
}

.header-cell.column-hover::after,
.slot.column-hover::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: rgba(18, 100, 207, .9);
  pointer-events: none;
}

.time-row {
  height: 74px;
  border-bottom: 1px solid var(--line);
}

.slot {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  padding: 4px 2px;
  color: #334154;
  background: var(--day);
}

.slot button {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.slot .time-label {
  font-size: 13px;
  font-weight: 850;
}

.slot .date-label {
  min-height: 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.slot .date-label:empty {
  min-height: 0;
}

.slot.night {
  color: #eaf1f8;
  background: var(--night);
}

.slot.night .date-label {
  color: #b5c2d0;
}

.slot.morning {
  background: var(--morning);
}

.slot.evening {
  background: var(--evening);
}

.slot.weekend {
  box-shadow: inset 0 -4px 0 rgba(186, 63, 85, .22);
}

.slot.selected {
  color: white;
  background: var(--selected);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .32), 0 0 0 1px rgba(37, 101, 235, .42);
}

.slot.selected .date-label {
  color: #dbeaff;
}

.slot.good {
  box-shadow: inset 0 0 0 2px rgba(15, 122, 96, .42);
}

.slot.bad {
  opacity: .76;
}

.insights {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .8fr);
  gap: 16px;
  margin-top: 16px;
}

.panel {
  min-width: 0;
  padding: 16px;
}

.panel-head {
  justify-content: space-between;
  margin-bottom: 12px;
}

.summary,
.best-slots {
  display: grid;
  gap: 8px;
}

.summary-line,
.best-slot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--soft);
  border-radius: 6px;
}

.best-slot {
  align-items: center;
}

.best-slot button {
  flex: none;
  height: 30px;
  padding: 0 10px;
  border-radius: 5px;
  color: white;
  background: var(--green);
  font-weight: 850;
}

.score {
  color: var(--green);
  font-weight: 900;
}

#selectedBadge {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.content-section {
  margin-top: 18px;
  padding: 22px;
  background: linear-gradient(180deg, rgba(251, 250, 252, .97), rgba(244, 250, 255, .95));
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 36px rgba(8, 18, 40, .2);
}

.content-section h1,
.content-section h2 {
  margin-bottom: 12px;
  font-size: 22px;
}

.content-section p {
  max-width: 880px;
  margin: 0 0 12px;
  color: #425164;
  font-size: 15px;
  line-height: 1.65;
}

.content-section p:last-child {
  margin-bottom: 0;
}

.page-updated {
  display: inline-block;
  margin: -4px 0 14px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, .12);
  color: #2f5fb3;
  font-size: 12px;
  font-weight: 700;
}

.page-note {
  font-size: 13px;
  color: #6b7686;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.faq-grid article {
  padding: 16px;
  background: var(--soft);
  border: 1px solid #e4ebf2;
  border-radius: 8px;
}

.faq-grid h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.faq-grid h3 a {
  color: inherit;
  text-decoration: none;
}

.faq-grid h3 a:hover {
  text-decoration: underline;
}

.faq-grid p {
  margin: 0;
  font-size: 14px;
}

.breadcrumb-nav {
  margin: 16px 0 0;
  color: #cfe0f5;
  font-size: 13px;
}

.breadcrumb-nav a {
  color: #8fd8ff;
  text-decoration: none;
  font-weight: 700;
}

.breadcrumb-nav a:hover {
  text-decoration: underline;
}

.pair-clocks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 4px 0 16px;
}

.pair-clock {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  background: var(--soft);
  border: 1px solid #e4ebf2;
  border-radius: 10px;
}

.pair-clock-city {
  font-size: 13px;
  font-weight: 700;
  color: #425164;
}

.pair-clock-time {
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}

.pair-clock-meta {
  font-size: 12px;
  color: #425164;
}

.pair-cta {
  display: inline-flex;
  align-items: center;
  height: 39px;
  padding: 0 16px;
  border-radius: 8px;
  color: white;
  background: linear-gradient(120deg, var(--blue) 0%, #22d3ee 100%);
  box-shadow: 0 10px 24px rgba(37, 101, 235, .35);
  font-weight: 850;
  text-decoration: none;
}

.pair-cta:hover {
  filter: brightness(1.05);
}

.pair-table-wrap {
  overflow-x: auto;
}

.pair-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.pair-table th,
.pair-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #e4ebf2;
}

.pair-table th {
  color: #425164;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.pair-rollover {
  color: #425164;
  font-size: 12px;
}

.pair-transitions {
  margin: 0;
  padding-left: 20px;
  color: #425164;
  font-size: 15px;
  line-height: 1.65;
}

.pair-transitions li {
  margin-bottom: 6px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 20px clamp(10px, 3vw, 32px) 34px;
  color: #d0deef;
  font-size: 14px;
}

.site-footer nav {
  display: flex;
  gap: 16px;
}

.site-footer a {
  color: #8fd8ff;
  font-weight: 800;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.consent-banner {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  width: min(620px, calc(100vw - 36px));
  padding: 18px;
  background: rgba(251, 250, 252, .98);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(23, 32, 42, .24);
}

.consent-copy h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.consent-copy p {
  margin: 0 0 8px;
  color: #425164;
  font-size: 14px;
  line-height: 1.5;
}

.consent-links,
.consent-actions,
.consent-preferences {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.consent-links a {
  color: var(--blue-dark);
  font-weight: 800;
  text-decoration: none;
}

.consent-links a:hover {
  text-decoration: underline;
}

.consent-preferences {
  padding: 12px;
  background: var(--soft);
  border: 1px solid #e4ebf2;
  border-radius: 8px;
}

.consent-preferences label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.consent-actions {
  justify-content: flex-end;
}

@media (max-width: 840px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .location-column {
    border-right: 0;
  }

  .timeline-wrap {
    border-top: 1px solid var(--line);
  }

  .insights {
    grid-template-columns: 1fr;
  }

  .faq-grid {
    grid-template-columns: 1fr;
  }

  .map-picker-layout {
    grid-template-columns: 1fr;
  }

  .map-picker-map {
    min-height: 280px;
  }
}

@media (max-width: 560px) {
  .brand {
    align-items: flex-start;
  }

  .header-actions,
  .add-row {
    width: 100%;
  }

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

  .header-actions button {
    flex: 1 1 140px;
  }

  .location-card {
    grid-template-columns: 24px 24px minmax(0, 1fr) 28px;
  }

  .clock {
    display: none;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .consent-actions {
    justify-content: stretch;
  }

  .consent-actions button {
    flex: 1 1 140px;
  }
}
