:root {
  --ink: #1d2a3f;
  --ink-2: #4a5872;
  --muted: #7b8698;
  --bg: #f5f2ec;
  --card: #ffffff;
  --line: #e4ded3;
  --navy: #1f3a5f;
  --accent: #e8833a;
  --accent-2: #f6a25e;
  --ok: #2e9e5b;
  --warn: #c9741f;
  --danger: #c43d3d;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(30, 40, 60, .08);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-size: 16px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); overflow: hidden;
  font-family: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; touch-action: manipulation; }
svg { width: 24px; height: 24px; fill: currentColor; flex: none; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
small { font-size: .78em; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== 画面 ===== */
.view { position: fixed; inset: 0; display: none; flex-direction: column; background: var(--bg); }
.view.active { display: flex; animation: viewIn .22s ease-out; }
.view.dark { background: #0d1522; color: #fff; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(10px + var(--safe-top)) 10px 10px; background: var(--card); border-bottom: 1px solid var(--line); min-height: 60px; flex: none; }
.topbar h2 { font-size: 1.1rem; font-weight: 700; flex: 1; text-align: center; }
.topbar.dark-bar { background: transparent; border: none; color: #fff; }
.icon-btn { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); }
.icon-btn:active { background: rgba(0,0,0,.06); }
.icon-btn.light { color: #fff; }
.icon-btn.light:active { background: rgba(255,255,255,.15); }

/* ===== ホーム ===== */
.home-top { background: var(--navy); color: #fff; border: none; justify-content: space-between; }
.home-top .icon-btn { color: #fff; }
.brand { display: flex; align-items: center; gap: 12px; padding-left: 6px; }
.brand-icon { width: 42px; height: 42px; border-radius: 11px; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.brand h1 { font-size: 1.25rem; letter-spacing: .02em; }
.brand .sub { font-size: .8rem; opacity: .8; }
.home-body { flex: 1; overflow-y: auto; padding: 16px 16px calc(28px + var(--safe-bottom)); -webkit-overflow-scrolling: touch; }
.hero { background: linear-gradient(135deg, #24466f, #1f3a5f 60%); color: #fff; border-radius: var(--radius); padding: 18px 18px 16px; margin-bottom: 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -30px; top: -30px; width: 130px; height: 130px; border-radius: 50%; background: rgba(246,162,94,.18); }
.hero-lead { font-size: 1.02rem; line-height: 1.55; }
.hero-lead strong { color: #ffd2a8; }
.hero-points { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; font-size: .85rem; }
.hero-points li { padding-left: 20px; position: relative; opacity: .95; }
.hero-points li::before { content: "✓"; position: absolute; left: 0; color: var(--accent-2); font-weight: 700; }

.big-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow); font-size: 1.02rem; font-weight: 700; color: var(--navy); padding: 10px 12px; line-height: 1.3; }
.big-btn svg { width: 28px; height: 28px; }
.big-btn small { font-weight: 500; color: var(--muted); }
.big-btn.primary { background: var(--accent); color: #fff; min-height: 76px; font-size: 1.25rem; box-shadow: 0 6px 16px rgba(232,131,58,.35); }
.big-btn.primary svg { width: 34px; height: 34px; }
.big-btn:active { transform: scale(.98); }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.btn-row.tight { gap: 8px; margin-top: 8px; }
.free-note { text-align: center; font-size: .85rem; color: var(--ink-2); margin: 12px 0 4px; min-height: 1.2em; }
.free-note b { color: var(--accent); }

.list-head { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; }
.list-head h2 { font-size: 1.05rem; white-space: nowrap; }
.list-head input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; background: var(--card); }
.doc-list { display: flex; flex-direction: column; gap: 10px; }
.doc-item { display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: 14px; padding: 10px; box-shadow: var(--shadow); text-align: left; width: 100%; }
.doc-item:active { background: #fbf8f3; }
.doc-thumb { width: 58px; height: 74px; border-radius: 6px; object-fit: cover; background: #eee; border: 1px solid var(--line); flex: none; }
.doc-info { flex: 1; min-width: 0; }
.doc-name { font-weight: 700; font-size: 1rem; }
.doc-meta { font-size: .8rem; color: var(--muted); margin-top: 3px; }
.doc-tag { display: inline-block; font-size: .72rem; background: #eef3f9; color: var(--navy); border-radius: 6px; padding: 1px 6px; margin-right: 4px; }
.empty { text-align: center; color: var(--muted); padding: 30px 0; line-height: 1.8; }

/* ===== カメラ ===== */
#video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
#cam-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cam-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.cam-flash.on { animation: flash .35s ease-out; }
@keyframes flash { 0% { opacity: .9; } 100% { opacity: 0; } }
.cam-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  padding: calc(8px + var(--safe-top)) 8px 8px; background: linear-gradient(rgba(0,0,0,.55), transparent); }
.cam-guide { flex: 1; text-align: center; font-size: .92rem; font-weight: 700; padding-top: 12px; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.cam-toggles { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.pill-btn { border: 1.5px solid rgba(255,255,255,.7); color: #fff; border-radius: 999px; padding: 7px 12px; font-size: .82rem; font-weight: 700; background: rgba(0,0,0,.25); }
.pill-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }
.cam-hint { position: absolute; left: 50%; top: calc(90px + var(--safe-top)); transform: translateX(-50%); background: rgba(0,0,0,.65); color: #fff; padding: 8px 16px;
  border-radius: 999px; font-size: .92rem; font-weight: 700; white-space: nowrap; transition: background .2s; }
.cam-hint:empty { display: none; }
.cam-hint.ok { background: rgba(46,158,91,.9); }
.cam-hint.warn { background: rgba(201,116,31,.92); }
.cam-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-around;
  padding: 18px 10px calc(22px + var(--safe-bottom)); background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.shutter { width: 78px; height: 78px; border-radius: 50%; border: 5px solid #fff; background: rgba(255,255,255,.25); position: relative; }
.shutter::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: #fff; transition: transform .1s; }
.shutter:active::after { transform: scale(.88); }
.shutter .ring { position: absolute; inset: -9px; border-radius: 50%; border: 4px solid transparent; z-index: 1; }
.shutter .ring.counting { border-color: var(--accent); animation: ring 1.1s linear forwards; }
@keyframes ring { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
.cam-side { width: 76px; display: flex; flex-direction: column; align-items: center; gap: 4px; color: #fff; font-size: .8rem; font-weight: 700; }
.cam-side svg { width: 30px; height: 30px; }
.stack { width: 46px; height: 58px; position: relative; display: block; }
.stack img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 4px; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.5); background: #fff; }
.stack img:nth-last-child(2) { transform: rotate(-7deg) translate(-3px, 2px); }
.stack .count { position: absolute; right: -8px; top: -8px; background: var(--accent); color: #fff; border-radius: 999px; min-width: 22px; height: 22px; font-size: .78rem; display: grid; place-items: center; padding: 0 5px; z-index: 2; }
.cam-done:disabled { opacity: .45; }

/* ===== 補正アニメーション ===== */
.overlay { position: fixed; inset: 0; z-index: 30; }
.anim-overlay { background: radial-gradient(circle at 50% 40%, #1d3354, #0b1220 75%); }
#anim-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.anim-label { position: absolute; left: 50%; bottom: calc(80px + var(--safe-bottom)); transform: translateX(-50%); color: #fff; font-weight: 700;
  background: rgba(255,255,255,.12); backdrop-filter: blur(6px); padding: 10px 18px; border-radius: 999px; white-space: nowrap; font-size: .98rem; }
.anim-label.pop { animation: pop .35s ease-out; }
@keyframes pop { from { transform: translateX(-50%) scale(.9); opacity: .2; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
.anim-skip { position: absolute; right: 14px; top: calc(14px + var(--safe-top)); color: #fff; opacity: .8; font-size: .9rem; padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.4); }

/* ===== 四隅 ===== */
.corner-help { text-align: center; font-size: .88rem; opacity: .85; padding: 0 16px 6px; }
.corner-stage { flex: 1; position: relative; touch-action: none; }
#corner-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.corner-actions { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 10px; padding: 12px 14px calc(14px + var(--safe-bottom)); }

/* ===== 共通ボタン ===== */
.btn { min-height: 50px; border-radius: 14px; padding: 0 16px; font-weight: 700; background: var(--card); color: var(--navy); border: 1.5px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { background: transparent; }
.btn.ghost.light { color: #fff; border-color: rgba(255,255,255,.45); }
.btn.small { min-height: 40px; font-size: .88rem; padding: 0 12px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; }

/* ===== 書類 ===== */
.doc-body { flex: 1; overflow-y: auto; padding: 14px 14px 110px; }
.field-label { font-size: .82rem; color: var(--muted); font-weight: 700; }
.name-row input { width: 100%; margin-top: 6px; padding: 12px 14px; font-size: 1.05rem; font-weight: 700; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); }
.name-row input:focus { outline: none; border-color: var(--accent); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 14px; font-size: .88rem; font-weight: 600; color: var(--ink-2); }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.filename-preview { font-size: .8rem; color: var(--muted); margin-top: 4px; word-break: break-all; }
.pages-head { display: flex; align-items: baseline; justify-content: space-between; margin: 18px 0 10px; }
.pages-head h3 { font-size: 1rem; }
.pages-head .hint { font-size: .78rem; color: var(--muted); }
.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.page-card { position: relative; background: var(--card); border-radius: 10px; box-shadow: var(--shadow); padding: 8px; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.page-card img { width: 100%; aspect-ratio: 1 / 1.414; object-fit: contain; display: block; background: #f1f1f1; border-radius: 4px; pointer-events: none; }
.page-card .no { position: absolute; left: 4px; top: 4px; background: var(--navy); color: #fff; font-size: .78rem; font-weight: 700; border-radius: 8px; padding: 2px 8px; }
.page-card .warn { position: absolute; right: 4px; top: 4px; background: var(--warn); color: #fff; font-size: .72rem; font-weight: 700; border-radius: 8px; padding: 2px 6px; }
.page-card .proc { position: absolute; inset: 8px; display: grid; place-items: center; background: rgba(255,255,255,.6); border-radius: 4px; }
.page-card.dragging { opacity: .9; z-index: 10; box-shadow: 0 12px 28px rgba(0,0,0,.25); transform: scale(1.05); transition: none; }
.page-card.placeholder { opacity: .25; }
.page-add { border: 2px dashed #cdc4b5; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--ink-2); font-weight: 700; font-size: .88rem; min-height: 180px; }
.page-add svg { width: 32px; height: 32px; color: var(--accent); }
.page-add-row { display: flex; flex-direction: column; gap: 10px; }
.page-add-row .page-add { min-height: 0; flex: 1; padding: 14px 6px; }
.sticky-foot { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 14px calc(14px + var(--safe-bottom)); background: linear-gradient(transparent, var(--bg) 30%); }
.sticky-foot .btn { min-height: 58px; font-size: 1.05rem; box-shadow: 0 6px 16px rgba(232,131,58,.35); }

/* ===== ページ編集 ===== */
.page-warn { background: #fff4e5; color: #8a4b0f; font-size: .86rem; padding: 10px 14px; display: flex; gap: 10px; align-items: center; justify-content: space-between; border-bottom: 1px solid #f3dcbc; }
.page-warn .btn { min-height: 36px; font-size: .82rem; flex: none; }
.page-stage { flex: 1; position: relative; background: #e9e5dd; touch-action: none; overflow: hidden; }
#page-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.busy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(245,242,236,.35); }
.compare-btn { position: absolute; right: 10px; bottom: 10px; background: rgba(29,42,63,.78); color: #fff; font-size: .78rem; padding: 8px 12px; border-radius: 999px; user-select: none; -webkit-user-select: none; }
.tool-panel { background: var(--card); padding: 12px 14px 6px; border-top: 1px solid var(--line); min-height: 64px; }
.tool-tabs { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--card); border-top: 1px solid var(--line); padding-bottom: var(--safe-bottom); }
.tool-tabs button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 10px; font-size: .76rem; font-weight: 700; color: var(--muted); }
.tool-tabs button.on { color: var(--accent); }
.seg { display: flex; background: #f0ece4; border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; min-height: 42px; border-radius: 9px; font-weight: 700; font-size: .9rem; color: var(--ink-2); }
.seg button.on { background: var(--card); color: var(--navy); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.seg.small button { min-height: 38px; font-size: .86rem; }
.mode-desc { font-size: .8rem; color: var(--muted); margin: 8px 2px 4px; min-height: 2.4em; line-height: 1.5; }
.slider { display: grid; grid-template-columns: 8.5em 1fr 2.5em; align-items: center; gap: 8px; font-size: .86rem; font-weight: 700; color: var(--ink-2); margin-bottom: 4px; }
.slider input { width: 100%; accent-color: var(--accent); height: 30px; }
.slider output { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.mask-help { font-size: .86rem; color: var(--ink-2); line-height: 1.6; }

/* ===== 設定 ===== */
.settings-body { flex: 1; overflow-y: auto; padding: 14px 14px calc(30px + var(--safe-bottom)); }
.set-group { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.set-group h3 { font-size: .82rem; color: var(--muted); padding: 12px 16px 4px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid #f1ece4; min-height: 54px; width: 100%; text-align: left; }
.set-group h3 + .set-row { border-top: none; }
.set-row .label { font-weight: 600; }
.set-row .label small { display: block; color: var(--muted); font-weight: 400; margin-top: 2px; line-height: 1.45; }
.set-row select { border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; max-width: 52%; }
.set-row .val { color: var(--muted); font-size: .88rem; }
.name-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 16px 14px; }
.name-list .chip { display: inline-flex; align-items: center; gap: 4px; }
.name-list .chip b { color: var(--muted); font-weight: 400; padding-left: 4px; }
.about { font-size: .84rem; color: var(--ink-2); line-height: 1.7; padding: 4px 16px 14px; }
.about a { color: var(--navy); }

/* スイッチ */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; font-weight: 600; }
.switch-row small { display: block; color: var(--muted); font-weight: 400; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row i { flex: none; width: 50px; height: 30px; border-radius: 999px; background: #d8d2c7; position: relative; transition: background .2s; }
.switch-row i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.switch-row input:checked + i { background: var(--ok); }
.switch-row input:checked + i::after { transform: translateX(20px); }

/* ===== シート ===== */
.sheet-backdrop, .dialog-backdrop { position: fixed; inset: 0; background: rgba(15,22,35,.45); z-index: 40; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--card); border-radius: 22px 22px 0 0; padding: 6px 18px calc(18px + var(--safe-bottom));
  max-height: 92vh; overflow-y: auto; animation: up .25s ease-out; box-shadow: 0 -8px 30px rgba(0,0,0,.2); }
@keyframes up { from { transform: translateY(40%); opacity: .4; } }
.sheet-grip { width: 42px; height: 5px; border-radius: 3px; background: #ddd; margin: 4px auto 12px; }
.sheet h3 { font-size: 1.15rem; margin-bottom: 12px; }
.form-row { margin-bottom: 14px; }
.form-label { display: block; font-size: .82rem; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.form-row select { width: 100%; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-size: 1rem; }
.ex-file { font-size: .84rem; color: var(--ink-2); background: #f6f3ee; border-radius: 10px; padding: 10px 12px; margin: 4px 0 14px; word-break: break-all; }
.progress-box { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 40px 0; color: var(--ink-2); font-weight: 700; }
.result-head { display: flex; gap: 14px; align-items: center; margin: 10px 0 8px; }
.ok-badge { width: 52px; height: 52px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; font-size: 1.6rem; font-weight: 700; flex: none; animation: pop2 .4s ease-out; }
@keyframes pop2 { from { transform: scale(.4); } 70% { transform: scale(1.1); } }
.result-name { font-weight: 700; font-size: 1.05rem; word-break: break-all; }
.result-meta { font-size: .86rem; color: var(--ink-2); margin-top: 3px; }
.result-note { font-size: .8rem; color: var(--muted); margin-bottom: 14px; line-height: 1.6; }
#export-result .btn { margin-bottom: 10px; }

/* ===== ダイアログ ===== */
.dialog-backdrop { display: grid; place-items: center; padding: 20px; z-index: 60; }
.dialog { background: var(--card); border-radius: 20px; padding: 22px 20px 16px; width: 100%; max-width: 420px; box-shadow: 0 10px 40px rgba(0,0,0,.3); animation: pop2 .25s ease-out; }
.dialog h3 { font-size: 1.12rem; margin-bottom: 10px; }
#dialog-body { font-size: .93rem; color: var(--ink-2); line-height: 1.7; }
#dialog-body input { width: 100%; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; font-size: 1.05rem; margin-top: 8px; }
.dialog-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.price-tag { font-size: 1.6rem; font-weight: 800; color: var(--accent); }

/* ===== ロック ===== */
.lock-screen { position: fixed; inset: 0; z-index: 100; background: var(--navy); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 20px; }
.lock-icon { width: 72px; height: 72px; border-radius: 18px; }
.lock-title { font-weight: 700; font-size: 1.05rem; }
.lock-title.err { color: #ffb3a8; animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.pin-dots { display: flex; gap: 14px; height: 18px; }
.pin-dots span { width: 15px; height: 15px; border-radius: 50%; border: 2px solid #fff; }
.pin-dots span.f { background: #fff; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px; }
.pin-pad button { height: 76px; border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; font-size: 1.6rem; font-weight: 600; }
.pin-pad button:active { background: rgba(255,255,255,.25); }
.pin-pad button.fn { background: transparent; font-size: .95rem; }

/* ===== その他 ===== */
.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-bottom)); transform: translateX(-50%); background: rgba(29,42,63,.94); color: #fff; padding: 12px 20px;
  border-radius: 14px; z-index: 90; font-size: .92rem; font-weight: 600; max-width: 90vw; text-align: center; animation: fade .2s; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 4px solid rgba(232,131,58,.25); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (min-width: 700px) {
  .home-body, .doc-body, .settings-body { max-width: 720px; margin: 0 auto; width: 100%; }
  .sheet { max-width: 560px; margin: 0 auto; }
}

.tool-pane[data-pane="adjust"] { max-height: 34vh; overflow-y: auto; }
.fix-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 6px; }
.fix-chips button { border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 11px; font-size: .8rem; font-weight: 700; color: var(--muted); background: #fff; }
.fix-chips button::before { content: "○ "; }
.fix-chips button.on { border-color: var(--ok); color: var(--ok); background: #eef8f1; }
.fix-chips button.on::before { content: "✓ "; }
