/* The ColdBot portal: base, top bar, reel cards. One look on every device: ColdBot's own (brands/coldbot
   "How it looks"): navy #102838, green #1E9C6A, cream #EFE9D7, muted #8FA3B0, Inter. The other shades are
   tints of those. Every text colour reads at 4.5:1 or more on its background (portal/test/brand.test.js);
   green text uses the lighter --accent-text, because the brand green on navy is 4.35:1. Inter: SIL OFL 1.1
   (fonts/OFL.txt). */
@font-face {
  font-family: Inter; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/inter-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: Inter; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/fonts/inter-latin-600-normal.woff2") format("woff2");
}
:root {
  --bg: #102838; --surface: #163447; --surface2: #1C3D52; --hover: #24485F; --fg: #EFE9D7; --muted: #C3CDD3;
  --faint: #8FA3B0; --line: #2E4D61; --accent: #1E9C6A; --accent-text: #4CC895; --on-accent: #06141D;
  --accent-soft: #17483F; --on-soft: #CFF3E2; --warn-bg: #4B3000; --warn-fg: #FFC58C; --info-bg: #1C3D52;
  --ok: #6ECDA8; --ok-bg: #173A2D; --late: #FF8A80; --late-bg: #4A1B17; --today: #FFD27A; --today-bg: #3F3212;
  --must-bg: #5A4600; --must-fg: #FFE9A6; --toast: #EFE9D7; --on-toast: #102838; --yt-play: #163447;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--fg); min-height: 100vh;
  font: 14px/1.45 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.noscroll { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: var(--accent-text); }
h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; color: var(--muted); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ic { width: 20px; height: 20px; flex: none; display: inline-block; fill: currentColor; }
.ic.small { width: 16px; height: 16px; }
.ic.big { width: 40px; height: 40px; color: var(--faint); }
.yt-play { fill: var(--yt-play); }

/* top bar */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  min-height: 64px; padding: 8px 16px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { display: block; height: 22px; width: auto; padding-right: 12px; border-right: 1px solid var(--line); box-sizing: content-box; }
.brand-name { font-size: 16px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-select, .search {
  height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface);
}
.search { width: min(280px, 100%); }
.tabs { display: flex; gap: 4px; }
.tab {
  padding: 8px 14px; border-radius: 18px; color: var(--muted); text-decoration: none; font-weight: 500;
}
.tab:hover { background: var(--hover); }
.tab[aria-current="page"] { background: var(--accent-soft); color: var(--on-soft); }
.top-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; min-width: 0; }
.me { color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 18px;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg); text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--hover); }
.btn.filled { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.icon-btn {
  width: 40px; height: 40px; padding: 10px; border: 0; border-radius: 50%; background: transparent; color: var(--muted);
  display: inline-grid; place-items: center; flex: none;
}
.icon-btn:hover { background: var(--hover); }

/* main area */
.main { max-width: 1280px; margin: 0 auto; padding: 16px 16px 64px; }
.main-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin: 8px 0 16px; }
.help { margin: 0; color: var(--faint); }
.loading, .empty { color: var(--faint); padding: 32px 0; text-align: center; }
.sect { margin: 24px 0; }
.sect-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.sect-sub { color: var(--faint); }

/* reel cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.card {
  display: flex; flex-direction: column; text-align: left; padding: 0; overflow: hidden; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg);
}
.card:hover { box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.thumb { position: relative; display: block; aspect-ratio: 9 / 12; background: var(--surface2); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-empty { display: grid; place-items: center; height: 100%; }
.dur {
  position: absolute; right: 8px; bottom: 8px; padding: 1px 6px; border-radius: 4px; background: rgba(0, 0, 0, .7);
  color: #FFFFFF; font-size: 12px;
}
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 12px; min-width: 0; }
.card-name { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-when { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.chips { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.chip {
  display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 4px; border-radius: 50%;
  background: var(--surface2); color: var(--faint);
}
.chip.st-posted { background: var(--ok-bg); color: var(--ok); }
.chip.st-late, .chip.st-problem { background: var(--late-bg); color: var(--late); }
.chip.st-today, .chip.st-draft { background: var(--today-bg); color: var(--today); }
.chip.st-auto { background: var(--accent-soft); color: var(--on-soft); }
.chip.st-rehearsal { background: var(--surface2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600;
}
.badge.warn { background: var(--warn-bg); color: var(--warn-fg); }
.badge.must { background: var(--must-bg); color: var(--must-fg); }

/* folders on the reels screen */
.folders { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.folder {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 18px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); text-decoration: none; font-weight: 500; white-space: nowrap;
}
.folder:hover { background: var(--hover); }
.folder[aria-current="page"] { background: var(--accent-soft); color: var(--on-soft); border-color: transparent; }
.folder-n { min-width: 22px; padding: 0 6px; border-radius: 10px; background: var(--surface2); font-size: 12px; text-align: center; }
.folder[aria-current="page"] .folder-n { background: var(--surface); color: var(--fg); }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 80; transform: translate(-50%, 120px); max-width: calc(100% - 32px);
  padding: 12px 18px; border-radius: 8px; background: var(--toast); color: var(--on-toast); transition: transform .2s;
}
.toast.show { transform: translate(-50%, 0); }

/* login and change-password pages */
.logout { display: contents; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.login-page { display: grid; place-items: start center; padding: 48px 16px; }
.login-card {
  width: min(400px, 100%); padding: 24px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
}
.login-card h1 { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.login-card .help { margin: 12px 0 0; }
/* The login page is the simplest one: the wordmark, two fields, a green button with dark ink (5.3:1; white on
   that green is only 3.5:1) and two lines, centred on the navy. */
.login-page:has(.login-card.simple) { align-content: center; }
.login-card.simple { border: 0; padding: 0 0 48px; background: none; text-align: center; }
.login-mark { display: block; width: min(220px, 70%); height: auto; margin: 0 auto 32px; }
.login-card.simple .login-form input { text-align: left; }
.login-form input::placeholder { color: var(--faint); opacity: 1; }
.login-form .btn.filled { font-weight: 600; }
.login-form { display: flex; flex-direction: column; gap: 6px; }
.login-form label { margin-top: 8px; font-weight: 500; }
.login-form input {
  height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); font-size: 16px;
}
.login-form .btn { justify-content: center; height: 40px; margin-top: 12px; }
.login-error { margin: 8px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--late-bg); color: var(--late); }
.login-done { margin: 8px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--ok-bg); color: var(--ok); }

@media (max-width: 720px) {
  .login-page { padding: 24px 16px; }
  .top { gap: 8px; padding: 8px 16px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; }
  .me { display: none; }
  .search { width: 100%; }
  .top-actions { flex-wrap: wrap; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .folders { gap: 6px; }
  .folder { height: 32px; padding: 0 10px; }
}
