:root {
  --bg: oklch(0.95 0.01 250);
  --paper: oklch(0.99 0.004 260);
  --ink: oklch(0.26 0.04 262);
  --muted: oklch(0.54 0.03 245);
  --line: oklch(0.9 0.01 250);
  --accent: oklch(0.73 0.15 165);
  --accent-ink: oklch(0.29 0.07 165);
  --warm: oklch(0.78 0.11 62);
  --danger: oklch(0.63 0.19 26);
  --shadow: 0 12px 40px color-mix(in oklab, var(--ink) 12%, transparent);
  --radius: 18px;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Manrope, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 420px at 10% -4%, color-mix(in oklab, var(--warm) 45%, white) 0%, transparent 70%),
    radial-gradient(900px 420px at 90% -10%, color-mix(in oklab, var(--accent) 42%, white) 0%, transparent 72%),
    var(--bg);
  line-height: 1.45;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    repeating-linear-gradient(45deg, transparent 0 2px, color-mix(in oklab, var(--ink) 2%, transparent) 2px 3px);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1180px, 94vw);
  margin: clamp(18px, 3vw, 40px) auto 56px;
}

.hero,
.panel {
  background: color-mix(in oklab, var(--paper) 94%, white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero {
  padding: clamp(20px, 4vw, 42px);
  margin-bottom: 18px;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: white;
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 7px 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.lang-btn.active {
  background: color-mix(in oklab, var(--accent) 14%, white);
  color: var(--accent-ink);
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 0.78rem;
}

h1 {
  margin: 10px 0 0;
  font-family: Literata, serif;
  font-size: clamp(2.1rem, 4.2vw, 3.7rem);
  line-height: 1.05;
}

.lead {
  margin: 14px 0 0;
  max-width: 68ch;
  color: color-mix(in oklab, var(--ink) 86%, var(--muted));
  font-size: clamp(1rem, 1.45vw, 1.16rem);
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-badges span {
  border: 1px solid color-mix(in oklab, var(--accent) 38%, var(--line));
  background: color-mix(in oklab, var(--accent) 10%, white);
  color: var(--accent-ink);
  border-radius: 999px;
  padding: 8px 13px;
  font-size: 0.86rem;
  font-weight: 700;
}

.panel {
  padding: clamp(16px, 2.5vw, 24px);
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.panel h2,
.panel h3 {
  margin: 0;
}

.panel-head p,
.chart-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

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

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

label {
  display: grid;
  gap: 6px;
  font-size: 0.91rem;
  font-weight: 600;
}

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

input,
select,
textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  padding: 10px 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea { resize: vertical; }

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: color-mix(in oklab, var(--accent) 65%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 18%, transparent);
}

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

.actions.full {
  grid-column: 1 / -1;
}

.btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn:active { transform: translateY(0); }

.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  box-shadow: 0 8px 24px color-mix(in oklab, var(--accent) 35%, transparent);
}

.btn.ghost {
  background: color-mix(in oklab, var(--paper) 94%, white);
  border-color: var(--line);
  color: var(--ink);
  font-weight: 700;
}

.hint {
  min-height: 1.2em;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.hint.error {
  color: var(--danger);
  font-weight: 700;
}

.admin-note {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  margin-top: 12px;
}

.workspace {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 16px;
}

.program-list {
  display: grid;
  gap: 8px;
}

.program-btn {
  display: grid;
  text-align: left;
  gap: 4px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 13px;
  padding: 11px 12px;
  cursor: pointer;
}

.program-btn strong { font-size: 0.94rem; }

.program-btn span { color: var(--muted); font-size: 0.82rem; }

.program-btn.active {
  border-color: color-mix(in oklab, var(--accent) 55%, var(--line));
  background: color-mix(in oklab, var(--accent) 10%, white);
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 22px;
  color: var(--muted);
}

.program-content {
  display: grid;
  gap: 16px;
}

.attempt-form,
.chart-block,
.history-block {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: white;
}

.chart {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 260px;
  padding: 12px;
  display: flex;
  align-items: end;
  gap: 10px;
  overflow-x: auto;
  background:
    linear-gradient(to top, color-mix(in oklab, var(--ink) 4%, transparent) 1px, transparent 1px) 0 100% / 100% 20%;
}

.bar-col {
  min-width: 62px;
  display: grid;
  gap: 8px;
  justify-items: center;
}

.bar-stack {
  width: 34px;
  height: 180px;
  position: relative;
  display: flex;
  align-items: end;
  justify-content: center;
}

.bar-back,
.bar-front {
  position: absolute;
  bottom: 0;
  border-radius: 9px 9px 4px 4px;
}

.bar-back {
  width: 34px;
  background: color-mix(in oklab, var(--ink) 18%, white);
}

.bar-front {
  width: 21px;
  background: linear-gradient(to top, color-mix(in oklab, var(--accent) 85%, black), var(--accent));
}

.bar-label {
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}

.bar-label strong {
  color: var(--ink);
  display: block;
  font-size: 0.8rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

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

th { color: var(--muted); font-weight: 700; }

.disk-note {
  margin: 0;
  border: 1px solid color-mix(in oklab, var(--warm) 35%, var(--line));
  background: color-mix(in oklab, var(--warm) 17%, white);
  color: color-mix(in oklab, var(--ink) 80%, var(--warm));
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-weight: 600;
}

.reveal {
  animation: rise 0.58s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.reveal:nth-of-type(2) { animation-delay: 0.07s; }
.reveal:nth-of-type(3) { animation-delay: 0.13s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
  .workspace { grid-template-columns: 1fr; }
  .grid.two { grid-template-columns: 1fr; }
  .chart { min-height: 230px; }
}
