@font-face {
  font-family: "Stack Sans Text";
  src: url("../../fonts/StackSansText-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Martian Mono";
  src: url("../../fonts/MartianMono-VariableFont_wdth,wght.ttf") format("truetype");
  font-weight: 100 800;
  font-style: normal;
  font-display: block;
}

:root {
  color-scheme: light;
  --bg: #f4f4f2;
  --band-a: #f4f4f2;
  --band-b: #eeeeeb;
  --surface: #ffffff;
  --surface-soft: #fbfbfa;
  --border: rgba(32, 33, 36, 0.08);
  --border-focus: rgba(32, 33, 36, 0.24);
  --text-primary: #1a1a1a;
  --text-secondary: #5f6368;
  --text-tertiary: #9aa0a6;
  --ink: #202020;
  --ink-soft: #303030;
  --safe: #188038;
  --safe-bg: rgba(24, 128, 56, 0.06);
  --warn: #8a6200;
  --warn-bg: rgba(138, 98, 0, 0.06);
  --danger: #b3261e;
  --danger-bg: rgba(179, 38, 30, 0.06);
  --editor-bg: var(--ink);
  --editor-bar-bg: var(--ink-soft);
  --editor-border: rgba(255, 255, 255, 0.08);
  --editor-text: #f4f4f2;
  --editor-muted: #c8c8c5;
  --font-ui: "Stack Sans Text", system-ui, -apple-system, sans-serif;
  --font-mono: "Martian Mono", monospace;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 14px;
  overflow-y: scroll;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 1rem;
  letter-spacing: 0;
}

button,
textarea,
pre {
  font: inherit;
}

button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.42;
}

h1,
h2,
h3,
p,
pre,
ul {
  margin: 0;
  font-weight: 400;
}

h1 {
  font-size: 1.12rem;
  line-height: 1.35;
}

h2 {
  font-size: 0.88rem;
  line-height: 1.4;
}

h3 {
  font-size: 0.84rem;
  line-height: 1.45;
}

a {
  color: inherit;
}

.app-shell {
  width: min(720px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 96px 0 64px;
}

.page {
  width: min(720px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 96px 0 72px;
}

.site-nav {
  position: fixed;
  top: 0px;
  right: 0px;
  left: 0px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: auto;
  border-bottom: 1px solid rgba(32, 33, 36, 0.08);
  background: var(--bg);
  padding: 8px 8px;
}

.site-links {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 6px;
}

.site-menu {
  display: none;
  position: relative;
}

.menu-toggle {
  display: none;
}

.site-link {
  border-radius: 999px;
  color: var(--text-secondary);
  padding: 8px 10px;
  font-size: 0.78rem;
  text-decoration: none;
}

.site-link:hover,
.site-link[aria-current="page"] {
  color: var(--text-primary);
}

.hero {
  display: grid;
  justify-items: center;
  gap: 22px;
  text-align: center;
  padding-bottom: 54px;
}

.hero .site-nav {
  margin-bottom: 0;
}

.hero h1 {
  max-width: 620px;
  font-size: clamp(1.62rem, 3.4vw, 1.92rem);
  line-height: 1.16;
}

.hero > p {
  max-width: 620px;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
}

.brand-bar {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 36px;
  color: var(--text-primary);
  text-decoration: none;
}

.brand-name {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.status-pill {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  display: grid;
  gap: 10px;
  width: min(268px, calc(100vw - 48px));
  border: 1px solid rgba(32, 33, 36, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 34px rgba(32, 33, 36, 0.09), var(--shadow);
  color: var(--text-secondary);
  padding: 12px;
  font-size: 0.74rem;
  line-height: 1.25;
  backdrop-filter: blur(10px);
  transform-origin: right bottom;
  transition: border-color 220ms ease, box-shadow 220ms ease, opacity 220ms ease, transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.inspection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.inspection-head span,
.inspection-grid span {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  line-height: 1;
  text-transform: uppercase;
}

.inspection-head strong {
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}

.inspection-grid {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 7px 10px;
  align-items: baseline;
}

.inspection-grid strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.74rem;
  font-weight: 400;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspection-grid strong::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin: 0 7px 1px 0;
  border-radius: 999px;
  background: rgba(154, 160, 166, 0.5);
}

.inspection-change .inspection-head strong,
.inspection-change .inspection-grid strong {
  animation: inspection-text-change 560ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (max-width: 1180px) {
  .status-pill {
    width: auto;
    border-radius: 999px;
    padding: 10px 13px;
  }

  .status-pill .inspection-grid {
    display: none;
  }

  .status-pill .inspection-head {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .status-pill .inspection-head span {
    display: none;
  }
}

.status-pill.is-safe {
  border-color: rgba(24, 128, 56, 0.18);
}

.status-pill.is-warn {
  border-color: rgba(138, 98, 0, 0.2);
}

.status-pill.is-danger {
  border-color: rgba(179, 38, 30, 0.18);
}

.status-pill.is-safe .inspection-head strong {
  color: var(--safe);
}

.status-pill.is-safe .inspection-grid strong::before {
  background: rgba(24, 128, 56, 0.62);
}

.status-pill.is-warn .inspection-head strong {
  color: var(--warn);
}

.status-pill.is-warn .inspection-grid strong::before {
  background: rgba(138, 98, 0, 0.56);
}

.status-pill.is-danger .inspection-head strong {
  color: var(--danger);
}

.status-pill.is-danger .inspection-grid strong::before {
  background: rgba(179, 38, 30, 0.56);
}

.preset-section {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 0 18px;
}

.preset-start {
  min-width: 116px;
}

.preset-hint {
  margin: -2px 0 2px;
  color: var(--text-tertiary);
  font-size: 0.74rem;
  line-height: 1.35;
}

.preset-box {
  --preset-box-padding: 8px;
  --preset-control-radius: 16px;
  overflow: hidden;
  display: grid;
  width: min(680px, 100%);
  border: 1px solid var(--border);
  border-radius: calc(var(--preset-control-radius) + var(--preset-box-padding));
  background: var(--surface-soft);
  box-shadow: var(--shadow);
}

.preset-groups {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  width: 100%;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: rgba(32, 33, 36, 0.028);
  padding: var(--preset-box-padding);
  scrollbar-width: none;
}

.preset-groups::-webkit-scrollbar {
  display: none;
}

.preset-groups button {
  min-height: 32px;
  flex: 0 0 auto;
  min-width: 120px;
  border-color: transparent;
  border-radius: var(--preset-control-radius);
  background: transparent;
  color: var(--text-secondary);
  padding: 0 13px;
  font-size: 0.76rem;
  text-align: center;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.preset-groups button.is-active {
  border-color: rgba(32, 33, 36, 0.1);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
}

.preset-box-body {
  display: grid;
  gap: 10px;
  padding: var(--preset-box-padding);
}

.preset-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
  gap: 6px;
  width: 100%;
  padding: 0;
}

.preset-panel button {
  min-height: 32px;
  border-color: var(--border);
  border-radius: var(--preset-control-radius);
  background: var(--surface);
  color: var(--text-secondary);
  padding: 0 10px;
  font-size: 0.78rem;
  text-align: center;
}

.preset-panel button.is-active {
  border-color: var(--border-focus);
  color: var(--text-primary);
}

.preset-description {
  justify-self: center;
  color: var(--text-tertiary);
  font-size: 0.75rem;
  line-height: 1.45;
  text-align: center;
  width: min(560px, 100%);
}

.flow {
  display: grid;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  gap: 0;
}

.flow > .preset-section,
.flow > .empty-state,
.flow > .memory-empty,
.flow > .memory-section {
  width: min(720px, calc(100vw - 40px));
  justify-self: center;
}

.flow-section {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 44px 0;
}

.flow-section:nth-child(odd) {
  background: var(--band-b);
}

.flow-section:nth-child(even) {
  background: var(--band-a);
}

.flow-section > * {
  width: min(720px, calc(100vw - 40px));
}

.flow-section.is-saved-rule {
  gap: 12px;
}

.section-head,
.result-head,
.example-card-head,
.editor-bar,
.action-bar,
.diagnosis-summary,
.details-row,
.section-actions {
  display: flex;
  align-items: center;
}

.section-head,
.result-head,
.example-card-head,
.editor-bar {
  justify-content: space-between;
  gap: 16px;
}

.section-head h2 {
  margin-top: 4px;
}

.section-head p {
  margin-top: 4px;
  color: var(--text-tertiary);
  font-size: 0.76rem;
  line-height: 1.45;
}

.section-label {
  color: var(--text-tertiary);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.translation-direction {
  display: block;
  margin-top: 5px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.button,
.icon-button,
.fix-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 999px;
  padding: 0 16px;
  font-size: 0.82rem;
  line-height: 1;
  text-align: center;
}

.button.is-primary {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.button.is-subtle {
  color: var(--text-secondary);
  background: transparent;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 32px;
  min-height: 32px;
  padding: 0;
  color: var(--text-tertiary);
}

.section-actions.is-muted-actions {
  opacity: 0.72;
}

.examples {
  display: grid;
  gap: 16px;
}

.saved-rule-examples {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
}

.saved-rule-examples summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.76rem;
  list-style: none;
}

.saved-rule-examples summary::-webkit-details-marker {
  display: none;
}

.saved-rule-examples summary::before {
  content: "+";
  width: 16px;
  color: var(--text-tertiary);
  font-size: 0.78rem;
  line-height: 1;
}

.saved-rule-examples[open] summary::before {
  content: "-";
}

.saved-rule-examples .examples {
  border-top: 1px solid var(--border);
  padding: 12px;
}

.empty-state {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.example-card {
  display: grid;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding: 0 0 24px;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.examples .example-card:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.example-card.is-flash {
  animation: correction-flash 1100ms ease-out;
}

.example-card.is-correction {
  border-color: rgba(24, 128, 56, 0.24);
}

.example-card.has-conflict {
  border-color: rgba(179, 38, 30, 0.28);
}

.example-card-head span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.example-match {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
}

.example-match.is-safe {
  background: var(--safe);
}

.example-match.is-danger {
  background: var(--danger);
}

.example-note {
  color: var(--text-secondary);
  font-size: 0.74rem;
  line-height: 1.45;
}

.example-note.is-danger {
  color: var(--danger);
}

.example-note.is-safe {
  color: var(--safe);
}

.example-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
  align-items: stretch;
  gap: 16px;
}

.suggestion-hint {
  border-top: 1px solid rgba(255, 255, 255, 0.045);
  background: rgba(255, 255, 255, 0.012);
  padding: 7px 10px 8px 16px;
}

.suggestion-hint-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 26px;
  opacity: 0.62;
  transition: opacity 140ms ease;
}

.suggestion-hint:hover .suggestion-hint-inner,
.suggestion-hint:focus-within .suggestion-hint-inner {
  opacity: 0.92;
}

.suggestion-summary {
  min-width: 0;
  overflow: hidden;
  color: var(--editor-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-action {
  min-height: 28px;
  flex: 0 0 auto;
  border-color: rgba(255, 255, 255, 0.07);
  color: var(--editor-muted);
  background: transparent;
  padding: 0 10px;
  font-size: 0.74rem;
}

.pair-arrow {
  color: var(--border-focus);
  align-self: center;
  font-size: 0.88rem;
  text-align: center;
}

.add-card {
  min-height: 48px;
  border: 1px dashed var(--border-focus);
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}

.file-import {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  border: 1px dashed var(--border-focus);
  border-radius: 8px;
  background: transparent;
  padding: 6px 10px;
}

.file-import.is-dragging {
  border-color: var(--border-focus);
  background: var(--surface-soft);
}

.file-import .button {
  min-height: 32px;
  border-color: transparent;
  padding: 0 10px;
}

.file-import span {
  color: var(--text-tertiary);
  font-size: 0.74rem;
  line-height: 1.4;
}

.file-import-note {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text-tertiary);
  font-size: 0.76rem;
}

.file-import-note.is-safe {
  border-color: rgba(104, 211, 145, 0.2);
  color: var(--safe);
}

.file-import-note.is-danger {
  border-color: rgba(255, 111, 111, 0.2);
  color: var(--danger);
}

.editor {
  overflow: hidden;
  border: 1px solid var(--editor-border);
  border-radius: 8px;
  background: var(--editor-bg);
  transition: border-color 160ms ease, opacity 200ms ease, transform 200ms ease;
}

.editor:focus-within {
  border-color: rgba(255, 255, 255, 0.28);
}

.editor-bar {
  min-height: 40px;
  border-bottom: 1px solid var(--editor-border);
  background: var(--editor-bar-bg);
  padding: 0 16px;
}

.editor-bar span:first-child {
  color: var(--editor-muted);
  font-size: 0.74rem;
}

.format-chip {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--editor-muted);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  padding: 2px 18px 2px 6px;
}

select.format-chip {
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 9px) 50%, calc(100% - 5px) 50%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}

select.format-chip:hover,
select.format-chip:focus {
  border-color: var(--editor-border);
  outline: none;
}

.format-chip.is-warn {
  color: #e1c56f;
}

.editor textarea,
.error-box {
  width: 100%;
  min-height: 160px;
  overflow-y: auto;
  overscroll-behavior: contain;
  resize: none;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--editor-text);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.55;
  tab-size: 2;
}

.editor.is-compact textarea {
  min-height: 100px;
}

.editor.is-try textarea {
  min-height: 192px;
}

.editor.is-result textarea {
  min-height: 160px;
  font-size: 0.84rem;
  transition: opacity 180ms ease;
}

.transform-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.transform-step .button {
  min-width: 132px;
}

.transform-feedback {
  color: var(--text-tertiary);
  font-size: 0.78rem;
  line-height: 1.45;
}

.transform-feedback.is-safe {
  color: var(--safe);
}

.transform-feedback.is-warn {
  color: var(--warn);
}

.transform-feedback.is-danger {
  color: var(--danger);
}

.output-preview,
.output-empty {
  overflow: hidden;
  border: 1px solid var(--editor-border);
  border-radius: 8px;
  background: var(--editor-bg);
}

.output-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  min-height: 42px;
  border-bottom: 1px solid var(--editor-border);
  background: var(--editor-bar-bg);
  padding: 8px 14px;
}

.output-preview-head p {
  margin-top: 2px;
  color: var(--editor-muted);
  font-size: 0.72rem;
}

.preview-mode {
  min-height: 30px;
  border: 1px solid var(--editor-border);
  border-radius: 6px;
  background: transparent;
  color: var(--editor-muted);
  padding: 0 8px;
  font-size: 0.72rem;
}

.output-preview-body {
  position: relative;
}

.output-preview-body pre,
.output-empty {
  margin: 0;
  color: var(--editor-text);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.output-preview.has-more .output-preview-body::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 64px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(16, 18, 22, 0), var(--editor-bg));
}

.output-empty {
  color: var(--editor-muted);
}

.format-note,
.reliability-note {
  border-top: 1px solid rgba(138, 98, 0, 0.12);
  background: var(--warn-bg);
  color: var(--warn);
  padding: 8px 16px;
  font-size: 0.7rem;
  line-height: 1.45;
}

.format-diagnostic {
  border-top: 1px solid rgba(184, 51, 51, 0.16);
  padding: 10px 16px 12px;
  font-size: 0.72rem;
  line-height: 1.45;
}

.format-diagnostic p {
  margin: 0;
}

.format-diagnostic.is-danger {
  background: rgba(184, 51, 51, 0.07);
  color: var(--danger);
}

.format-diagnostic.is-warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.format-fixes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.format-fixes .button {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 0.68rem;
}

.array-note {
  color: var(--text-tertiary);
  font-size: 0.75rem;
  line-height: 1.45;
}

.array-note.is-warn {
  color: var(--warn);
}

.result-card {
  display: grid;
  gap: 24px;
}

.status-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.82rem;
  transition: color 300ms ease;
}

.status-badge span {
  font-weight: 500;
}

.status-badge small {
  color: var(--text-tertiary);
}

.is-safe {
  color: var(--safe);
}

.is-warn {
  color: var(--warn);
}

.is-danger {
  color: var(--danger);
}

.is-muted {
  color: var(--text-tertiary);
}

.is-muted-output .editor {
  opacity: 0.6;
}

.batch-summary {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
}

.batch-summary > p {
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.45;
}

.batch-message {
  color: var(--warn) !important;
}

.batch-progress {
  display: grid;
  gap: 7px;
}

.batch-progress > div {
  overflow: hidden;
  height: 6px;
  border-radius: 999px;
  background: rgba(32, 33, 36, 0.08);
}

.batch-progress > div span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ink);
  transition: width 140ms ease;
}

.batch-progress p {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.batch-counts {
  display: grid;
  gap: 7px;
}

.batch-count {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 8px;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.batch-count span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.batch-preview-row {
  display: grid;
  gap: 6px;
}

.batch-preview-row span {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.batch-preview-row pre {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-secondary);
  padding: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.5;
}

.output-corrections {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
}

.output-corrections-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.output-corrections-head p,
.output-corrections-head span {
  color: var(--text-tertiary);
  font-size: 0.76rem;
  line-height: 1.45;
}

.output-corrections-head p {
  margin-top: 4px;
}

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

.output-correction-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.85fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.output-correction-row code {
  overflow: hidden;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.output-correction-row input {
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  background: var(--surface);
  color: var(--text-primary);
  padding: 0 10px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

.output-correction-row input:focus {
  border-color: var(--border-focus);
}

.rule-section {
  display: grid;
  gap: 10px;
  border-top: 1px dashed var(--border);
  padding-top: 16px;
}

.rule-section p {
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.5;
}

.rule-lines {
  display: grid;
  gap: 8px;
}

.rule-lines p,
.rule-empty {
  color: var(--text-secondary);
  font-size: 0.76rem;
  line-height: 1.5;
  margin: 0;
}

.reasoning-line {
  animation: rule-line-in 220ms ease-out both;
}

.rule-spec {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
}

.rule-spec.is-analysis {
  gap: 14px;
}

.spec-block {
  display: grid;
  align-content: start;
  gap: 8px;
}

.spec-block.is-current-payload,
.spec-block.is-rule-steps,
.rule-spec > details {
  grid-column: 1 / -1;
}

.spec-row {
  display: grid;
  grid-template-columns: minmax(96px, 0.72fr) minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  border-top: 1px solid var(--border);
  padding-top: 9px;
}

.spec-row.is-compact {
  gap: 10px;
}

.spec-row-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.spec-row code {
  min-width: 0;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.spec-row p,
.spec-empty {
  color: var(--text-secondary);
  font-size: 0.76rem;
  line-height: 1.45;
}

.analysis-summary {
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.45;
}

.spec-row small {
  color: var(--text-tertiary);
  font-size: 0.7rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.spec-row em {
  font-style: normal;
  font-size: 0.7rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.spec-row em.is-warn {
  color: var(--warn);
}

.spec-row em.is-danger {
  color: var(--danger);
}

.spec-issues {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.spec-issue {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 6px;
  font-size: 0.66rem;
  line-height: 1;
  white-space: nowrap;
}

.spec-issue.is-warn {
  border-color: rgba(138, 98, 0, 0.16);
  background: var(--warn-bg);
  color: var(--warn);
}

.spec-issue.is-danger {
  border-color: rgba(179, 38, 30, 0.16);
  background: var(--danger-bg);
  color: var(--danger);
}

.candidate-preview {
  display: grid;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px 14px;
}

.candidate-preview span {
  color: var(--text-tertiary);
  font-size: 0.7rem;
}

.candidate-preview p {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.76rem;
  line-height: 1.45;
}

.candidate-preview code {
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.evidence-summary {
  display: grid;
  gap: 10px;
  border-top: 1px dashed var(--border);
  padding-top: 16px;
}

.evidence-summary p {
  margin-top: 4px;
  color: var(--text-tertiary);
  font-size: 0.74rem;
  line-height: 1.45;
}

.evidence-reasons {
  display: grid;
  gap: 4px;
}

.evidence-reasons p {
  margin: 0;
  color: var(--text-secondary);
}

.evidence-summary-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.evidence-summary-items span {
  min-height: 26px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-secondary);
  padding: 6px 9px;
  font-size: 0.72rem;
  line-height: 1;
}

.diagnosis-summary {
  flex-wrap: wrap;
  gap: 6px;
  color: var(--text-tertiary);
  font-size: 0.72rem;
}

.diagnosis-summary span {
  padding: 2px 0;
}

.diagnosis-summary.is-safe span:first-child {
  color: var(--safe);
}

.diagnosis-summary.is-warn span:first-child {
  color: var(--warn);
}

.diagnosis-summary.is-danger span:first-child {
  color: var(--danger);
}

.reasoning-hint {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px 14px;
  color: var(--text-secondary);
  font-size: 0.76rem;
  line-height: 1.45;
}

.reasoning-hint::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--text-tertiary);
}

.reasoning-hint.is-safe::before {
  background: var(--safe);
}

.reasoning-hint.is-warn {
  border-color: rgba(138, 98, 0, 0.14);
  background: var(--warn-bg);
}

.reasoning-hint.is-warn::before {
  background: var(--warn);
}

.reasoning-hint.is-danger {
  border-color: rgba(179, 38, 30, 0.14);
  background: var(--danger-bg);
}

.reasoning-hint.is-danger::before {
  background: var(--danger);
}

.reasoning-hint strong {
  color: var(--text-primary);
  font-weight: 500;
}

.next-example-card,
.learning-notice,
.test-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.next-example-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
}

.next-example-card p {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.45;
}

.next-example-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.next-example-fields code {
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-primary);
  padding: 4px 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.learning-notice {
  display: grid;
  gap: 3px;
  border-color: rgba(24, 128, 56, 0.14);
  background: var(--safe-bg);
  padding: 10px 14px;
  color: var(--text-secondary);
  font-size: 0.76rem;
  line-height: 1.45;
}

.learning-notice strong {
  color: var(--safe);
  font-weight: 500;
}

.test-section {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.test-head,
.test-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.test-head p {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.45;
}

.test-list {
  display: grid;
  gap: 12px;
}

.test-card {
  display: grid;
  gap: 10px;
  border-top: 1px dashed var(--border);
  padding-top: 12px;
}

.test-card-head span {
  color: var(--text-secondary);
  font-size: 0.76rem;
}

.test-card.is-passed .test-card-head span {
  color: var(--safe);
}

.test-card.is-failed .test-card-head span,
.test-card.is-invalid .test-card-head span {
  color: var(--danger);
}

.diagnosis-row {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 8px;
  font-size: 0.76rem;
  line-height: 1.45;
}

.diagnosis-row p {
  color: var(--text-secondary);
}

.diagnosis-row.is-warn span {
  color: var(--warn);
}

.diagnosis-row.is-danger span {
  color: var(--danger);
}

.details-row {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.inspect-details {
  color: var(--text-secondary);
  font-size: 0.76rem;
}

.inspect-details > summary {
  cursor: pointer;
  width: max-content;
  color: var(--text-tertiary);
}

.inspect-details[open] > summary {
  margin-bottom: 8px;
  color: var(--text-primary);
}

.detail-block {
  color: var(--text-secondary);
  font-size: 0.76rem;
}

.detail-block summary {
  cursor: pointer;
  color: var(--text-primary);
}

.detail-body {
  display: grid;
  gap: 8px;
  padding: 8px 0 0 16px;
}

.detail-item span {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.detail-item p {
  margin-top: 4px;
  color: var(--text-secondary);
}

.error-box {
  white-space: pre-wrap;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--danger);
}

.action-bar {
  flex-wrap: wrap;
  gap: 8px;
}

.action-bar .button {
  flex: 1 1 128px;
}

.fix-link {
  flex-basis: 100%;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  padding: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(26, 26, 26, 0.24);
  padding: 20px;
}

.modal {
  display: grid;
  gap: 16px;
  width: min(520px, 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.16);
  padding: 18px;
}

.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cli-export-summary {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.45;
}

.cli-export-summary.is-safe {
  border-color: rgba(24, 128, 56, 0.14);
  background: var(--safe-bg);
}

.cli-export-summary.is-warn {
  border-color: rgba(138, 98, 0, 0.14);
  background: var(--warn-bg);
}

.cli-export-summary strong {
  color: var(--text-primary);
  font-weight: 500;
}

.export-facts {
  display: grid;
  gap: 8px;
  margin: 0;
}

.export-facts div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  align-items: baseline;
}

.export-facts dt {
  color: var(--text-tertiary);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.export-facts dd {
  margin: 0;
  color: var(--text-primary);
  overflow-wrap: anywhere;
  font-size: 0.8rem;
}

.command-example {
  display: grid;
  gap: 6px;
}

.command-example-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.command-example-head span {
  color: var(--text-tertiary);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.command-copy {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-secondary);
  padding: 5px 8px;
  font-size: 0.7rem;
  line-height: 1;
}

.command-copy:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.command-example code {
  display: block;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text-primary);
  padding: 10px 12px;
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.55;
}

.memory-section {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 24px;
}

.memory-empty {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 16px;
  color: var(--text-tertiary);
  font-size: 0.76rem;
  line-height: 1.45;
}

.memory-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.memory-head p {
  margin-top: 4px;
  color: var(--text-tertiary);
  font-size: 0.78rem;
  line-height: 1.45;
}

.memory-head > span {
  color: var(--text-tertiary);
  white-space: nowrap;
  font-size: 0.72rem;
}

.memory-list {
  display: grid;
  gap: 10px;
}

.memory-item {
  display: grid;
  gap: 8px;
}

.memory-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.memory-load {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px 14px;
  text-align: left;
}

.memory-item strong {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-item .memory-meta {
  color: var(--text-tertiary);
  font-size: 0.7rem;
}

.memory-spec {
  display: grid;
  gap: 4px;
}

.memory-spec p {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  min-width: 0;
}

.memory-spec span {
  color: var(--text-tertiary);
  font-size: 0.66rem;
  text-transform: uppercase;
}

.memory-spec code {
  overflow: hidden;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-actions {
  display: flex;
  gap: 6px;
  padding-top: 2px;
}

.memory-details {
  display: grid;
  justify-items: start;
}

.memory-details summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 0.7rem;
  list-style: none;
  padding: 0 2px;
}

.memory-details summary::-webkit-details-marker {
  display: none;
}

.memory-details summary::before {
  content: "+";
  font-size: 0.72rem;
  line-height: 1;
}

.memory-details[open] summary::before {
  content: "-";
}

.memory-details div {
  display: grid;
  gap: 6px;
  width: 100%;
  border-left: 1px solid var(--border);
  margin-top: 6px;
  padding: 2px 0 2px 10px;
}

.memory-item {
  position: relative;
}

.memory-details p {
  display: grid;
  gap: 3px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.memory-details span {
  color: var(--text-tertiary);
  font-family: var(--font-ui);
  font-size: 0.66rem;
  text-transform: uppercase;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 48px 24px;
  text-align: center;
}

.empty-state p {
  color: var(--text-secondary);
  line-height: 1.5;
}

.value-statements {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.content-page {
  display: grid;
  gap: 16px;
  padding-top: 0;
}

.content-page h1 {
  max-width: 680px;
  margin-bottom: 12px;
  font-size: 1.82rem;
  line-height: 1.16;
}

.content-page h2 {
  margin-top: 32px;
  font-size: 1.12rem;
  font-weight: 500;
  line-height: 1.3;
}

.content-page h3 {
  margin-top: 16px;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--text-primary);
}

.content-page p,
.content-page li {
  color: var(--text-secondary);
  line-height: 1.62;
}

.content-page ul {
  display: grid;
  gap: 8px;
  padding-left: 1.1rem;
}

.content-page code {
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-primary);
  padding: 2px 5px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

.content-page pre {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-primary);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  line-height: 1.55;
}

.content-page pre code {
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.content-page .button {
  width: max-content;
  margin-top: 2px;
  text-decoration: none;
}

.article-date {
  display: block;
  margin-top: -8px;
  margin-bottom: 16px;
  color: var(--text-tertiary);
  font-size: 0.78rem;
}

.article-list {
  display: grid;
  gap: 4px;
  margin-top: 16px;
}

.article-item {
  display: grid;
  gap: 4px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
  transition: opacity 150ms ease;
}

.article-item:first-child {
  border-top: 1px solid var(--border);
}

.article-item:hover {
  opacity: 0.7;
}

.article-item-date {
  color: var(--text-tertiary);
  font-size: 0.72rem;
}

.article-item-title {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.3;
}

.article-item-description {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.5;
}

.article-empty {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}

a.section-label {
  text-decoration: none;
  transition: opacity 150ms ease;
}

a.section-label:hover {
  opacity: 0.6;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 32px;
  margin: 10px 0 8px;
}

.stat {
  display: grid;
  gap: 2px;
}

.stat strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 400;
}

.stat span {
  color: var(--text-tertiary);
  font-size: 0.72rem;
}

.divider {
  width: 100%;
  height: 1px;
  border: 0;
  background: var(--border);
  margin: 16px 0 8px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 48px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
  color: var(--text-tertiary);
  font-size: 0.76rem;
}

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

.footer-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.is-shaking {
  animation: shake 240ms linear;
}

.reasoning-change {
  animation: reasoning-change 720ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes rule-line-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes reasoning-change {
  0% {
    opacity: 0.84;
    transform: translateY(10px) scale(0.985);
    box-shadow: 0 10px 22px rgba(32, 33, 36, 0.06), var(--shadow);
  }
  52% {
    opacity: 1;
    transform: translateY(-1px) scale(1);
    box-shadow: 0 16px 38px rgba(32, 33, 36, 0.1), var(--shadow);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    box-shadow: 0 14px 34px rgba(32, 33, 36, 0.09), var(--shadow);
  }
}

@keyframes inspection-text-change {
  0% {
    opacity: 0;
    transform: translateY(4px);
  }
  48% {
    opacity: 0.58;
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes correction-flash {
  0% {
    border-color: rgba(24, 128, 56, 0.58);
    box-shadow: 0 0 0 1px rgba(24, 128, 56, 0.18), var(--shadow);
  }
  45% {
    border-color: rgba(24, 128, 56, 0.28);
  }
  100% {
    border-color: var(--border);
    box-shadow: var(--shadow);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  33% {
    transform: translateX(-4px);
  }
  66% {
    transform: translateX(4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100vw - 32px, 720px);
    padding-top: 88px;
  }

  .hero {
    gap: 20px;
    padding-bottom: 48px;
  }

  .hero .site-nav {
    margin-bottom: 0;
  }

  .hero h1 {
    font-size: 1.58rem;
  }

  .flow-section {
    padding: 36px 0;
  }

  .flow-section > *,
  .flow > .preset-section,
  .flow > .empty-state,
  .flow > .memory-empty,
  .flow > .memory-section {
    width: min(100vw - 32px, 720px);
  }

  .page {
    width: min(100vw - 32px, 720px);
    padding-top: 88px;
  }

  .content-page {
    padding-top: 0;
  }

  .content-page h1 {
    font-size: 1.58rem;
  }

  .site-nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-items: stretch;
  }

  .site-menu {
    display: block;
    justify-self: end;
  }

  .site-links-desktop {
    display: none;
  }

  .menu-toggle {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    list-style: none;
    transition: border-color 150ms ease, color 150ms ease;
  }

  .menu-toggle::marker,
  .menu-toggle::-webkit-details-marker {
    display: none;
    content: "";
  }

  .menu-toggle:hover,
  .site-menu[open] .menu-toggle {
    border-color: var(--border-focus);
    color: var(--text-primary);
  }

  .menu-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: currentColor;
  }

  .site-menu .site-links {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 30;
    display: none;
    min-width: 156px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 6px;
  }

  .site-menu[open] .site-links {
    display: grid;
    justify-content: stretch;
  }

  .site-menu .site-link {
    border-radius: 6px;
    padding: 10px 12px;
  }

  .brand-bar {
    width: max-content;
    justify-content: flex-start;
  }

  .preset-panel {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .status-pill {
    right: 12px;
    bottom: 12px;
    width: auto;
    max-width: calc(100vw - 24px);
    border-radius: 999px;
    padding: 10px 13px;
  }

  .status-pill .inspection-grid {
    display: none;
  }

  .status-pill .inspection-head {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .status-pill .inspection-head span {
    display: none;
  }

  .example-pair {
    grid-template-columns: 1fr;
  }

  .pair-arrow {
    transform: rotate(90deg);
  }

  .file-import {
    display: grid;
    justify-items: stretch;
  }

  .file-import span {
    text-align: center;
  }

  .transform-step {
    grid-template-columns: 1fr;
  }

  .transform-step .button {
    width: 100%;
  }

  .output-preview-head {
    display: grid;
    align-items: stretch;
  }

  .action-bar .button {
    flex-basis: calc(50% - 8px);
  }

  .output-correction-row {
    grid-template-columns: 1fr auto;
  }

  .output-correction-row code {
    grid-column: 1 / -1;
  }

  .rule-spec {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .spec-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .memory-row {
    grid-template-columns: 1fr;
  }

  .memory-actions {
    justify-content: flex-start;
    padding-top: 0;
  }

  .next-example-card {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 16px;
  }

  .modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .export-facts div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

}

@media (max-width: 480px) {
  .app-shell {
    width: min(100vw - 28px, 720px);
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .page {
    width: min(100vw - 28px, 720px);
  }

  .flow-section > *,
  .flow > .preset-section,
  .flow > .empty-state,
  .flow > .memory-empty,
  .flow > .memory-section {
    width: min(100vw - 28px, 720px);
  }

  .empty-state {
    padding: 16px;
  }

  .editor textarea,
  .error-box {
    padding: 12px;
  }

  .action-bar .button {
    flex: 1 1 calc(50% - 4px);
  }

}
