:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --border: #e3e6ea;
  --text: #1f2329;
  --text-sub: #6b7280;
  --accent: #2563eb;
  --accent-text: #ffffff;
  --badge-color-bg: #dbeafe;
  --badge-color-text: #1d4ed8;
  --badge-mono-bg: #e5e7eb;
  --badge-mono-text: #374151;
  --badge-gray-bg: #cbd5e1;
  --badge-gray-text: #334155;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-hover: 0 6px 22px rgba(0,0,0,.13);
  --accent-soft: rgba(37,99,235,.08);
}
body.dark {
  --bg: #1a1c1e;
  --surface: #242729;
  --border: #3a3d40;
  --text: #e8eaed;
  --text-sub: #9aa0a6;
  --accent: #3b82f6;
  --accent-text: #ffffff;
  --badge-color-bg: #1e3a8a;
  --badge-color-text: #bfdbfe;
  --badge-mono-bg: #374151;
  --badge-mono-text: #d1d5db;
  --badge-gray-bg: #475569;
  --badge-gray-text: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,.4);
  --shadow-hover: 0 6px 22px rgba(0,0,0,.5);
  --accent-soft: rgba(59,130,246,.16);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background .2s, color .2s;
}
.material-symbols-outlined { font-size: 20px; vertical-align: middle; }
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 24px; background: var(--surface);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand h1 { font-size: 18px; margin: 0; font-weight: 700; }
.help-link {
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 4px; width: 26px; height: 26px; border-radius: 50%;
  color: var(--text-sub); text-decoration: none;
  transition: color .15s, background .15s;
}
.help-link:hover { color: var(--accent); background: var(--accent-soft); }
.help-link .material-symbols-outlined { font-size: 20px; }
.header-left { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }
.header-left .status, .header-left .summary { margin: 0; }
.container { max-width: none; margin: 0; padding: 0; display: flex; align-items: flex-start; }
.workspace { flex: 1; min-width: 0; padding: 24px 24px 48px; }
.header-actions { display: inline-flex; align-items: center; gap: 8px; }
.hidden { display: none !important; }
.dropzone {
  max-width: 560px; margin: 24px auto 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 2px dashed var(--border); border-radius: var(--radius-lg);
  padding: 48px 40px; text-align: center; background: var(--surface);
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.dropzone:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.drop-icon { font-size: 56px !important; color: var(--accent); opacity: .85; margin-bottom: 4px; }
.dropzone p { color: var(--text-sub); margin: 0; }
.dropzone .dz-title { font-size: 16px; font-weight: 700; color: var(--text); }
.dropzone .dz-sub { font-size: 13px; margin: 2px 0 14px; }
.dropzone .dz-hint { font-size: 12px; margin-top: 16px; opacity: .8; }
.primary-btn, .secondary-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; border-radius: 8px; padding: 10px 16px;
  font-family: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
}
.primary-btn { background: var(--accent); color: var(--accent-text); }
.secondary-btn { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.primary-btn, .secondary-btn { transition: filter .15s, background .15s, border-color .15s, transform .1s, box-shadow .15s; }
.primary-btn:hover { filter: brightness(1.08); box-shadow: var(--shadow); }
.secondary-btn:hover { border-color: var(--accent); background: var(--bg); }
.primary-btn:active, .secondary-btn:active { transform: translateY(1px); }
.icon-btn { transition: border-color .15s, color .15s, background .15s; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn {
  background: transparent; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px; cursor: pointer; color: var(--text);
}
.reset-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; border-radius: 8px; padding: 8px 14px;
  font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  background: #b91c1c; color: #fff;
}
.reset-btn:hover { background: #991b1b; }
.reset-btn .material-symbols-outlined { font-size: 18px; }
.status { color: var(--text-sub); margin: 0; display: inline-flex; align-items: center; gap: 8px; }
.export-bar {
  display: flex; flex-direction: row; align-items: center; gap: 8px;
  margin: 0; padding: 0; background: transparent;
  border: none; border-radius: 0;
}
.export-bar .primary-btn, .export-bar .secondary-btn { width: auto; justify-content: center; }
.summary { color: var(--text); font-size: 13px; line-height: 1.4; font-weight: 500; white-space: nowrap; }
.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.thumb-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: box-shadow .18s, transform .18s, border-color .18s;
}
.thumb-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); border-color: var(--accent); }
.thumb-img {
  position: relative; display: flex; align-items: center; justify-content: center;
  padding: 10px; background: var(--bg); min-height: 160px; cursor: pointer;
}
.thumb-img canvas { max-width: 100%; height: auto; box-shadow: var(--shadow); }
.thumb-img.placeholder { cursor: pointer; }
.thumb-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: 100%; min-height: 140px; padding: 16px; text-align: center;
  border: 1px dashed var(--border); border-radius: 8px; background: var(--surface); color: var(--text-sub);
}
.thumb-placeholder .material-symbols-outlined { font-size: 28px; color: var(--accent); }
.thumb-placeholder .ph-title { font-size: 13px; font-weight: 600; color: var(--text); }
.thumb-placeholder .ph-sub { font-size: 11px; font-variant-numeric: tabular-nums; }
.thumb-placeholder .ph-hint { font-size: 11px; }
.thumb-meta {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-top: 1px solid var(--border);
}
.page-no { font-size: 13px; font-weight: 500; }
.badge-group { margin-left: auto; display: inline-flex; gap: 4px; }
.badge {
  font-size: 12px; padding: 4px 9px; border-radius: 999px; font-weight: 500;
  border: 1px solid transparent; cursor: pointer; font-family: inherit;
  transition: filter .15s, opacity .15s, transform .15s;
}
.badge.off { background: var(--badge-mono-bg); color: var(--text-sub); opacity: .45; }
.badge.off:hover { opacity: .8; transform: translateY(-1px); }
.badge.active.color { background: linear-gradient(90deg, #e57373, #ffb74d, #fff176, #81c784, #64b5f6, #ba68c8); color: #1f2329; border-color: transparent; text-shadow: 0 1px 1px rgba(255,255,255,.5); box-shadow: 0 0 0 1.5px #fff inset; }
.badge.active.gray { background: var(--badge-gray-bg); color: var(--badge-gray-text); }
.badge.active.mono { background: var(--badge-mono-bg); color: var(--badge-mono-text); }
.badge.active { font-weight: 700; box-shadow: 0 0 0 1.5px currentColor inset; }
.dl-btn {
  position: absolute; top: 8px; right: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  box-shadow: var(--shadow); opacity: .9; transition: opacity .15s, transform .15s;
}
.thumb-card:hover .dl-btn { opacity: 1; transform: translateY(-1px); }
.dl-btn:disabled { opacity: .4; cursor: default; }
.method-badge {
  position: absolute; top: 8px; left: 8px;
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow); opacity: .92; pointer-events: none;
}
.method-badge .material-symbols-outlined { font-size: 14px; }
.method-badge.vector { color: var(--badge-color-text); }
.method-badge.pixel { color: var(--text-sub); }
.method-badge.manual { color: #16a34a; border-color: #16a34a; }
.check-mark {
  position: absolute; bottom: 8px; left: 8px;
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: #16a34a; color: #ffffff;
  box-shadow: var(--shadow); pointer-events: none;
}
.check-mark .material-symbols-outlined { font-size: 14px; }
.thumb-reason {
  font-size: 11px; line-height: 1.35; color: var(--text-sub);
  margin-top: 4px; word-break: break-word;
}
.modal-loading { color: var(--text-sub); font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }
.modal-loading .spinner { margin-right: 0; }
.spinner {
  display: inline-block; box-sizing: border-box;
  width: 16px; height: 16px; vertical-align: -3px; margin-right: 8px;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.nav-btn {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  box-shadow: var(--shadow);
}
.nav-btn:disabled { opacity: .35; cursor: default; }
.nav-btn .material-symbols-outlined { font-size: 28px; }
.settings-sidebar {
  flex: none; width: var(--sw, 340px); align-self: stretch;
  position: sticky; top: 60px; height: calc(100vh - 60px); overflow: hidden;
  background: var(--surface); border-left: 1px solid var(--border);
  transition: width .25s ease;
}
.settings-sidebar.collapsed { width: 0; border-left-color: transparent; }
body.sidebar-resizing { user-select: none; cursor: ew-resize; }
body.sidebar-resizing .settings-sidebar { transition: none; }
.sidebar-resizer {
  position: absolute; left: 0; top: 0; width: 6px; height: 100%;
  cursor: ew-resize; z-index: 6; background: transparent;
}
.sidebar-resizer:hover, body.sidebar-resizing .sidebar-resizer { background: var(--accent); opacity: .35; }
.sidebar-inner {
  width: var(--sw, 340px); height: 100%;
  display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-bottom: 1px solid var(--border);
}
.sidebar-title { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; margin-right: auto; }
.sidebar-title .material-symbols-outlined { color: var(--accent); }
.settings-actions {
  display: flex; flex-direction: row; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.settings-section { flex: none; border-bottom: 1px solid var(--border); }
.settings-section > summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px; font-size: 14px; font-weight: 700;
  cursor: pointer; user-select: none; list-style: none; transition: background .15s;
}
.settings-section > summary:hover { background: var(--bg); }
.settings-section > summary::-webkit-details-marker { display: none; }
.settings-section > summary .sec-title { display: inline-flex; align-items: center; gap: 8px; }
.settings-section > summary .sec-title .material-symbols-outlined { color: var(--accent); }
.settings-section > summary::after {
  content: 'expand_more'; font-family: 'Material Symbols Outlined';
  font-size: 20px; color: var(--text-sub); transition: transform .2s;
}
.settings-section[open] > summary::after { transform: rotate(180deg); }
.settings-scroll {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
}
.settings-footer {
  flex: none; display: flex; align-items: center; gap: 4px;
  padding: 8px 14px; border-top: 1px solid var(--border);
}
.footer-link {
  display: inline-flex; align-items: center; gap: 4px;
  background: transparent; border: none; border-radius: 6px;
  padding: 4px 6px; cursor: pointer; font-family: inherit;
  font-size: 11px; color: var(--text-sub); transition: color .15s, background .15s;
}
.footer-link:hover { color: var(--accent); background: var(--bg); }
.footer-link .material-symbols-outlined { font-size: 15px; }
.settings-body {
  display: flex; flex-direction: column; gap: 14px; padding: 16px 18px 20px;
}
.desc-toggle {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-size: 12px; font-weight: 600; color: var(--text-sub);
  cursor: pointer; user-select: none; white-space: nowrap;
}
.desc-toggle:hover { color: var(--text); }
.desc-toggle input[type="checkbox"] {
  width: 16px; height: 16px; margin: 0; flex: none;
  accent-color: var(--accent); cursor: pointer;
}
.settings-sidebar.hide-desc small { display: none; }
.row-help { display: none; }
.settings-sidebar.hide-desc .setting-row { position: relative; }
.settings-sidebar.hide-desc .setting-row:hover .row-help {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; color: var(--text-sub); cursor: help; margin-left: 4px; vertical-align: middle;
}
.settings-sidebar.hide-desc .row-help:hover { color: var(--accent); }
.settings-sidebar.hide-desc .row-help:hover ~ small {
  display: block; position: fixed; left: -9999px; top: -9999px; z-index: 50;
  padding: 8px 10px; width: max-content; max-width: 240px; pointer-events: none;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow); font-size: 11px; line-height: 1.4; font-weight: 400;
}
.setting-group {
  display: flex; flex-direction: column; gap: 14px;
  padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg);
}
.setting-row {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px;
  font-size: 13px; margin-top: 10px;
}
.setting-row > span { grid-column: 1 / -1; }
.setting-row input[type="range"] {
  grid-column: 1; width: 100%; -webkit-appearance: none; appearance: none;
  height: 6px; border-radius: 999px; background: var(--border); outline: none; cursor: pointer;
}
.setting-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 16px; height: 16px;
  border-radius: 50%; background: var(--accent); border: 2px solid var(--surface);
  box-shadow: var(--shadow); cursor: pointer;
}
.setting-row input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: var(--accent);
  border: 2px solid var(--surface); box-shadow: var(--shadow); cursor: pointer;
}
.setting-row > span { font-weight: 500; }
.setting-row small { display: block; color: var(--text-sub); font-size: 11px; font-weight: 400; margin: 3px 0 0; line-height: 1.4; }
#rejudge-btn, #reset-settings { flex: 1; justify-content: center; }
#rejudge-btn { position: relative; border-color: var(--accent); color: var(--accent); font-weight: 600; }
#rejudge-btn.dirty { border-color: #f97316; color: #f97316; }
#rejudge-btn.dirty::after {
  content: ''; position: absolute; top: -5px; right: -5px;
  width: 10px; height: 10px; border-radius: 50%; background: #f97316;
  border: 2px solid var(--surface);
}
.settings-subhead {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--accent);
}
.settings-subhead .material-symbols-outlined { font-size: 16px; }
.setting-group > summary.settings-subhead { cursor: pointer; user-select: none; list-style: none; }
.setting-group > summary.settings-subhead::-webkit-details-marker { display: none; }
.setting-group > summary.settings-subhead::after {
  content: 'expand_more'; font-family: 'Material Symbols Outlined';
  font-size: 18px; color: var(--text-sub); margin-left: auto; transition: transform .2s;
}
.setting-group[open] > summary.settings-subhead::after { transform: rotate(180deg); }
.setting-row select {
  grid-column: 1 / -1; width: 100%; padding: 7px 8px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 13px;
}
.setting-row > input[type="number"] {
  grid-column: 1 / -1; width: 100%; padding: 7px 8px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 13px;
}
.setting-row > input[type="number"].val-input {
  grid-column: 2; justify-self: end; width: 66px; min-width: 48px;
  text-align: center; padding: 3px 6px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--badge-color-bg);
  color: var(--badge-color-text); font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums; font-family: inherit;
}
.setting-row > input[type="number"].val-input:focus { outline: none; border-color: var(--accent); }
.val-input::-webkit-outer-spin-button, .val-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.val-input { appearance: textfield; -moz-appearance: textfield; }
.setting-row.sub-setting {
  margin-top: 6px; margin-left: 12px; padding-left: 12px; border-left: 2px solid var(--accent);
}
.setting-row.sub-setting > span { color: var(--text-sub); font-weight: 500; }
.setting-row.sub-setting > span::before { content: '└ '; color: var(--accent); font-weight: 700; }
.res-row { grid-template-columns: 1fr auto; }
.res-input { display: flex; gap: 6px; align-items: center; }
.res-input select { width: auto; }
.res-input input[type="number"] {
  width: 90px; padding: 6px 8px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 13px;
}
.setting-row.check-row { grid-template-columns: 1fr auto; align-items: start; }
.setting-row.check-row > span { grid-column: 1; }
.setting-row input[type="checkbox"] {
  grid-column: 2; justify-self: end; -webkit-appearance: none; appearance: none;
  position: relative; width: 40px; height: 22px; border-radius: 999px;
  background: var(--border); cursor: pointer; transition: background .2s; flex: none;
}
.setting-row input[type="checkbox"]::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: var(--shadow); transition: transform .2s;
}
.setting-row input[type="checkbox"]:checked { background: var(--accent); }
.setting-row input[type="checkbox"]:checked::after { transform: translateX(18px); }
.check-view {
  display: none; position: fixed; inset: 0; z-index: 90;
  background: var(--bg); flex-direction: column;
}
.check-view.open { display: flex; }
.check-head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.check-title { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; }
.check-back { flex: none; background: #f97316; color: #fff; border-color: #f97316; font-weight: 600; }
.check-back:hover { background: #ea580c; border-color: #ea580c; }
.check-head-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.check-head-actions .badge-group { margin-left: 0; gap: 6px; }
.check-head-actions .badge { font-size: 14px; padding: 6px 14px; }
.check-body { flex: 1; display: flex; align-items: center; gap: 8px; padding: 12px; min-height: 0; }
.check-panes {
  flex: 1; height: 100%; min-width: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.check-pane {
  margin: 0; min-width: 0; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; box-shadow: var(--shadow);
}
.check-pane figcaption {
  padding: 9px 14px; font-size: 12px; font-weight: 700; letter-spacing: .03em;
  color: var(--text-sub); border-bottom: 1px solid var(--border); background: var(--surface);
}
.check-canvas-wrap {
  flex: 1; min-height: 0; overflow: hidden; padding: 10px;
  display: flex; align-items: center; justify-content: center; background: var(--bg);
  cursor: grab; user-select: none; touch-action: none;
}
.check-canvas-wrap.panning { cursor: grabbing; }
.check-canvas-wrap canvas {
  max-width: 100%; max-height: 100%; box-shadow: var(--shadow);
  transform-origin: center center; will-change: transform;
}
.check-skip {
  color: var(--text-sub); font-size: 13px; text-align: center; line-height: 1.6;
}
.check-hint {
  margin: 0; padding: 0 16px 8px; text-align: center;
  font-size: 12px; color: var(--text-sub);
}
.check-info {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--surface); border-top: 1px solid var(--border);
}
.check-caption { flex: 1; min-width: 240px; font-size: 13px; }
.check-scale { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-sub); }
.check-scale select {
  padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-family: inherit; font-size: 13px;
}
.check-scale .material-symbols-outlined { font-size: 18px; }
.check-scale.disabled { opacity: .4; pointer-events: none; }
.check-pdf-frame { width: 100%; height: 100%; border: 0; background: #fff; border-radius: 6px; }
.check-viewer { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-sub); cursor: pointer; }
.check-viewer input { width: 16px; height: 16px; accent-color: #4f7cff; cursor: pointer; }
#check-ok.checked { background: #16a34a; }
.restore-prompt {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.45); align-items: center; justify-content: center; padding: 20px;
}
.restore-prompt.open { display: flex; }
.restore-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.25);
  padding: 28px; max-width: 420px; width: 100%; text-align: center;
}
.restore-icon { font-size: 40px !important; color: var(--accent); }
.restore-title { font-size: 18px; font-weight: 700; margin: 10px 0 6px; }
.restore-info { font-size: 13px; color: var(--text); margin: 6px 0; font-weight: 500; }
.restore-note { font-size: 12px; color: var(--text-sub); margin: 6px 0 18px; }
.restore-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.primary-btn.danger { background: #b91c1c; }
.primary-btn.danger:hover { background: #991b1b; }
.confirm-modal {
  display: none; position: fixed; inset: 0; z-index: 110;
  background: rgba(0,0,0,.45); align-items: center; justify-content: center; padding: 20px;
}
.confirm-modal.open { display: flex; }
.confirm-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.25);
  padding: 26px; max-width: 420px; width: 100%; text-align: center;
}
.confirm-icon { font-size: 38px !important; color: var(--accent); }
.confirm-title { font-size: 18px; font-weight: 700; margin: 10px 0 6px; }
.confirm-message { font-size: 13px; color: var(--text-sub); margin: 6px 0 18px; line-height: 1.6; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.confirm-progress { margin: 8px 0 4px; }
.confirm-progress-bar { width: 100%; height: 10px; border-radius: 999px; background: var(--border); overflow: hidden; }
.confirm-progress-fill { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .2s; }
.confirm-progress-text { font-size: 12px; color: var(--text-sub); margin: 12px 0 0; display: inline-flex; align-items: center; gap: 8px; justify-content: center; }
.check-list {
  flex: none; width: 200px; height: 100%;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow);
}
.check-list-head { padding: 8px 10px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.check-list-filter { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text); cursor: pointer; }
.check-list-filter input { width: 16px; height: 16px; accent-color: #4f7cff; cursor: pointer; }
.check-list-count { font-size: 11px; color: var(--text-sub); }
.check-list-count.done { color: #16a34a; font-weight: 600; }
.check-list-items { flex: 1; min-height: 0; overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.check-list-item {
  display: flex; align-items: center; gap: 6px; width: 100%; text-align: left;
  padding: 6px 8px; border-radius: 6px; cursor: pointer;
  font-family: inherit; font-size: 12px; color: var(--text);
  background: transparent; border: 1px solid transparent;
}
.check-list-item:hover { background: var(--bg); }
.check-list-item.active { border-color: var(--accent); background: var(--badge-color-bg); }
.check-list-item .cli-no { font-weight: 600; min-width: 36px; }
.check-list-item .cli-mode { font-size: 11px; padding: 1px 6px; border-radius: 999px; font-weight: 600; }
.check-list-item .cli-mode.color { background: var(--badge-color-bg); color: var(--badge-color-text); }
.check-list-item .cli-mode.gray { background: var(--badge-gray-bg); color: var(--badge-gray-text); }
.check-list-item .cli-mode.mono { background: var(--badge-mono-bg); color: var(--badge-mono-text); }
.check-list-item .cli-stat { margin-left: auto; font-size: 16px; color: var(--text-sub); }
.check-list-item.checked .cli-stat { color: #16a34a; }
@media (max-width: 860px) {
  .container { flex-direction: column; }
  .check-panes { grid-template-columns: 1fr; }
  .check-list { width: 150px; }
  .settings-sidebar {
    width: 100%; position: static; height: auto; overflow: visible;
    border-left: none; border-top: 1px solid var(--border);
  }
  .settings-sidebar.collapsed { display: none; }
  .sidebar-inner { width: 100%; height: auto; overflow: visible; }
  .sidebar-resizer { display: none; }
  .settings-scroll { overflow: visible; flex: none; }
}
@media (max-width: 640px) {
  .setting-row { grid-template-columns: 1fr; gap: 4px; }
}