/* Rail — shared tokens and pieces. Direction "Signal": white, ink, one hot orange, live progress bars. */

:root {
  --ink: #111317;
  --ink-2: #3a3e48;
  --muted: #6b7080;
  --faint: #b7bac4;
  --line: #e3e5ea;
  --line-2: #eceef2;
  --bg: #f4f5f7;
  --card: #ffffff;
  --hot: #ff6a1a;
  --hot-soft: #fff4e5;
  --hot-ink: #b8460a;
  --go: #1fa855;
  --go-soft: #e7f7ee;
  --warn: #e39a00;
  --warn-soft: #fff6dc;
  --late: #f0362b;
  --late-soft: #ffeceb;
  --sans: "Rethink Sans", system-ui, sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, monospace;
  --r: 12px;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font: 15px/1.45 var(--sans); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; }
.mono { font-family: var(--mono); font-feature-settings: "tnum"; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }
html.embed { scrollbar-width: none; }
html.embed::-webkit-scrollbar { display: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 10px; font-weight: 600; font-size: 14px;
  border: 1px solid var(--line); background: var(--card); transition: background .12s, border-color .12s, transform .06s; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: #cfd2d9; }
.btn:active { transform: translateY(1px); }
.btn.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.dark:hover { background: #262a31; }
.btn.hot { background: var(--hot); color: #fff; border-color: var(--hot); }
.btn.go { background: var(--go); color: #fff; border-color: var(--go); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* Staff top bar (hidden when a page is embedded in the landing demo) */
.topbar { height: 54px; background: var(--ink); color: #fff; display: flex; align-items: center; gap: 18px; padding: 0 18px; position: sticky; top: 0; z-index: 20; }
.wordmark { font-weight: 800; letter-spacing: -.03em; font-size: 19px; display: flex; align-items: center; gap: 8px; text-decoration: none; }
.wordmark i { width: 18px; height: 4px; background: var(--hot); border-radius: 2px; box-shadow: 0 -6px 0 #fff; }
.topbar .place { color: #9196a3; font-size: 13px; }
.topbar nav { display: flex; gap: 2px; margin-left: 10px; }
.topbar nav a { text-decoration: none; color: #b8bcc7; font-size: 14px; font-weight: 600; padding: 7px 11px; border-radius: 8px; }
.topbar nav a:hover { color: #fff; background: #23262d; }
.topbar nav a.on { color: #fff; background: #2a2e36; }
.topbar .sp { flex: 1; }
body.embed .topbar { display: none; }

/* Switch */
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; cursor: pointer; user-select: none; }
.switch input { appearance: none; width: 34px; height: 20px; border-radius: 99px; background: #c9ccd4; position: relative; cursor: pointer; transition: background .15s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--go); }
.switch input:checked::after { transform: translateX(14px); }
.topbar .switch { color: #c9ccd4; }
.topbar .switch input { background: #3a3e48; }
.topbar .switch input:checked { background: var(--hot); }

/* Live dot */
.livedot { width: 8px; height: 8px; border-radius: 50%; background: var(--go); box-shadow: 0 0 0 3px rgba(31,168,85,.18); display: inline-block; flex: none; }
.livedot.off { background: var(--faint); box-shadow: none; }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; letter-spacing: .02em; padding: 2px 7px; border-radius: 99px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.chip.hot { background: var(--hot-soft); color: var(--hot-ink); }
.chip.go { background: var(--go-soft); color: #137a3c; }
.chip.warn { background: var(--warn-soft); color: #8a5d00; }
.chip.late { background: var(--late-soft); color: #b3241b; }
.chip.ink { background: var(--ink); color: #fff; }

/* Toast */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; font-size: 14px; font-weight: 500; box-shadow: 0 8px 24px rgba(17,19,23,.25); animation: toast-in .2s ease-out; }
.toast.bad { background: var(--late); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* Sheets / drawers */
.scrim { position: fixed; inset: 0; background: rgba(17,19,23,.38); z-index: 50; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--card); z-index: 51; display: flex; flex-direction: column; box-shadow: -12px 0 40px rgba(17,19,23,.15); animation: slide-in .18s ease-out; }
@keyframes slide-in { from { transform: translateX(30px); opacity: 0; } }
.drawer header { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.drawer header h2 { font-size: 20px; letter-spacing: -.02em; flex: 1; }
.drawer .body { flex: 1; overflow: auto; padding: 16px 18px; }
.drawer footer { padding: 14px 18px; border-top: 1px solid var(--line); display: grid; gap: 8px; }

.empty { color: var(--muted); font-size: 14px; text-align: center; padding: 28px 12px; }
