:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-strong: #16202a;
  --ink: #17212b;
  --muted: #68717b;
  --line: #d8dee5;
  --accent: #0f766e;
  --accent-strong: #0b5c56;
  --warning: #b45309;
  --danger: #b42318;
  --success: #157347;
  --phase: #7b4a2b;
  --neutral: #2f80c8;
  --earth: #4d9f3a;
  --traveller: #5f6368;
  --shadow: 0 16px 40px rgba(18, 31, 45, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

a {
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--panel-strong);
  color: #f7fafc;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background: #f5c542;
  color: #18222d;
  border-radius: 8px;
  font-weight: 800;
}

.brand h1,
.brand p,
.section-heading h2,
.section-heading p,
.hero-copy h2,
.hero-copy p,
.workbench-header h2,
.workbench-header p {
  margin: 0;
}

.brand h1 {
  font-size: 1.15rem;
}

.brand p {
  color: #b8c3cf;
  font-size: 0.9rem;
  margin-top: 4px;
}

.safety-banner {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(245, 197, 66, 0.45);
  border-left: 4px solid #f5c542;
  background: rgba(245, 197, 66, 0.08);
  border-radius: 8px;
  line-height: 1.4;
}

.safety-banner span {
  color: #d7dee7;
  font-size: 0.92rem;
}

.nav-actions {
  display: grid;
  gap: 8px;
}

.nav-button,
.secondary-button,
.ghost-button,
.primary-button,
.segmented {
  min-height: 42px;
  border-radius: 8px;
  padding: 10px 14px;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.nav-button {
  display: block;
  text-align: left;
  color: #dbe4ee;
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.nav-button:hover,
.nav-button.active {
  background: rgba(15, 118, 110, 0.8);
  color: #ffffff;
}

.progress-card,
.toolbox,
.inspector,
.quiz-panel,
.hazard-panel {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.progress-card {
  margin-top: auto;
}

.card-title {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.progress-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0;
}

.progress-bar {
  height: 10px;
  border-radius: 999px;
  background: #e9eef3;
  overflow: hidden;
  margin: 14px 0;
}

.progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--accent);
}

.main-stage {
  min-width: 0;
  padding: 28px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.home-screen {
  min-height: calc(100vh - 56px);
  display: none;
  align-content: center;
}

.home-screen.active {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1fr);
  gap: 28px;
}

.hero-copy {
  display: grid;
  gap: 18px;
  align-content: center;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.hero-copy h2 {
  font-size: clamp(2rem, 4vw, 4.8rem);
  line-height: 1.04;
  max-width: 780px;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 680px;
  color: var(--muted);
  line-height: 1.65;
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.standard-note {
  max-width: 760px;
  border-left: 4px solid var(--warning);
  border-radius: 8px;
  padding: 14px 16px;
  background: rgba(180, 83, 9, 0.08);
  color: #4a5562;
  line-height: 1.55;
}

.standard-note strong {
  color: var(--warning);
}

.primary-button {
  color: #ffffff;
  background: var(--accent);
  font-weight: 700;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button,
.ghost-button {
  background: #edf2f7;
  color: var(--ink);
  border: 1px solid var(--line);
}

.ghost-button {
  background: transparent;
}

.full {
  width: 100%;
  margin-bottom: 0;
}

.overview-grid,
.safety-grid,
.level-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.seo-content {
  grid-column: 1 / -1;
  margin-top: 20px;
  padding: 22px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.65;
}

.seo-content h2,
.seo-content h3,
.seo-content p {
  margin-top: 0;
}

.seo-content p {
  color: var(--muted);
}

.seo-topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.seo-topic-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
}

.overview-grid article,
.safety-rule,
.level-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 6px 20px rgba(24, 34, 45, 0.05);
}

.overview-grid span {
  color: var(--accent);
  font-weight: 800;
}

.overview-grid h3,
.safety-rule h3,
.level-card h3 {
  margin: 8px 0;
}

.overview-grid p,
.safety-rule p,
.level-card p,
.basics-list p {
  color: var(--muted);
  line-height: 1.45;
}

.section-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.section-heading h2,
.workbench-header h2 {
  font-size: 2rem;
}

.section-heading > p:not(.eyebrow),
.workbench-header p {
  color: var(--muted);
}

.compact {
  margin-top: 22px;
}

.safety-rule.danger {
  border-left: 4px solid var(--danger);
}

.quiz-panel,
.hazard-panel {
  margin-top: 18px;
}

.quiz-topline,
.workbench-header,
.board-status,
.level-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.quiz-list {
  display: grid;
  gap: 12px;
  margin: 14px 0;
}

.quiz-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.option-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 8px 0;
  color: var(--muted);
}

.feedback-text {
  min-height: 24px;
  font-weight: 700;
}

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

.hazard-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.hazard-card h3,
.hazard-card p {
  margin: 0 0 8px;
}

.hazard-card select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}

.level-card.locked {
  opacity: 0.58;
}

.level-badge {
  border-radius: 999px;
  padding: 6px 10px;
  background: #edf2f7;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.level-badge.done {
  background: rgba(21, 115, 71, 0.12);
  color: var(--success);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 320px;
  grid-template-areas:
    "tools tools"
    "board inspector";
  gap: 16px;
  align-items: stretch;
  margin-top: 18px;
}

.toolbox {
  grid-area: tools;
  display: grid;
  grid-template-columns: minmax(280px, 1.2fr) minmax(220px, 0.8fr) minmax(240px, 0.8fr);
  gap: 14px;
  align-items: start;
}

.tool-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}

.tool-block-header {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-weight: 800;
  text-align: left;
}

.tool-block-header:hover {
  background: #eef8f6;
}

.tool-block-header.collapsed {
  border-bottom: 0;
}

.toggle-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: #edf2f7;
  color: var(--accent);
  font-weight: 900;
}

.tool-block-body {
  padding: 12px;
}

.tool-block-body.collapsed {
  display: none;
}

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

.board-wrap {
  grid-area: board;
}

.inspector {
  grid-area: inspector;
}

.toolbox .card-title {
  margin: 0 0 8px;
}

.board-fullscreen-mode {
  overflow: hidden;
}

.board-fullscreen-mode .sidebar,
.board-fullscreen-mode .guide-panel {
  display: none;
}

.board-fullscreen-mode .app-shell {
  display: block;
  min-height: 100vh;
}

.board-fullscreen-mode .main-stage {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: block;
  min-height: 100vh;
  padding: 0;
  background: var(--bg);
}

.board-fullscreen-mode .practice-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.board-fullscreen-mode .screen:not(.practice-screen) {
  display: none;
}

.board-fullscreen-mode .workspace-grid {
  grid-template-columns: minmax(0, 1fr) 330px;
  grid-template-areas:
    "tools tools"
    "board inspector";
  flex: 1;
  min-height: 0;
  margin: 0;
  gap: 0;
}

.board-fullscreen-mode .workbench-header {
  padding: 10px 14px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.board-fullscreen-mode .workbench-header h2 {
  font-size: 1.3rem;
}

.board-fullscreen-mode .workbench-header p:not(.eyebrow) {
  font-size: 0.92rem;
}

.board-fullscreen-mode .toolbox,
.board-fullscreen-mode .inspector {
  border-radius: 0;
  border-top: 0;
  border-bottom: 0;
  overflow: auto;
}

.board-fullscreen-mode .toolbox {
  max-height: 190px;
  border-left: 0;
  border-right: 0;
}

.board-fullscreen-mode .board-status {
  border-radius: 0;
}

.board-fullscreen-mode .board {
  min-height: calc(100vh - 302px);
  height: calc(100vh - 302px);
  border-radius: 0;
}

.board-fullscreen-mode .connection-list {
  max-height: 30vh;
}

.guide-panel {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 18px;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
}

.guide-panel strong {
  display: block;
  margin-top: 4px;
  line-height: 1.45;
}

.guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.component-palette,
.wire-palette {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.toolbox .component-palette,
.toolbox .wire-palette {
  margin-bottom: 0;
}

.toolbox .component-palette {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  max-height: 220px;
  overflow: auto;
  padding-right: 4px;
}

.toolbox .wire-palette {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.component-chip,
.wire-chip {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px;
  text-align: left;
}

.component-chip:hover,
.wire-chip:hover,
.wire-chip.active {
  border-color: var(--accent);
}

.component-chip.required {
  background: #eef8f6;
  border-color: rgba(15, 118, 110, 0.4);
}

.zoom-control {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.chip-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 28px;
  border-radius: 6px;
  background: #e9eef3;
  font-weight: 800;
}

.wire-swatch {
  width: 34px;
  height: 10px;
  border-radius: 999px;
}

.wire-swatch.earth {
  background: repeating-linear-gradient(90deg, var(--earth) 0 10px, #f1c232 10px 20px);
}

.board-wrap {
  min-width: 0;
}

.board-status {
  min-height: 42px;
  background: var(--panel-strong);
  color: #f7fafc;
  border-radius: 8px 8px 0 0;
  padding: 10px 14px;
  font-size: 0.92rem;
}

.board {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background:
    linear-gradient(90deg, rgba(20, 33, 45, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(20, 33, 45, 0.05) 1px, transparent 1px),
    #ffffff;
  background-size: 28px 28px;
  box-shadow: var(--shadow);
  transform-origin: top left;
}

.board.board-error {
  animation: boardAlarm 0.45s ease;
}

.drop-hint {
  position: absolute;
  inset: 20px;
  display: grid;
  place-items: center;
  color: #9aa5b1;
  border: 2px dashed #cbd5df;
  border-radius: 8px;
  pointer-events: none;
}

.wire-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

.placed-component {
  position: absolute;
  width: 128px;
  min-height: 86px;
  border: 2px solid #cbd5df;
  border-radius: 8px;
  background: #f9fbfd;
  box-shadow: 0 10px 22px rgba(18, 31, 45, 0.12);
  padding: 10px;
  user-select: none;
}

.placed-component.powered {
  border-color: var(--success);
  box-shadow: 0 0 0 4px rgba(21, 115, 71, 0.12), 0 10px 22px rgba(18, 31, 45, 0.12);
}

.placed-component[data-component="lamp"].powered .component-symbol {
  background: #ffd166;
  color: #3f2f00;
  box-shadow: 0 0 22px rgba(255, 209, 102, 0.95), 0 0 60px rgba(255, 209, 102, 0.45);
  animation: lampGlow 0.9s ease-in-out infinite alternate;
}

.placed-component.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.18), 0 10px 22px rgba(18, 31, 45, 0.12);
}

.placed-component.hint {
  outline: 2px dashed rgba(15, 118, 110, 0.7);
  outline-offset: 5px;
}

.component-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.component-symbol {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e8f3f1;
  color: var(--accent-strong);
  font-weight: 900;
}

.port-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.port {
  min-width: 28px;
  border-radius: 999px;
  border: 1px solid #aab4bf;
  background: #ffffff;
  padding: 4px 7px;
  font-size: 0.72rem;
  font-weight: 700;
}

.port.pending {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.feedback-panel {
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  line-height: 1.55;
  background: #f8fafc;
}

.feedback-panel.success {
  border-color: rgba(21, 115, 71, 0.4);
  background: rgba(21, 115, 71, 0.08);
}

.feedback-panel.warning {
  border-color: rgba(180, 83, 9, 0.42);
  background: rgba(180, 83, 9, 0.08);
}

.feedback-panel ul {
  padding-left: 18px;
}

.mode-toggle {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.wire-flow {
  stroke-dasharray: 12 10;
  animation: flow 1.1s linear infinite;
}

.wire-problem {
  stroke: var(--danger) !important;
  stroke-width: 7;
}

.wire-label-group {
  cursor: pointer;
  pointer-events: auto;
}

.wire-label-group:active {
  cursor: grabbing;
}

.endpoint-tag {
  cursor: pointer;
  pointer-events: auto;
}

.wire-label-group text,
.endpoint-tag text {
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.8);
  stroke-width: 3px;
}

.wire-label-group rect,
.endpoint-tag rect {
  filter: drop-shadow(0 4px 9px rgba(18, 31, 45, 0.18));
}

.connection-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.connection-row {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 8px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 8px;
  text-align: left;
}

.connection-row:hover {
  border-color: var(--accent);
  background: #eef8f6;
}

.connection-row.problem {
  border-color: var(--danger);
  background: rgba(180, 35, 24, 0.08);
}

.blast-overlay {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  z-index: 50;
  pointer-events: none;
  background:
    radial-gradient(circle at center, rgba(255, 237, 213, 0.95), rgba(180, 35, 24, 0.32) 38%, rgba(23, 33, 43, 0.35));
}

.blast-overlay.active {
  display: grid;
  animation: blastFade 1.35s ease forwards;
}

.blast-core {
  display: grid;
  gap: 10px;
  max-width: 520px;
  padding: 28px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--danger);
  border: 3px solid var(--danger);
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.blast-core strong {
  font-size: 2rem;
  letter-spacing: 0.04em;
}

.blast-core span {
  color: var(--ink);
}

.cable-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.42);
}

.cable-modal.active {
  display: grid;
}

.cable-dialog {
  width: min(560px, 100%);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.cable-dialog h3 {
  margin: 8px 0;
}

.cable-dialog p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.55;
}

.cable-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.danger-button {
  min-height: 42px;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--danger);
  color: #ffffff;
  font-weight: 800;
}

.danger-button:hover {
  background: #8f1d15;
}

@keyframes blastFade {
  0% {
    opacity: 0;
    transform: scale(0.96);
  }
  15% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.04);
  }
}

.port[data-port="L"],
.port[data-port="L-IN"],
.port[data-port="L-OUT"] {
  border-color: var(--phase);
  color: var(--phase);
}

.port[data-port="N"],
.port[data-port="N-IN"],
.port[data-port="N-OUT"] {
  border-color: var(--neutral);
  color: var(--neutral);
}

.port[data-port="PE"] {
  border-color: var(--earth);
  color: var(--earth);
  background: #fbf7da;
}

@keyframes flow {
  to {
    stroke-dashoffset: -44;
  }
}

@keyframes boardAlarm {
  0%, 100% {
    box-shadow: var(--shadow);
  }
  25%, 75% {
    box-shadow: 0 0 0 6px rgba(180, 35, 24, 0.2), var(--shadow);
    transform: translateX(-4px);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(180, 35, 24, 0.26), var(--shadow);
    transform: translateX(4px);
  }
}

@keyframes lampGlow {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.08);
  }
}

.segmented {
  border-radius: 0;
  background: #ffffff;
  color: var(--muted);
}

.segmented.active {
  background: var(--panel-strong);
  color: #ffffff;
}

.install-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.install-panel {
  width: min(620px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.install-panel h1,
.admin-section h2 {
  margin: 8px 0 18px;
}

.admin-form,
.admin-edit-card {
  display: grid;
  gap: 12px;
}

.admin-form label,
.admin-edit-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.admin-form input,
.admin-edit-card input,
.admin-edit-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  font: inherit;
}

.admin-edit-card textarea {
  min-height: 88px;
  resize: vertical;
}

.admin-edit-card .code-area {
  min-height: 150px;
  font-family: Consolas, Monaco, monospace;
  font-size: 0.9rem;
  line-height: 1.45;
}

.document-page {
  display: grid;
  gap: 16px;
  align-content: start;
}

.practice-band {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  line-height: 1.6;
}

.practice-band h3 {
  margin-top: 0;
}

.practices-shell .main-stage {
  max-width: 1180px;
}

.notice {
  border-radius: 8px;
  margin: 12px 0;
  padding: 12px;
  font-weight: 700;
}

.notice.success {
  background: rgba(21, 115, 71, 0.1);
  color: var(--success);
  border: 1px solid rgba(21, 115, 71, 0.28);
}

.notice.danger {
  background: rgba(180, 35, 24, 0.1);
  color: var(--danger);
  border: 1px solid rgba(180, 35, 24, 0.28);
}

.admin-muted {
  color: var(--muted);
  line-height: 1.5;
}

.admin-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-section {
  margin-top: 24px;
}

.admin-edit-list {
  display: grid;
  gap: 14px;
}

.admin-edit-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.component-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .workspace-grid,
  .home-screen.active {
    grid-template-columns: 1fr;
  }

  .workspace-grid {
    grid-template-areas:
      "tools"
      "board"
      "inspector";
  }

  .toolbox {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .main-stage,
  .sidebar {
    padding: 16px;
  }

  .overview-grid,
  .safety-grid,
  .hazard-list,
  .level-list,
  .seo-topic-grid {
    grid-template-columns: 1fr;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "tools"
      "board"
      "inspector";
  }

  .toolbox {
    grid-template-columns: 1fr;
  }

  .board {
    min-height: 520px;
  }

  .quiz-topline,
  .workbench-header,
  .board-status,
  .guide-panel {
    align-items: flex-start;
    flex-direction: column;
  }
}
