:root {
  color-scheme: light;
  --paper: oklch(98.4% 0.012 82);
  --surface: oklch(99.1% 0.006 88);
  --surface-warm: oklch(96.8% 0.018 86);
  --ink: oklch(23% 0.045 263);
  --muted: oklch(48% 0.035 255);
  --line: oklch(88% 0.015 245);
  --saffron: oklch(64% 0.17 52);
  --green: oklch(54% 0.15 157);
  --blue: oklch(45% 0.16 258);
  --red: oklch(53% 0.19 29);
  --focus: oklch(57% 0.17 258);
  --shadow: 0 24px 70px oklch(25% 0.05 263 / 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, oklch(72% 0.15 58 / 0.1), transparent 250px),
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
select,
textarea,
input[type="range"] {
  accent-color: var(--blue);
}

:focus-visible {
  outline: 3px solid oklch(57% 0.17 258 / 0.34);
  outline-offset: 2px;
}

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: oklch(99.1% 0.006 88 / 0.9);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
  font-size: 13px;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
}

.topnav a {
  color: var(--muted);
  text-decoration: none;
}

.topnav a:hover {
  color: var(--ink);
}

.shell {
  width: min(1240px, calc(100% - 32px));
  margin: 26px auto 48px;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumb a {
  color: var(--blue);
  text-decoration: none;
}

.mast {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
}

.mast-copy {
  max-width: 780px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--saffron);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(34px, 4vw, 56px);
  line-height: 1.03;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 16px;
}

.lede {
  margin-bottom: 0;
  max-width: 72ch;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.byline {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.status-stack {
  display: grid;
  justify-items: end;
  gap: 8px;
  flex: 0 0 auto;
}

.status-pill,
.draft-pill {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 13px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
}

.draft-pill {
  background: var(--surface-warm);
}

.support-notice {
  border: 1px solid oklch(81% 0.09 54);
  border-radius: 8px;
  padding: 11px 13px;
  background: oklch(95.8% 0.035 76);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.startup-error {
  margin: 16px auto;
  width: min(920px, calc(100% - 32px));
  border: 1px solid var(--red);
  border-radius: 8px;
  padding: 14px 16px;
  background: oklch(96% 0.035 29);
  color: var(--ink);
  font-weight: 750;
  line-height: 1.45;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.tool-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.primary-panel {
  min-height: 680px;
  display: flex;
  flex-direction: column;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.field {
  display: grid;
  gap: 5px;
  min-width: 190px;
}

.language-field {
  flex: 1 1 230px;
  max-width: 340px;
}

.compact-field {
  min-width: 0;
}

.field span,
.toggle {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
}

input[type="range"] {
  width: 100%;
}

output {
  margin-left: 4px;
  color: var(--ink);
}

.toggle {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
}

.toggle input {
  width: 18px;
  height: 18px;
}

.tool-button,
.editor-actions button,
.side-actions button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 800;
  text-align: center;
}

.tool-button.primary {
  background: var(--green);
  border-color: var(--green);
  color: var(--surface);
}

.tool-button.danger {
  color: var(--red);
}

.tool-button:hover:not(:disabled),
.editor-actions button:hover:not(:disabled),
.side-actions button:hover:not(:disabled) {
  border-color: var(--focus);
}

.tool-button:disabled,
.editor-actions button:disabled,
.side-actions button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.live-strip {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: oklch(75% 0.025 250);
}

.dot.live {
  background: var(--red);
  box-shadow: 0 0 0 6px oklch(53% 0.19 29 / 0.12);
}

.divider {
  width: 1px;
  height: 18px;
  flex: 0 0 auto;
  background: var(--line);
}

#interimText {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

textarea {
  width: 100%;
  min-height: 460px;
  flex: 1;
  border: 0;
  outline: 0;
  resize: vertical;
  padding: 20px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.7;
  background: var(--surface);
}

textarea::placeholder {
  color: oklch(60% 0.028 255);
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.export-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.side-panel {
  padding: 16px;
  display: grid;
  gap: 17px;
}

.mini-section {
  display: grid;
  gap: 12px;
}

.mini-section.soft {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.mini-copy {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.wave {
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, oklch(97.5% 0.015 247), var(--surface));
}

.wave span {
  width: 10px;
  height: 28px;
  border-radius: 999px;
  background: var(--blue);
  opacity: 0.26;
  transform-origin: center;
}

.wave.active span {
  animation: wave 900ms ease-in-out infinite;
}

.wave span:nth-child(2) {
  animation-delay: 90ms;
}

.wave span:nth-child(3) {
  animation-delay: 180ms;
}

.wave span:nth-child(4) {
  animation-delay: 270ms;
}

.wave span:nth-child(5) {
  animation-delay: 360ms;
}

@keyframes wave {
  0%,
  100% {
    transform: scaleY(0.65);
    opacity: 0.3;
  }

  50% {
    transform: scaleY(1.8);
    opacity: 0.85;
  }
}

.download-link,
.upsell-link {
  min-height: 42px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  text-decoration: none;
  font-weight: 800;
}

.download-link {
  border: 1px solid var(--line);
  color: var(--blue);
}

.download-link.disabled {
  opacity: 0.5;
  pointer-events: none;
  color: var(--muted);
}

.upsell-link {
  background: var(--ink);
  color: var(--surface);
}

.side-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.command-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.command-list li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  background: var(--surface-warm);
  font-size: 13px;
}

.chunk-list {
  min-height: 58px;
  max-height: 250px;
  overflow: auto;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
}

.chunk-list li {
  margin-bottom: 8px;
  line-height: 1.45;
}

.chunk-list .empty-row {
  list-style: none;
  margin-left: -22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-warm);
}

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

.seo-copy,
.content-section {
  max-width: 940px;
  padding: 6px 0 0;
}

.content-section {
  display: grid;
  gap: 12px;
}

.content-section p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.68;
}

.howto-list,
.support-link-list,
.reference-list {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.65;
}

.howto-list li,
.support-link-list li,
.reference-list li {
  margin-bottom: 8px;
}

.support-link-list a,
.reference-list a {
  color: var(--blue);
  text-decoration: none;
}

.example-media {
  margin: 6px 0 0;
  display: grid;
  gap: 8px;
}

.example-media img {
  width: min(100%, 760px);
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.example-media figcaption {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.faq-section details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--surface);
}

.faq-section summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 800;
}

.faq-section details p {
  margin-top: 8px;
}

.feature-links {
  display: grid;
  gap: 12px;
  max-width: 980px;
  padding: 6px 0 0;
}

.feature-link-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.feature-link-grid a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-weight: 750;
}

.feature-link-grid a:hover,
.feature-link-grid a[aria-current="page"] {
  border-color: var(--focus);
  color: var(--blue);
}

.seo-copy h2 {
  margin-bottom: 8px;
}

.seo-copy p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.site-footer {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto 34px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  color: var(--muted);
  font-size: 14px;
}

.site-footer span {
  font-weight: 800;
  color: var(--ink);
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--blue);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 980px) {
  .topbar {
    padding: 0 16px;
  }

  .topnav {
    display: none;
  }

  .mast {
    align-items: start;
    flex-direction: column;
  }

  .status-stack {
    justify-items: start;
    display: flex;
    flex-wrap: wrap;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }

  .toolbar {
    align-items: stretch;
  }

  .field,
  .tool-button {
    flex: 1 1 150px;
  }

  .language-field {
    max-width: none;
  }

  textarea {
    min-height: 360px;
    font-size: 16px;
  }
}

@media (max-width: 540px) {
  .shell {
    width: min(100% - 20px, 1240px);
    margin-top: 18px;
  }

  h1 {
    font-size: 34px;
  }

  .toolbar,
  .editor-actions,
  .side-panel {
    padding: 12px;
  }

  .tool-button,
  .editor-actions button {
    width: 100%;
  }

  .live-strip {
    align-items: start;
    flex-wrap: wrap;
    padding: 12px;
  }

  #interimText {
    flex-basis: 100%;
    white-space: normal;
  }
}
