/* Ookii Roam
   Desktop (>=1024px): a fixed 1024x1536 stage positioned over the artwork plate.
   Below 1024px: the plate is dropped and everything reflows into native cards. */
:root {
  color-scheme: light;
  --navy: #101c46;
  --navy-deep: #16255f;
  --blue: #2f52e8;
  --orange: #ef7350;
  --cream: #fdf7ee;
  --cream-card: #f4ece1;
  --cream-field: #efe3d3;
  --cream-edge: #ddcbb2;
  --muted: #6a7093;
  --hour-w: 18.125px;
}
* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: #c9a88c var(--cream-field); }
html, body { margin: 0; background: #0b1230; }
body { font-family: Poppins, Helvetica, Arial, sans-serif; color: var(--navy); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--cream-field); border-radius: 9px; }
::-webkit-scrollbar-thumb { background: #c9a88c; border-radius: 9px; border: 2px solid var(--cream-field); }
::-webkit-scrollbar-thumb:hover { background: var(--orange); }
::placeholder { color: #9a927f; opacity: 1; }
input { font-family: inherit; color: inherit; border: 0; background: transparent; }
input:focus { outline: none; }
button { font-family: inherit; color: inherit; border: 0; background: transparent; cursor: pointer; padding: 0; }
a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--blue); }

.viewport { width: 100%; overflow: hidden; }
.stage { position: relative; width: 1024px; height: 1536px; margin: 0 auto; transform-origin: top center; user-select: none; }
.plate { position: absolute; inset: 0; width: 1024px; height: 1536px; display: block; }

/* sky */
.star { position: absolute; border-radius: 50%; background: var(--cream); animation: twinkle 4s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: .12; transform: scale(.75); } 50% { opacity: .95; transform: scale(1.2); } }
.shoot {
  position: absolute; height: 2px; border-radius: 2px; transform-origin: right center;
  background: linear-gradient(to left, rgba(253,247,238,.95), rgba(253,247,238,0));
  animation: shoot 7s linear infinite;
}
@keyframes shoot {
  0% { opacity: 0; transform: translate(0, 0); } 4% { opacity: 0; }
  9% { opacity: 1; } 17% { opacity: 1; }
  23% { opacity: 0; transform: translate(var(--dx), var(--dy)); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)); }
}

/* header */
.logo { position: absolute; left: 64px; top: 72px; width: 292px; height: 73px; display: block; }
.support {
  position: absolute; right: 43px; top: 38px; padding: 10px 22px; border: 1.5px solid var(--orange);
  border-radius: 22px; background: var(--orange); color: #0B1230; font-size: 13px; font-weight: 700; letter-spacing: .6px;
  animation: supportBob 3.4s ease-in-out infinite;
}
.support:hover { background: #F6906F; border-color: #F6906F; color: #0B1230; }
.support:focus-visible { outline: 3px solid #FDF7EE; outline-offset: 3px; }
@keyframes supportBob {
  0%, 100% { transform: translateY(0); box-shadow: 0 0 0 0 rgba(239,115,80,0); }
  50% { transform: translateY(-5px); box-shadow: 0 10px 26px -6px rgba(239,115,80,.55); }
}
.headline {
  position: absolute; left: 66px; top: 176px; width: 360px; margin: 0;
  font-size: 38px; line-height: 1.16; font-weight: 800; letter-spacing: -.5px; text-wrap: pretty;
}
.accent { color: var(--orange); }
.lede { position: absolute; left: 66px; top: 358px; width: 268px; margin: 0; font-size: 14px; line-height: 1.62; color: #3a4778; }

/* labels sit inside the painted cards */
.label { position: absolute; font-size: 11.5px; font-weight: 700; letter-spacing: 1.1px; white-space: nowrap; }
.label--city { left: 84px; top: 556px; }
.label--date { left: 84px; top: 758px; }
.label--hours { left: 84px; top: 902px; }
.label--display { left: 86px; top: 1068px; }
.label--weekend { left: 86px; top: 1186px; line-height: 1.55; }
.label--lists { left: 762px; top: 1040px; font-size: 12px; }

/* fields (transparent — the artwork paints the box) */
.field { position: absolute; }
.field-inner { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; height: 100%; font-size: 12.5px; }
.field-btn { cursor: pointer; }
.field--search { left: 47px; top: 602px; width: 188px; height: 44px; }
.field--search .field-inner { padding: 0 13px; }
.field--search input { flex: 1; min-width: 0; font-size: 12.5px; }
.icon-btn { font-size: 22px; line-height: 1; color: #8d7f6d; }
.field--date { left: 47px; top: 798px; width: 188px; height: 38px; }
.field--date .field-inner { padding: 0 13px; }
.field .icon { font-size: 19px; line-height: 1; color: #8d7f6d; }
.field--start { left: 47px; top: 944px; width: 101px; height: 36px; }
.field--end { left: 157px; top: 944px; width: 98px; height: 36px; }
.field--start .field-inner, .field--end .field-inner { padding: 0 11px; }
.caret { font-size: 9px; color: #8d7f6d; }
.linkish {
  position: absolute; left: 48px; top: 672px; display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--orange); white-space: nowrap;
}
.plus { font-size: 15px; }

/* popups */
.popup {
  position: absolute; left: 0; z-index: 20; background: var(--cream);
  border: 1px solid var(--cream-edge); border-radius: 14px; box-shadow: 0 18px 34px rgba(50,32,22,.24);
}
.popup--wide { top: 50px; width: 258px; max-height: 232px; overflow-y: auto; overflow-x: hidden; }
.popup--hours { top: 40px; width: 118px; max-height: 176px; overflow-y: auto; overflow-x: hidden; border-radius: 12px; }
.popup--cal { top: 44px; width: 258px; padding: 14px; border-radius: 16px; }
.opt {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  width: 100%; padding: 9px 13px; font-size: 12.5px; text-align: left; border-bottom: 1px solid #f0e5d6;
}
.opt:last-child { border-bottom: 0; }
.opt:hover { background: #f2e6d5; }
.opt .name { font-weight: 600; }
.opt .meta { font-size: 10.5px; color: #7c7f99; white-space: nowrap; }
.opt.is-on { background: var(--blue); color: #fff; }
.opt.is-on .meta { color: rgba(255,255,255,.8); }
.opt--hour { padding: 8px 12px; justify-content: flex-start; }
.empty-note { padding: 12px 13px; font-size: 11.5px; color: #7c7f99; }

/* calendar */
.cal-head { display: flex; align-items: center; gap: 2px; }
.cal-title { flex: 1; text-align: center; font-size: 13px; font-weight: 700; letter-spacing: .4px; white-space: nowrap; }
.cal-nav { flex: 0 0 auto; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--orange); font-size: 18px; }
.cal-nav--yr { width: 22px; font-size: 13px; }
.cal-nav:hover { background: #f2e6d5; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-top: 10px; }
.cal-dow { text-align: center; font-size: 13px; font-weight: 700; letter-spacing: .4px; color: #767061; }
.cal-dow abbr { text-decoration: none; border: 0; cursor: default; }
.cal-day { height: 29px; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 13px; font-weight: 500; }
.cal-day.is-weekend { color: #8A5F3A; }
.cal-day.is-today { box-shadow: 0 0 0 1.5px var(--orange) inset; font-weight: 700; }
.cal-day.is-on { background: var(--blue); color: #fff; font-weight: 700; box-shadow: none; }
.cal-day.is-empty { pointer-events: none; }
.cal-day:not(.is-empty):hover { background: #f2e6d5; }
.cal-today { width: 100%; margin-top: 10px; padding: 9px 0; border-radius: 11px; border: 1px solid #e8a68d; font-size: 13px; font-weight: 600; color: #A24E36; }
.cal-today:hover { background: rgba(239, 115, 80, .10); }

/* segmented + toggle */
.segmented { position: absolute; left: 42px; top: 1104px; width: 218px; height: 36px; display: flex; gap: 4px; }
.seg-btn { flex: 1; display: flex; align-items: center; justify-content: center; border-radius: 10px; font-size: 12px; font-weight: 700; letter-spacing: .6px; color: var(--muted); }
.seg-btn.is-on { background: var(--blue); color: #fff; }
.toggle { position: absolute; left: 254px; top: 1197px; width: 46px; height: 26px; border-radius: 13px; background: #d9cbb6; flex: none; }
.toggle.is-on { background: var(--orange); }
.knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.22); transition: left .18s ease; }
.toggle.is-on .knob { left: 23px; }

/* timeline */
.banner {
  position: absolute; left: 506px; top: 424px; padding: 13px 26px; background: var(--blue); border-radius: 14px;
  box-shadow: 0 14px 26px rgba(20,30,90,.45); color: #fff; font-size: 13px; font-weight: 700; letter-spacing: 1.2px; white-space: nowrap;
}
.axis-label { position: absolute; top: 532px; width: 60px; text-align: center; font-size: 12px; font-weight: 600; color: #b6c2ea; }
.row { position: absolute; left: 264px; }
.row-pill {
  position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 11px; width: 226px; height: 100%;
  padding: 0 10px 0 7px; background: var(--navy-deep); border-radius: 30px; box-shadow: 0 10px 22px rgba(6,12,40,.5);
}
.avatar { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; font-size: 15px; font-weight: 700; flex: none; }
.row-text { flex: 1; min-width: 0; }
.row-name { font-size: 14px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-zone { margin-top: 2px; font-size: 10.5px; font-weight: 500; letter-spacing: .3px; color: #98a6d6; white-space: nowrap; }
.row-x { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.10); color: #b6c2ea; font-size: 12px; flex: none; }
.row-x:hover { background: var(--orange); color: #fff; }
.track { position: absolute; left: 244px; top: 6px; width: 435px; background: rgba(20,33,80,.9); border-radius: 8px; }
.seg { position: absolute; top: 6px; background: #fbe8d3; border-radius: 6px; }
.band { position: absolute; top: 560px; background: rgba(53,88,255,.66); border-radius: 6px; box-shadow: 0 0 0 1px rgba(140,170,255,.6) inset; pointer-events: none; }
.scrub { position: absolute; left: 508px; top: 548px; width: 435px; cursor: ew-resize; touch-action: none; z-index: 4; }
.scrub-hint { display: none; }
.empty { position: absolute; left: 300px; top: 660px; width: 360px; font-size: 14px; line-height: 1.6; color: #9fb0e6; }

/* pick an hour */
.hourcard {
  position: absolute; left: 408px; top: 892px; width: 304px; padding: 15px 0 18px; background: var(--blue);
  border-radius: 22px; box-shadow: 0 22px 40px rgba(20,30,90,.5); text-align: center; color: #fff;
}
.hourcard-title { font-size: 12.5px; font-weight: 700; letter-spacing: 1.3px; opacity: .92; }
.hourcard-row { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 4px; }
.chev { font-size: 30px; line-height: 1; color: #fff; opacity: .9; }
.chev:hover { opacity: 1; }
.hourcard-time { min-width: 158px; font-size: 38px; font-weight: 800; letter-spacing: -1px; }
.suffix { font-size: 19px; font-weight: 700; letter-spacing: 0; }
.zone-wrap { position: relative; display: flex; justify-content: center; margin-top: 2px; }
.zone-chip {
  display: flex; align-items: center; gap: 7px; padding: 6px 13px; background: rgba(255,255,255,.14);
  border-radius: 20px; font-size: 11px; font-weight: 600; letter-spacing: .7px; color: #e7ecff; white-space: nowrap;
}
.zone-chip:hover { background: rgba(255,255,255,.24); }
.zone-chip .caret { color: #e7ecff; }
.popup--zone {
  left: 50%; bottom: 40px; top: auto; z-index: 30; width: 270px; margin-left: -135px; padding: 10px;
  border-radius: 16px; text-align: left; color: var(--navy);
}
.popup--zone input {
  width: 100%; padding: 9px 12px; background: var(--cream-field);
  border: 1px solid #e0d0ba; border-radius: 11px; font-size: 12px;
}
.zone-list { max-height: 186px; overflow-y: auto; overflow-x: hidden; margin-top: 8px; }
.zone-list .opt { border-bottom: 0; border-radius: 9px; padding: 8px 10px; }
.verdict { margin-top: 8px; font-size: 13.5px; font-weight: 500; }
.rule { margin: 6px auto 0; width: 88px; height: 6px; border-radius: 3px; background: var(--orange); }

/* saved lists */
.lists { position: absolute; left: 706px; top: 1074px; width: 264px; max-height: 208px; overflow-y: auto; overflow-x: hidden; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 9px 2px; border-bottom: 1px solid #e3d7c7; }
.list-badge { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 11px; color: #fff; font-size: 14px; font-weight: 700; flex: none; }
.list-main { flex: 1; min-width: 0; text-align: left; }
.list-name { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-count { margin-top: 1px; font-size: 11.5px; color: var(--muted); }
.list-x { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; color: #8a8397; font-size: 12px; flex: none; }
.list-x:hover { background: var(--orange); color: #fff; }
.lists-actions { position: absolute; left: 706px; top: 1292px; width: 264px; }
.newlist { width: 100%; padding: 12px 0; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--orange); border: 1px solid #e8a68d; border-radius: 13px; }
.newlist:hover { background: rgba(239,115,80,.10); }
.name-row { display: flex; align-items: center; gap: 8px; }
[hidden] { display: none !important; }
.name-row input { flex: 1; min-width: 0; padding: 11px 12px; background: var(--cream-field); border: 1px solid #e0d0ba; border-radius: 12px; font-size: 12.5px; }
.save { padding: 11px 15px; background: var(--blue); color: #fff; border-radius: 12px; font-size: 12.5px; font-weight: 600; }
.lists-hint { margin-top: 8px; font-size: 10.5px; color: #7c7f99; text-align: center; }

/* footer */
.footer { position: absolute; left: 172px; top: 1406px; width: 570px; }
.footer-title { font-size: 14.5px; font-weight: 700; color: #fff; }
.footer-copy { margin-top: 6px; width: 400px; font-size: 12.5px; line-height: 1.5; color: #ccd5f0; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 11px; margin-top: 12px; font-size: 11.5px; font-weight: 500; }
.footer-links a { color: #e9eeff; white-space: nowrap; }
.footer-links a.muted { color: #97a4d4; }
.footer-links a:hover { color: var(--orange); }
.footer-links span { color: #5d6ba0; }
.footer-meta { margin-top: 10px; font-size: 10.5px; letter-spacing: .4px; color: #7f8cbd; white-space: nowrap; }

/* =========================================================
   COMPACT — phone and tablet (below 1024px)
   The artwork plate is dropped; cards are drawn in CSS.
   ========================================================= */
@media (max-width: 1023px) {
  html, body { background: #0b1230; overflow-x: hidden; }
  .viewport { overflow: visible; max-width: 100%; }
  .stage {
    width: 100%; height: auto; max-width: min(760px, 100%); padding: 0 20px;
    transform: none; display: flex; flex-direction: column; gap: 26px;
  }
  .plate { display: none; }

  /* every desktop-positioned piece goes back into flow */
  .logo, .support, .headline, .lede, .label, .field, .linkish, .segmented, .toggle,
  .banner, .row, .row-pill, .track, .band, .scrub, .empty, .hourcard, .lists, .lists-actions, .footer {
    position: static; left: auto; top: auto; right: auto; bottom: auto;
  }

  /* header */
  .m-head { position: relative; padding: 30px 0 4px; }
  #sky { position: absolute; inset: -10px -20px auto; height: 300px; overflow: hidden; pointer-events: none; }
  .m-brand { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
  .m-brand::before {
    content: ''; position: absolute; z-index: 0; left: -30px; top: -84px; width: 306px; height: 197px;
    background: url(assets/m-shape.png) left top / 100% 100% no-repeat;
    filter: drop-shadow(10px 12px 20px rgba(4,9,32,.55));
    -webkit-mask-image: linear-gradient(180deg, #000 58%, rgba(0,0,0,.55) 82%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 58%, rgba(0,0,0,.55) 82%, transparent 100%);
  }
  .logo { position: relative; z-index: 1; }
  .logo { width: 208px; height: 52px; }
  .support {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 22px;
    font-size: 13.5px; white-space: nowrap;
  }
  .headline {
    position: relative; width: auto; margin: 26px 0 0; max-width: 11ch;
    font-size: 32px; line-height: 1.14; color: #fff;
  }
  .lede { position: relative; width: auto; max-width: 46ch; margin: 14px 0 0; font-size: 15px; color: #ccd5f0; }

  /* cards */
  .m-controls { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .m-controls, .m-timeline, .card, .hourcard, .footer { min-width: 0; max-width: 100%; }
  .card > *, .m-timeline > *, .hourcard > * { min-width: 0; }
  .card {
    background: var(--cream-card); border-radius: 20px; padding: 18px 18px 20px;
    box-shadow: 0 16px 30px rgba(6,12,40,.34);
  }
  .label { display: block; margin-bottom: 12px; white-space: normal; }
  .label--weekend { margin-bottom: 0; }
  .field { display: block; position: relative; width: 100%; height: auto; }
  .field-inner {
    min-height: 50px; padding: 0 14px; background: var(--cream-field);
    border: 1px solid #e0d0ba; border-radius: 13px; font-size: 15px;
  }
  .field--search input { min-width: 0; font-size: 15px; }
  .icon-btn { min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
  .field .icon { font-size: 21px; }
  .caret { font-size: 11px; }
  .linkish { display: inline-flex; min-height: 44px; margin-top: 4px; font-size: 14px; }
  .hour-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
  .segmented { width: 100%; height: 50px; gap: 8px; }
  .seg-btn { border: 1px solid #e0d0ba; border-radius: 13px; font-size: 13px; }
  .seg-btn.is-on { border-color: var(--blue); }
  .card--weekend { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
  .toggle { position: relative; width: 52px; height: 30px; border-radius: 15px; }
  .knob { width: 24px; height: 24px; }
  .toggle.is-on .knob { left: 25px; }

  /* popups anchor to their field and never exceed the card */
  .popup { width: 100% !important; margin-left: 0 !important; }
  .popup--wide { top: 56px; max-height: 268px; }
  .popup--hours { top: 56px; max-height: 220px; }
  .popup--cal { top: 56px; }
  .opt { min-height: 44px; padding: 11px 14px; font-size: 14px; }
  .opt--hour { font-size: 14px; }
  .cal-day { height: 38px; font-size: 13px; }
  .cal-dow { font-size: 13px; }
  .cal-nav { width: 40px; height: 40px; font-size: 22px; }
  .cal-nav--yr { width: 34px; font-size: 16px; }
  .cal-today { min-height: 44px; font-size: 14px; }

  /* timeline */
  .m-timeline { display: flex; flex-direction: column; gap: 12px; }
  .banner {
    align-self: flex-start; padding: 12px 20px; font-size: 12px; letter-spacing: 1px;
    white-space: normal; box-shadow: 0 12px 22px rgba(20,30,90,.4);
  }
  #axis { display: flex; justify-content: space-between; padding: 0 2px; }
  .axis-label { position: static; width: auto; font-size: 11px; }
  /* one continuous board: each city is a single unit, one hour marker across all of them */
  #rows { position: relative; display: flex; flex-direction: column; touch-action: pan-y; padding-top: 2px; }
  .row {
    display: block; height: auto; padding: 12px 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,.07);
  }
  .row:last-child { border-bottom: 0; }
  .row-head { display: flex; align-items: center; gap: 11px; }
  .row-name { font-size: 15px; }
  .row-zone { font-size: 11px; letter-spacing: .6px; color: #8d9ccd; }
  .row-x { width: 30px; height: 30px; font-size: 12px; background: transparent; color: #6f7fb4; }
  .avatar { width: 34px; height: 34px; font-size: 13px; }
  .track {
    position: relative; width: 100%; height: 14px; margin-top: 10px;
    border-radius: 999px; overflow: hidden; cursor: ew-resize;
    background:
      repeating-linear-gradient(to right, rgba(255,255,255,.14) 0 1px, transparent 1px calc(100% / 4)),
      rgba(255,255,255,.06);
  }
  .seg {
    top: 0; height: 100%; border-radius: 999px;
    background: linear-gradient(180deg, #fdf1e2, #f6dcc2);
  }
  .hour-line {
    position: absolute; top: 6px; bottom: 6px; width: 2px; margin-left: -1px;
    left: calc(14px + (100% - 28px) * var(--f, 0.5));
    background: linear-gradient(180deg, rgba(151,178,255,.25), #7f9bff 12%, #7f9bff 92%, rgba(151,178,255,.2));
    box-shadow: 0 0 14px rgba(90,130,255,.75); pointer-events: none; border-radius: 2px;
  }
  .hour-chip {
    position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
    padding: 3px 9px; border-radius: 999px; background: #7f9bff; color: #0d1a4a;
    font-size: 10px; font-weight: 700; letter-spacing: .6px; white-space: nowrap;
  }
  .band, .scrub, .row-pill { display: none; }
  .empty { width: auto; font-size: 14px; }
  #scrubHint { display: block; }
  .scrub-hint { font-size: 10.5px; letter-spacing: .5px; color: #7e8dc4; text-align: center; }

  /* pick an hour */
  .hourcard { width: 100%; padding: 20px 16px 22px; border-radius: 24px; }
  .hourcard-row { gap: 14px; margin-top: 6px; }
  .chev { min-width: 44px; min-height: 44px; font-size: 34px; }
  .hourcard-time { min-width: 0; flex: 1; font-size: 42px; }
  .zone-chip { min-height: 40px; font-size: 11.5px; }
  .popup--zone { left: 0; right: 0; bottom: 46px; margin: 0 auto; max-width: 320px; }
  .zone-list { max-height: 220px; }
  .verdict { margin-top: 10px; font-size: 14.5px; }

  /* saved lists */
  .lists { width: 100%; max-height: none; }
  .list-row { padding: 11px 0; }
  .list-badge { width: 42px; height: 42px; }
  .list-name { font-size: 14.5px; }
  .lists-actions { width: 100%; margin-top: 14px; }
  .newlist { min-height: 48px; font-size: 13.5px; }
  .name-row input { min-height: 48px; font-size: 14px; }
  .save { min-height: 48px; padding: 0 18px; font-size: 13.5px; }

  /* ---- artwork woven into the compact layouts ---- */
  .m-head { position: relative; isolation: isolate; padding: 36px 0 26px; }
  .m-head::before {
    content: ''; position: absolute; left: -20px; right: -20px; top: -1px; bottom: -56px; z-index: 0;
    background: url(assets/m-sky.png) center 34% / cover no-repeat, #101c46;
    border-radius: 0 0 46% 24% / 0 0 96px 58px;
  }
  #sky { z-index: 1; inset: 0 -20px auto; height: 280px; }
  .m-head::after {
    content: ''; position: absolute; z-index: 1; right: 0; top: 80px; width: 62px; height: 69px;
    background: url(assets/m-moon.png) center / contain no-repeat;
    filter: drop-shadow(0 10px 18px rgba(6,12,40,.55));
    animation: moonDrift 14s ease-in-out infinite;
  }
  @keyframes moonDrift { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-9px) rotate(-4deg); } }
  .headline { color: #fff; text-shadow: 0 2px 18px rgba(6,12,40,.5); }
  .lede { color: #d8e0f7; }

  .m-controls {
    position: relative; padding: 22px 18px 26px;
    background: url(assets/m-cream.png) center / cover, var(--cream-card);
    border-radius: 46px 22px 46px 22px;
    box-shadow: 0 24px 46px rgba(6,12,40,.46), inset 0 1px 0 rgba(255,255,255,.65);
  }
  .card { background: #faf4ea; box-shadow: 0 10px 20px rgba(58,40,26,.14); }
  .card--city { position: relative; }
  .card--city::after {
    content: ''; position: absolute; right: 18px; top: -16px; width: 40px; height: 40px;
    border-radius: 50%; background: url(assets/m-sphere.png) center / 150% auto;
    box-shadow: 0 8px 14px rgba(58,40,26,.32);
  }

  .m-timeline {
    position: relative; padding: 20px 16px 26px;
    background: linear-gradient(rgba(18,32,86,.34), rgba(18,32,86,.9) 48%), url(assets/m-map.png) center top / cover no-repeat, var(--navy-deep);
    border-radius: 42px 42px 54px 54px;
    box-shadow: 0 24px 46px rgba(6,12,40,.5);
  }
  #rows { background: rgba(11,20,56,.62); border-radius: 22px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); }
  #axis { padding: 0 14px; }

  .card--lists { background: url(assets/m-cream.png) center / cover, var(--cream-card); border-radius: 30px 30px 44px 44px; }
  .hourcard { box-shadow: 0 24px 46px rgba(20,30,90,.55), inset 0 1px 0 rgba(255,255,255,.28); }

  /* footer */
  .footer { position: relative; width: 100%; padding: 6px 0 30px; margin-top: -4px; border-top: 1px solid rgba(255,255,255,.10); }
  .footer-copy { width: auto; max-width: 52ch; font-size: 13px; }
  .footer-links { gap: 10px 14px; margin-top: 16px; font-size: 12.5px; }
  .footer-meta { white-space: normal; }
}

/* tablet: two-column controls, wider stage */
@media (min-width: 640px) and (max-width: 1023px) {
  .stage { max-width: 860px; padding: 0 32px 0; }
  .m-controls { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .card--city { grid-column: 1 / -1; }
  .card--weekend { grid-column: 1 / -1; }
  .headline { font-size: 44px; max-width: 18ch; }
  .lede { font-size: 16px; }
  .logo { width: 250px; height: 62px; }
  .m-brand::before { left: -42px; top: -104px; width: 386px; height: 226px; }
  .hourcard { align-self: center; max-width: 420px; }
  .card--lists { max-width: 520px; align-self: center; width: 100%; }
  .row { padding: 14px 18px 18px; }
  .track { height: 16px; }
  #axis { padding: 0 18px; }
  .hour-line { left: calc(18px + (100% - 36px) * var(--f, 0.5)); }
  .m-head::before { border-radius: 0 0 40% 26% / 0 0 120px 70px; bottom: -70px; }
  .m-head::after { width: 104px; height: 116px; right: 18px; top: 108px; }
  #sky { height: 340px; }
  .m-controls { padding: 26px 24px 30px; border-radius: 56px 26px 56px 26px; }
  .m-timeline { padding: 24px 22px 30px; border-radius: 52px 52px 64px 64px; }
  .footer::after {
    content: ''; position: absolute; left: -32px; right: -32px; bottom: 0; height: 96px;
    background: url(assets/m-footer.png) center / cover no-repeat; border-radius: 26px 26px 0 0;
  }
  .footer { padding-bottom: 108px; }
}

/* =========================================================
   TABLET LANDSCAPE (700–1023px wide, landscape, tall enough)
   Returns to the desktop artwork layout, scaled to the viewport.
   app.js mirrors this condition so it renders the desktop timeline.
   ========================================================= */
@media (min-width: 700px) and (max-width: 1023px) and (orientation: landscape) and (min-height: 560px) {
  html, body { overflow-x: hidden; }
  .viewport { overflow: hidden; max-width: none; }
  .stage {
    display: block; width: 1024px; height: 1536px; max-width: none;
    padding: 0; margin: 0 auto; gap: 0; transform-origin: top center;
  }
  .plate { display: block; }

  /* wrappers stop being cards and stop being positioning contexts */
  .m-head, .m-brand, .m-controls, .m-timeline, .card {
    position: static; display: block; padding: 0; margin: 0;
    background: none; box-shadow: none; border-radius: 0; max-width: none; isolation: auto;
  }
  .m-head::before, .m-head::after, .m-brand::before, .m-controls::before, .m-controls::after,
  .card--city::after, .footer::after { content: none; display: none; }
  #sky { position: absolute; inset: 0; height: auto; z-index: 0; }

  /* header */
  .logo { position: absolute; left: 64px; top: 72px; width: 292px; height: 73px; z-index: auto; }
  .support {
    position: absolute; right: 43px; left: auto; top: 38px; min-height: 0; padding: 10px 22px;
    font-size: 13px; border: 1.5px solid var(--orange);
  }
  .headline {
    position: absolute; left: 66px; top: 176px; width: 360px; max-width: none; margin: 0;
    font-size: 38px; line-height: 1.16; color: var(--navy); text-shadow: none;
  }
  .lede { position: absolute; left: 66px; top: 358px; width: 268px; max-width: none; margin: 0; font-size: 14px; color: #3a4778; }

  /* left controls back onto the painted plate */
  .label { position: absolute; display: block; margin: 0; font-size: 11.5px; white-space: nowrap; }
  .label--city { left: 84px; top: 556px; }
  .label--date { left: 84px; top: 758px; }
  .label--hours { left: 84px; top: 902px; }
  .label--display { left: 86px; top: 1068px; }
  .label--weekend { left: 86px; top: 1186px; }
  .label--lists { left: 762px; top: 1040px; font-size: 12px; }
  .field { position: absolute; display: block; }
  .field-inner {
    min-height: 0; background: none; border: 0; border-radius: 0; font-size: 12.5px;
  }
  .field--search { left: 47px; top: 602px; width: 188px; height: 44px; }
  .field--search .field-inner { padding: 0 13px; }
  .field--search input { font-size: 12.5px; }
  .field--date { left: 47px; top: 798px; width: 188px; height: 38px; }
  .field--date .field-inner { padding: 0 13px; }
  .hour-pair { display: block; }
  .field--start { left: 47px; top: 944px; width: 101px; height: 36px; }
  .field--end { left: 157px; top: 944px; width: 98px; height: 36px; }
  .field--start .field-inner, .field--end .field-inner { padding: 0 11px; }
  .icon-btn { min-width: 0; min-height: 0; font-size: 22px; }
  .field .icon { font-size: 19px; }
  .caret { font-size: 9px; }
  .linkish { position: absolute; left: 48px; top: 672px; min-height: 0; margin: 0; font-size: 12.5px; }
  .segmented { position: absolute; left: 42px; top: 1104px; width: 218px; height: 36px; gap: 4px; }
  .seg-btn { border: 0; border-radius: 10px; font-size: 12px; }
  .toggle { position: absolute; left: 254px; top: 1197px; width: 46px; height: 26px; border-radius: 13px; }
  .knob { width: 20px; height: 20px; }
  .toggle.is-on .knob { left: 23px; }

  /* popups back to their desktop sizes */
  .popup { width: auto !important; }
  .popup--wide { top: 50px; width: 258px !important; max-height: 232px; }
  .popup--hours { top: 40px; width: 118px !important; max-height: 176px; }
  .popup--cal { top: 44px; width: 258px !important; }
  .popup--zone { left: 50%; right: auto; bottom: 40px; width: 270px !important; max-width: none; margin: 0 0 0 -135px !important; }
  .opt { min-height: 0; padding: 9px 13px; font-size: 12.5px; }
  .opt--hour { padding: 8px 12px; font-size: 12.5px; }
  .cal-day { height: 29px; font-size: 13px; }
  .cal-dow { font-size: 13px; }
  .cal-nav { width: 26px; height: 26px; font-size: 18px; }
  .cal-nav--yr { width: 22px; font-size: 13px; }
  .cal-today { min-height: 0; font-size: 13px; }
  .zone-list { max-height: 186px; }

  /* timeline */
  .banner {
    position: absolute; left: 506px; top: 424px; align-self: auto; padding: 13px 26px;
    font-size: 13px; letter-spacing: 1.2px; white-space: nowrap; box-shadow: 0 14px 26px rgba(20,30,90,.45);
  }
  #axis { display: block; padding: 0; }
  .axis-label { position: absolute; top: 532px; width: 60px; font-size: 12px; }
  #rows { display: block; position: static; padding: 0; background: none; border-radius: 0; box-shadow: none; }
  .row { position: absolute; left: 264px; display: block; padding: 0; border-bottom: 0; }
  .row-pill { display: flex; }
  .avatar { width: 40px; height: 40px; font-size: 15px; }
  .row-name { font-size: 14px; }
  .row-zone { font-size: 10.5px; letter-spacing: .3px; color: #98a6d6; }
  .row-x { width: 22px; height: 22px; background: rgba(255,255,255,.10); color: #b6c2ea; }
  .track {
    position: absolute; left: 244px; top: 6px; width: 435px; margin: 0;
    border-radius: 8px; cursor: default; overflow: visible; background: rgba(20,33,80,.9);
  }
  .seg { top: 6px; border-radius: 6px; background: #fbe8d3; }
  .band, .scrub { display: block; }
  #scrubHint { display: none; }
  .empty { position: absolute; left: 300px; top: 660px; width: 360px; }

  /* pick an hour */
  .hourcard { position: absolute; left: 408px; top: 892px; width: 304px; max-width: none; padding: 15px 0 18px; border-radius: 22px; align-self: auto; }
  .hourcard-row { gap: 18px; margin-top: 4px; }
  .chev { min-width: 0; min-height: 0; font-size: 30px; }
  .hourcard-time { min-width: 158px; flex: none; font-size: 38px; }
  .zone-chip { min-height: 0; font-size: 11px; }
  .verdict { margin-top: 8px; font-size: 13.5px; }

  /* saved lists */
  .lists { position: absolute; left: 706px; top: 1074px; width: 264px; max-height: 208px; }
  .list-badge { width: 36px; height: 36px; }
  .list-name { font-size: 13.5px; }
  .list-row { padding: 9px 2px; }
  .lists-actions { position: absolute; left: 706px; top: 1292px; width: 264px; margin: 0; }
  .newlist { min-height: 0; font-size: 12.5px; }
  .name-row input { min-height: 0; font-size: 12.5px; }
  .save { min-height: 0; padding: 11px 15px; font-size: 12.5px; }

  /* footer */
  .footer {
    position: absolute; left: 172px; top: 1406px; width: 570px;
    padding: 0; margin: 0; border-top: 0;
  }
  .footer-copy { width: 400px; max-width: none; font-size: 12.5px; }
  .footer-links { gap: 6px 11px; margin-top: 12px; font-size: 11.5px; }
  .footer-meta { white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  .star, .shoot, .support, .m-head::after { animation: none; }
}
