:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  --bg: #f7f7f7;
  --surface: #ffffff;
  --soft: #f3f3f3;
  --raised: #f7f7f7;
  --hover: #fbfbfb;
  --ink: #191919;
  --muted: #636363;
  --nav-ink: #464646;
  --line: #e5e5e5;
  --input-line: #dcdcdc;
  --hover-line: #d0d0d0;
  --primary: #242424;
  --primary-hover: #3b3b3b;
  --primary-ink: #ffffff;
  --accent: #4e4e4e;
  --accent-soft: #eeeeee;
  --success-ink: #575757;
  --success-surface: #f3f3f3;
  --error-ink: #454545;
  --error-surface: #f1f1f1;
  --warning-ink: #5f5f5f;
  --warning-surface: #f4f4f4;
  --radius: 16px;
  --shadow: 0 1px 2px rgb(25 25 25 / .045);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0f0f;
  --surface: #171717;
  --soft: #222222;
  --raised: #1b1b1b;
  --hover: #1c1c1c;
  --ink: #f2f2f2;
  --muted: #afafaf;
  --nav-ink: #c7c7c7;
  --line: #2d2d2d;
  --input-line: #3d3d3d;
  --hover-line: #5d5d5d;
  --primary: #efefef;
  --primary-hover: #dcdcdc;
  --primary-ink: #1b1b1b;
  --accent: #cccccc;
  --accent-soft: #252525;
  --success-ink: #cfcfcf;
  --success-surface: #2c2c2c;
  --error-ink: #bababa;
  --error-surface: #282828;
  --warning-ink: #d0d0d0;
  --warning-surface: #2d2d2d;
  --shadow: 0 1px 2px rgb(0 0 0 / .15);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 5rem; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 1rem; line-height: 1.48; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
img, svg { display: block; max-width: 100%; }
svg.icon { width: 1.125rem; height: 1.125rem; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.14; }
h1 { font-size: clamp(2rem, 4vw, 2.85rem); font-weight: 725; letter-spacing: -.06em; }
h2 { font-size: 1.21rem; font-weight: 700; letter-spacing: -.035em; }
h3 { font-size: 1rem; font-weight: 670; letter-spacing: -.02em; }
small, .small { font-size: .82rem; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }
.subtle-link { color: var(--accent); font-weight: 650; font-size: .88rem; }
.subtle-link:hover { text-decoration: underline; }
.skip { position: fixed; top: .7rem; left: .7rem; z-index: 20; padding: .65rem 1rem; border-radius: .55rem; background: var(--primary); color: var(--primary-ink); transform: translateY(-150%); }
.skip:focus { transform: none; }
.app-shell { min-height: 100dvh; display: grid; grid-template-columns: 15rem minmax(0, 1fr); }
.side {
  position: sticky; top: 0; height: 100dvh; overflow-y: auto;
  display: flex; flex-direction: column; padding: 1.35rem 1rem .9rem;
  border-right: 1px solid var(--line); background: var(--surface);
}
.brand { display: inline-flex; align-items: center; gap: .72rem; align-self: start; padding: .1rem .25rem; }
.brand-mark { display: grid; place-items: center; width: 2.35rem; height: 2.35rem; border-radius: .68rem; background: #1b1b1b; flex: none; }
.brand-mark img { width: 1.55rem; height: 1.55rem; object-fit: contain; filter: grayscale(1); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: .95rem; letter-spacing: .075em; font-weight: 800; line-height: 1.12; }
.brand small { color: var(--muted); font-size: .74rem; margin-top: .17rem; }
.side .brand { margin-bottom: 1.8rem; }
.side-nav { display: grid; gap: 1.42rem; }
.nav-group { display: grid; gap: .22rem; }
.nav-label { padding: 0 .64rem .34rem; color: var(--muted); font-size: .68rem; font-weight: 730; letter-spacing: .105em; text-transform: uppercase; }
.nav-link { display: flex; align-items: center; gap: .69rem; min-height: 2.63rem; border-radius: .55rem; padding: .45rem .66rem; color: var(--nav-ink); font-size: .9rem; font-weight: 580; }
.nav-link:hover { background: var(--soft); color: var(--ink); }
.nav-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 705; }
.nav-link .icon { width: 1.02rem; height: 1.02rem; }
.side-foot { margin-top: auto; padding-top: 1.35rem; }
.side-foot .profile { margin-top: .6rem; border-top: 1px solid var(--line); padding: .85rem .28rem .1rem; display: flex; align-items: center; gap: .58rem; }
.side-foot .profile span:last-child { overflow: hidden; }
.side-foot .profile strong, .side-foot .profile small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.side-foot .profile strong { font-size: .85rem; }
.side-foot .profile small { font-size: .73rem; color: var(--muted); }
.programs { display: flex; flex-wrap: wrap; gap: .3rem; padding-inline: .18rem; }
.program-tag { font-size: .69rem; font-weight: 690; color: var(--muted); padding: .14rem .39rem; border: 1px solid var(--line); border-radius: .31rem; }
.avatar { flex: none; display: inline-grid; place-items: center; width: 2.15rem; height: 2.15rem; border-radius: 50%; background: var(--soft); color: var(--nav-ink); font-size: .76rem; font-weight: 750; letter-spacing: .01em; }
.app-body { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 4;
  min-height: 4.15rem; padding: .55rem clamp(1.1rem, 3vw, 2.6rem);
  display: flex; align-items: center; justify-content: space-between; gap: .65rem;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.context { display: flex; align-items: center; gap: .65rem; color: var(--muted); font-size: .85rem; }
.context strong { color: var(--ink); font-weight: 660; }
.context .icon { width: .8rem; height: .8rem; }
.top-actions, .toolbar, .actions { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.top-actions { justify-content: end; flex-wrap: nowrap; }
.top-actions .avatar:hover { background: var(--accent-soft); }
.sample-compact { display: none; }
.mobile-bar, .nav-dismiss, .mobile-brand { display: none; }
main.workspace { max-width: 96rem; min-width: 0; margin-inline: auto; padding: 2rem clamp(1.1rem, 3vw, 2.6rem) 3rem; }
.page-head, .panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.page-head { margin-bottom: 1.38rem; align-items: flex-end; }
.page-head p, .panel-head p { color: var(--muted); margin-top: .35rem; }
.panel-head { margin-bottom: 1rem; align-items: center; }
.page-head .actions { flex: none; }
.stack { display: grid; gap: 1rem; min-width: 0; }
.stack-tight { display: grid; gap: .66rem; min-width: 0; }
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow); }
.panel-flat { border-radius: .75rem; padding: 1rem; border: 1px solid var(--line); }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.layout-equal { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.layout-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .48rem; min-height: 2.55rem; padding: .5rem .82rem; border: 1px solid var(--line); border-radius: .57rem; background: var(--surface); color: var(--ink); font-size: .87rem; font-weight: 650; line-height: 1.2; white-space: nowrap; }
.button:hover { background: var(--soft); border-color: var(--hover-line); }
.button.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.button.primary:hover { background: var(--primary-hover); }
.button.danger { color: var(--error-ink); }
.button.icon-btn { width: 2.6rem; padding: 0; }
.button:disabled { cursor: not-allowed; opacity: .56; }
.badge { display: inline-flex; flex: none; align-items: center; gap: .3rem; width: fit-content; padding: .2rem .52rem; border-radius: 999px; background: var(--soft); color: var(--nav-ink); font-size: .73rem; font-weight: 680; line-height: 1.5; white-space: nowrap; }
.badge.good { background: var(--success-surface); color: var(--success-ink); }
.badge.wait { background: var(--warning-surface); color: var(--warning-ink); }
.badge.error { background: var(--error-surface); color: var(--error-ink); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge .icon { width: .86rem; height: .86rem; }
.field, label.field { display: grid; gap: .35rem; font-size: .88rem; font-weight: 620; min-width: 0; }
.field small { color: var(--muted); font-weight: 450; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  width: 100%; min-height: 2.65rem; min-width: 0;
  border: 1px solid var(--input-line); border-radius: .55rem; color: var(--ink);
  background: var(--surface); padding: .52rem .68rem; font-size: .94rem; font-weight: 450;
}
select { appearance: none; padding-right: 2rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%237e7e7e' stroke-width='1.4'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .55rem center; background-size: 1rem; }
textarea { min-height: 5.6rem; resize: vertical; }
input[type="file"]::file-selector-button { margin-right: .65rem; border: 0; background: var(--soft); padding: .35rem .55rem; border-radius: .35rem; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 1rem; height: 1rem; margin: 0; flex: none; }
.check-label { display: inline-flex; align-items: center; gap: .5rem; font-size: .87rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.full { grid-column: 1 / -1; }
.fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.fieldset legend { font-weight: 680; padding: 0; margin-bottom: .5rem; }
.notice { padding: .72rem .85rem; background: var(--soft); color: var(--muted); border-radius: .55rem; font-size: .88rem; overflow-wrap: anywhere; }
.notice:empty { display: none; }
.notice[data-tone="error"] { color: var(--error-ink); background: var(--error-surface); }
.notice[data-tone="good"] { color: var(--success-ink); background: var(--success-surface); }
.empty { display: grid; justify-items: start; gap: .38rem; padding: .95rem 0 .27rem; }
.empty .icon-tile { margin-bottom: .2rem; }
.empty p { color: var(--muted); font-size: .89rem; }
.empty .button { margin-top: .45rem; }
.icon-tile { display: grid; place-items: center; flex: none; width: 2.36rem; height: 2.36rem; border-radius: .58rem; background: var(--soft); color: var(--nav-ink); }
.icon-tile.tint { background: var(--accent-soft); color: var(--accent); }
.list { display: grid; list-style: none; padding: 0; margin: 0; }
.list > li + li { border-top: 1px solid var(--line); }
.list-item { display: flex; align-items: flex-start; justify-content: space-between; gap: .7rem; padding: .77rem 0; min-width: 0; }
.list-item:first-child { padding-top: 0; }
.list-item:last-child { padding-bottom: 0; }
.list-item p { margin-top: .28rem; overflow-wrap: anywhere; }
.table-wrap { max-width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: .88rem; }
.data-table th { color: var(--muted); background: var(--raised); font-weight: 660; font-size: .79rem; }
.data-table th, .data-table td { padding: .72rem .65rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--hover); }
.data-table th.number, .data-table td.number { text-align: right; font-variant-numeric: tabular-nums; }
dialog { margin: auto; max-width: min(35rem, calc(100% - 1.5rem)); width: 100%; max-height: calc(100dvh - 1.5rem); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.22rem; background: var(--surface); color: var(--ink); box-shadow: 0 24px 80px rgb(22 22 22 / .25); overflow: auto; }
dialog::backdrop { background: rgb(25 25 25 / .43); }
.auth-shell { min-height: 100dvh; display: grid; place-items: center; padding: 1.25rem; }
.auth-card { width: min(100%, 29rem); margin-inline: auto; }
.auth-card .brand { margin-bottom: 1.7rem; }
.auth-card h1 { font-size: clamp(1.85rem, 5vw, 2.35rem); }
.auth-card .intro { margin: .55rem 0 1.25rem; }
.auth-card .form-submit { width: 100%; margin-top: .15rem; }
.auth-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100dvh; }
.auth-layout .auth-shell { padding: 2rem; }
.auth-splash { min-height: 36rem; background: var(--soft); position: relative; display: grid; place-items: center; border-inline-start: 1px solid var(--line); overflow: hidden; }
.auth-splash::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg,var(--line) 1px, transparent 1px); background-size: 40px 40px; mask-image: radial-gradient(ellipse at center, #000000 12%, transparent 73%); }
.auth-splash .brand-mark { z-index: 1; width: 7.7rem; height: 7.7rem; border-radius: 1.9rem; }
.auth-splash .brand-mark img { width: 5.4rem; height: 5.4rem; }
.auth-caption { position: absolute; z-index: 1; bottom: 2.3rem; left: 2.4rem; color: var(--ink); }
.auth-caption strong { font-size: 1.35rem; }
.auth-caption p { color: var(--muted); font-size: .86rem; margin-top: .25rem; }
@media (max-width: 65rem) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: min(18rem, 88vw); height: 100dvh; z-index: 12; transform: translateX(-105%); visibility: hidden; transition: transform .19s ease, visibility .19s; }
  .side[data-open="true"] { transform: translateX(0); visibility: visible; box-shadow: 10px 0 35px rgb(25 25 25 / .15); }
  .nav-dismiss { display: grid; position: fixed; inset: 0; z-index: 11; background: rgb(21 21 21 / .28); border: 0; }
  .context { display: none; }
  .mobile-bar { display: flex; align-items: center; gap: .62rem; min-width: 0; }
  .mobile-bar .brand small { display: none; }
}
@media (max-width: 48rem) {
  .layout-2 { grid-template-columns: minmax(0, 1fr); }
  .auth-layout { grid-template-columns: minmax(0, 1fr); }
  .auth-splash { display: none; }
}
@media (max-width: 36rem) {
  .page-head { display: grid; margin-bottom: 1.05rem; }
  .panel { padding: 1rem; }
  .layout-equal { grid-template-columns: minmax(0, 1fr); }
  .layout-3 { grid-template-columns: minmax(0, 1fr); gap: .6rem; }
  main.workspace { padding-top: 1.25rem; }
  .topbar { min-height: 3.6rem; }
  .page-head p { font-size: .94rem; }
  .auth-layout .auth-shell { padding: 1.25rem; }
}
@media (max-width: 27rem) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .topbar { padding-inline: .7rem; }
  .mobile-bar { gap: .43rem; }
  .mobile-bar .brand { gap: .4rem; }
  .mobile-bar .brand-mark { width: 1.95rem; height: 1.95rem; }
  .mobile-bar .brand-mark img { width: 1.22rem; height: 1.22rem; }
  .mobile-bar .brand strong { font-size: .8rem; }
  .sample-wide { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .sample-compact { display: inline; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
