:root {
  --bg: #eef3f7;
  --panel: #ffffff;
  --ink: #17212b;
  --muted: #627181;
  --line: #d8e0e8;
  --primary: #225a86;
  --primary-dark: #1f527a;
  --primary-2: #168f72;
  --accent: #f5b700;
  --cyan: #19bfd6;
  --slate: #737d86;
  --danger: #b42318;
  --ok: #17803d;
  --shadow: 0 8px 22px rgba(24, 43, 62, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  max-width: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

canvas,
img,
svg {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 70px;
  padding: 12px 18px;
  background: var(--primary-dark);
  border-bottom: 4px solid #e6edf4;
  box-shadow: 0 3px 12px rgba(17, 37, 56, 0.22);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 208px;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
}

.brand-copy {
  display: grid;
  gap: 1px;
  line-height: 1.02;
}

.brand-copy strong {
  font-size: 24px;
}

.brand-copy small {
  color: #c8d8e6;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.15;
  text-transform: none;
  white-space: nowrap;
}

.brand span,
.login-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #fff;
  color: #fff;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.brand span svg {
  width: 22px;
  height: 22px;
  color: #122b40;
}

.login-mark {
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 12px;
}

.brand-mark img,
.login-mark img {
  display: block;
  width: 100%;
  height: 100%;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.nav a,
.button,
button,
.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.nav a {
  flex: 0 0 auto;
  padding: 8px 11px;
  color: rgba(255, 255, 255, 0.78);
  border: 1px solid transparent;
  font-weight: 650;
}

.nav a.home-nav {
  padding-inline: 7px;
  gap: 5px;
}

.nav a.home-nav svg {
  width: 16px;
  height: 16px;
}

.nav a svg,
.button svg,
button svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.nav a.active {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.75);
  color: #fff;
}

.nav a.election-day-nav {
  background: #b42318;
  color: #fff;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.nav .exit {
  margin-left: auto;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.65);
}

.main {
  width: min(1500px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 54px;
}

.hero,
.page-title {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 20px;
  margin-bottom: 18px;
}

.hero {
  padding: 22px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: stretch;
}

.dashboard-hero-left {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 430px);
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.hero-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.hero-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  flex: 0 0 62px;
  border-radius: 8px;
  background: #e8f1f8;
  color: var(--primary-dark);
  border: 1px solid #cfe0ee;
}

.hero-icon svg {
  width: 34px;
  height: 34px;
}

.hero h1,
.page-title h1 {
  margin: 5px 0 7px;
  font-size: 31px;
  line-height: 1.12;
}

.page-title p,
.hero p,
.card p,
.login-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.eyebrow {
  display: inline-flex;
  color: var(--primary-2);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-stat {
  display: grid;
  align-content: center;
  min-width: 220px;
  padding: 18px;
  border-radius: 8px;
  background: var(--primary-dark);
  color: #fff;
}

.hero-stat strong {
  font-size: 44px;
  line-height: 1;
}

.hero-stat span,
.hero-stat b {
  margin-top: 6px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.stat-card,
.card {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stat-card {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 17px;
  min-height: 116px;
}

.stat-card.icon-stat {
  grid-template-columns: 48px 1fr;
  grid-template-areas:
    "icon label"
    "icon value"
    "icon note";
  gap: 4px 12px;
}

.stat-card.icon-stat span {
  grid-area: label;
}

.stat-card.icon-stat strong {
  grid-area: value;
}

.stat-card.icon-stat small {
  grid-area: note;
}

.stat-card span,
.stat-card small,
.card-head span,
small,
.muted {
  color: var(--muted);
}

.stat-card strong {
  font-size: 29px;
}

.stat-icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  align-self: start;
  color: #fff;
}

.stat-icon svg {
  width: 24px;
  height: 24px;
}

.stat-icon.blue { background: var(--primary); }
.stat-icon.green { background: var(--primary-2); }
.stat-icon.amber { background: #c97900; }
.stat-icon.gray { background: var(--slate); }

.dash-grid,
.admin-grid,
.station-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0;
}

.card {
  padding: 18px;
  margin-bottom: 16px;
}

.quick-panel {
  padding: 0;
  overflow: hidden;
}

.quick-title {
  padding: 14px 20px;
  background: var(--primary-dark);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  padding: 18px 20px 20px;
}

.admin-section {
  display: block;
}

.admin-section > summary {
  list-style: none;
}

.admin-section > summary::-webkit-details-marker {
  display: none;
}

.admin-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.admin-section-head h2 {
  margin: 0;
  color: #0f3150;
  font-size: 19px;
}

.admin-section-head small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.accordion-icon {
  flex: 0 0 34px;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--primary-dark);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.accordion-icon::before {
  content: "+";
}

.admin-section[open] .accordion-icon::before {
  content: "-";
}

.admin-section[open] > summary {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.admin-section-search {
  margin-bottom: 14px;
}

.admin-guide-callout {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin: 18px 0;
  padding: 16px;
  border-color: #bed7eb;
  background: #f7fbff;
}

.guide-callout-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: var(--primary-dark);
  color: #fff;
}

.guide-callout-icon svg {
  width: 28px;
  height: 28px;
}

.admin-guide-callout h2 {
  margin: 3px 0 4px;
  color: #0f3150;
  font-size: 21px;
}

.admin-guide-callout p {
  margin: 0;
  color: #40505c;
  font-weight: 700;
}

.guide-callout-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.guide-reader-card {
  padding: 18px;
}

.guide-reader {
  max-height: 72vh;
  margin: 0;
  padding: 18px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: #17212b;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.quick-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 76px;
  padding: 16px;
  border-radius: 8px;
  color: #fff;
  font-size: 22px;
  font-weight: 850;
  text-align: center;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}

.quick-action svg {
  width: 28px;
  height: 28px;
}

.quick-action.navy { background: var(--primary-dark); }
.quick-action.cyan { background: var(--cyan); }
.quick-action.green { background: #1c8d55; }
.quick-action.amber { background: #f5b700; color: #111827; }
.quick-action.slate { background: var(--slate); }
.quick-action.red { background: var(--danger); }

.quick-action:hover {
  filter: brightness(0.96);
}

.problem-center,
.problem-card {
  border-color: #fecaca;
  background: #fffafa;
}

.hero-problem-card {
  display: grid;
  gap: 10px;
  min-height: 116px;
  padding: 13px;
  border-radius: 8px;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #14532d;
}

.hero-problem-card.has-problems {
  border-color: #fecaca;
  background: #fff1f2;
  color: #7f1d1d;
}

.hero-problem-head {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.hero-problem-head svg {
  width: 24px;
  height: 24px;
}

.hero-problem-head strong,
.hero-problem-head span {
  display: block;
}

.hero-problem-head strong {
  font-size: 16px;
}

.hero-problem-head span,
.hero-problem-item small {
  color: inherit;
  opacity: 0.78;
}

.hero-problem-list {
  display: grid;
  gap: 7px;
}

.hero-problem-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(127, 29, 29, 0.16);
}

.hero-problem-item b,
.hero-problem-item small {
  display: block;
}

.hero-problem-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-problem-ok {
  font-weight: 800;
}

.day-command-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.command-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  grid-template-areas:
    "icon label"
    "icon value"
    "icon note";
  align-items: center;
  gap: 3px 12px;
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.command-card svg {
  grid-area: icon;
  width: 38px;
  height: 38px;
  padding: 8px;
  border-radius: 8px;
  background: #e8f1f8;
  color: var(--primary);
}

.command-card.urgent svg {
  background: #fff1f2;
  color: var(--danger);
}

.command-card span {
  grid-area: label;
  color: var(--muted);
  font-weight: 800;
}

.command-card strong {
  grid-area: value;
  font-size: 30px;
}

.command-card small {
  grid-area: note;
}

.flag-list {
  display: grid;
  gap: 9px;
}

.flag-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff1f2;
}

.flag-item svg,
.red-flag {
  color: var(--danger);
}

.flag-item small,
.red-flag {
  display: block;
  margin-top: 3px;
}

.red-flag {
  font-weight: 700;
}

.anomaly-card {
  border-color: #f3c7c7;
}

.anomaly-list {
  display: grid;
  gap: 9px;
}

.anomaly-list.compact {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.anomaly-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 11px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: inherit;
}

.anomaly-item.critical {
  border-color: #fca5a5;
  background: #fff1f2;
}

.anomaly-item.warning {
  border-color: #fcd34d;
  background: #fffbeb;
}

.anomaly-item svg {
  width: 22px;
  height: 22px;
  color: #b42318;
}

.anomaly-item.warning svg {
  color: #b45309;
}

.anomaly-item strong,
.anomaly-item small,
.anomaly-item em {
  display: block;
}

.anomaly-item small {
  margin-top: 3px;
  color: #40505c;
  font-weight: 800;
}

.anomaly-item em {
  margin-top: 4px;
  color: #6b4e16;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.anomaly-dashboard-card {
  display: grid;
  grid-template-columns: minmax(190px, 0.8fr) minmax(0, 1.6fr) auto;
  gap: 14px;
  align-items: center;
  margin: 18px 0;
  padding: 16px;
  border-color: #fcd34d;
  background: #fffbeb;
}

.anomaly-dashboard-card.critical {
  border-color: #fca5a5;
  background: #fff1f2;
}

.anomaly-dashboard-card h2 {
  margin: 2px 0;
  color: #0f3150;
  font-size: 24px;
}

.anomaly-dashboard-card p {
  margin: 0;
  color: #40505c;
  font-weight: 800;
}

.anomaly-dashboard-list {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.anomaly-dashboard-list a {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  color: inherit;
  font-size: 13px;
  font-weight: 800;
}

.anomaly-dashboard-list span {
  overflow: hidden;
  color: #40505c;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.problem-list {
  display: grid;
  gap: 10px;
}

.problem-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.problem-row.urgent,
.problem-open {
  background: #fff1f2;
}

.priority-kritično,
.priority-hitno {
  border-color: #fca5a5;
}

.problem-row svg {
  color: #b42318;
}

.problem-row small {
  display: block;
  margin-top: 3px;
}

.bm-contact-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  margin: 12px 0 18px;
  border: 1px solid #bfd3e5;
  border-radius: 8px;
  background: #f7fbff;
  box-shadow: var(--shadow);
}

.bm-contact-strip span {
  display: block;
  color: #40505c;
  font-size: 13px;
  font-weight: 800;
}

.bm-contact-strip strong {
  display: block;
  margin-top: 3px;
  color: #0f3150;
  font-size: 20px;
}

.alarm-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 11px 18px;
  border: 0;
  border-radius: 8px;
  background: #b42318;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.alarm-button svg,
.danger-button svg {
  width: 22px;
  height: 22px;
}

.alarm-button:hover,
.danger-button:hover {
  background: #941b13;
}

.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #bfd3e5;
  border-radius: 8px;
  background: #fff;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.danger-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff1f2;
  color: var(--danger);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.danger-mini svg {
  width: 15px;
  height: 15px;
}

.inline-delete {
  display: inline-flex;
  margin: 0 0 8px;
}

.inline-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.form-grid.one-column {
  grid-template-columns: 1fr;
}

.bo-mobile-actions {
  display: none;
}

.result-wizard-card h3 {
  margin: 0 0 12px;
  color: #0f3150;
}

.wizard-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.wizard-progress button {
  background: #edf5fb;
  color: var(--primary);
  border-color: #cfe0ee;
}

.wizard-progress button.active {
  background: var(--primary);
  color: #fff;
}

.wizard-step {
  display: none;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.wizard-step.active {
  display: block;
}

.wizard-actions,
.lock-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-top: 12px;
}

.unlock-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.problem-update-form {
  display: grid;
  gap: 8px;
  min-width: 260px;
}

.problem-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.election-picker {
  display: flex;
  align-items: end;
  gap: 8px;
  min-width: min(420px, 100%);
}

.election-picker label {
  flex: 1 1 240px;
  min-width: 220px;
}

.election-picker span {
  color: #40505c;
  font-size: 12px;
  font-weight: 900;
}

.comparison-card {
  margin-bottom: 18px;
}

.comparison-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
}

.comparison-picker label {
  display: grid;
  gap: 5px;
  min-width: 220px;
}

.comparison-picker span {
  color: #40505c;
  font-size: 12px;
  font-weight: 900;
}

.comparison-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.comparison-summary article {
  display: grid;
  gap: 5px;
  min-height: 92px;
  padding: 13px;
  border: 1px solid #cfe0ee;
  border-radius: 8px;
  background: #f7fbff;
}

.comparison-summary span,
.comparison-summary small {
  color: var(--muted);
  font-weight: 800;
}

.comparison-summary strong {
  color: #0f3150;
  font-size: 25px;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.comparison-panel {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.comparison-panel h3 {
  margin: 0 0 3px;
  color: #0f3150;
  font-size: 16px;
}

.comparison-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  align-items: center;
  padding-top: 7px;
  border-top: 1px solid #e5edf3;
}

.comparison-row span {
  overflow: hidden;
  color: #273646;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comparison-row strong {
  color: var(--primary);
  font-size: 14px;
}

.comparison-row small {
  grid-column: 1 / -1;
}

.comparison-table-wrap {
  margin: 12px 0 16px;
}

.comparison-station-head {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.diff-pos {
  color: var(--ok);
  font-weight: 900;
}

.diff-neg {
  color: var(--danger);
  font-weight: 900;
}

.chart-card {
  display: flex;
  flex-direction: column;
  height: 380px;
  overflow: hidden;
}

.chart-card canvas {
  display: block;
  width: 100% !important;
  height: 292px !important;
  max-height: 292px;
  flex: 0 0 292px;
}

.chart-card.wide {
  height: 430px;
}

.chart-card.wide canvas {
  height: 342px !important;
  max-height: 342px;
  flex-basis: 342px;
}

.station-pies-section {
  margin-bottom: 16px;
}

.pie-sort-form {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.pie-sort-form label {
  display: grid;
  gap: 5px;
  min-width: 160px;
}

.pie-sort-form label:first-of-type {
  min-width: min(260px, 100%);
}

.pie-sort-form span {
  color: #40505c;
  font-size: 12px;
  font-weight: 900;
}

.station-pie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.station-pie-card {
  display: grid;
  gap: 10px;
  min-height: 156px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.station-pie-head {
  display: grid;
  gap: 2px;
}

.station-pie-head strong {
  color: var(--primary-dark);
  font-size: 15px;
}

.station-pie-head span {
  overflow: hidden;
  color: #51616e;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-pie-head em {
  width: fit-content;
  padding: 3px 7px;
  border-radius: 8px;
  background: #eaf3f9;
  color: var(--primary);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.station-pie-body {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.station-pie-canvas {
  width: 88px;
  height: 88px;
}

.station-pie-canvas canvas {
  display: block;
  width: 88px !important;
  height: 88px !important;
}

.station-pie-body ol {
  display: grid;
  gap: 3px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.station-pie-body li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(34px, auto) minmax(42px, auto);
  gap: 6px;
  align-items: center;
  color: #40505c;
  font-size: 12px;
  font-weight: 800;
}

.station-pie-body li span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-pie-body li strong {
  color: #0f3150;
  text-align: right;
}

.station-pie-body li small {
  color: #6b7a88;
  font-size: 11px;
  font-weight: 900;
  text-align: right;
}

.empty-pie-row span {
  color: #8a96a3;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.card-head h2 {
  color: #0f3150;
}

.card-head h2,
.lesson-card h2,
.check-columns h3 {
  margin: 0;
  font-size: 19px;
}

.card-head a,
.mini-link {
  color: var(--primary);
  font-weight: 700;
}

.card-head a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 8px;
  background: #edf5fb;
  border: 1px solid #cfe0ee;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border-radius: 8px;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: #40505c;
  font-size: 12px;
  text-transform: uppercase;
  background: #f2f6f9;
}

td small {
  display: block;
  margin-top: 3px;
}

.table-link {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  background: #e7f2f3;
  color: var(--primary);
  font-weight: 800;
}

.station-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.station-tile {
  display: grid;
  gap: 7px;
  min-height: 126px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.station-tile:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 18px rgba(34, 90, 134, 0.12);
}

.station-tile i,
.meter {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: #e4eaef;
}

.station-tile i em,
.meter span {
  display: block;
  width: var(--p, 0%);
  height: 100%;
  background: linear-gradient(90deg, var(--primary-2), var(--accent));
}

.meter span {
  width: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 8px;
  background: #edf1f4;
  color: #51616e;
  font-size: 12px;
  font-weight: 800;
}

.status.ok {
  background: #e6f6ea;
  color: var(--ok);
}

.status.warn {
  background: #fff3dd;
  color: #9a5a00;
}

.flash,
.success-box,
.warnings div,
.hint-box,
.empty-state {
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.flash {
  background: #e6f6ea;
  color: var(--ok);
  font-weight: 700;
}

.flash.error,
.warnings div {
  background: #fff1f0;
  color: var(--danger);
  border-color: #f6c4bd;
}

.success-box {
  background: #e6f6ea;
  color: var(--ok);
}

.hint-box {
  background: #f7fafb;
  color: #40505c;
  line-height: 1.45;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.completion-form {
  display: grid;
  gap: 6px;
  justify-items: end;
  max-width: 330px;
}

.completion-lock {
  color: #8a4b00;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  text-align: right;
}

.button,
button {
  padding: 9px 13px;
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 800;
}

.button:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  background: #8b98a5;
  border-color: #8b98a5;
}

.button.ghost,
button.ghost,
.mini-button {
  background: #fff;
  color: var(--primary);
  border-color: var(--line);
}

.icon-button {
  width: 38px;
  padding: 0;
}

form label {
  display: grid;
  gap: 6px;
}

label span {
  color: #40505c;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 88px;
  resize: vertical;
}

.form-grid,
.protocol-grid,
.party-votes,
.user-create {
  display: grid;
  gap: 12px;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.compact {
  grid-template-columns: 110px minmax(180px, 1fr) 150px auto;
  align-items: end;
}

.form-grid.compact.catalog-create {
  grid-template-columns: minmax(220px, 1fr) 150px auto;
}

.assignment-create {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(240px, 1.5fr) 120px 130px auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.import-create {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(280px, 1.4fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.sample-table table {
  min-width: 520px;
}

.catalog-row input[name="name"] {
  min-width: min(360px, 100%);
}

.protocol-grid,
.party-votes {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 14px;
}

.user-create {
  grid-template-columns: repeat(6, minmax(0, 1fr)) auto;
  align-items: end;
  margin-bottom: 18px;
}

.inline-save,
.inline-admin {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.inline-save input {
  width: 94px;
}

.inline-admin {
  margin: 8px 0;
}

.inline-admin input:first-of-type {
  max-width: 110px;
}

.checkline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
}

.checkline input,
.check-list input,
.check-columns input {
  width: 18px;
  min-height: 18px;
}

.checkline span {
  font-size: 13px;
}

.table-search,
.search-box input {
  max-width: 340px;
}

.sort-control {
  display: grid;
  gap: 5px;
  min-width: 190px;
}

.sort-control span {
  color: #40505c;
  font-size: 12px;
  font-weight: 800;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(145deg, #eef2f5, #dfeaed 52%, #f4eadc);
}

.login-card {
  width: min(430px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 14px 0 6px;
  font-size: 32px;
}

.login-card .login-subtitle {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.login-card form {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.training-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.search-box {
  position: relative;
  width: min(430px, 100%);
}

.search-box svg {
  position: absolute;
  left: 10px;
  top: 11px;
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.search-box input {
  padding-left: 34px;
  max-width: none;
}

.segmented {
  display: flex;
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.segmented a {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 800;
}

.segmented a:hover {
  background: #eef5f4;
  color: var(--primary);
}

.training-guide {
  margin-bottom: 16px;
}

.urgent-training-button {
  min-height: 42px;
  padding: 9px 14px;
  font-size: 15px;
}

.urgent-help {
  border: 2px solid #d92d20;
  background: #fffafa;
  box-shadow: 0 18px 42px rgba(180, 35, 24, 0.16);
}

.urgent-help .card-head {
  align-items: center;
}

.urgent-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.urgent-card {
  display: grid;
  gap: 8px;
  min-height: 142px;
  padding: 14px;
  border: 2px solid #f04438;
  border-radius: 8px;
  background: #b42318;
  color: #fff;
}

.urgent-card strong {
  color: #fff;
  font-size: 18px;
  line-height: 1.12;
  text-transform: uppercase;
}

.urgent-card span {
  color: #fff7f6;
  font-weight: 800;
  line-height: 1.35;
}

.playbook-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.playbook-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  overflow: hidden;
}

.playbook-card summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  cursor: pointer;
  list-style: none;
}

.playbook-card summary::-webkit-details-marker {
  display: none;
}

.playbook-card summary strong {
  display: block;
  color: #0f3150;
  font-size: 16px;
}

.playbook-card summary small {
  color: var(--muted);
  font-weight: 800;
}

.playbook-icon {
  flex: 0 0 44px;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #e8f1f8;
  color: var(--primary-dark);
  border: 1px solid #cfe0ee;
}

.playbook-icon svg {
  width: 24px;
  height: 24px;
}

.playbook-card > p {
  padding: 0 14px 12px 70px;
}

.playbook-columns {
  display: grid;
  grid-template-columns: minmax(180px, 0.85fr) minmax(0, 1.15fr);
  gap: 12px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.playbook-columns b {
  display: block;
  margin-bottom: 6px;
  color: #0f3150;
}

.playbook-columns ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: #40505c;
  font-weight: 700;
}

.playbook-columns p {
  margin: 0 0 9px;
}

.guided-training {
  overflow: hidden;
}

.guided-progress {
  display: grid;
  gap: 6px;
  min-width: 180px;
  text-align: right;
}

.guided-progress strong {
  color: var(--primary-dark);
  font-size: 18px;
}

.guided-progress span {
  display: block;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce5ec;
}

.guided-progress b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
}

.guided-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 14px;
}

.guided-sidebar {
  display: grid;
  gap: 8px;
  align-content: start;
}

.guided-sidebar button {
  display: flex;
  align-items: center;
  gap: 9px;
  justify-content: flex-start;
  min-height: 42px;
  padding: 9px;
  border-color: var(--line);
  background: #f6f9fb;
  color: #40505c;
  text-align: left;
}

.guided-sidebar button span {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 26px;
  border-radius: 8px;
  background: #e8f1f8;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.guided-sidebar button.active {
  background: var(--primary-dark);
  color: #fff;
  border-color: var(--primary-dark);
}

.guided-sidebar button.active span {
  background: rgba(255, 255, 255, 0.17);
  color: #fff;
}

.guided-sidebar button.locked {
  opacity: 0.55;
}

.guided-step {
  display: none;
  min-height: 420px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.guided-step.active {
  display: grid;
  gap: 14px;
}

.guided-step-head {
  display: flex;
  gap: 13px;
  align-items: flex-start;
}

.guided-step-head h3 {
  margin: 0 0 6px;
  color: #0f3150;
  font-size: 24px;
}

.guided-check-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.guided-check-list label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-height: 44px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.guided-check-list input {
  flex: 0 0 auto;
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.guided-check-list span {
  color: #273646;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.guided-check-list label:has(input:checked) {
  border-color: #b7d8c1;
  background: #f0faf3;
}

.guided-quiz {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.guided-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.guided-actions button:disabled,
.guided-sidebar button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  background: #edf2f5;
  color: #6f7f8d;
  border-color: var(--line);
}

.diagram-section,
.red-mistakes {
  margin-bottom: 16px;
}

.diagram-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.diagram-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.diagram-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #0f3150;
}

.diagram-card h3 svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.flow-diagram {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.flow-diagram span {
  min-height: 38px;
  padding: 9px 11px;
  border: 1px solid #cfe0ee;
  border-radius: 8px;
  background: #fff;
  color: #273646;
  font-weight: 900;
}

.flow-diagram b {
  width: 28px;
  height: 2px;
  background: var(--primary);
  position: relative;
}

.flow-diagram b::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -4px;
  width: 0;
  height: 0;
  border-left: 7px solid var(--primary);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.flow-diagram.compact span {
  min-height: 34px;
  padding: 7px 9px;
}

.room-diagram {
  position: relative;
  min-height: 230px;
  border: 2px solid #cfe0ee;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(34, 90, 134, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(34, 90, 134, 0.06) 1px, transparent 1px),
    #fff;
  background-size: 28px 28px;
}

.room-diagram div {
  position: absolute;
  display: grid;
  place-items: center;
  min-height: 42px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f6f9fb;
  color: #273646;
  font-weight: 900;
  text-align: center;
}

.room-table {
  left: 18px;
  top: 18px;
  width: 44%;
}

.room-queue {
  left: 18px;
  bottom: 18px;
  width: 30%;
}

.room-screen {
  right: 18px;
  top: 18px;
  width: 28%;
  height: 62px;
  background: #fff7df !important;
}

.room-screen.second {
  top: 92px;
}

.room-box {
  right: 18px;
  bottom: 18px;
  width: 28%;
  background: #eef8f1 !important;
}

.formula-diagram {
  display: grid;
  gap: 10px;
}

.formula-diagram div {
  display: grid;
  grid-template-columns: minmax(100px, 0.8fr) 30px minmax(160px, 1.2fr);
  gap: 8px;
  align-items: center;
}

.formula-diagram strong {
  padding: 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #cfe0ee;
  color: #273646;
}

.formula-diagram span {
  text-align: center;
  color: var(--primary);
  font-size: 22px;
  font-weight: 900;
}

.mistake-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.red-action-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.red-action-strip article {
  display: grid;
  gap: 8px;
  min-height: 154px;
  padding: 14px;
  border: 2px solid #b42318;
  border-radius: 8px;
  background: linear-gradient(180deg, #b42318, #7a1d15);
  color: #fff;
  box-shadow: 0 12px 24px rgba(180, 35, 24, 0.18);
}

.red-action-strip svg {
  width: 32px;
  height: 32px;
  color: #fff;
}

.red-action-strip strong {
  color: #fff;
  font-size: 18px;
  line-height: 1.12;
}

.red-action-strip span {
  color: #ffe4e0;
  font-weight: 800;
  line-height: 1.35;
}

.mistake-grid article {
  display: grid;
  gap: 8px;
  min-height: 148px;
  padding: 14px;
  border: 1px solid #f0b8b1;
  border-radius: 8px;
  background: #fff7f6;
}

.mistake-grid svg {
  width: 28px;
  height: 28px;
  color: var(--danger);
}

.mistake-grid strong {
  color: #7a1d15;
  font-size: 15px;
}

.mistake-grid span {
  color: #4d5965;
  line-height: 1.35;
  font-weight: 700;
}

.protocol-trainer,
.incident-simulator {
  margin-bottom: 16px;
}

.trainer-grid,
.incident-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.trainer-card,
.incident-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.trainer-card.passed,
.incident-card.passed {
  border-color: #9fd3ad;
  background: #f3fbf5;
}

.trainer-card.failed,
.incident-card.failed {
  border-color: #f1b8b0;
  background: #fff7f6;
}

.trainer-head,
.incident-title {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.trainer-head > span {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 30px;
  border-radius: 8px;
  background: #e8f1f8;
  color: var(--primary);
  font-weight: 900;
}

.trainer-head h3,
.incident-title h3 {
  margin: 0 0 3px;
  color: #0f3150;
  font-size: 18px;
}

.incident-title svg {
  width: 24px;
  height: 24px;
  color: var(--danger);
}

.incident-card p {
  margin: 0;
  color: #40505c;
  font-weight: 800;
  line-height: 1.4;
}

.protocol-sheet,
.party-mini-table {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.protocol-sheet div,
.party-mini-table div {
  display: grid;
  gap: 2px;
  min-height: 54px;
  padding: 9px;
  border: 1px solid #d9e5ee;
  border-radius: 8px;
  background: #fff;
}

.protocol-sheet span,
.party-mini-table span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.protocol-sheet strong,
.party-mini-table strong {
  color: #17212b;
  font-size: 20px;
}

.party-mini-table {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.party-mini-table div {
  min-height: 46px;
  background: #fffdf5;
}

.drill-options {
  display: grid;
  gap: 8px;
}

.drill-options label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-height: 44px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.drill-options label:has(input:checked) {
  border-color: var(--primary);
  background: #eaf3f9;
}

.drill-options input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.drill-options span {
  color: #273646;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.drill-result {
  padding: 10px;
  border-radius: 8px;
  font-weight: 900;
  line-height: 1.4;
}

.drill-result.ok {
  border: 1px solid #9fd3ad;
  background: #eef8f1;
  color: #116233;
}

.drill-result.bad {
  border: 1px solid #f1b8b0;
  background: #fff1f2;
  color: var(--danger);
}

.drill-result.warn {
  border: 1px solid #f1d18a;
  background: #fffbeb;
  color: #875800;
}

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.lesson-card {
  position: relative;
}

.lesson-number {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 32px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: #f5ead7;
  color: #814a00;
  font-weight: 900;
}

.check-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 14px 0;
  list-style: none;
}

.check-list label,
.check-columns label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.quiz {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.mini-button {
  width: fit-content;
  min-height: 32px;
  padding: 6px 10px;
}

.check-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.check-columns div {
  display: grid;
  gap: 10px;
  align-content: start;
}

.manual-preview {
  display: grid;
  gap: 8px;
}

.manual-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #cfe0ee;
  border-radius: 8px;
  background: #f3f8fb;
  color: #40505c;
  font-weight: 800;
}

.manual-note svg {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  color: var(--primary);
}

.manual-preview details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.manual-preview summary {
  padding: 12px;
  cursor: pointer;
  font-weight: 800;
}

.manual-preview p {
  padding: 0 12px 12px;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.scenario-grid details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.scenario-grid summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px;
  cursor: pointer;
  font-weight: 900;
}

.scenario-grid summary svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.scenario-grid p {
  margin: 0;
  padding: 0 13px 13px 43px;
  color: #40505c;
}

.test-card {
  margin-top: 16px;
  max-width: 100%;
  overflow: hidden;
}

.test-card .card-head > div {
  min-width: 0;
}

.test-progress {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #fff7df;
  color: #805600;
  font-weight: 900;
}

.test-progress.complete {
  background: #e7f6ec;
  color: var(--ok);
}

.test-result {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.test-result.failed {
  border-color: #f1c6c0;
  background: #fff7f6;
}

.test-result span,
.test-result small,
.test-submit-note {
  color: var(--muted);
}

.test-result strong {
  display: block;
  margin: 4px 0;
  font-size: 30px;
}

.score-meter {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce5ec;
}

.score-meter span {
  display: block;
  height: 100%;
  max-width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
}

.test-result.failed .score-meter span {
  background: linear-gradient(90deg, var(--danger), #f5b700);
}

.test-review {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.test-review summary {
  cursor: pointer;
  font-weight: 900;
}

.review-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.review-list article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.review-list p {
  margin: 7px 0;
}

.test-form {
  display: grid;
  gap: 14px;
}

.test-wizard .wizard-progress {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 2px;
}

.test-wizard .wizard-progress button {
  min-height: 42px;
  padding: 8px;
  white-space: nowrap;
}

.test-step {
  padding: 0;
  border: 0;
  background: transparent;
}

.test-step.active {
  display: grid;
  gap: 14px;
}

.test-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f9fb;
  min-width: 0;
}

.test-step-head h3 {
  margin: 0;
  color: #0f3150;
}

.test-step-head span {
  color: var(--muted);
  font-weight: 800;
}

.test-question-list {
  display: grid;
  gap: 12px;
}

.test-question {
  display: grid;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(24, 43, 62, 0.05);
}

.test-question.missing {
  border-color: #d94332;
  box-shadow: 0 0 0 2px rgba(217, 67, 50, 0.13);
}

.test-question-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  min-width: 0;
  padding: 0;
}

.test-question-head > div {
  min-width: 0;
}

.question-number {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 28px;
  border-radius: 8px;
  background: #e4eef6;
  color: var(--primary);
  font-size: 13px;
}

.test-question h4 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.test-question-head small {
  color: var(--muted);
  font-weight: 800;
}

.test-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.test-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  min-height: 58px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.test-option:hover {
  border-color: #b8cad8;
  background: #f3f8fb;
}

.test-option input {
  flex: 0 0 auto;
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: 3px;
}

.test-option span {
  flex: 1 1 auto;
  min-width: 0;
  color: #273646;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.test-option:has(input:checked) {
  border-color: var(--primary);
  background: #eaf3f9;
  box-shadow: inset 0 0 0 1px var(--primary);
}

.test-submit {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  padding-top: 4px;
}

.test-submit-note {
  padding: 0 4px;
  font-weight: 800;
}

.test-warning {
  padding: 12px;
  border: 1px solid #f1c6c0;
  border-radius: 8px;
  background: #fff7f6;
  color: var(--danger);
  font-weight: 900;
}

.report-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.report-band div {
  padding: 16px;
  border-radius: 8px;
  background: #172026;
  color: #fff;
}

.report-band span {
  display: block;
  color: #c8d2da;
}

.report-band strong {
  display: block;
  margin-top: 8px;
  font-size: 23px;
}

.empty {
  max-width: 640px;
}

@media (max-width: 1100px) {
  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .dashboard-hero-left {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
  }

  .hero-stat {
    min-width: 0;
  }

  .stats-grid,
  .day-command-grid,
  .report-band,
  .urgent-grid,
  .red-action-strip,
  .comparison-summary,
  .comparison-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-grid,
  .admin-grid,
  .station-layout,
  .check-columns {
    grid-template-columns: 1fr;
  }

  .user-create,
  .form-grid.compact,
  .form-grid.compact.catalog-create,
  .assignment-create,
  .import-create {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body {
    font-size: 14px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    padding: 10px;
  }

  .brand {
    min-width: 0;
    font-size: 21px;
  }

  .brand-copy strong {
    font-size: 21px;
  }

  .brand-copy small {
    font-size: 9px;
  }

  .brand span {
    width: 32px;
    height: 32px;
  }

  .nav {
    gap: 6px;
    padding-bottom: 6px;
  }

  .nav a {
    min-height: 36px;
    padding: 7px 10px;
    font-size: 13px;
  }

  .main {
    width: min(100% - 14px, 1460px);
    padding-top: 12px;
    padding-bottom: 36px;
  }

  .hero,
  .page-title {
    flex-direction: column;
    gap: 12px;
  }

  .hero {
    padding: 14px;
  }

  .dashboard-hero,
  .dashboard-hero-left {
    grid-template-columns: 1fr;
  }

  .hero-main {
    align-items: flex-start;
    gap: 12px;
  }

  .hero-icon {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }

  .hero-icon svg {
    width: 27px;
    height: 27px;
  }

  .hero h1,
  .page-title h1 {
    font-size: 24px;
  }

  .hero-stat {
    width: 100%;
    min-width: 0;
    padding: 14px;
  }

  .hero-stat strong {
    font-size: 34px;
  }

  .hero-problem-card {
    min-height: 0;
  }

  .hero-problem-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .hero-problem-item small {
    white-space: normal;
  }

  .card,
  .stat-card {
    padding: 14px;
    margin-bottom: 12px;
  }

  .stats-grid,
  .day-command-grid,
  .report-band,
  .comparison-summary,
  .comparison-grid,
  .form-grid,
  .user-create,
  .form-grid.compact,
  .form-grid.compact.catalog-create,
  .assignment-create,
  .import-create {
    grid-template-columns: 1fr;
  }

  .stat-card {
    min-height: 96px;
  }

  .stat-card strong {
    font-size: 25px;
  }

  .station-grid,
  .lesson-grid {
    grid-template-columns: 1fr;
  }

  .role-polling .station-analytics,
  .role-polling .stats-grid {
    display: none;
  }

  .role-polling .bo-mobile-actions {
    display: grid;
  }

  .bo-mobile-actions {
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 12px 0;
  }

  .bo-mobile-actions a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 14px;
    border-radius: 8px;
    background: var(--primary-dark);
    color: #fff;
    font-size: 18px;
    font-weight: 900;
  }

  .bo-mobile-actions a.danger {
    background: var(--danger);
  }

  .bo-mobile-actions svg {
    width: 26px;
    height: 26px;
  }

  .actions,
  .training-tools,
  .bm-contact-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .actions {
    width: 100%;
  }

  .election-picker {
    display: grid;
    width: 100%;
    min-width: 0;
  }

  .election-picker label {
    min-width: 0;
  }

  .pie-sort-form {
    display: grid;
    width: 100%;
    justify-content: stretch;
  }

  .pie-sort-form label,
  .pie-sort-form label:first-of-type {
    min-width: 0;
  }

  .table-search,
  .search-box,
  .search-box input,
  .sort-control {
    width: 100%;
    max-width: none;
  }

  .problem-row {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .problem-row form {
    grid-column: 1 / -1;
  }

  .anomaly-dashboard-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .admin-guide-callout {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .guide-callout-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .guide-reader {
    max-height: none;
    padding: 12px;
    font-size: 14px;
  }

  .anomaly-dashboard-list a {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .anomaly-dashboard-list span {
    white-space: normal;
  }

  .playbook-grid,
  .playbook-columns,
  .guided-layout,
  .guided-check-list,
  .diagram-grid,
  .urgent-grid,
  .red-action-strip,
  .station-pie-grid,
  .trainer-grid,
  .incident-grid,
  .mistake-grid,
  .scenario-grid,
  .test-options,
  .test-submit {
    grid-template-columns: 1fr;
  }

  .completion-form {
    justify-items: stretch;
    max-width: none;
  }

  .completion-lock {
    text-align: left;
  }

  .guided-sidebar {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .guided-sidebar button {
    flex: 0 0 220px;
    width: auto;
  }

  .guided-step {
    min-height: 0;
    padding: 12px;
  }

  .guided-step-head h3 {
    font-size: 20px;
  }

  .guided-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .formula-diagram div {
    grid-template-columns: 1fr;
  }

  .protocol-sheet,
  .party-mini-table {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .formula-diagram span {
    display: none;
  }

  .room-diagram {
    min-height: 270px;
  }

  .playbook-card > p {
    padding: 0 14px 12px;
  }

  .test-wizard .wizard-progress {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .test-step-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .test-options {
    display: grid;
  }

  .test-submit {
    display: grid;
    align-items: stretch;
  }

  .test-question {
    padding: 12px;
  }

  .test-question legend {
    font-size: 15px;
  }

  .button,
  button {
    width: 100%;
  }

  .icon-button {
    width: 100%;
  }

  .nav {
    width: 100%;
  }

  .nav .exit {
    margin-left: 0;
  }

  .chart-card {
    height: 318px;
  }

  .chart-card canvas {
    height: 230px !important;
    max-height: 230px;
    flex-basis: 230px;
  }

  .chart-card.wide {
    height: 330px;
  }

  .chart-card.wide canvas {
    height: 244px !important;
    max-height: 244px;
    flex-basis: 244px;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .quick-action {
    min-height: 62px;
    font-size: 19px;
  }

  .inline-save,
  .inline-admin {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 8px;
  }

  .inline-save input,
  .inline-admin input,
  .inline-admin input:first-of-type,
  .catalog-row input[name="name"] {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .table-wrap {
    border: 1px solid var(--line);
    background: #fff;
  }

  table {
    min-width: 680px;
  }

  th,
  td {
    padding: 9px 8px;
  }

  .sample-table table {
    min-width: 620px;
  }

  .alarm-button,
  .danger-button {
    width: 100%;
    min-height: 50px;
  }

  .bm-contact-strip strong {
    font-size: 17px;
  }

  .wizard-progress,
  .problem-controls,
  .unlock-form {
    grid-template-columns: 1fr;
  }

  .wizard-actions,
  .lock-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .command-card {
    min-height: 96px;
  }
}

.results-view-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.results-overview-header { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 16px; margin: 24px 0 18px; }
.results-area-picker { display: flex; gap: 10px; align-items: end; flex: 0 1 650px; min-width: 0; }
.results-area-picker label { flex: 1; min-width: 0; }
.results-area-picker select { width: 100%; min-width: 0; }
@media (max-width: 600px) {
  .results-view-tabs .button { flex: 1 1 220px; }
  .results-area-picker { flex-basis: 100%; flex-wrap: wrap; }
  .results-area-picker label { flex-basis: 100%; }
}
.results-entry-section { margin-bottom: 28px; padding: 20px 0; border-block: 1px solid #cbd5d9; scroll-margin-top: 130px; }
#election-voters, #pregled { scroll-margin-top: 130px; }
.polling-workspace { max-width: 860px; margin: 0 auto; }
.bm-people { padding: 8px 0; scroll-margin-top: 130px; min-width: 0; max-width: min(1000px, calc(100vw - 70px)); }
.station-toggle-cell { display: flex; align-items: center; gap: 8px; }
.station-people-toggle { width: 36px; height: 36px; padding: 6px; flex: 0 0 36px; }
.station-people-toggle svg { width: 20px; height: 20px; }
.station-people-toggle[aria-expanded=true] svg { transform: rotate(90deg); }
[data-people-panel][hidden] { display: none !important; }
[data-people-panel] .bm-people > summary { display: none; }
.bm-people > summary { display: flex; align-items: center; gap: 8px; padding: 10px 0; cursor: pointer; font-weight: 700; }
.bm-people > summary svg { width: 20px; height: 20px; flex-shrink: 0; }
.bm-people[open] > summary svg { transform: rotate(90deg); }
.bm-person { padding: 14px 0; border-top: 1px solid #cbd5d9; overflow-wrap: anywhere; }
.bm-person > div { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.bm-person dl { display: grid; grid-template-columns: 80px minmax(0,1fr); gap: 6px 12px; }
.bm-person dd { margin: 0; white-space: normal; }
.person-phone { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.person-call { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 14px; border-radius: 6px; background: #b42318; color: #fff; font-weight: 700; text-decoration: none; }
.person-call:hover, .person-call:focus-visible { background: #8e1b12; color: #fff; }
.person-call svg { width: 18px; height: 18px; }
.bm-people details > summary { cursor: pointer; padding: 12px 0; }
.people-form { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; padding: 14px 0; white-space: normal; }
.people-form > label { min-width: 0; }
.people-form .actions { grid-column: 1 / -1; }
.people-private { display: flex; gap: 6px; }
.people-private input { min-width: 0; }
.people-private button { flex: 0 0 44px; padding: 8px; }
@media (max-width: 700px) { .people-form { grid-template-columns: minmax(0,1fr); } }
.training-example { padding: 20px 0; border-bottom: 1px solid #cbd5d9; }
.example-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.example-fields { display: grid; gap: 8px; }
.example-fields button { display: grid; grid-template-columns: minmax(0,1fr) auto 20px; text-align: left; gap: 12px; min-height: 48px; }
.example-fields button[aria-pressed=true] { background: #e7f4ed; color: #125137; border-color: #16784d; }
.example-explanation { background: #f4f7f8; padding: 20px; border-left: 3px solid #16784d; align-self: start; }
.example-error-task { margin-top: 20px; }
.example-error-task summary { cursor: pointer; padding: 12px 0; font-weight: 700; }
.situation-exercise { border-top: 1px solid #cbd5d9; padding: 20px 0; }
.training-example .checkline { margin: 14px 0; align-items: start; }
.training-videos { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 24px; }
.training-videos video { display: block; width: 100%; aspect-ratio: 4/3; background: #141414; }
@media (max-width: 700px) { .example-layout, .training-videos { grid-template-columns: 1fr; } }
.polling-workspace h1 { font-size: 24px; overflow-wrap: anywhere; }
.polling-workspace .bm-contact-strip { gap: 16px; flex-wrap: wrap; }
.polling-workspace .bm-contact-strip a:not(.alarm-button) { display: block; }
.polling-actions, .results-display-switch, .training-route { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.polling-task, .report-coverage { padding: 20px 0; border-block: 1px solid #cbd5d9; margin: 20px 0; }
.polling-task summary, #result-wizard > summary { font-size: 18px; font-weight: 700; cursor: pointer; padding: 16px 0; }
.polling-task .form-grid, .polling-task details { margin-top: 18px; }
.polling-task h2 { font-size: 22px; }
.polling-workspace .form-grid { grid-template-columns: 1fr; }
.polling-workspace button, .polling-workspace .button { min-height: 44px; }
.polling-workspace #turnout-entry, #problem-entry, #result-wizard,
#lekcije, #trener-zapisnika, #test, #prirucnik, #hitno { scroll-margin-top: 130px; }
.report-coverage > strong { display: block; font-size: 22px; margin: 16px 0; }
.coverage-hidden, [data-results-panel][hidden], .main > section[hidden] { display: none !important; }
.training-resume { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; width: 100%; }
.training-resume strong { flex: 1 1 280px; }
.training-resume [role=status] { flex-basis: 100%; font-size: 13px; }
.training-route { width: 100%; border-bottom: 1px solid #cbd5d9; }
.training-route a { padding: 12px 14px; border-bottom: 3px solid transparent; }
.training-route a[aria-current] { border-bottom-color: #16784d; background: #e7f4ed; color: #125137; }
.results-matrix { margin: 20px 0; }
.results-matrix th { max-width: 220px; min-width: 100px; white-space: normal; }
@media (max-width: 600px) {
.polling-actions > a { flex: 1 1 140px; }
  .training-route a { flex: 1 1 130px; }
  .polling-workspace .result-review-layout { display: flex; flex-direction: column; }
}
.polling-actions .danger-button { background: #b42318; border-color: #b42318; color: white; }
.result-picker { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; margin-block: 18px 22px; }
.result-picker select { width: 100%; min-width: 0; }
.result-entry-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.result-entry-heading h2 { font-size: 20px; overflow-wrap: anywhere; }
.result-input-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.result-input-form legend { font-weight: 700; margin-bottom: 14px; }
.result-votes { display: grid; gap: 8px; }
.result-votes label { display: grid; grid-template-columns: minmax(0, 1fr) 110px; align-items: center; gap: 14px; padding: 8px 0; border-bottom: 1px solid #dbe2e5; }
.result-votes label span { overflow-wrap: anywhere; }
.result-votes input { width: 100%; }
.result-live-total { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 16px 0; }
.result-input-form > fieldset > label { display: grid; margin-block: 12px; }
.protocol-entry { padding-block: 20px; margin-top: 20px; border-top: 1px solid #cbd5d9; }
.protocol-upload-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.protocol-upload-options input[type="file"] { width: 100%; min-width: 0; }
.result-review-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.result-review-layout .protocol-entry { margin: 0; padding: 0; border: 0; min-width: 0; }
.result-edit-panel { min-width: 0; }
.result-review-layout .protocol-upload-options { grid-template-columns: minmax(0, 1fr); margin-top: 16px; }
.protocol-preview-tools { display: flex; align-items: end; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.protocol-preview-tools label { flex: 1 1 200px; min-width: 0; }
.protocol-preview-tools select { width: 100%; min-width: 0; }
.protocol-preview-tools button, .protocol-preview-tools a { width: 38px; height: 38px; padding: 6px; }
.protocol-preview-viewport { height: 580px; max-height: 70vh; min-height: 280px; overflow: auto; background: #eef2f3; border: 1px solid #cbd5d9; }
.protocol-preview-viewport img { display: block; width: 100%; max-width: none; height: auto; }
.protocol-preview-viewport iframe { width: 100%; height: 100%; border: 0; }
.protocol-preview [hidden] { display: none !important; }
.cycle-voters, .document-history { margin-block: 14px; }
.cycle-voters summary, .document-history summary { cursor: pointer; padding-block: 12px; font-weight: 600; }
.result-confirm-form { display: grid; gap: 12px; padding-block: 20px; margin-top: 20px; border-top: 1px solid #cbd5d9; }
.upload-image-preview { display: block; width: 100%; max-height: 300px; object-fit: contain; background: #eef3f7; border: 1px solid var(--line); border-radius: 8px; }
.upload-image-preview[hidden] { display: none !important; }
.upload-selection { margin: 0; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; color: var(--muted); }
.upload-selection:empty { display: none; }
.turnout-history { list-style: none; margin: 12px 0 0; padding: 0; }
.turnout-history li { display: grid; grid-template-columns: 54px 72px minmax(0, 1fr); gap: 12px; align-items: center; padding: 12px; border-bottom: 1px solid var(--line); background: #fff; }
.turnout-time { font-weight: 700; }
.turnout-history strong { font-size: 18px; }
.turnout-history small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.turnout-state { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.turnout-state.reported { color: var(--ok); font-weight: 700; }
.polling-workspace #result-votes,
.polling-workspace #protocol-entry,
.polling-workspace #turnout-entry,
.polling-workspace #problem-entry,
.polling-workspace #result-wizard,
.polling-workspace .bm-people { scroll-margin-top: var(--polling-header-offset, 145px); }
.polling-workspace .bm-people { max-width: 100%; }
.polling-workspace .polling-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.polling-workspace .polling-actions a { min-height: 48px; padding: 10px; }
.polling-workspace .polling-actions svg { flex-shrink: 0; }
.polling-workspace .polling-actions .danger-button { width: auto; }
.polling-workspace .bm-contact-strip > div { min-width: 0; }
.polling-workspace .page-title p { line-height: 1.6; overflow-wrap: anywhere; }
.polling-workspace summary { min-height: 48px; line-height: 1.4; }
.results-status-strip { display: flex; gap: 12px 24px; flex-wrap: wrap; margin-block: 16px; }
@media (max-width: 1000px) {
  .result-review-layout { grid-template-columns: minmax(0, 1fr); }
  .result-edit-panel { order: 1; }
  .result-review-layout .protocol-entry { order: 2; }
}
@media (max-width: 700px) {
  .result-picker, .protocol-upload-options { grid-template-columns: minmax(0, 1fr); }
  .result-votes label { grid-template-columns: minmax(0, 1fr) 88px; }
}

@media screen and (max-width: 1000px) {
  /* Keep form text readable when a phone opens its keyboard. */
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea {
    font-size: 16px;
    min-height: 44px;
    min-width: 0;
  }
  .polling-workspace input:not([type="hidden"]), .polling-workspace select { min-height: 48px; }
  .polling-workspace textarea { min-height: 112px; }
  .polling-workspace form label > span { font-size: 14px; line-height: 1.4; }
  .polling-workspace input:focus-visible, .polling-workspace select:focus-visible,
  .polling-workspace textarea:focus-visible, .polling-workspace a:focus-visible,
  .polling-workspace button:focus-visible, .polling-workspace summary:focus-visible {
    outline: 3px solid var(--primary); outline-offset: 3px;
  }
  .polling-workspace .result-review-layout { display: grid; grid-template-columns: minmax(0, 1fr); }
  .polling-workspace .result-review-layout > * { width: 100%; }
  .polling-workspace .result-input-form button[type="submit"],
  .polling-workspace .lock-actions button, .polling-workspace .protocol-upload-options button[type="submit"] {
    width: 100%; min-height: 48px; white-space: normal;
  }
  .polling-workspace .protocol-preview-tools button, .polling-workspace .protocol-preview-tools a {
    width: 48px; height: 48px; flex-shrink: 0;
  }
}

@media screen and (max-width: 720px) {
  .role-polling .main { width: calc(100% - 24px); }
  .role-polling .nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; padding-bottom: 0; }
  .role-polling .nav a { min-height: 44px; padding: 8px 6px; }
  .polling-workspace .polling-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .polling-workspace .polling-actions a { font-size: 14px; white-space: normal; }
  .polling-workspace .bm-person { margin: 10px 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
  .polling-workspace .bm-person > div { gap: 8px; }
  .polling-workspace .bm-person > div > strong { flex-basis: 100%; font-size: 16px; line-height: 1.4; }
  .polling-workspace .bm-person dl { font-size: 14px; line-height: 1.5; gap: 10px; }
  .polling-workspace .bm-person dt { color: var(--muted); }
  .polling-workspace .bm-person dd a { min-height: 44px; display: inline-flex; align-items: center; }
  .polling-workspace .bm-contact-strip a:not(.alarm-button) { display: inline-flex; align-items: center; min-height: 44px; font-size: 16px; font-weight: 700; }
  .polling-workspace .protocol-grid { grid-template-columns: minmax(0, 1fr); }
  .polling-workspace .result-votes label { gap: 12px; grid-template-columns: minmax(0, 1fr) 96px; min-height: 60px; }
  .polling-workspace .result-votes input { text-align: center; }
  .polling-workspace .result-live-total { padding: 14px; border-radius: 8px; background: #fff; }
  .polling-workspace .result-live-total [data-party-check] { flex-basis: 100%; }
  .polling-workspace .protocol-entry { padding-top: 20px; border-top: 1px solid var(--line); }
  .polling-workspace .turnout-history li { grid-template-columns: 44px 58px minmax(0, 1fr); gap: 8px; }
  .polling-workspace .polling-task h2, .polling-workspace .result-entry-heading h2 { font-size: 20px; line-height: 1.4; }
}

.bm-selection { padding-bottom: 170px; }
.bm-picker-table { max-height: 280px; overflow: auto; }
.register-people { margin-top: 24px; }
.people-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }
.people-pagination button { width: 44px; height: 44px; padding: 8px; }
.bm-selection-tools { display: flex; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.bm-selection-tools > label:first-child { flex: 1 1 260px; }
.bm-selected-only { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.bm-selection input[type="checkbox"] { width: 22px; height: 22px; min-width: 22px; accent-color: #0f7a68; cursor: pointer; }
.bm-selection [hidden] { display: none !important; }
.bm-selection-total { position: fixed; bottom: 0; left: 0; right: 0; z-index: 25; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px max(16px, calc((100% - 1440px) / 2)); padding-bottom: max(16px, env(safe-area-inset-bottom)); background: #fff; border-top: 2px solid #0f7a68; box-shadow: 0 -3px 12px #00000012; }
.bm-selection-total > div { display: flex; gap: 24px; flex-wrap: wrap; }
.bm-selection-total strong { font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  .bm-selection-total > div { flex-direction: column; gap: 4px; font-size: 14px; }
  .bm-selection-total button { width: auto; flex: 0 0 auto; }
}

@media print {
  .topbar,
  .actions,
  .inline-save,
  button,
  .button,
  .table-search,
  .training-tools {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .main {
    width: 100%;
    padding: 0;
  }

  .card,
  .stat-card,
  .hero {
    box-shadow: none;
    break-inside: avoid;
  }
}

/* Pregled biračkih odbora */
.board-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; padding: 18px; }
.board-tools label { display: grid; gap: 6px; }
.board-tools label:has(input[type="checkbox"]) { display: flex; align-items: center; align-self: center; }
.board-grid { max-height: 72vh; overflow: auto; }
.board-grid table { border-collapse: separate; border-spacing: 0; min-width: 1500px; }
.board-grid th { position: sticky; top: 0; z-index: 2; background: #e7eef4; color: #182c40; white-space: nowrap; }
.board-grid td, .board-grid th { border-right: 1px solid #dbe3eb; border-bottom: 1px solid #dbe3eb; padding: 10px 12px; }
.board-grid tbody tr:nth-child(even) { background: #f5f8fb; }
.board-grid tbody tr:hover { background: #e9f2fa; }
.board-grid td:first-child, .board-grid th:first-child { position: sticky; left: 0; background: #edf3f8; }
.board-grid th:first-child { z-index: 3; }
.board-grid .people-private input { width: 150px; min-width: 150px; }
.board-vacant { color: #637487; }
.board-tools label { min-width: 0; max-width: 100%; }
.board-tools input[type="checkbox"] { width: 20px; min-width: 20px; height: 20px; accent-color: #0f7a68; }
@media (max-width: 700px) {
  .board-tools { padding: 10px 0; }
  .board-tools label { width: 100%; }
  .board-tools select, .board-tools input[type="search"] { width: 100%; min-width: 0; }
}
.board-proposer-picker { position: relative; min-width: 220px; max-width: 100%; align-self: end; }
.board-proposer-picker > summary { cursor: pointer; padding: 12px; border: 1px solid #cbd5d9; border-radius: 8px; background: #fff; color: #182c40; }
.board-proposer-options { position: absolute; z-index: 5; top: calc(100% + 6px); left: 0; width: 300px; max-width: calc(100vw - 80px); max-height: 320px; overflow-y: auto; padding: 12px; border: 1px solid #cbd5d9; border-radius: 8px; background: #fff; box-shadow: 0 8px 24px #182c4026; }
.board-proposer-options label { padding: 8px 0; cursor: pointer; }
.board-proposer-options button { width: 100%; margin-bottom: 6px; }
@media (max-width: 700px) { .board-proposer-picker { width: 100%; } }

/* Praktična obuka i materijali */
.training-materials, .ballot-exercises { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.training-materials article { border: 1px solid #dbe3eb; border-radius: 10px; padding: 16px; min-width: 0; }
.training-materials p { color: #637487; }
.lesson-source { display: block; color: #637487; line-height: 1.5; }
.sample-ballot { display: block; width: 100%; max-width: 320px; height: auto; margin: 12px auto; }
.day-simulation { border-top: 1px solid #dbe3eb; padding-top: 20px; }
.day-simulation [data-day-step] { margin: 16px 0; }
.ballot-exercises .situation-exercise { margin: 0; min-width: 0; }
@media (max-width: 900px) { .ballot-exercises { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 600px) { .training-materials, .ballot-exercises { grid-template-columns: minmax(0,1fr); } }
.day-simulation [hidden] { display: none !important; }
.ballot-exercises form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.ballot-exercises form .checkline { margin: 0; }
.ballot-exercises form button { width: 100%; }
.ballot-exercises [data-situation-result] { grid-column: 1 / -1; }
#listici, #simulacija-dana, #materijali-obuke { scroll-margin-top: 130px; }

/* Mapa biračkih mesta */
.register-voter-table { min-width: 0; width: 100%; }
.bm-selection [data-bm-export][hidden] { display: none !important; }
.register-voter-table td { vertical-align: middle; white-space: normal; }
.voter-station-number { width: 80px; font-weight: 700; }
.voter-person-open { display: flex; width: 100%; min-height: 48px; padding: 8px; text-align: left; justify-content: flex-start; background: transparent; border: 0; color: var(--primary); white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }
.voter-flag-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.voter-flag-badge { padding: 5px 8px; border: 1px solid #e8cb89; border-radius: 6px; background: #fff8e8; color: #735000; font-size: 12px; }
.voter-flag-dialog { width: min(560px, calc(100vw - 24px)); max-height: 85dvh; padding: 22px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); }
.voter-flag-dialog::backdrop { background: #102b40aa; }
.voter-dialog-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.voter-dialog-head h2 { margin: 0; font-size: 22px; line-height: 1.4; overflow-wrap: anywhere; }
.voter-dialog-head button { width: 48px; height: 48px; padding: 0; flex-shrink: 0; font-size: 26px; }
.voter-flag-option { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 10px; margin: 10px 0; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.voter-flag-option input { width: 22px; height: 22px; min-height: 22px; flex-shrink: 0; }
.voter-flag-option span { font-size: 16px; }
.voter-flag-dialog button[type="submit"] { width: 100%; min-height: 48px; }
.voter-flag-history { margin-top: 18px; }
.voter-flag-history summary { min-height: 44px; cursor: pointer; }
.voter-flag-history li { margin: 10px 0; line-height: 1.5; font-size: 13px; }
@media screen and (max-width: 720px) {
  .role-polling .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .register-voter-table thead { display: none; }
  .register-voter-table, .register-voter-table tbody { display: block; min-width: 0; }
  .register-voter-table tr { display: grid; grid-template-columns: 64px minmax(0,1fr); margin: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
  .register-voter-table td { display: block; border: 0; padding: 4px; }
  .register-voter-table .voter-person-flags { grid-column: 2; }
  .voter-person-open { font-size: 16px; }
  .voter-flag-dialog { padding: 16px; }
  .voter-flag-dialog h2 { font-size: 20px; }
}

.account-password-card { max-width: 520px; margin: 24px auto; }
.account-password-card form { display: grid; gap: 16px; margin-top: 20px; }
.account-password-card button { min-height: 48px; white-space: normal; }
.oik-editor { scroll-margin-top: 140px; }
.oik-editor-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 24px; }
.oik-editor-layout > div { min-width: 0; }
.oik-editor .form-grid { margin: 16px 0 24px; }
.oik-review, .oik-document { margin: 12px 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #f7fbff; overflow-wrap: anywhere; }
.oik-review small, .oik-document small { display: block; margin: 6px 0; }
.oik-review p { white-space: pre-wrap; }
@media screen and (max-width: 900px) { .oik-editor-layout { grid-template-columns: minmax(0,1fr); } }

.member-activity { margin: 14px 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #f7fbff; }
.member-activity h4 { margin: 0 0 12px; font-size: 15px; }
.member-activity-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.member-activity-grid > div { min-width: 0; }
.member-stat-label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.member-activity small, .board-grid .member-stat-cell small { display: block; margin-top: 5px; font-size: 12px; line-height: 1.4; }
.member-stat-time { display: block; font-variant-numeric: tabular-nums; }
.member-training-progress { display: block; width: 100%; max-width: 260px; height: 10px; margin-top: 8px; accent-color: var(--primary); }
.member-stat-completed { color: var(--ok); font-weight: 700; }
.member-login-history { margin-top: 6px; }
.member-login-history summary { cursor: pointer; white-space: normal; font-size: 13px; }
.member-login-history ol { margin: 8px 0 0; padding-left: 20px; line-height: 1.8; font-size: 12px; }
.board-grid .member-stat-cell { min-width: 230px; max-width: 320px; white-space: normal; vertical-align: top; }
.board-activity-tools { margin: 14px 0; }
.board-activity-tools label { display: grid; gap: 6px; max-width: 340px; }
@media screen and (max-width: 900px) { .member-activity-grid { grid-template-columns: minmax(0, 1fr); } }

.station-map-workspace { min-width: 0; }
.station-map-workspace [hidden] { display: none !important; }
.map-toolbar { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; margin-bottom: 18px; }
.map-toolbar label { display: grid; gap: 6px; min-width: 0; }
.map-toolbar input, .map-toolbar select, .map-toolbar button { min-height: 44px; }
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.map-panel, .map-sidebar { min-width: 0; }
#station-map { height: min(68vh, 680px); min-height: 420px; width: 100%; border: 1px solid var(--line); border-radius: 10px; isolation: isolate; z-index: 0; scroll-margin-top: 135px; background: #e5eef0; }
.map-sidebar { max-height: 76vh; overflow-y: auto; padding: 0 4px; }
.map-sidebar > p:first-child { margin-top: 0; font-weight: 700; }
.map-station-list { display: grid; gap: 10px; }
.map-station-card { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.map-station-select { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; width: 100%; padding: 8px; min-height: 48px; text-align: left; white-space: normal; background: #f3f7fb; color: var(--ink); border-color: var(--line); }
.map-station-select[aria-pressed="true"] { background: #e0edf7; border-color: var(--primary); }
.map-station-select > span { font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.map-station-card p { margin: 10px 0; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.map-location-label { display: block; line-height: 1.4; color: var(--muted); }
.map-location-label.approximate, .map-popup .approximate { color: #9a5700; font-weight: 700; }
.map-location-label.confirmed { color: var(--ok); }
.map-station-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 4px; color: var(--primary); font-weight: 700; }
.map-legend { display: flex; flex-wrap: wrap; gap: 10px 18px; padding-top: 14px; font-size: 13px; }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.map-dot.approximate { background: #b86c0b; }
.map-boundary-key { width: 20px; height: 0; border-top: 2px solid var(--primary); }
.map-help, .map-network-message { font-size: 14px; line-height: 1.5; color: var(--muted); }
.station-map-marker { background: transparent; border: 0; }
.station-map-marker span { display: flex; justify-content: center; align-items: center; width: 100%; height: 100%; background: #225a86; border: 2px solid #fff; border-radius: 22px; color: #fff; font-size: 14px; font-weight: 800; box-shadow: 0 2px 8px #17212b55; }
.station-map-marker.approximate span { background: #b86c0b; }
.station-map-cluster span { display: flex; flex-direction: column; justify-content: center; align-items: center; width: 50px; height: 50px; border-radius: 50%; border: 3px solid #fff; outline: 4px solid #225a8640; background: #225a86; color: #fff; font-size: 17px; font-weight: 800; box-shadow: 0 2px 8px #17212b44; }
.station-map-cluster small { font-size: 11px; line-height: 1; color: inherit; }
.station-map-marker:focus-visible { outline: 3px solid #17212b; outline-offset: 3px; border-radius: 22px; }
.station-map-workspace .leaflet-control-zoom a { width: 44px; height: 44px; line-height: 44px; font-size: 24px; }
.map-popup article + article { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.station-map-workspace .leaflet-container a.leaflet-popup-close-button { width: 44px; height: 44px; line-height: 44px; font-size: 24px; }
.map-popup h3 { margin: 6px 0; font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.map-popup p { margin: 8px 0; line-height: 1.4; }
.map-popup-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.map-popup .button, .map-popup button { min-height: 44px; font-size: 14px; padding: 8px 10px; color: #fff; }
.map-popup .ghost { color: var(--primary); }
.map-popup button { width: 100%; margin-top: 8px; }
.map-popup-note { color: var(--muted); font-size: 13px; }
.map-location-editor { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin-bottom: 14px; }
.map-location-editor summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; }
.map-location-editor p { font-size: 14px; line-height: 1.5; }
.map-location-editor form { display: grid; gap: 12px; }
.map-location-editor [data-map-editor-title] { overflow-wrap: anywhere; }
@media screen and (max-width: 900px) {
  .map-layout { grid-template-columns: minmax(0, 1fr); }
  .map-sidebar { max-height: none; overflow: visible; padding: 0; }
  .map-station-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #station-map { height: 55vh; min-height: 360px; max-height: 540px; }
}
@media screen and (max-width: 600px) {
  .map-toolbar { grid-template-columns: minmax(0, 1fr); }
  .map-toolbar input, .map-toolbar select, .map-toolbar button { min-height: 48px; font-size: 16px; }
  .map-station-list { grid-template-columns: minmax(0, 1fr); }
  #station-map { height: 420px; min-height: 360px; max-height: 60svh; }
  .map-station-card { padding: 12px; }
  .map-location-editor input, .map-location-editor button { min-height: 48px; }
}
