/* ==========================================================================
   JSON Object Editor — Core Design System
   White + light-green theme shared by every page on the site.
   ========================================================================== */

:root {
  /* Brand palette */
  --bg: #ffffff;
  --bg-soft: #f6faf7;
  --bg-soft-2: #eef7f1;
  --surface: #ffffff;
  --surface-raised: #ffffff;

  --accent: #2fa96b;
  --accent-dark: #22a05f;
  --accent-darker: #1c8a52;
  --accent-light: #e3f5ea;
  --accent-line: #bfe6d1;

  --text-primary: #16261c;
  --text-secondary: #5c6f64;
  --text-muted: #8a9a90;

  --border: #dde7e1;
  --border-strong: #c7d6cd;

  --success: #2fa96b;
  --warning: #b3720c;
  --warning-bg: #fdf3e2;
  --error: #c23f3f;
  --error-bg: #fdecec;
  --info: #2f7ea9;
  --info-bg: #e9f4fb;

  --code-bg: #0f1f16;
  --code-text: #d9ece1;

  --shadow-sm: 0 1px 2px rgba(22, 38, 28, 0.06);
  --shadow-md: 0 4px 16px rgba(22, 38, 28, 0.08);
  --shadow-lg: 0 12px 32px rgba(22, 38, 28, 0.12);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --header-h: 64px;
  --container-w: 1180px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "Cascadia Code", Consolas, "Courier New", monospace;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding-left: 0; list-style: none; }
img { max-width: 100%; display: block; }
a { color: var(--accent-darker); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
code, pre { font-family: var(--font-mono); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 2000;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

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

.container { max-width: var(--container-w); margin: 0 auto; padding: 0 24px; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
}
.nav { width: 100%; display: flex; align-items: center; gap: 24px; }
.nav-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; color: var(--text-primary); white-space: nowrap; }
.nav-brand:hover { text-decoration: none; }
.nav-brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-darker));
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 15px; flex-shrink: 0;
}
.nav-links { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav-link {
  padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 500;
  color: var(--text-secondary); white-space: nowrap;
}
.nav-link:hover { background: var(--bg-soft-2); color: var(--text-primary); text-decoration: none; }
.nav-link.is-active { color: var(--accent-darker); background: var(--accent-light); }

.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  display: flex; align-items: center; gap: 4px; padding: 8px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--text-secondary); background: none; border: none; cursor: pointer;
}
.nav-dropdown-toggle:hover { background: var(--bg-soft-2); color: var(--text-primary); }
.nav-dropdown-menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 300px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: 8px; display: none; grid-template-columns: 1fr 1fr; gap: 2px;
}
.nav-dropdown.is-open .nav-dropdown-menu { display: grid; }
.nav-dropdown-menu a {
  display: block; padding: 8px 10px; border-radius: 6px; font-size: 13px; color: var(--text-primary);
}
.nav-dropdown-menu a:hover { background: var(--accent-light); text-decoration: none; }
.nav-dropdown-menu .menu-section-title {
  grid-column: 1 / -1; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); padding: 8px 10px 2px;
}

.nav-toggle {
  display: none; background: none; border: 1px solid var(--border); border-radius: 8px;
  width: 38px; height: 38px; align-items: center; justify-content: center; cursor: pointer; color: var(--text-primary);
}
.nav-cta { margin-left: auto; }

@media (max-width: 880px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-cta { margin-left: 0; }
  .site-header.is-mobile-open { height: auto; align-items: flex-start; padding: 12px 0; }
  .site-header.is-mobile-open .nav { flex-wrap: wrap; }
  .site-header.is-mobile-open .nav-links {
    display: flex; flex-direction: column; width: 100%; order: 5; gap: 2px; padding-top: 8px; border-top: 1px solid var(--border); margin-top: 8px;
  }
  .site-header.is-mobile-open .nav-dropdown-menu { position: static; box-shadow: none; grid-template-columns: 1fr; margin: 4px 0; }
  .site-header.is-mobile-open .nav-dropdown.is-open .nav-dropdown-menu { display: grid; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 9px; font-size: 14px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .05s;
  line-height: 1.2; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); text-decoration: none; }
.btn-secondary { background: var(--surface); color: var(--text-primary); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--bg-soft-2); text-decoration: none; }
.btn-ghost { background: none; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-soft-2); color: var(--text-primary); text-decoration: none; }
.btn-danger { background: var(--error-bg); color: var(--error); }
.btn-danger:hover { background: #fbdada; text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-icon { width: 34px; height: 34px; padding: 0; }

/* ---------- Hero ---------- */
.hero { padding: 44px 0 28px; background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%); }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700;
  color: var(--accent-darker); background: var(--accent-light); border: 1px solid var(--accent-line);
  padding: 4px 12px; border-radius: 999px; margin-bottom: 14px;
}
.hero-title { font-size: clamp(26px, 4vw, 38px); font-weight: 800; letter-spacing: -0.02em; color: var(--text-primary); margin-bottom: 12px; }
.hero-title .accent { color: var(--accent-darker); }
.hero-subtitle { font-size: 16px; color: var(--text-secondary); max-width: 680px; }
.hero-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

/* ---------- Sections / typography ---------- */
.section { padding: 48px 0; }
.section-tight { padding: 28px 0; }
.section-title { font-size: 24px; font-weight: 800; color: var(--text-primary); margin-bottom: 10px; letter-spacing: -0.01em; }
.section-lead { color: var(--text-secondary); font-size: 15px; max-width: 720px; margin-bottom: 28px; }
.prose h2 { font-size: 21px; font-weight: 800; color: var(--text-primary); margin: 32px 0 12px; }
.prose h3 { font-size: 16px; font-weight: 700; color: var(--text-primary); margin: 20px 0 8px; }
.prose p { color: var(--text-secondary); margin-bottom: 12px; }
.prose code { background: var(--bg-soft-2); padding: 2px 6px; border-radius: 4px; font-size: 13px; color: var(--accent-darker); }

/* ---------- Cards / feature grid ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.card-accent { border-left: 3px solid var(--accent); }
.card-icon {
  width: 38px; height: 38px; border-radius: 10px; background: var(--accent-light); color: var(--accent-darker);
  display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 12px;
}
.card-title { font-size: 15.5px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.card-body { font-size: 13.5px; color: var(--text-secondary); line-height: 1.55; }

/* Tool link cards (used on hub / related-tools) */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.tool-card {
  display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 16px; transition: border-color .15s, box-shadow .15s, transform .1s;
}
.tool-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow-md); text-decoration: none; transform: translateY(-1px); }
.tool-card-title { font-size: 14.5px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.tool-card-desc { font-size: 12.5px; color: var(--text-secondary); }

.related-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-chip {
  font-size: 13px; font-weight: 600; color: var(--accent-darker); background: var(--accent-light);
  border: 1px solid var(--accent-line); padding: 6px 12px; border-radius: 999px;
}
.tool-chip:hover { background: var(--accent-line); text-decoration: none; }

/* ---------- FAQ ---------- */
.faq-item { border-bottom: 1px solid var(--border); padding: 14px 0; }
.faq-item summary {
  cursor: pointer; font-weight: 700; font-size: 14.5px; color: var(--text-primary);
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--accent); font-size: 20px; font-weight: 400; flex-shrink: 0; }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { color: var(--text-secondary); margin-top: 10px; font-size: 13.5px; }

/* ---------- Editor shell (used by tool pages) ---------- */
.tool-shell { padding: 24px 0 56px; }
.toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 10px 12px; border-bottom: none;
}
.toolbar-group { display: flex; align-items: center; gap: 6px; padding-right: 8px; border-right: 1px solid var(--border); }
.toolbar-group:last-child { border-right: none; }
.toolbar-spacer { flex: 1; }
.toolbar-label { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; margin-right: 2px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); }
.split.single { grid-template-columns: 1fr; }
.editor-panel { background: var(--surface); display: flex; flex-direction: column; min-width: 0; }
.editor-panel-header {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border);
  font-size: 12.5px; font-weight: 700; color: var(--text-secondary);
}
.editor-panel-header .spacer { flex: 1; }
.editor-surface { height: 420px; position: relative; }
.editor-surface .cm-editor { height: 100%; font-size: 13.5px; }
.editor-surface.tall { height: 560px; }

.status-bar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  background: var(--bg-soft-2); border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md); padding: 8px 14px; font-size: 12px; color: var(--text-secondary);
}
.status-info { display: flex; gap: 14px; flex-wrap: wrap; }
.status-ok { color: var(--success); font-weight: 600; }
.status-error { color: var(--error); font-weight: 600; }

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
}

/* ---------- Forms ---------- */
.form-group { margin-bottom: 12px; }
.form-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); margin-bottom: 5px; }
.input, .select, .textarea {
  width: 100%; padding: 9px 11px; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 8px; color: var(--text-primary); font-size: 13.5px; font-family: inherit;
}
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--accent-line); border-color: var(--accent); }
.textarea { resize: vertical; min-height: 70px; font-family: var(--font-mono); }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-primary); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab-btn {
  padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-secondary);
  background: var(--bg-soft-2); border: 1px solid transparent; cursor: pointer;
}
.tab-btn.is-active { background: var(--accent); color: #fff; }
.tab-btn:hover:not(.is-active) { border-color: var(--border-strong); }

/* ---------- Stats ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.stat-tile { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.stat-tile .n { font-size: 20px; font-weight: 800; color: var(--accent-darker); }
.stat-tile .l { font-size: 11.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }

/* ---------- Table view ---------- */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { border: 1px solid var(--border); padding: 7px 10px; text-align: left; }
.data-table th { background: var(--bg-soft-2); font-weight: 700; color: var(--text-primary); position: sticky; top: 0; }
.data-table td { color: var(--text-secondary); }
.table-scroll { overflow: auto; max-height: 460px; border: 1px solid var(--border); border-radius: 8px; }

/* ---------- Tree view ---------- */
.tree-view { font-family: var(--font-mono); font-size: 12.8px; overflow: auto; padding: 4px; }
.tree-node { margin-left: 18px; }
.tree-row { padding: 1px 4px; border-radius: 4px; }
.tree-row:hover { background: var(--bg-soft-2); }
.tree-key { color: #1a6ea8; font-weight: 600; }
.tree-string { color: #b3572f; }
.tree-number { color: #2fa96b; }
.tree-boolean { color: #7b3fb0; }
.tree-null { color: var(--text-muted); font-style: italic; }
.tree-toggle { cursor: pointer; user-select: none; color: var(--text-muted); margin-right: 4px; display: inline-block; width: 12px; }
.tree-path-btn { opacity: 0; margin-left: 6px; font-size: 11px; color: var(--accent-darker); background: none; border: none; cursor: pointer; }
.tree-row:hover .tree-path-btn { opacity: 1; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.badge-success { background: var(--accent-light); color: var(--accent-darker); }
.badge-error { background: var(--error-bg); color: var(--error); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }

/* ---------- Alerts ---------- */
.alert { border-radius: 10px; padding: 12px 14px; font-size: 13.5px; border: 1px solid; margin-bottom: 14px; }
.alert-error { background: var(--error-bg); border-color: #f2c6c6; color: var(--error); }
.alert-info { background: var(--info-bg); border-color: #c6e0f2; color: var(--info); }
.alert-warning { background: var(--warning-bg); border-color: #f2dfb0; color: var(--warning); }

/* ---------- Modal ---------- */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(20, 30, 24, 0.45); z-index: 1000;
  align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.is-open { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  max-width: 560px; width: 100%; max-height: 85vh; overflow-y: auto; padding: 22px;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-title { font-size: 17px; font-weight: 800; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-secondary); width: 30px; height: 30px; border-radius: 8px; }
.modal-close:hover { background: var(--bg-soft-2); }

/* ---------- Toasts ---------- */
.toast-container { position: fixed; top: 78px; right: 18px; z-index: 1100; display: flex; flex-direction: column; gap: 8px; max-width: 340px; }
.toast {
  padding: 11px 14px; border-radius: 10px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow-md);
  animation: toast-in .18s ease-out, toast-out .25s ease-in 2.6s forwards;
  border: 1px solid transparent;
}
.toast-success { background: #f0faf4; color: var(--accent-darker); border-color: var(--accent-line); }
.toast-error { background: var(--error-bg); color: var(--error); border-color: #f2c6c6; }
.toast-info { background: var(--surface); color: var(--text-primary); border-color: var(--border); }
@keyframes toast-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--border); padding: 44px 0 24px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 24px; }
.footer-brand { max-width: 260px; }
.footer-brand .nav-brand { margin-bottom: 10px; }
.footer-brand p { font-size: 13px; color: var(--text-secondary); }
.footer-heading { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: 12px; }
.footer-col a { display: block; font-size: 13.5px; color: var(--text-secondary); padding: 4px 0; }
.footer-col a:hover { color: var(--accent-darker); text-decoration: none; }
.footer-bottom {
  margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 12.5px; color: var(--text-muted);
}
@media (max-width: 780px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; max-width: none; }
}

/* ---------- Misc ---------- */
.hr { height: 1px; background: var(--border); border: none; margin: 24px 0; }
.kbd { font-family: var(--font-mono); background: var(--bg-soft-2); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; font-size: 12px; }
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius-md); padding: 22px; text-align: center;
  color: var(--text-secondary); font-size: 13.5px; transition: all .15s; cursor: pointer;
}
.dropzone.is-drag { border-color: var(--accent); background: var(--accent-light); color: var(--accent-darker); }
.loading-spin { width: 16px; height: 16px; border: 2.5px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

::selection { background: var(--accent-light); color: var(--text-primary); }

/* ---------- Tool page two-column layout ---------- */
.tool-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.tool-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: calc(var(--header-h) + 16px); }
.tool-side .card { padding: 16px; }
.tool-side-title { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); margin-bottom: 10px; }
@media (max-width: 980px) {
  .tool-layout { grid-template-columns: 1fr; }
  .tool-side { position: static; flex-direction: row; flex-wrap: wrap; }
  .tool-side .card { flex: 1 1 220px; }
}

/* ---------- Document tabs (multi-tab editor) ---------- */
.doc-tabs { display: flex; align-items: center; gap: 4px; padding: 8px 8px 0; flex-wrap: wrap; background: var(--bg-soft); border: 1px solid var(--border); border-bottom: none; border-radius: var(--radius-md) var(--radius-md) 0 0; }
.doc-tab {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 14px; border-radius: 8px 8px 0 0;
  background: var(--bg-soft-2); font-size: 12.5px; font-weight: 600; color: var(--text-secondary); cursor: pointer; border: 1px solid transparent;
}
.doc-tab.is-active { background: var(--surface); color: var(--text-primary); border-color: var(--border); border-bottom-color: var(--surface); }
.doc-tab-close { width: 18px; height: 18px; border-radius: 50%; border: none; background: none; color: inherit; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.doc-tab-close:hover { background: rgba(0,0,0,0.08); }
.doc-tab-add { padding: 6px 10px; border-radius: 8px; border: 1px dashed var(--border-strong); background: none; color: var(--text-secondary); cursor: pointer; font-size: 16px; line-height: 1; }
.doc-tab-add:hover { border-color: var(--accent); color: var(--accent-darker); }

/* ---------- Generic dropdown menu (export, etc.) ---------- */
.menu-wrap { position: relative; display: inline-block; }
.menu {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 190px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; display: none;
}
.menu.is-open { display: block; }
.menu-item { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; border: none; background: none; font-size: 13px; color: var(--text-primary); cursor: pointer; }
.menu-item:hover { background: var(--accent-light); }

/* ---------- Diff view (compare page) ---------- */
.diff-grid { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.diff-col { overflow: auto; max-height: 520px; font-family: var(--font-mono); font-size: 12.5px; }
.diff-col + .diff-col { border-left: 1px solid var(--border); }
.diff-line { padding: 2px 10px 2px 0; white-space: pre-wrap; word-break: break-word; display: flex; }
.diff-ln { display: inline-block; width: 38px; flex-shrink: 0; text-align: right; margin-right: 10px; color: var(--text-muted); user-select: none; }
.diff-same { background: transparent; }
.diff-removed { background: var(--error-bg); }
.diff-added { background: var(--accent-light); }
.diff-empty { background: var(--bg-soft-2); }
@media (max-width: 860px) { .diff-grid { grid-template-columns: 1fr; } .diff-col + .diff-col { border-left: none; border-top: 1px solid var(--border); } }

/* ---------- Cheat sheet ---------- */
.cheat-table td:first-child { font-family: var(--font-mono); color: var(--accent-darker); white-space: nowrap; }

/* ---------- Code output block (read-only generated code) ---------- */
.code-block {
  background: var(--code-bg); color: var(--code-text); border-radius: var(--radius-md);
  padding: 16px 18px; font-family: var(--font-mono); font-size: 12.8px; line-height: 1.6;
  overflow: auto; max-height: 560px; white-space: pre; margin: 0;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--text-muted); margin-bottom: 14px; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb .sep { color: var(--border-strong); }
