:root {
  --ink: #17202a;
  --muted: #617082;
  --line: #d9e0e7;
  --paper: #fbfcfd;
  --panel: #ffffff;
  --red: #d71920;
  --red-dark: #981b1e;
  --gold: #f2b84b;
  --green: #247a52;
  --blue: #2866a8;
  --shadow: 0 18px 48px rgba(23, 32, 42, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #eef2f5;
}

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

button {
  cursor: pointer;
}

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

.app-shell.sidebar-collapsed {
  grid-template-columns: 88px minmax(0, 1fr);
}

.app-shell.signed-out {
  display: block;
  min-height: 100vh;
}

.app-shell.signed-out .sidebar,
.app-shell.signed-out .topbar {
  display: none;
}

.app-shell.signed-out .workspace {
  min-height: 100vh;
  display: grid;
}

.app-shell.signed-out .view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.sidebar {
  background: #121820;
  color: #f8fafc;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
  transition: width 180ms ease, padding 180ms ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-text {
  display: grid;
  min-width: 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: white;
  font-weight: 900;
  border-radius: 8px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  background: white;
  padding: 4px;
}

.brand span,
.account-panel span,
#sectionKicker,
.muted {
  color: var(--muted);
  font-size: 0.86rem;
}

.sidebar .brand span,
.sidebar .account-panel span {
  color: #aab7c6;
}

.sidebar-controls {
  display: flex;
  gap: 8px;
}

.sidebar-icon-button {
  border: 1px solid #344250;
  background: #17202a;
  color: #dbe3eb;
  border-radius: 8px;
  padding: 9px 10px;
}

.sidebar-icon-button.active,
.sidebar-icon-button:hover {
  background: #26313d;
  color: white;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  border: 0;
  background: transparent;
  color: #dbe3eb;
  text-align: left;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.nav-icon {
  width: 28px;
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  font-weight: 800;
}

.nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item.active,
.nav-item:hover {
  background: #26313d;
  color: white;
}

.account-panel {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #344250;
  border-radius: 8px;
}

.mobile-menu-button {
  display: none;
}

.app-shell.sidebar-collapsed .sidebar {
  padding-inline: 14px;
  align-items: center;
}

.app-shell.sidebar-collapsed .brand,
.app-shell.sidebar-collapsed .sidebar-controls {
  justify-content: center;
}

.app-shell.sidebar-collapsed .brand-text,
.app-shell.sidebar-collapsed .nav-label,
.app-shell.sidebar-collapsed .account-panel span,
.app-shell.sidebar-collapsed .account-panel strong,
.app-shell.sidebar-collapsed #loginButton {
  display: none;
}

.app-shell.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 10px;
}

.app-shell.sidebar-collapsed .sidebar-controls {
  display: grid;
}

.app-shell.sidebar-collapsed .sidebar-icon-button {
  width: 58px;
  padding-inline: 6px;
  font-size: 0.75rem;
}

.app-shell.sidebar-collapsed .account-panel {
  padding: 8px;
}

.workspace {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  min-height: 92px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 22px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar h1,
.topbar p {
  margin: 0;
}

.topbar h1 {
  font-size: 1.65rem;
}

.topbar-actions,
.toolbar,
.button-row,
.chips,
.activity-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.view {
  padding: 26px 28px 42px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

.surface,
.card,
.editor-panel,
.modal,
.auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.surface {
  padding: 18px;
}

.session-panel {
  align-self: start;
}

.session-panel summary {
  cursor: pointer;
  font-weight: 900;
  margin-left: 15px;
  font-size: 1.15rem;
  list-style-position: outside;
}

.session-panel summary span,
.toolbox-section summary {
  user-select: none;
}

.session-panel[open] summary {
  margin-bottom: 12px;
}

.session-panel-actions {
  margin-bottom: 14px;
}

.session-panel .form-grid {
  margin-top: 0 !important;
}

.card {
  padding: 16px;
  display: grid;
  gap: 10px;
}

.auth-card {
  max-width: 460px;
  width: min(100%, 440px);
  margin: 0 auto;
  padding: 28px;
  display: grid;
  gap: 18px;
  box-shadow: var(--shadow);
}

.auth-card h2 {
  margin: 0 0 6px;
}

.auth-card p {
  margin: 0;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.auth-brand div:last-child {
  display: grid;
  gap: 2px;
}

.auth-brand strong {
  font-size: 1.05rem;
}

.auth-brand span {
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-logo,
.auth-logo-mark {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: white;
}

.auth-logo {
  object-fit: contain;
  border: 1px solid var(--line);
  padding: 6px;
}

.auth-logo-mark {
  display: grid;
  place-items: center;
  background: var(--red);
  color: white;
  font-weight: 900;
  font-size: 1.1rem;
}

.auth-link {
  border-color: var(--line);
  color: var(--ink);
  justify-self: start;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.table-actions .secondary-button,
.table-actions .success-button,
.table-actions .danger-button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 0.78rem;
}

.role-permissions-form {
  display: grid;
  gap: 18px;
}

.permission-group {
  display: grid;
  gap: 10px;
}

.permission-group h3 {
  margin: 0;
}

.permission-group code {
  color: var(--red-dark);
  font-size: 0.78rem;
}

.card h3,
.surface h2,
.surface h3 {
  margin: 0;
}

.dashboard-section {
  margin-top: 16px;
}

.dashboard-section:first-child {
  margin-top: 0;
}

.dashboard-actions,
.dashboard-card-grid,
.dashboard-age-grid,
.dashboard-range-list,
.dashboard-widget-options {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

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

.dashboard-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.dashboard-age-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.age-lesson-card {
  align-content: start;
}

.dashboard-session-link,
.text-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-align: left;
}

.dashboard-session-link {
  display: grid;
  gap: 3px;
  padding: 7px 0;
}

.dashboard-session-link span {
  color: var(--muted);
  font-size: 0.82rem;
}

.drill-library-card {
  align-content: start;
}

.drill-library-card .toolbar {
  justify-content: space-between;
}

.drill-preview {
  border-radius: 8px;
  overflow: hidden;
  background: #e2e8f0;
  height: 150px;
  display: grid;
  place-items: center;
}

.diagram-snapshot {
  width: 100%;
  height: 100%;
  display: block;
}

.inline-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.inline-select select {
  min-height: 34px;
  min-width: 150px;
}

.metric {
  font-size: 2rem;
  font-weight: 800;
}

.primary-button,
.success-button,
.secondary-button,
.ghost-button,
.danger-button {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 8px 12px;
  font-weight: 700;
}

.primary-button {
  background: var(--red);
  color: white;
}

.secondary-button {
  background: white;
  border-color: var(--line);
  color: var(--ink);
}

.success-button {
  background: #16a34a;
  border-color: #15803d;
  color: white;
}

.success-button:disabled {
  opacity: 1;
  cursor: default;
}

.ghost-button {
  background: transparent;
  border-color: #435161;
  color: inherit;
}

.danger-button {
  background: #fee2e2;
  color: #991b1b;
}

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

.form-grid label,
.stack label {
  display: grid;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--muted);
}

.form-grid .wide,
.stack .wide {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  color: var(--ink);
  background: white;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  color: var(--muted);
  font-size: 0.82rem;
}

.checkbox-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 0.86rem;
}

.checkbox-cell input {
  width: auto;
}

.evaluation-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
}

.evaluation-card h3 {
  margin: 0 0 4px;
}

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

.evaluation-grid div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.evaluation-grid strong {
  font-size: 0.8rem;
}

.evaluation-grid span {
  color: var(--muted);
  white-space: pre-wrap;
}

.evaluation-question {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 180px) minmax(0, 1fr);
  gap: 10px;
}

.evaluation-question legend {
  padding: 0 6px;
  font-weight: 800;
}

.callout {
  border: 1px solid #f59e0b;
  border-radius: 8px;
  background: #fff7ed;
  color: #7c2d12;
  padding: 10px 12px;
  font-weight: 700;
}

.evaluation-builder {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.evaluation-builder-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(170px, 0.55fr) minmax(130px, 0.35fr) auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.tryout-shell {
  display: grid;
  gap: 14px;
}

.tryout-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.tryout-tabs .active,
.secondary-button.active {
  border-color: #ef4444;
  color: #b91c1c;
  background: #fff1f2;
}

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

.compact-toolbar {
  align-items: start;
  margin-bottom: 10px;
}

.compact-toolbar h4,
.compact-toolbar p {
  margin: 0;
}

.tryout-age-counts {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.tryout-card-list,
.ranking-list {
  display: grid;
  gap: 10px;
}

.tryout-player-card,
.ranking-row,
.placement-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.tryout-player-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.tryout-player-card.checked-in {
  border-color: #16a34a;
  background: #f0fdf4;
}

.tryout-number {
  min-width: 44px;
  min-height: 44px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  background: #111827;
  color: white;
  font-size: 1.15rem;
  font-weight: 900;
}

.tryout-number-input,
.rank-input {
  width: 78px;
}

.compact-search {
  min-width: 220px;
  max-width: 320px;
}

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

.tryout-eval-card form {
  display: grid;
  gap: 10px;
}

.sportsengine-mapping {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.sportsengine-mapping h4 {
  margin-bottom: 10px;
}

.tryout-schedule-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.tryout-schedule-preview h4 {
  margin-bottom: 10px;
}

.ranking-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
}

.placement-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  align-items: start;
}

.placement-column {
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.placement-column.good {
  border-color: #16a34a;
}

.placement-column.warning {
  border-color: #f59e0b;
}

.placement-column.at-max,
.placement-column.blocked {
  border-color: #dc2626;
}

.placement-card {
  padding: 10px;
  cursor: grab;
}

.placement-card.dragging {
  opacity: 0.55;
  cursor: grabbing;
}

.status,
.chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.78rem;
  font-weight: 800;
  background: #eef2f5;
}

.status.planned {
  background: #dbeafe;
  color: #1e40af;
}

.status.completed {
  background: #dcfce7;
  color: #166534;
}

.status.draft {
  background: #fef3c7;
  color: #92400e;
}

.designer-layout {
  display: grid;
  grid-template-columns: 250px minmax(360px, 1fr);
  gap: 14px;
  align-items: start;
}

.designer-layout > section:nth-child(n + 3) {
  display: none;
}

.app-shell[data-route="designer"] .topbar {
  min-height: 68px;
  padding: 14px 22px;
}

.app-shell[data-route="designer"] .view {
  padding: 14px 16px 24px;
}

.app-shell[data-route="designer"] .surface {
  padding: 12px;
}

.app-shell[data-route="designer"] .designer-layout {
  grid-template-columns: clamp(200px, 18vw, 250px) minmax(0, 1fr);
  gap: 10px;
}

.app-shell[data-route="designer"] .designer-toolbar {
  gap: 5px;
}

.app-shell[data-route="designer"] .designer-toolbar select,
.app-shell[data-route="designer"] .designer-toolbar input,
.app-shell[data-route="designer"] .designer-toolbar button,
.app-shell[data-route="designer"] .designer-toolbar .field-toggle {
  min-height: 28px;
  padding: 4px 7px;
  font-size: 0.74rem;
}

.app-shell[data-route="designer"] .designer-toolbar label {
  font-size: 0.64rem;
}

.app-shell[data-route="designer"] .advanced-toolbox {
  max-height: calc(100dvh - 180px);
}

.app-shell[data-route="designer"] .field-viewport {
  min-height: clamp(480px, calc(100dvh - 190px), 820px);
  padding: 12px;
}

@media (min-width: 981px) and (max-width: 1360px) {
  .app-shell[data-route="designer"]:not(.sidebar-collapsed) {
    grid-template-columns: 232px minmax(0, 1fr);
  }

  .app-shell[data-route="designer"] .sidebar {
    padding: 16px 12px;
    gap: 16px;
  }

  .app-shell[data-route="designer"] .brand-mark,
  .app-shell[data-route="designer"] .brand-logo {
    width: 40px;
    height: 40px;
  }

  .app-shell[data-route="designer"] .nav-item {
    padding: 9px 10px;
  }

  .app-shell[data-route="designer"] .account-panel {
    padding: 10px;
  }
}

@media (min-width: 981px) and (max-width: 1180px) {
  .app-shell[data-route="designer"] .designer-layout {
    grid-template-columns: 180px minmax(0, 1fr);
  }

  .app-shell[data-route="designer"] .tool-grid .tool-button {
    min-height: 48px;
    padding: 6px 4px;
    font-size: 0.68rem;
  }

  .app-shell[data-route="designer"] .tool-icon {
    width: 24px;
    height: 22px;
    font-size: 0.92rem;
  }

  .app-shell[data-route="designer"] .diagram-standard-card {
    display: none;
  }
}

.designer-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.designer-control-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.designer-control-panel summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.designer-control-panel summary strong {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
}

.designer-control-panel[open] {
  padding-bottom: 8px;
}

.designer-control-panel[open] summary {
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.designer-toolbar,
.designer-control-panel .frame-strip {
  padding-inline: 8px;
}

.designer-toolbar label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.designer-toolbar select,
.designer-toolbar input,
.designer-toolbar button {
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
}

.designer-toolbar #drillPicker {
  max-width: 220px;
}

.designer-toolbar .field-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font-size: 0.76rem;
}

.designer-toolbar .field-toggle input {
  width: auto;
}

.field-mount {
  margin-top: 10px;
}

.palette {
  display: grid;
  gap: 8px;
}

.palette button {
  text-align: left;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.toolbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.advanced-toolbox {
  margin-top: 12px;
  max-height: calc(100vh - 210px);
  overflow: auto;
  padding-right: 4px;
}

.toolbox-section {
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.toolbox-section:first-child {
  border-top: 0;
}

.toolbox-section summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-weight: 900;
  cursor: pointer;
  list-style-position: outside;
}

.toolbox-section .tool-grid {
  margin-top: 8px;
}

.diagram-standard-card {
  padding: 10px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  display: grid;
  gap: 7px;
  font-size: 0.75rem;
}

.diagram-standard-card h4 {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.diagram-standard-card div {
  display: grid;
  grid-template-columns: 42px 58px 1fr;
  gap: 6px;
  align-items: center;
}

.standard-line {
  width: 34px;
  height: 0;
  border-top: 3px solid #111827;
}

.standard-line.run {
  border-top-style: dotted;
}

.standard-line.dribble {
  height: 12px;
  border: 0;
  background: repeating-radial-gradient(ellipse at center, transparent 0 4px, #111827 5px 6px, transparent 7px 10px);
  clip-path: polygon(0 45%, 14% 15%, 28% 75%, 42% 20%, 56% 80%, 70% 18%, 84% 70%, 100% 42%, 100% 64%, 84% 92%, 70% 42%, 56% 100%, 42% 45%, 28% 98%, 14% 40%, 0 66%);
}

.standard-token {
  width: 30px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #e5e7eb;
  color: #111827;
  font-weight: 900;
}

.standard-token.standard-home {
  background: #2563eb;
  color: #ffffff;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  border-radius: 0;
  padding-top: 5px;
}

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

.tool-grid .tool-button {
  min-height: 58px;
  padding: 8px 6px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  font-size: 0.73rem;
  line-height: 1.05;
  text-align: center;
}

.tool-icon {
  width: 28px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #eef2f5;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 900;
}

.tool-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.formation-tool .tool-icon {
  width: auto;
  min-width: 42px;
  padding: 0 6px;
  font-size: 0.72rem;
}

.tool-grid .danger-tool {
  border-color: #fecaca;
  color: #991b1b;
  background: #fff7f7;
}

.palette button.active,
.frame-tab.active {
  border-color: var(--red);
  background: #fff1f2;
  color: var(--red-dark);
}

.palette button.active .tool-icon {
  background: var(--red);
  color: white;
}

.palette hr {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
}

.frame-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.frame-tab {
  flex: 0 0 auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 9px;
  font-weight: 800;
  font-size: 0.78rem;
}

.diagram-json {
  margin-top: 12px;
  min-height: 112px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.8rem;
}

.field-viewport {
  position: relative;
  width: 100%;
  min-height: clamp(560px, calc(100vh - 230px), 860px);
  overflow: auto;
  display: grid;
  align-items: start;
  justify-items: stretch;
  padding: 18px;
  background: #dbe3eb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.selection-actions {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: min(420px, calc(100% - 28px));
  padding: 6px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(23, 32, 42, 0.16);
}

.selection-actions[hidden] {
  display: none;
}

.selection-actions span {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.selection-actions button {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 0.76rem;
}

.field-scale {
  width: 100%;
  max-width: none;
  justify-self: stretch;
  transform-origin: center center;
  transition: transform 140ms ease;
}

.field-board {
  position: relative;
  aspect-ratio: 1.55 / 1;
  width: 100%;
  min-width: 100%;
  min-height: 360px;
  overflow: hidden;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 8%,
      rgba(0, 0, 0, 0.03) 8%,
      rgba(0, 0, 0, 0.03) 16%
    ),
    #2f8c5d;
  border: 2px solid white;
  box-shadow: var(--shadow);
}

.field-board.whiteboard {
  background: #f8fafc;
  border-color: #17202a;
}

.field-board.blank-area {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.field-board.technical-area {
  background: #2f8c5d;
  border-color: rgba(255, 255, 255, 0.55);
}

.field-board.vertical {
  max-width: none;
}

.soccer-field-base,
.pitch-lines,
.diagram-lines,
.diagram-objects,
.center-circle,
.center-spot,
.penalty,
.six-yard,
.penalty-spot,
.penalty-arc,
.goal,
.third {
  position: absolute;
  inset: 0;
}

.pitch-lines {
  display: none;
  pointer-events: none;
}

.soccer-field-base {
  width: 100%;
  height: 100%;
  z-index: 0;
}

.pitch-lines::before {
  content: "";
  position: absolute;
  inset: 5%;
  border: 3px solid rgba(255, 255, 255, 0.86);
}

.pitch-lines::after {
  content: "";
  position: absolute;
  top: 5%;
  bottom: 5%;
  left: 50%;
  border-left: 3px solid rgba(255, 255, 255, 0.78);
}

.field-board.half .pitch-lines::after,
.field-board.third-layout .pitch-lines::after {
  left: auto;
  right: 5%;
}

.center-circle {
  width: 18%;
  height: 31%;
  inset: 34.5% auto auto 41%;
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
}

.center-spot {
  width: 8px;
  height: 8px;
  left: calc(50% - 4px);
  top: calc(50% - 4px);
  background: rgba(255, 255, 255, 0.88);
  border-radius: 50%;
}

.field-board.half .center-circle,
.field-board.third-layout .center-circle {
  width: 36%;
  height: 28%;
  left: auto;
  right: -12%;
  top: 36%;
}

.field-board.half .center-spot,
.field-board.third-layout .center-spot {
  left: auto;
  right: calc(5% - 4px);
}

.penalty {
  width: 17%;
  height: 44%;
  top: 29%;
  border: 2px solid rgba(255, 255, 255, 0.75);
}

.penalty.left {
  left: 5%;
  border-left: 0;
}

.penalty.right {
  right: 5%;
  border-right: 0;
}

.six-yard {
  width: 6%;
  height: 22%;
  top: 39%;
  border: 2px solid rgba(255, 255, 255, 0.75);
}

.six-yard.left {
  left: 5%;
  border-left: 0;
}

.six-yard.right {
  right: 5%;
  border-right: 0;
}

.penalty-spot {
  width: 7px;
  height: 7px;
  top: calc(50% - 3.5px);
  background: rgba(255, 255, 255, 0.88);
  border-radius: 50%;
}

.penalty-spot.left {
  left: 16%;
}

.penalty-spot.right {
  right: 16%;
}

.penalty-arc {
  width: 10%;
  height: 22%;
  top: 39%;
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
}

.penalty-arc.left {
  left: 15%;
  border-left-color: transparent;
  border-top-color: transparent;
  border-bottom-color: transparent;
}

.penalty-arc.right {
  right: 15%;
  border-right-color: transparent;
  border-top-color: transparent;
  border-bottom-color: transparent;
}

.field-board.half .penalty.right,
.field-board.half .six-yard.right,
.field-board.half .penalty-spot.right,
.field-board.half .penalty-arc.right,
.field-board.half .goal.right,
.field-board.half .third,
.field-board.third-layout .penalty,
.field-board.third-layout .six-yard,
.field-board.third-layout .penalty-spot,
.field-board.third-layout .penalty-arc,
.field-board.third-layout .goal {
  display: none;
}

.goal {
  width: 3.5%;
  height: 18%;
  top: 41%;
  border: 2px solid rgba(255, 255, 255, 0.75);
  background: repeating-linear-gradient(0deg, rgba(255,255,255,0.22), rgba(255,255,255,0.22) 2px, transparent 2px, transparent 7px);
}

.goal.left {
  left: 1.5%;
}

.goal.right {
  right: 1.5%;
}

.third {
  top: 5%;
  bottom: 5%;
  width: 0;
  border-left: 2px dashed rgba(255, 255, 255, 0.5);
}

.third.one {
  left: 33.333%;
}

.third.two {
  left: 66.666%;
}

.field-board.half .third.one {
  display: block;
  left: 50%;
}

.field-board.third-layout .third.one,
.field-board.third-layout .third.two {
  display: block;
}

.field-board.third-layout .third.one {
  left: 5%;
}

.field-board.third-layout .third.two {
  left: 95%;
}

.diagram-lines {
  width: 100%;
  height: 100%;
  pointer-events: auto;
  z-index: 1;
}

.diagram-objects {
  z-index: 2;
}

.selection-box {
  position: absolute;
  z-index: 3;
  border: 1px dashed #f2b84b;
  background: rgba(242, 184, 75, 0.16);
  pointer-events: none;
}

.diagram-line {
  cursor: pointer;
  pointer-events: stroke;
}

.diagram-line-hit {
  cursor: grab;
  pointer-events: all;
}

.diagram-line.selected {
  filter: drop-shadow(0 0 3px #f2b84b);
}

.diagram-line-arrow {
  pointer-events: none;
}

.line-label {
  font-size: 3px;
  font-weight: 900;
  paint-order: stroke;
  stroke: rgba(17, 24, 39, 0.78);
  stroke-width: 0.35px;
  pointer-events: none;
}

.line-action-number text {
  fill: #111827;
  font-size: 2.6px;
  font-weight: 900;
  pointer-events: none;
}

.line-endpoint {
  fill: #f2b84b;
  stroke: #111827;
  stroke-width: 1.5px;
  vector-effect: non-scaling-stroke;
  cursor: grab;
  display: none;
  pointer-events: all;
}

.line-endpoint.visible {
  display: block;
}

.line-endpoint.curve-handle {
  fill: #38bdf8;
}

.line-endpoint.bend-handle {
  fill: #38bdf8;
}

.line-endpoint.bend-add-handle {
  fill: #ffffff;
  stroke: #2563eb;
  stroke-width: 1.5px;
  opacity: 0.86;
  cursor: copy;
}

.bend-tools {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.bend-tools button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 0.76rem;
}

.designer-properties-modal {
  max-height: min(72vh, 760px);
  overflow: auto;
  padding-right: 4px;
}

.diagram-object {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  user-select: none;
  touch-action: none;
  cursor: grab;
}

.field-board.pan-tool,
.field-board.pan-tool .diagram-object {
  cursor: grab;
}

.field-board.eraser-tool,
.field-board.eraser-tool .diagram-object {
  cursor: cell;
}

.diagram-object.selected {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.diagram-object.locked {
  cursor: not-allowed;
  opacity: 0.82;
}

.lock-badge {
  position: absolute;
  right: -18px;
  top: -18px;
  border: 1px solid #111827;
  border-radius: 999px;
  background: #f8fafc;
  color: #111827;
  font-size: 0.54rem;
  font-weight: 900;
  padding: 2px 4px;
}

.obj-player {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--red);
  color: white;
  border: 2px solid white;
  font-weight: 900;
  font-size: 0.82rem;
  display: grid;
  place-items: center;
}

.obj-home-player,
.obj-away-player,
.obj-neutral-player {
  border-radius: 50%;
}

.obj-home-player {
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  border-radius: 0;
  padding-top: 18%;
}

.obj-goalkeeper {
  border-radius: 50%;
}

.obj-coach {
  border-radius: 8px;
  outline: 2px solid white;
}

.obj-player-ball {
  border-radius: 50%;
}

.player-ball-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #111827 0 18%, transparent 19%),
    white;
  border: 2px solid #111827;
}

.obj-cone {
  width: 100%;
  height: 100%;
  position: relative;
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 0 18%, rgba(17, 24, 39, 0.18) 19% 22%, transparent 23%),
    radial-gradient(ellipse at 50% 24%, rgba(255, 255, 255, 0.9) 0 13%, transparent 14%),
    radial-gradient(ellipse at 50% 43%, rgba(255, 255, 255, 0.46) 0 24%, transparent 25%),
    radial-gradient(ellipse at 50% 62%, rgba(17, 24, 39, 0.14) 0 52%, transparent 54%),
    linear-gradient(155deg, #fff7d6 0%, #fbbf24 38%, #d97706 100%) !important;
  clip-path: none;
  box-shadow: inset 0 -4px 7px rgba(17, 24, 39, 0.2), 0 2px 3px rgba(17, 24, 39, 0.22);
  transform: perspective(42px) rotateX(52deg);
}

.obj-cone::before {
  content: "";
  position: absolute;
  left: 30%;
  right: 30%;
  top: 18%;
  height: 22%;
  border-radius: 50%;
  background: #f8fafc;
  box-shadow: inset 0 2px 4px rgba(17, 24, 39, 0.35), 0 0 0 2px rgba(245, 158, 11, 0.55);
}

.obj-cone::after {
  content: "";
  position: absolute;
  left: 16%;
  right: 16%;
  top: 42%;
  height: 1px;
  border-radius: 50%;
  background: rgba(146, 64, 14, 0.28);
  box-shadow: 0 5px 0 rgba(146, 64, 14, 0.18);
}

.obj-ball {
  width: 100%;
  height: 100%;
  position: relative;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #111827 0 17%, transparent 18%),
    radial-gradient(circle at 26% 28%, #111827 0 11%, transparent 12%),
    radial-gradient(circle at 74% 28%, #111827 0 11%, transparent 12%),
    radial-gradient(circle at 30% 76%, #111827 0 11%, transparent 12%),
    radial-gradient(circle at 72% 76%, #111827 0 11%, transparent 12%),
    linear-gradient(135deg, #ffffff 0%, #e5e7eb 100%) !important;
  border: 2px solid #111827;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.28);
}

.obj-ball::before {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  border: 1px solid rgba(17, 24, 39, 0.5);
  clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%);
}

.obj-ball::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background:
    linear-gradient(28deg, transparent 44%, rgba(17, 24, 39, 0.5) 45% 48%, transparent 49%),
    linear-gradient(152deg, transparent 44%, rgba(17, 24, 39, 0.5) 45% 48%, transparent 49%);
  pointer-events: none;
}

.obj-full-goal,
.obj-mini-goal,
.obj-popup-goal,
.obj-target-gate,
.obj-goal,
.obj-minigoal {
  width: 100%;
  height: 100%;
  position: relative;
  border: 4px solid var(--goal-frame, #ffffff);
  background:
    repeating-linear-gradient(90deg, var(--goal-net, rgba(255, 255, 255, 0.42)) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(0deg, var(--goal-net, rgba(255, 255, 255, 0.42)) 0 1px, transparent 1px 9px);
  box-shadow: inset 0 0 0 2px var(--goal-frame, #ffffff);
}

.obj-mini-goal,
.obj-minigoal {
  border-width: 3px;
}

.obj-full-goal::before,
.obj-mini-goal::before,
.obj-popup-goal::before,
.obj-goal::before,
.obj-minigoal::before {
  content: "";
  position: absolute;
  inset: 18% 12% 0;
  border: 2px solid var(--goal-frame, #ffffff);
  border-bottom: 0;
  pointer-events: none;
}

.obj-popup-goal {
  border-radius: 50% 50% 4px 4px;
}

.obj-target-gate {
  border-style: dashed;
}

.obj-mannequin {
  width: 100%;
  height: 100%;
  position: relative;
  background: transparent !important;
}

.obj-mannequin::before {
  content: "";
  position: absolute;
  left: 5%;
  right: 5%;
  top: 0;
  height: 58%;
  border-radius: 48% 48% 18% 18%;
  background:
    repeating-linear-gradient(25deg, transparent 0 8px, rgba(255,255,255,0.45) 9px 11px, transparent 12px 18px),
    linear-gradient(135deg, #fff36b 0%, var(--dummy-fill, #facc15) 48%, #d6a600 100%);
  clip-path: polygon(30% 0, 70% 0, 77% 22%, 100% 34%, 92% 100%, 62% 100%, 58% 72%, 42% 72%, 38% 100%, 8% 100%, 0 34%, 23% 22%);
  border: 2px solid #b58500;
}

.obj-mannequin::after {
  content: "";
  position: absolute;
  left: 38%;
  right: 38%;
  top: 3%;
  height: 16%;
  border-radius: 50%;
  background: var(--dummy-fill, #facc15);
  border: 2px solid #b58500;
}

.dummy-pole {
  position: absolute;
  left: calc(50% - 3px);
  top: 5%;
  bottom: 6%;
  width: 6px;
  border-radius: 999px;
  background: #111827;
  box-shadow: inset 1px 0 0 rgba(255,255,255,0.25);
  z-index: 3;
}

.dummy-strap {
  position: absolute;
  left: 22%;
  right: 22%;
  height: 7px;
  border-radius: 2px;
  background: #111827;
  z-index: 4;
}

.dummy-strap.top {
  top: 21%;
}

.dummy-strap.middle {
  top: 43%;
}

.dummy-strap.bottom {
  top: 59%;
}

.dummy-leg {
  position: absolute;
  top: 58%;
  bottom: 8%;
  width: 25%;
  border-radius: 4px;
  background: linear-gradient(90deg, #111827, #242a34 55%, #05070a);
  z-index: 2;
}

.dummy-leg.left {
  left: 11%;
}

.dummy-leg.right {
  right: 11%;
}

.dummy-base {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 0;
  height: 9%;
  border-radius: 3px;
  background:
    repeating-linear-gradient(90deg, transparent 0 10%, rgba(17,24,39,0.5) 10% 13%, transparent 13% 20%),
    var(--dummy-fill, #facc15);
  border: 2px solid #b58500;
  z-index: 5;
}

.obj-pole {
  width: 22%;
  height: 100%;
  background: #facc15;
  border: 1px solid white;
}

.obj-marker,
.obj-flat-marker {
  width: 100%;
  height: 68%;
  border-radius: 50%;
  background: #60a5fa;
  border: 1px solid white;
}

.obj-hurdle {
  width: 100%;
  height: 100%;
  border: 4px solid #f97316;
  border-top: 0;
  background: transparent;
}

.obj-agility-ladder {
  width: 100%;
  height: 100%;
  position: relative;
  border: 0;
  background: transparent !important;
}

.obj-agility-ladder::before,
.obj-agility-ladder::after {
  content: "";
  position: absolute;
  left: 2%;
  right: 2%;
  height: 5px;
  border-radius: 999px;
  background: #111827;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.36);
}

.obj-agility-ladder::before {
  top: 20%;
}

.obj-agility-ladder::after {
  bottom: 20%;
}

.obj-agility-ladder .ladder-rungs {
  position: absolute;
  inset: 10% 5%;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 12%,
    #f97316 12% 16%,
    transparent 16% 24%
  );
  clip-path: none;
  filter: drop-shadow(0 1px 0 rgba(17, 24, 39, 0.28));
}

.obj-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 5px solid #22c55e;
  background: transparent !important;
}

.obj-speed-gate {
  width: 100%;
  height: 100%;
  border-left: 5px solid #facc15;
  border-right: 5px solid #facc15;
  background: transparent !important;
}

.obj-zone,
.obj-rectangle-zone,
.obj-circle-zone,
.obj-channel-zone,
.obj-grid-box,
.obj-polygon-zone,
.obj-shaded-zone,
.obj-dashed-grid,
.obj-thirds-zone,
.obj-wide-channels,
.obj-central-channel,
.obj-end-zone,
.obj-target-zone {
  width: 100%;
  height: 100%;
  position: relative;
  display: grid;
  place-items: center;
  border: 2px var(--zone-border-style, solid) var(--zone-border, #111827);
  background: var(--zone-fill, rgba(37, 99, 235, 0.15));
  color: var(--zone-text, #ffffff);
  font-weight: 900;
  text-align: center;
}

.obj-circle-zone,
.obj-target-zone {
  border-radius: 50%;
}

.zone-label {
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(17, 24, 39, 0.55);
  color: white;
  font-size: 0.78rem;
  line-height: 1;
}

.obj-grid-box,
.obj-dashed-grid {
  background:
    linear-gradient(rgba(248,250,252,0.4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(248,250,252,0.4) 1px, transparent 1px),
    var(--zone-fill, rgba(14, 165, 233, 0.16)) !important;
  background-size: 25% 25%;
}

.obj-polygon-zone {
  clip-path: polygon(12% 18%, 88% 7%, 100% 74%, 46% 100%, 0 68%);
}

.obj-thirds-zone {
  background:
    linear-gradient(90deg, transparent 0 32%, var(--zone-border, #111827) 32% 34%, transparent 34% 66%, var(--zone-border, #111827) 66% 68%, transparent 68%),
    var(--zone-fill, rgba(248, 250, 252, 0.08)) !important;
}

.obj-wide-channels {
  background:
    linear-gradient(90deg, var(--zone-fill, rgba(250, 204, 21, 0.18)) 0 24%, transparent 24% 76%, var(--zone-fill, rgba(250, 204, 21, 0.18)) 76% 100%) !important;
}

.obj-central-channel {
  background:
    linear-gradient(90deg, transparent 0 22%, var(--zone-fill, rgba(34, 197, 94, 0.2)) 22% 78%, transparent 78%) !important;
}

.obj-end-zone {
  border-style: dashed;
}

.obj-target-zone::before {
  content: "";
  width: 46%;
  height: 46%;
  border-radius: 50%;
  border: 2px solid var(--zone-border, #111827);
  position: absolute;
}

.obj-text {
  width: 100%;
  height: 100%;
  color: white;
  background: rgba(17, 24, 39, 0.72);
  border-radius: 6px;
  padding: 5px 8px;
  font-weight: 800;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
}

.obj-number-marker {
  border-radius: 50%;
  border: 2px solid #111827;
}

.obj-callout {
  border: 2px solid #111827;
  border-radius: 8px;
}

.object-caption {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.72);
  color: white;
  border-radius: 5px;
  padding: 2px 5px;
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}

.resize-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--gold);
  border: 1px solid #111827;
  border-radius: 2px;
  z-index: 3;
}

.rotate-handle {
  position: absolute;
  left: 50%;
  top: -34px;
  width: 14px;
  height: 14px;
  transform: translateX(-50%);
  border: 2px solid #111827;
  border-radius: 50%;
  background: var(--gold);
  cursor: grab;
  z-index: 4;
}

.rotate-handle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: 18px;
  transform: translateX(-50%);
  background: #111827;
}

.rotate-handle::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(17, 24, 39, 0.45);
  border-left-color: transparent;
  border-radius: 50%;
}

.resize-handle.nw {
  left: -7px;
  top: -7px;
  cursor: nwse-resize;
}

.resize-handle.ne {
  right: -7px;
  top: -7px;
  cursor: nesw-resize;
}

.resize-handle.sw {
  left: -7px;
  bottom: -7px;
  cursor: nesw-resize;
}

.resize-handle.se {
  right: -7px;
  bottom: -7px;
  cursor: nwse-resize;
}

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

.activity-modal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.activity-picker-panel {
  display: grid;
  gap: 12px;
}

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

.drill-pick-list {
  display: grid;
  gap: 10px;
  max-height: 460px;
  overflow: auto;
  padding-right: 4px;
}

.drill-pick-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.session-wizard {
  display: grid;
  gap: 16px;
}

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

.wizard-step {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--muted);
  background: #f8fafc;
  text-align: center;
}

.wizard-step.active {
  color: #b91c1c;
  border-color: #ef4444;
  background: #fff1f2;
}

.wizard-panel {
  display: none;
}

.wizard-panel.active {
  display: grid;
  gap: 12px;
}

.wizard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

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

.wizard-summary article,
.wizard-flow-block,
.wizard-drill-option {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.wizard-summary article {
  padding: 12px;
}

.wizard-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 4px;
}

.wizard-block-list,
.wizard-extra-drills {
  display: grid;
  gap: 10px;
}

.wizard-flow-block,
.wizard-drill-option {
  display: grid;
  grid-template-columns: auto 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
}

.wizard-flow-block {
  grid-template-columns: 42px minmax(0, 1fr);
}

.activity-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.order-handle {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: #eef2f5;
  border-radius: 8px;
  font-weight: 900;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 18, 26, 0.5);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 10;
}

.modal {
  width: min(820px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 18px;
  box-shadow: var(--shadow);
}

.print-sheet {
  display: none;
}

.print-header,
.print-meta-grid,
.print-drill-layout,
.print-section-heading,
.print-brand {
  display: grid;
}

.print-header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.print-brand {
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.print-brand img,
.print-brand span {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.print-brand small,
.print-generated,
.print-kicker,
.print-meta-grid span {
  color: var(--muted);
}

.print-cover h1 {
  margin: 6px 0 16px;
  font-size: 2rem;
}

.print-meta-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 18px;
}

.print-meta-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.print-meta-grid span {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.print-info {
  margin: 12px 0;
}

.print-info h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.print-info p {
  margin: 0;
  line-height: 1.45;
}

.print-table {
  width: 100%;
  border-collapse: collapse;
}

.print-table th,
.print-table td {
  border: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.print-drill-page {
  break-before: page;
  page-break-before: always;
  padding-top: 8px;
}

.print-section-heading {
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.print-number {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: white;
  font-weight: 900;
}

.print-section-heading h2 {
  margin: 0;
}

.print-drill-layout {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.print-diagram {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.print-field-board {
  min-height: 0;
  box-shadow: none;
}

.print-field-board .resize-handle,
.print-field-board .rotate-handle,
.print-field-board .lock-badge {
  display: none;
}

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

  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(300px, 86vw);
    z-index: 30;
    box-shadow: var(--shadow);
    transform: translateX(0);
  }

  .app-shell.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
  }

  .app-shell.sidebar-collapsed .brand-text,
  .app-shell.sidebar-collapsed .nav-label,
  .app-shell.sidebar-collapsed .account-panel span,
  .app-shell.sidebar-collapsed .account-panel strong,
  .app-shell.sidebar-collapsed #loginButton {
    display: initial;
  }

  .app-shell.sidebar-collapsed .sidebar {
    align-items: stretch;
  }

  .mobile-menu-button {
    display: inline-flex;
  }

  .topbar {
    align-items: flex-start;
  }

  .designer-layout,
  .designer-toolbar,
  .activity-modal-layout,
  .grid.two,
  .grid.three,
  .dashboard-actions,
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 15px;
  }

  .view {
    padding: 14px 12px 28px;
  }

  .topbar {
    padding: 12px;
    gap: 10px;
  }

  .topbar h1 {
    font-size: 1.2rem;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions .secondary-button,
  .topbar-actions .ghost-button {
    flex: 1 1 120px;
    min-height: 34px;
    padding: 7px 10px;
    font-size: 0.82rem;
  }

  #saveAllButton {
    display: none;
  }

  .surface {
    padding: 14px;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

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

  .mobile-session-reader,
  .mobile-session-hero,
  .mobile-activity-card {
    display: grid;
    gap: 14px;
  }

  .mobile-reader-toolbar {
    align-items: flex-start;
  }

  .mobile-reader-toolbar .secondary-button {
    width: 100%;
  }

  .mobile-session-picker {
    margin-top: 0;
  }

  .mobile-session-hero h2,
  .mobile-activity-card h2 {
    margin: 0;
  }

  .mobile-session-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .mobile-session-facts div,
  .mobile-session-notes article {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    padding: 9px;
  }

  .mobile-session-facts span {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .mobile-session-facts strong {
    display: block;
    margin-top: 3px;
    font-size: 0.9rem;
  }

  .mobile-session-notes {
    display: grid;
    gap: 10px;
  }

  .mobile-session-notes h3 {
    margin: 0 0 4px;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .mobile-session-notes p {
    margin: 0;
    line-height: 1.45;
  }

  .mobile-activity-stack {
    display: grid;
    gap: 14px;
    margin-top: 14px;
  }

  .mobile-activity-heading {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  .mobile-activity-card .print-diagram {
    padding: 6px;
    overflow: hidden;
  }

  .mobile-activity-card .print-field-board {
    min-height: 0;
    width: 100%;
  }

  .mobile-activity-card .print-field-board.vertical {
    max-width: min(100%, 340px);
    margin: 0 auto;
  }

  .designer-layout {
    display: block;
  }
}

@media print {
  @page {
    margin: 0.45in;
  }

  .sidebar,
  .topbar,
  .view > :not(.print-sheet) {
    display: none !important;
  }

  .app-shell,
  .workspace {
    display: block;
  }

  .view {
    padding: 0;
  }

  .print-sheet {
    display: block;
    background: white;
    color: black;
    padding: 0;
    font-size: 10.5pt;
  }

  .print-cover {
    break-after: auto;
  }

  .print-cover.compact {
    margin-bottom: 12px;
  }

  .print-drill-layout {
    grid-template-columns: 58% 1fr;
  }

  .print-diagram,
  .print-meta-grid div {
    break-inside: avoid;
  }

  .print-info {
    break-inside: avoid;
  }

  .print-field-board {
    width: 100%;
  }

  .diagram-object.selected {
    outline: 0;
  }
}
