:root {
  color-scheme: light;
  --bg: #f5f7f7;
  --surface: #ffffff;
  --ink: #172126;
  --muted: #61717a;
  --line: #d7e0e2;
  --primary: #087f8c;
  --accent: #d85545;
  --gold: #d79b28;
  --green: #3b8b5f;
  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:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 15%, transparent), transparent 34%),
    linear-gradient(315deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 32%),
    var(--bg);
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.app { min-height: 100vh; padding: 18px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  max-width: 1500px;
  margin: 0 auto 16px;
}
.identity { display: flex; align-items: center; gap: 14px; min-width: 0; }
.identity > div:last-child { min-width: 0; }
.mark {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 28% 30%, var(--primary) 0 8px, transparent 9px),
    radial-gradient(circle at 70% 42%, var(--accent) 0 8px, transparent 9px),
    radial-gradient(circle at 50% 72%, var(--gold) 0 7px, transparent 8px),
    var(--surface);
  box-shadow: 0 16px 44px rgba(23, 33, 38, 0.11);
}
.eyebrow { margin: 0 0 5px; color: var(--primary); font-size: 0.76rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: clamp(1.5rem, 3vw, 2.8rem); line-height: 1; overflow-wrap: anywhere; }
h2 { margin-bottom: 0; font-size: 1.08rem; }
.identity p:last-child { margin: 0; color: var(--muted); line-height: 1.42; overflow-wrap: anywhere; }
.top-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.top-actions span, button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 12px;
  font-weight: 850;
}
.layout {
  display: grid;
  grid-template-columns: minmax(300px, 450px) minmax(0, 1fr) minmax(270px, 360px);
  gap: 16px;
  align-items: start;
  max-width: 1500px;
  margin: 0 auto;
}
.instrument, .readout, .commons {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 50px rgba(23, 33, 38, 0.10);
}
.scenario {
  min-height: 112px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  line-height: 1.55;
}
.task-card { display: grid; gap: 13px; }
.option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.option-grid.three { grid-template-columns: repeat(3, 1fr); }
.option-card {
  min-height: 116px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}
.option-card:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 9%, white); }
.option-card b { display: block; margin-bottom: 6px; }
.option-card span { display: block; color: var(--muted); line-height: 1.35; font-size: 0.9rem; }
label { color: var(--muted); font-weight: 830; }
textarea, input[type="text"], input[type="number"], select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.45; }
.slider-row { display: grid; grid-template-columns: minmax(120px, 180px) minmax(0, 1fr) 52px; align-items: center; gap: 10px; }
input[type="range"] { width: 100%; accent-color: var(--primary); }
.value { text-align: right; color: var(--ink); font-weight: 950; font-variant-numeric: tabular-nums; }
.check { display: flex; gap: 9px; align-items: flex-start; font-weight: 650; }
.check input { margin-top: 4px; accent-color: var(--green); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.primary {
  border-color: color-mix(in srgb, var(--primary) 85%, black);
  background: var(--primary);
  color: white;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--primary) 26%, transparent);
}
.secondary { background: var(--surface); }
canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1.7;
  margin: 14px 0;
  border-radius: 8px;
  background: #101719;
}
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.metrics div { min-height: 76px; padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfc; }
.metrics strong { display: block; font-size: 1.3rem; line-height: 1.05; }
.metrics span { display: block; margin-top: 5px; color: var(--muted); font-size: 0.8rem; font-weight: 850; }
.reflection { margin: 12px 0 0; padding: 12px; border: 1px solid color-mix(in srgb, var(--gold) 55%, white); border-radius: 8px; background: color-mix(in srgb, var(--gold) 13%, white); color: #5e4617; line-height: 1.45; }
.capture { display: grid; gap: 5px; margin: 14px 0; padding: 12px; border-left: 4px solid var(--green); border-radius: 0 8px 8px 0; background: color-mix(in srgb, var(--green) 10%, white); }
.capture span { color: var(--muted); line-height: 1.42; }
.feed { display: grid; gap: 8px; max-height: 520px; overflow: auto; }
.feed-item { padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfc; }
.feed-item b { display: block; margin-bottom: 4px; font-size: 0.88rem; }
.feed-item span { color: var(--muted); line-height: 1.35; font-size: 0.84rem; }
details { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); }
summary { color: var(--ink); font-weight: 850; cursor: pointer; }
@media (max-width: 1180px) {
  .layout { grid-template-columns: minmax(300px, 440px) minmax(0, 1fr); }
  .commons { grid-column: 1 / -1; }
}
@media (max-width: 780px) {
  .app { padding: 12px; }
  .topbar { align-items: stretch; flex-direction: column; }
  .identity { align-items: flex-start; }
  .identity p:last-child { max-width: 28ch; }
  .top-actions { justify-content: flex-start; }
  .layout, .metrics, .option-grid, .option-grid.three { grid-template-columns: 1fr; }
  .slider-row { grid-template-columns: 1fr; gap: 6px; }
  .value { text-align: left; }
  .actions button { width: 100%; }
}
