:root {
  color-scheme: light dark;
  --surface: #ffffff;
  --surface-2: #f6f6f6;
  --line: #e2e2e2;
  --text: #191919;
  --text-2: #666666;
  --productive: #257de0;
  --unproductive: #f47230;
  --neutral: #a6a6a6;
  --idle: #d8d8d8;
  --accent: #257de0;
  --danger: #c0392b;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #191919;
    --surface-2: #232323;
    --line: #383838;
    --text: #efefef;
    --text-2: #9c9c9c;
    --productive: #338ced;
    --unproductive: #e76624;
    --neutral: #7a7a7a;
    --idle: #4a4a4a;
    --accent: #338ced;
    --danger: #eb6263;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--surface-2); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 15px; margin: 0 0 12px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.shell { display: grid; grid-template-columns: 200px 1fr; min-height: 100vh; }
nav { background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px; position: sticky; top: 0; height: 100vh; }
nav .brand { font-weight: 700; font-size: 16px; padding: 4px 8px 16px; }
nav a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); }
nav a.on { background: var(--surface-2); font-weight: 600; }
nav .foot { position: absolute; bottom: 16px; left: 12px; right: 12px; color: var(--text-2); font-size: 12px; }
main { padding: 24px; max-width: 1100px; width: 100%; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.tile .v { font-size: 26px; font-weight: 700; }
.tile .k { color: var(--text-2); font-size: 12px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--text-2); font-weight: 600; font-size: 12px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
input, select, textarea, button { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; }
textarea { width: 100%; min-height: 70px; }
button { cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: var(--danger); }
button.small { padding: 3px 8px; font-size: 12px; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label { display: block; color: var(--text-2); font-size: 12px; margin: 10px 0 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .shell { grid-template-columns: 1fr; } nav { position: static; height: auto; } nav .foot { position: static; margin-top: 12px; } .grid2 { grid-template-columns: 1fr; } }
.muted { color: var(--text-2); }
.err { color: var(--danger); margin-top: 8px; }
.ok { color: var(--productive); margin-top: 8px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 6px 0 10px; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.bar { display: flex; height: 10px; gap: 2px; min-width: 140px; }
.bar span { display: block; height: 100%; border-radius: 2px; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; border: 1px solid var(--line); }
.chip.productive::before, .chip.unproductive::before, .chip.neutral::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.chip.productive::before { background: var(--productive); }
.chip.unproductive::before { background: var(--unproductive); }
.chip.neutral::before { background: var(--neutral); }
.status { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--text-2); }
.dot.active { background: var(--productive); border-color: var(--productive); }
.dot.idle { background: transparent; border-color: var(--neutral); }
.dot.offline { background: var(--line); border-color: var(--line); }
#tip { position: fixed; z-index: 10; pointer-events: none; background: var(--text); color: var(--surface); padding: 6px 9px; border-radius: 6px; font-size: 12px; max-width: 320px; white-space: pre-line; }
.auth { max-width: 380px; margin: 10vh auto; }
.auth .card { padding: 24px; }
.auth input { width: 100%; }
pre, code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
pre { background: var(--surface-2); border: 1px solid var(--line); padding: 10px; border-radius: 6px; overflow-x: auto; user-select: all; }
svg text { fill: var(--text-2); font-size: 11px; }
.strip { position: relative; height: 34px; background: var(--surface-2); border-radius: 4px; border: 1px solid var(--line); }
.strip div { position: absolute; top: 3px; bottom: 3px; min-width: 2px; border-radius: 2px; }
.hours { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-2); margin-top: 4px; }
.sr { position: absolute; left: -9999px; }

nav .foot a { display: inline; padding: 0; }

/* v0.2 */
.pulse { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.pcard { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface-2); display: grid; gap: 8px; }
.pcard .doing { min-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.cats { display: grid; gap: 8px; }
.catrow { display: grid; grid-template-columns: 170px 1fr 130px; gap: 4px 12px; align-items: center; }
.cname { font-weight: 600; }
.cbar { height: 10px; background: var(--surface-2); border-radius: 3px; }
.cbar span { display: block; height: 100%; background: var(--productive); border-radius: 3px; }
.ctop { grid-column: 2 / 4; font-size: 12px; margin-top: -2px; }
.small { font-size: 12px; }
.chip { white-space: nowrap; }

.shots{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px;margin-top:12px}
.shots figure{margin:0;border:1px solid var(--line,#ddd);border-radius:8px;overflow:hidden;background:#fff}
.shots img{display:block;width:100%;aspect-ratio:16/9;object-fit:cover;background:#eee}
.shots figcaption{padding:6px 8px;font-size:12px;display:flex;justify-content:space-between;gap:6px;align-items:center}
.lightbox{position:fixed;inset:0;background:rgba(0,0,0,.85);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;color:#fff;z-index:50;cursor:zoom-out}
.lightbox img{max-width:94vw;max-height:88vh}
.chips{display:flex;flex-wrap:wrap;gap:6px}
.chip{background:#eef1f5;border-radius:14px;padding:3px 6px 3px 10px;font-size:13px}
.chip button{border:0;background:none;cursor:pointer;font-size:15px}

.ok-text{color:#1a7f37}.bad-text{color:#b42318}
.daybars{display:flex;align-items:flex-end;gap:4px;height:110px}
.daybar{flex:1;max-width:56px;background:var(--productive,#2a9d8f);border-radius:3px 3px 0 0;min-width:4px}

/* ---- v0.6 visual refresh ---- */
:root{--bg:#f3f5f9;--surface-2:#f3f5f9;--line:#e4e8ef;--text:#14213d;--text-2:#667085;--accent:#2563eb;--productive:#2563eb;--unproductive:#f97316;--radius:12px;--shadow:0 1px 2px rgba(16,24,40,.05),0 1px 3px rgba(16,24,40,.06);--side:#0f172a;--side-text:#cbd5e1}
@media (prefers-color-scheme:dark){:root{--bg:#0b1220;--surface:#111a2e;--surface-2:#0b1220;--line:#22304a;--text:#e6ebf5;--text-2:#93a0b8;--accent:#4f8cff;--productive:#4f8cff;--unproductive:#fb923c;--side:#0a1020;--shadow:none}}
body{background:var(--bg);font:14px/1.5 Inter,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;-webkit-font-smoothing:antialiased}
h1{font-size:24px;letter-spacing:-.02em;margin:0 0 16px;font-weight:700}
h2{font-size:15px;font-weight:650;letter-spacing:-.01em}
.shell{grid-template-columns:232px 1fr}
nav{background:var(--side);border-right:0;padding:18px 12px;overflow-y:auto;color:var(--side-text)}
nav .brand{display:flex;align-items:center;gap:10px;color:#fff;font-size:16px;font-weight:700;padding:2px 8px 18px;letter-spacing:-.01em}
nav .logo{display:grid;place-items:center;width:28px;height:28px;border-radius:8px;background:linear-gradient(135deg,#3b82f6,#7c3aed);color:#fff;font-weight:800;font-size:15px}
nav .navsec{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:#64748b;padding:16px 10px 6px;font-weight:600}
nav a{color:var(--side-text);padding:7px 10px;border-radius:8px;transition:background .12s,color .12s}
nav a:hover{background:rgba(255,255,255,.07);color:#fff;text-decoration:none}
nav a.on{background:rgba(59,130,246,.2);color:#fff;font-weight:600;box-shadow:inset 2px 0 0 #60a5fa}
nav .foot{color:#94a3b8;position:static;margin-top:24px;padding:12px 10px 0;border-top:1px solid rgba(255,255,255,.08)}
nav .foot a{display:inline;padding:0;color:#e2e8f0;text-decoration:underline}
nav .foot a:hover{background:none}
main{padding:28px 32px 48px;max-width:1240px}
.card,.tile{border-radius:var(--radius);box-shadow:var(--shadow);border-color:var(--line)}
.card{padding:20px}
.tile{padding:16px 18px;position:relative;overflow:hidden}
.tile::before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--accent);opacity:.85}
.tile .v{font-size:28px;letter-spacing:-.02em}
.tile .k{margin-top:2px}
table{border-collapse:separate;border-spacing:0}
th{font-size:11px;text-transform:uppercase;letter-spacing:.05em;font-weight:600;padding:8px 10px}
td{padding:10px}
tbody tr{transition:background .1s}
tbody tr:hover{background:color-mix(in srgb,var(--accent) 5%,transparent)}
tbody tr:last-child td{border-bottom:0}
input,select,textarea{border-radius:8px;padding:8px 11px;border-color:var(--line);background:var(--surface)}
input:hover,select:hover,textarea:hover{border-color:color-mix(in srgb,var(--text-2) 50%,var(--line))}
button{border-radius:8px;padding:8px 14px;font-weight:500;transition:background .12s,border-color .12s,transform .05s}
button:hover{border-color:color-mix(in srgb,var(--text-2) 50%,var(--line));background:color-mix(in srgb,var(--accent) 5%,var(--surface))}
button:active{transform:translateY(1px)}
button.primary{background:var(--accent);border-color:var(--accent);color:#fff;box-shadow:0 1px 2px rgba(37,99,235,.35)}
button.primary:hover{background:color-mix(in srgb,var(--accent) 88%,#000);border-color:transparent}
button.small{padding:3px 9px;font-size:12px;border-radius:7px}
button.danger:hover{background:color-mix(in srgb,var(--danger) 8%,var(--surface))}
.bar{height:8px;border-radius:5px;overflow:hidden}
.bar span{border-radius:0}
.chip{border-radius:999px}
.err{background:color-mix(in srgb,var(--danger) 9%,var(--surface));border:1px solid color-mix(in srgb,var(--danger) 35%,var(--line));padding:10px 12px;border-radius:8px}
.ok{background:color-mix(in srgb,var(--accent) 8%,var(--surface));padding:8px 12px;border-radius:8px;display:inline-block}
.muted{color:var(--text-2)}
.shots figure{border-radius:var(--radius);box-shadow:var(--shadow);transition:transform .12s}
.shots figure:hover{transform:translateY(-2px)}
pre{background:#0f172a;color:#e2e8f0;padding:12px 14px;border-radius:8px;overflow:auto;font-size:12.5px}
@media (max-width:800px){.shell{grid-template-columns:1fr}nav{height:auto;position:static}main{padding:18px 14px 40px}}
