/* ===========================================================================
   SmartGrading — 1d / Studio Dark
   Sistem vizual global pentru desktop, mobil, spații PDF și tipărire.
   =========================================================================== */

:root {
  color-scheme: dark;

  /* Studio Dark: paleta exactă a direcției 1d */
  --bg:             #101014;
  --bg-hover:       #17181d;
  --bg-soft:        #18191e;
  --surface:        #1c1d23;
  --surface-2:      #22232a;
  --surface-3:      #292a32;
  --border:         #22232a;
  --border-strong:  #2a2b33;
  --text:           #ecedf0;
  --text-soft:      #b8bac2;
  --text-muted:     #9a9ca6;
  --text-label:     #8a8c95;
  --text-faint:     #7e808a;

  --accent:         #c9f05a;
  --accent-hover:   #d6f87a;
  --accent-soft:    rgba(201, 240, 90, .12);
  --accent-text:    #101014;
  --danger:         #ff7b86;
  --danger-soft:    rgba(255, 123, 134, .12);
  --ok:             #75dc9a;
  --ok-soft:        rgba(117, 220, 154, .12);
  --warn:           #ef884d;
  --warn-soft:      rgba(239, 136, 77, .12);

  --sidebar-bg:     #101014;
  --sidebar-hover:  #17181d;
  --sidebar-surface:#1c1d23;
  --sidebar-text:   #9a9ca6;
  --sidebar-faint:  #7e808a;
  --sidebar-active: #ecedf0;

  --shadow-sm: 0 1px 0 rgba(255, 255, 255, .025);
  --shadow-md: 0 14px 34px rgba(0, 0, 0, .24);
  --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, .72);
  --focus-ring: 0 0 0 3px rgba(201, 240, 90, .24);

  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --sidebar-w: 244px;
  --font: "Manrope", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: "Space Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

@supports (color: oklch(85% .17 120)) {
  :root {
    --accent: oklch(85% .17 120);
    --accent-hover: oklch(89% .16 120);
    --warn: oklch(72% .16 40);
  }
}

/* Tema alternativă existentă rămâne disponibilă, în același limbaj Studio. */
[data-theme="light"] {
  color-scheme: light;
  --bg:             #f4f5ef;
  --bg-hover:       #eceee5;
  --bg-soft:        #e9ebe2;
  --surface:        #ffffff;
  --surface-2:      #f0f1eb;
  --surface-3:      #e5e8de;
  --border:         #e1e4d9;
  --border-strong:  #cdd2c3;
  --text:           #181914;
  --text-soft:      #42453d;
  --text-muted:     #62665b;
  --text-label:     #6b6f63;
  --text-faint:     #6b6f63;
  --accent:         #5e7900;
  --accent-hover:   #4e6800;
  --accent-soft:    rgba(94, 121, 0, .11);
  --accent-text:    #ffffff;
  --danger:         #bd3344;
  --danger-soft:    rgba(189, 51, 68, .1);
  --ok:             #267a49;
  --ok-soft:        rgba(38, 122, 73, .1);
  --warn:           #a74d1d;
  --warn-soft:      rgba(167, 77, 29, .1);
  --sidebar-bg:     #181914;
  --sidebar-hover:  #23251f;
  --sidebar-surface:#2a2c24;
  --sidebar-text:   #aeb2a6;
  --sidebar-faint:  #8f9388;
  --sidebar-active: #ffffff;
  --shadow-sm: 0 1px 2px rgba(32, 35, 25, .05);
  --shadow-md: 0 12px 28px rgba(32, 35, 25, .1);
  --shadow-lg: 0 30px 70px -30px rgba(32, 35, 25, .34);
  --focus-ring: 0 0 0 3px rgba(94, 121, 0, .2);
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { min-height: 100dvh; }
button, input, select, textarea { font: inherit; }
button, select, label, summary { touch-action: manipulation; }
button, a, select, summary, input[type="checkbox"], input[type="radio"] { cursor: pointer; }
::selection { background: var(--accent); color: var(--accent-text); }
/* Regulile de componentă declară `display`, iar stilul autorului bate foaia
   browserului; fără asta, atributul `hidden` nu ar ascunde nimic. */
[hidden] { display: none !important; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -.025em;
  text-wrap: balance;
}

p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  transform: translateY(-160%);
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
  text-decoration: none;
  transition: transform .18s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* Bare de derulare discrete, dar vizibile. */
* { scrollbar-color: var(--border-strong) transparent; scrollbar-width: thin; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border: 3px solid transparent; border-radius: 999px; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background-color: var(--text-faint); }

/* -------------------------------- layout --------------------------------- */

.app { display: flex; min-height: 100dvh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  border-right: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  padding: 20px 16px 14px;
}

.brand-mark {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.brand-mark svg { width: 76%; height: 76%; }

.brand-text {
  color: var(--sidebar-active);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.05;
}

.brand-text em {
  display: block;
  margin-top: 4px;
  color: var(--sidebar-faint);
  font-family: var(--font);
  font-size: 9.5px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: .13em;
  line-height: 1;
  text-transform: uppercase;
}

/* Închiderea și hamburgerul comandă doar sertarul flotant de pe mobil. Selectorul
   e compus pentru că `.icon-btn` declară `display` mai jos în fișier. */
.icon-btn.sidebar-close {
  display: none;
  margin-left: auto;
  color: var(--sidebar-text);
}

.class-picker { padding: 0 16px 15px; }
.class-picker label {
  display: block;
  margin-bottom: 7px;
  color: var(--sidebar-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.class-picker select {
  width: 100%;
  min-height: 42px;
  padding: 9px 34px 9px 13px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}
.class-picker select:hover { background: var(--surface-2); }
.class-picker select:focus-visible { border-color: var(--accent); box-shadow: var(--focus-ring); outline: none; }
.class-picker select option { background: var(--surface); color: var(--text); }

nav {
  flex: 1;
  overflow-y: auto;
  padding: 2px 10px 14px;
}

nav a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 40px;
  margin-bottom: 3px;
  padding: 9px 32px 9px 14px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background .18s var(--ease), color .18s var(--ease);
}

nav a:hover { background: var(--sidebar-hover); color: var(--sidebar-active); }
nav a.active { background: var(--sidebar-surface); color: var(--sidebar-active); font-weight: 650; }
nav a.active::after {
  content: "";
  position: absolute;
  right: 14px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
nav a .ico { display: none; }

nav .nav-group {
  padding: 15px 14px 6px;
  color: var(--sidebar-faint);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.sidebar-foot {
  display: grid;
  gap: 8px;
  padding: 13px 14px 16px;
  border-top: 1px solid var(--border);
}
.sidebar-foot .btn { color: var(--sidebar-text); }

.sidebar-account {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  margin-bottom: 3px;
  padding: 2px 2px 8px;
}
.sidebar-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(201, 240, 90, .18);
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font: 700 12px var(--font-display);
}
.sidebar-account-copy { min-width: 0; flex: 1; line-height: 1.2; }
.sidebar-account-copy strong,
.sidebar-account-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-account-copy strong { color: var(--sidebar-active); font-size: 12px; font-weight: 650; }
.sidebar-account-copy span { margin-top: 3px; color: var(--sidebar-faint); font: 500 9.5px var(--font-mono); }
.sidebar-account-alert {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--warn-soft);
  color: var(--warn);
  font: 700 11px var(--font-mono);
}
.logout-btn:hover { border-color: rgba(255, 123, 134, .36) !important; color: var(--danger) !important; }

.main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 91px;
  padding: 18px 26px 16px;
  background: rgba(16, 16, 20, .92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(140%) blur(16px);
}

[data-theme="light"] .topbar { background: rgba(244, 245, 239, .9); }

.topbar-title {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar-title h1 {
  order: 2;
  font-size: clamp(23px, 2vw, 30px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.035em;
}

.topbar-title p {
  order: 1;
  margin-bottom: 5px;
  overflow: hidden;
  color: var(--text-label);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .075em;
  line-height: 1.25;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.topbar-title p:empty { display: none; }

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: flex-end;
}

.icon-btn.menu-btn { display: none; }

.content {
  width: 100%;
  max-width: 1480px;
  padding: 22px 26px 32px;
}
.content.wide { max-width: none; padding: 0; }

.scrim, .fab { display: none; }

/* ----------------------------- componente -------------------------------- */

.card {
  overflow: clip;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 16px; }
/* Blocurile de nivel înalt ale paginii: grilele nu sunt „.card”, așa că regula
   de mai sus nu le prinde și blocurile s-ar lipi unul de altul. */
.content > .grid + .card,
.content > .card + .grid,
.content > .grid + .grid { margin-top: 16px; }

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 11px;
  padding: 16px 19px;
  border-bottom: 1px solid var(--border);
}
.card-head h2 { font-size: 16px; letter-spacing: -.02em; }
.card-head .sub { color: var(--text-label); font-size: 11.5px; }
.card-head .spacer { flex: 1; }
.card-body { padding: 19px; }
.card-body.tight { padding: 0; }

.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
/* Într-o grilă distanța o dă „gap”; o margine ar coborî cardurile din primul
   rând față de vecinele lor. */
.grid > .card + .card { margin-top: 0; }

.stat { min-height: 116px; padding: 18px; }
.stat .label {
  color: var(--text-label);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.stat .value {
  margin-top: 7px;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.035em;
  line-height: 1;
}
.stat .hint { margin-top: 7px; color: var(--text-label); font-size: 11.5px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-text);
  font: 700 12.5px/1.2 var(--font);
  white-space: nowrap;
  text-decoration: none;
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease), transform .12s var(--ease);
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-text); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn:disabled { opacity: .42; cursor: not-allowed; transform: none; }

.btn.ghost {
  background: transparent;
  color: var(--text-soft);
  border-color: var(--border-strong);
}
.btn.ghost:hover { background: var(--surface-2); border-color: var(--surface-3); color: var(--text); }
.sidebar-foot .btn.ghost { color: var(--sidebar-text); border-color: var(--sidebar-surface); }
.sidebar-foot .btn.ghost:hover { background: var(--sidebar-hover); color: var(--sidebar-active); }
.btn.subtle { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.btn.subtle:hover { background: var(--accent); color: var(--accent-text); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #101014; }
[data-theme="light"] .btn.danger { color: #fff; }
.btn.danger:hover { filter: brightness(1.08); }
.btn.danger.ghost { background: transparent; color: var(--danger); border-color: rgba(255, 123, 134, .38); }
.btn.danger.ghost:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.sm { min-height: 34px; padding: 7px 11px; font-size: 11.75px; }
.btn.block { width: 100%; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }

.report-actions { display: inline-flex; align-items: center; gap: 8px; }
.report-action {
  min-width: 44px;
  min-height: 44px;
  border-color: var(--border-strong);
  color: var(--text-soft);
  text-decoration: none;
}
.report-action svg { display: block; width: 20px; height: 20px; }
.report-action.download {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border-strong));
  background: var(--accent-soft);
  color: var(--accent);
}
.report-action:hover { text-decoration: none; }
.report-action.download:hover { border-color: var(--accent); background: var(--accent); color: var(--accent-text); }
.report-action:active { transform: scale(.97); }

.form { width: 100%; }
label.field { display: block; margin-bottom: 15px; }
.form-field { display: block; margin-bottom: 15px; }
label.field > span:first-child,
.field > span:first-child,
.form-field > label:first-child {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: .01em;
}

input[type="text"], input[type="password"], input[type="date"], input[type="number"], input[type="search"],
input[type="file"], input[type="color"], select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font: 500 14px/1.45 var(--font);
  caret-color: var(--accent);
  transition: background .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}
input[type="color"] { min-width: 54px; padding: 5px; }
input[type="file"] { padding: 8px; color: var(--text-muted); }
input::file-selector-button {
  margin-right: 10px;
  padding: 6px 10px;
  border: 0;
  border-radius: var(--radius-xs);
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
}
textarea { min-height: 96px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--text-label); opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: var(--text-faint); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-3);
  box-shadow: var(--focus-ring);
}
select option { background: var(--surface); color: var(--text); }
input[type="checkbox"], input[type="radio"] { width: 17px; height: 17px; flex: 0 0 auto; accent-color: var(--accent); }

.row { display: flex; flex-wrap: wrap; gap: 12px; }
.row > * { min-width: 150px; flex: 1; }
.checkline { display: flex; align-items: center; gap: 9px; min-height: 40px; color: var(--text-soft); font-size: 13.5px; }
.checkline input { width: 17px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-strong);
  color: var(--text-label);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s var(--ease); }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; }
.table-wrap { max-width: 100%; overflow-x: auto; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 23px;
  padding: 3px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 10.75px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}
.pill.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.muted { background: var(--surface-2); color: var(--text-label); }

.tag-code {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 4px 7px;
  border: 1px solid rgba(201, 240, 90, .16);
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font: 600 10.5px/1 var(--font-mono);
  white-space: nowrap;
}

.empty { padding: 54px 22px; color: var(--text-muted); text-align: center; }
.empty .big {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin: 0 auto 13px;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 19px;
  filter: grayscale(1);
}
.empty h3 { margin-bottom: 6px; color: var(--text); font-size: 16px; }
.empty p { max-width: 470px; margin: 0 auto 17px; font-size: 13px; line-height: 1.65; text-wrap: pretty; }

.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.mono { font-family: var(--font-mono); }
.multiline {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.feedback-list { display: grid; gap: 7px; margin-top: 8px; }
.feedback-note {
  padding: 8px 10px;
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  background: var(--bg-hover);
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.55;
  break-inside: avoid-page;
}
.feedback-note .comment-context {
  margin-bottom: 3px;
  color: var(--text-label);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .04em;
}
.assign-comment, .matrix-comment {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.45;
}
.matrix-comment { min-width: 140px; max-width: 240px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.spacer { flex: 1; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Nivelurile de performanță păstrează culorile semantice din baza de date. */
.levels { display: flex; flex-wrap: wrap; gap: 7px; }
.level-btn {
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font: 650 11.5px var(--font);
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), transform .12s var(--ease);
}
.level-btn:hover { border-color: var(--text-faint); background: var(--surface-2); color: var(--text); }
.level-btn:active { transform: scale(.98); }
.level-btn:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.level-btn.on { color: #fff; border-color: transparent; font-weight: 700; }

/* -------------------------------- modal ---------------------------------- */

.modal-host {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(5, 5, 7, .72);
  backdrop-filter: blur(8px);
}
.modal-host[hidden] { display: none !important; }

.modal {
  display: flex;
  flex-direction: column;
  width: min(620px, 100%);
  max-height: 88dvh;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: modal-in .2s var(--ease);
}
.modal.lg { width: min(940px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.modal-head h2 { flex: 1; font-size: 17px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; gap: 9px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--border); background: var(--bg-hover); }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }

/* -------------------------------- toasts --------------------------------- */

.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: none;
}
.toast {
  max-width: 360px;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  animation: toast-in .18s var(--ease);
}
.toast.err { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--ok); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ------------------------- spații de lucru cu PDF ------------------------- */

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  height: calc(100dvh - 91px);
  background: var(--bg);
}
.workspace.wide-panel { grid-template-columns: minmax(0, 1fr) 460px; }

.ws-pdf {
  position: relative;
  overflow: auto;
  border-right: 1px solid var(--border);
  background: #0b0b0e;
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .045) 1px, transparent 0);
  background-size: 20px 20px;
}
.ws-pdf:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
[data-theme="light"] .ws-pdf { background-color: #dfe2d9; background-image: radial-gradient(circle at 1px 1px, rgba(24, 25, 20, .08) 1px, transparent 0); }

.ws-side {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--surface);
}
.ws-side-head {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 15px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(28, 29, 35, .96);
  backdrop-filter: blur(12px);
}
[data-theme="light"] .ws-side-head { background: rgba(255, 255, 255, .94); }
.ws-side-body { flex: 1; padding: 14px 16px; }
.ws-side-foot {
  position: sticky;
  bottom: 0;
  padding: 13px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.pdf-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(28, 29, 35, .94);
  backdrop-filter: blur(12px);
}
[data-theme="light"] .pdf-toolbar { background: rgba(255, 255, 255, .94); }
.quick-assign {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(170px, 1fr);
  flex: 0 1 350px;
  align-items: center;
  gap: 8px;
  min-width: 230px;
  margin-left: 4px;
}
.quick-assign-label {
  display: flex;
  flex-direction: column;
  gap: 1px;
  color: var(--text-label);
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.15;
  cursor: text;
}
.quick-assign-page {
  color: var(--accent);
  font: 650 10.5px/1.2 var(--font-mono);
  font-variant-numeric: tabular-nums;
}
input[type="search"].quick-assign-input {
  min-height: 36px;
  padding: 7px 10px;
  border-color: var(--border-strong);
  background: color-mix(in srgb, var(--surface-2) 90%, transparent);
  font-size: 12.5px;
}
.quick-assign-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  z-index: 12;
  max-height: min(300px, 45dvh);
  overflow-y: auto;
  padding: 5px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.quick-assign-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  color: var(--text-soft);
  cursor: pointer;
}
.quick-assign-option:hover,
.quick-assign-option.active,
.quick-assign-option[aria-selected="true"] {
  border-color: color-mix(in srgb, var(--accent) 32%, transparent);
  background: var(--accent-soft);
  color: var(--text);
}
.quick-assign-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quick-assign-meta {
  color: var(--text-label);
  font: 550 9.5px/1.2 var(--font-mono);
  white-space: nowrap;
}
.quick-assign-empty { padding: 12px 10px; color: var(--text-muted); font-size: 12px; text-align: center; }
.pdf-pages { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 18px; }
.pdf-page {
  position: relative;
  max-width: 100%;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .32);
}
.pdf-page canvas { display: block; max-width: 100%; height: auto; border-radius: 5px; }
.pdf-page .page-no {
  position: absolute;
  top: 9px;
  left: 9px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background: rgba(16, 16, 20, .84);
  color: #fff;
  font: 600 10.5px var(--font-mono);
  backdrop-filter: blur(8px);
}
.pdf-page .page-owner {
  position: absolute;
  top: 9px;
  right: 9px;
  max-width: 60%;
  overflow: hidden;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pdf-page.is-start { outline: 3px solid var(--accent); outline-offset: 3px; }

.assign-list { display: flex; flex-direction: column; gap: 6px; }
.assign-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 45px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-soft);
  cursor: pointer;
  font-size: 13px;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.assign-row:hover { border-color: var(--border-strong); background: var(--surface-3); color: var(--text); }
.assign-row.assigned { border-color: rgba(117, 220, 154, .32); background: var(--ok-soft); }
.assign-row.absent { opacity: .58; }
.assign-row .nm { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; }
.assign-row .pg { color: var(--text-label); font-family: var(--font-mono); font-size: 10.5px; font-variant-numeric: tabular-nums; }

.standards-picker {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0 0 15px;
  padding: 0;
  border: 0;
}
.standards-picker-legend {
  display: block;
  width: 100%;
  margin: 0 0 6px;
  padding: 0;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: .01em;
}
.standards-picker-count { margin-left: 7px; color: var(--text-label); font-weight: 500; }
.standards-picker-help {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
  text-wrap: pretty;
}
.standards-picker-list {
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  max-height: 260px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1px 5px 1px 1px;
  scrollbar-gutter: stable;
}
.standards-picker-list.compact { max-height: 240px; }
.standard-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-soft);
  cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.standard-choice:hover { border-color: var(--border-strong); background: var(--surface-3); color: var(--text); }
.standard-choice:focus-within { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.standard-choice:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 32%, transparent); background: var(--accent-soft); }
.standard-choice > input { margin: 3px 0 0; }
.standard-choice-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
}
.standard-choice-code {
  max-width: 100%;
  min-width: 0;
  justify-self: start;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}
.standard-choice-text {
  min-width: 0;
  max-width: 100%;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
}

.std-block {
  margin-bottom: 10px;
  padding: 13px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--surface-2);
}
.std-block:last-child { margin-bottom: 0; }
.std-block .std-head { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 8px; }
.std-block .std-desc { margin-top: 4px; margin-bottom: 9px; color: var(--text-muted); font-size: 12px; line-height: 1.55; }
.std-block details { margin-top: 9px; border-top: 1px solid var(--border-strong); padding-top: 8px; }
.std-block summary { color: var(--text-label); font-size: 11.5px; font-weight: 600; }
.std-block summary:hover { color: var(--text); }
.std-block .descriptor { padding: 8px 0; border-top: 1px dashed var(--border-strong); color: var(--text-soft); font-size: 12px; }
.std-block details .descriptor:first-of-type { margin-top: 8px; }
.std-block .descriptor b { font-weight: 700; }

/* -------------------------------- grafice -------------------------------- */

.chart { width: 100%; overflow-x: auto; }
.chart svg { display: block; max-width: 100%; height: auto; }
.chart svg text { font-family: var(--font); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; color: var(--text-muted); font-size: 11.5px; }
.legend i { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 3px; }

.heat-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.4fr) repeat(auto-fit, minmax(26px, 1fr));
  align-items: center;
  gap: 4px;
}
.heat-cell { height: 27px; border-radius: 6px; background: var(--surface-2); }

.ws-switch {
  display: none;
  gap: 7px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 6;
}

/* ----------------------- autentificare și securitate --------------------- */

.auth-body {
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 16% 14%, rgba(201, 240, 90, .08), transparent 27rem),
    radial-gradient(circle at 86% 88%, rgba(117, 220, 154, .045), transparent 25rem),
    var(--bg);
}
.auth-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .38;
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .08) 1px, transparent 0);
  background-size: 26px 26px;
  mask-image: linear-gradient(to bottom, #000, transparent 72%);
}
[data-theme="light"] .auth-body::before { opacity: .2; }

.auth-page {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.auth-card {
  width: min(430px, 100%);
  padding: 28px;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 46px; }
.auth-brand .brand-text { color: var(--text); }
.auth-brand .brand-text em { color: var(--text-label); }
.auth-intro { margin-bottom: 25px; }
.auth-intro .eyebrow {
  display: block;
  margin-bottom: 10px;
  color: var(--accent);
  font: 600 9.5px var(--font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.auth-intro h1 { font-size: clamp(28px, 7vw, 36px); letter-spacing: -.045em; }
.auth-intro p { margin-top: 9px; color: var(--text-muted); font-size: 13px; line-height: 1.65; }
.auth-form .form-field { margin-bottom: 17px; }
.auth-submit { width: 100%; min-height: 46px; margin-top: 4px; }

.password-control { position: relative; display: block; }
.password-control input { min-height: 48px; padding-right: 82px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  min-width: 68px;
  min-height: 44px;
  padding: 6px 9px;
  transform: translateY(-50%);
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}
.password-toggle:hover { background: var(--surface-3); color: var(--text); }
.password-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }

.form-message {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.55;
}
.form-message.error { border-color: rgba(255, 123, 134, .34); background: var(--danger-soft); color: var(--danger); }
.form-message.success { border-color: rgba(117, 220, 154, .3); background: var(--ok-soft); color: var(--ok); }

.account-grid {
  display: grid;
  grid-template-columns: minmax(230px, 310px) minmax(0, 680px);
  gap: 14px;
  align-items: start;
}
.account-grid .card + .card { margin-top: 0; }
.account-profile { display: flex; align-items: center; gap: 14px; }
.account-profile > div:last-child { display: grid; gap: 5px; min-width: 0; }
.account-profile > div:last-child > * { min-width: 0; overflow-wrap: anywhere; }
.account-avatar {
  display: grid;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 16px;
  background: var(--accent);
  color: var(--accent-text);
  font: 700 19px var(--font-display);
}
.account-password-form { max-width: 520px; }
.account-password-form .btn { min-width: 150px; min-height: 44px; }
.password-hint { margin: -8px 0 15px; color: var(--text-label); font-size: 11px; line-height: 1.55; }
.security-warning {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(239, 136, 77, .28);
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  color: var(--warn);
}
.security-warning strong { display: block; font-size: 12.5px; }
.security-warning p { margin-top: 3px; color: var(--text-soft); font-size: 11.5px; line-height: 1.55; }

/* -------------------------------- print ---------------------------------- */

@media print {
  :root, [data-theme="light"] {
    color-scheme: light;
    --bg: #fff;
    --bg-hover: #f3f3f1;
    --bg-soft: #f4f4f2;
    --surface: #fff;
    --surface-2: #f7f7f5;
    --surface-3: #efefec;
    --border: #ddd;
    --border-strong: #bbb;
    --text: #111;
    --text-soft: #333;
    --text-muted: #555;
    --text-label: #555;
    --text-faint: #666;
    --accent: #4f6200;
    --accent-hover: #405100;
    --accent-soft: rgba(79, 98, 0, .1);
    --accent-text: #fff;
  }
  .sidebar, .fab, .no-print, .toasts, .menu-btn, .topbar-actions,
  .auth-page, .account-security-card { display: none !important; }
  .app, .main { display: block; min-height: 0; }
  .topbar {
    position: static;
    display: block;
    min-height: 0;
    margin-bottom: 18px;
    padding: 0 0 14px;
    border-bottom: 1px solid #bbb;
    background: #fff;
    color: #111;
    backdrop-filter: none;
  }
  .content { max-width: none; padding: 0; }
  .card { break-inside: auto; border: 1px solid #ccc; box-shadow: none; }
  .card-head { break-after: avoid-page; }
  .card.stat, .std-block, tr, .feedback-note { break-inside: avoid-page; }
  .std-block { border: 1px solid #ddd; }
  body { background: #fff; color: #111; font-size: 12px; }
}

/* ------------------------------- responsive ------------------------------ */

@media screen and (max-width: 1100px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 350px; }
  .workspace.wide-panel { grid-template-columns: minmax(0, 1fr) 400px; }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media screen and (max-width: 860px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(284px, calc(100vw - 48px));
    transform: translateX(-102%);
    transition: transform .24s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  body.nav-open { overflow: hidden; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(5, 5, 7, .7);
    backdrop-filter: blur(4px);
  }
  .icon-btn.sidebar-close { display: inline-flex; }
  .icon-btn.menu-btn { display: inline-flex; }
  .brand { padding-top: calc(20px + env(safe-area-inset-top)); }
  .sidebar-foot { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }

  .fab {
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border: 0;
    border-radius: 14px;
    background: var(--accent);
    color: var(--accent-text);
    box-shadow: 0 16px 32px rgba(0, 0, 0, .38);
    font-size: 19px;
    font-weight: 700;
  }
  body.nav-open .fab { display: none; }
  .toasts { bottom: calc(82px + env(safe-area-inset-bottom)); }

  .topbar { min-height: 74px; padding: calc(12px + env(safe-area-inset-top)) 14px 12px; }
  .topbar-title h1 { font-size: 20px; }
  .topbar-title p { margin-bottom: 3px; font-size: 9.5px; }
  .topbar-actions { gap: 7px; }
  .content { padding: 14px 14px calc(80px + env(safe-area-inset-bottom)); }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .account-grid { grid-template-columns: 1fr; }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { min-height: 104px; padding: 15px; }
  .stat .value { font-size: 28px; }

  /* Pe telefon panourile PDF trec una sub alta, cu comutatorul existent. */
  .content.wide { padding-bottom: 0; }
  .workspace, .workspace.wide-panel { grid-template-columns: 1fr; height: auto; }
  .ws-pdf { height: 62dvh; border-right: 0; border-bottom: 1px solid var(--border); }
  .ws-side { height: auto; }
  .ws-side-foot {
    padding-right: 82px;
    padding-bottom: calc(13px + env(safe-area-inset-bottom));
  }
  .workspace.show-side .ws-pdf { display: none; }
  .workspace.show-pdf .ws-side { display: none; }
  .ws-switch { position: static; display: flex; }
  .quick-assign { order: 5; flex: 1 1 100%; margin-left: 0; }
}

@media screen and (max-width: 620px) {
  .topbar { align-items: flex-start; flex-wrap: wrap; }
  .menu-btn { margin-top: 1px; }
  .topbar-actions { width: 100%; padding-left: 54px; justify-content: flex-start; }
  .topbar-actions:empty { display: none; }
  .topbar-actions .btn { flex: 1 1 auto; }

  .modal-host { align-items: flex-end; padding: 10px 8px max(8px, env(safe-area-inset-bottom)); }
  .modal { max-height: 92dvh; border-radius: 18px 18px 13px 13px; }
  .modal-body { padding: 17px 15px; }
  .modal-foot { padding: 12px 15px; }
}

@media screen and (max-width: 520px) {
  input[type="text"], input[type="password"], input[type="date"], input[type="number"], input[type="search"],
  input[type="file"], input[type="color"], select, textarea { font-size: 16px; }
  .auth-card { padding: 23px 18px; border-radius: 17px; }
  .auth-brand { margin-bottom: 36px; }
  .brand { min-height: 68px; }
  .content { padding-inline: 12px; }
  .grid { gap: 10px; }
  .grid.cols-4 { gap: 10px; }
  .stat { min-height: 100px; padding: 14px; }
  .stat .label { font-size: 10.5px; }
  .stat .value { margin-top: 6px; font-size: 26px; }
  .stat .hint { margin-top: 5px; font-size: 10.5px; }
  .dashboard-stats > .stat:last-child {
    grid-column: 1 / -1;
    grid-row: 1;
    min-height: 116px;
    background: var(--accent);
    color: var(--accent-text);
  }
  .dashboard-stats > .stat:last-child .label,
  .dashboard-stats > .stat:last-child .hint {
    color: color-mix(in srgb, var(--accent-text) 72%, transparent);
  }
  .dashboard-stats > .stat:last-child .value { font-size: 36px; font-weight: 700; }
  .card-head { padding: 14px 15px; }
  .card-body { padding: 15px; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; min-height: 44px; }
  .btn.sm, .level-btn { min-height: 44px; }
  .icon-btn { min-width: 44px; min-height: 44px; }
  .standards-picker-list,
  .standards-picker-list.compact { max-height: min(42dvh, 260px); padding-right: 3px; }
  .standard-choice { gap: 9px; min-height: 52px; padding: 11px 10px; }
  th, td { padding: 10px; }
  .toasts { right: 10px; bottom: calc(78px + env(safe-area-inset-bottom)); left: 10px; align-items: stretch; }
  .toast { max-width: none; }
  .pdf-pages { padding: 12px; }
}

@media screen and (max-width: 360px) {
  .grid.cols-4 { grid-template-columns: 1fr; }
  .row { flex-direction: column; }
  .row > * { width: 100%; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
