:root {
  color-scheme: dark;
  --font-display: "General Sans", "Inter", sans-serif;
  --font-body: "Satoshi", "Inter", sans-serif;
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
  --bg: #11161a;
  --surface: #171f24;
  --surface-2: #1d272d;
  --surface-3: #253139;
  --border: rgba(180, 207, 215, 0.16);
  --text: #e7eff1;
  --muted: #9daeb4;
  --faint: #65767d;
  --accent: #5ec7d3;
  --accent-strong: #a9edf0;
  --warning: #f3aa4e;
  --danger: #e06c75;
  --success: #7fc978;
  --ice-a: #9edee9;
  --ice-b: #e3fbff;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.26);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #eef5f7;
  --surface: #f8fbfb;
  --surface-2: #ffffff;
  --surface-3: #e7f0f3;
  --border: rgba(27, 63, 74, 0.16);
  --text: #152328;
  --muted: #5f7279;
  --faint: #879aa1;
  --accent: #036f7a;
  --accent-strong: #0d4f58;
  --warning: #a85e13;
  --danger: #aa3f4b;
  --success: #3d7b34;
  --ice-a: #b6edf3;
  --ice-b: #f4fdff;
  --shadow: 0 24px 60px rgba(34, 62, 73, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 16% 6%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 32rem),
    linear-gradient(140deg, var(--bg), color-mix(in srgb, var(--bg) 90%, #29434b));
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.55;
}

button,
input {
  font: inherit;
}

a {
  color: var(--accent-strong);
}

.skip-link {
  position: fixed;
  inset: var(--space-3) auto auto var(--space-3);
  z-index: 20;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #071114;
  transform: translateY(-140%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  width: min(1480px, calc(100% - var(--space-8)));
  margin: 0 auto;
  padding: var(--space-6) 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.brand-mark {
  width: 44px;
  height: 44px;
  color: var(--accent);
  flex: 0 0 auto;
}

.brand-mark path {
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

h1,
h2 {
  font-family: var(--font-display);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

h1 {
  font-size: var(--text-xl);
  font-weight: 700;
}

h2 {
  font-size: var(--text-lg);
  font-weight: 650;
}

.eyebrow {
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.theme-toggle,
.mode-toggle {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  color: var(--text);
  cursor: pointer;
}

.theme-toggle:hover,
.mode-toggle:hover,
.mode-toggle[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}

.mode-toggle[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.mode-icon {
  color: var(--accent);
  font-size: 0.72rem;
}

.demo-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) auto auto;
  gap: var(--space-5);
  align-items: center;
  margin-bottom: var(--space-4);
  padding: var(--space-5);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), transparent 58%),
    color-mix(in srgb, var(--surface) 94%, transparent);
}

.demo-copy {
  display: grid;
  gap: var(--space-2);
}

.demo-copy h2 {
  max-width: 56rem;
  font-size: clamp(1.35rem, 1.1rem + 1vw, 2rem);
}

.demo-copy p:last-child {
  max-width: 58rem;
  color: var(--muted);
  font-size: var(--text-sm);
}

.demo-steps {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  gap: var(--space-2);
}

.demo-steps span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  white-space: nowrap;
}

.demo-steps strong {
  display: grid;
  width: 1.35rem;
  height: 1.35rem;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #071114;
  font-size: 0.78rem;
  line-height: 1;
}

.demo-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dashboard {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr) minmax(320px, 0.8fr);
  grid-template-rows: auto auto auto;
  gap: var(--space-4);
  align-items: stretch;
}

section {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
}

.control-panel {
  grid-row: 1 / span 3;
  padding: var(--space-5);
}

.summary-panel,
.decision-panel,
.stick-panel,
.stick-trouble-panel,
.visual-panel,
.parent-panel,
.symptom-panel,
.history-panel,
.starter-panel,
.share-panel,
.feedback-panel,
.chart-panel,
.explainer-panel {
  padding: var(--space-5);
}

.summary-panel {
  grid-column: 2 / 4;
}

.decision-panel {
  grid-column: 2 / 4;
}

.stick-panel {
  display: none;
  grid-column: 2 / 4;
}

.stick-trouble-panel {
  display: none;
  grid-column: 2;
}

.visual-panel {
  grid-column: 2;
}

.parent-panel {
  grid-column: 3;
}

.symptom-panel {
  grid-column: 2;
}

.history-panel {
  grid-column: 2 / 4;
}

.starter-panel {
  grid-column: 3;
}

.share-panel {
  grid-column: 2 / 4;
}

.feedback-panel {
  grid-column: 2 / 4;
}

.tradeoff,
.friction {
  min-height: 315px;
}

.explainer-panel {
  grid-column: 2 / 4;
}

.parent-mode .visual-panel,
.parent-mode .tradeoff,
.parent-mode .friction {
  display: none;
}

.parent-mode .parent-panel {
  grid-column: 2 / 4;
}

.parent-mode .decision-panel {
  grid-column: 2 / 4;
}

.stick-mode .summary-panel,
.stick-mode .decision-panel,
.stick-mode .visual-panel,
.stick-mode .parent-panel,
.stick-mode .symptom-panel,
.stick-mode .starter-panel,
.stick-mode .tradeoff,
.stick-mode .friction {
  display: none;
}

.stick-mode .stick-panel,
.stick-mode .stick-trouble-panel {
  display: block;
}

.stick-mode .history-panel {
  display: block;
  grid-column: 3;
}

.parent-mode .symptom-panel {
  grid-column: 2;
}

.parent-mode .history-panel {
  grid-column: 2 / 4;
}

.parent-mode .starter-panel {
  grid-column: 3;
}

.parent-mode .share-panel {
  grid-column: 2 / 4;
}

.parent-mode .feedback-panel {
  grid-column: 2 / 4;
}

.parent-mode.stick-mode .history-panel {
  grid-column: 3;
}

.panel-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-5);
}

.panel-header.compact {
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.controls {
  display: grid;
  gap: var(--space-5);
}

.gear-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  padding: var(--space-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface-2);
}

.gear-tab {
  min-height: 44px;
  border-radius: var(--radius-full);
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.gear-tab:hover,
.gear-tab.is-active {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--text);
}

.gear-tab.is-active {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent);
}

.gear-pane {
  display: grid;
  gap: var(--space-5);
}

.gear-pane[hidden] {
  display: none;
}

.profile-fieldset,
.preset-fieldset {
  display: grid;
  gap: var(--space-3);
  border: 0;
}

.profile-controls {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface-2));
}

.field-label {
  color: var(--muted);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.text-input,
.select-input {
  min-height: 44px;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
}

.text-input::placeholder {
  color: var(--faint);
}

.profile-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-2);
}

.subtle-button {
  color: var(--muted);
}

.privacy-note,
.profile-status {
  color: var(--muted);
  font-size: var(--text-xs);
}

.privacy-note {
  padding-top: var(--space-2);
  border-top: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.preset-button {
  min-height: 62px;
  display: grid;
  align-content: center;
  gap: 0.1rem;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.preset-button:hover,
.preset-button.is-active {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-2));
}

.preset-button strong {
  font-size: var(--text-sm);
  line-height: 1.1;
}

.preset-button span {
  color: var(--muted);
  font-size: var(--text-xs);
}

.control-group {
  display: grid;
  gap: var(--space-3);
}

.control-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}

label,
legend {
  color: var(--text);
  font-weight: 700;
}

output {
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.range-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: var(--text-xs);
}

.ice-fieldset,
.confidence-fieldset,
.context-fieldset,
.stick-fieldset {
  border: 0;
  display: grid;
  gap: var(--space-3);
}

.fieldset-help {
  color: var(--muted);
  font-size: var(--text-xs);
}

.ice-options,
.confidence-options,
.context-options,
.stick-options {
  display: grid;
  gap: var(--space-2);
}

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

.ice-option,
.confidence-button,
.context-button,
.stick-button {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  cursor: pointer;
}

.confidence-button {
  min-height: 64px;
}

.context-button {
  min-height: 62px;
}

.stick-button {
  min-height: 62px;
}

.ice-option:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 72%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-2));
}

.confidence-button:hover,
.confidence-button.is-active,
.context-button:hover,
.context-button.is-active,
.stick-button:hover,
.stick-button.is-active {
  border-color: color-mix(in srgb, var(--accent) 72%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-2));
}

.ice-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.ice-option span,
.confidence-button,
.context-button,
.stick-button {
  display: grid;
  gap: 0.05rem;
}

.ice-option small,
.confidence-button small,
.context-button small,
.stick-button small {
  color: var(--muted);
}

.note-input {
  width: 100%;
  resize: vertical;
  min-height: 82px;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}

.note-input::placeholder {
  color: var(--muted);
}

.history-note {
  padding-top: var(--space-2);
  border-top: 1px dashed var(--border);
  color: var(--muted);
}

.model-note {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: var(--text-sm);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}

.kpi {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}

.kpi-label,
.kpi span:last-child {
  color: var(--muted);
  font-size: var(--text-xs);
}

.kpi strong {
  color: var(--text);
  font-size: var(--text-xl);
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1;
}

.parent-card {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border));
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-2));
}

.feedback-card {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}

.parent-card strong {
  color: var(--text);
  font-size: var(--text-lg);
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1.1;
}

.parent-card p,
.advice-grid p,
.symptom-result p,
.after-result p,
.red-flag p {
  color: var(--muted);
  font-size: var(--text-sm);
}

.script-line {
  margin-top: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid color-mix(in srgb, var(--accent) 26%, var(--border));
  color: var(--text) !important;
  font-weight: 700;
}

.advice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.symptom-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.symptom-button,
.after-button,
.starter-list button {
  min-height: 48px;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.symptom-button:hover,
.symptom-button.is-active,
.after-button:hover,
.after-button.is-active,
.starter-list button:hover,
.starter-list button.is-active {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-2));
}

.symptom-result,
.after-skate,
.after-result,
.history-card,
.red-flag {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}

.symptom-result strong,
.after-result strong {
  color: var(--text);
  font-size: var(--text-lg);
  line-height: 1.15;
}

.history-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-2));
}

.history-card strong {
  display: block;
  color: var(--text);
  font-size: var(--text-lg);
  line-height: 1.15;
}

.history-card p,
.history-item p,
.empty-history {
  color: var(--muted);
  font-size: var(--text-sm);
}

.history-actions {
  display: grid;
  justify-items: end;
  gap: var(--space-2);
}

.history-list {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.history-item {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}

.history-item-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}

.history-item strong {
  color: var(--text);
  font-size: var(--text-base);
}

.history-meta {
  color: var(--muted);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums lining-nums;
}

.history-tags {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.history-tags span {
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
}

.empty-history {
  padding: var(--space-4);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface-2) 62%, transparent);
}

.after-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.starter-list {
  display: grid;
  gap: var(--space-2);
}

.starter-list button {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 0 var(--space-3);
  align-items: baseline;
}

.starter-list strong {
  color: var(--text);
  font-variant-numeric: tabular-nums lining-nums;
}

.starter-list small {
  grid-column: 2;
  color: var(--muted);
}

.decision-card {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--border));
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--accent) 9%, var(--surface-2));
}

.stick-card {
  border-color: color-mix(in srgb, var(--warning) 34%, var(--border));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--warning) 8%, var(--surface-2)), transparent 62%),
    var(--surface-2);
}

.decision-ask {
  display: grid;
  gap: var(--space-2);
}

.decision-ask strong {
  color: var(--text);
  font-size: clamp(2rem, 1.5rem + 2.4vw, 4rem);
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.decision-ask p {
  max-width: 62rem;
  color: var(--muted);
}

.decision-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.decision-grid article {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}

.decision-grid strong {
  color: var(--text);
  font-size: var(--text-sm);
  line-height: 1.2;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.summary-text-label {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-text {
  width: 100%;
  min-height: 118px;
  resize: vertical;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--text-sm);
  line-height: 1.45;
}

.share-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-5);
  align-items: center;
  padding: var(--space-4);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-2));
}

#qrCanvas {
  width: 156px;
  height: 156px;
  padding: var(--space-2);
  border: 1px solid color-mix(in srgb, var(--text) 10%, var(--border));
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}

.share-copy {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.share-copy strong {
  color: var(--text);
  font-size: var(--text-lg);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.share-copy p,
.copy-status {
  color: var(--muted);
  font-size: var(--text-sm);
}

.copy-button {
  width: max-content;
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  border: 1px solid color-mix(in srgb, var(--accent) 52%, var(--border));
  border-radius: var(--radius-full);
  background: var(--accent);
  color: #071114;
  cursor: pointer;
  font-weight: 700;
}

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

.secondary-button {
  width: max-content;
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

.secondary-button:hover {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--border));
}

.advice-grid article {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}

.blade-wrap {
  min-height: 310px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface-2), color-mix(in srgb, var(--surface-3) 72%, transparent));
  overflow: hidden;
}

#bladeSvg {
  width: min(100%, 660px);
  height: auto;
}

.ice-bed {
  fill: url(#iceGradient);
  opacity: 0.82;
}

.blade-body {
  fill: color-mix(in srgb, var(--surface-3) 76%, var(--text));
  stroke: color-mix(in srgb, var(--text) 52%, transparent);
  stroke-width: 2;
}

.hollow-path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 7;
  stroke-linecap: round;
}

.bite-line {
  stroke: var(--warning);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 4 8;
}

.edge-point {
  fill: var(--warning);
  stroke: var(--surface);
  stroke-width: 2;
}

.svg-label {
  fill: var(--muted);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
}

.status-badge,
.recommendation,
.melt-value {
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-3);
  color: var(--accent-strong);
  background: var(--surface-2);
  font-size: var(--text-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chart-box {
  height: 245px;
}

.notes-list {
  display: grid;
  gap: var(--space-3);
  color: var(--muted);
  font-size: var(--text-sm);
  list-style: none;
}

.notes-list li {
  padding-left: var(--space-4);
  position: relative;
}

.notes-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (max-width: 1120px) {
  .demo-strip {
    grid-template-columns: 1fr;
  }

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

  .demo-steps span {
    justify-content: center;
  }

  .demo-actions {
    justify-content: flex-start;
  }

  .dashboard {
    grid-template-columns: 340px minmax(0, 1fr);
  }

  .summary-panel,
  .decision-panel,
  .stick-panel,
  .stick-trouble-panel,
  .history-panel,
  .share-panel,
  .feedback-panel,
  .explainer-panel {
    grid-column: 1 / -1;
  }

  .control-panel {
    grid-row: auto;
  }

  .visual-panel,
  .decision-panel,
  .stick-panel,
  .stick-trouble-panel,
  .parent-panel,
  .symptom-panel,
  .history-panel,
  .starter-panel,
  .share-panel,
  .feedback-panel,
  .tradeoff,
  .friction {
    grid-column: auto;
  }

  .parent-mode.stick-mode .history-panel {
    grid-column: auto;
  }

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

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - var(--space-4), 620px);
    padding: var(--space-4) 0;
  }

  .topbar,
  .panel-header.compact {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .demo-strip {
    padding: var(--space-4);
  }

  .demo-steps {
    grid-template-columns: 1fr;
  }

  .demo-steps span {
    justify-content: flex-start;
  }

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

  .control-panel,
  .summary-panel,
  .decision-panel,
  .stick-panel,
  .stick-trouble-panel,
  .visual-panel,
  .parent-panel,
  .symptom-panel,
  .history-panel,
  .starter-panel,
  .share-panel,
  .feedback-panel,
  .tradeoff,
  .friction,
  .explainer-panel {
    grid-column: 1;
  }

  .parent-mode .parent-panel,
  .parent-mode .decision-panel,
  .stick-mode .stick-panel,
  .stick-mode .stick-trouble-panel,
  .stick-mode .history-panel,
  .parent-mode .symptom-panel,
  .parent-mode .history-panel,
  .parent-mode .starter-panel,
  .parent-mode .share-panel {
    grid-column: 1;
  }

  .parent-mode .feedback-panel {
    grid-column: 1;
  }

  .parent-mode.stick-mode .history-panel {
    grid-column: 1;
  }

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

  .chart-box {
    height: 230px;
  }

  .preset-grid,
  .context-options,
  .advice-grid,
  .symptom-options,
  .after-options,
  .decision-grid {
    grid-template-columns: 1fr;
  }

  .share-card {
    grid-template-columns: 1fr;
  }

  .history-card {
    grid-template-columns: 1fr;
  }

  .history-actions {
    justify-items: start;
  }

  .history-item-header {
    display: grid;
  }

  #qrCanvas {
    justify-self: center;
  }
}

@media print {
  body {
    background: #fff;
    color: #111;
  }

  .topbar,
  .demo-strip,
  .control-panel,
  .summary-panel,
  .visual-panel,
  .symptom-panel,
  .history-panel,
  .starter-panel,
  .share-panel,
  .chart-panel,
  .explainer-panel,
  .result-actions {
    display: none !important;
  }

  .app-shell,
  .dashboard,
  .decision-panel,
  .parent-panel {
    display: block;
    width: 100%;
    box-shadow: none;
  }

  .decision-panel,
  .parent-panel {
    border: 1px solid #999;
    margin-bottom: 1rem;
    color: #111;
    background: #fff;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
