:root {
  color-scheme: light;
  --ink: #18382f;
  --muted: #62756d;
  --line: #dce5df;
  --accent: #21644e;
  --accent-dark: #164b39;
  --code-font-size: 16px;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: #f4f6f3;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button, label.file-button, summary { cursor: pointer; }
button:disabled { opacity: .42; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 3px solid #4e98dd; outline-offset: 3px;
}
button { transition: background .15s, border-color .15s; }
button:not(:disabled):hover { filter: brightness(.96); }
.topbar { min-height: 64px; background: white; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 12px 28px; gap: 20px; }
.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--ink); font-size: 21px; font-weight: 650; letter-spacing: -.5px; }
.brand b { font-weight: 450; color: var(--muted); }
.brand-icon { display: grid; place-items: center; width: 40px; height: 40px; background: var(--accent-dark); color: white; border-radius: 10px; font: 20px monospace; flex-shrink: 0; }
.header-right { display: flex; align-items: center; gap: 18px; }
.local-badge { color: #24614c; background: #eef6ee; padding: 6px 12px; border-radius: 20px; font-size: 13px; white-space: nowrap; }
.local-badge i { display: inline-block; width: 7px; height: 7px; background: #31865f; border-radius: 50%; margin-right: 7px; }
.version { font-size: 13px; color: var(--muted); white-space: nowrap; }
main { max-width: 1920px; margin: auto; padding: 22px 28px; }
.intro { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 0 0 22px; }
.eyebrow { font-size: 12px; font-weight: 750; letter-spacing: 1.5px; color: #5c7667; margin: 0 0 6px; }
h1 { font-size: clamp(28px, 2.3vw, 36px); line-height: 1.15; letter-spacing: -1px; font-weight: 650; margin: 0 0 8px; }
.subtitle { margin: 0; color: var(--muted); font-size: 16px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid #cfdcd3; background: white; color: var(--ink); border-radius: 7px; padding: 9px 14px; white-space: nowrap; font-size: 15px; font-weight: 550; min-height: 39px; }
.button.primary { background: var(--accent); color: white; border-color: var(--accent); }
.button.small { font-size: 14px; padding: 6px 10px; gap: 6px; min-height: 35px; }
.button.secondary { background: white; }
.comparison-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.changes-sidebar { background: white; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; min-width: 0; }
.changes-header { padding: 20px 18px 14px; border-bottom: 1px solid var(--line); }
.changes-header h2 { margin: 0 0 6px; font-size: 23px; line-height: 1.25; letter-spacing: -.5px; }
.changes-header .eyebrow { font-size: 11px; }
#changes-summary { margin: 0; font-size: 14px; color: var(--muted); }
.changes-list { list-style: none; margin: 0; padding: 10px; max-height: clamp(300px, 59vh, 760px); overflow-y: auto; overscroll-behavior: contain; }
.changes-list:empty { display: none; }
.change-item { background: #fbfcfa; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 9px; overflow: hidden; }
.change-item:last-child { margin-bottom: 0; }
.change-item.is-active { background: #f0f7ef; border-color: var(--accent); box-shadow: inset 3px 0 var(--accent); }
.change-jump { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; width: 100%; border: 0; background: none; text-align: left; color: var(--ink); padding: 12px; min-width: 0; }
.change-kind { font-size: 14px; font-weight: 700; }
.change-lines { font-size: 14px; color: #3c6151; font-weight: 550; }
.change-preview { display: block; font: 12px/1.6 "SFMono-Regular", Consolas, "Liberation Mono", monospace; color: var(--muted); max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; }
.change-apply { display: block; margin: 0 10px 10px; border: 1px solid #c4d8c9; border-radius: 5px; padding: 6px 10px; background: white; color: var(--accent-dark); font-size: 14px; font-weight: 600; }
.changes-tip { margin: 0; padding: 14px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.workspace { background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 4px 18px #1e382b05; overflow: hidden; min-width: 0; }
.toolbar { min-height: 57px; border-bottom: 1px solid var(--line); padding: 10px 15px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.toolbar-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.toolbar label { font-size: 14px; color: var(--muted); }
select { border: 1px solid #dce5df; border-radius: 5px; padding: 6px 8px; color: var(--ink); background: #f5f8f4; font-size: 14px; max-width: 170px; min-height: 35px; }
.checkbox { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.checkbox input { accent-color: var(--accent); width: 16px; height: 16px; }
.toolbar-divider { height: 18px; width: 1px; background: var(--line); margin: 0 7px; }
.review-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 15px; border-bottom: 1px solid var(--line); background: #f5f8f3; }
#change-position { min-width: 50px; text-align: center; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--muted); }
.action-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 15px; border-bottom: 1px solid var(--line); }
.action-toolbar #download { margin-left: auto; }
.diff-count { font-size: 14px; font-weight: 600; color: var(--accent-dark); }
.pane-heads { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border-bottom: 1px solid var(--line); background: #fcfdfb; }
.pane-head { padding: 15px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.pane-head + .pane-head { border-left: 1px solid var(--line); }
.side-tag { width: 34px; height: 34px; border-radius: 7px; display: grid; place-items: center; font-weight: 700; font-size: 16px; flex-shrink: 0; }
.side-tag.original { background: #fff0ed; color: #a44935; }
.side-tag.result { background: #e5f3e7; color: #27734d; }
.pane-description { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }
.pane-description strong { font-size: 16px; font-weight: 600; }
.pane-description span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-button { position: relative; overflow: hidden; flex-shrink: 0; }
.file-button:focus-within { outline: 3px solid #4e98dd; outline-offset: 2px; }
.file-button input { position: absolute; opacity: 0; inset: 0; width: 100%; cursor: pointer; }
#editors { min-height: 340px; min-width: 0; }
.cm-mergeView { height: clamp(340px, 49vh, 720px); overflow: auto; font-size: var(--code-font-size, 16px); }
.cm-mergeViewEditors { min-height: 100%; }
.cm-mergeViewEditor { min-width: 0; }
.cm-editor { min-height: 100%; }
.cm-scroller { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace !important; line-height: 1.65 !important; }
.cm-content { padding: 16px 0 !important; min-height: 100%; }
.cm-line { padding: 0 12px !important; }
.cm-gutters { background: #f8faf6 !important; border-right: 1px solid #e7ece5 !important; color: #6f8278 !important; }
.cm-lineNumbers .cm-gutterElement { min-width: 42px !important; padding: 0 9px 0 7px !important; }
.cm-merge-revert { min-width: 42px; background: #f4f7f1 !important; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.cm-merge-revert button { background: white !important; border: 1px solid #bed8ca !important; color: #27734d !important; border-radius: 5px !important; width: 29px; height: 29px; font-size: 18px !important; margin-left: 6px; padding: 0 !important; cursor: pointer; transform: translateY(1px); }
.cm-merge-a .cm-changedLine { background: #fff0eb !important; }
.cm-merge-b .cm-changedLine { background: #eaf6e9 !important; }
.cm-deletedText { background: #ffd3c5 !important; text-decoration: none !important; }
.cm-insertedText { background: #bde8c3 !important; }
.cm-placeholder { color: #7e8b82 !important; }
.cm-focused { outline: 0 !important; }
.cm-selectionBackground { background: #cfe2f6 !important; }
.cm-cursor { border-left-color: #172b3b !important; }
.pane-feet { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: #fcfdfb; border-top: 1px solid var(--line); font: 12px/1.5 monospace; color: var(--muted); }
.pane-feet span { padding: 8px 15px; overflow-wrap: anywhere; }
.pane-feet span + span { border-left: 1px solid var(--line); }
.result-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 15px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.result-label { font-size: 14px; font-weight: 600; margin-right: 4px; }
.export-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
#filename { width: 165px; min-width: 90px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 14px; color: var(--ink); background: #fcfdfb; }
.below-workspace { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 14px 0 22px; }
.legend { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.removed { background: #eba48e; }.added { background: #86c48d; }
.hint-arrow { background: white; border: 1px solid var(--line); width: 22px; height: 22px; justify-content: center; color: var(--accent); }
.text-button { background: none; border: 0; color: #63766b; font-size: 14px; padding: 5px; white-space: nowrap; }
footer { display: flex; justify-content: space-between; gap: 20px; color: #63766b; font-size: 13px; }
.help { margin-top: 18px; color: var(--muted); font-size: 14px; max-width: 1000px; }
.help summary { color: #385d4a; }.help p { line-height: 1.7; }
.format-notice { padding: 10px 15px; display: flex; justify-content: space-between; gap: 15px; align-items: center; background: #fff8e8; color: #775e25; font-size: 14px; flex-wrap: wrap; }
.format-notice[hidden] { display: none; }
#toast { position: fixed; top: 80px; right: 24px; max-width: min(420px, 90vw); padding: 12px 18px; background: #193c2e; color: white; font-size: 15px; border-radius: 8px; box-shadow: 0 6px 30px #0003; z-index: 100; pointer-events: none; }
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 24px; max-width: min(440px, 95vw); color: var(--ink); }
dialog::backdrop { background: #122c3a66; }dialog h2 { font-size: 23px; margin: 0 0 10px; }dialog p { color: var(--muted); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
#syntax-report { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border-top: 1px solid var(--line); background: #fcfdfb; }
.syntax-side { padding: 10px 15px; min-width: 0; }.syntax-side + .syntax-side { border-left: 1px solid var(--line); }
.syntax-heading { display: flex; align-items: center; gap: 8px; font-size: 14px; }.syntax-heading b { font: 600 13px monospace; color: #6b7e73; }
.syntax-side p { font-size: 13px; color: var(--muted); margin: 3px 0 0; overflow-wrap: anywhere; }
.syntax-side[data-state=error] .syntax-heading { color: #a63027; }.syntax-side[data-state=warning] .syntax-heading { color: #90620d; }.syntax-side[data-state=checked] .syntax-heading { color: #27734d; }.syntax-side[data-state=pending] .syntax-heading { color: var(--muted); }
.syntax-side details { font-size: 13px; margin-top: 5px; }.syntax-side ol { list-style: none; padding: 0; margin: 4px 0 0; max-height: 140px; overflow: auto; }
.diagnostic { display: block; text-align: left; font-size: 14px; line-height: 1.5; border: 0; background: none; padding: 5px 0; color: #a63027; white-space: normal; overflow-wrap: anywhere; width: 100%; }
.diagnostic.warning { color: #90620d; }.diagnostic:hover { text-decoration: underline; }.cm-lint-marker { cursor: pointer; }.syntax-side [hidden] { display: none; }
@media (max-width: 1350px) {
  main { padding: 20px; }.comparison-layout { grid-template-columns: 265px minmax(0, 1fr); gap: 12px; }
  .pane-head { flex-wrap: wrap; }.pane-description { flex-basis: calc(100% - 50px); }.pane-head .file-button { margin-left: 44px; }
}
@media (max-width: 1100px) {
  .comparison-layout { grid-template-columns: minmax(0, 1fr); }
  .changes-sidebar { display: grid; grid-template-columns: 210px minmax(0, 1fr); }
  .changes-header { border-bottom: 0; border-right: 1px solid var(--line); padding: 16px; }
  .changes-list { max-height: 200px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: max-content; align-content: start; gap: 8px; }
  .change-item { margin: 0; }.changes-tip { grid-column: 1 / -1; padding: 8px 16px; }
  .pane-head { flex-wrap: nowrap; }.pane-description { flex-basis: auto; }.pane-head .file-button { margin-left: 0; }
  .topbar { padding: 12px 20px; }
  footer { flex-direction: column; gap: 4px; }
}
@media (max-width: 720px) {
  .topbar { padding: 12px; gap: 10px; }.brand { font-size: 17px; gap: 8px; }.brand-icon { width: 32px; height: 32px; font-size: 17px; }.local-badge { font-size: 12px; padding: 5px 8px; }.header-right { gap: 0; }
  main { padding: 18px 12px; }.intro { align-items: flex-start; flex-wrap: wrap; gap: 12px; }.subtitle { font-size: 15px; }
  .changes-sidebar { display: block; }.changes-header { border-right: 0; padding: 12px 14px; }.changes-header .eyebrow { display: none; }.changes-header h2 { font-size: 21px; }
  .changes-list { display: block; max-height: 185px; padding-top: 0; }.change-item { margin-bottom: 8px; }.changes-tip { padding: 8px 14px; }
  .toolbar, .review-toolbar, .action-toolbar { padding: 10px; gap: 10px; }.toolbar-group { gap: 7px; }#use-current { margin-left: 0; }
  .pane-head { flex-wrap: wrap; padding: 12px; gap: 8px; }.pane-description { flex-basis: calc(100% - 44px); }.pane-head .file-button { margin-top: 3px; }
  .pane-description strong { font-size: 15px; }.cm-mergeView { height: 440px; }.cm-merge-revert { min-width: 34px; }.cm-merge-revert button { margin-left: 3px; width: 27px; }
  .pane-feet span { padding: 8px; }.result-bar { padding: 12px; }.export-controls { width: 100%; }#filename { flex: 1; }
  .below-workspace { align-items: flex-start; flex-wrap: wrap; gap: 10px; }.legend { gap: 8px; }.syntax-side { padding: 9px; }.syntax-heading { align-items: flex-start; }
}
@media (max-width: 420px) { .local-badge { display: none; }.review-toolbar .button { font-size: 13px; }.change-navigation { gap: 5px; }#change-position { min-width: 42px; } }

/* Focus and review controls keep file content and display options separate. */
.view-options { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 20px; padding: 10px 15px; border-bottom: 1px solid var(--line); font-size: 14px; background: #fbfcfa; }
.view-options span { color: var(--muted); font-size: 13px; }
#review-progress { color: #416252; font-size: 14px; }
#keep-current { margin-left: 0; }
#use-current { margin-left: 0; }
.change-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px 10px; }
.change-actions .change-apply, .change-actions .change-keep { margin: 0; }
.change-keep { border: 1px solid #c4d8c9; border-radius: 5px; padding: 6px 10px; background: white; color: var(--accent-dark); font-size: 14px; font-weight: 600; }
.change-item.is-reviewed { background: #f3f5f3; }
.change-item.is-reviewed .change-kind::after { content: ' · Reviewed'; color: #416252; }
.cm-collapsedLines { cursor: pointer; border-block: 1px dashed #b9d0bf; color: #385d4a !important; background: #eff5ed !important; font: 13px/1.8 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important; padding: 3px 8px !important; text-align: center; }
.cm-collapsedLines:hover { background: #e4f0e0 !important; }
.cm-collapsedLines:focus-visible { outline: 2px solid #4e98dd; outline-offset: -2px; }
@media (max-width: 720px) { #keep-current { margin-left: 0; } .view-options { padding: 10px; } }
