@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/inter.ttf') format('truetype');
}
:root {
  color-scheme: light;
  --background: #f8f9f5;
  --surface: #fff;
  --surface-soft: #edf3eb;
  --text: #20382f;
  --muted: #52665a;
  --line: #dfe6df;
  --primary: #286349;
  --on-primary: #fff;
  --warning: #794a19;
  --error: #9b342d;
  --radius: 16px;
  --shadow: 0 12px 32px #223c2e1a;
  --rail: #182e25;
  --rail-active: #365644;
  --rail-accent: #b5d6ac;
  --atlas-form-surface: linear-gradient(132deg, color-mix(in srgb, var(--surface) 88%, var(--primary)), var(--surface) 72%);
  --atlas-form-tile: linear-gradient(122deg, color-mix(in srgb, var(--surface-soft) 82%, var(--primary)), var(--surface-soft) 55%, var(--surface));
  --atlas-primary-fill: linear-gradient(145deg, color-mix(in srgb, var(--primary) 94%, white), var(--primary) 50%, color-mix(in srgb, var(--primary) 69%, black));
  font-family: Inter, system-ui, sans-serif;
  font-size: 15px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --background: #131e19;
    --surface: #1c2a23;
    --surface-soft: #25372c;
    --text: #ecf1ea;
    --muted: #b3c4b7;
    --line: #496052;
    --primary: #acd099;
    --on-primary: #14291c;
    --warning: #f2ce98;
    --error: #ffb0aa;
    --atlas-primary-fill: linear-gradient(145deg, color-mix(in srgb, var(--primary) 56%, white), var(--primary) 54%, color-mix(in srgb, var(--primary) 85%, black));
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--text); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: clamp(1.65rem, 3vw, 2.25rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; }
p { margin: 0; line-height: 1.55; }
a { color: var(--primary); text-underline-offset: .18em; }
small, .muted, time { color: var(--muted); }
.nav-symbols { position: absolute; }
.workspace { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100dvh; }
#admin-rail { display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; overflow: auto; padding: 24px 13px 14px; background: var(--rail); color: #e8eee8; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; padding: 0 11px 27px; text-decoration: none; }
.brand strong { font-size: 17px; letter-spacing: -.045em; }
.brand small { color: #b4c5b8; font-size: 12px; }
.brand-icon { width: 42px; height: 42px; flex: none; border-radius: 11px; background: #c5e1bc; color: var(--rail); display: inline-grid; place-items: center; font-size: 32px; line-height: 1; }
#admin-nav { display: grid; gap: 4px; margin-bottom: 19px; }
#admin-nav a { display: flex; align-items: center; gap: 11px; min-height: 44px; border-radius: 9px; padding: 10px 13px; color: #dce6db; font-size: 14px; text-decoration: none; }
#admin-nav a:hover { background: #264335; }
#admin-nav a[aria-current="page"] { background: var(--rail-active); color: #fff; box-shadow: inset 3px 0 var(--rail-accent); }
.nav-icon { width: 21px; height: 21px; flex: none; fill: currentColor; }
.rail-account { display: grid; justify-items: start; gap: 8px; margin-top: auto; padding: 16px 8px 0; border-top: 1px solid #385043; overflow-wrap: anywhere; }
.rail-account button { color: inherit; border-color: #597466; }
.top-bar { display: flex; gap: 10px; min-height: 64px; align-items: center; padding: 8px clamp(16px,3.2vw,48px); border-bottom: 1px solid var(--line); background: var(--surface); }
.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 13px; }
.breadcrumb strong { color: var(--text); font-weight: 550; }
.mobile-menu, #admin-menu-backdrop { display: none; }
.body { min-width: 0; }
.body main { max-width: 1560px; margin: 0 auto; padding: 32px clamp(16px,3.2vw,48px) 50px; display: grid; gap: 18px; min-width: 0; }
.body-region { display: grid; gap: 16px; min-width: 0; }
.button, button {
  display: inline-flex; justify-content: center; align-items: center; min-height: 44px;
  font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; padding: 8px 14px;
  border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
button:disabled { opacity: .6; cursor: default; }
.primary { background: var(--atlas-primary-fill); color: var(--on-primary); border-color: transparent; }
.quiet { background: transparent; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; min-width: 0; }
.sign-in { display: grid; place-items: center; min-height: 100dvh; padding: 16px; }
.access { width: min(440px, 100%); justify-items: start; padding: 24px; gap: 18px; box-shadow: var(--shadow); }
.toolbar, .tabs, .actions, .chips { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.tabs button[aria-pressed=true] { color: var(--on-primary); background: var(--primary); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; min-width: 0; }
.tariff-cards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.tariff-card { grid-row: span var(--tariff-rows); grid-template-rows: subgrid; align-items: start; gap: 10px; background: var(--atlas-form-tile); }
.tariff-card h3 { color: var(--muted); margin-top: 4px; }
.feature-list { display: grid; gap: 10px; min-width: 0; }
.quota-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: baseline; gap: 8px; }
.quota-row > :last-child { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; min-width: 3.5ch; }
.metric { font-size: 1.65rem; font-weight: 720; }
label { display: grid; gap: 6px; min-width: 0; font-weight: 620; }
input, select, textarea { min-width: 0; max-width: 100%; min-height: 44px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
input[type="checkbox"] { min-height: 0; width: 18px; height: 18px; accent-color: var(--primary); }
.check { display: flex; align-items: center; min-height: 44px; gap: 8px; }
textarea { min-height: 84px; resize: vertical; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.chip { border-radius: 999px; background: var(--surface-soft); color: var(--text); padding: 4px 9px; white-space: normal; overflow-wrap: anywhere; }
.table-wrap { overflow: auto; max-width: 100%; }
.exercise-preview { max-width: 100%; max-height: 240px; object-fit: contain; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; }
th { font-size: .88rem; color: var(--muted); }
.reference-table { min-inline-size: 0; container-type: inline-size; }
.reference-table table { min-inline-size: 36rem; }
.reference-table th, .reference-table td:where(:not(:first-child):not(:last-child)),
.reference-table .chip { white-space: nowrap; overflow-wrap: normal; }
.reference-table td:first-child { min-inline-size: 12ch; overflow-wrap: break-word; }
.reference-table td:last-child { inline-size: 1%; }
.reference-table .actions { inline-size: max-content; max-inline-size: 18rem; }
dl { display: grid; grid-template-columns: minmax(90px, 1fr) 2fr; gap: 8px; margin: 0; }
dd { margin: 0; overflow-wrap: anywhere; }
dt { color: var(--muted); }
.chart { display: grid; gap: 8px; min-width: 0; }
.chart-plot { min-width: 0; height: 190px; }
.daily-chart { display: block; width: 100%; height: 100%; }
.error { color: var(--error); }
dialog { color: var(--text); background: var(--atlas-form-surface); border: 1px solid var(--line); border-radius: 18px; width: min(600px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; box-shadow: var(--shadow); }
dialog::backdrop { background: #0a1b14a0; }
dialog h2 { padding: 16px 18px 12px; }
.dialog-body { padding: 8px 18px 18px; display: grid; gap: 12px; }
.dialog-footer { background: var(--surface); border-top: 1px solid var(--line); position: sticky; bottom: 0; padding: 12px 18px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
[hidden] { display: none !important; }
@media(max-width: 1110px) {
  .workspace { grid-template-columns: 195px minmax(0,1fr); }
}
@media(max-width: 890px) {
  .tariff-cards { grid-template-columns: minmax(0,1fr); }
  .tariff-card { grid-row: auto; grid-template-rows: auto; }
  .workspace { grid-template-columns: minmax(0,1fr); }
  #admin-rail { position: fixed; inset: 0 auto 0 0; z-index: 6; width: min(242px, 100vw); visibility: hidden; transform: translateX(-110%); }
  #admin-rail.open { transform: none; visibility: visible; }
  .mobile-menu { display: inline-flex; width: 44px; padding: 0; flex: none; }
  #admin-menu-backdrop { display: block; position: fixed; inset: 0; z-index: 5; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 0; background: #17291f88; }
  .top-bar, .body main { padding-left: 16px; padding-right: 16px; }
}
@media(max-width: 590px) {
  .cards { grid-template-columns: minmax(0,1fr); }
  .body main { padding-top: 18px; }
  .toolbar > label { flex: 1 1 135px; }
  .toolbar > label > * { width: 100%; }
}
@container (max-width: 48rem) {
  .reference-table table, .reference-table tbody { display: block; min-inline-size: 0; }
  .reference-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .reference-table tr { display: grid; grid-template-columns: minmax(0,1fr) max-content; gap: 6px 12px; border-bottom: 1px solid var(--line); padding: 12px 0; }
  .reference-table td { min-inline-size: 0; inline-size: auto; border: 0; padding: 0; }
  .reference-table td:nth-child(1) { grid-area: 1 / 1; min-inline-size: 0; font-weight: 650; }
  .reference-table td:nth-child(2) { grid-area: 2 / 1; color: var(--muted); overflow-wrap: anywhere; white-space: normal; }
  .reference-table td:nth-child(3) { grid-area: 2 / 2; justify-self: end; }
  .reference-table td:nth-child(4) { grid-area: 1 / 2; justify-self: end; }
  .reference-table td:last-child { grid-area: 3 / 1 / auto / span 2; inline-size: auto; }
  .reference-table .actions { inline-size: auto; max-inline-size: none; }
}
@media(prefers-reduced-motion: reduce) { * { scroll-behavior: auto; } }
