/* timezoner — world-clock console.
   Night indigo base; amber encodes daylight/working hours. Serif is
   reserved for identity, mono for time figures, Inter for the UI. */

@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/static/fonts/newsreader-var.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/static/fonts/newsreader-var-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/static/fonts/plexmono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/static/fonts/plexmono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/static/fonts/plexmono-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --night: #12162a;
  --dusk: #1a2038;
  --panel: #1e2440;
  --line: #2e3757;
  --line-strong: #3d4870;
  --day: #f2b84b;
  --day-dim: #b98a2e;
  --dawn: #e07a3f;
  --slate: #55608a;
  --text: #e9e7dc;
  --dim: #9299b4;
  --danger: #e0653f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 10px 28px -14px rgba(0, 0, 0, 0.6);
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --serif: "Newsreader", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
}

a { color: var(--day); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 24px 72px; }

/* ── header ─────────────────────────────────────────── */
.top {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 26px 0 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}
.wordmark {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
}
.wordmark b { font-weight: 500; font-style: italic; color: var(--day); }
.top .spacer { flex: 1; }
.top form { margin: 0; }

/* ── panels ─────────────────────────────────────────── */
.panel {
  background: var(--dusk);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 24px 26px;
  margin-bottom: 24px;
}
.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
  margin: 0 0 16px;
}
.sub-note {
  font-size: 13px;
  color: var(--dim);
  margin: -10px 0 16px;
}

/* ── forms ──────────────────────────────────────────── */
input, select, button {
  font: inherit;
  color: var(--text);
  background: var(--night);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
input::placeholder { color: #5b6386; }
input[type="time"], input[type="date"] { font-family: var(--mono); font-size: 14px; }
input:hover, select:hover { border-color: var(--slate); }
input:focus-visible, select:focus-visible, button:focus-visible {
  outline: 2px solid var(--day);
  outline-offset: 1px;
}
button { cursor: pointer; background: var(--panel); font-weight: 500; }
button:hover { border-color: var(--slate); }
button.primary {
  background: var(--day);
  border-color: var(--day);
  color: #201a08;
  font-weight: 600;
}
button.primary:hover { background: #f6c76a; border-color: #f6c76a; }
button.quiet {
  background: none;
  border-color: transparent;
  color: var(--dim);
  padding: 5px 9px;
  border-radius: 7px;
}
button.quiet:hover { color: var(--text); background: rgba(233, 231, 220, 0.07); border-color: transparent; }
button.danger:hover { color: var(--danger); background: rgba(224, 101, 63, 0.12); }
.row-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--dim);
}
.flash {
  color: var(--danger);
  font-size: 14px;
  min-height: 1.2em;
  margin: 10px 0 0;
}

/* ── place search ───────────────────────────────────── */
.place-search { position: relative; }
.geo-results {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 20;
  min-width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 6px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.6);
}
.geo-results:empty { display: none; box-shadow: none; }
.geo-opt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0;
  margin-top: -1px;
  padding: 8px 12px;
}
.geo-opt:hover { background: var(--dusk); }
.geo-place { font-size: 14px; }
.geo-tz { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.geo-msg {
  font-size: 13px;
  color: var(--dim);
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 8px 12px;
  margin: 0;
}

/* ── login ──────────────────────────────────────────── */
.login-wrap {
  min-height: 80vh;
  display: grid;
  place-items: center;
}
.login {
  width: min(380px, 90vw);
  text-align: center;
  padding: 44px 36px;
  border-radius: 18px;
}
.login .wordmark { font-size: 34px; }
.login .tagline { color: var(--dim); font-size: 14px; margin: 8px 0 0; }
.login form { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; }

/* ── board list ─────────────────────────────────────── */
.board-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.board-list a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 16px 20px;
  background: var(--dusk);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.board-list a:hover {
  border-color: var(--slate);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.board-list .name { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.board-list .meta { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.board-list .spacer { flex: 1; }

/* ── timeline ───────────────────────────────────────── */
.tl { position: relative; }
.tl-grid { display: grid; grid-template-columns: 190px 1fr; row-gap: 10px; align-items: center; }
.tl-label { padding-right: 16px; min-width: 0; }
.tl-label .who { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-label .zone { font-family: var(--mono); font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-label .local {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--day);
}

.strip {
  position: relative;
  height: 36px;
  background: var(--night);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}
.strip .span {
  position: absolute;
  top: 5px;
  bottom: 5px;
  background: linear-gradient(180deg, var(--day), var(--day-dim));
  border-radius: 4px;
}
.strip .block {
  position: absolute;
  top: 5px;
  bottom: 5px;
  background: repeating-linear-gradient(
    -45deg,
    rgba(18, 22, 42, 0.65) 0 4px,
    rgba(18, 22, 42, 0.25) 4px 8px
  );
  border-radius: 4px;
}

/* hour scale — carries the sun: a thin sky band below the figures */
.scale {
  position: relative;
  height: 26px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
}
.scale::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3px;
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(90deg,
    var(--night) 0%, var(--night) 18%,
    #b96a2e 26%, #e8c364 34%,
    #f2dc8f 50%,
    #e8c364 66%, #b96a2e 76%,
    var(--night) 84%, var(--night) 100%);
}
.scale span { position: absolute; transform: translateX(-50%); }

/* heat bar */
.heat {
  position: relative;
  height: 16px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--night);
  border: 1px solid var(--line);
}
.heat .seg { position: absolute; top: -1px; bottom: -1px; }
.heat .seg.full { background: var(--day); }
.heat .seg.most { background: var(--dawn); }
.heat .seg.some { background: var(--slate); }
.heat-label { align-self: start; padding-top: 0; }

/* scrub line + now line: overlay only the strip column */
.tl-overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 190px;
  right: 0;
  pointer-events: none;
}
.scrub-line, .now-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-1px);
}
.scrub-line { background: var(--text); opacity: 0.85; }
.now-line { background: var(--dawn); opacity: 0.6; }

.scrub {
  display: grid;
  grid-template-columns: 190px 1fr;
  align-items: center;
  margin-top: 18px;
}
.scrub .t {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
input[type="range"] {
  width: 100%;
  padding: 0;
  background: none;
  border: none;
  accent-color: var(--day);
}

/* ── best windows ───────────────────────────────────── */
.windows { display: flex; flex-wrap: wrap; gap: 12px; }
.window {
  background: var(--night);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 18px;
  min-width: 190px;
}
.window .range { font-family: var(--mono); font-size: 17px; font-weight: 600; color: var(--day); }
.window .len { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.window .locals { margin-top: 10px; font-size: 12px; color: var(--dim); }
.window .locals div { display: flex; justify-content: space-between; gap: 12px; }
.window .locals .lt { font-family: var(--mono); }
.none-note { color: var(--dim); font-size: 14px; margin: 0; }

/* ── people editor ──────────────────────────────────── */
.people { list-style: none; margin: 0 0 20px; padding: 0; }
.people li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.people li:last-child { border-bottom: none; }
.people .who { font-weight: 600; }
.people .meta { font-family: var(--mono); font-size: 12px; color: var(--dim); flex: 1; }
.people details { width: 100%; }
.people summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  border-radius: 6px;
}
.people summary::-webkit-details-marker { display: none; }
.people .edit-form { padding: 14px 0 8px; }

/* board header controls */
.board-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 20px; }
.board-top h1 { font-family: var(--serif); font-size: 30px; font-weight: 600; letter-spacing: 0.005em; margin: 0; flex: 1; }
.board-top .spacer { flex: 1; }

@media (max-width: 640px) {
  .tl-grid, .scrub { grid-template-columns: 1fr; }
  .tl-overlay { left: 0; }
  .tl-label { padding: 6px 0 2px; display: flex; gap: 10px; align-items: baseline; }
  .board-top h1 { flex-basis: 100%; }
  .panel { padding: 18px; }
}

@media (prefers-reduced-motion: no-preference) {
  .scrub-line { transition: left 60ms linear; }
}
