:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
  --bg: #0b111d;
  --surface: #121b2a;
  --surface-2: #172235;
  --surface-3: #1b2940;
  --text: #e8edf5;
  --muted: #91a0b5;
  --subtle: #64748b;
  --line: rgba(161, 180, 207, .16);
  --line-strong: rgba(161, 180, 207, .25);
  --accent: #8bd5c2;
  --accent-strong: #61c5aa;
  --accent-soft: rgba(97, 197, 170, .12);
  --blue: #8bb8ee;
  --red: #e18d91;
  --green: #78c9a9;
  --shadow: 0 18px 50px rgba(0, 0, 0, .18);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); min-width: 320px; transition: background .2s, color .2s; }
body[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5f7; --surface: #ffffff; --surface-2: #f6f8fa; --surface-3: #eaf0f5;
  --text: #1d2939; --muted: #617186; --subtle: #8b99aa; --line: rgba(46, 64, 86, .12);
  --line-strong: rgba(46, 64, 86, .22); --accent: #218b75; --accent-strong: #167861;
  --accent-soft: rgba(33, 139, 117, .09); --blue: #386fa8; --red: #b84e57; --green: #23845f;
  --shadow: 0 18px 50px rgba(35, 55, 80, .08);
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.app-shell { width: min(1440px, calc(100% - 64px)); margin: 0 auto; }
.topbar { height: 82px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border: 1px solid rgba(139, 213, 194, .5); border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 3px; background: var(--accent-soft); }
.brand-mark span { display: block; width: 3px; border-radius: 4px; background: var(--accent); }
.brand-mark span:nth-child(1) { height: 10px; }.brand-mark span:nth-child(2) { height: 17px; }.brand-mark span:nth-child(3) { height: 13px; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.12; }
.brand-copy strong { font-size: 17px; letter-spacing: -.7px; font-weight: 750; }.brand-copy strong span { color: var(--accent); }
.brand-copy small { color: var(--subtle); font-size: 9px; letter-spacing: 1.25px; text-transform: uppercase; margin-top: 4px; }
.top-actions { display: flex; align-items: center; gap: 13px; }
.privacy-pill, .connection-pill { font-size: 11px; color: var(--muted); letter-spacing: .2px; }
.privacy-pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 30px; padding: 7px 10px; }
.privacy-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.connection-pill { color: var(--subtle); }.connection-pill.online { color: var(--green); }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); background: transparent; color: var(--muted); }
.icon-button:hover { background: var(--surface-2); color: var(--text); }.icon-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.install-button { border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent); padding: 8px 12px; border-radius: 8px; font-size: 11px; font-weight: 700; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; padding: 54px 0 42px; }
.hero-copy { max-width: 720px; }.eyebrow { color: var(--accent); font-size: 10px; font-weight: 750; letter-spacing: 1.7px; display: flex; align-items: center; gap: 9px; margin-bottom: 17px; }.eyebrow-line { width: 22px; height: 1px; background: var(--accent); }
h1 { margin: 0; font-size: clamp(34px, 4.2vw, 55px); line-height: 1.03; letter-spacing: -2.6px; font-weight: 760; }
h1 em { color: var(--accent); font-style: normal; }
.hero-copy p { color: var(--muted); margin: 17px 0 0; max-width: 660px; font-size: 14px; line-height: 1.7; }
.hero-note { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; min-width: 290px; box-shadow: var(--shadow); }
.note-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-family: Georgia, serif; font-size: 19px; }
.hero-note div:nth-child(2) { display: flex; flex-direction: column; gap: 4px; }.hero-note strong { font-size: 11px; }.hero-note span { font-size: 10px; color: var(--muted); }.note-check { margin-left: auto; color: var(--accent); font-size: 18px; }
.workspace { background: var(--surface); border: 1px solid var(--line); border-radius: 15px; overflow: hidden; box-shadow: var(--shadow); }
.workspace-toolbar { height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 13px; }.toolbar-left strong { font-size: 12px; }.section-kicker { color: var(--accent); font: 700 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .5px; }
.toolbar-separator { height: 15px; width: 1px; background: var(--line-strong); }.subtle-label, .panel-hint { color: var(--subtle); font-size: 10px; }
.text-button { color: var(--muted); background: none; border: 0; font-size: 11px; padding: 7px 8px; border-radius: 6px; }.text-button:hover { color: var(--text); background: var(--surface-3); }.text-button.danger-hover:hover { color: var(--red); }.button-symbol { color: var(--accent); font-size: 16px; margin-right: 4px; vertical-align: -1px; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr); min-height: 350px; }
.editor-panel { min-width: 0; display: flex; flex-direction: column; }.source-panel { border-right: 0; }.result-panel { border-left: 0; }
.panel-heading { height: 48px; padding: 0 17px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.panel-heading > div { display: flex; align-items: center; gap: 8px; }.panel-heading strong { font-size: 11px; }.panel-dot { width: 7px; height: 7px; border-radius: 50%; }.source-dot { background: var(--blue); }.result-dot { background: var(--accent); }
.panel-caption { color: var(--subtle); font: 700 8px ui-monospace, monospace; letter-spacing: .9px; border: 1px solid var(--line); border-radius: 4px; padding: 3px 5px; }.ready-indicator { color: var(--subtle); font-size: 9px; display: flex; align-items: center; gap: 6px; }.ready-indicator > span { width: 6px; height: 6px; border-radius: 50%; background: var(--subtle); }.ready-indicator.is-ready { color: var(--accent); }.ready-indicator.is-ready > span { background: var(--accent); }.ready-indicator .status-ok { background: var(--green); }
textarea { display: block; width: 100%; min-height: 250px; flex: 1; resize: vertical; border: 0; outline: 0; background: transparent; color: var(--text); padding: 19px 20px; font: 12px/1.75 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 2; }
textarea::placeholder { color: var(--subtle); opacity: .8; }.result-panel textarea { color: var(--accent); background: rgba(97, 197, 170, .025); }
.panel-footer { min-height: 33px; display: flex; justify-content: space-between; align-items: center; padding: 0 17px; border-top: 1px solid var(--line); color: var(--subtle); font-size: 9px; }
.center-rail { display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--surface-2); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }.rail-line { flex: 1; width: 1px; background: var(--line-strong); }.rail-icon { width: 25px; height: 25px; margin: 10px 0; border: 1px solid var(--line-strong); border-radius: 50%; display: grid; place-items: center; font-size: 13px; color: var(--accent); background: var(--surface); }
.controls-area { display: flex; align-items: stretch; justify-content: space-between; gap: 30px; padding: 18px 20px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }
.rules-block { flex: 1; min-width: 0; }.rules-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }.rules-title strong { font-size: 11px; }.rules-subtitle { color: var(--subtle); font-size: 9px; margin-left: 3px; }
.rule-options { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 9px; }.check-option { display: flex; align-items: flex-start; gap: 9px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; min-width: 0; }.check-option:hover { border-color: var(--line-strong); background: var(--surface); }.check-option input { position: absolute; opacity: 0; pointer-events: none; }.fake-check { width: 14px; height: 14px; flex: 0 0 14px; margin-top: 1px; border: 1px solid var(--subtle); border-radius: 4px; position: relative; }.check-option input:checked + .fake-check { background: var(--accent); border-color: var(--accent); }.check-option input:checked + .fake-check:after { content: ''; position: absolute; left: 4px; top: 1px; width: 4px; height: 7px; border: solid #0b1d1b; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }.check-option input:focus-visible + .fake-check { outline: 2px solid var(--accent); outline-offset: 2px; }
.check-option > span:last-child { display: flex; flex-direction: column; gap: 4px; min-width: 0; }.check-option strong { font-size: 9px; font-weight: 650; }.check-option small { color: var(--subtle); font-size: 8px; line-height: 1.4; }
.rules-footnote { margin-top: 11px; color: var(--subtle); font-size: 9px; display: flex; align-items: center; gap: 7px; }.info-icon { display: inline-grid; place-items: center; width: 13px; height: 13px; border: 1px solid var(--line-strong); border-radius: 50%; font: 700 8px Georgia, serif; color: var(--muted); }
.run-block { width: 195px; flex: 0 0 195px; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; }.run-meta { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--subtle); font-size: 9px; }.run-meta-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }.format-button { border: 0; border-radius: 8px; min-height: 42px; padding: 0 14px; background: var(--accent); color: #09201b; font-weight: 750; font-size: 11px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 4px 14px rgba(97, 197, 170, .13); }.format-button:hover { background: var(--accent-strong); transform: translateY(-1px); }.format-arrow { font-size: 17px; font-weight: 500; }
.details-section { margin-top: 30px; }.details-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }.details-heading > div:first-child { display: flex; align-items: center; gap: 10px; }.details-heading strong { font-size: 12px; }.view-tabs { display: flex; align-items: center; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }.view-tab { border: 0; background: transparent; color: var(--muted); border-radius: 5px; padding: 7px 12px; font-size: 10px; }.view-tab.active { background: var(--surface-3); color: var(--text); font-weight: 700; }
.view-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; min-height: 190px; }.view-panel[hidden] { display: none; }.diff-header, .preview-topline { min-height: 37px; border-bottom: 1px solid var(--line); padding: 0 14px; display: flex; justify-content: space-between; align-items: center; color: var(--subtle); font: 700 8px ui-monospace, monospace; letter-spacing: .7px; }.diff-legend { display: flex; align-items: center; gap: 5px; font: 9px system-ui; letter-spacing: 0; text-transform: none; }.diff-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-left: 7px; }.legend-removed { background: var(--red); }.legend-added { background: var(--green); }
.diff-content { max-height: 340px; overflow: auto; padding: 8px 0; font: 10px/1.75 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }.diff-line { display: grid; grid-template-columns: 25px 32px minmax(0, 1fr); padding: 0 12px 0 5px; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 18px; }.diff-marker, .diff-number { color: var(--subtle); text-align: center; user-select: none; }.diff-text { color: var(--muted); }.diff-line.removed { background: rgba(225, 141, 145, .09); }.diff-line.removed .diff-marker, .diff-line.removed .diff-text { color: var(--red); }.diff-line.added { background: rgba(120, 201, 169, .10); }.diff-line.added .diff-marker, .diff-line.added .diff-text { color: var(--green); }.no-change, .empty-state { min-height: 148px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); }.no-change-icon { width: 26px; height: 26px; border: 1px solid rgba(120, 201, 169, .35); border-radius: 50%; display: grid; place-items: center; color: var(--green); margin-bottom: 3px; }.no-change strong, .empty-state strong { color: var(--text); font-size: 11px; }.no-change span:last-child, .empty-state span { color: var(--subtle); font-size: 9px; }.empty-glyph { color: var(--subtle); font: 26px Georgia, serif; opacity: .7; margin-bottom: 3px; }
.preview-topline { font-family: system-ui; letter-spacing: 0; font-weight: 500; }.preview-topline span:first-child { font: 700 8px ui-monospace, monospace; letter-spacing: .7px; }.markdown-preview { padding: 22px 26px; color: var(--text); line-height: 1.65; font-size: 12px; max-height: 480px; overflow: auto; }.markdown-preview h1, .markdown-preview h2, .markdown-preview h3, .markdown-preview h4, .markdown-preview h5, .markdown-preview h6 { letter-spacing: -.4px; margin: 1.2em 0 .55em; line-height: 1.3; }.markdown-preview h1 { font-size: 23px; }.markdown-preview h2 { font-size: 19px; }.markdown-preview h3 { font-size: 16px; }.markdown-preview h4, .markdown-preview h5, .markdown-preview h6 { font-size: 13px; }.markdown-preview p { margin: .6em 0 1em; color: var(--muted); }.markdown-preview strong { color: var(--text); }.markdown-preview a { color: var(--blue); }.markdown-preview ul, .markdown-preview ol { padding-left: 22px; color: var(--muted); }.markdown-preview li { padding: 2px 0; }.markdown-preview blockquote { border-left: 2px solid var(--accent); margin: 1em 0; padding: 3px 14px; background: var(--accent-soft); }.markdown-preview blockquote p { margin: .35em 0; }.markdown-preview hr { border: 0; border-top: 1px solid var(--line-strong); margin: 18px 0; }.markdown-preview code { font: 11px ui-monospace, monospace; background: var(--surface-3); color: var(--accent); padding: 2px 5px; border-radius: 4px; }.markdown-preview .math-inline { color: var(--blue); background: rgba(139, 184, 238, .08); }.preview-code, .preview-math { padding: 13px 15px; margin: 12px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--blue); font: 11px/1.65 ui-monospace, monospace; white-space: pre; }.preview-code { color: var(--muted); }.preview-code code { padding: 0; background: none; color: inherit; }.table-scroll { overflow-x: auto; margin: 12px 0; }.markdown-preview table { border-collapse: collapse; width: 100%; font-size: 11px; }.markdown-preview th, .markdown-preview td { padding: 7px 10px; border: 1px solid var(--line-strong); text-align: left; }.markdown-preview th { background: var(--surface-2); color: var(--text); }.markdown-preview td { color: var(--muted); }
.export-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }.export-info { display: flex; align-items: center; gap: 11px; }.export-icon { width: 31px; height: 31px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 18px; }.export-info div { display: flex; flex-direction: column; gap: 4px; }.export-info strong { font-size: 10px; }.export-info small { color: var(--subtle); font-size: 9px; }.export-actions { display: flex; align-items: center; gap: 8px; }.filename-wrap { display: flex; align-items: center; gap: 5px; padding: 0 9px; height: 34px; border: 1px solid var(--line); border-radius: 7px; color: var(--subtle); font-size: 9px; }.filename-wrap input { width: 120px; border: 0; background: transparent; color: var(--text); outline: 0; font: 10px ui-monospace, monospace; }.filename-wrap b { font-weight: 500; color: var(--subtle); }.secondary-button, .primary-button { height: 35px; border-radius: 7px; padding: 0 12px; font-size: 10px; font-weight: 700; }.secondary-button { border: 1px solid var(--line-strong); color: var(--text); background: var(--surface-2); }.secondary-button:hover:not(:disabled) { background: var(--surface-3); }.primary-button { border: 1px solid var(--accent); background: var(--accent); color: #09201b; }.primary-button:hover:not(:disabled) { background: var(--accent-strong); }.secondary-button:disabled, .primary-button:disabled { cursor: not-allowed; opacity: .4; }
.principles-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; padding: 24px 5px 26px; }.principles-row > div { display: flex; align-items: center; gap: 10px; }.principle-icon { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 8px; display: grid; place-items: center; color: var(--accent); font: 16px Georgia, serif; }.principles-row > div > span:last-child { display: flex; flex-direction: column; gap: 3px; }.principles-row strong { font-size: 9px; }.principles-row small { color: var(--subtle); font-size: 8px; }.footer { border-top: 1px solid var(--line); min-height: 54px; display: flex; align-items: center; justify-content: space-between; color: var(--subtle); font: 8px ui-monospace, monospace; letter-spacing: .5px; }.footer-separator { color: var(--accent); padding: 0 5px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; background: var(--text); color: var(--bg); border-radius: 9px; padding: 11px 15px; font-size: 11px; font-weight: 650; box-shadow: var(--shadow); transition: opacity .2s, transform .2s; z-index: 10; max-width: calc(100% - 32px); text-align: center; }.toast.visible { opacity: 1; transform: translate(-50%, 0); }.toast.warning { background: #e8bf78; color: #292013; }
@media (max-width: 1000px) { .app-shell { width: min(100% - 36px, 900px); }.hero { padding: 42px 0 32px; }.hero-note { min-width: 240px; }.rule-options { grid-template-columns: repeat(2, minmax(130px, 1fr)); }.controls-area { gap: 20px; }.rules-subtitle { display: none; } }
@media (max-width: 720px) { .app-shell { width: calc(100% - 28px); }.topbar { height: 68px; }.privacy-pill { display: none; }.connection-pill { font-size: 9px; }.hero { display: block; padding: 36px 0 25px; }.hero-copy p { font-size: 12px; }.hero-note { margin-top: 20px; width: 100%; }.editor-grid { grid-template-columns: 1fr; }.center-rail { display: none; }.editor-panel { min-height: 290px; }.source-panel { border-bottom: 1px solid var(--line); }.panel-heading { height: 43px; }.controls-area { display: block; padding: 16px 14px; }.rule-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }.run-block { width: 100%; margin-top: 15px; }.run-meta { justify-content: flex-start; }.format-button { width: 100%; }.workspace-toolbar { padding: 0 12px; }.subtle-label, .toolbar-separator { display: none; }.export-bar { display: block; }.export-actions { flex-wrap: wrap; margin-top: 14px; }.filename-wrap { flex: 1 1 100%; }.filename-wrap input { flex: 1; }.secondary-button, .primary-button { flex: 1; }.principles-row { grid-template-columns: repeat(2, 1fr); gap: 16px 10px; }.footer { align-items: flex-start; justify-content: center; flex-direction: column; gap: 6px; padding: 13px 0; }.preview-topline span:last-child { max-width: 55%; text-align: right; line-height: 1.4; } }
@media (max-width: 390px) { h1 { font-size: 34px; }.brand-copy small { letter-spacing: .7px; }.top-actions { gap: 7px; }.connection-pill { display: none; }.rule-options { grid-template-columns: 1fr; }.panel-hint { display: none; }.toolbar-right { gap: 3px; }.diff-header { gap: 8px; }.diff-legend { font-size: 8px; } }

/* PDF export action */
.pdf-button { height: 35px; border: 1px solid #6f9fca; border-radius: 7px; padding: 0 12px; background: #315f86; color: #fff; font-size: 10px; font-weight: 750; white-space: nowrap; }
.pdf-button:hover:not(:disabled) { background: #3d719b; }
.pdf-button:disabled { cursor: not-allowed; opacity: .4; }
@media (max-width: 720px) { .pdf-button { flex: 1; } }
