@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&display=swap');
/* design.css — TK-OS design language (tokens + rhythm).
 *
 * Deliberately conservative: it changes type, spacing and surface, never layout.
 * Loaded AFTER Tailwind so these rules win where they overlap.
 */

:root {
  --tk-font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tk-serif: "Instrument Serif", Georgia, serif;
  --tk-ink: #0e0e0c;
  --tk-muted: #5f5b54;
  --tk-line: #e4e0d8;
  --tk-bg: #ffffff;
  --tk-accent: #d93a1e;
  --tk-danger: #d93a1e;
  --tk-radius-card: 12px;
  --tk-radius-control: 8px;
  --tk-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--tk-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  color: var(--tk-ink);
}

/* Numbers should not jump when they change. */
.tabular, table td, table th, input[type=number], code, pre { font-variant-numeric: tabular-nums; }

/* One dominant heading per screen: 28, then 15, then 13. */
#main-view-container h2 { font-size: 28px; line-height: 1.15; font-weight: 650; letter-spacing: -.02em; }
#main-view-container h3 { font-size: 15px; line-height: 1.3; font-weight: 600; letter-spacing: -.01em; }
#main-view-container p { line-height: 1.5; }

/* Tables: readable rows, quiet header, numeric alignment. */
table { border-collapse: separate; border-spacing: 0; }
table thead th {
  font-size: 10px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--tk-muted);
  font-weight: 600;
  padding-bottom: 8px;
}
table tbody td { height: 40px; }
table tbody tr:hover { background: #f8fafc; }

/* Controls: same height everywhere, visible focus. */
input[type="text"], input[type="number"], input[type="date"], input[type="email"],
input[type="password"], input[type="search"], select, textarea {
  border-radius: var(--tk-radius-control);
  border-color: var(--tk-line);
  background: #fff;
  min-height: 34px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--tk-accent);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, .14);
}
button { transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease; }

/* Optional building blocks for the next passes. */
.tk-card { background: #fff; border: 1px solid var(--tk-line); border-radius: var(--tk-radius-card); box-shadow: var(--tk-shadow); padding: 20px; }
.tk-stat { display: flex; flex-direction: column; gap: 2px; }
.tk-stat-value { font-size: 32px; font-weight: 650; letter-spacing: -.02em; line-height: 1.1; }
.tk-stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--tk-muted); font-weight: 600; }
.tk-empty { border: 1px dashed var(--tk-line); border-radius: var(--tk-radius-card); padding: 20px; color: var(--tk-muted); font-size: 13px; background: #fff; }

/* Sidebar: quieter, with a clear current item. */
aside, nav[aria-label="main"] { border-right: 1px solid var(--tk-line); }

/* Tailwind's CDN injects its styles at the end of head, so equal-specificity rules
   lose. These two use element+id specificity to actually win. */
#main-view-container .tk-stat-value { font-size: 34px; font-weight: 650; letter-spacing: -.03em; color: #0f172a; }
#main-view-container .tk-stat-label { font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: #64748b; font-weight: 700; }

/* ── Hero: flat, editorial, one accent ─────────────────────────────────── */
.tk-hero {
  position: relative;
  border-radius: 14px;
  padding: 24px 24px 0;
  color: #e6edf7;
  background: #0e0e0c;
  border: 1px solid rgba(230, 237, 247, .08);
  overflow: hidden;
}
.tk-hero-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; }
.tk-hero-eyebrow { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: #8c8579; font-weight: 600; }
#main-view-container .tk-hero-title { font-size: 31px; line-height: 1.06; font-weight: 600; letter-spacing: -.03em; color: #f4f7fb; margin: 6px 0 0; text-wrap: balance; }
#main-view-container .tk-hero-title em { font-family: var(--tk-serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; color: #f4f7fb; }
.tk-hero-sub { font-size: 12.5px; color: #8b96a8; margin-top: 5px; max-width: 58ch; }
.tk-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tk-btn-ghost { padding: 7px 11px; border-radius: 7px; font-size: 11.5px; font-weight: 600; color: #cbd5e1; background: transparent; border: 1px solid rgba(230,237,247,.14); }
.tk-btn-ghost:hover { background: rgba(230,237,247,.06); color: #f4f7fb; }
.tk-btn-solid { padding: 7px 12px; border-radius: 7px; font-size: 11.5px; font-weight: 600; color: #0b0f16; background: #f4f7fb; border: 1px solid #f4f7fb; }
.tk-btn-solid:hover { background: #dbe4f0; }

/* Stats as a single row separated by hairlines, not four boxes. */
.tk-hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 22px; border-top: 1px solid rgba(230,237,247,.08); }
@media (max-width: 720px) { .tk-hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tk-hero-stat { padding: 14px 16px 16px; border-left: 1px solid rgba(230,237,247,.06); }
.tk-hero-stat:first-child { border-left: 0; padding-left: 0; }
.tk-hero-stat-value { font-size: 26px; font-weight: 600; letter-spacing: -.03em; color: #f4f7fb; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tk-hero-stat-label { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #6b7688; font-weight: 600; margin-top: 3px; }

/* Surfaces: hairlines, no shadows. */
.tk-card { background: #fff; border: 1px solid rgba(15,23,42,.08); border-radius: 12px; box-shadow: none; padding: 18px; }
body { background: #f7f8fa; }
#main-view-container .rounded-xl.border { border-color: rgba(15,23,42,.08) !important; box-shadow: none !important; }

/* ── Metadata bar: context, not five competing boxes ───────────────────── */
.tk-meta {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: #fff;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 12px;
  overflow: hidden;
}
@media (max-width: 900px) { .tk-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tk-meta-item { padding: 12px 14px; border-left: 1px solid rgba(15,23,42,.06); }
.tk-meta-item:first-child { border-left: 0; }
.tk-meta-label { font-size: 9.5px; letter-spacing: .13em; text-transform: uppercase; color: #8b96a8; font-weight: 700; }
.tk-meta-value { font-size: 12.5px; color: #1e293b; font-weight: 550; margin-top: 3px; line-height: 1.35; }

/* ── Section headers: a label and a rule, no boxes ─────────────────────── */
.tk-section { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid rgba(15,23,42,.07); }
#main-view-container .tk-section-title { font-size: 12.5px; font-weight: 650; letter-spacing: -.01em; color: #0f172a; margin: 0; }

/* ── Chips ─────────────────────────────────────────────────────────────── */
.tk-chip { display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 10.5px; font-weight: 600; color: #475569; background: #f1f5f9; border: 1px solid rgba(15,23,42,.06); font-variant-numeric: tabular-nums; }

/* ── Timers: a quiet strip, not two dark pills ─────────────────────────── */
.tk-timers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
@media (max-width: 720px) { .tk-timers { grid-template-columns: 1fr; } }
.tk-timer { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; border: 1px solid rgba(15,23,42,.08); border-radius: 11px; }
.tk-timer-tag { font-size: 9.5px; font-weight: 700; letter-spacing: .1em; color: #8b96a8; }
.tk-timer-body { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex: 1; }
.tk-timer-name { font-size: 12px; color: #334155; font-weight: 550; }
.tk-timer-time { font-size: 15px; font-weight: 650; color: #0f172a; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

/* ── Table with room to breathe ────────────────────────────────────────── */
.tk-table-lg tbody td { height: 44px; }
.tk-table-lg tbody tr { border-bottom: 1px solid rgba(15,23,42,.05); }

/* ── Editor: looks like a tool, not a form ─────────────────────────────── */
.tk-editor { width: 100%; min-height: 250px; padding: 14px; border-radius: 11px; border: 1px solid rgba(15,23,42,.08); background: #fbfcfd; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.6; color: #334155; resize: vertical; }
.tk-editor:focus { outline: none; border-color: #94a3b8; box-shadow: 0 0 0 3px rgba(148,163,184,.18); }

/* ── Small empty state ─────────────────────────────────────────────────── */
.tk-empty-sm { font-size: 11.5px; color: #94a3b8; padding: 10px 12px; border: 1px dashed rgba(15,23,42,.12); border-radius: 9px; background: #fcfdfe; }

/* Shell: the top bar wears the brand, not Tailwind's slate. */
#tk-topbar {
  background: #0e0e0c !important;
  border-bottom-color: #232120 !important;
  color: #c9c3b8 !important;
  font-family: var(--tk-font);
  letter-spacing: .01em;
}
#tk-topbar .bg-slate-800 { background: #1a1917 !important; }
#tk-topbar .border-slate-700, #tk-topbar .border-slate-800 { border-color: #2a2824 !important; }
#tk-topbar a:hover, #tk-topbar button:hover { color: #fff !important; }

/* The week selector was the last green surface in the chrome. */
#lab-week-selector, select#lab-week {
  background: #fff !important;
  border: 1px solid var(--tk-line) !important;
  color: var(--tk-ink) !important;
  font-weight: 600;
}
