/* Keklik Studio HQ: the approved mocks (night-shift navy, amber Big Shoulders signage,
   Geist text, Keklik orange only for what needs Shehriar). Night is the default; .day
   swaps the palette. Motion stops under prefers-reduced-motion. */

.hq {
  --sky: #0a1424; --sky2: #0d1a2e; --sky3: #112038; --city: #14233b; --cityw: #f2d49b;
  --ground: #1b2942; --earth: #0b1220; --wall: #1b2942; --rail: #2b3d5c; --room: #0e1727;
  --lit: #152339; --ink: #e8eef6; --dim: #9db2cc; --faint: #7d93b0; --sign: #f2a33a;
  --plaque: #0a101b; --desk: #2e4163; --chair: #3a4f75; --screen: #07131f; --cone: #ffd27a;
  --panel: #0f1828; --panel2: #132036; --line: #24324a; --bg: #0a101b; --win: #0a1424;
  --pot: #2e4163; --paper: #e8eef6; --swall: #152339; --swall2: #111d30; --floor: #1b2942;
  --rug: #22304b; --cork: #6b4f36; --glass: #1d3354; --link: #f2805a; --link-hover: #ffb08f;
  --ok: #59e3a0; --warn: #f2a33a; --hot: #c8481e; --hot-text: #f2805a; --input: #0b1424;
  color-scheme: dark;
}
.hq.day {
  --sky: #cfe6f5; --sky2: #c2def1; --sky3: #b5d6ee; --city: #a7bfd6; --cityw: #ffffff;
  --ground: #8d9fb6; --earth: #7b8da6; --wall: #6f84a3; --rail: #8ea2bd; --room: #e3eaf2;
  --lit: #edf2f8; --ink: #0f1828; --dim: #3f5370; --faint: #4f6380; --sign: #c8481e;
  --plaque: #f6f8fb; --desk: #3a4d70; --chair: #4a5f85; --screen: #0f1828; --cone: transparent;
  --panel: #ffffff; --panel2: #f4f7fb; --line: #d3dce8; --bg: #eef2f7; --win: #cfe6f5;
  --pot: #3a4d70; --paper: #ffffff; --swall: #e9eff6; --swall2: #dfe7f1; --floor: #c3cfdd;
  --rug: #b3c1d3; --cork: #9a7a58; --glass: #d6e6f3; --link: #b8461f; --link-hover: #8f3415;
  --ok: #1f9463; --warn: #b26a00; --hot-text: #b8461f; --input: #ffffff;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html.hq, .hq body { margin: 0; background: var(--bg); color: var(--ink); font-family: Geist, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.45; }
.hq body { min-height: 100vh; display: flex; flex-direction: column; }
.hq a { color: var(--link); }
.hq a:hover { color: var(--link-hover); }
.disp { font-family: "Big Shoulders Display", sans-serif; font-weight: 800; letter-spacing: 1.5px; }
.mono { font-family: "Geist Mono", ui-monospace, Menlo, monospace; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 10; background: var(--panel); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* Header ------------------------------------------------------------------ */
.top { height: 60px; flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; padding: 0 28px; border-bottom: 1px solid var(--line); background: var(--panel); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand .k { color: var(--ink); flex: none; }
.brand .word { font-size: 24px; color: var(--sign); }
.brand .hq-word { font-size: 20px; color: var(--ink); white-space: nowrap; }
.crumbs { font-size: 12px; color: var(--dim); margin-left: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tabs { display: flex; gap: 6px; }
.tab { font: 500 13px Geist, sans-serif; padding: 7px 14px; border-radius: 8px; color: var(--dim) !important; text-decoration: none; border: 1px solid transparent; white-space: nowrap; }
.tab.on { background: var(--lit); color: var(--ink) !important; border-color: var(--line); }
.tab:hover { color: var(--ink) !important; }
.top-right { display: flex; align-items: center; gap: 14px; justify-content: flex-end; min-width: 0; }
.needs-badge { font: 500 12px "Geist Mono", monospace; background: var(--hot); color: #fff !important; padding: 5px 10px; border-radius: 99px; text-decoration: none; white-space: nowrap; }
.clock { font-size: 12px; color: var(--dim); white-space: nowrap; }
.clock b { font-weight: 400; color: var(--ok); }
.switch { display: flex; gap: 6px; }
.pbtn { font: 500 12px Geist, sans-serif; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; }
.pbtn[aria-pressed="true"] { background: var(--hot); border-color: var(--hot); color: #fff; }
.who-menu { font-size: 12px; white-space: nowrap; }
.linkbtn { font: inherit; background: none; border: 0; padding: 0; color: var(--dim); cursor: pointer; }
.linkbtn:hover { color: var(--ink); }

/* Rail: the menu down the left, folded to icons until the top button opens it --- */
.rail { position: fixed; z-index: 20; inset: 0 auto 0 0; width: 56px; display: flex; flex-direction: column; gap: 8px; padding: 10px 7px; background: var(--panel); border-right: 1px solid var(--line); overflow: hidden; transition: width .18s ease, box-shadow .18s ease; }
.rail[data-open="true"] { width: 248px; overflow-y: auto; box-shadow: 0 0 0 100vmax rgba(4, 9, 17, .5); }
.shell { margin-left: 56px; flex: 1; display: flex; flex-direction: column; min-width: 0; }
.rail form { margin: 0; }
.hq .rail-toggle, .hq .rail-item { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; height: 40px; flex: none; padding: 0 10px; border: 1px solid transparent; border-radius: 9px; background: none; color: var(--dim); font: 500 13px Geist, sans-serif; text-align: left; text-decoration: none; white-space: nowrap; cursor: pointer; }
.hq .rail-toggle:hover, .hq .rail-item:hover { color: var(--ink); background: var(--lit); }
.hq .rail-item.on { color: var(--ink); background: var(--lit); border-color: var(--line); }
.hq .rail-item.needs { color: var(--hot-text); }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rail .label { opacity: 0; transition: opacity .12s; }
.rail[data-open="true"] .label { opacity: 1; }
.rail .open-only, .rail[data-open="true"] .closed-only { display: none; }
.rail[data-open="true"] .open-only { display: block; }
.hq .rail-brand { display: flex; align-items: center; gap: 16px; height: 44px; flex: none; padding: 0 14px; color: var(--ink); text-decoration: none; }
.rail-brand .k { flex: none; }
.rail-brand .label { font-size: 21px; white-space: nowrap; }
.rail-brand .word { color: var(--sign); }
.rail-group { display: flex; flex-direction: column; gap: 4px; padding-top: 8px; border-top: 1px solid var(--line); }
.rail-end { margin-top: auto; }
.rail-count { position: absolute; left: 22px; top: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--hot); color: #fff; font: 600 10px/17px "Geist Mono", monospace; text-align: center; }
.rail-clock { display: flex; justify-content: center; gap: 8px; height: 22px; align-items: center; font-size: 11px; color: var(--dim); white-space: nowrap; }
.rail-clock b { font-weight: 400; color: var(--ok); }
.rail:not([data-open="true"]) .rail-clock .label { display: none; }
.rail[data-open="true"] .rail-clock { justify-content: flex-start; padding: 0 11px; }
.day .rail .night-ico, .hq:not(.day) .rail .day-ico { display: none; }
.rail-who { padding: 0 11px 4px; font-size: 11px; color: var(--faint); white-space: nowrap; }
.rail:not([data-open="true"]) .rail-who { display: none; }
.crumb-bar { padding: 16px 24px 0; }
.crumb-bar:empty { display: none; }
.trail { display: flex; align-items: center; gap: 14px; min-width: 0; }
.hq .trail .back { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 6px 13px 6px 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--ink); font: 500 13px Geist, sans-serif; text-decoration: none; }
.hq .trail .back:hover { background: var(--lit); color: var(--ink); }
.trail .back .ico { width: 16px; height: 16px; }
.trail .path { display: flex; align-items: center; gap: 8px; min-width: 0; font: 12px "Geist Mono", monospace; color: var(--dim); white-space: nowrap; overflow: hidden; }
.hq .trail .path a { color: var(--dim); text-decoration: none; }
.hq .trail .path a:hover { color: var(--ink); text-decoration: underline; }
.trail .path [aria-current] { color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.trail .sep { color: var(--faint); }
@media (max-width: 760px) { .crumb-bar { padding: 12px 16px 0; } .trail .path { display: none; } }
@media (max-width: 760px) {
  .rail { inset: 0 0 auto 0; width: auto; height: 52px; flex-direction: row; align-items: center; padding: 6px 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail .rail-group { flex-direction: row; padding-top: 0; border-top: 0; }
  .rail .rail-end, .rail .label { display: none; }
  .hq .rail .rail-toggle, .hq .rail .rail-item { width: 40px; }
  .rail .rail-brand { padding: 0 10px; }
  .rail[data-open="true"] { bottom: 0; right: auto; width: min(280px, 100%); height: auto; flex-direction: column; align-items: stretch; }
  .rail[data-open="true"] .rail-group { flex-direction: column; padding-top: 8px; border-top: 1px solid var(--line); }
  .rail[data-open="true"] .rail-end { display: flex; }
  .rail[data-open="true"] .label { display: inline; }
  .hq .rail[data-open="true"] .rail-toggle, .hq .rail[data-open="true"] .rail-item { width: 100%; }
  .shell { margin-left: 0; padding-top: 52px; }
}

/* Page ---------------------------------------------------------------------- */
.page { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.wrap { padding: 18px 24px 22px; }
.notices { padding: 12px 24px 0; display: flex; flex-direction: column; gap: 6px; }
.notice { margin: 0; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); font-size: 13px; }
.notice.error { border-color: var(--hot); color: var(--hot-text); }
.notice.success { border-color: var(--ok); }
.foot { padding: 0 24px 18px; font-size: 11px; color: var(--faint); text-align: center; }

.grid { display: grid; gap: 18px; min-width: 0; }
.desk-grid { grid-template-columns: minmax(300px, 400px) minmax(0, 1fr) minmax(260px, 330px); }
.office-grid { grid-template-columns: 1.35fr 1fr 0.9fr; }
.room-grid { grid-template-columns: 1.25fr 1fr 0.95fr; }
.two-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
@media (max-width: 1180px) {
  .desk-grid, .office-grid, .room-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .desk-grid > :nth-child(2) { grid-column: 1 / -1; order: 3; }
}
@media (max-width: 760px) {
  .desk-grid, .office-grid, .room-grid, .two-grid { grid-template-columns: minmax(0, 1fr); }
  .top { grid-template-columns: minmax(0, 1fr) auto; height: auto; padding: 10px 16px; }
  .tabs { grid-column: 1 / -1; order: 3; overflow-x: auto; }
  .wrap { padding: 14px 16px; }
}

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.card.tall { padding: 16px 20px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; min-width: 0; }
.card-head h2, .card-head h1 { margin: 0; font-size: 20px; }
.card h2.small, .card-head h2.small { font-size: 18px; }
.count { font-size: 11px; color: var(--dim); white-space: nowrap; }
.count.hot { color: var(--hot-text); }
.empty { margin: 0; font-size: 13px; color: var(--dim); line-height: 1.5; }
.sub { margin: 0 0 6px; font-size: 11px; color: var(--faint); font-weight: 500; letter-spacing: .3px; }
.dim { color: var(--dim); }
.faint { color: var(--faint); }
.p { margin: 0; font-size: 13.5px; line-height: 1.5; }
.small { font-size: 12px; }
.meta { margin: 0; font-size: 11px; color: var(--dim); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font: 500 11px "Geist Mono", monospace; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--dim); white-space: nowrap; text-decoration: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip.hot { border-color: var(--hot); color: var(--hot-text); }
a.chip:hover, a.chip[aria-current="true"] { border-color: var(--link); color: var(--ink); }

.act, .ghost { font: 500 12.5px Geist, sans-serif; padding: 7px 14px; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; white-space: nowrap; line-height: 1.2; }
.act { border: 1px solid var(--hot); background: var(--hot); color: #fff !important; }
.act:hover { background: #b23f1a; }
.ghost { border: 1px solid var(--line); background: transparent; color: var(--ink) !important; }
.ghost:hover { border-color: var(--link); }
.btns { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.btns form { margin: 0; }

.dot { width: 8px; height: 8px; border-radius: 99px; flex: none; display: inline-block; }
.lamp { width: 10px; height: 10px; border-radius: 99px; flex: none; }
.lamp.on { background: #ffd27a; }
.lamp.off { background: var(--line); }
.who { display: inline-flex; align-items: center; gap: 6px; font: 500 11px "Geist Mono", monospace; padding: 3px 8px; border-radius: 99px; border: 1px solid var(--line); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.ln { margin: 0; font-size: 13px; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* Decisions ----------------------------------------------------------------- */
.decision { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.decision:first-of-type { padding-top: 0; }
.decision:last-child { border-bottom: 0; padding-bottom: 0; }
.decision .title { margin: 2px 0 0; font-size: 14.5px; font-weight: 500; overflow-wrap: anywhere; }
.decision .title a { color: var(--ink); text-decoration: none; }
.decision .title a:hover { color: var(--link); }
.decision .why { margin: 0; font-size: 13px; line-height: 1.5; color: var(--dim); overflow-wrap: anywhere; }
.decision .from { display: flex; gap: 8px; align-items: center; font-size: 11px; color: var(--dim); min-width: 0; }

/* Lists of to-dos ----------------------------------------------------------- */
.items { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.items:last-child { margin-bottom: 0; }
.item { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; align-items: baseline; min-width: 0; }
.item > :first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item > :last-child { flex: none; font-size: 11px; }
.item a { color: var(--ink); text-decoration: none; }
.item a:hover { color: var(--link); }
.st-doing, .st-working { color: var(--ok); }
.st-waiting, .st-overdue { color: var(--hot-text); }
.st-quiet { color: var(--faint); }
.star { color: var(--sign); }

/* Rooms on the desk view ---------------------------------------------------- */
.rooms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1320px) { .rooms { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.room-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; text-decoration: none; color: inherit !important; }
.room-card:hover { border-color: var(--hot); }
.room-card .name { font-size: 16px; color: var(--sign); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.room-card .fl { margin-left: auto; font-size: 10.5px; color: var(--faint); flex: none; }
.room-card .row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.room-card .nums { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--dim); }
.room-card .nums span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat b { display: block; font: 400 18px "Geist Mono", monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat span { font-size: 12px; color: var(--dim); }
.spark { display: flex; align-items: flex-end; gap: 4px; height: 40px; margin-top: 4px; }
.spark span { flex: 1; background: #2b5a8a; border-radius: 2px; min-height: 2px; }
.spark span:last-child { background: #3a7fc0; }
.lights { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.lights li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lights li .clip { flex: 1; }
.lights li .mono { margin-left: auto; font-size: 11px; color: var(--dim); flex: none; }
.ok-dot { background: var(--ok); }
.warn-dot { background: var(--warn); }
.down-dot { background: var(--hot); }
.idle-dot { background: var(--faint); }

/* Tables -------------------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.table th { text-align: left; font: 500 11px "Geist Mono", monospace; color: var(--faint); padding: 0 8px 8px 0; border-bottom: 1px solid var(--line); }
.table td { padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; overflow: hidden; text-overflow: ellipsis; }
.table tr:last-child td { border-bottom: 0; }
.table td a { color: var(--ink); text-decoration: none; }
.table td a:hover { color: var(--link); }
.table .nowrap { white-space: nowrap; }

/* Forms --------------------------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: 12px; }
.form p { margin: 0; display: flex; flex-direction: column; gap: 5px; }
.form label, .field-label { font-size: 12px; color: var(--dim); font-weight: 500; }
.hq input:not([type=checkbox]):not([type=radio]):not([type=hidden]), .hq textarea, .hq select {
  font: 14px Geist, sans-serif; color: var(--ink); background: var(--input); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0;
}
.hq textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
.hq input:focus, .hq textarea:focus, .hq select:focus { outline: 2px solid var(--link); outline-offset: 0; border-color: transparent; }
.form .row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form .row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.form .help { font-size: 11.5px; color: var(--faint); }
.errorlist { margin: 0; padding: 0; list-style: none; color: var(--hot-text); font-size: 12px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.inline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline input, .inline select { width: auto !important; }

/* Guidance (markdown) ------------------------------------------------------- */
.md { font-size: 13px; line-height: 1.55; color: var(--ink); overflow-wrap: anywhere; }
.md h1, .md h2, .md h3 { font: 600 12px "Geist Mono", monospace; letter-spacing: .3px; color: var(--faint); text-transform: uppercase; margin: 12px 0 4px; }
.md > :first-child { margin-top: 0; }
.md p, .md ul, .md ol { margin: 0 0 8px; }
.md ul, .md ol { padding-left: 18px; }
.md code { font: 12px "Geist Mono", monospace; background: var(--panel2); padding: 1px 4px; border-radius: 4px; }
details.fold > summary { cursor: pointer; list-style: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: " +"; color: var(--faint); font-family: "Geist Mono", monospace; font-size: 12px; }
details.fold[open] > summary::after { content: " –"; }

/* Activity ------------------------------------------------------------------ */
.log { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.log li { display: grid; grid-template-columns: 104px 104px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; align-items: baseline; }
.log li:last-child { border-bottom: 0; }
.log time, .log .actor { font: 11px "Geist Mono", monospace; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log .actor.claude { color: var(--ok); }
.log .what { overflow-wrap: anywhere; }
.log.compact li { grid-template-columns: 90px minmax(0, 1fr); }

/* Scenes (inline SVG) ------------------------------------------------------- */
.scene { display: block; width: 100%; height: auto; }
/* The building fills the window; hq.js widens the view so the city runs to both edges. */
.fit { height: 100vh; height: 100dvh; overflow: hidden; }
.fit .shell { min-height: 0; height: 100%; }
.building-wrap { flex: 1; position: relative; min-height: 0; background: var(--sky); }
.building-wrap svg { position: absolute; inset: 0; width: 100%; height: 100%; }
@media (max-aspect-ratio: 3/2) {
  .fit { height: auto; overflow: visible; }
  .building-wrap { flex: none; }
  .building-wrap svg { position: static; height: auto; }
}
.scene-strip { background: var(--swall); border-bottom: 1px solid var(--line); }
.scene-strip svg { max-width: 1440px; margin: 0 auto; }
.scene text { font-family: "Geist Mono", monospace; }
.scene .disp { font-family: "Big Shoulders Display", sans-serif; }
.room-link { cursor: pointer; }
.room-link:hover .roomfill, .room-link:focus-visible .roomfill { stroke: #f2805a; stroke-width: 3; }
.room-link:focus { outline: none; }
.night-only { transition: opacity .6s; }
.day .night-only { opacity: 0; }
.day-only { opacity: 0; transition: opacity .6s; }
.day .day-only { opacity: 1; }
.day .cone { display: none; }

.cone { opacity: .13; animation: cone 7s ease-in-out infinite; }
.cone.f { animation: flick 5.3s steps(1) infinite; }
@keyframes cone { 0%, 100% { opacity: .11; } 50% { opacity: .18; } }
@keyframes flick { 0%, 100% { opacity: .14; } 61% { opacity: .04; } 63% { opacity: .15; } 65% { opacity: .06; } 67% { opacity: .14; } }
.twinkle { animation: tw 3.2s ease-in-out infinite; }
@keyframes tw { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
.blink { animation: blink 1.4s steps(2) infinite; }
.led { animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .15; } }
.code { animation: scroll 6s linear infinite; }
@keyframes scroll { from { transform: translateY(0); } to { transform: translateY(-36px); } }
.type { animation: type .6s ease-in-out infinite alternate; }
@keyframes type { to { transform: translateY(1.5px); } }
.pulse { animation: pulse 1.9s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .6; transform: scale(1.06); } }
.dot.pulse { animation-name: dotpulse; }
@keyframes dotpulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.steam { animation: steam 3s ease-out infinite; transform-box: fill-box; }
@keyframes steam { 0% { opacity: 0; transform: translateY(4px); } 40% { opacity: .7; } 100% { opacity: 0; transform: translateY(-12px); } }
.cloud { animation: cloud 160s linear infinite; }
@keyframes cloud { from { transform: translateX(-1100px); } to { transform: translateX(2500px); } }
.lift { animation: lift 36s ease-in-out infinite; }
@keyframes lift { 0%, 10% { transform: translateY(0); } 16%, 26% { transform: translateY(122px); } 32%, 42% { transform: translateY(244px); } 48%, 58% { transform: translateY(366px); } 64%, 74% { transform: translateY(488px); } 80%, 88% { transform: translateY(612px); } 96%, 100% { transform: translateY(0); } }
.stroll { animation: stroll 9s ease-in-out infinite alternate; }
@keyframes stroll { from { transform: translateX(-50px); } to { transform: translateX(50px); } }
.step { animation: step .5s ease-in-out infinite alternate; }
@keyframes step { to { transform: translateY(-1.5px); } }
.sip { animation: sip 5s ease-in-out infinite; transform-box: fill-box; transform-origin: left bottom; }
@keyframes sip { 0%, 70%, 100% { transform: rotate(0); } 80%, 90% { transform: rotate(-22deg); } }
.breathe { animation: breathe 3s ease-in-out infinite alternate; }
@keyframes breathe { to { transform: translateY(-2px); } }
.sway { animation: sway 4s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: bottom center; }
@keyframes sway { from { transform: rotate(-2deg); } to { transform: rotate(2deg); } }
.glow { animation: glow 3s ease-in-out infinite; }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 210, 122, 0); } 50% { box-shadow: 0 0 10px 2px rgba(255, 210, 122, .35); } }
.day .glow { animation: none; }
.print { animation: print 6s ease-in-out infinite; }
@keyframes print { 0%, 40% { transform: translateY(0); opacity: 0; } 50% { opacity: 1; } 80%, 100% { transform: translateY(-16px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .hq *, .hq *::before, .hq *::after { animation: none !important; transition: none !important; }
}

/* Entrance (sign-in pages) -------------------------------------------------- */
.entrance { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 56px 16px; }
.entrance-card { width: 100%; max-width: 460px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 26px 28px; display: flex; flex-direction: column; gap: 14px; }
.entrance-card.wide { max-width: 680px; }
.entrance-card h1 { font: 800 26px "Big Shoulders Display", sans-serif; letter-spacing: 1.5px; margin: 0; text-transform: uppercase; color: var(--sign); }
.entrance-card h2 { font: 800 18px "Big Shoulders Display", sans-serif; letter-spacing: 1.2px; margin: 10px 0 0; text-transform: uppercase; }
.entrance-card p { margin: 0; line-height: 1.5; }
.entrance-card form { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.entrance-card form p { display: flex; flex-direction: column; gap: 5px; }
.entrance-card form p:has(> input[type=checkbox]) { flex-direction: row; align-items: center; gap: 8px; }
.entrance-card label { font-size: 12px; color: var(--dim); font-weight: 500; }
.entrance-card button:not(.linkbtn), .entrance-card a[href].button { font: 500 13px Geist, sans-serif; padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; text-decoration: none; text-align: center; }
.entrance-card button[type=submit]:not(.ghost):not(.linkbtn), .entrance-card .primary { background: var(--hot); border-color: var(--hot); color: #fff; }
.entrance-card a.button { display: inline-block; margin: 0 6px 6px 0; }
.entrance-card .linkbtn { font-size: 12px; }
.entrance-card form .ghost { justify-content: center; }
.entrance-card a[href].button.primary { background: var(--hot); border-color: var(--hot); color: #fff; }
.entrance-card hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.entrance-card table { width: 100%; border-collapse: collapse; font-size: 13px; }
.entrance-card th, .entrance-card td { text-align: left; padding: 6px 6px 6px 0; border-bottom: 1px solid var(--line); }
.entrance-card ul.errorlist { color: var(--hot-text); }
.entrance-card pre, .entrance-card code { font: 13px "Geist Mono", monospace; overflow-wrap: anywhere; white-space: pre-wrap; }
.entrance-card svg { background: #fff; border-radius: 8px; padding: 6px; max-width: 220px; height: auto; }
.entrance-card .alt { font-size: 12px; color: var(--dim); }
.entrance-card section, .entrance-card div { min-width: 0; }

/* The Data room's tabs (Room, Money, Actors, Failures, Competitor watch, Build pipeline) ----- */
.data-wrap { display: flex; flex-direction: column; gap: 14px; }
.data-tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 5px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.hq .data-tabs a { font: 500 13px Geist, sans-serif; padding: 7px 13px; border-radius: 8px; color: var(--dim); text-decoration: none; white-space: nowrap; }
.hq .data-tabs a:hover { color: var(--ink); background: var(--lit); }
.hq .data-tabs a[aria-current="page"] { color: var(--ink); background: var(--lit); box-shadow: inset 0 -2px 0 var(--sign); }
.room-tabs { padding: 14px 24px 0; }
.data-note { font-size: 13px; line-height: 1.5; }
.data-note code { font-size: 12px; }
.scroll-x { overflow-x: auto; min-width: 0; }
.table .num { text-align: right; padding-right: 12px; }
.table.auto { table-layout: auto; }
.bullets { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.55; }

.actor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); gap: 12px; }
.actor-card { gap: 10px; }
.actor-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; min-width: 0; }
.actor-name { margin: 0; font-size: 15px; font-weight: 600; }
.switch-form { display: flex; align-items: center; gap: 8px; flex: none; margin: 0; }
.switch { width: 38px; height: 22px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel2); padding: 2px; cursor: pointer; flex: none; position: relative; }
.switch span { display: block; width: 16px; height: 16px; border-radius: 99px; background: var(--faint); transition: transform .15s; }
.switch.on { background: rgba(89, 227, 160, .18); border-color: var(--ok); }
.switch.on span { background: var(--ok); transform: translateX(16px); }
.switch[disabled], .hq button[disabled] { opacity: .45; cursor: not-allowed; }
.actor-form { margin-top: 8px; }

.fail-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.fail-list > li { border-bottom: 1px solid var(--line); }
.fail-list > li:last-child { border-bottom: 0; }
.fail-list summary { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; cursor: pointer; font-size: 13px; list-style: none; min-width: 0; }
.fail-list summary::-webkit-details-marker { display: none; }
.fail-list .fail-what { min-width: 0; }
.fail-list .nowrap { white-space: nowrap; font-size: 11px; }
.fail-detail { display: flex; flex-direction: column; gap: 6px; padding: 0 0 12px; }
.fail-detail .p { overflow-wrap: anywhere; }

.gap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 10px; margin-bottom: 8px; }
.gap { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; background: var(--panel2); }
.gap-add { border-color: var(--ok); }
.gap-skip { opacity: .75; }
.gap-head { display: flex; flex-direction: column; gap: 6px; }
.gap-head h4 { margin: 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.gap-form { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.gap-form textarea { min-height: 36px; resize: vertical; font-size: 13px; }
.chip.decided { border-color: var(--ok); color: var(--ok); }
h3.sub { margin: 10px 0 4px; font: 600 12px Geist, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.matrix th, .matrix td { font-size: 12px; padding: 6px 10px 6px 0; }
.matrix .matrix-group { font: 600 11px "Geist Mono", monospace; color: var(--sign); padding-top: 12px; text-transform: uppercase; letter-spacing: .06em; }
.cell-yes, .cell-included { color: var(--ok); }
.cell-no { color: var(--faint); }
.cell-paid, .cell-partial { color: var(--warn); }

.stations { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; align-items: start; }
.station .items { margin: 0; }

/* Projects and clients ------------------------------------------------------ */
.hq a.stat { color: var(--ink); text-decoration: none; border-radius: 8px; }
.hq a.stat:hover b { color: var(--link); }
.pipeline-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.file-row { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.file-row:last-child { border-bottom: 0; }
.file-row > a { font-size: 13px; color: var(--ink); text-decoration: none; }
.file-row > a:hover { color: var(--link); }
.file-row .inline { flex-wrap: nowrap; }
.hq .file-row select { width: auto !important; flex: 1; min-width: 0; padding: 5px 8px; font-size: 12.5px; }
.file-row .ghost { padding: 5px 12px; }
.links-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.links { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.links li { display: flex; flex-direction: column; min-width: 0; }
.links .mono { font-size: 11px; }
.tick { width: 18px; height: 18px; flex: none; border-radius: 5px; border: 1px solid var(--line); background: transparent; color: var(--ok); font: 600 12px/1 Geist, sans-serif; cursor: pointer; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.tick:hover { border-color: var(--link); }
.tick.on { border-color: var(--ok); }
.item .inline { flex-wrap: nowrap; min-width: 0; font-size: 13px; }
.row-milestone { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 10px; }
.status-switch { display: inline-flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; align-self: flex-start; max-width: 100%; }
.status-switch form { margin: 0; display: flex; }
.seg { font: 500 12.5px Geist, sans-serif; padding: 7px 13px; background: transparent; border: 0; border-right: 1px solid var(--line); color: var(--dim); cursor: pointer; white-space: nowrap; }
.status-switch > :last-child .seg, .status-switch > .seg:last-child { border-right: 0; }
button.seg:hover { color: var(--ink); background: var(--lit); }
.seg.on { color: var(--ink); background: var(--lit); box-shadow: inset 0 -2px 0 var(--sign); }
details.contact { border-bottom: 1px solid var(--line); padding: 7px 0; }
details.contact > summary { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; min-width: 0; }
details.contact > summary::after { content: none; }
details.contact > summary .clip { max-width: 55%; }
@media (max-width: 760px) {
  .pipeline-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stack-table, .stack-table tbody, .stack-table tr { display: block; width: 100%; }
  .stack-table thead { display: none; }
  .stack-table tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .stack-table tr:last-child { border-bottom: 0; }
  .stack-table td { display: inline-block; width: auto !important; max-width: 100%; border: 0; padding: 2px 14px 0 0; vertical-align: baseline; }
  .stack-table td:first-child { display: block; padding-top: 0; }
  .stack-table td span[style*="display:block"] { display: inline !important; }
  .stack-table td:first-child span[style*="display:block"] { display: block !important; }
  .stack-table td.contact-cell { display: block; }
  .stack-table td.contact-cell span[style*="display:block"] { display: block !important; }
  .stack-table .no-contact { display: none; }
  .stack-table td[data-label]::before { content: attr(data-label) " "; color: var(--faint); font: 11px "Geist Mono", monospace; }
  .links-grid, .row-milestone { grid-template-columns: minmax(0, 1fr); }
}

/* Social (Marketing): the channels strip and a post's image. */
.social-channels { display: flex; gap: 8px; flex-wrap: wrap; }
.social-channel { display: flex; flex-direction: column; gap: 2px; min-width: 0; max-width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); }
.social-channel b { font: 500 12px "Geist Mono", monospace; }
.social-channel .meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.social-image { margin: 4px 0 0; display: flex; flex-direction: column; gap: 4px; }
.social-image img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); }
.social-image figcaption { overflow-wrap: anywhere; }
.hq a.social-state { color: inherit; }
.social-table { min-width: 560px; }
.social-slides { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.social-slides .social-image img { aspect-ratio: 1; object-fit: contain; background: #fff; width: 100%; }
.social-slides a { display: block; border-radius: 10px; }
.social-slides a:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.social-slides a img { cursor: zoom-in; }
.lightbox { width: min(96vw, 1100px); max-height: 96vh; padding: 12px 14px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--ink); }
.lightbox::backdrop { background: rgba(4, 8, 16, .82); }
.lightbox-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; min-width: 0; }
.lightbox-caption { flex: 1; min-width: 0; font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lightbox-original { font-size: 12px; white-space: nowrap; }
.lightbox-stage { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lightbox-stage img { flex: 1; min-width: 0; max-height: calc(96vh - 110px); object-fit: contain; border-radius: 8px; background: #fff; }
.lightbox-step { flex: none; width: 40px; height: 64px; font-size: 28px; line-height: 1; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); color: var(--ink); cursor: pointer; }
.lightbox-step:hover { background: var(--lit); }
.lightbox-count { margin: 8px 0 0; font-size: 11px; color: var(--faint); text-align: center; min-height: 1em; }
@media (max-width: 600px) { .lightbox-step { width: 30px; height: 48px; font-size: 22px; } }
.social-text { white-space: pre-wrap; overflow-wrap: anywhere; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); }

/* Marketing calendar --------------------------------------------------------- */
.cal-grid { grid-template-columns: minmax(0, 1fr) minmax(260px, 320px); }
.month { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.month-head, .month-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month-head span { font: 500 11px "Geist Mono", monospace; color: var(--faint); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.month-week + .month-week .day { border-top: 1px solid var(--line); }
.day { min-height: 92px; padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; border-inline-start: 1px solid var(--line); }
.day:first-child { border-inline-start: 0; }
.day.out { background: var(--panel2); }
.day.out .day-n { color: var(--faint); }
.day.today .day-n { color: var(--sign); font-weight: 600; }
.day-n { font-size: 11px; color: var(--dim); }
.hq a.cal-item { display: block; font-size: 12px; line-height: 1.3; padding: 4px 6px; border-radius: 6px; background: var(--lit); color: var(--ink); text-decoration: none; border-inline-start: 3px solid var(--link); overflow-wrap: anywhere; }
.hq a.cal-item:hover { outline: 1px solid var(--link); }
.hq a.cal-more { font-size: 11px; color: var(--dim); text-decoration: none; padding: 0 6px; }
.hq a.cal-more:hover { color: var(--link); }
.cal-kind { display: block; font-size: 10px; color: var(--dim); }
.cal-item.k-article { border-inline-start-color: var(--sign); }
.cal-item.k-social { border-inline-start-color: var(--ok); }
.cal-item.k-launch { border-inline-start-color: var(--hot); }
.cal-item.s-done, .cal-item.s-dropped { opacity: .6; }
.cal-item.s-dropped { text-decoration: line-through; }
.cal-item.s-waiting { border-inline-start-style: dashed; }
@media (max-width: 1180px) { .cal-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .month { border: 0; border-radius: 0; }
  .month-head { display: none; }
  .month-week { display: block; }
  .day { min-height: 0; border: 0 !important; border-top: 1px solid var(--line) !important; padding: 8px 0; }
  .day.none, .day.out { display: none; }
  .day.today { display: flex; }
}
.check-set { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.check-set legend { width: 100%; margin-bottom: 4px; }

/* Operations: a site's recent checks as a strip of bars */
.strip { display: flex; gap: 2px; align-items: center; min-height: 16px; flex-wrap: nowrap; overflow: hidden; }
.strip i { flex: none; width: 5px; height: 16px; border-radius: 2px; background: var(--ok); }
.strip i.warn { background: var(--warn); }
.strip i.down { background: var(--hot); }
.none-dot { background: var(--faint); }
.hot-text { color: var(--hot-text); }

/* A guidance or rules change, line by line */
.diff { font-size: 12px; line-height: 1.55; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; max-height: 60vh; overflow-y: auto; }
.diff > div { padding: 1px 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.diff-same { color: var(--dim); }
.diff-add { background: color-mix(in srgb, var(--ok) 16%, transparent); }
.diff-del { background: color-mix(in srgb, var(--hot) 16%, transparent); }
.diff-skip { color: var(--faint); font-style: italic; }
.diff-level { color: var(--ink); font-weight: 600; padding-top: 6px !important; }
@media (max-width: 760px) { .stack-table td.strip-cell { display: flex; align-items: center; gap: 8px; } }
/* allauth's "Alternative options" links sit in one bare div */
.entrance-card hr + h2 + div { display: flex; flex-wrap: wrap; gap: 6px 18px; }
