/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f5f5f0;
  --bg-surface: #ffffff;
  --bg-card: #fafaf7;
  --bg-hover: #f0efe8;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --accent: #c62828;
  --accent-hover: #b71c1c;
  --accent-light: #ffcdd2;
  --del-bg: rgba(244, 67, 54, 0.12);
  --del-text: #c62828;
  --del-border: #e57373;
  --ins-bg: rgba(46, 125, 50, 0.1);
  --ins-text: #2e7d32;
  --ins-border: #66bb6a;
  --border: #d5d5cc;
  --border-light: #e8e8e0;
  --radius: 6px;
  --radius-sm: 4px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Background collage */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    url('/img/044c8597e93d6a68946d48f73a738c874ec99b9e3aa09763892fd1f271e0e17f.jpg') 0% 0% / 33.33% auto no-repeat,
    url('/img/b06d0f2644a5885752643682e7e5d45f.jpg') 33.33% 0% / 33.33% auto no-repeat,
    url('/img/il_570xN.758037996_jda2.webp') 66.66% 0% / 33.34% auto no-repeat,
    url('/img/p-0236-2.webp') 0% 100% / 25% auto no-repeat,
    url('/img/d5c13c296da7f11f48bf.jpg') 25% 100% / 25% auto no-repeat,
    url('/img/R-27690654-1689516253-1262.jpg') 50% 100% / 25% auto no-repeat;
  opacity: 0.06;
  filter: grayscale(100%);
  pointer-events: none;
}

/* Header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  box-shadow: var(--shadow);
}
header h1 {
  font-size: 18px; font-weight: 800; color: var(--accent);
  text-transform: uppercase; letter-spacing: 1.5px;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.session-id {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-muted);
  cursor: pointer; padding: 2px 8px; background: var(--bg-card); border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}
.session-id:hover { color: var(--accent); }
.header-actions { display: flex; gap: 6px; }

/* Buttons */
.btn {
  padding: 6px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-surface); color: var(--text); font-size: 13px; cursor: pointer;
  transition: all 0.15s; white-space: nowrap; box-shadow: var(--shadow);
}
.btn:hover:not(:disabled) { background: var(--bg-hover); border-color: var(--accent); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-accept { color: var(--ins-text); border-color: var(--ins-border); }
.btn-accept:hover:not(:disabled) { background: var(--ins-bg); }
.btn-reject { color: var(--del-text); border-color: var(--del-border); }
.btn-reject:hover:not(:disabled) { background: var(--del-bg); }

/* Main */
main { flex: 1; overflow: hidden; position: relative; }

/* Steps */
.step { display: none; position: absolute; inset: 0; overflow: auto; }
.step.active { display: flex; }
.step-content { max-width: 700px; margin: 0 auto; padding: 40px 20px; width: 100%; }
.step-center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }

/* Upload */
.upload-area {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 60px 40px;
  text-align: center; cursor: pointer; transition: border-color 0.2s;
  background: var(--bg-surface);
}
.upload-area:hover, .upload-area.dragover { border-color: var(--accent); }
.upload-icon { font-size: 48px; margin-bottom: 16px; }
.upload-area h2 { margin-bottom: 8px; }
.upload-area p { color: var(--text-muted); margin-bottom: 20px; }
.file-info {
  margin-top: 24px; padding: 20px; background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); text-align: center; box-shadow: var(--shadow);
}
.file-info-name { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.file-info-stats { color: var(--text-muted); font-size: 13px; margin-bottom: 16px; }

/* Session Dashboard */
.session-header { margin-bottom: 28px; }
.session-header h2 { font-size: 20px; margin-bottom: 4px; }
.session-sid { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.session-runs-section { margin-bottom: 24px; }
.session-runs-section h3 {
  font-size: 14px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 12px;
}
.session-runs { display: flex; flex-direction: column; gap: 10px; }
.run-card {
  padding: 16px; background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); display: flex; align-items: center; gap: 16px;
  transition: border-color 0.15s; cursor: pointer; box-shadow: var(--shadow);
}
.run-card:hover { border-color: var(--accent); }
.run-card-number {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-light); border: 1px solid var(--del-border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: var(--accent); flex-shrink: 0;
}
.run-card-info { flex: 1; min-width: 0; }
.run-card-mode { font-weight: 600; margin-bottom: 2px; }
.run-card-time { font-size: 12px; color: var(--text-muted); }
.run-status-label { font-weight: 600; }
.run-completed .run-status-label { color: var(--ins-text); }
.run-processing .run-status-label { color: var(--accent); }
.run-error .run-status-label { color: var(--del-text); }
.run-card-decisions { display: flex; gap: 10px; font-size: 11px; margin-top: 4px; }
.run-card-decisions .stat-accepted { color: var(--ins-text); }
.run-card-decisions .stat-rejected { color: var(--del-text); }
.run-card-decisions .stat-pending { color: var(--text-muted); }
.empty-runs {
  color: var(--text-muted); font-size: 14px; padding: 24px;
  text-align: center; background: var(--bg-surface);
  border: 1px dashed var(--border); border-radius: var(--radius);
}
.session-dash-actions { margin-top: 20px; }

/* Sidebar nav */
.sidebar-nav {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; border-bottom: 1px solid var(--border);
}
.sidebar-nav[hidden] { display: none; }
.run-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }

/* Configure */
.presets-section, .params-section { margin-bottom: 24px; }
.presets-section h3, .params-section h3 {
  font-size: 14px; color: var(--text-muted); margin-bottom: 12px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.preset-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.preset-card {
  padding: 14px 16px; background: var(--bg-surface); border: 2px solid var(--border);
  border-radius: var(--radius); cursor: pointer; transition: all 0.15s; box-shadow: var(--shadow);
}
.preset-card:hover { border-color: var(--accent); }
.preset-card.selected { border-color: var(--accent); background: var(--accent-light); }
.preset-card-name { font-weight: 600; margin-bottom: 4px; }
.preset-card-desc { font-size: 12px; color: var(--text-muted); }

.params-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.param-chip {
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 16px;
  background: transparent; color: var(--text-muted); font-size: 12px;
  cursor: pointer; transition: all 0.15s;
}
.param-chip:hover { border-color: var(--accent); color: var(--text); }
.param-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }

.config-actions { display: flex; justify-content: space-between; margin-top: 24px; }

/* Processing */
.spinner {
  width: 48px; height: 48px; border: 4px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-bar {
  width: 300px; height: 4px; background: var(--border); border-radius: 2px; margin-top: 16px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: var(--accent); border-radius: 2px; width: 0%;
  transition: width 0.5s; animation: progress-pulse 2s ease-in-out infinite;
}
@keyframes progress-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }

/* Processing log */
.processing-log {
  width: 100%; max-width: 500px; margin-top: 16px;
  max-height: 200px; overflow-y: auto;
  font-family: var(--font-mono); font-size: 11px; line-height: 1.5;
  text-align: left; color: var(--text-muted);
}
.processing-log .log-line { padding: 1px 0; }
.processing-log .log-ok { color: var(--ins-text); }
.processing-log .log-err { color: var(--del-text); }
.processing-log .log-warn { color: #e65100; }

/* Processing steps */
.processing-steps {
  display: flex; flex-direction: column; gap: 6px; margin: 20px 0 16px;
  text-align: left; width: 100%; max-width: 360px;
}
.processing-step {
  display: flex; align-items: center; gap: 10px; padding: 6px 12px;
  border-radius: var(--radius-sm); font-size: 13px; color: var(--text-muted);
  transition: all 0.3s;
}
.processing-step .step-icon {
  width: 20px; text-align: center; font-size: 14px; flex-shrink: 0;
}
.processing-step.waiting .step-icon::after { content: '\00B7'; }
.processing-step.active {
  color: var(--accent); background: rgba(198,40,40,0.06);
}
.processing-step.active .step-icon::after {
  content: ''; display: inline-block; width: 10px; height: 10px;
  border: 2px solid var(--accent); border-top-color: transparent;
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
.processing-step.done { color: var(--ins-text); }
.processing-step.done .step-icon::after { content: '\2713'; }
.processing-step .step-correctors {
  font-size: 11px; color: var(--text-muted); margin-left: auto;
}

/* Review layout — FULL WIDTH */
#stepReview { flex-direction: row; }

/* Sidebar */
aside {
  width: 340px; min-width: 280px; background: var(--bg-surface);
  border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 2px 0 6px rgba(0,0,0,0.04);
}
.filter-section {
  padding: 12px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.filter-section h3 {
  font-size: 13px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 10px;
}
.filter-group { margin-bottom: 10px; }
.filter-group label {
  display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 4px;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.filter-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  padding: 3px 10px; border: 1px solid var(--border); border-radius: 12px;
  background: transparent; color: var(--text-muted); font-size: 11px;
  cursor: pointer; transition: all 0.15s;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.search-input {
  width: 100%; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-card); color: var(--text); font-size: 12px;
}
.search-input:focus { outline: none; border-color: var(--accent); }
.filter-summary { font-size: 11px; color: var(--text-muted); padding-top: 6px; }

/* Correction list */
.correction-list { flex: 1; overflow-y: auto; padding: 4px 0; }
.correction-item {
  display: flex; align-items: flex-start; gap: 8px; padding: 8px 14px;
  border-bottom: 1px solid var(--border-light); cursor: pointer; transition: background 0.1s; font-size: 13px;
}
.correction-item:hover { background: var(--bg-hover); }
.correction-item.highlight { background: var(--bg-hover); }
.correction-item.status-accepted { border-left: 3px solid var(--ins-border); }
.correction-item.status-rejected { border-left: 3px solid var(--del-border); }
.correction-item-content { flex: 1; min-width: 0; }
.correction-item-text { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.correction-item del {
  color: var(--del-text); background: var(--del-bg); padding: 0 3px; border-radius: 2px;
  text-decoration: line-through;
}
.correction-item ins {
  color: var(--ins-text); background: var(--ins-bg); padding: 0 3px; border-radius: 2px;
  text-decoration: none;
}
.correction-item-meta {
  display: flex; gap: 8px; font-size: 10px; color: var(--text-muted); margin-top: 3px;
}
.correction-item-meta .cat { padding: 1px 6px; background: var(--bg-card); border-radius: 8px; border: 1px solid var(--border-light); }
.correction-item-actions { display: flex; gap: 2px; flex-shrink: 0; }
.action-btn {
  width: 24px; height: 24px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-muted); font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.1s;
}
.action-btn:hover { background: var(--bg-card); }
.action-btn.active-accept { color: #fff; background: var(--ins-text); border-color: var(--ins-border); }
.action-btn.active-reject { color: #fff; background: var(--del-text); border-color: var(--del-border); }
.bulk-actions {
  padding: 8px 14px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-shrink: 0;
}

/* View mode toggle */
.view-mode-toggle {
  display: flex; gap: 0; margin-bottom: 16px;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
}
.view-mode-btn {
  flex: 1; padding: 7px 14px; border: none; background: transparent;
  color: var(--text-muted); font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all 0.15s; text-align: center;
  border-right: 1px solid var(--border);
}
.view-mode-btn:last-child { border-right: none; }
.view-mode-btn:hover { color: var(--text); background: var(--bg-hover); }
.view-mode-btn.active { color: #fff; background: var(--accent); }

/* Tooltip extra lines (hidden by default) */
.tooltip-proposed, .tooltip-original {
  display: none; margin-top: 4px; font-size: 11px; color: var(--text);
}

/* View mode: ORIGINAL */
.view-mode-original .correction-group ins { display: none; }
.view-mode-original .correction-group del {
  text-decoration: none; background: rgba(244,67,54,0.15); color: var(--del-text);
}
.view-mode-original .correction-group:hover .tooltip-proposed { display: block; }
.view-mode-original .correction-group.status-accepted del { opacity: 0.4; }
.view-mode-original .correction-group.status-rejected del { font-weight: 600; opacity: 1; }
.view-mode-original .correction-group.status-accepted ins,
.view-mode-original .correction-group.status-rejected ins { display: none; }

/* View mode: CORRECTED */
.view-mode-corrected .correction-group del { display: none; }
.view-mode-corrected .correction-group ins {
  background: rgba(46,125,50,0.12); color: var(--ins-text);
}
.view-mode-corrected .correction-group:hover .tooltip-original { display: block; }
.view-mode-corrected .correction-group.status-accepted ins { font-weight: 600; }
.view-mode-corrected .correction-group.status-rejected ins { opacity: 0.4; text-decoration: line-through; }
.view-mode-corrected .correction-group.status-accepted del,
.view-mode-corrected .correction-group.status-rejected del { display: none; }

/* Document view — FULL WIDTH */
#documentView { flex: 1; overflow-y: auto; padding: 30px 40px; }
.document-content {
  font-size: 15px; line-height: 1.7;
  white-space: pre-wrap; word-wrap: break-word;
}
.document-content .correction-group {
  position: relative; cursor: pointer; border-radius: 2px;
  transition: outline-color 0.15s; outline: 2px solid transparent;
}
.document-content .correction-group:hover { outline-color: var(--accent); }
.document-content .correction-group.active { outline-color: var(--accent); }
.document-content .correction-group.status-accepted { outline-color: rgba(46,125,50,0.3); }
.document-content .correction-group.status-rejected { outline-color: rgba(244,67,54,0.3); }
.document-content .correction-group.status-accepted del { opacity: 0.4; }
.document-content .correction-group.status-accepted ins { font-weight: 600; }
.document-content .correction-group.status-rejected del { font-weight: 600; }
.document-content .correction-group.status-rejected ins { opacity: 0.4; text-decoration: line-through; }
.document-content .correction-group.dim { opacity: 0.25; }
.document-content del {
  color: var(--del-text); background: var(--del-bg); text-decoration: line-through;
  padding: 1px 2px; border-radius: 2px;
}
.document-content ins {
  color: var(--ins-text); background: var(--ins-bg); text-decoration: none;
  padding: 1px 2px; border-radius: 2px;
}
.document-content .tooltip {
  display: none; position: absolute; bottom: calc(100% + 6px); left: 0;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 6px 10px; font-size: 12px; white-space: nowrap; z-index: 10;
  box-shadow: var(--shadow-lg);
}
.document-content .correction-group:hover .tooltip { display: block; }
.tooltip-corrector { color: var(--accent); font-weight: 600; }
.tooltip-rule { color: var(--text-muted); }
.tooltip-category { color: var(--text-muted); font-style: italic; }

/* History panel */
.panel-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 100;
  display: flex; justify-content: flex-end;
}
.panel-overlay[hidden] { display: none; }
.panel {
  width: 400px; background: var(--bg-surface); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; height: 100%; box-shadow: -4px 0 12px rgba(0,0,0,0.08);
}
.panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.panel-header h3 { font-size: 16px; }
.history-list { flex: 1; overflow-y: auto; padding: 8px 0; }
.history-item {
  padding: 10px 16px; border-bottom: 1px solid var(--border-light); cursor: pointer;
  transition: background 0.1s;
}
.history-item:hover { background: var(--bg-hover); }
.history-item.current { border-left: 3px solid var(--accent); background: var(--bg-hover); }
.history-item-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.history-time { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
.history-current-badge {
  font-size: 10px; color: var(--accent); background: var(--accent-light);
  padding: 1px 6px; border-radius: 8px;
}
.history-desc { font-size: 13px; margin-bottom: 4px; }
.history-stats { font-size: 11px; color: var(--text-muted); display: flex; gap: 8px; }
.history-stats .stat-accepted { color: var(--ins-text); }
.history-stats .stat-rejected { color: var(--del-text); }
.history-stats .stat-pending { color: var(--text-muted); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; min-width: 400px; max-width: 500px; box-shadow: var(--shadow-lg);
}
.modal h3 { margin-bottom: 14px; font-size: 16px; }
.share-url-box { display: flex; gap: 8px; margin-bottom: 10px; }
.share-url-box input {
  flex: 1; padding: 6px 10px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-family: var(--font-mono); font-size: 12px;
}
.hint { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }

/* Stats bar */
.stats-bar {
  display: flex; gap: 20px; padding: 6px 20px; background: var(--bg-surface);
  border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted); flex-shrink: 0;
}
.stats-bar[hidden] { display: none; }
.stats-bar span::before {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 5px; content: '';
}
#statTotal::before { background: var(--accent); }
#statAccepted::before { background: var(--ins-border); }
#statRejected::before { background: var(--del-border); }
#statPending::before { background: var(--text-muted); }

/* Site footer */
.site-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; background: var(--bg-surface);
  border-top: 1px solid var(--border); flex-shrink: 0; gap: 24px;
}
.footer-brand { flex-shrink: 0; }
.footer-ascii {
  font-family: var(--font-mono); font-size: 9px; line-height: 1.2;
  color: var(--accent); opacity: 0.5; margin: 0;
}
.footer-meta {
  font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); margin-top: 2px;
}
.footer-info { text-align: right; }
.footer-copy { font-size: 11px; color: var(--text-muted); }
.footer-quote {
  font-size: 10px; color: var(--text-muted); opacity: 0.6;
  font-style: italic; margin: 2px 0 4px;
}
.footer-links { display: flex; gap: 12px; justify-content: flex-end; }
.footer-links a {
  font-size: 11px; color: var(--accent); text-decoration: none; opacity: 0.7;
}
.footer-links a:hover { opacity: 1; }

/* Invisible character visualization */
.char-vis {
  font-family: var(--font-mono);
  font-size: 0.8em;
  font-weight: 700;
  border-radius: 3px;
  padding: 1px 3px;
  margin: 0 1px;
  vertical-align: baseline;
  cursor: help;
  display: inline-block;
  line-height: 1.2;
  border-width: 1.5px;
  border-style: solid;
}
.char-nbsp {
  background: rgba(21,101,192,0.12);
  color: #1565c0;
  border-color: #1565c0;
}
.char-nnbsp {
  background: rgba(106,27,154,0.12);
  color: #6a1b9a;
  border-color: #6a1b9a;
  font-size: 0.7em;
}
.char-thinsp {
  background: rgba(230,81,0,0.12);
  color: #e65100;
  border-color: #e65100;
}
.char-wj, .char-zwsp {
  background: rgba(198,40,40,0.12);
  color: var(--del-text);
  border-color: var(--del-text);
  font-size: 0.7em;
}

/* Help / Catalog modal */
.modal-wide {
  min-width: 600px;
  max-width: 780px;
  max-height: 85vh;
  overflow-y: auto;
}
.modal-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.modal-header-row h3 { font-size: 16px; }
.help-section { margin-bottom: 20px; }
.help-section h4 {
  font-size: 13px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.help-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.help-table th {
  text-align: left;
  padding: 5px 8px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.help-table td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
}
.help-table tr:hover td { background: var(--bg-hover); }
.help-table td:first-child { color: var(--accent); font-weight: 600; font-family: var(--font-mono); }

/* Read-only */
body.readonly .action-btn,
body.readonly .bulk-actions,
body.readonly #btnExportMd,
body.readonly #btnShare,
body.readonly #btnUndo,
body.readonly #btnRedo { display: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Responsive */
@media (max-width: 768px) {
  #stepReview { flex-direction: column; }
  aside { width: 100%; max-height: 40vh; border-right: none; border-bottom: 1px solid var(--border); }
  #documentView { padding: 16px; }
  .preset-grid { grid-template-columns: 1fr; }
  .run-card { flex-wrap: wrap; }
  .modal-wide { min-width: auto; max-width: 95vw; }
}
