/* 10:10 v2 (C4E). Warm paper, black ink, one yellow for the slot. Squares say who is at the desk. */

:root {
  --ground: #f2f0e9;
  --paper: #f7f5ef;
  --ink: #111111;
  --ink-2: #55534c;
  --hair: #d3cec1;
  --yellow: #f6b829;
  --yellow-2: #e3a514;
  --red: #c9412c;
  --beige: #e6dfcf;
  --grey: #888680;
  --dusk: #2b2a26;
  --on-dark: #f2f0e9;
  --on-dark-2: #b9b5a8;
  --lab: 120px;
  --sans: 'Montserrat', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 500 15px/1.45 var(--sans); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
::selection { background: var(--yellow); color: var(--ink); }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.top :focus-visible, .foot :focus-visible, .tile.home :focus-visible, .tile.dark :focus-visible { outline-color: var(--on-dark); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font: 500 11px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.hint { color: var(--ink-2); font-size: 13px; }
.error { color: var(--red); font-weight: 700; margin-top: 8px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 14px; border: 1px solid var(--ink); border-radius: 0; background: transparent; color: var(--ink); font-weight: 700; font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--beige); }
.btn.step { width: 32px; height: 32px; padding: 0; }
.btn.primary { background: var(--yellow); border-color: var(--yellow); height: 48px; font-size: 15px; }
.btn.primary:hover { background: var(--yellow-2); border-color: var(--yellow-2); }
.linkbtn { border: 0; padding: 0; background: none; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- top bar ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 16px; min-height: 56px; padding: 8px 24px; background: var(--ink); color: var(--on-dark); }
.brand { display: inline-block; padding: 3px 8px; border: 1px solid var(--on-dark); font-weight: 800; font-size: 15px; letter-spacing: .02em; text-decoration: none; }
.tools { display: flex; gap: 4px; margin-left: auto; }
.tool { padding: 6px 10px; border: 1px solid transparent; background: none; color: var(--on-dark); font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.tool:hover { border-color: var(--on-dark-2); }
.tool.on { border-color: var(--on-dark); }
.clock { display: flex; align-items: baseline; gap: 10px; margin-left: 12px; white-space: nowrap; }
.clock .mono { color: var(--on-dark-2); }
.clock time { font: 700 15px var(--mono); }

/* ---------- page ---------- */
.main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 48px 32px 72px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 44px; align-content: start; }

/* ---------- readout + slot panel ---------- */
.readout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 40px; align-items: center; }
.big { font: 800 clamp(88px, 14.5vw, 208px)/.88 var(--sans); letter-spacing: -.045em; margin-left: -.04em; }
.big small, .tile-time small { font-size: .3em; letter-spacing: 0; margin-left: .1em; }
.until { margin-top: 18px; font-size: 17px; font-weight: 600; color: var(--ink-2); }
.who { margin-top: 10px; max-width: 20em; font-size: 28px; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; text-wrap: balance; }

.slot-panel { border: 1px solid var(--ink); background: var(--paper); padding: 16px 18px 18px; }
.slot-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.slot-row.slim { min-height: 0; margin: -6px 0 4px; }
.slot-row.rule { border-top: 1px solid var(--hair); margin-top: 8px; padding-top: 8px; }
.slot-pick { border-top: 1px solid var(--hair); margin-top: 8px; padding-top: 14px; color: var(--ink-2); font-size: 14px; line-height: 1.45; }
.now-btn { height: 32px; margin-left: 14px; vertical-align: middle; font-size: 13px; }
.daynav { display: flex; }
.daynav .btn + .btn, .daynav .date + .btn { margin-left: -1px; }
.date { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 124px; height: 32px; margin-left: -1px; border: 1px solid var(--ink); font-size: 13px; font-weight: 700; cursor: pointer; }
.date input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.date input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.date:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.seg { display: flex; }
.seg button { width: 46px; height: 32px; margin-left: -1px; border: 1px solid var(--ink); background: transparent; font: 500 12px var(--mono); cursor: pointer; }
.seg button:hover { background: var(--beige); }
.seg button[aria-pressed='true'] { background: var(--yellow); font-weight: 700; }
.count { font: 700 22px var(--mono); }
.count.past { font-size: 15px; }
.slot-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 14px; }
.slot-actions .btn:not(.primary) { height: 48px; }
.slot-more { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; }
.slot-more a, .slot-more .linkbtn { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.slot-more a:hover, .slot-more .linkbtn:hover { color: var(--ink); }

/* ---------- the day strip ---------- */
.day-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 10px; }
.day-head h2 { font-weight: 700; white-space: nowrap; }
.day-head .hint { max-width: 62ch; text-align: right; font-size: 12.5px; }
.strip-box { border: 1px solid var(--ink); background: var(--paper); padding: 10px 16px 8px; }
.strip-scroll { overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; }
.strip { min-width: calc(var(--lab) + var(--cols) * 15px); user-select: none; -webkit-user-select: none; }
.flags, .axis { display: flex; }
.flags { height: 24px; }
.ticks { position: relative; flex: 1; }
.flag { position: absolute; bottom: 4px; left: calc((var(--a) + .5) * 100% / var(--cols) - 9px); display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; background: var(--ink); color: var(--paper); font: 700 11px var(--mono); }
button.flag { cursor: pointer; }
button.flag:hover { background: var(--yellow); color: var(--ink); }
.flag.inline { position: static; display: inline-grid; width: 16px; height: 16px; vertical-align: -3px; font-size: 10px; }
.rows { position: relative; cursor: pointer; padding: 3px 0; }
.rows.ro { cursor: default; }
.rows:focus-visible { outline-offset: 3px; }
.band-layer { position: absolute; inset: -6px 0 -6px var(--lab); pointer-events: none; }
.band { position: absolute; top: 0; bottom: 0; left: calc(var(--a) * 100% / var(--cols)); width: calc(var(--n) * 100% / var(--cols)); background: var(--yellow); }
.now { position: absolute; top: 0; bottom: 0; left: calc(var(--a) * 100% / var(--cols)); width: 2px; margin-left: -1px; background: var(--red); }
.srow { display: flex; align-items: stretch; height: 22px; }
.lab { position: sticky; left: 0; z-index: 2; flex: 0 0 var(--lab); width: var(--lab); padding-right: 10px; background: var(--paper); font-size: 12px; font-weight: 700; line-height: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track { position: relative; z-index: 1; flex: 1; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); }
.sq { display: grid; place-items: center; font-style: normal; }
.sq::before { content: ''; width: 70%; max-width: 14px; aspect-ratio: 1; box-sizing: border-box; }
.sq.on::before { background: var(--ink); }
.sq.half::before { background: var(--grey); }
.sq.off::before { border: 1px solid var(--grey); }
.sq.busy::before { outline: 2px solid var(--red); outline-offset: 1px; }
.sq.inline { display: inline-grid; width: 14px; height: 14px; vertical-align: -2px; }
.sq.inline::before { width: 10px; }
.srow.loading .sq::before { animation: pulse 1.1s ease-in-out infinite; }
.axis { height: 18px; margin-top: 6px; }
.axis .ticks span { position: absolute; left: calc(var(--a) * 100% / var(--cols)); font: 500 11px var(--mono); color: var(--ink-2); white-space: nowrap; }

/* ---------- city tiles ---------- */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tile { position: relative; display: flex; flex-direction: column; aspect-ratio: 1; min-width: 0; padding: 14px 14px 12px; border: 1px solid var(--ink); background: var(--paper); }
.tile.warm { background: var(--beige); }
.tile.home { background: var(--ink); color: var(--on-dark); }
.tile.dark { background: var(--dusk); border-color: var(--dusk); color: var(--on-dark); }
.tile.home .mono, .tile.dark .mono, .tile.home .tile-acts button, .tile.dark .tile-acts button { color: var(--on-dark-2); }
.tile-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.tile-top > div:first-child { min-width: 0; }
.tile h3 { margin-top: 3px; font-size: 19px; line-height: 1.15; font-weight: 800; overflow-wrap: break-word; }
.tile-acts { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.tile-acts button { padding: 3px 0; border: 0; background: none; color: var(--ink-2); cursor: pointer; }
.tile-acts button:hover { color: inherit; text-decoration: underline; }
.tile-time { margin: auto 0; font: 800 clamp(44px, 5.6vw, 72px)/1 var(--sans); letter-spacing: -.02em; }
.tile-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 6px 8px; }
.tile-foot p { white-space: nowrap; }
.badge { flex: none; padding: 3px 6px; border: 1px solid currentColor; font: 700 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.badge.night { background: var(--red); border-color: var(--red); color: #fff; }
.tile.add { justify-content: center; gap: 14px; }
.tile.add h3 { font-size: 22px; }

/* ---------- city search ---------- */
.search { position: relative; }
.search input { width: 100%; height: 42px; padding: 0 10px; border: 1px solid var(--ink); border-radius: 0; background: var(--ground); font-size: 14px; }
.search input::placeholder { color: var(--ink-2); opacity: 1; }
.search input:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.results { position: absolute; z-index: 20; top: 46px; left: 0; right: 0; margin: 0; padding: 4px; list-style: none; background: var(--paper); border: 1px solid var(--ink); max-height: 320px; overflow: auto; }
.results li { display: grid; padding: 7px 8px; cursor: pointer; }
.results li strong { font-size: 14px; }
.results li span { color: var(--ink-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results li.active { background: var(--yellow); }
.results li.active span { color: var(--ink); }
.results .empty { color: var(--ink-2); cursor: default; font-size: 13px; }

/* ---------- panels ---------- */
.panel { border: 1px solid var(--ink); background: var(--paper); padding: 20px; }
.panel h2 { font: 700 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 6px; }
.panel h2:not(:first-child) { margin-top: 22px; }
.panel .hint { margin-bottom: 10px; }
.panel .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fields { display: flex; flex-wrap: wrap; gap: 14px 20px; }
.fields label { display: grid; gap: 4px; font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.fields select { height: 40px; min-width: 130px; padding: 0 8px; border: 1px solid var(--ink); border-radius: 0; background: var(--ground); color: var(--ink); font: 600 14px var(--sans); letter-spacing: 0; text-transform: none; }
.copyrow { display: flex; gap: 8px; }
.copyrow input { flex: 1; min-width: 0; height: 40px; padding: 0 10px; border: 1px solid var(--ink); border-radius: 0; background: var(--ground); font: 13px var(--mono); }
.lists { list-style: none; margin: 0 0 12px; padding: 0; }
.lists li { display: flex; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--hair); }
.lists li span { flex: 1; min-width: 0; color: var(--ink-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lists .linkbtn { font-weight: 700; }
.ico { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 1px solid transparent; background: none; color: var(--ink-2); cursor: pointer; }
.ico:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- footer, toast, loading ---------- */
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding: 18px 24px; background: var(--ink); color: var(--on-dark-2); }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--on-dark); }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 30; transform: translateX(-50%); padding: 10px 16px; background: var(--ink); color: var(--on-dark); font: 500 13px var(--mono); }
.skel, .skeleton-line { background: #e4e0d4; animation: pulse 1.1s ease-in-out infinite; }
.skel-head { height: 240px; }
.skel-strip { height: 170px; }
.skel-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.skel-tiles .skel { aspect-ratio: 1; }
.skeleton-line { height: 36px; margin: 4px; cursor: default !important; }
@keyframes pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* ---------- narrower screens ---------- */
@media (max-width: 1100px) {
  .tiles, .skel-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile-time { font-size: clamp(44px, 7vw, 72px); }
}
@media (max-width: 900px) {
  .readout { grid-template-columns: 1fr; gap: 28px; }
  .slot-panel { max-width: 520px; }
  .day-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .day-head .hint { text-align: left; }
}
@media (max-width: 640px) {
  :root { --lab: 84px; }
  .top { padding: 8px 16px; gap: 8px; }
  .tool { padding: 6px; }
  .clock { margin-left: 4px; }
  .clock .mono { display: none; }
  .main { padding: 28px 16px 56px; gap: 36px; }
  .who { font-size: 23px; }
  .until { font-size: 15px; margin-top: 14px; }
  .slot-panel { padding: 12px 14px 14px; }
  .seg button { width: 42px; }
  .date { width: 112px; }
  .strip-box { padding: 8px 10px 6px; }
  .tiles, .skel-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 10px; }
  .tile h3 { font-size: 15px; }
  .tile-top { flex-direction: column; gap: 4px; }
  .tile-acts { flex-direction: row; gap: 12px; }
  .tile .mono { letter-spacing: .04em; }
  .tile-time { font-size: 40px; }
  .tile .badge { font-size: 10px; padding: 2px 4px; }
  .tile.add h3 { font-size: 17px; }
  .foot { padding: 16px; }
}

/* ---------- extension popup + embed ---------- */
html.compact:not(.embed) body { width: 780px; }
.embed body { background: transparent; }
.embed-box { background: var(--ground); padding: 12px; }
.embed .strip-box { padding: 8px 12px 6px; }
.embed .tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.embed .tile { aspect-ratio: auto; padding: 10px; }
.embed .tile h3 { font-size: 15px; }
.embed .tile-time { margin: 12px 0; font-size: 34px; }
.embed-credit { display: inline-block; margin-top: 8px; color: var(--ink-2); }

/* Reading pages (terms, privacy, city-pair pages): the app's paper and ink, black bar on top. */
.legal-bar { padding: 14px max(16px, calc((100% - 720px) / 2 + 16px)); background: var(--ink); }
.legal-bar .brand { color: var(--on-dark); }
.legal { max-width: 720px; margin: 0 auto; padding: 0 16px 64px; }
.legal h1 { font-size: 40px; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; margin: 40px 0 14px; }
.legal h2 { font-size: 18px; font-weight: 800; margin: 30px 0 6px; }
.legal p, .legal li { max-width: 66ch; }
.legal p + p { margin-top: 10px; }
.legal .draft { border: 1px solid var(--red); color: var(--red); font-weight: 700; padding: 10px 14px; font-size: 14px; margin-bottom: 12px; }
.legal .foot { background: none; color: var(--ink-2); padding: 18px 0; margin-top: 44px; border-top: 1px solid var(--ink); justify-content: flex-start; font-size: 13px; }
table{border-collapse:collapse;width:100%;max-width:520px;margin-top:10px;font:500 14px var(--mono)}td,th{text-align:left;padding:6px 10px;border-bottom:1px solid var(--hair)}th{font:700 11px var(--mono);text-transform:uppercase;letter-spacing:.1em;color:var(--ink-2);border-bottom-color:var(--ink)}tr.work td{background:var(--beige);font-weight:700}.pairs{columns:3 200px;padding:0;list-style:none}.pairs li{padding:2px 0}.cta{display:inline-flex;align-items:center;height:48px;margin:18px 0 6px;padding:0 18px;background:var(--yellow);color:var(--ink);font-weight:700;text-decoration:none}.cta:hover{background:var(--yellow-2)}