:root {
  --paper: #f6f2e9;
  --paper-2: #efe9dc;
  --ink: #14130f;
  --ink-2: #2a2822;
  --muted: #6b675c;
  --line: #ded6c5;
  --coral: #ff5a36;
  --blue: #2f6bff;
  --green: #17b26a;
  --yellow: #ffd43b;
  --white: #fffdf7;
  --radius: 16px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.6 Inter, ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(700px 380px at 90% -10%, rgba(255,90,54,.10), transparent 70%),
              radial-gradient(600px 340px at 0% 10%, rgba(47,107,255,.07), transparent 70%);
}
a { color: inherit; }
.bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 14px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: rgba(246,242,233,.9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand img { height: 30px; width: auto; display: block; }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid var(--line); background: var(--white);
  padding: 5px 10px; border-radius: 999px; color: var(--ink-2);
}
.pill.small { letter-spacing: 0; text-transform: none; font-weight: 600; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(23,178,106,.15); }
.back { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--muted); }
.back:hover { color: var(--ink); }

.wrap { position: relative; z-index: 1; max-width: 1280px; margin: 0 auto; padding: clamp(28px, 5vw, 56px) clamp(16px, 4vw, 40px) 48px; }
.intro { max-width: 720px; margin-bottom: 26px; }
.kicker { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--coral); margin: 0 0 8px; }
h1, h2, h3 { font-family: "Bricolage Grotesque", Inter, sans-serif; letter-spacing: -.03em; line-height: 1.05; margin: 0; }
h1 { font-size: clamp(34px, 4.6vw, 56px); font-weight: 800; }
h1 em { font-style: normal; color: var(--coral); }
.lede { color: var(--muted); font-size: 16px; max-width: 56ch; margin: 12px 0 0; }

.grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 18px; align-items: start; }
.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(16px, 2.4vw, 24px);
  box-shadow: 0 22px 50px -42px rgba(20,19,15,.5);
}
.form { display: grid; gap: 12px; }
.row { display: grid; gap: 12px; }
.row.two { grid-template-columns: 1fr 1fr; }
label { display: grid; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
input, textarea {
  width: 100%; font: inherit; font-size: 14px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 11px; outline: none;
}
textarea { resize: vertical; min-height: 220px; line-height: 1.55; }
input:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,107,255,.12); }
.hint { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); }
.link { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--paper);
  border: 1.5px solid var(--ink); border-radius: 11px;
  padding: 13px 18px; font: inherit; font-weight: 600; cursor: pointer;
  transition: transform .16s ease, background .16s ease;
}
.button:hover { transform: translateY(-1px); background: #000; }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.fine { color: var(--muted); font-size: 11.5px; margin: 0; }

.output { min-height: 460px; }
.empty { text-align: center; padding: 34px 10px; }
.empty .mark { font-size: 28px; color: var(--coral); }
.empty h2 { font-size: 22px; margin: 10px 0 6px; }
.empty p { color: var(--muted); margin: 0 auto 18px; max-width: 34ch; }
.expect { list-style: none; padding: 0; margin: 0 auto; display: grid; gap: 7px; max-width: 260px; text-align: left; color: var(--ink-2); font-size: 13px; }
.expect li::before { content: "✓"; color: var(--green); font-weight: 800; margin-right: 8px; }

.working { text-align: center; padding: 44px 16px; }
.spinner {
  width: 34px; height: 34px; margin: 0 auto 18px;
  border: 3px solid var(--line); border-top-color: var(--coral); border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.working h2 { font-size: 22px; }
.working p { color: var(--muted); margin: 8px auto 0; max-width: 38ch; }
.elapsed { margin-top: 14px; font: 12px ui-monospace, monospace; color: var(--muted); }

.result-head { display: flex; gap: 14px; justify-content: space-between; align-items: flex-start; }
.summary { margin: 0; font-size: 14.5px; color: var(--ink-2); }
.board { margin: 18px 0 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.board img { display: block; width: 100%; height: auto; }
.board figcaption { padding: 8px 11px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); }
.blocks { display: grid; gap: 16px; margin-top: 18px; }
.block h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.block h3 span { background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; font-size: 10px; }
.item {
  border-left: 3px solid var(--blue); background: var(--paper);
  border-radius: 0 8px 8px 0; padding: 9px 11px; margin-top: 8px; font-size: 13.5px;
}
.item.suggestion { border-left-color: var(--yellow); }
.item.action { border-left-color: var(--green); }
.item .meta { display: block; color: var(--muted); font-size: 11px; margin-bottom: 3px; }
.item b { font-weight: 600; }
.item p { margin: 0; }
.muted { color: var(--muted); font-size: 13px; }
.foot {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 18px clamp(16px, 4vw, 40px); border-top: 1px solid var(--line);
  color: var(--muted); font-size: 11.5px;
}
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .row.two { grid-template-columns: 1fr; }
  .output { min-height: 0; }
  .bar .pill { display: none; }
}

/* live page */
.live-grid { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; }
.panel-title { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 6px; }
.form .button { margin-top: 4px; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.board-link { display: block; font-size: 13px; font-weight: 600; color: var(--blue); margin: 0 0 10px; }
.button.danger { background: transparent; color: var(--coral); border-color: var(--coral); width: 100%; }
.button.danger:hover { background: rgba(255,90,54,.08); }
.live-status { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 4px; }
.live-status h2 { font-size: 22px; }
.live-block { margin-top: 18px; }
.live-block h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.live-block h3 span { background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; font-size: 10px; }
.summary-block { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.summary-block h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.summary-block p { margin: 6px 0 0; font-size: 14px; color: var(--ink-2); }
.muted.small { font-size: 12.5px; }
@media (max-width: 900px) { .live-grid { grid-template-columns: 1fr; } }
