:root {
  --ink: #0e0f22;
  --red: #ef261f;
  --soft: #f5f6f8;
  --line: #e6e7ec;
  --muted: #6d7080;
  --warning-bg: #fff5e6;
  --warning-line: #ffdda7;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  line-height: 1.5;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: #fff; }
button, textarea { font: inherit; }
.container { width: min(1180px, calc(100% - 28px)); margin: auto; }

.site-header { position: sticky; top: 0; z-index: 10; background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { height: 84px; display: flex; align-items: center; }
.brand-lockup { display: inline-flex; align-items: flex-start; gap: 10px; }
.logo { display: block; width: 150px; height: auto; }
.product-tag { margin-top: 1px; padding: 3px 6px; color: #fff; background: var(--red); border-radius: 3px; font-size: 8px; font-weight: 900; line-height: 1; letter-spacing: .12em; text-transform: uppercase; }

.workspace { display: grid; grid-template-columns: minmax(320px, 40fr) minmax(0, 60fr); min-height: calc(100vh - 159px); }
.composer, .result { min-width: 0; padding: clamp(44px, 5vw, 76px) clamp(24px, 4vw, 64px); }
.composer { border-right: 1px solid var(--line); }
.result { background: var(--soft); }
.panel-inner { width: 100%; max-width: 760px; margin: 0 auto; }
.composer .panel-inner { max-width: 520px; margin-left: auto; }
.result .panel-inner { margin-right: auto; }

.eyebrow { margin: 0 0 12px; color: var(--red); font-size: 12px; font-weight: 900; letter-spacing: .17em; text-transform: uppercase; }
h1, h2, h3, p { text-wrap: pretty; }
h1 { margin: 0; font-size: clamp(46px, 5vw, 72px); line-height: .92; letter-spacing: -.055em; }
h2 { margin: 0; font-size: clamp(30px, 3.2vw, 46px); line-height: .98; letter-spacing: -.04em; }
.intro { max-width: 490px; margin: 24px 0 38px; color: var(--muted); font-size: 17px; }
label { display: block; color: var(--ink); font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
textarea { width: 100%; min-height: 190px; margin-top: 8px; padding: 16px; resize: vertical; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 14px; outline: none; line-height: 1.55; transition: border-color .15s, box-shadow .15s; }
textarea::placeholder { color: #9295a2; }
textarea:hover { border-color: #c9cbd4; }
textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(239, 38, 31, .1); }
.input-example { margin: 9px 2px 0; color: var(--muted); font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.actions { margin-top: 22px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.shortcut { color: var(--muted); font-size: 12px; }
kbd { padding: 2px 5px; background: var(--soft); border: 1px solid var(--line); border-radius: 5px; font-family: inherit; }
button { min-height: 48px; padding: 14px 22px; display: inline-flex; align-items: center; justify-content: center; gap: 13px; color: #fff; background: var(--red); border: 0; border-radius: 999px; font-weight: 900; cursor: pointer; transition: transform .15s, filter .15s, box-shadow .15s; }
button:hover { transform: translateY(-1px); filter: brightness(.94); box-shadow: 0 7px 16px rgba(239, 38, 31, .17); }
button:focus-visible { outline: 3px solid rgba(239, 38, 31, .22); outline-offset: 3px; }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

.result-head { margin-bottom: 30px; padding-bottom: 26px; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.status { flex: 0 0 auto; padding: 7px 11px; color: var(--muted); background: #fff; border-radius: 999px; font-size: 11px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; box-shadow: inset 0 0 0 1px var(--line); }
.status.parsed { color: #17623c; background: #e9f6ee; box-shadow: none; }
.status.partially_parsed { color: #815313; background: #fff0d8; box-shadow: none; }
.empty { min-height: 360px; padding: 72px 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 8px 22px rgba(14, 15, 34, .05); }
.empty-icon { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 16px; color: #fff; background: var(--red); border-radius: 50%; font-size: 24px; font-weight: 700; }
.empty h3 { margin: 0 0 6px; color: var(--ink); font-size: 22px; letter-spacing: -.02em; }
.empty p { max-width: 390px; margin: 0; }

.step, .repeat { margin: 0 0 14px; padding: 21px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 22px rgba(14, 15, 34, .05); }
.step { display: flex; gap: 16px; }
.step-number { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; color: #fff; background: var(--ink); border-radius: 50%; font-size: 11px; font-weight: 900; }
.step-body { min-width: 0; }
.step small, .repeat small { color: var(--red); font-size: 10px; font-weight: 900; letter-spacing: .15em; }
.step h3, .repeat h3 { margin: 3px 0 9px; font-size: 22px; line-height: 1.1; letter-spacing: -.025em; }
.step p { margin: 8px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.step .explanation, .repeat .explanation { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.tag { display: inline-block; margin: 2px 6px 2px 0; padding: 6px 9px; color: var(--ink); background: #f0f1f5; border-radius: 999px; font-size: 11px; font-weight: 900; text-transform: uppercase; }
.repeat > header { display: flex; align-items: center; gap: 16px; }
.count { margin-left: auto; color: var(--red); font-size: 25px; line-height: 1; }
.nested { margin: 18px 0 0 14px; padding-left: 17px; border-left: 3px solid var(--red); }
.nested .step, .nested .repeat { background: var(--soft); box-shadow: none; }
.nested .nested .step, .nested .nested .repeat { background: #fff; }
.recovery { margin-top: 13px; padding-top: 13px; color: var(--muted); border-top: 1px dashed #c9cbd4; font-size: 13px; }
.recovery strong { color: var(--ink); }
.warnings { margin: 0 0 18px; padding: 15px 17px; color: #694715; background: var(--warning-bg); border: 1px solid var(--warning-line); border-radius: 14px; }
.warnings strong { color: var(--ink); }
.warnings p { margin: 5px 0 0; font-size: 13px; overflow-wrap: anywhere; }
.notes, .session-summary { margin: 0 0 18px; padding: 17px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.notes strong { color: var(--ink); }
.notes p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.session-summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-left: 4px solid var(--red); }
.session-summary small { color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .13em; }
.session-summary strong { font-size: 22px; }

footer { padding: 17px 0; color: var(--muted); background: #fff; border-top: 1px solid var(--line); }
footer .container { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
footer strong { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: 11px; font-weight: 700; }
footer strong i { width: 4px; height: 4px; background: var(--red); border-radius: 50%; }
footer span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .11em; }

@media (max-width: 800px) {
  .header-inner { height: 76px; }
  .logo { width: 136px; }
  .workspace { display: block; }
  .composer, .result { padding: 48px max(20px, calc((100vw - 720px) / 2)); }
  .composer { border-right: 0; border-bottom: 1px solid var(--line); }
  .composer .panel-inner { max-width: 720px; margin: auto; }
  .result .panel-inner { max-width: 720px; margin: auto; }
}

@media (max-width: 480px) {
  .composer, .result { padding: 40px 14px; }
  h1 { font-size: clamp(43px, 14vw, 60px); }
  .intro { margin: 20px 0 30px; font-size: 16px; }
  .actions { align-items: stretch; flex-direction: column; }
  .shortcut { text-align: center; }
  button { width: 100%; }
  .result-head { gap: 14px; }
  h2 { font-size: 30px; }
  .status { font-size: 9px; }
  .empty { min-height: 300px; padding: 52px 18px; }
  .step, .repeat { padding: 17px; border-radius: 16px; }
  .step { gap: 12px; }
  .nested { margin-left: 8px; padding-left: 10px; }
  footer .container { gap: 12px; }
  footer strong { font-size: 10px; }
  footer span { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  button, textarea { transition: none; }
}
