:root {
  --brand-orange: #d99548;
  --brand-orange-dark: #b96f25;
  --brand-orange-soft: #f8eee2;
  --brand-charcoal: #2f2e2d;
  --brand-black: #171717;
  --brand-red: #c2251a;
  --brand-yellow: #f7e256;
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-muted: #fbfaf8;
  --text: #272624;
  --muted: #74716d;
  --line: #e4e0da;
  --line-strong: #d2ccc4;
  --good: #1d7a4b;
  --good-bg: #e8f5ed;
  --bad: #b63830;
  --bad-bg: #fbeceb;
  --warning: #8a5b0a;
  --warning-bg: #fff4da;
  --info: #2f5f80;
  --info-bg: #edf5fa;
  --shadow-sm: 0 8px 24px rgba(47, 46, 45, 0.07);
  --shadow-md: 0 18px 50px rgba(47, 46, 45, 0.11);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Calibri, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  line-height: 1.45;
  background:
    radial-gradient(circle at 0 0, rgba(217, 149, 72, 0.08), transparent 29rem),
    linear-gradient(180deg, #faf9f7 0, var(--bg) 340px);
}

button, input, select, textarea { font: inherit; }
a { color: var(--brand-orange-dark); }
a:hover { color: var(--brand-charcoal); }

.topbar {
  min-height: 86px;
  padding: 0 max(22px, calc((100vw - 1240px) / 2));
  display: flex;
  align-items: center;
  gap: 34px;
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 20px rgba(47, 46, 45, 0.045);
  backdrop-filter: blur(14px);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--brand-orange), transparent 42%);
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--brand-black);
  text-decoration: none;
  flex: 0 0 auto;
}

.brand-logo {
  display: block;
  width: 206px;
  height: auto;
  object-fit: contain;
}

.brand-caption {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 15px;
  border-left: 2px solid var(--brand-orange);
  line-height: 1.05;
}

.brand-caption strong {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.brand-caption span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.topbar nav {
  display: flex;
  align-items: stretch;
  align-self: stretch;
  gap: 4px;
  flex: 1;
}

.topbar nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0 15px;
  color: #5d5a56;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
}

.topbar nav a:hover,
.topbar nav a.active {
  color: var(--brand-black);
}

.topbar nav a::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--brand-orange);
  transform: scaleX(0);
  transition: transform 0.18s ease;
}

.topbar nav a:hover::after,
.topbar nav a.active::after { transform: scaleX(1); }

.userbox {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
}

.user-name {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: right;
}

.user-name strong { font-size: 14px; }
.user-name small { color: var(--muted); margin-top: 3px; }
.userbox form { margin: 0; }

.link-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--brand-charcoal);
  cursor: pointer;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
}

.link-button:hover {
  border-color: var(--brand-orange);
  color: var(--brand-orange-dark);
}

.container {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 74px;
}

footer {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 32px;
  color: #8a8782;
  font-size: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

footer b { color: var(--brand-charcoal); }

h1, h2, h3 {
  color: var(--brand-charcoal);
  font-weight: 700;
}

h1 {
  margin: 0 0 9px;
  font-size: clamp(30px, 4vw, 43px);
  line-height: 1.04;
  letter-spacing: -0.025em;
}

h2 { line-height: 1.18; }
h3 { line-height: 1.25; }
p { margin-top: 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
  color: var(--brand-orange-dark);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 12px;
  font-weight: 700;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--brand-orange);
}

.muted, .page-head p { color: var(--muted); }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 30px;
}

.page-head p { margin-bottom: 0; font-size: 16px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.card, .panel, .intro-card, .auth-card, .question-card, .review-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.card {
  position: relative;
  overflow: hidden;
  padding: 25px;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-orange), #f1b974 55%, transparent);
}

.test-card {
  display: flex;
  flex-direction: column;
  min-height: 330px;
}

.test-card h2 {
  margin: 20px 0 10px;
  font-size: 24px;
}

.test-card > p {
  color: var(--muted);
  min-height: 62px;
}

.test-meta, .test-stats {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
  padding-top: 13px;
  margin-top: auto;
}

.test-stats {
  margin-top: 12px;
  margin-bottom: 21px;
}

.test-meta b, .test-stats b { color: var(--brand-charcoal); }

.pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border: 1px solid #edcfad;
  border-radius: 999px;
  padding: 6px 11px;
  background: var(--brand-orange-soft);
  color: #985a20;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 17px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.button:hover { transform: translateY(-1px); }

.button.primary {
  background: var(--brand-orange);
  color: #241b12;
  box-shadow: 0 8px 19px rgba(217, 149, 72, 0.25);
}

.button.primary:hover {
  background: #e3a35d;
  color: var(--brand-black);
  box-shadow: 0 10px 24px rgba(217, 149, 72, 0.34);
}

.button.ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--brand-charcoal);
}

.button.ghost:hover {
  border-color: var(--brand-orange);
  background: var(--brand-orange-soft);
}

.button.large { min-height: 50px; padding: 13px 24px; font-size: 16px; }
.button.tiny { min-height: 34px; padding: 7px 10px; font-size: 12px; }

.panel {
  padding: 25px;
  margin-top: 22px;
}

.panel > h2:first-child { margin-top: 0; }

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--surface);
}

th {
  text-align: left;
  color: #67635e;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 13px 12px;
  border-bottom: 1px solid var(--line-strong);
  background: #f7f4f0;
  white-space: nowrap;
}

td {
  padding: 14px 12px;
  border-bottom: 1px solid #eeeae5;
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fdfbf8; }
td small { display: block; color: var(--muted); margin-top: 3px; }
.empty { text-align: center; color: var(--muted); padding: 30px; }

.status, .status-button {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  border: 0;
  white-space: nowrap;
}

.status.pass, .status.on, .status-button.on { background: var(--good-bg); color: var(--good); }
.status.fail, .status.off, .status-button.off { background: var(--bad-bg); color: var(--bad); }
.status-button { cursor: pointer; }

.auth-page {
  background:
    radial-gradient(circle at 10% 15%, rgba(217, 149, 72, 0.13), transparent 25rem),
    linear-gradient(135deg, #f9f7f3 0%, #f3eee7 100%);
}

.auth-page .topbar {
  position: relative;
  box-shadow: none;
}

.auth-page .container {
  width: min(1120px, calc(100% - 40px));
  padding-top: 54px;
}

.auth-wrap {
  min-height: calc(100vh - 250px);
  display: grid;
  place-items: center;
}

.auth-shell {
  width: min(950px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.auth-visual {
  position: relative;
  min-height: 520px;
  padding: 54px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 70% 15%, rgba(247, 226, 86, 0.9) 0 3%, transparent 4%),
    radial-gradient(circle at 70% 24%, rgba(194, 37, 26, 0.8), transparent 28%),
    linear-gradient(145deg, #171717 0%, #34312e 62%, #201f1e 100%);
}

.auth-visual::before,
.auth-visual::after {
  content: "";
  position: absolute;
  border-radius: 48% 52% 65% 35%;
  filter: blur(1px);
  opacity: 0.9;
}

.auth-visual::before {
  width: 270px;
  height: 420px;
  right: -45px;
  top: 45px;
  background: linear-gradient(180deg, var(--brand-yellow), var(--brand-orange) 42%, var(--brand-red) 85%);
  transform: rotate(22deg);
}

.auth-visual::after {
  width: 175px;
  height: 310px;
  right: 95px;
  top: 112px;
  background: linear-gradient(180deg, #fff3a5, #f6a03b 52%, #b51f17 100%);
  transform: rotate(-13deg);
  opacity: 0.74;
}

.auth-copy { position: relative; z-index: 2; max-width: 400px; }
.auth-copy .eyebrow { color: #f4bc7d; }
.auth-copy h2 { color: #fff; font-size: 34px; margin: 0 0 16px; }
.auth-copy p { color: #d9d5d0; font-size: 17px; margin: 0; }

.auth-card {
  width: 100%;
  padding: 52px 46px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-card-logo {
  width: 240px;
  max-width: 100%;
  margin: 0 auto 30px;
}

.auth-card h1 { text-align: center; font-size: 34px; }
.auth-card .muted { text-align: center; margin-bottom: 24px; }

.stack { display: flex; flex-direction: column; gap: 15px; }

label {
  color: #514e4a;
  font-size: 13px;
  font-weight: 700;
}

input, select, textarea {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  background: #fff;
  color: var(--text);
}

input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(217, 149, 72, 0.19);
  border-color: var(--brand-orange);
}

textarea { resize: vertical; }

.alert {
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  margin: 15px 0;
  border-left: 4px solid currentColor;
  font-size: 14px;
}

.alert.error { background: var(--bad-bg); color: #8c2c27; }
.alert.info { background: var(--info-bg); color: var(--info); }
.alert.warning { background: var(--warning-bg); color: var(--warning); }
.alert.success { background: var(--good-bg); color: #17633e; }

.intro-card {
  position: relative;
  overflow: hidden;
  max-width: 800px;
  margin: 28px auto;
  padding: 42px;
}

.intro-card::after {
  content: "";
  position: absolute;
  right: -95px;
  top: -120px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(217, 149, 72, 0.09);
}

.intro-card > * { position: relative; z-index: 1; }

.rules-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 25px 0;
}

.rules-grid > div {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 18px;
  text-align: center;
  background: var(--surface-muted);
}

.rules-grid strong { display: block; font-size: 31px; color: var(--brand-charcoal); }
.rules-grid span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }

.test-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 25px;
}

.timer {
  min-width: 142px;
  padding: 12px 18px;
  border-radius: 12px;
  text-align: center;
  background: var(--brand-charcoal);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.timer span { display: block; color: #bdb9b4; font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; }
.timer b { font-size: 27px; font-variant-numeric: tabular-nums; }
.timer.urgent { background: var(--brand-red); }

.question-list { display: flex; flex-direction: column; gap: 18px; }

.question-card {
  padding: 29px;
  box-shadow: none;
  border-left: 4px solid #e8dfd4;
}

.question-card h2 { font-size: 21px; margin-bottom: 0; }
.question-number { color: var(--brand-orange-dark); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.options { display: grid; gap: 10px; margin-top: 19px; }

.option {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 14px;
  cursor: pointer;
  font-weight: 500;
  background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.option:hover {
  border-color: var(--brand-orange);
  background: #fffaf4;
  transform: translateX(2px);
}

.option:has(input:checked) {
  border-color: var(--brand-orange);
  background: var(--brand-orange-soft);
  box-shadow: inset 3px 0 0 var(--brand-orange);
}

.option input { width: auto; margin: 3px 0 0; accent-color: var(--brand-orange-dark); }

.submit-bar {
  position: sticky;
  bottom: 14px;
  z-index: 15;
  margin-top: 26px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border: 1px solid #4a4845;
  border-radius: 12px;
  background: rgba(47, 46, 45, 0.97);
  color: #fff;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
}

.result-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 34px;
  display: flex;
  align-items: center;
  gap: 30px;
  color: #fff;
  box-shadow: var(--shadow-md);
}

.result-hero::after {
  content: "";
  position: absolute;
  right: -75px;
  top: -95px;
  width: 270px;
  height: 270px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.result-hero.passed { background: linear-gradient(135deg, #1b6943, #2d9865); }
.result-hero.failed { background: linear-gradient(135deg, #7f2924, #c4483f); }
.result-hero h1 { color: #fff; }
.result-hero p { color: rgba(255, 255, 255, 0.82); }
.result-hero .pill { border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.12); color: #fff; }
.result-hero > * { position: relative; z-index: 1; }

.score-ring {
  width: 150px;
  height: 150px;
  border: 8px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: none;
}

.score-ring strong { font-size: 34px; }
.score-ring span { font-size: 12px; }
.review-list { display: flex; flex-direction: column; gap: 16px; }

.review-card {
  padding: 23px;
  box-shadow: none;
  border-left: 4px solid var(--brand-red);
}

.review-card h3 { margin-top: 0; }
.answer { padding: 11px 13px; border-radius: 8px; margin: 8px 0; }
.answer.wrong { background: var(--bad-bg); color: #842c27; }
.answer.correct { background: var(--good-bg); color: #17633e; }

.review-card blockquote {
  margin: 16px 0;
  padding: 14px 17px;
  border-left: 4px solid var(--brand-orange);
  background: #faf5ee;
  color: #4e4a46;
  font-size: 15px;
}

.source { color: var(--muted); font-size: 13px; }
.actions { margin-top: 23px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat {
  position: relative;
  overflow: hidden;
  min-height: 125px;
  border-radius: 13px;
  padding: 21px;
  background: var(--brand-charcoal);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--brand-orange);
}

.stat span { color: #bbb7b2; font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; }
.stat strong { display: block; margin-top: 5px; font-size: 32px; color: #fff; }

.filters {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 0.8fr 0.8fr auto;
  gap: 10px;
  align-items: end;
}

.filters.compact { grid-template-columns: minmax(250px, 340px); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-top: 26px; }
.two-columns { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; }
.two-columns .panel { margin-top: 0; }
.inline-form { display: flex; gap: 6px; align-items: center; }
.inline-form input { min-width: 130px; margin: 0; }

.question-admin-list { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }

.question-admin {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 17px;
  background: var(--surface-muted);
}

.question-admin h3 { margin: 8px 0; }
.question-admin p { margin: 4px 0; }
.question-admin small { color: var(--muted); }
.question-admin.inactive { opacity: 0.53; }

.form-panel { max-width: 870px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.option-editor { display: grid; gap: 8px; }

.option-editor label {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px;
  background: var(--surface-muted);
}

.option-editor input[type="radio"] { width: auto; margin: 0; accent-color: var(--brand-orange-dark); }
.option-editor input[type="text"], .option-editor input:not([type]) { margin: 0; border: 0; background: transparent; }
.option-editor label input:last-child:focus { outline: none; }
.grow { min-width: 0; }

.brand-note {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 1050px) {
  .brand-caption { display: none; }
  .filters { grid-template-columns: repeat(3, 1fr); }
  .filters .button { min-height: 45px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .topbar { min-height: 76px; gap: 18px; }
  .brand-logo { width: 175px; }
  .topbar nav { display: none; }
  .userbox { margin-left: auto; }
  .auth-shell { grid-template-columns: 1fr; max-width: 520px; }
  .auth-visual { min-height: 240px; padding: 34px; }
  .auth-visual::before { width: 190px; height: 310px; top: -60px; }
  .auth-visual::after { width: 120px; height: 230px; top: -10px; right: 80px; }
  .auth-copy h2 { font-size: 29px; }
  .auth-card { padding: 40px 34px; }
  .two-columns { grid-template-columns: 1fr; }
  .rules-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 650px) {
  .container, .auth-page .container { width: min(100% - 28px, 1240px); padding-top: 28px; }
  .topbar { padding: 0 14px; }
  .brand-logo { width: 150px; }
  .user-name { display: none; }
  .page-head, .test-header, .result-hero { align-items: flex-start; flex-direction: column; }
  .page-head .button { width: 100%; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .filters, .form-grid { grid-template-columns: 1fr; }
  .rules-grid { grid-template-columns: 1fr; }
  .submit-bar { bottom: 6px; align-items: stretch; flex-direction: column; }
  .submit-bar .button { width: 100%; }
  .score-ring { width: 122px; height: 122px; }
  .question-card { padding: 21px; }
  .inline-form { flex-direction: column; align-items: stretch; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar .button { width: 100%; }
  .auth-visual { display: none; }
  .auth-card { padding: 38px 24px; }
  .auth-card-logo { width: 220px; }
  footer { flex-direction: column; gap: 5px; }
  .question-admin { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 430px) {
  .stat-grid { grid-template-columns: 1fr; }
  .brand-logo { width: 132px; }
  .link-button { padding: 7px 10px; }
  h1 { font-size: 31px; }
}

/* Version 2: competency, reporting and assistant */
.assistant-link span,.assistant-button{color:var(--orange,#f1952c)}
.assistant-button{background:#20221f;color:#fff;border-color:#20221f}.assistant-button:hover{background:#30332f;color:#fff}
.sortable-table th a{color:inherit;text-decoration:none;white-space:nowrap}.sortable-table th a:hover{color:#e58618}
.summary-grid,.testing-list{display:grid;gap:22px}.summary-card{padding:0;overflow:hidden}.summary-head{display:flex;justify-content:space-between;gap:20px;align-items:flex-start;padding:24px 26px;border-bottom:1px solid #ecebe7}.summary-head h2{margin:0 0 5px}.summary-head p{margin:0;color:#6b6d68}.summary-counters{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}.summary-counters span{padding:7px 10px;border-radius:999px;font-size:13px;font-weight:700}.summary-counters .pass{background:#e9f6ec;color:#187a34}.summary-counters .fail{background:#fff0ec;color:#b73920}.summary-counters .neutral{background:#f0f0ee;color:#555}.status.neutral{background:#efefed;color:#575956}
.test-settings{padding:0;overflow:hidden}.test-settings.inactive{opacity:.78}.test-settings-form{padding:25px 27px;border-bottom:1px solid #e9e8e3}.test-settings-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px}.title-input{font-size:24px;font-weight:700;border:0;border-bottom:1px solid transparent;padding:7px 0;width:min(650px,70vw);background:transparent}.title-input:focus{border-bottom-color:#e78b20;outline:0}.test-settings-form textarea{width:100%;margin:13px 0}.settings-row{display:flex;gap:14px;align-items:end;flex-wrap:wrap}.settings-row label{max-width:170px}.switch{display:flex!important;align-items:center;gap:9px;cursor:pointer}.switch input{display:none}.switch span{width:42px;height:23px;border-radius:20px;background:#bbb;position:relative;display:block}.switch span:after{content:"";position:absolute;width:17px;height:17px;background:#fff;border-radius:50%;top:3px;left:3px;transition:.2s}.switch input:checked+span{background:#e68b20}.switch input:checked+span:after{left:22px}.section-list{padding:20px 27px 27px}.section-list h3{margin:0 0 12px}.section-row{display:flex;justify-content:space-between;align-items:center;gap:15px;border-top:1px solid #ecebe7;padding:13px 0}.section-row small{display:block;color:#777;margin-top:4px}.section-row.inactive{opacity:.55}
.user-admin-list{display:grid;gap:15px}.user-admin-card{border:1px solid #e4e3df;border-radius:12px;padding:16px;background:#fff}.user-admin-card.inactive{opacity:.58}.user-admin-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}.user-admin-title small{display:block;color:#777;margin-top:3px}.user-edit-grid{display:grid;grid-template-columns:1.2fr 1fr 1fr auto;gap:9px;align-items:end;margin-bottom:10px}.user-edit-grid label{font-size:12px}.context-label{font-size:12px;text-transform:uppercase;letter-spacing:.08em;font-weight:700;color:#d87c16;margin:18px 0 7px}.review-card blockquote{white-space:pre-line;line-height:1.55;max-height:none}
.assistant-shell{background:#fff;border:1px solid #e1e0dc;border-radius:18px;box-shadow:0 14px 40px rgba(25,25,22,.07);overflow:hidden}.chat-log{height:min(62vh,680px);min-height:430px;overflow-y:auto;padding:25px;display:flex;flex-direction:column;gap:17px;background:linear-gradient(180deg,#fafaf8,#fff)}.chat-empty{text-align:center;margin:auto;color:#777;max-width:520px}.chat-empty span{font-size:40px;color:#e88a1c}.chat-empty h2{color:#252622}.chat-message{display:flex;gap:11px;max-width:86%}.chat-message.user{align-self:flex-end;flex-direction:row-reverse}.chat-avatar{width:34px;height:34px;display:grid;place-items:center;border-radius:50%;background:#222420;color:#fff;font-weight:700;flex:0 0 auto}.chat-message.user .chat-avatar{background:#e68a1b}.chat-bubble{padding:13px 16px;border-radius:5px 16px 16px 16px;background:#f0f0ed;white-space:pre-wrap;line-height:1.5}.chat-message.user .chat-bubble{background:#252723;color:#fff;border-radius:16px 5px 16px 16px}.chat-sources{border-top:1px solid rgba(120,120,110,.25);font-size:12px;margin-top:12px;padding-top:9px;color:#6b6c68}.chat-form{display:flex;gap:12px;padding:17px;border-top:1px solid #e5e4df;background:#fff;align-items:end}.chat-form textarea{flex:1;resize:vertical;min-height:62px}.chat-form button{min-width:140px}
.chat-answer-text{white-space:normal}.chat-answer-text[data-assistant-markdown]{visibility:hidden}.chat-answer-text p{margin:0 0:.72em}.chat-answer-text p:last-child{margin-bottom:0}.chat-answer-text ul,.chat-answer-text ol{margin:.3em 0 .78em;padding-left:1.45em}.chat-answer-text li{margin:.18em 0}.chat-answer-text strong{font-weight:700}.chat-answer-text code{padding:.08em .3em;border-radius:4px;background:rgba(0,0,0,.07);font:inherit}.chat-markdown-gap{height:.28em}
@media(max-width:1000px){.user-edit-grid{grid-template-columns:1fr 1fr}.summary-head,.test-settings-head{flex-direction:column}.topbar nav{overflow-x:auto;max-width:100%}.topbar{flex-wrap:wrap}}
@media(max-width:700px){.user-edit-grid{grid-template-columns:1fr}.chat-message{max-width:96%}.chat-form{flex-direction:column;align-items:stretch}.chat-form button{width:100%}.summary-head{padding:18px}.section-list,.test-settings-form{padding:18px}.settings-row label{max-width:none;flex:1}.title-input{width:100%;font-size:20px}}

/* v3: evidence-first review and AI administration */
.evidence-context{background:#fffaf0;border-left:5px solid var(--brand-orange);padding:17px 19px;font-size:15px}
.answer-rationale{margin-top:12px;padding:12px 14px;border-radius:10px;background:var(--good-bg);color:#17633e;font-weight:700}
.ai-status-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin:20px 0}
.ai-settings-panel{max-width:930px}
.toggle-row{display:flex;align-items:center;justify-content:space-between;gap:20px;border:1px solid var(--line);padding:15px 17px;border-radius:12px;background:var(--surface-muted)}
.toggle-row span{display:flex;flex-direction:column;gap:4px}.toggle-row small,.ai-settings-panel label small{display:block;color:var(--muted);font-weight:400;margin-top:5px}.toggle-row input{width:24px;height:24px;margin:0}
.check-line{display:flex;align-items:center;gap:9px}.check-line input{width:18px;height:18px;margin:0}
.ai-test-form{display:flex;align-items:center;gap:14px;margin-top:18px;padding-top:18px;border-top:1px solid var(--line)}
.connection-result{margin-top:18px;padding:14px 16px;border-radius:10px}.connection-result.ok{background:var(--good-bg);color:#17633e}.connection-result.error{background:var(--bad-bg);color:#8c2c27}.connection-result p{margin:6px 0 0}
@media(max-width:900px){.ai-status-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:600px){.ai-status-grid{grid-template-columns:1fr}.toggle-row,.ai-test-form{align-items:flex-start;flex-direction:column}}

/* Version 4: official supplied Жарко logo asset */
.brand-logo {
  width: 222px;
  max-height: 64px;
  object-fit: contain;
}
.auth-card-logo {
  width: 300px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}
@media (max-width: 900px) {
  .brand-logo { width: 190px; }
}
@media (max-width: 650px) {
  .brand-logo { width: 165px; }
  .auth-card-logo { width: 270px; }
}
@media (max-width: 430px) {
  .brand-logo { width: 145px; }
}

/* Version 6: weekly rupechi.ru knowledge synchronization */
.site-sync-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin:20px 0}
.site-sync-grid .stat small{display:block;color:var(--muted);font-size:12px;margin-top:7px;line-height:1.35}
.site-sync-layout{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(300px,.85fr);gap:22px;align-items:start}
.site-sync-panel{max-width:none}
.sync-settings-grid{grid-template-columns:1.2fr .7fr .7fr 1.1fr 1.2fr}
.site-sync-run-form{display:flex;align-items:center;gap:16px;margin-top:20px;padding-top:20px;border-top:1px solid var(--line)}
.site-sync-run-form .muted{max-width:580px;line-height:1.45}
.site-sync-info h2{margin-top:7px}
.compact-list{margin:14px 0 18px;padding-left:20px;line-height:1.6}
.chat-sources a{color:inherit;text-decoration:underline;text-underline-offset:2px}
.chat-sources a:hover{color:var(--brand-orange)}
@media(max-width:1050px){.site-sync-grid{grid-template-columns:repeat(2,1fr)}.site-sync-layout{grid-template-columns:1fr}.sync-settings-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:620px){.site-sync-grid{grid-template-columns:1fr}.sync-settings-grid{grid-template-columns:1fr}.site-sync-run-form{align-items:stretch;flex-direction:column}.site-sync-run-form .button{width:100%}}

/* V7: раскрывающийся список разделов на странице активных тестов */
.section-dropdown{border-top:1px solid #e9e8e3;background:#fff}
.section-dropdown>summary{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:18px 27px;cursor:pointer;list-style:none;user-select:none;transition:background .18s ease}
.section-dropdown>summary::-webkit-details-marker{display:none}
.section-dropdown>summary:hover{background:#faf9f6}
.section-dropdown-title{display:flex;align-items:baseline;gap:10px;min-width:0}
.section-dropdown-title b{font-size:17px}
.section-dropdown-title small{color:#777;font-size:13px;white-space:nowrap}
.section-dropdown-action{display:inline-flex;align-items:center;gap:9px;color:#6b6d68;font-size:13px;font-weight:700;white-space:nowrap}
.section-dropdown-action:after{content:"";width:8px;height:8px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg) translateY(-2px);transition:transform .18s ease}
.section-dropdown[open] .section-dropdown-action:before{content:"Скрыть"}
.section-dropdown[open] .section-dropdown-action{font-size:0}
.section-dropdown[open] .section-dropdown-action:before{font-size:13px}
.section-dropdown[open] .section-dropdown-action:after{transform:rotate(225deg) translate(-2px,-2px)}
.section-dropdown[open]>summary{background:#faf9f6;border-bottom:1px solid #ecebe7}
.section-dropdown .section-list{padding:7px 27px 20px}
.section-dropdown .section-row:first-child{border-top:0}
.section-empty{padding:15px 0;color:#777}
@media(max-width:700px){.section-dropdown>summary{padding:16px 18px}.section-dropdown-title{align-items:flex-start;flex-direction:column;gap:3px}.section-dropdown-title small{white-space:normal}.section-dropdown .section-list{padding:5px 18px 17px}.section-dropdown-action{font-size:0}.section-dropdown-action:before{content:"Открыть";font-size:13px}.section-dropdown[open] .section-dropdown-action:before{content:"Скрыть"}}

/* Version 11: unified and control testing */
.section-title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:24px}.section-title-row h2{margin:0 0 7px}.section-title-row p{margin:0;color:var(--muted)}.timezone-note{display:inline-flex;padding:7px 11px;border:1px solid var(--line);border-radius:999px;color:var(--muted);font-size:12px;white-space:nowrap}
.control-employee-panel{margin-top:0;border-top:4px solid var(--brand-red)}.control-card-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(290px,1fr));gap:16px;margin-top:20px}.control-card{display:flex;flex-direction:column;min-height:310px;padding:20px;border:1px solid var(--line);border-radius:12px;background:#fff;box-shadow:0 7px 18px rgba(47,46,45,.05)}.control-card.state-available,.control-card.state-in_progress{border-color:#e3b16e;box-shadow:0 10px 28px rgba(217,149,72,.14)}.control-card-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.control-card h3{margin:17px 0 7px;font-size:22px}.control-groups{min-height:42px;color:var(--muted);font-size:13px}.control-facts{display:grid;gap:7px;margin:10px 0 14px;padding:13px;border-radius:9px;background:var(--surface-muted);font-size:13px}.control-facts span{display:flex;justify-content:space-between;gap:12px}.control-facts b{color:var(--brand-charcoal)}.assignment-note{padding-left:12px;border-left:3px solid var(--brand-orange);color:#5f5b56;font-size:13px}.control-card-actions{margin-top:auto;padding-top:14px}.control-card-actions .button{width:100%}
.status.control-scheduled,.status.control-missed,.status.control-cancelled{background:#efefed;color:#575956}.status.control-available{background:#fff1df;color:#995716}.status.control-in_progress{background:#edf5fa;color:#2f5f80}.status.control-passed{background:var(--good-bg);color:var(--good)}.status.control-failed,.status.control-timeout{background:var(--bad-bg);color:var(--bad)}.status.control-type{background:#fff1df;color:#995716}
.training-panel{border-top:4px solid var(--brand-orange)}.general-test-layout{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(260px,.9fr);gap:30px;align-items:start;margin-top:18px}.general-meta,.general-stats{justify-content:flex-start;gap:28px;margin-top:0}.general-stats{margin-bottom:20px}.included-groups{border:1px solid var(--line);border-radius:10px;background:var(--surface-muted)}.included-groups summary{padding:14px 16px;cursor:pointer;font-weight:700}.included-groups>div{display:grid;gap:7px;padding:0 16px 15px}.included-groups span{display:flex;justify-content:space-between;gap:12px;padding-top:7px;border-top:1px solid var(--line);font-size:13px}.included-groups b{color:var(--brand-orange-dark)}
.wide-intro{max-width:930px}.rules-grid.four{grid-template-columns:repeat(4,1fr)}.test-section-preview{margin:22px 0;border:1px solid var(--line);border-radius:11px;overflow:hidden}.test-section-preview h3{margin:0;padding:14px 17px;background:#f7f4f0;border-bottom:1px solid var(--line)}.test-section-preview>div{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:11px 17px;border-bottom:1px solid #eeeae5}.test-section-preview>div:last-child{border-bottom:0}.test-section-preview b{color:var(--brand-orange-dark);white-space:nowrap}.control-window{display:grid;grid-template-columns:repeat(3,1fr);gap:11px;margin:22px 0}.control-window>div{padding:15px;border:1px solid var(--line);border-radius:10px;background:var(--surface-muted)}.control-window span{display:block;color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.05em}.control-window b{display:block;margin-top:5px;font-size:15px}.control-intro>.status{margin:0 0 15px}
.autosave-line{position:sticky;top:86px;z-index:20;display:flex;justify-content:space-between;gap:20px;margin-bottom:18px;padding:10px 14px;border:1px solid var(--line);border-radius:9px;background:rgba(255,255,255,.96);box-shadow:var(--shadow-sm);font-size:13px}.autosave-line .saved{color:var(--good)}.autosave-line .saving{color:var(--info)}.autosave-line .save-error{color:var(--bad)}.question-groups{display:grid;gap:32px}.test-question-group{scroll-margin-top:150px}.test-group-heading{display:grid;grid-template-columns:1fr auto;align-items:end;gap:3px 20px;margin-bottom:15px;padding:18px 22px;border-radius:13px;background:linear-gradient(135deg,var(--brand-charcoal),#45413d);color:#fff;box-shadow:var(--shadow-sm)}.test-group-heading>span{grid-column:1/-1;color:#edbb82;text-transform:uppercase;letter-spacing:.08em;font-size:11px;font-weight:700}.test-group-heading h2{margin:0;color:#fff;font-size:27px}.test-group-heading small{color:#d8d4cf}.question-number{display:flex;justify-content:space-between;gap:16px}.question-number span{color:var(--muted);font-weight:400;text-transform:none;letter-spacing:0}.timer.warning{background:var(--warning-bg);color:var(--warning);border-color:#e7c674}.review-group{margin-bottom:8px;color:var(--brand-orange-dark);font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.07em}
.settings-grid-wide{display:grid;grid-template-columns:minmax(250px,2fr) repeat(2,minmax(150px,1fr));gap:15px;margin-bottom:15px}.general-test-settings form>label{display:block;margin-bottom:14px}.source-group-settings{align-items:end}.source-group-settings label{max-width:220px}.settings-hint{flex:1;padding:11px 0;color:var(--muted);font-size:13px}
.control-admin-grid{display:grid;grid-template-columns:minmax(0,3fr) minmax(230px,1fr);gap:22px;align-items:start}.assignment-builder{margin-top:0}.control-stats-panel{margin-top:0;position:sticky;top:108px}.control-stat-list{display:grid;gap:8px;margin:18px 0}.control-stat-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px;border:1px solid var(--line);border-radius:9px;text-decoration:none}.control-stat-row:hover{border-color:var(--brand-orange);background:var(--surface-muted)}.control-stat-row b{font-size:20px;color:var(--brand-charcoal)}.assignment-picker-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin:22px 0}.picker-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px}.picker-head h3{margin:0}.picker-head small{color:var(--muted)}#employee-select{min-height:310px}.picker-actions{display:flex;gap:8px;margin-top:8px}.control-group-picker{display:grid;gap:8px;max-height:368px;overflow:auto;padding:2px}.control-group-option{display:flex;align-items:flex-start;gap:10px;padding:11px;border:1px solid var(--line);border-radius:9px;background:#fff;cursor:pointer}.control-group-option:hover{border-color:var(--brand-orange);background:var(--brand-orange-soft)}.control-group-option input{width:auto;margin:4px 0 0;flex:0 0 auto}.control-group-option span{display:flex;flex-direction:column}.control-group-option small{margin-top:3px;color:var(--muted);font-weight:400}.table-actions{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center}.table-actions form{margin:0}.table-link{border:0;padding:0;background:none;color:var(--brand-orange-dark);font:inherit;font-weight:700;cursor:pointer}.table-link:hover{text-decoration:underline}.table-link.danger{color:var(--bad)}.control-table td:nth-child(2){min-width:290px}.control-table td:nth-child(3){min-width:170px}

@media(max-width:1050px){.control-admin-grid{grid-template-columns:1fr}.control-stats-panel{position:static}.assignment-picker-grid,.general-test-layout{grid-template-columns:1fr}.settings-grid-wide{grid-template-columns:1fr 1fr}.settings-grid-wide label:first-child{grid-column:1/-1}}
@media(max-width:700px){.section-title-row,.control-facts span,.autosave-line{flex-direction:column}.rules-grid.four,.control-window{grid-template-columns:1fr 1fr}.assignment-picker-grid,.settings-grid-wide{grid-template-columns:1fr}.settings-grid-wide label:first-child{grid-column:auto}.test-group-heading{grid-template-columns:1fr}.test-group-heading small{margin-top:5px}.control-card-grid{grid-template-columns:1fr}.autosave-line{top:142px}.picker-actions{flex-wrap:wrap}}

/* Version 12: question count per control-test section */
.control-group-option{display:grid;grid-template-columns:minmax(0,1fr) 92px;gap:12px;align-items:center;cursor:default}
.control-group-main{display:flex;align-items:flex-start;gap:10px;min-width:0;cursor:pointer}
.control-group-main input{width:auto;margin:4px 0 0;flex:0 0 auto}
.control-group-main span{display:flex;flex-direction:column;min-width:0}
.control-group-main small{margin-top:3px;color:var(--muted);font-weight:400}
.control-question-count{display:flex;flex-direction:column;gap:4px;color:var(--muted);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em}
.control-question-count input{width:100%;min-width:0;padding:8px 9px;text-align:center;color:var(--brand-charcoal);font-size:15px;font-weight:700}
@media(max-width:700px){.control-group-option{grid-template-columns:minmax(0,1fr) 82px}.control-question-count input{padding:8px 5px}}

/* V13: массовая установка количества вопросов для контрольного теста */
.bulk-question-count{display:grid;grid-template-columns:minmax(0,1fr) 92px auto;align-items:end;gap:10px;margin:10px 2px 12px;padding:10px 12px;border:1px solid var(--line);border-radius:9px;background:var(--surface-muted)}
.bulk-question-count label{align-self:center;margin:0;color:var(--brand-charcoal);font-size:13px;font-weight:700}
.bulk-question-count input{width:100%;min-width:0;padding:8px 9px;text-align:center;font-size:15px;font-weight:700}
.bulk-question-count .button.compact{min-height:38px;padding:8px 12px;white-space:nowrap}
@media(max-width:700px){.bulk-question-count{grid-template-columns:minmax(0,1fr) 82px}.bulk-question-count .button.compact{grid-column:1/-1;width:100%}}

/* V14: расширенные типы вопросов, изображения и управление контрольным пулом */
.question-builder-panel{max-width:1050px}.question-builder-panel label small{display:block;margin-top:4px;color:var(--muted);font-weight:400}.answer-editor{padding:18px;border:1px solid var(--line);border-radius:12px;background:var(--surface-muted)}.answer-editor[hidden]{display:none}.answer-editor-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:14px}.answer-editor-head h2{margin:0 0 4px;font-size:20px}.answer-editor-head p{margin:0;color:var(--muted);font-size:13px}.dynamic-rows{display:grid;gap:9px}.dynamic-row{display:grid;align-items:center;gap:9px}.choice-row{grid-template-columns:145px minmax(0,1fr) 40px}.matching-row{grid-template-columns:minmax(0,1fr) 30px minmax(0,1fr) 40px}.ordering-row{grid-template-columns:38px minmax(0,1fr) 40px}.correct-marker{display:flex!important;align-items:center;gap:7px;margin:0!important;padding:9px;border:1px solid var(--line);border-radius:8px;background:#fff;font-size:12px}.correct-marker input{width:auto;margin:0}.pair-arrow,.order-number{display:grid;place-items:center;color:var(--brand-orange-dark);font-weight:800}.icon-button{display:inline-grid;place-items:center;width:34px;height:34px;padding:0;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--brand-charcoal);font-size:17px;cursor:pointer}.icon-button:hover{border-color:var(--brand-orange);background:var(--brand-orange-soft)}.icon-button.danger{color:var(--bad)}.toggle-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.check-card{display:flex!important;align-items:flex-start;gap:11px;margin:0!important;padding:14px;border:1px solid var(--line);border-radius:10px;background:#fff}.check-card input{width:19px;height:19px;margin:2px 0 0}.check-card span{display:flex;flex-direction:column}.check-card small{margin-top:3px!important}.question-badges{display:flex;flex-wrap:wrap;gap:7px}.pill.neutral,.pill.muted{background:#efefed;color:#5c5e59}.pill.success{background:var(--good-bg);color:var(--good)}.question-admin{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:18px;align-items:start}.question-admin-image{width:140px;max-height:120px;object-fit:contain;border:1px solid var(--line);border-radius:9px;background:#fff}.question-admin-body h3{margin:12px 0 8px}.correct-answer-preview{display:grid;grid-template-columns:auto 1fr;gap:7px}.correct-answer-preview span,.multiline-answer span{white-space:pre-line}.question-admin-actions{display:grid;gap:7px;min-width:190px}.question-admin-actions form,.question-admin-actions .button{width:100%;margin:0}.button.danger{background:#fff;color:var(--bad);border-color:#e4b3ae}.button.danger:hover{background:var(--bad-bg)}.question-type-hint{display:inline-flex;margin:7px 0 2px;padding:5px 8px;border-radius:999px;background:var(--brand-orange-soft);color:var(--brand-orange-dark);font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}.question-image-wrap{display:flex;justify-content:center;margin:16px 0}.question-image-wrap img{max-width:min(100%,760px);max-height:470px;object-fit:contain;border:1px solid var(--line);border-radius:12px;background:#fff}.answer-instruction{margin:5px 0 12px;color:var(--muted);font-size:13px}.checkbox-options .option input{accent-color:var(--brand-orange)}.matching-answer-grid{display:grid;gap:10px}.matching-row-answer{display:grid!important;grid-template-columns:minmax(0,1.2fr) minmax(220px,.8fr);align-items:center;gap:16px;margin:0!important;padding:12px;border:1px solid var(--line);border-radius:10px;background:#fff}.matching-row-answer>span{font-weight:700}.ordering-list{display:grid;gap:8px}.ordering-item{display:grid;grid-template-columns:38px minmax(0,1fr) auto;align-items:center;gap:10px;padding:11px;border:1px solid var(--line);border-radius:10px;background:#fff}.ordering-position{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:var(--brand-charcoal);color:#fff;font-weight:800}.ordering-text{font-weight:650}.ordering-actions{display:flex;gap:6px}.review-image{justify-content:flex-start}.review-image img{max-width:520px;max-height:320px}.multiline-answer{display:grid;grid-template-columns:auto 1fr;gap:7px}
@media(max-width:850px){.question-admin{grid-template-columns:1fr}.question-admin-image{width:100%;max-height:230px}.question-admin-actions{grid-template-columns:repeat(3,1fr);min-width:0}.question-admin-actions .button{height:100%}.matching-row-answer{grid-template-columns:1fr}.toggle-grid{grid-template-columns:1fr}}
@media(max-width:620px){.answer-editor-head{flex-direction:column}.choice-row{grid-template-columns:1fr 40px}.choice-row .correct-marker{grid-column:1/-1}.matching-row{grid-template-columns:1fr 40px}.matching-row .pair-arrow{display:none}.matching-row input:nth-of-type(2){grid-column:1}.ordering-row{grid-template-columns:32px 1fr 40px}.question-admin-actions{grid-template-columns:1fr}.ordering-item{grid-template-columns:34px 1fr}.ordering-actions{grid-column:1/-1;justify-content:flex-end}.multiline-answer,.correct-answer-preview{grid-template-columns:1fr}}

/* V16: изображения вариантов ответа и надежный выбор нескольких правильных */
.choice-row{grid-template-columns:160px minmax(0,1fr) 40px;align-items:start}
.matching-row{grid-template-columns:minmax(0,1.1fr) 30px minmax(220px,.9fr) 40px;align-items:start}
.ordering-row{grid-template-columns:38px minmax(0,1fr) 40px;align-items:start}
.answer-option-main{display:grid;gap:8px;min-width:0}
.correct-marker{min-height:44px;cursor:pointer;user-select:none}
.correct-marker input[type="checkbox"],.correct-marker input[type="radio"]{width:20px;height:20px;flex:0 0 auto;accent-color:var(--brand-orange)}
.multiple-status{margin-top:10px;padding:9px 11px;border-radius:8px;font-size:13px;font-weight:800}
.multiple-status.valid{background:var(--good-bg);color:var(--good)}
.multiple-status.invalid{background:var(--bad-bg);color:var(--bad)}
.option-image-editor{display:grid;gap:7px;padding:10px;border:1px dashed var(--line);border-radius:9px;background:#fff}
.option-image-editor>small{margin:0!important;color:var(--muted)}
.option-image-preview{display:flex;align-items:center;gap:10px;min-height:62px;padding:8px;border-radius:8px;background:var(--surface-muted);color:var(--muted);font-size:12px;font-weight:700}
.option-image-preview[hidden]{display:none}
.option-image-preview img{width:92px;height:62px;object-fit:contain;border:1px solid var(--line);border-radius:7px;background:#fff}
.option-image-actions{display:flex;flex-wrap:wrap;gap:7px}
.option-image-upload-label{position:relative;overflow:hidden;cursor:pointer}
.option-image-upload-label input{position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none}
.option-image-remove[hidden]{display:none}
.row-remove-button{margin-top:5px}
.option-with-media{align-items:flex-start!important}
.option-content{display:flex;flex-direction:column;align-items:flex-start;gap:9px;min-width:0;width:100%}
.answer-option-image{display:block;max-width:min(100%,360px);max-height:230px;object-fit:contain;border:1px solid var(--line);border-radius:9px;background:#fff}
.matching-left-content{display:flex;flex-direction:column;gap:8px;font-weight:700}
.matching-image{max-width:280px;max-height:180px}
.ordering-image{max-width:250px;max-height:160px}
.visually-hidden{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}
@media(max-width:850px){.matching-row{grid-template-columns:1fr 40px}.matching-row .pair-arrow{display:none}.matching-row>input[name="match_right"]{grid-column:1}.choice-row{grid-template-columns:145px minmax(0,1fr) 40px}}
@media(max-width:620px){.choice-row{grid-template-columns:1fr 40px}.choice-row .correct-marker{grid-column:1/-1}.option-image-actions{display:grid;grid-template-columns:1fr}.option-image-actions .button{width:100%}.answer-option-image{max-width:100%}}

/* v17: reliable multi-answer editor */
.correct-marker.selected{border-color:var(--brand-orange);background:var(--brand-orange-soft);box-shadow:0 0 0 2px rgba(236,102,8,.12)}
.correct-marker input[type="checkbox"]{appearance:auto!important;-webkit-appearance:checkbox!important;display:block!important;opacity:1!important;pointer-events:auto!important}
.multiple-status{margin:0 0 12px;padding:10px 12px;border-radius:9px;font-weight:750}
.multiple-status.valid{background:var(--good-bg);color:var(--good)}
.multiple-status.invalid{background:var(--bad-bg);color:var(--bad)}

/* V18: фильтр активности и ненавязчивая маркировка вопросов с изображениями */
.question-bank-filters{display:grid;grid-template-columns:minmax(220px,1fr) minmax(220px,1fr);gap:14px;align-items:end}
.question-list-summary{margin:4px 0 14px;color:var(--muted);font-size:13px}
.pill.image-marker{display:inline-flex;align-items:center;gap:5px;background:#f3f1ee;color:#6b625a;border:1px solid #ddd7d0;font-weight:700}
.pill.image-marker span{font-size:14px;line-height:1;color:var(--brand-orange-dark)}
.question-admin.inactive{opacity:.76;background:#fafafa}
.question-admin.inactive h3{color:#656565}
.empty-state.compact{margin:15px 0;padding:28px;border:1px dashed var(--line);border-radius:12px;text-align:center;background:var(--surface-muted)}
.empty-state.compact h3{margin:0 0 6px}.empty-state.compact p{margin:0;color:var(--muted)}
@media(max-width:700px){.question-bank-filters{grid-template-columns:1fr}}

/* V19: stable question-bank position and uniform compact action buttons */
.question-admin-actions{
  --question-action-width: 168px;
  display:grid;
  grid-template-columns:repeat(2,var(--question-action-width));
  gap:6px;
  min-width:0;
  width:max-content;
}
.question-admin-actions form{
  width:var(--question-action-width);
  margin:0;
}
.question-admin-actions .button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:var(--question-action-width);
  min-width:var(--question-action-width);
  min-height:34px;
  margin:0;
  padding:7px 9px;
  font-size:12px;
  line-height:1.15;
  text-align:center;
  white-space:normal;
}
@media(max-width:850px){
  .question-admin-actions{
    grid-template-columns:repeat(2,minmax(0,1fr));
    width:min(100%,342px);
  }
  .question-admin-actions form,.question-admin-actions .button{
    width:100%;
    min-width:0;
  }
}
@media(max-width:430px){
  .question-admin-actions{grid-template-columns:1fr;width:100%}
}


/* V20: fixed compact action column; all remaining width belongs to question content */
.question-admin{
  display:grid;
  grid-template-columns:minmax(0,1fr) 148px;
  gap:16px;
  align-items:start;
  width:100%;
}
.question-admin-main{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:18px;
  min-width:0;
  width:100%;
}
.question-admin-main.has-question-image{
  grid-template-columns:140px minmax(0,1fr);
}
.question-admin-body{
  min-width:0;
  width:100%;
}
.question-admin-body h3,
.correct-answer-preview,
.question-admin-body small{
  overflow-wrap:anywhere;
}
.question-admin-actions{
  --question-action-width:148px;
  display:grid;
  grid-template-columns:1fr;
  gap:6px;
  width:148px;
  min-width:148px;
  max-width:148px;
  justify-self:end;
}
.question-admin-actions form,
.question-admin-actions .button{
  width:148px;
  min-width:148px;
  max-width:148px;
  margin:0;
}
.question-admin-actions .button{
  min-height:32px;
  padding:6px 7px;
  font-size:11.5px;
  line-height:1.15;
  white-space:normal;
}
@media(max-width:850px){
  .question-admin{
    grid-template-columns:minmax(0,1fr) 140px;
    gap:12px;
  }
  .question-admin-main.has-question-image{
    grid-template-columns:110px minmax(0,1fr);
  }
  .question-admin-image{width:110px;max-height:100px}
  .question-admin-actions,
  .question-admin-actions form,
  .question-admin-actions .button{
    width:140px;
    min-width:140px;
    max-width:140px;
  }
}
@media(max-width:650px){
  .question-admin{grid-template-columns:1fr}
  .question-admin-main.has-question-image{grid-template-columns:92px minmax(0,1fr)}
  .question-admin-image{width:92px;max-height:86px}
  .question-admin-actions{
    grid-template-columns:repeat(2,minmax(0,1fr));
    width:100%;
    min-width:0;
    max-width:none;
    justify-self:stretch;
  }
  .question-admin-actions form,
  .question-admin-actions .button{
    width:100%;
    min-width:0;
    max-width:none;
  }
}
@media(max-width:430px){
  .question-admin-main.has-question-image{grid-template-columns:1fr}
  .question-admin-image{width:100%;max-height:200px}
  .question-admin-actions{grid-template-columns:1fr}
}


/* V21: subtle readable numbering in the admin question bank */
.question-list-number{
  display:block;
  margin:0 0 5px;
  color:#6b7280;
  font-size:12px;
  font-weight:700;
  line-height:1.2;
  letter-spacing:.02em;
  font-variant-numeric:tabular-nums;
}


/* V22: stable unique question ID on every screen that displays an individual question */
.question-uid{
  display:inline-flex;
  align-items:center;
  flex:0 0 auto;
  margin-left:6px;
  padding:1px 5px;
  border:1px solid #d9d5cf;
  border-radius:5px;
  background:#f7f6f4;
  color:#69645f;
  font-size:11px;
  font-weight:700;
  line-height:1.35;
  letter-spacing:.015em;
  text-transform:none;
  white-space:nowrap;
  font-variant-numeric:tabular-nums;
}
.question-list-number.question-uid{
  width:max-content;
  margin:0 0 5px;
}
.question-number .question-progress-label{
  display:inline-flex;
  align-items:center;
  gap:2px;
  color:var(--brand-orange-dark);
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.question-number .question-uid{
  margin-left:5px;
  vertical-align:middle;
}
.review-group .question-uid{
  margin-left:7px;
  vertical-align:middle;
}

/* Version 24: MCP 1C integration and restored control-test views */
details.section-list{margin-top:18px;border:1px solid var(--line);border-radius:10px;background:var(--surface-muted);overflow:hidden}
details.section-list>summary{padding:14px 16px;cursor:pointer;list-style:none;color:var(--brand-charcoal)}
details.section-list>summary::-webkit-details-marker{display:none}
details.section-list>summary::after{content:"Показать";float:right;color:var(--brand-orange-dark);font-size:12px}
details.section-list[open]>summary::after{content:"Скрыть"}
details.section-list>div{border-top:1px solid var(--line);background:#fff}
.ai-settings-panel h2{margin:8px 0 0}
.chat-sources a{overflow-wrap:anywhere}

/* Version 24.1: explicit archive for historical question revisions */
.page-head-actions{display:flex;flex-wrap:wrap;gap:10px;justify-content:flex-end}
.pill.archive{background:#ece9e5;color:#5f5952;border-color:#d7d1ca}
.question-admin.archived{border-color:#d7d1ca;background:#faf9f7}
.question-admin.archived .question-admin-body h3{color:#5d5954}
.archive-only-note{display:flex;flex-direction:column;gap:5px;padding:12px;border:1px solid #d7d1ca;border-radius:9px;background:#f3f1ee;color:#5f5952;font-size:12px}
.archive-only-note b{font-size:13px;color:var(--brand-charcoal)}
.question-admin.archived .question-admin-actions{display:flex;align-items:stretch}
@media(max-width:700px){.page-head-actions{width:100%;justify-content:flex-start}.page-head-actions .button{flex:1 1 auto}}
.eyebrow .question-uid{
  margin-left:7px;
  vertical-align:middle;
}
.question-id-note{
  margin-top:5px;
  color:var(--muted);
  font-size:12px;
}
/* Zharik assistant identity */
.chat-message.assistant .chat-avatar{overflow:hidden;background:#5b2d16;border:2px solid #f1952c;box-shadow:0 2px 8px rgba(91,45,22,.22)}
.chat-avatar img{width:100%;height:100%;display:block;object-fit:cover}
.chat-empty-avatar{width:116px;height:116px;display:block;margin:0 auto 14px;border-radius:50%;object-fit:cover;border:4px solid #f1952c;box-shadow:0 8px 24px rgba(91,45,22,.2)}
.zharik-avatar-button,.chat-empty-avatar-button{appearance:none;padding:0;border:0;background:transparent;font:inherit}
.zharik-avatar-button{display:block;width:100%;height:100%;border-radius:50%;cursor:zoom-in;transition:filter .15s ease}
.zharik-avatar-button:hover{filter:brightness(1.12)}
.zharik-avatar-button:focus-visible,.chat-empty-avatar-button:focus-visible{outline:3px solid #f1952c;outline-offset:3px}
.chat-empty-avatar-button{display:inline-block;border-radius:50%;line-height:0;cursor:zoom-in}
.chat-empty-avatar-button .chat-empty-avatar{transition:transform .18s ease,box-shadow .18s ease}
.chat-empty-avatar-button:hover .chat-empty-avatar{transform:scale(1.04);box-shadow:0 10px 30px rgba(91,45,22,.28)}
.zharik-modal[hidden]{display:none}
.zharik-modal{position:fixed;inset:0;z-index:10000;display:grid;place-items:center;background:rgba(14,10,7,.88);backdrop-filter:blur(5px)}
.zharik-modal-surface{appearance:none;width:100%;height:100%;padding:24px;border:0;background:transparent;display:grid;place-items:center;align-content:center;gap:14px;cursor:zoom-out;color:#fff}
.zharik-modal-surface img{display:block;max-width:min(90vw,1024px);max-height:82vh;width:auto;height:auto;border-radius:24px;border:4px solid #f1952c;box-shadow:0 24px 80px rgba(0,0,0,.55)}
.zharik-modal-surface:focus-visible{outline:3px solid #f1952c;outline-offset:-8px}
.zharik-modal-hint{font-size:14px;font-weight:700;letter-spacing:.02em;text-shadow:0 1px 4px #000}
.zharik-modal-open{overflow:hidden}

/* Version 25.5: document analysis in Zharik */
.assistant-document-panel{padding:14px 18px;border-top:1px solid var(--line);background:#fffaf4}
.assistant-document-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:10px}
.assistant-upload-mode{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:13px;font-weight:700}
.assistant-upload-mode select{min-height:36px;padding:6px 32px 6px 9px;border:1px solid var(--line-strong);border-radius:8px;background:#fff;color:var(--text)}
.assistant-upload-status{min-height:20px;color:var(--muted);font-size:13px;font-weight:700}
.assistant-upload-status.success{color:var(--good)}
.assistant-upload-status.error{color:var(--bad)}
.assistant-document-note{margin:8px 0 0;color:var(--muted);font-size:12px}
.assistant-document-list{display:grid;gap:8px;margin-top:12px}
.assistant-document-card{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;padding:11px 12px;border:1px solid var(--line);border-radius:10px;background:#fff}
.assistant-document-main{display:grid;grid-template-columns:minmax(120px,max-content) max-content;align-items:center;gap:4px 8px;min-width:0}
.assistant-document-main>strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.assistant-document-main>small,.assistant-document-main>details{grid-column:1/-1}
.assistant-document-main>small{color:var(--muted)}
.assistant-document-main details{font-size:12px;color:var(--muted)}
.assistant-document-main summary{width:max-content;cursor:pointer;color:var(--brand-orange-dark);font-weight:700}
.assistant-document-main details div{max-width:760px;margin-top:6px;padding:9px;border-radius:7px;background:var(--surface-muted);white-space:pre-wrap;overflow-wrap:anywhere}
.assistant-document-badge{display:inline-flex;padding:2px 7px;border-radius:999px;background:var(--info-bg);color:var(--info);font-size:11px;font-weight:800;white-space:nowrap}
.assistant-document-badge.pending{background:var(--warning-bg);color:var(--warning)}
.assistant-document-badge.knowledge{background:var(--good-bg);color:var(--good)}
.assistant-document-actions{display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:7px;flex:0 0 auto}
.button.compact{min-height:32px;padding:6px 10px;font-size:12px}
@media(max-width:700px){
  .assistant-document-toolbar,.assistant-upload-mode{align-items:stretch;flex-direction:column}
  .assistant-document-toolbar>.button,.assistant-upload-mode select{width:100%}
  .assistant-document-card{flex-direction:column}
  .assistant-document-actions{width:100%;justify-content:stretch}
  .assistant-document-actions .button{flex:1}
}

/* 2026-08-26: Bitrix sync, protected testing and installable mobile app */
.test-page-timer{
  position:fixed;
  top:100px;
  right:max(18px,calc((100vw - 1240px)/2));
  z-index:45;
  border:2px solid rgba(255,255,255,.72);
  box-shadow:0 12px 34px rgba(35,31,27,.28);
  transition:background-color .25s ease,color .25s ease,transform .2s ease;
}
.timer.pace-warning{background:#e5aa24;color:#2d2413;transform:scale(1.02)}
.timer.pace-warning span{color:#594415}
.timer.pace-danger{background:var(--brand-red);color:#fff;transform:scale(1.04);animation:pace-alert 1.8s ease-in-out infinite}
.timer.pace-danger span{color:#ffe4df}
@keyframes pace-alert{0%,100%{box-shadow:0 12px 34px rgba(124,30,22,.28)}50%{box-shadow:0 12px 42px rgba(190,43,31,.55)}}
.assistant-disabled{display:inline-flex;align-items:center;gap:6px;align-self:center;padding:12px 14px;color:#8a8580;font-size:14px;font-weight:750;white-space:nowrap;cursor:not-allowed}
.assistant-disabled>span{filter:grayscale(1)}
.app-download-links{display:flex;flex-wrap:wrap;gap:9px 18px}
.app-download-links a{font-weight:700;text-underline-offset:3px}
.bitrix-sync-panel{margin:22px 0}.compact-sync-grid{grid-template-columns:repeat(3,minmax(0,1fr));margin:18px 0}.bitrix-sync-panel .toolbar p{margin:6px 0 0;color:var(--muted)}
.mobile-app-hero{display:grid;grid-template-columns:minmax(0,1fr) 250px;align-items:center;gap:44px;padding:42px;background:linear-gradient(135deg,#fff 20%,#fff7ec)}
.mobile-app-copy h1{margin:7px 0 14px;font-size:clamp(34px,5vw,58px)}
.mobile-app-copy>p{max-width:720px;font-size:18px;line-height:1.6}
.mobile-install-actions{display:flex;flex-wrap:wrap;gap:11px;margin:24px 0 14px}
.mobile-app-icon{display:grid;place-items:center}.mobile-app-icon img{width:230px;height:230px;border-radius:48px;box-shadow:0 24px 55px rgba(80,51,22,.2)}
.mobile-platform-grid{display:grid;grid-template-columns:1fr 1fr;gap:22px;margin-top:22px}.platform-card{padding:28px}.platform-card h2{margin:5px 0 12px}.platform-card ol{padding-left:22px;line-height:1.8}.platform-symbol{font-size:36px;font-weight:800}
@media(max-width:700px){
  .test-page-timer{top:auto;right:12px;bottom:14px;min-width:124px;padding:9px 13px}
  .test-page-timer b{font-size:23px}.test-page-timer span{font-size:9px}
  .compact-sync-grid,.mobile-platform-grid,.mobile-app-hero{grid-template-columns:1fr}
  .mobile-app-hero{padding:25px}.mobile-app-icon{grid-row:1}.mobile-app-icon img{width:150px;height:150px;border-radius:34px}
  .mobile-install-actions{display:grid}.mobile-install-actions .button{width:100%}
  .app-download-links{flex-direction:column;gap:6px}
}

/* Version 25.8: images pasted into Zharik chat */
.assistant-compose-main{display:grid;flex:1;min-width:0;gap:9px}
.assistant-compose-main textarea{width:100%}
.clipboard-image-list{display:flex;flex-wrap:wrap;gap:9px;padding:9px;border:1px dashed var(--brand-orange);border-radius:10px;background:#fff8ef}
.clipboard-image-list[hidden]{display:none}
.clipboard-image-preview{position:relative;display:grid;grid-template-columns:72px minmax(0,130px);align-items:center;gap:8px;padding:6px 30px 6px 6px;border:1px solid var(--line);border-radius:9px;background:#fff}
.clipboard-image-preview img{width:72px;height:58px;display:block;object-fit:cover;border-radius:6px;background:var(--surface-muted)}
.clipboard-image-preview span{overflow:hidden;color:var(--muted);font-size:11px;text-overflow:ellipsis;white-space:nowrap}
.clipboard-image-remove{position:absolute;top:5px;right:5px;width:23px;height:23px;padding:0;border:0;border-radius:50%;background:#ece9e4;color:#5b5752;font-size:18px;line-height:1;cursor:pointer}
.clipboard-image-remove:hover{background:var(--bad-bg);color:var(--bad)}
.clipboard-image-remove:focus-visible{outline:2px solid var(--brand-orange);outline-offset:2px}
.chat-image-gallery{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:9px}
.chat-image-gallery img{display:block;width:min(220px,100%);max-height:220px;object-fit:contain;border:1px solid rgba(255,255,255,.28);border-radius:9px;background:#fff}
@media(max-width:700px){
  .assistant-compose-main{width:100%}
  .clipboard-image-preview{grid-template-columns:64px minmax(0,1fr);width:100%}
  .clipboard-image-preview img{width:64px;height:54px}
  .chat-image-gallery img{width:100%;max-height:280px}
}
