/* © Егор — демо портфолио. */
/* Кейс 18 — статическое демо системы контроля знаний.
   Палитра и метрики воспроизводят исходный UI (shadcn-подобная тема):
   primary hsl(217 91% 48%), card 98%, sidebar 96%, радиусы md 6px / lg 9px / xl 12px.
   Стиль демо: воздушные блоки без контурных рамок; рамки сохранены только
   у полей ввода и структурных разделителей (шапка, сайдбар). */

@font-face{
  font-family:"Inter";
  font-style:normal;
  font-weight:400;
  font-display:swap;
  src:url("fonts/inter-cyrillic-400.woff2") format("woff2");
  unicode-range:U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face{
  font-family:"Inter";
  font-style:normal;
  font-weight:400;
  font-display:swap;
  src:url("fonts/inter-cyrillic-ext-400.woff2") format("woff2");
  unicode-range:U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}
@font-face{
  font-family:"Inter";
  font-style:normal;
  font-weight:400;
  font-display:swap;
  src:url("fonts/inter-latin-400.woff2") format("woff2");
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* ─── Токены темы (светлая, как :root исходника) ─── */
:root{
  --background:0 0% 100%;
  --foreground:220 13% 13%;
  --border:220 13% 91%;
  --card:0 0% 98%;
  --card-foreground:220 13% 13%;
  --sidebar:220 5% 96%;
  --sidebar-foreground:220 13% 13%;
  --sidebar-border:220 5% 92%;
  --sidebar-accent:220 5% 93%;
  --sidebar-accent-foreground:220 13% 13%;
  --popover:220 5% 94%;
  --popover-foreground:220 13% 13%;
  --primary:217 91% 48%;
  --primary-foreground:210 40% 98%;
  --secondary:220 5% 92%;
  --secondary-foreground:220 13% 13%;
  --muted:220 5% 93%;
  --muted-foreground:220 9% 46%;
  --accent:220 6% 94%;
  --accent-foreground:220 13% 13%;
  --destructive:0 84% 45%;
  --destructive-foreground:0 0% 98%;
  --input:220 13% 75%;
  --ring:217 91% 48%;
  --chart-1:217 91% 48%;
  --chart-2:142 76% 36%;
  --chart-3:280 87% 47%;
  --chart-4:32 95% 44%;
  --chart-5:340 82% 52%;
  --elevate-1:rgba(0,0,0,.03);
  --elevate-2:rgba(0,0,0,.08);
  --green:142 71% 45%;
  --green-deep:142 76% 36%;
  --yellow:45 93% 47%;
  --yellow-deep:45 93% 38%;
  --red:0 84% 60%;
  --red-deep:0 72% 51%;
  --orange:25 95% 53%;
  --radius-md:.375rem;
  --radius-lg:.5625rem;
  --radius-xl:.75rem;
  --font-sans:"Inter","Open Sans","Segoe UI",system-ui,sans-serif;
  --font-mono:Menlo,Consolas,"Liberation Mono",monospace;
  --sidebar-width:16rem;
}
.dark{
  --background:220 13% 9%;
  --foreground:210 20% 98%;
  --border:220 13% 18%;
  --card:220 13% 11%;
  --card-foreground:210 20% 98%;
  --sidebar:220 5% 13%;
  --sidebar-foreground:210 20% 98%;
  --sidebar-border:220 5% 16%;
  --sidebar-accent:220 5% 16%;
  --sidebar-accent-foreground:210 20% 98%;
  --popover:220 5% 15%;
  --popover-foreground:210 20% 98%;
  --primary:217 91% 55%;
  --primary-foreground:210 40% 98%;
  --secondary:220 5% 18%;
  --secondary-foreground:210 20% 98%;
  --muted:220 5% 17%;
  --muted-foreground:220 9% 65%;
  --accent:220 6% 16%;
  --accent-foreground:210 20% 98%;
  --destructive:0 84% 45%;
  --destructive-foreground:0 0% 98%;
  --input:220 13% 35%;
  --ring:217 91% 55%;
  --chart-1:217 91% 65%;
  --chart-2:142 76% 55%;
  --chart-3:280 87% 65%;
  --chart-4:32 95% 60%;
  --chart-5:340 82% 65%;
  --elevate-1:rgba(255,255,255,.04);
  --elevate-2:rgba(255,255,255,.09);
}

/* ─── База ─── */
*,*::before,*::after{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:var(--font-sans);
  font-size:16px;line-height:1.5;
  background:hsl(var(--background));
  color:hsl(var(--foreground));
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4,p{margin:0}
button{font:inherit;color:inherit}
a{color:hsl(var(--primary));text-decoration:none}
a:hover{text-decoration:underline}
svg{display:block}
::selection{background:hsl(var(--primary)/.2)}

.muted{color:hsl(var(--muted-foreground))}
.text-xs{font-size:.75rem;line-height:1rem}
.text-sm{font-size:.875rem;line-height:1.25rem}
.text-lg{font-size:1.125rem;line-height:1.75rem}
.text-2xl{font-size:1.5rem;line-height:2rem}
.font-medium{font-weight:500}
.font-semibold{font-weight:600}
.font-bold{font-weight:700}
.mono{font-family:var(--font-mono)}
.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ─── Каркас: сайдбар + шапка + контент ─── */
.shell{display:flex;height:100vh;overflow:hidden;width:100%}
.inset{display:flex;flex-direction:column;flex:1;min-width:0;min-height:0;margin-left:var(--sidebar-width)}
body.is-login .sidebar,body.is-login .topbar{display:none}
body.is-login .inset{margin-left:0}
.topbar{
  display:flex;align-items:center;gap:1rem;
  height:3.5rem;padding:0 1.5rem;flex-shrink:0;
  background:hsl(var(--background));
  border-bottom:1px solid hsl(var(--border));
  position:sticky;top:0;z-index:30;
}
.topbar__spacer{flex:1}
.main{flex:1;overflow:auto;padding:1.5rem}

.sidebar{
  position:fixed;inset:0 auto 0 0;z-index:40;
  width:var(--sidebar-width);
  display:flex;flex-direction:column;
  background:hsl(var(--sidebar));
  color:hsl(var(--sidebar-foreground));
  border-right:1px solid hsl(var(--sidebar-border));
}
.sidebar__header{padding:.75rem 1rem;border-bottom:1px solid hsl(var(--sidebar-border))}
.sidebar__brand{display:flex;align-items:center;gap:.75rem}
.sidebar__logo{
  width:2.5rem;height:2.5rem;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
  border-radius:var(--radius-lg);
  background:hsl(var(--primary));color:hsl(var(--primary-foreground));
}
.sidebar__logo svg{width:1.5rem;height:1.5rem}
.sidebar__name{font-weight:600;line-height:1.2}
.sidebar__sub{font-size:.75rem;color:hsl(var(--muted-foreground))}
.sidebar__content{flex:1;overflow-y:auto;padding:.5rem}
.sidebar__label{
  padding:.375rem .5rem;font-size:.75rem;font-weight:500;
  color:hsl(var(--muted-foreground));
}
.sidebar__menu{display:flex;flex-direction:column;gap:.25rem;list-style:none;margin:0;padding:0}
.sidebar__footer{padding:.5rem;border-top:1px solid hsl(var(--sidebar-border))}
.sidebar__user{display:flex;align-items:center;gap:.75rem;padding:.5rem}
.sidebar__user-info{flex:1;min-width:0;display:grid;text-align:left;font-size:.875rem;line-height:1.25}
.sidebar__user-name{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sidebar__user-login{font-size:.75rem;color:hsl(var(--muted-foreground));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.nav-btn{
  display:flex;align-items:center;gap:.5rem;width:100%;
  padding:.5rem;border-radius:var(--radius-md);
  background:none;border:none;cursor:pointer;text-align:left;
  font-size:.875rem;color:hsl(var(--sidebar-foreground));
  transition:background-color .15s;
}
.nav-btn svg{width:1rem;height:1rem;flex-shrink:0}
.nav-btn:hover{background:hsl(var(--sidebar-accent))}
.nav-btn.is-active{background:hsl(var(--sidebar-accent));font-weight:500}
.nav-btn--danger{color:hsl(var(--destructive))}
.nav-btn--danger:hover{background:hsl(var(--destructive)/.1)}

.avatar{
  width:2rem;height:2rem;border-radius:9999px;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
  background:hsl(var(--primary));color:hsl(var(--primary-foreground));
  font-size:.75rem;font-weight:600;
}
.avatar--lg{width:4rem;height:4rem;font-size:1.25rem}

.sidebar-overlay{
  position:fixed;inset:0;z-index:35;
  background:rgba(0,0,0,.5);
}

/* Переключатель роли в шапке */
.role-switch{
  display:inline-flex;gap:.25rem;padding:.25rem;
  background:hsl(var(--muted));border-radius:var(--radius-lg);
}
.role-switch__btn{
  display:inline-flex;align-items:center;gap:.375rem;
  padding:.25rem .75rem;min-height:1.75rem;
  border:none;border-radius:var(--radius-md);
  background:transparent;cursor:pointer;
  font-size:.8125rem;font-weight:500;color:hsl(var(--muted-foreground));
  transition:background-color .15s,color .15s;
}
.role-switch__btn svg{width:.875rem;height:.875rem}
.role-switch__btn.is-active{
  background:hsl(var(--background));color:hsl(var(--foreground));
  box-shadow:0 1px 2px rgba(0,0,0,.06);
}

/* ─── Кнопки (метрики исходника: min-h 36px, px 16, radius 6) ─── */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:.5rem;
  min-height:2.25rem;padding:.5rem 1rem;
  border-radius:var(--radius-md);border:none;
  font-size:.875rem;font-weight:500;line-height:1.25;
  white-space:nowrap;cursor:pointer;
  background:hsl(var(--primary));color:hsl(var(--primary-foreground));
  transition:background-color .15s,opacity .15s;
}
.btn svg{width:1rem;height:1rem;flex-shrink:0}
.btn:hover{background:hsl(var(--primary)/.9)}
.btn:active{background:hsl(var(--primary)/.8)}
.btn:disabled{opacity:.5;pointer-events:none}
.btn:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:2px}
/* Контурные кнопки исходника → воздушный фон без рамки */
.btn-outline{background:hsl(var(--accent));color:inherit}
.btn-outline:hover{background:hsl(var(--elevate-2))}
.btn-outline:active{background:hsl(var(--elevate-2))}
.btn-secondary{background:hsl(var(--secondary));color:hsl(var(--secondary-foreground))}
.btn-secondary:hover{background:hsl(var(--elevate-2))}
.btn-ghost{background:transparent;color:inherit}
.btn-ghost:hover{background:hsl(var(--elevate-1))}
.btn-destructive{background:hsl(var(--destructive));color:hsl(var(--destructive-foreground))}
.btn-destructive:hover{background:hsl(var(--destructive)/.9)}
.btn-sm{min-height:2rem;padding:.25rem .75rem;font-size:.75rem}
.btn-lg{min-height:2.5rem;padding:.5rem 2rem}
.btn-icon{width:2.25rem;height:2.25rem;min-height:0;padding:0}
.btn-block{width:100%}

/* ─── Бейджи (radius 6, px 10, text-xs semibold) ─── */
.badge{
  display:inline-flex;align-items:center;gap:.25rem;
  padding:.125rem .625rem;border-radius:var(--radius-md);
  font-size:.75rem;font-weight:600;line-height:1.25;
  white-space:nowrap;border:none;
  background:hsl(var(--primary));color:hsl(var(--primary-foreground));
}
.badge svg{width:.75rem;height:.75rem}
.badge-secondary{background:hsl(var(--secondary));color:hsl(var(--secondary-foreground))}
.badge-outline{background:hsl(var(--muted)/.6);color:hsl(var(--foreground))}
.badge-destructive{background:hsl(var(--destructive));color:hsl(var(--destructive-foreground))}
.badge-green{background:hsl(var(--green)/.12);color:hsl(var(--green-deep))}
.badge-red{background:hsl(var(--red)/.12);color:hsl(var(--red-deep))}
.badge-blue{background:hsl(var(--primary)/.1);color:hsl(var(--primary))}
.dark .badge-green{color:hsl(var(--green))}
.dark .badge-red{color:hsl(var(--red))}

/* ─── Карточки и строки: без контурных рамок ─── */
.card{
  background:hsl(var(--card));color:hsl(var(--card-foreground));
  border-radius:var(--radius-xl);
  border:none;
}
.card__header{display:flex;flex-direction:column;gap:.375rem;padding:1.5rem}
.card__header--row{flex-direction:row;align-items:center;justify-content:space-between;gap:1rem}
.card__header--row-start{align-items:flex-start}
.card__title{font-size:1.5rem;font-weight:600;line-height:1.2;letter-spacing:-.025em;display:flex;align-items:center;gap:.5rem}
.card__title svg{width:1.25rem;height:1.25rem;flex-shrink:0}
.card__title--sm{font-size:.875rem;font-weight:500;letter-spacing:0}
.card__title--md{font-size:1.125rem;font-weight:600;letter-spacing:0}
.card__desc{font-size:.875rem;color:hsl(var(--muted-foreground))}
.card__content{padding:0 1.5rem 1.5rem}
.card__content--p4{padding:1rem 1.5rem}
.card__header--tight{padding-bottom:.5rem}
.card__icon{width:1rem;height:1rem;color:hsl(var(--muted-foreground));flex-shrink:0}

/* строки внутри карточек: белый фон вместо рамки */
.row{
  display:flex;align-items:center;justify-content:space-between;gap:1rem;
  padding:1rem;border-radius:var(--radius-lg);
  background:hsl(var(--background));
  transition:background-color .15s;
}
.row--hover:hover{background:hsl(var(--elevate-1))}
.row__body{flex:1;min-width:0}
.row__title{display:flex;align-items:center;gap:.5rem;margin-bottom:.25rem;flex-wrap:wrap}
.row__title h4{font-weight:500;font-size:1rem}
.row__meta{display:flex;align-items:center;gap:1rem;margin-top:.5rem;font-size:.75rem;color:hsl(var(--muted-foreground));flex-wrap:wrap}
.row__meta span{display:inline-flex;align-items:center;gap:.25rem}
.row__meta svg{width:.75rem;height:.75rem}
.row__meta .due{color:hsl(var(--orange))}
.row__actions{display:flex;align-items:center;gap:.5rem;flex-shrink:0}
.stack{display:flex;flex-direction:column;gap:1rem}
.stack--sm{gap:.75rem}

/* ─── Прогресс-бары ─── */
.progress{
  position:relative;width:100%;height:1rem;overflow:hidden;
  border-radius:9999px;background:hsl(var(--secondary));
}
.progress__bar{height:100%;background:hsl(var(--primary));border-radius:9999px;transition:width .3s}
.progress--h2{height:.5rem}
.progress--h15{height:.375rem}
.progress--h3{height:.75rem}
.progress--w32{width:8rem}
.progress--w24{width:6rem}
.progress--w64{width:16rem;max-width:100%}
.progress-label{display:flex;align-items:center;justify-content:space-between;font-size:.75rem;margin-bottom:.25rem}

/* ─── Сетки и секции ─── */
.page{display:flex;flex-direction:column;gap:2rem;max-width:80rem;margin:0 auto}
.page--narrow{max-width:48rem}
.page--mid{max-width:42rem}
.page-head{display:flex;flex-direction:column;gap:.5rem}
.page-head h1{font-size:1.5rem;font-weight:700;letter-spacing:-.025em}
.page-head--row{flex-direction:row;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap}
.page-head__actions{display:flex;gap:.5rem;flex-wrap:wrap}
.grid{display:grid;gap:1rem}
.grid--stats{grid-template-columns:1fr}
.grid--2{grid-template-columns:1fr;gap:1.5rem}
.grid--3{grid-template-columns:1fr}
.stat-value{font-size:1.5rem;font-weight:700;line-height:1.2}
.stat-note{font-size:.75rem;color:hsl(var(--muted-foreground));margin-top:.125rem}
.back-head{display:flex;align-items:center;gap:1rem}
.back-head h1{font-size:1.5rem;font-weight:700;letter-spacing:-.025em}

/* ─── Формы: рамки сохраняются только здесь ─── */
.field{display:flex;flex-direction:column;gap:.5rem}
.field label{font-size:.875rem;font-weight:500}
.input,.textarea,.select{
  width:100%;padding:.5rem .75rem;
  font:inherit;font-size:.875rem;
  color:hsl(var(--foreground));
  background:hsl(var(--background));
  border:1px solid hsl(var(--input));
  border-radius:var(--radius-md);
  transition:border-color .15s,box-shadow .15s;
}
.input{height:2.25rem}
.input::placeholder,.textarea::placeholder{color:hsl(var(--muted-foreground))}
.input:focus,.textarea:focus,.select:focus{
  outline:none;border-color:hsl(var(--ring));
  box-shadow:0 0 0 1px hsl(var(--ring));
}
.textarea{min-height:9.375rem;resize:vertical}
.select{height:2.25rem;appearance:auto}
.form-stack{display:flex;flex-direction:column;gap:1rem}
.field-error{font-size:.875rem;color:hsl(var(--destructive))}
.field-hint{font-size:.75rem;color:hsl(var(--muted-foreground))}

/* радио и чекбоксы (как radix: 16px, primary) */
.option-row{
  display:flex;align-items:center;gap:.75rem;
  padding:.75rem;border-radius:var(--radius-lg);
  background:hsl(var(--background));
  cursor:pointer;transition:background-color .15s;
}
.option-row:hover{background:hsl(var(--elevate-1))}
.option-row input{
  appearance:none;-webkit-appearance:none;
  width:1rem;height:1rem;flex-shrink:0;margin:0;
  border:1px solid hsl(var(--input));
  background:hsl(var(--background));
  display:grid;place-content:center;cursor:pointer;
  transition:background-color .15s,border-color .15s;
}
.option-row input[type="radio"]{border-radius:9999px}
.option-row input[type="checkbox"]{border-radius:.25rem}
.option-row input::before{
  content:"";width:.5rem;height:.5rem;transform:scale(0);
  transition:transform .12s;
}
.option-row input[type="radio"]::before{
  border-radius:9999px;background:hsl(var(--primary-foreground));
}
.option-row input[type="checkbox"]::before{
  width:.625rem;height:.625rem;
  background:hsl(var(--primary-foreground));
  clip-path:polygon(14% 44%,0 65%,50% 100%,100% 16%,80% 0%,43% 62%);
  transform:scale(0);
}
.option-row input:checked{background:hsl(var(--primary));border-color:hsl(var(--primary))}
.option-row input:checked::before{transform:scale(1)}
.option-row input:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:2px}
.option-row span{flex:1;cursor:pointer}
.options{display:flex;flex-direction:column;gap:.75rem}

/* ─── Экран входа ─── */
.login{
  min-height:100vh;display:flex;align-items:center;justify-content:center;
  padding:1rem;background:hsl(var(--background));
}
.login__box{width:100%;max-width:28rem;display:flex;flex-direction:column;gap:1.5rem}
.login__hero{display:flex;flex-direction:column;align-items:center;gap:.5rem;text-align:center}
.login__logo{
  width:4rem;height:4rem;border-radius:9999px;
  display:flex;align-items:center;justify-content:center;
  background:hsl(var(--primary)/.1);color:hsl(var(--primary));
}
.login__logo svg{width:2rem;height:2rem}
.login__hero h1{font-size:1.5rem;font-weight:700;letter-spacing:-.025em}
.login__foot{display:flex;align-items:center;justify-content:center;gap:.5rem;font-size:.875rem;color:hsl(var(--muted-foreground))}
.login__foot svg{width:1rem;height:1rem}
.login__quick{display:flex;gap:.5rem}
.login__quick .btn{flex:1}
.login__divider{display:flex;align-items:center;gap:.75rem;font-size:.75rem;color:hsl(var(--muted-foreground))}
.login__divider::before,.login__divider::after{content:"";flex:1;height:1px;background:hsl(var(--border))}

/* ─── Прохождение теста ─── */
.take{max-width:48rem;margin:0 auto;display:flex;flex-direction:column;gap:1.5rem}
.take__sticky{position:sticky;top:0;z-index:20;background:hsl(var(--background)/.95);backdrop-filter:blur(4px);padding-bottom:1rem}
.take__bar{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap}
.take__bar-left{display:flex;align-items:center;gap:1rem}
.take__bar-right{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}
.timer{
  display:flex;align-items:center;gap:.5rem;
  padding:.5rem 1rem;border-radius:var(--radius-lg);
  font-family:var(--font-mono);font-size:1.125rem;
  background:hsl(var(--muted));
}
.timer svg{width:1.25rem;height:1.25rem}
.timer--warn{background:hsl(var(--destructive)/.1);color:hsl(var(--destructive))}
.saved{display:flex;align-items:center;gap:.25rem;font-size:.75rem;color:hsl(var(--muted-foreground))}
.saved svg{width:.75rem;height:.75rem}
.take__pos{padding:.25rem .25rem .5rem}
.take__pos-labels{display:flex;align-items:center;justify-content:space-between;margin-bottom:.25rem;font-size:.75rem;color:hsl(var(--muted-foreground))}
.qgrid{display:flex;gap:.5rem;flex-wrap:wrap}
.qgrid__btn{
  width:2.5rem;height:2.5rem;min-height:0;padding:0;
  display:inline-flex;align-items:center;justify-content:center;
  border-radius:var(--radius-md);border:none;cursor:pointer;
  font-size:.75rem;font-weight:500;
  background:hsl(var(--accent));color:inherit;
  transition:background-color .15s;
}
.qgrid__btn:hover{background:hsl(var(--elevate-2))}
.qgrid__btn.is-current{background:hsl(var(--primary));color:hsl(var(--primary-foreground))}
.qgrid__btn.is-answered:not(.is-current){background:hsl(var(--green)/.12);color:hsl(var(--green-deep))}
.dark .qgrid__btn.is-answered:not(.is-current){color:hsl(var(--green))}
.question-text{font-size:1.125rem;line-height:1.6}
.question-tags{display:flex;gap:.5rem;flex-wrap:wrap}
.hint-box{
  padding:1rem;border-radius:var(--radius-lg);
  background:hsl(var(--primary)/.07);
  font-size:.875rem;
}
.hint-box p:first-child{font-weight:500;color:hsl(var(--primary))}
.hint-box p+p{margin-top:.5rem}
.take__nav{display:flex;align-items:center;justify-content:space-between;gap:1rem}

/* ─── Результаты ─── */
.score-hero{display:flex;flex-direction:column;align-items:center;text-align:center;padding:2rem 1.5rem}
.score-hero svg{width:4rem;height:4rem;margin-bottom:1rem}
.score-hero__value{font-size:3rem;font-weight:700;line-height:1;margin-bottom:.5rem}
.score-hero__points{color:hsl(var(--muted-foreground));margin-bottom:1rem}
.score-green{color:hsl(var(--green-deep))}
.score-yellow{color:hsl(var(--yellow-deep))}
.score-red{color:hsl(var(--red-deep))}
.dark .score-green{color:hsl(var(--green))}
.dark .score-yellow{color:hsl(var(--yellow))}
.dark .score-red{color:hsl(var(--red))}
.bg-green-tint{background:hsl(var(--green)/.08)}
.bg-yellow-tint{background:hsl(var(--yellow)/.1)}
.bg-red-tint{background:hsl(var(--red)/.08)}
.mini-stat{display:flex;align-items:center;gap:.75rem;padding:1rem 1.5rem}
.mini-stat svg{width:2rem;height:2rem;flex-shrink:0}
.mini-stat__value{font-weight:500}
.mini-stat__label{font-size:.875rem;color:hsl(var(--muted-foreground))}
.icon-green{color:hsl(var(--green))}
.icon-red{color:hsl(var(--red))}
.icon-primary{color:hsl(var(--primary))}
.icon-yellow{color:hsl(var(--yellow))}
.icon-blue{color:hsl(var(--primary))}
.proctor-row{display:flex;align-items:center;justify-content:space-between;padding:.75rem;border-radius:var(--radius-lg);background:hsl(var(--background));font-size:.875rem}
.proctor-note{padding:.75rem;border-radius:var(--radius-lg);background:hsl(var(--muted)/.4);font-size:.875rem;color:hsl(var(--muted-foreground))}
.event-row{padding:.75rem;border-radius:var(--radius-lg);background:hsl(var(--background));font-size:.875rem}
.event-row__head{display:flex;align-items:center;justify-content:space-between;gap:.75rem}
.event-row__head b{font-weight:500}
.event-row p{margin-top:.25rem;color:hsl(var(--muted-foreground))}
.answer-block{padding:1rem;border-radius:var(--radius-lg);background:hsl(var(--background))}
.answer-block__head{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:.75rem}
.answer-block__q{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}
.answer-block__text{color:hsl(var(--muted-foreground));margin-bottom:1rem}
.answer-options{display:flex;flex-direction:column;gap:.5rem;margin-bottom:1rem}
.answer-option{padding:.75rem;border-radius:var(--radius-lg);background:hsl(var(--card))}
.answer-option__in{display:flex;align-items:center;gap:.5rem}
.answer-option svg{width:1rem;height:1rem;flex-shrink:0}
.answer-option--picked-correct{background:hsl(var(--green)/.12)}
.answer-option--picked-wrong{background:hsl(var(--red)/.12)}
.answer-option--correct{background:hsl(var(--green)/.06)}
.open-box{padding:.75rem;border-radius:var(--radius-lg);background:hsl(var(--muted)/.5)}
.open-box--reference{background:hsl(var(--green)/.1)}
.open-box--ai{background:hsl(var(--primary)/.06)}
.open-box__label{display:flex;align-items:center;gap:.5rem;font-size:.875rem;font-weight:500;margin-bottom:.25rem}
.open-box__label svg{width:1rem;height:1rem}
.open-box--reference .open-box__label{color:hsl(var(--green-deep))}
.dark .open-box--reference .open-box__label{color:hsl(var(--green))}
.open-box--ai .open-box__label{color:hsl(var(--primary))}
.open-box p{font-size:.9375rem}
.open-stack{display:flex;flex-direction:column;gap:1rem}

/* ─── Рекомендации / инфо-блоки ─── */
.rec{display:flex;align-items:flex-start;gap:1rem;padding:1rem;border-radius:var(--radius-lg)}
.rec svg{width:1.25rem;height:1.25rem;flex-shrink:0;margin-top:.125rem}
.rec__body{flex:1}
.rec__body h4{font-weight:500}
.rec__body p{font-size:.875rem;color:hsl(var(--muted-foreground));margin-top:.25rem}
.rec--high{background:hsl(var(--destructive)/.08)}
.rec--high svg{color:hsl(var(--destructive))}
.rec--medium{background:hsl(var(--yellow)/.12)}
.rec--medium svg{color:hsl(var(--yellow-deep))}
.rec--low{background:hsl(var(--primary)/.08)}
.rec--low svg{color:hsl(var(--primary))}
.rec-total{margin-top:1rem;padding-top:1rem;border-top:1px solid hsl(var(--border));font-size:.875rem;color:hsl(var(--muted-foreground))}
.info-tile{display:flex;align-items:center;gap:.75rem;padding:1rem;border-radius:var(--radius-lg);background:hsl(var(--muted)/.5)}
.info-tile svg{width:2rem;height:2rem;color:hsl(var(--primary));flex-shrink:0}
.info-tile__value{font-weight:500}
.info-tile__label{font-size:.875rem;color:hsl(var(--muted-foreground))}
.rules{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem;font-size:.875rem;color:hsl(var(--muted-foreground))}
.rules li{display:flex;align-items:flex-start;gap:.5rem}
.rules svg{width:1rem;height:1rem;color:hsl(var(--primary));margin-top:.125rem;flex-shrink:0}

/* ─── Графики (SVG) ─── */
.chart{width:100%;height:auto;aspect-ratio:2/1;max-height:300px}
.chart--sm{max-height:200px}
.chart svg{width:100%;height:100%}
.chart text{font-family:var(--font-sans);font-size:11px;fill:hsl(var(--muted-foreground))}
.chart .grid-line{stroke:hsl(var(--muted));stroke-dasharray:3 3}
.chart .axis-line{stroke:hsl(var(--border))}
.chart-note{font-size:.875rem;color:hsl(var(--muted-foreground));margin-top:.5rem;text-align:center}
.legend{display:flex;gap:1.25rem;justify-content:center;font-size:.75rem;color:hsl(var(--muted-foreground));margin-top:.5rem;flex-wrap:wrap}
.legend span{display:inline-flex;align-items:center;gap:.375rem}
.legend i{width:.625rem;height:.625rem;border-radius:2px;display:inline-block}

/* ─── Диалоги ─── */
.dialog-overlay{
  position:fixed;inset:0;z-index:50;
  background:rgba(0,0,0,.55);backdrop-filter:blur(2px);
  display:flex;align-items:center;justify-content:center;padding:1rem;
}
.dialog{
  width:100%;max-width:32rem;max-height:calc(100vh - 2rem);overflow-y:auto;
  background:hsl(var(--background));color:hsl(var(--foreground));
  border-radius:var(--radius-xl);
  padding:1.5rem;display:flex;flex-direction:column;gap:1rem;
  box-shadow:0 16px 40px rgba(0,0,0,.18);
}
.dialog h2{font-size:1.125rem;font-weight:600}
.dialog__desc{font-size:.875rem;color:hsl(var(--muted-foreground))}
.dialog__desc .ok{display:flex;align-items:center;gap:.5rem;color:hsl(var(--green-deep))}
.dialog__desc .warn{display:flex;align-items:center;gap:.5rem;color:hsl(var(--orange))}
.dark .dialog__desc .ok{color:hsl(var(--green))}
.dialog__desc svg{width:1rem;height:1rem}
.dialog__footer{display:flex;justify-content:flex-end;gap:.5rem;flex-wrap:wrap}

/* ─── Тосты ─── */
.toasts{
  position:fixed;right:1rem;bottom:1rem;z-index:60;
  display:flex;flex-direction:column;gap:.5rem;max-width:22rem;
}
.toast{
  background:hsl(var(--background));color:hsl(var(--foreground));
  border-radius:var(--radius-lg);padding:.875rem 1rem;
  box-shadow:0 8px 24px rgba(0,0,0,.14);
  animation:toast-in .2s ease-out;
}
.toast b{display:block;font-size:.875rem;font-weight:600}
.toast p{font-size:.8125rem;color:hsl(var(--muted-foreground));margin-top:.125rem}
.toast--destructive{background:hsl(var(--destructive));color:hsl(var(--destructive-foreground))}
.toast--destructive p{color:hsl(var(--destructive-foreground)/.85)}
@keyframes toast-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

/* ─── Пустые состояния / заглушки ─── */
.empty{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:3rem 1rem;gap:.5rem}
.empty svg{width:3rem;height:3rem;color:hsl(var(--muted-foreground));margin-bottom:.5rem}
.empty h3{font-weight:500;font-size:1.125rem}
.empty p{color:hsl(var(--muted-foreground))}
.empty .btn{margin-top:.5rem}

/* сообщения / уведомления / пособия */
.msg-row{display:flex;gap:.75rem;padding:1rem;border-radius:var(--radius-lg);background:hsl(var(--background))}
.msg-row__body{flex:1;min-width:0}
.msg-row__head{display:flex;align-items:center;justify-content:space-between;gap:.5rem}
.msg-row__head b{font-weight:500;font-size:.9375rem}
.msg-row__head time{font-size:.75rem;color:hsl(var(--muted-foreground))}
.msg-row p{font-size:.875rem;color:hsl(var(--muted-foreground));margin-top:.25rem}
.material-card{display:flex;align-items:center;gap:1rem;padding:1rem;border-radius:var(--radius-lg);background:hsl(var(--background))}
.material-card__icon{
  width:2.5rem;height:2.5rem;border-radius:var(--radius-lg);flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
  background:hsl(var(--primary)/.1);color:hsl(var(--primary));
}
.material-card__icon svg{width:1.25rem;height:1.25rem}
.material-card__body{flex:1;min-width:0}
.profile-grid{display:grid;gap:1rem;grid-template-columns:1fr}
.profile-field{padding:.75rem 1rem;border-radius:var(--radius-lg);background:hsl(var(--background))}
.profile-field dt{font-size:.75rem;color:hsl(var(--muted-foreground))}
.profile-field dd{margin:0;font-weight:500}
.dropzone{
  display:flex;flex-direction:column;align-items:center;gap:.5rem;
  padding:2.5rem 1rem;border-radius:var(--radius-lg);
  background:hsl(var(--muted)/.4);text-align:center;
  color:hsl(var(--muted-foreground));font-size:.875rem;
}
.dropzone svg{width:2rem;height:2rem}

/* ─── Демо-лента ─── */
.demo-ribbon{
  position:fixed;left:14px;bottom:14px;z-index:40;pointer-events:none;
  font-family:var(--font-mono);font-size:10.5px;letter-spacing:.04em;
  color:hsl(var(--muted-foreground));background:hsl(var(--popover));
  padding:5px 10px;border-radius:6px;
}
@media print{.demo-ribbon{display:none!important}}

/* ─── Адаптив ─── */
@media (min-width:640px){
  .grid--3{grid-template-columns:repeat(3,1fr)}
  .profile-grid{grid-template-columns:1fr 1fr}
  .login__quick{flex-direction:row}
}
@media (min-width:768px){
  .grid--stats{grid-template-columns:repeat(2,1fr)}
  .grid--2{grid-template-columns:repeat(2,1fr)}
}
@media (min-width:1024px){
  .grid--stats{grid-template-columns:repeat(4,1fr)}
}
@media (max-width:1023px){
  .topbar{padding:0 1rem}
  .main{padding:1rem}
}
@media (max-width:767px){
  .inset{margin-left:0}
  .sidebar{transform:translateX(-100%);transition:transform .2s ease;box-shadow:none}
  .sidebar.is-open{transform:none;box-shadow:0 0 40px rgba(0,0,0,.2)}
  .role-switch__btn{padding:.25rem .5rem;font-size:.75rem}
  .role-switch__btn .role-switch__label{display:none}
  .take__sticky{top:0}
  .row{flex-wrap:wrap}
  .row__actions{width:100%;justify-content:flex-end}
  .page-head--row{flex-direction:column;align-items:flex-start}
  .dialog{padding:1.25rem}
}
@media (min-width:768px){
  #sidebar-trigger{display:none}
  .sidebar-overlay{display:none!important}
}

/* Автосценарий: плавающая кнопка, верхняя плашка и подсветка шагов */
.scenario-fab{position:fixed;right:1rem;bottom:1rem;z-index:65;border-radius:.75rem;padding:.65rem 1.1rem;font-weight:700;box-shadow:0 10px 26px -10px hsl(var(--foreground)/.5)}
.toasts{bottom:4.5rem}
.scenario-bar{position:fixed;top:.75rem;left:50%;transform:translateX(-50%);z-index:66;display:flex;align-items:center;gap:.75rem;background:hsl(var(--foreground));color:hsl(var(--background));border-radius:.75rem;padding:.5rem .85rem;max-width:min(92vw,40rem);box-shadow:0 12px 30px -12px hsl(var(--foreground)/.55);font-size:.85rem}
.scenario-bar__step{font-weight:700}
.scenario-bar__stop{border-radius:.5rem;padding:.2rem .6rem;font-size:.75rem;font-weight:600;background:hsl(var(--background)/.16);color:inherit}
.scenario-hl{outline:3px solid hsl(var(--primary));outline-offset:3px;border-radius:.5rem}
