:root {
  --bg: #f5f6f8; --panel: #fff; --panel2: #f9fafb; --text: #161a20; --muted: #6b7280; --line: #e5e7eb;
  --accent: #6d4aff; --ok: #16a34a; --warn: #d97706; --bad: #dc2626; --chip: #eef0f3;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f13; --panel: #151820; --panel2: #1a1e27; --text: #e7e9ee; --muted: #9aa3b2; --line: #262b36;
    --accent: #9b85ff; --ok: #4ade80; --warn: #fbbf24; --bad: #f87171; --chip: #20242e;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14.5px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
button { font: inherit; color: inherit; cursor: pointer; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; }
button:hover { border-color: var(--muted); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
input { font: inherit; color: inherit; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.spacer { flex: 1; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login form { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; width: 100%; max-width: 340px; display: grid; gap: 10px; }
.login h1 { margin: 4px 0 0; font-size: 22px; } .login p { margin: 0 0 6px; }
.err { color: var(--bad); min-height: 1.4em; font-size: 13px; }

/* header */
header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top { display: flex; align-items: center; gap: 10px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 16px; display: flex; gap: 8px; align-items: center; }
.sys { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { background: var(--chip); border-radius: 999px; padding: 2px 10px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.pill b { color: var(--text); font-weight: 600; }

main { padding-top: 20px; padding-bottom: 60px; }
section { margin-bottom: 30px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 4px; }
h2 + p { margin: 0 0 12px; }
section > h2:only-child, h2 + .projects, h2 + .card { margin-top: 10px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }

/* tools */
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.tool { display: flex; gap: 14px; align-items: flex-start; padding: 16px; text-decoration: none; transition: transform .1s, border-color .1s; }
.tool:hover { border-color: var(--accent); transform: translateY(-1px); }
.tool .ic { font-size: 26px; line-height: 1; width: 44px; height: 44px; display: grid; place-items: center; background: var(--chip); border-radius: 12px; flex: none; }
.tool .t { font-weight: 650; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.tool .d { color: var(--muted); font-size: 13px; margin-top: 2px; }
.tool .u { font-size: 12px; color: var(--accent); margin-top: 4px; }

/* status dots */
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--muted); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 22%, transparent); }

/* focus */
.focus { display: grid; gap: 8px; }
.frow { display: grid; grid-template-columns: 34px 170px 1fr auto; gap: 12px; align-items: start; padding: 12px 14px; }
.frow .ic { font-size: 22px; }
.frow .n { font-weight: 650; } .frow .when { font-size: 12px; color: var(--muted); }
.frow .next { font-size: 14px; }
.frow .flags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.flag { font-size: 12px; border-radius: 6px; padding: 1px 8px; background: var(--chip); }
.flag.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.flag.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.flag.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.frow a.go { font-size: 13px; color: var(--accent); text-decoration: none; white-space: nowrap; }
@media (max-width: 720px) { .frow { grid-template-columns: 30px 1fr; } .frow > :nth-child(3), .frow > :nth-child(4) { grid-column: 2; } }

/* projects */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
@media (max-width: 400px) { .projects { grid-template-columns: 1fr; } }
.proj { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.ph { display: flex; gap: 12px; align-items: flex-start; }
.ph .ic { font-size: 28px; line-height: 1; }
.ph .n { font-weight: 700; font-size: 17px; }
.ph .tg { color: var(--muted); font-size: 13px; }
.stage { margin-left: auto; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); white-space: nowrap; }
.statusline { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.statusline span { display: inline-flex; gap: 6px; align-items: center; }
.where { margin: 0; font-size: 14px; }
.lbl { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 4px; }
ol.next { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 13.5px; }
.links { display: flex; gap: 6px; flex-wrap: wrap; }
.links a { font-size: 13px; text-decoration: none; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; }
.links a:hover { border-color: var(--accent); color: var(--accent); }
.repos { display: grid; gap: 4px; }
.repo { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 12.5px; background: var(--panel2); border-radius: 8px; padding: 6px 10px; }
.repo .rn { font-weight: 600; }
.repo .msg { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 140px; min-width: 0; }
details summary { cursor: pointer; font-size: 12.5px; color: var(--muted); }
.cmd { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.cmd code { flex: 1; background: var(--panel2); border-radius: 6px; padding: 5px 8px; overflow-x: auto; white-space: nowrap; }
.cmd button { padding: 3px 8px; font-size: 12px; }

/* lists */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 820px) { .two { grid-template-columns: 1fr; } }
.list > div { padding: 10px 14px; border-top: 1px solid var(--line); }
.list > div:first-child { border-top: 0; }
.site { display: flex; gap: 10px; align-items: center; }
.site a { font-weight: 600; text-decoration: none; } .site a:hover { color: var(--accent); }
.foot { margin-top: 20px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 30; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; }
.skeleton { color: var(--muted); padding: 20px; }
