:root {
  --bg: #f2f2f6;
  --panel: #ffffff;
  --panel-muted: #f7f7fa;
  --line: #d9dce3;
  --text: #172432;
  --muted: #5b6f84;
  --blue: #0188fe;
  --blue-soft: #d8efff;
  --green: #2c9b58;
  --green-soft: #e0f4e5;
  --orange: #db8a24;
  --orange-soft: #fff0dc;
  --shadow: 0 8px 24px rgba(29, 29, 31, 0.06);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-width: 360px;
  --page-glow: rgba(255, 255, 255, 0);
  --page-top: #f2f2f6;
  --page-bottom: #f2f2f6;
  --sidebar-bg: rgba(246, 246, 250, 0.92);
  --section-bg: rgba(255, 255, 255, 0.78);
  --panel-strong: #ffffff;
  --header-sticky-top: rgba(248, 248, 251, 0.98);
  --header-sticky-bottom: rgba(243, 243, 247, 0.94);
  --active-strip: #0188fe;
  --item-completed-bg: #edf8f1;
  --item-skipped-bg: #fff4e6;
  --item-active-bg: #eef6ff;
  --item-not-required-bg: #e8edf2;
  --modal-panel: #ffffff;
  color-scheme: light dark;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top right, var(--page-glow), transparent 30%),
    linear-gradient(180deg, var(--page-top) 0%, var(--page-bottom) 100%);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
}

button,
input,
textarea {
  font: inherit;
}

button,
[data-action],
.item-card,
.sidebar-row,
.section-toggle {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(1, 136, 254, 0.12);
}

a {
  color: inherit;
}

.boot-screen,
.fatal-error {
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 16px;
  text-align: center;
  padding: 32px;
}

.boot-icon {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(300px, var(--sidebar-width)) 1fr;
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid rgba(22, 33, 43, 0.08);
  background: var(--sidebar-bg);
  backdrop-filter: blur(10px);
  padding: 20px 18px 28px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.detail-pane {
  padding: 26px;
}

.sidebar-header,
.detail-header,
.notes-panel,
.gnss-panel,
.result-card,
.landing-panel,
.pilot-image-card,
.log-entry,
.log-group,
.empty-state,
.pilot-card,
.item-card,
.mobile-backline {
  background: var(--panel);
  border: 1px solid rgba(22, 33, 43, 0.08);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.sidebar-header {
  padding: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.sidebar-actions,
.detail-actions,
.detail-header-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.sidebar-nav {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.search-field,
.input-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.search-field {
  margin-top: 18px;
}

.search-field input,
.input-field input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-muted);
  padding: 14px 16px;
  color: var(--text);
}

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

.section-toggle,
.sidebar-row,
.item-main-button,
.ghost-button,
.primary-button,
.danger-button,
.row-reset-button,
.status-menu-button,
.status-menu-toggle,
.segmented-control button,
.image-button,
.modal-close {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}

.sidebar-section {
  background: var(--section-bg);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(22, 33, 43, 0.08);
  overflow: hidden;
}

.section-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
  font-weight: 700;
}

.section-content {
  padding: 0 10px 10px;
  display: grid;
  gap: 8px;
}

.sidebar-row-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.sidebar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid transparent;
}

.sidebar-row.is-active {
  border-color: rgba(1, 136, 254, 0.26);
  background: var(--blue-soft);
}

.sidebar-copy {
  display: grid;
  gap: 3px;
}

.sidebar-copy small,
.detail-subtitle,
.item-hint,
.detail-hints,
.image-caption,
.log-entry span,
.empty-state p,
.map-note,
.form-error {
  color: var(--muted);
}

.progress-orb,
.sidebar-symbol {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  background: var(--blue-soft);
  flex: 0 0 auto;
}

.progress-orb::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
}

.row-reset-button {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--panel-strong);
  border: 1px solid rgba(22, 33, 43, 0.08);
}

.detail-view {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.detail-view > .detail-header {
  position: sticky;
  top: 18px;
  z-index: 8;
  background:
    linear-gradient(180deg, var(--header-sticky-top) 0%, var(--header-sticky-bottom) 100%);
  backdrop-filter: blur(18px);
}

.detail-header,
.notes-panel,
.gnss-panel,
.landing-panel,
.empty-state,
.log-group {
  padding: 18px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
  color: var(--blue);
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.status-pill {
  background: var(--panel-muted);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.1;
}

.status-pill--summary {
  background: #d8efff;
  color: #016dc9;
}

.status-pill--success {
  background: #d8f0df;
  color: #1f7a44;
}

.status-pill--warning {
  background: #ffe7c9;
  color: #b96d0d;
}

.status-pill--active {
  background: #d8efff;
  color: #0188fe;
}

.progress-bar {
  display: flex;
  gap: 4px;
  margin-top: 10px;
}

.progress-segment {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: #cfd8e4;
}

.progress-segment--completed {
  background: var(--green);
}

.progress-segment--skipped {
  background: var(--orange);
}

.progress-segment--not_required {
  background: #b8c0cc;
}

.checklist-items {
  display: grid;
  gap: 8px;
}

.item-card {
  padding: 8px;
  position: relative;
  overflow: visible;
  z-index: 1;
  cursor: pointer;
}

.item-card.has-open-menu {
  z-index: 30;
}

.item-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 999px;
  opacity: 0;
  background: var(--active-strip);
}

.item-card.is-focused::before,
.item-card--skipped::before {
  opacity: 1;
}

.item-card--completed {
  background: var(--item-completed-bg);
}

.item-card--skipped {
  background: var(--item-skipped-bg);
}

.item-card--open.is-focused {
  background: var(--item-active-bg);
}

.item-card--not_required {
  background: var(--item-not-required-bg);
}

.item-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.item-main-button {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  text-align: left;
  align-items: start;
  pointer-events: none;
}

.item-status-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--panel-muted);
  font-weight: 800;
  font-size: 0.95rem;
}

.item-status-icon-button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
  pointer-events: auto;
  cursor: pointer;
  flex-shrink: 0;
}

.item-card--completed .item-status-icon,
.item-card--completed .item-status-icon-button {
  background: #2d9957;
  color: white;
}

.item-card--skipped .item-status-icon,
.item-card--skipped .item-status-icon-button {
  background: #d67f16;
  color: white;
}

.item-card.is-focused .item-status-icon,
.item-card.is-focused .item-status-icon-button {
  background: #0188fe;
  color: white;
}

.item-card--not_required .item-status-icon,
.item-card--not_required .item-status-icon-button {
  background: #c8d1da;
  color: #556476;
}

.item-copy {
  display: grid;
  gap: 2px;
  padding-top: 1px;
}

.item-question {
  font-weight: 650;
  line-height: 1.18;
  font-size: 0.97rem;
}

.item-question-prefix {
  color: #d64040;
  font-weight: 800;
}

.item-card--not_required .item-question,
.item-card--not_required .item-hint {
  color: #6b7886;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(85, 100, 118, 0.75);
}

.expected-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border-radius: 12px;
  padding: 0 10px;
  font-size: 0.97rem;
  font-weight: 650;
  line-height: 1.1;
  max-width: 180px;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.item-check-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.item-actions {
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 0;
}

.item-state-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border-radius: 12px;
  min-width: 44px;
  padding: 0 8px;
  text-align: center;
}

.item-state-symbol {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.status-surface--open {
  background: #d8efff;
  color: #0188fe;
}

.status-surface--completed {
  background: #cfead8;
  color: #1e7a43;
}

.status-surface--skipped {
  background: #ffd79a;
  color: #c46c00;
}

.status-surface--not_required {
  background: #d7dde4;
  color: #5a6878;
}

.status-menu-wrap {
  display: flex;
  justify-content: flex-start;
  position: relative;
  z-index: 12;
  pointer-events: auto;
  margin-top: 6px;
}

.status-menu-toggle,
.ghost-button,
.primary-button,
.danger-button {
  padding: 9px 12px;
  border-radius: 14px;
  font-weight: 700;
}

.status-menu-toggle,
.ghost-button {
  background: var(--panel-muted);
}

.status-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 8px;
  border-radius: 12px;
  font-size: 0.97rem;
  font-weight: 650;
  line-height: 1.1;
  min-width: 44px;
  text-align: center;
  margin-right: 0;
}

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

.primary-button--small {
  padding: 9px 12px;
  font-size: 0.9rem;
}

.danger-button {
  background: #8a2a2a;
  color: white;
}

.status-menu {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 15;
  min-width: 260px;
  padding: 8px;
  background: var(--panel);
  border: 1px solid rgba(22, 33, 43, 0.08);
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 6px;
}

.status-menu-button {
  text-align: left;
  padding: 9px 10px;
  border-radius: 12px;
  background: var(--panel-muted);
}

.detail-hints {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.85rem;
}

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

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

.form-grid--utm-top {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.form-grid--utm-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 14px;
  margin-top: 14px;
  align-items: end;
}

.form-grid--longtext {
  grid-template-columns: 1fr auto;
  align-items: end;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.form-grid--longtext .primary-button--small {
  white-space: nowrap;
}

.gnss-convert-button {
  margin-top: 18px;
}

.segmented-control {
  display: inline-flex;
  gap: 8px;
  padding: 8px;
  border-radius: 18px;
  background: var(--panel-muted);
  flex-wrap: wrap;
}

.segmented-control button {
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
}

.segmented-control button.is-active {
  background: var(--panel-strong);
  box-shadow: 0 6px 18px rgba(22, 33, 43, 0.08);
}

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

.result-card {
  padding: 18px;
}

.result-card p {
  margin-top: 10px;
  font-weight: 700;
}

.map-frame {
  height: 360px;
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 16px;
  border: 1px solid rgba(22, 33, 43, 0.08);
  cursor: crosshair;
}

.pilot-blocks {
  display: grid;
  gap: 14px;
}

.pilot-card {
  padding: 16px;
  line-height: 1.5;
  background: rgba(1, 136, 254, 0.08);
}

.pilot-card--blue {
  background: rgba(1, 136, 254, 0.14);
}

.pilot-card--orange {
  background: rgba(219, 138, 36, 0.15);
}

.pilot-card--green {
  background: rgba(44, 155, 88, 0.12);
}

.pilot-card--category {
  background: var(--panel-muted);
  border: 1px solid var(--line);
}

.pilot-card__category-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.pilot-list--inline {
  margin: 0;
  padding-left: 20px;
}

.pilot-list--inline li + li {
  margin-top: 6px;
}

.two-column-block {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 12px;
}

.two-column-block > .pilot-card {
  min-width: 0;
}

.two-column-block--compact {
  grid-template-columns: 1fr 78px;
}

.two-column-block--balanced {
  grid-template-columns: minmax(0, 1fr) minmax(132px, 0.95fr);
}

.two-column-block--scenario {
  grid-template-columns: 88px minmax(0, 1fr);
}

.two-column-block--funkstatus {
  grid-template-columns: 64px minmax(0, 1fr);
}

.pilot-card--count {
  text-align: center;
  font-weight: 800;
}

.two-column-block--scenario > .pilot-card:first-child {
  display: grid;
  place-items: center;
  font-weight: 800;
}

.two-column-block--funkstatus > .pilot-card:first-child {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.8rem;
}

.pilot-card--status-primary {
  min-height: 100%;
}

.pilot-status-code {
  font-size: 1.55rem;
  line-height: 1;
  font-weight: 900;
  flex: 0 0 auto;
}

.pilot-status-title {
  font-weight: 800;
  line-height: 1.2;
}

.pilot-table-wrap {
  overflow: auto;
  border-radius: var(--radius);
}

.template-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.template-actions a {
  text-decoration: none;
}

.pilot-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: var(--radius);
}

.pilot-table th,
.pilot-table td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border: 1px solid rgba(1, 136, 254, 0.16);
  background: rgba(1, 136, 254, 0.08);
}

.pilot-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(1, 136, 254, 0.22);
}

.pilot-table__header-cell {
  font-weight: 700;
  position: sticky;
  left: 0;
  z-index: 1;
  background: rgba(1, 136, 254, 0.14);
}

/* Corner cell: sticky both directions */
.pilot-table thead tr th:first-child {
  left: 0;
  z-index: 2;
}

.pilot-list {
  margin: 0;
  padding-left: 24px;
}

.pilot-list li + li {
  margin-top: 10px;
}

.pilot-code {
  white-space: pre-wrap;
  font-family: "SF Mono", "Courier New", monospace;
}

.pilot-image-card img,
.image-modal img {
  width: 100%;
  display: block;
  border-radius: 18px;
}

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

.inline-link {
  color: var(--blue);
  font-weight: 700;
}

.pilot-hero-symbol {
  font-size: 4rem;
  text-align: center;
  padding: 28px;
}

.detail-actions--top {
  margin-bottom: 18px;
}

.logbook-groups {
  display: grid;
  gap: 16px;
}

.log-group h3 {
  margin-bottom: 14px;
}

.log-entry {
  padding: 16px;
  display: grid;
  gap: 5px;
  margin-top: 10px;
}

.log-entry-meta {
  font-size: 0.8rem;
  opacity: 0.6;
}

.gnss-log-map {
  width: 256px;
  height: 256px;
  border-radius: var(--radius);
  margin-top: 6px;
  border: 1px solid var(--line);
  object-fit: cover;
}

.empty-state {
  text-align: center;
}

.empty-state--large {
  padding: 48px 24px;
}

.landing-panel {
  padding: 36px;
  text-align: center;
  max-width: 720px;
}

.landing-badge {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 800;
  margin-bottom: 14px;
}

.mobile-backline {
  padding: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: rgba(22, 33, 43, 0.94);
  color: white;
  padding: 12px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  z-index: 40;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 24, 0.82);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 50;
}

.image-modal {
  max-width: min(1000px, 100%);
  width: 100%;
  background: var(--modal-panel);
  border-radius: 26px;
  padding: 18px;
  position: relative;
}

.image-modal--confirm {
  max-width: min(520px, 100%);
  display: grid;
  gap: 14px;
}

.detail-actions--confirm {
  justify-content: flex-end;
}

.detail-view--embedded > .detail-header {
  position: static;
}

.embedded-page-card {
  background: var(--panel);
  border: 1px solid rgba(22, 33, 43, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.embedded-page-frame {
  width: 100%;
  min-height: 960px;
  border: 0;
  display: block;
  background: transparent;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1722;
    --panel: #151f2b;
    --panel-muted: #1b2735;
    --line: #2a394a;
    --text: #edf3f9;
    --muted: #a6b4c4;
    --blue: #6da7e2;
    --blue-soft: #223a53;
    --green: #4eb672;
    --green-soft: #1d3826;
    --orange: #e49c45;
    --orange-soft: #46311b;
    --shadow: 0 22px 50px rgba(0, 0, 0, 0.35);
    --page-glow: rgba(57, 119, 184, 0.18);
    --page-top: #0b121a;
    --page-bottom: #101a25;
    --sidebar-bg: rgba(16, 24, 34, 0.86);
    --section-bg: rgba(21, 31, 43, 0.78);
    --panel-strong: #1a2532;
    --header-sticky-top: rgba(18, 26, 36, 0.98);
    --header-sticky-bottom: rgba(18, 26, 36, 0.94);
    --active-strip: #78aee5;
    --item-completed-bg: #1a2b22;
    --item-skipped-bg: #312417;
    --item-active-bg: #18283a;
    --item-not-required-bg: #253242;
    --modal-panel: #121b26;
  }

  .sidebar,
  .sidebar-section,
  .sidebar-header,
  .detail-header,
  .notes-panel,
  .gnss-panel,
  .result-card,
  .landing-panel,
  .pilot-image-card,
  .log-entry,
  .log-group,
  .empty-state,
  .pilot-card,
  .item-card,
  .mobile-backline,
  .status-menu,
  .image-modal {
    border-color: rgba(160, 188, 214, 0.12);
  }

  .sidebar-row.is-active {
    border-color: rgba(109, 167, 226, 0.32);
  }

  .progress-orb::after {
    background: var(--panel);
  }

  .status-pill--summary {
    background: #223244;
    color: #ebf2fa;
  }

  .status-pill--success {
    background: #1d3826;
    color: #9fe0b3;
  }

  .status-pill--warning {
    background: #49321b;
    color: #f4c287;
  }

  .status-pill--active {
    background: #223a53;
    color: #b8d7f7;
  }

  .progress-segment {
    background: #324354;
  }

  .item-status-icon,
  .row-reset-button,
  .segmented-control,
  .ghost-button,
  .status-menu-button,
  .status-menu-toggle {
    background: var(--panel-muted);
  }

  .expected-badge {
    background: #223a53;
    color: #b8d7f7;
  }

  .item-card--not_required .item-status-icon {
    background: #344352;
    color: #aab6c3;
  }

  .item-card--not_required .item-question,
  .item-card--not_required .item-hint,
  .item-card--not_required .item-meta {
    color: #92a0ae;
    text-decoration-color: rgba(170, 182, 195, 0.7);
  }

  .item-card--not_required .expected-badge,
  .item-card--not_required .status-menu-toggle {
    background: #334252;
    color: #aebbc8;
  }

  .pilot-table th,
  .pilot-table td,
  .pilot-table__header-cell {
    border-color: rgba(109, 167, 226, 0.18);
    background: rgba(34, 58, 83, 0.48);
  }

  .segmented-control button.is-active {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.24);
  }
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(22, 33, 43, 0.9);
  color: white;
}

.image-modal-copy {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

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

  .app-shell--mobile-detail .detail-pane {
    padding: 10px;
  }

  .sidebar {
    position: static;
    height: auto;
    min-height: 100vh;
  }

  .sidebar.is-hidden {
    display: none;
  }

  .detail-pane {
    padding: 10px;
  }

  .detail-view > .detail-header {
    top: 0;
  }

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

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

  .form-grid--utm-bottom {
    grid-template-columns: 1fr 1fr auto;
  }

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

  .two-column-block {
    grid-template-columns: minmax(0, 1fr) minmax(138px, 0.92fr);
    gap: 10px;
    align-items: stretch;
  }

  .two-column-block--compact {
    grid-template-columns: minmax(0, 1fr) 72px;
    gap: 10px;
    align-items: stretch;
  }

  .two-column-block--balanced {
    grid-template-columns: minmax(0, 1fr) minmax(138px, 0.92fr);
    gap: 10px;
    align-items: stretch;
  }

  .two-column-block--scenario {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .two-column-block--funkstatus {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .item-layout {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
  }

  .item-footer {
    margin-top: 1px;
  }

  .image-modal-copy,
  .sidebar-header,
  .detail-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-header,
  .notes-panel {
    padding: 12px;
  }

  .detail-header-meta {
    gap: 6px;
    align-items: center;
  }

  .detail-view {
    gap: 8px;
  }

  .mobile-backline {
    padding: 4px;
  }

  .mobile-backline .ghost-button {
    padding: 8px 12px;
    border-radius: 11px;
    font-size: 0.95rem;
  }

  .detail-header h2 {
    font-size: clamp(1.65rem, 6vw, 2.25rem);
    line-height: 1.08;
  }

  .status-pill {
    padding: 5px 9px;
    font-size: 0.78rem;
  }

  .progress-bar {
    margin-top: 6px;
  }

  .eyebrow {
    font-size: 0.74rem;
    letter-spacing: 0.1em;
  }

  .item-card {
    padding: 6px 6px 5px;
    border-radius: 18px;
  }

  .item-card::before {
    top: 8px;
    bottom: 8px;
    width: 3px;
  }

  .item-main-button {
    gap: 8px;
  }

  .item-status-icon {
    width: 27px;
    height: 27px;
    font-size: 0.92rem;
  }

  .item-copy {
    gap: 1px;
  }

  .item-question {
    font-size: 0.97rem;
    line-height: 1.14;
  }

  .item-hint {
    font-size: 0.85rem;
    line-height: 1.2;
  }

  .item-actions {
    gap: 0;
  }

  .expected-badge {
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.97rem;
    max-width: 118px;
    border-radius: 12px;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
    line-height: 1.05;
  }

  .status-menu-toggle {
    min-height: 36px;
    padding: 0 8px;
    font-size: 0.97rem;
    border-radius: 12px;
    min-width: 46px;
    margin-right: 0;
  }

  .item-state-pill {
    min-height: 36px;
    min-width: 46px;
    padding: 0 8px;
  }

  .status-menu-wrap {
    margin-top: 4px;
  }

  .status-menu {
    min-width: 220px;
  }

  .status-menu-button {
    padding: 10px 11px;
    font-size: 0.9rem;
  }
}

.update-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--thw-blue, #003c8f);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
}
.update-banner button {
  padding: 6px 16px;
  border: none;
  border-radius: 8px;
  background: #fff;
  color: var(--thw-blue, #003c8f);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
