:root {
  color-scheme: dark;
  --bg: #0a0f1e; --surface: #131a2e; --surface2: #18213a; --line: #2a3554;
  --fg: #e8ecf5; --muted: #9aa6c2;
  --yoda: #9ad14b; --artoo: #4f9cf9; --ok: #5fd38d; --warn: #f2b84b; --stop: #f26d6d;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font-size: 14px; line-height: 1.5; }
main, header.top { max-width: 1280px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
header.top { display: flex; justify-content: space-between; align-items: center; padding-block: 18px; gap: 12px; flex-wrap: wrap; }
h1 { margin: 0; font-size: 26px; letter-spacing: 0.12em; }
h1 .yoda { color: var(--yoda); } h1 .artoo { color: var(--artoo); } h1 .amp { color: var(--muted); font-weight: 400; }
h2 { font-size: 18px; margin: 0; }
h3 { margin: 0; font-size: 16px; }
section { margin-block: 22px 30px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.muted { color: var(--muted); }
.who { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.signin { padding-block: 60px; }
.notice { background: #2a1720; border: 1px solid var(--stop); padding: 10px 14px; border-radius: 10px; }
button, .button { background: var(--artoo); color: #061023; border: 0; border-radius: 8px; padding: 7px 12px; font-weight: 600; cursor: pointer; font-size: 13px; text-decoration: none; display: inline-block; }
button.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
button.danger { background: transparent; color: var(--stop); border: 1px solid #5a2a35; }
button.small { padding: 4px 9px; font-size: 12px; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--artoo); outline-offset: 2px; }
input, select, textarea { background: #0e1628; color: var(--fg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; }
form.inline { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; }
.item-form { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: end; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.item-form .full { grid-column: 1 / -1; }
.item-form button { justify-self: start; }
.grow { flex: 1; min-width: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.card .head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card .name { font-weight: 700; font-size: 16px; color: var(--artoo); letter-spacing: 0.04em; }
.row { display: flex; justify-content: space-between; gap: 10px; }
.row span:first-child { color: var(--muted); }
.pill { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 9px; border: 1px solid currentColor; white-space: nowrap; }
.pill.ok { color: var(--ok); } .pill.warn { color: var(--warn); } .pill.stop { color: var(--stop); } .pill.info { color: var(--artoo); } .pill.muted { color: var(--muted); }
.bar { display: grid; grid-template-columns: 48px 1fr 46px; gap: 8px; align-items: center; }
.bar .track { height: 8px; background: #0c1222; border: 1px solid #222c48; border-radius: 6px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--ok); }
.bar .fill.warn { background: var(--warn); } .bar .fill.stop { background: var(--stop); }
.bar .pct { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.login { background: #0e1830; border: 1px solid var(--artoo); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.login a { color: var(--artoo); word-break: break-all; }
code, .code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; background: #0e1628; border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; word-break: break-all; }
.code.block { display: block; padding: 8px; white-space: pre-wrap; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; min-width: 820px; background: var(--surface); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td a { color: var(--artoo); }
.enroll { margin-top: 12px; color: var(--muted); }
.enroll summary { cursor: pointer; }
.enroll > * { margin-top: 10px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface2); border-left: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.log { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.log li { background: #0e1628; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 12.5px; word-break: break-word; }
.log time { color: var(--muted); margin-right: 6px; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .item-form { grid-template-columns: 1fr; }
}
