@font-face { font-family: 'Sora Var'; src: url('fonts/sora-latin-wght-normal.woff2') format('woff2'); font-weight: 100 800; font-display: swap; }
@font-face { font-family: 'Inter Var'; src: url('fonts/inter-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'JetBrains Mono Var'; src: url('fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  --st-ink: #0d1730; --st-ink-deep: #070d1c; --st-ink-mid: #1c2d5e;
  --st-surface: #ffffff; --st-surface-2: #f5f7fb; --st-surface-3: #eef2f9;
  --st-border: #e4e9f2; --st-muted: #4a5878;
  --st-accent: #2f7bff; --st-accent-strong: #1a4bb3; --st-accent-soft: #eaf2ff;
  --st-teal: #17c3c0; --st-teal-text: #0f7f7d; --st-danger: #e5484d; --st-warn: #b7791f;
  --st-shadow: 0 1px 2px rgba(13,23,48,.04), 0 12px 32px rgba(13,23,48,.08);
  --st-font-display: 'Sora Var', 'Sora', system-ui, sans-serif;
  --st-font-body: 'Inter Var', 'Inter', system-ui, sans-serif;
  --st-font-mono: 'JetBrains Mono Var', 'JetBrains Mono', ui-monospace, monospace;
  --text: var(--st-ink);
}
@media (prefers-color-scheme: dark) {
  :root {
    --st-ink: #eef2f9; --st-ink-deep: #ffffff; --st-ink-mid: #9fb0d0;
    --st-surface: #070d1c; --st-surface-2: #0d1730; --st-surface-3: #152246;
    --st-border: #1c2d5e; --st-muted: #9fb0d0;
    --st-accent: #4a90ff; --st-accent-strong: #a7caff; --st-accent-soft: #152246;
    --st-teal-text: #17c3c0; --st-warn: #f3b95f;
    --st-shadow: 0 1px 2px rgba(0,0,0,.3), 0 20px 48px rgba(0,0,0,.45);
  }
}
* { box-sizing: border-box; }
html { background: var(--st-surface); }
body { margin: 0; font-family: var(--st-font-body); color: var(--st-ink); background: var(--st-surface); line-height: 1.5; font-size: 15px; }
h1, h2, h3, h4 { font-family: var(--st-font-display); letter-spacing: -0.01em; margin: 0 0 .5rem; color: var(--st-ink); }
h1 { font-size: 1.7rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; } h4 { font-size: 1rem; }
a { color: var(--st-accent); } a:hover { color: var(--st-accent-strong); }
:focus-visible { outline: 2px solid var(--st-accent); outline-offset: 2px; }
.mono, code, pre.code { font-family: var(--st-font-mono); }
.muted { color: var(--st-muted); } .small { font-size: .82rem; } .bad { color: var(--st-danger); }

.topbar { background: #0d1730; color: #fff; display: flex; align-items: center; justify-content: space-between; padding: .7rem 1.25rem; gap: 1rem; flex-wrap: wrap; border-bottom: 3px solid var(--st-teal); }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: #fff; }
.brand img { display: block; height: 26px; width: auto; }
.brand-sub { font-family: var(--st-font-display); font-weight: 600; font-size: .95rem; color: #9fb0d0; padding-left: .75rem; border-left: 1px solid #1c2d5e; }
.topnav { display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; }
.topnav a, .linkbtn { color: #cdd8ee; text-decoration: none; font-size: .9rem; background: none; border: 0; cursor: pointer; font-family: inherit; padding: 0; }
.topnav a:hover, .linkbtn:hover { color: #fff; }
.inline { display: inline; margin: 0; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 1.5rem 16px 4rem; }

.card { background: var(--st-surface-2); border: 1px solid var(--st-border); border-radius: 12px; padding: 1.25rem; margin: 1rem 0; box-shadow: var(--st-shadow); }
a.card { text-decoration: none; color: inherit; display: block; }
a.card:hover { border-color: var(--st-accent); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.grid .card { margin: 0; }
.stats { display: flex; gap: 1.5rem; margin: .75rem 0 0; flex-wrap: wrap; }
.stats dt { font-size: .75rem; color: var(--st-muted); text-transform: uppercase; letter-spacing: .04em; }
.stats dd { margin: 0; font-size: 1.4rem; font-family: var(--st-font-mono); }

.login { max-width: 420px; margin: 4rem auto; }
.login-logo { display: block; margin-bottom: 1rem; }
@media (prefers-color-scheme: dark) { .login-logo { filter: brightness(0) invert(1); } }
label { display: block; font-size: .85rem; color: var(--st-muted); margin-bottom: .75rem; }
input, select, textarea { display: block; width: 100%; margin-top: .25rem; padding: .55rem .65rem; font: inherit; color: var(--st-ink); background: var(--st-surface); border: 1px solid var(--st-border); border-radius: 8px; }
input[type=checkbox] { display: inline-block; width: auto; margin: 0 .4rem 0 0; }
input[type=file] { border: 0; padding-left: 0; background: none; }
textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 1rem; align-items: end; }
.form-grid .span2 { grid-column: 1 / -1; }
.check { color: var(--st-ink); }
.inline-label { display: flex; gap: .5rem; align-items: center; margin: 0; } .inline-label select { width: auto; margin: 0; }

.btn { display: inline-block; background: var(--st-accent); color: #fff; border: 1px solid var(--st-accent); border-radius: 8px; padding: .5rem .95rem; font: 600 .88rem var(--st-font-body); cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--st-accent-strong); border-color: var(--st-accent-strong); color: #fff; }
.btn-ghost { background: transparent; color: var(--st-accent); } .btn-ghost:hover { background: var(--st-accent-soft); color: var(--st-accent-strong); }
.btn-danger { background: transparent; color: var(--st-danger); border-color: var(--st-danger); } .btn-danger:hover { background: var(--st-danger); color: #fff; border-color: var(--st-danger); }

.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid; }
.flash-ok { background: var(--st-accent-soft); border-color: var(--st-teal); }
.flash-error { background: rgba(229,72,77,.1); border-color: var(--st-danger); }
.notice { background: var(--st-accent-soft); border-left: 4px solid var(--st-accent); padding: .7rem 1rem; border-radius: 6px; }

.eng-head { display: flex; justify-content: space-between; align-items: flex-start; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--st-border); margin: 0 0 1rem; flex-wrap: wrap; }
.tabs a { padding: .55rem 1rem; text-decoration: none; color: var(--st-muted); border-bottom: 2px solid transparent; font-weight: 500; }
.tabs a.active { color: var(--st-ink); border-bottom-color: var(--st-teal); }
.toolbar { display: flex; gap: .75rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; } .spacer { flex: 1; }

.pill { display: inline-block; font-size: .72rem; font-weight: 600; padding: .1rem .55rem; border-radius: 999px; background: var(--st-surface-3); color: var(--st-ink); text-transform: uppercase; letter-spacing: .03em; }
.pill-ok, .pill-done, .pill-active { background: rgba(23,195,192,.15); color: var(--st-teal-text); }
.pill-bad, .pill-error, .pill-refused { background: rgba(229,72,77,.15); color: var(--st-danger); }
.pill-running, .pill-queued, .pill-active.pill-mode { background: var(--st-accent-soft); color: var(--st-accent-strong); }
.pill-closed { background: var(--st-surface-3); color: var(--st-muted); }

.kanban { display: grid; grid-template-columns: repeat(6, minmax(190px, 1fr)); gap: .75rem; overflow-x: auto; padding-bottom: .5rem; }
.col { background: var(--st-surface-2); border: 1px solid var(--st-border); border-radius: 10px; padding: .75rem; min-height: 120px; }
.col h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--st-muted); display: flex; justify-content: space-between; }
.fcard { display: flex; flex-direction: column; gap: .25rem; background: var(--st-surface); border: 1px solid var(--st-border); border-left: 4px solid var(--st-border); border-radius: 8px; padding: .6rem .7rem; margin-bottom: .5rem; text-decoration: none; color: var(--st-ink); }
.fcard:hover { border-color: var(--st-accent); }
.sev-critical { border-left-color: var(--st-danger) !important; } .sev-high { border-left-color: #f0793a !important; }
.sev-medium { border-left-color: var(--st-warn) !important; } .sev-low { border-left-color: var(--st-accent) !important; } .sev-info { border-left-color: var(--st-muted) !important; }
.sev-tag { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.card.sev-critical, .card.sev-high, .card.sev-medium, .card.sev-low, .card.sev-info { border-left-width: 4px; }

.table { width: 100%; border-collapse: collapse; background: var(--st-surface); border: 1px solid var(--st-border); border-radius: 10px; overflow: hidden; }
.table th, .table td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--st-border); vertical-align: top; }
.table th { background: var(--st-surface-2); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--st-muted); }
.actions form { margin-bottom: .4rem; } .authform { display: grid; gap: .4rem; min-width: 260px; }
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .5rem 1rem; margin: 1rem 0; }
.meta dt { font-size: .72rem; color: var(--st-muted); text-transform: uppercase; } .meta dd { margin: 0; }
pre.prose { white-space: pre-wrap; font-family: var(--st-font-body); margin: 0 0 1rem; } .prose { white-space: pre-wrap; }
pre.code { background: var(--st-ink-deep); color: #eef2f9; padding: 1rem; border-radius: 8px; overflow: auto; max-height: 520px; font-size: .8rem; }
@media (prefers-color-scheme: dark) { pre.code { background: #0d1730; border: 1px solid var(--st-border); } }
ul.plain { list-style: none; padding: 0; } ol.timeline { list-style: none; padding: 0; } ol.timeline li { border-left: 2px solid var(--st-teal); padding: 0 0 1rem .9rem; }
.inline-form { display: flex; gap: .75rem; align-items: flex-start; margin: .5rem 0; } .inline-form textarea { flex: 1; }
.planrow { display: grid; grid-template-columns: 1fr 150px 1fr auto; gap: .6rem; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--st-border); }
.planrow select, .planrow input { margin: 0; }
.bar { height: 8px; background: var(--st-surface-3); border-radius: 99px; overflow: hidden; margin-bottom: 1rem; } .bar-fill { display: block; height: 100%; width: 0; background: var(--st-teal); }
.rfinding { border-left: 4px solid var(--st-border); padding: .25rem 0 .25rem 1rem; margin: 1rem 0; }

@media (max-width: 800px) { .planrow { grid-template-columns: 1fr; } .kanban { grid-template-columns: repeat(6, 230px); } }
@media (prefers-reduced-motion: no-preference) { .btn, .fcard, a.card { transition: background-color .15s, border-color .15s; } }
@media print { .topbar, .tabs, .btn { display: none; } body { background: #fff; color: #000; } }
