:root {
  color-scheme: dark;
  --paper: #11110f;
  --surface: #191a17;
  --surface-soft: #20211d;
  --ink: #f1f0e8;
  --ink-soft: #b9bab1;
  --muted: #85877f;
  --line: #30312c;
  --line-strong: #44453e;
  --accent: #aaaaff;
  --accent-dark: #c2c2ff;
  --accent-soft: #292943;
  --green: #9ac49a;
  --green-soft: #202b20;
  --amber: #e4c27e;
  --amber-soft: #302919;
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse at 13% 0%, rgba(72, 73, 130, .23), transparent 35rem),
    var(--paper);
  color: var(--ink);
  min-width: 320px;
}

button, textarea, select { font: inherit; }
button, select { color: inherit; }
button:focus-visible, a:focus-visible, select:focus-visible, textarea:focus-visible, input:focus-visible + .toggle-ui, summary:focus-visible {
  outline: 3px solid rgba(170, 170, 255, .38);
  outline-offset: 3px;
}

.site-shell { width: min(1160px, calc(100% - 52px)); margin: 0 auto; }

.topbar {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #181823; }
.brand-mark svg { width: 25px; height: 25px; }
.brand-name { font-size: 16px; font-weight: 760; letter-spacing: -.7px; }
.brand-name span { color: var(--accent); }
.topbar-actions { display: flex; align-items: center; gap: 22px; }
.local-badge, .footer-local { display: inline-flex; align-items: center; gap: 8px; color: var(--green); font-size: 12px; font-weight: 650; }
.local-dot, .result-dot { width: 7px; height: 7px; border-radius: 50%; background: #6e9d73; box-shadow: 0 0 0 3px rgba(110, 157, 115, .12); }
.text-link, .footer-links a { color: var(--ink-soft); text-decoration: none; font-size: 13px; font-weight: 600; }
.text-link:hover, .footer-links a:hover { color: var(--accent); }

.intro { padding: 68px 0 34px; max-width: 680px; }
.eyebrow, .section-kicker { color: var(--muted); font-size: 10px; font-weight: 760; letter-spacing: 1.35px; text-transform: uppercase; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 17px; }
.eyebrow-rule { width: 20px; height: 1px; background: var(--accent); }
h1 { margin: 0; font-size: clamp(42px, 5.4vw, 64px); font-weight: 700; letter-spacing: -3.6px; line-height: .99; }
h1 span { color: var(--accent); }
.intro-copy { max-width: 510px; margin: 20px 0 0; color: var(--ink-soft); font-size: 15px; line-height: 1.65; }

.skill-install { margin: 0 0 50px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(130deg, rgba(170, 170, 255, .07), transparent 60%), var(--surface); }
.skill-install-heading, .try-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.skill-install-heading h2, .try-heading h2 { margin-top: 6px; font-size: 20px; }
.skill-install-heading p, .try-heading p { max-width: 600px; margin: 8px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.skill-install-heading code, .install-note code { color: var(--accent); font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; }
.skill-install-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 19px; }
.install-card { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: rgba(17, 17, 15, .65); }
.install-card-heading { display: flex; align-items: center; gap: 11px; }
.install-number { display: grid; flex: 0 0 29px; place-items: center; width: 29px; height: 29px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font: 700 10px ui-monospace, monospace; }
.install-card h3 { margin: 0; font-size: 13px; }
.install-card p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.install-command { display: block; overflow-wrap: anywhere; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink-soft); font: 10px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
.install-copy { justify-self: start; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 7px; }
.install-copy:hover { border-color: var(--accent); }
.install-note { margin: 14px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.try-section { padding-top: 6px; }
.try-heading { align-items: center; margin-bottom: 17px; }
.try-heading p { max-width: 380px; margin: 0; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.editor-card, .settings-card, .report-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 9px 25px rgba(39, 39, 31, .025); }
.editor-card { overflow: hidden; }
.editor-heading { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 17px; border-bottom: 1px solid var(--line); }
.field-title { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 690; }
.step-index { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: #292a26; color: #aaa99f; font-size: 9px; font-weight: 750; letter-spacing: .3px; }
.output-index { background: var(--accent-soft); color: var(--accent); }
.editor-tools { display: flex; align-items: center; gap: 13px; }
.count { color: var(--muted); font-size: 11px; white-space: nowrap; }
.quiet-button { padding: 5px 0; border: 0; background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 11px; font-weight: 650; }
.quiet-button:hover:not(:disabled) { color: var(--accent); }
.quiet-button:disabled { color: #686a63; cursor: not-allowed; }
textarea {
  display: block;
  width: 100%;
  height: 270px;
  min-height: 170px;
  resize: vertical;
  padding: 18px;
  border: 0;
  border-radius: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.7;
  tab-size: 2;
}
textarea:focus-visible { outline-offset: -4px; }
textarea::placeholder { color: #777a73; }
#output-text { background: linear-gradient(180deg, rgba(170, 170, 255, .09), transparent 42%); }
.editor-foot { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.clear-button { color: var(--muted); }
.result-mark { display: inline-flex; align-items: center; gap: 7px; color: var(--green); font-weight: 630; }
.result-dot { width: 6px; height: 6px; }

.run-row { display: flex; align-items: center; gap: 15px; margin: 16px 0 28px; }
.run-button { display: inline-flex; min-width: 158px; min-height: 46px; align-items: center; justify-content: space-between; gap: 22px; padding: 0 14px 0 17px; border: 0; border-radius: 9px; background: var(--accent); color: #181823; cursor: pointer; font-size: 12px; font-weight: 720; box-shadow: 0 5px 16px rgba(132, 132, 255, .14); transition: background .15s ease, transform .15s ease; }
.run-button:hover { background: var(--accent-dark); transform: translateY(-1px); }
.run-button:active { transform: translateY(0); }
.run-arrow { font-size: 17px; font-weight: 400; }
.run-note { margin: 0; color: var(--muted); font-size: 11px; }

.details-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 14px; align-items: stretch; }
.settings-card, .report-card { padding: 21px 22px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.section-kicker { font-size: 9px; letter-spacing: 1.1px; }
h2 { margin: 5px 0 0; font-size: 17px; font-weight: 690; letter-spacing: -.45px; }
.settings-icon { display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid var(--line); border-radius: 8px; color: #73746c; font-size: 13px; }
.setting-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(155px, .92fr); align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.setting-copy label { font-size: 12px; font-weight: 660; }
.setting-copy p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
select { width: 100%; min-height: 35px; padding: 0 29px 0 10px; border: 1px solid var(--line); border-radius: 7px; background-color: var(--surface-soft); font-size: 10px; font-weight: 580; }
.toggle-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 4px; padding: 14px 0; border-top: 1px solid var(--line); cursor: pointer; }
.toggle-copy { display: grid; gap: 4px; }
.toggle-copy strong { font-size: 11px; font-weight: 650; }
.toggle-copy small { color: var(--muted); font-size: 10px; }
.toggle-row input { position: absolute; right: 0; width: 37px; height: 22px; opacity: 0; cursor: pointer; }
.toggle-ui { position: relative; flex: 0 0 37px; height: 22px; border: 1px solid #55564e; border-radius: 20px; background: #30312c; transition: background .15s ease; }
.toggle-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .17); transition: transform .15s ease; }
.toggle-row input:checked + .toggle-ui { border-color: var(--accent); background: var(--accent); }
.toggle-row input:checked + .toggle-ui::after { transform: translateX(15px); }
.rewrite-details { padding-top: 13px; border-top: 1px solid var(--line); }
.rewrite-details summary { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--ink-soft); font-size: 11px; font-weight: 650; list-style-position: outside; }
.optional-tag { padding: 3px 6px; border-radius: 5px; background: #2a2b26; color: #a8a99f; font-size: 8px; font-weight: 650; }
.rewrite-help { margin: 9px 0 10px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.rewrite-list { display: grid; gap: 8px; }
.rewrite-row { display: grid; grid-template-columns: 1fr 1fr 25px; gap: 6px; align-items: center; }
.rewrite-row input { width: 100%; min-width: 0; height: 31px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); font-size: 10px; }
.rewrite-row input::placeholder { color: #777a73; }
.remove-rewrite { width: 25px; height: 25px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.remove-rewrite:hover { background: #382321; color: #f29c9c; }
.add-rewrite { margin-top: 9px; color: var(--accent); }

.report-card { background: #171815; }
.report-heading { align-items: center; margin-bottom: 11px; }
.report-count { display: inline-grid; place-items: center; min-width: 29px; height: 25px; padding: 0 7px; border-radius: 7px; background: #2a2b26; color: #a5a69d; font-size: 10px; font-weight: 700; }
.empty-report { min-height: 230px; display: grid; align-content: center; justify-items: center; gap: 12px; padding: 25px; text-align: center; }
.empty-glyph { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-size: 19px; }
.empty-report p { max-width: 215px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.report-content.has-report { display: grid; gap: 15px; }
.report-summary { color: var(--muted); font-size: 10px; line-height: 1.5; }
.change-list, .review-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.change-item { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-soft); font-size: 10px; }
.change-item strong { color: var(--ink); font-size: 10px; font-variant-numeric: tabular-nums; }
.report-subhead { margin: 0 0 8px; color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.review-box { padding: 12px; border: 1px solid #51452e; border-radius: 8px; background: var(--amber-soft); }
.review-box .report-subhead { color: var(--amber); }
.review-item { position: relative; padding-left: 12px; color: #d8c08d; font-size: 10px; line-height: 1.55; overflow-wrap: anywhere; }
.review-item::before { content: ""; position: absolute; top: 6px; left: 0; width: 4px; height: 4px; border-radius: 50%; background: #b58a40; }
.clean-box { padding: 11px 12px; border-radius: 8px; background: var(--green-soft); color: var(--green); font-size: 10px; line-height: 1.5; }

.footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 45px 0 28px; padding-top: 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.footer-brand { color: var(--ink-soft); font-weight: 750; letter-spacing: -.3px; }
.footer-separator { padding: 0 8px; color: #b0afa8; }
.footer-links { display: flex; align-items: center; gap: 19px; }
.footer-links a { font-size: 10px; }
.footer-local { font-size: 10px; }
.error-state { color: #f29c9c !important; }

.architecture-section { margin-top: 34px; }
.architecture-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.architecture-heading h2 { margin-top: 5px; }
.diagram-link { color: var(--ink-soft); text-decoration: none; font-size: 11px; font-weight: 650; }
.diagram-link:hover { color: var(--accent); }
.diagram-frame { overflow: hidden; height: 740px; border: 1px solid var(--line); border-radius: var(--radius); background: #11110f; box-shadow: 0 9px 25px rgba(0, 0, 0, .2); }
.diagram-frame iframe { display: block; width: 100%; height: 100%; border: 0; }

@media (max-width: 820px) {
  .site-shell { width: min(100% - 36px, 640px); }
  .intro { padding-top: 54px; }
  .skill-install-heading, .try-heading { align-items: flex-start; flex-direction: column; }
  .try-heading p { max-width: 560px; }
  .workspace { grid-template-columns: 1fr; }
  textarea { height: 240px; }
  .details-grid { grid-template-columns: 1fr; }
  .empty-report { min-height: 175px; }
  .diagram-frame { height: 620px; }
}

@media (max-width: 480px) {
  .site-shell { width: calc(100% - 28px); }
  .topbar { height: 66px; }
  .topbar-actions { gap: 13px; }
  .topbar-actions .local-badge { display: none; }
  .local-badge { font-size: 10px; }
  .text-link { font-size: 11px; }
  .intro { padding: 43px 0 27px; }
  h1 { font-size: 45px; letter-spacing: -2.8px; }
  .intro-copy { margin-top: 15px; font-size: 13px; }
  .skill-install { padding: 17px; margin-bottom: 36px; }
  .skill-install-grid { grid-template-columns: 1fr; }
  .skill-install-heading { gap: 9px; }
  .skill-install-heading h2, .try-heading h2 { font-size: 18px; }
  .editor-heading { align-items: flex-start; flex-direction: column; padding: 12px 14px 10px; gap: 7px; }
  .editor-tools { width: 100%; justify-content: space-between; }
  textarea { height: 215px; padding: 14px; }
  .editor-foot { padding: 0 14px; font-size: 9px; }
  .run-row { align-items: flex-start; flex-direction: column; gap: 10px; margin-bottom: 22px; }
  .run-button { width: 100%; }
  .settings-card, .report-card { padding: 18px 15px; }
  .setting-row { grid-template-columns: 1fr; gap: 9px; }
  select { max-width: 100%; }
  .footer { align-items: flex-start; flex-direction: column; margin-top: 32px; }
  .architecture-heading { align-items: flex-start; flex-direction: column; }
  .diagram-frame { height: 560px; }
}
