:root {
  --ink: #17231f; --muted: #626d67; --paper: #f4f1e9; --panel: #fffdf8; --line: #d9d7ce;
  --accent: #d9ff65; --forest: #183f33; --warning: #fff3c7;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); }
button, textarea, input { font: inherit; }
button { color: inherit; }
button:focus-visible, textarea:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid rgba(48, 100, 80, .35); outline-offset: 3px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 20; padding: 10px 14px; border-radius: 8px; color: white; background: var(--forest); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.site-header { height: 72px; padding: 0 clamp(20px, 5vw, 72px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { color: var(--ink); text-decoration: none; font-size: 22px; letter-spacing: -.05em; }
.brand span { font-family: Georgia, serif; font-style: italic; font-weight: 400; }
.brand b { font-weight: 750; }
.header-meta { display: flex; align-items: center; gap: 9px; color: var(--muted); font: 12px var(--mono); letter-spacing: .06em; }
.meta-divider { width: 1px; height: 14px; background: var(--line); }
.ready-dot, .loading-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #56a078; }
.loading-dot { background: #d2ab29; animation: pulse 1.4s infinite; }
main { width: min(1440px, 100%); margin: auto; }
.intro { padding: clamp(28px, 3.5vw, 48px) clamp(20px, 6vw, 88px) 28px; display: grid; grid-template-columns: 1fr; gap: 8px; }
.eyebrow { grid-column: 1 / -1; margin: 0; color: #527064; font: 11px var(--mono); letter-spacing: .16em; }
h1 { margin: 0; max-width: none; white-space: nowrap; font-size: clamp(38px, 4.7vw, 68px); line-height: .97; letter-spacing: -.065em; font-weight: 720; }
h1 em { font-family: Georgia, serif; font-weight: 400; color: var(--forest); }
.intro-copy { max-width: none; padding-bottom: 0; display: grid; grid-template-columns: 1fr; gap: 4px; align-items: start; }
.subtitle { margin: 0; color: var(--ink); font-size: 17px; line-height: 1.5; font-weight: 650; }
.lede { margin: 0; color: var(--muted); font-size: clamp(12px, 1.05vw, 15px); line-height: 1.7; }
.subtitle, .lede { white-space: nowrap; }
.lede code { padding: 1px 4px; border-radius: 4px; background: #e8e6df; font: .9em var(--mono); }
.workspace, .report { margin: 0 clamp(12px, 3vw, 44px) 30px; padding: clamp(20px, 3vw, 40px); border: 1px solid var(--line); border-radius: 24px; background: var(--panel); box-shadow: 0 24px 70px rgba(31, 50, 42, .06); }
.settings-row, .setting-block, .report-summary, .report-title-group { display: flex; align-items: center; }
.settings-row, .report-summary { justify-content: space-between; gap: 24px; }
.setting-block, .report-title-group { gap: 14px; }
.setting-block h2, .report-heading { margin: 0; font-size: 17px; font-weight: 700; }
.setting-block p, .report-line { display: block; margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.step { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; font: 11px var(--mono); color: var(--muted); }
.step.dark { color: white; border-color: var(--forest); background: var(--forest); }
.segmented { min-width: 0; margin: 0; padding: 4px; display: flex; border: 1px solid var(--line); border-radius: 12px; background: #efede6; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { min-height: 40px; padding: 0 15px; display: flex; align-items: center; border-radius: 8px; font-size: 13px; }
.segmented input:checked + span { color: white; background: var(--forest); box-shadow: 0 3px 9px rgba(21, 52, 41, .18); }
.segmented input:focus-visible + span, .field-option input:focus-visible + span { outline: 3px solid rgba(48, 100, 80, .35); outline-offset: 2px; }
.field-row { min-width: 0; margin: 24px 0 16px; padding: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; border: 0; }
.field-label { margin-right: 5px; color: var(--muted); font-size: 12px; }
.field-option { position: relative; cursor: pointer; }
.field-option input { position: absolute; opacity: 0; pointer-events: none; }
.field-option span { display: block; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: #f4f2ec; font: 11px var(--mono); }
.field-option input:checked + span { color: var(--forest); border-color: #789b8d; background: #e8f2ed; }
.custom-field-list { display: contents; }
.custom-field-chip { display: flex; align-items: center; }
.custom-field-chip .field-option span { padding-right: 24px; }
.remove-field { width: 24px; height: 24px; margin-left: -25px; z-index: 1; display: grid; place-items: center; border: 0; border-radius: 50%; color: #65716b; background: transparent; font: 16px/1 var(--sans); cursor: pointer; }
.remove-field:hover { color: var(--ink); background: #d7e5de; }
.custom-field-editor { min-height: 31px; display: flex; align-items: center; border: 1px solid #789b8d; border-radius: 999px; background: white; }
.custom-field-editor input { width: 112px; padding: 7px 10px; border: 0; border-radius: inherit; outline: 0; color: var(--forest); background: transparent; font: 11px var(--mono); }
.custom-field-editor:focus-within { outline: 3px solid rgba(48, 100, 80, .35); outline-offset: 2px; }
.custom-field-editor:has(input[aria-invalid="true"]) { border-color: #b35a4e; }
.add-field { width: 31px; height: 31px; padding: 0; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: #f4f2ec; font: 16px/1 var(--mono); cursor: pointer; }
.add-field:hover { color: var(--forest); border-color: #789b8d; background: #e8f2ed; }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
.editor-card { min-width: 0; min-height: 470px; background: #fbfaf5; }
.editor-card + .editor-card { border-left: 1px solid var(--line); background: #f1efe8; }
.editor-card header { min-height: 54px; padding: 9px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); }
.editor-card header > div:first-child { display: grid; gap: 3px; }
.editor-card header span { font-size: 12px; font-weight: 700; }
.editor-card header small { color: var(--muted); font: 10px var(--mono); }
.editor-actions { display: flex; align-items: center; gap: 4px; }
.editor-actions button { min-height: 36px; padding: 6px 9px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.editor-actions button:hover { color: var(--ink); background: #e8e6df; }
.editor-actions button:disabled { opacity: .4; cursor: default; }
.sync-control { min-height: 36px; display: flex; align-items: center; gap: 6px; padding: 5px 8px; color: var(--muted); font-size: 12px; white-space: nowrap; cursor: pointer; }
.sync-control input { margin: 0; accent-color: var(--forest); }
.editor-card textarea { display: block; width: 100%; min-height: 415px; height: clamp(415px, 52vh, 620px); resize: vertical; overflow: auto; overflow-wrap: normal; word-break: normal; padding: 20px; border: 0; outline: 0; background: transparent; color: #23332d; white-space: pre; font: 13px/1.72 var(--mono); tab-size: 2; }
.editor-card textarea.drag-active { background: #eef6f1; box-shadow: inset 0 0 0 3px #6ba487; }
.output-view { width: 100%; min-height: 415px; margin: 0; padding: 20px; overflow: auto; color: #23332d; background: transparent; white-space: pre; font: 13px/1.72 var(--mono); tab-size: 2; }
.output-view pre { margin: 0; font: inherit; }
.output-view code { font: inherit; }
.diff-added { margin: 0 -2px; padding: 1px 2px; border-radius: 3px; color: #164c35; background: #bdebcf; box-shadow: inset 0 -1px 0 #70bd8e; }
.empty-state { min-height: 415px; display: grid; place-content: center; gap: 8px; text-align: center; color: var(--muted); }
.empty-state b { color: #45534e; font-size: 14px; }
.empty-state > span:last-child { font-size: 12px; }
.empty-mark { width: 78px; height: 44px; margin: 0 auto 7px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.45); font: 12px var(--mono); }
.action-row { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.action-row p { margin: 0; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.primary-action { min-width: min(300px, 100%); min-height: 54px; padding: 0 22px; display: flex; justify-content: space-between; align-items: center; border: 0; border-radius: 12px; background: var(--accent); font-weight: 750; cursor: pointer; box-shadow: 0 6px 0 #b6d84b; transition: transform .15s, box-shadow .15s; }
.primary-action:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 0 #b6d84b; }
.primary-action:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 #b6d84b; }
.primary-action:disabled { color: #809070; background: #e5edcc; box-shadow: none; cursor: wait; }
.primary-action span { font-size: 21px; }
.report { padding-bottom: 26px; }
.report:not([open]) { padding-bottom: clamp(20px, 3vw, 40px); }
.report-summary { list-style: none; cursor: pointer; }
.report-summary::-webkit-details-marker { display: none; }
.report-summary::after { content: "+"; display: grid; place-items: center; width: 28px; height: 28px; margin-left: 8px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font: 16px var(--mono); }
.report[open] .report-summary::after { content: "−"; }
.report-summary .profile-badge { margin-left: auto; }
.profile-badge { padding: 8px 11px; border-radius: 999px; color: var(--forest); background: #e8f2ed; font: 10px var(--mono); text-transform: uppercase; }
.change-list { margin-top: 24px; border-top: 1px solid var(--line); }
.change-list article { padding: 17px 0; display: grid; grid-template-columns: 180px 1fr; gap: 18px; border-bottom: 1px solid var(--line); }
.change-meta { display: flex; align-items: center; flex-wrap: wrap; align-content: center; gap: 6px; }
.change-meta span, .change-meta i { padding: 4px 6px; border-radius: 4px; background: #eceae3; font: 9px var(--mono); font-style: normal; }
.change-meta i { color: #456758; background: #e3eee8; }
.change-meta code { width: 100%; color: var(--muted); font: 11px var(--mono); overflow: hidden; text-overflow: ellipsis; }
.change-values { display: grid; grid-template-columns: 1fr 22px 1fr; align-items: center; gap: 10px; font: 12px/1.5 var(--mono); }
.change-values del { color: #7c6a66; text-decoration-color: #c79d91; }
.change-values ins { color: #205440; text-decoration: none; font-weight: 700; }
.change-values b { color: #93a099; text-align: center; }
.no-change { color: var(--muted); font-size: 13px; }
.warning-box { margin-top: 18px; padding: 16px; border: 1px solid #e1c76b; border-radius: 10px; background: var(--warning); font-size: 12px; }
.warning-box ul { margin: 8px 0 0; padding-left: 20px; line-height: 1.7; }
footer { padding: 30px clamp(20px, 5vw, 72px); display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 30px; border-top: 1px solid var(--line); color: var(--muted); }
footer p { margin: 0; text-align: right; font-size: 10px; line-height: 1.6; }
.footer-details { display: grid; gap: 4px; }
footer a { color: #48685b; text-underline-offset: 2px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 5; padding: 10px 14px; border-radius: 8px; color: white; background: var(--forest); font-size: 12px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: .2s; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.clipboard-helper { position: fixed; top: 0; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.noscript-message { margin: 0; padding: 12px 20px; color: #3d310e; background: var(--warning); text-align: center; font-size: 13px; }
@keyframes pulse { 50% { opacity: .35; } }
@media (max-width: 880px) {
  h1 { white-space: normal; }
  .intro-copy { max-width: 680px; }
  .subtitle, .lede { white-space: normal; }
  .lede { font-size: 15px; }
  .editor-grid { grid-template-columns: 1fr; }
  .editor-card + .editor-card { border-left: 0; border-top: 1px solid var(--line); }
  footer { grid-template-columns: 1fr; justify-items: center; }
  footer p { text-align: center; }
}
@media (max-width: 600px) {
  h1 { font-size: clamp(34px, 11vw, 44px); }
  .header-meta { display: none; }
  .settings-row, .action-row { align-items: stretch; flex-direction: column; }
  .segmented { width: 100%; }
  .segmented label { flex: 1; }
  .segmented span { justify-content: center; }
  .field-option span { min-height: 40px; display: flex; align-items: center; }
  .custom-field-editor, .add-field { min-height: 40px; }
  .add-field { width: 40px; }
  .editor-card header { align-items: flex-start; flex-direction: column; }
  .editor-actions { width: 100%; flex-wrap: wrap; }
  .editor-actions button, .sync-control { min-height: 44px; }
  .change-list article { grid-template-columns: 1fr; }
  .change-values { grid-template-columns: 1fr; }
  .change-values b { text-align: left; }
  .report-summary { flex-wrap: wrap; }
  .report-summary .profile-badge { order: 3; margin: 10px 0 0 48px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
