/* Wonder Scan — 暗い作業台の上に白い紙が載っていく、という見立て */
:root{
  --desk:#0A1017;        /* 作業台 */
  --ink:#0A1017;         /* 旧名（既存の指定が参照している） */
  --felt:#121A23;        /* 台の上に置く部品 */
  --panel:#121A23;
  --hair:#1E2A36;        /* 罫線 */
  --line:#1E2A36;
  --paper:#F6F3EC;       /* 紙 */
  --navy:#1F4E79;
  --azure:#4FA3E3;
  --seal:#C8453B;
  --text:#E6EDF4;
  --muted:#8296AA;
  --dim:#5E7083;
  --dock-h:72px;
  --tabs-h:62px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;height:100%}
body{
  font-family:"Meiryo UI","Meiryo","Hiragino Sans","Yu Gothic",sans-serif;
  background:var(--ink);
  color:var(--text);
  -webkit-text-size-adjust:100%;
  -webkit-tap-highlight-color:transparent;
  overscroll-behavior-y:none;
}
button,input,a{font-family:inherit}
[hidden]{display:none !important}
:focus-visible{outline:2px solid var(--azure);outline-offset:2px}

/* ---- 上部 ---- */
.topbar{
  display:flex;align-items:center;gap:9px;
  padding:calc(12px + env(safe-area-inset-top)) 20px 4px;
  background:var(--desk);
  position:sticky;top:0;z-index:20;
}
.topbar .mark{width:24px;height:24px;display:block;border-radius:7px}
.topbar h1{font-size:14px;font-weight:bold;margin:0;letter-spacing:.01em;color:#C6D5E3;flex:1}
.topbar .tally{
  font-size:11.5px;color:#9FB6CA;
  border:1px solid var(--hair);border-radius:999px;padding:3px 10px;
}

.controls{
  background:var(--ink);
  padding:12px 16px 10px;
  display:flex;flex-direction:column;gap:11px;
  border-bottom:1px solid var(--line);
}
.seg{display:flex;background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:3px;gap:3px}
.seg button{
  flex:1;border:0;background:transparent;color:var(--muted);
  font-size:13.5px;padding:9px 4px;border-radius:7px;cursor:pointer;
}
.seg button.on{background:var(--azure);color:#07121d;font-weight:bold}

.switch{display:flex;align-items:center;gap:10px;font-size:13.5px;color:var(--muted);cursor:pointer}
.switch input{position:absolute;opacity:0;width:0;height:0}
.switch .track{
  width:42px;height:25px;border-radius:999px;background:#2A3744;
  position:relative;flex:0 0 auto;transition:background .15s;
}
.switch .knob{
  position:absolute;top:3px;left:3px;width:19px;height:19px;border-radius:50%;
  background:#8FA0B2;transition:transform .15s,background .15s;
}
.switch input:checked + .track{background:rgba(88,166,232,.35)}
.switch input:checked + .track .knob{transform:translateX(17px);background:var(--azure)}
.switch input:focus-visible + .track{outline:2px solid var(--azure);outline-offset:2px}

/* ---- 作業台 ---- */
.desk{
  min-height:calc(100dvh - 240px);
  padding:14px 20px calc(var(--dock-h) + var(--tabs-h) + env(safe-area-inset-bottom) + 42px);
}
.empty{text-align:center;padding:12vh 0 10px}
.empty .lead{font-size:15px;margin:26px 0 6px}
.empty .sub{font-size:12.5px;color:var(--muted);margin:0;line-height:1.8}
.empty .guide{width:150px;height:120px;display:block;margin:0 auto}
.empty .guide .paper{fill:#fff;opacity:.9}
.empty .guide .rule{stroke:#B9C6D4;stroke-width:2.6;stroke-linecap:round;fill:none}
.empty .guide .corner{stroke:var(--azure);stroke-width:2.6;fill:none;stroke-linecap:round}

/* シャッター */
.shutter{
  width:66px;height:66px;border-radius:50%;
  border:3px solid rgba(255,255,255,.85);background:transparent;
  padding:0;cursor:pointer;display:grid;place-items:center;flex:0 0 auto;
}
.shutter span{width:50px;height:50px;border-radius:50%;background:#fff;transition:transform .1s}
.shutter:active span{transform:scale(.88)}

/* 紙 */
.sheets{display:flex;flex-direction:column;gap:18px;max-width:560px;margin:0 auto}
.sheet{
  background:#fff;border-radius:3px;
  box-shadow:0 14px 26px rgba(0,0,0,.45),0 2px 4px rgba(0,0,0,.4);
  overflow:hidden;position:relative;
}
.sheet img{width:100%;display:block;min-height:120px;background:#f0f2f5}
.sheet .num{
  position:absolute;top:0;left:0;
  background:rgba(13,20,28,.72);color:#fff;font-size:11.5px;
  padding:4px 9px;border-bottom-right-radius:6px;
}
.sheet .ops{display:flex;background:#fff;border-top:1px solid #e4e8ee}
.sheet .ops button{
  flex:1;min-height:46px;border:0;border-right:1px solid #e4e8ee;
  background:#fff;color:var(--navy);font-size:16px;cursor:pointer;
}
.sheet .ops button:last-child{border-right:0}
.sheet .ops button.del{color:#b3261e}
.sheet.pending{min-height:180px;background:var(--panel);box-shadow:none;border:1px dashed var(--line)}
.sheet.pending .bar{
  position:absolute;inset:auto 0 0 0;height:3px;background:var(--azure);
  animation:sweep 1.1s linear infinite;transform-origin:left;
}
.sheet.pending .waiting{color:var(--muted);font-size:13px;text-align:center;padding:76px 0}
@keyframes sweep{0%{transform:scaleX(0)}60%{transform:scaleX(1)}100%{transform:scaleX(1);opacity:.2}}
.sheet.arrive{animation:arrive .22s ease-out}
@keyframes arrive{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}

.note{
  max-width:560px;margin:14px auto 0;
  background:#3a1f22;border:1px solid #6b3237;color:#ffc9c9;
  border-radius:9px;padding:11px 13px;font-size:13px;
}

/* ---- 下部の操作バー（読み取りタブだけ） ---- */
.dock{
  position:fixed;left:14px;right:14px;z-index:30;
  bottom:calc(var(--tabs-h) + 18px + env(safe-area-inset-bottom));
  height:var(--dock-h);border-radius:20px;
  display:flex;align-items:center;justify-content:space-around;
  background:rgba(16,24,33,.9);backdrop-filter:blur(18px);
  border:1px solid #223040;
  box-shadow:0 14px 30px -12px rgba(0,0,0,.9);
}
.dockbtn{
  display:flex;flex-direction:column;align-items:center;gap:4px;
  width:88px;padding:4px 0;border:0;background:transparent;
  color:#C3D3E2;font-size:11px;cursor:pointer;
}
.dockbtn svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linejoin:round;stroke-linecap:round}
.dockbtn svg .f{fill:currentColor;stroke:none}
.dockbtn:disabled{color:#45515F;cursor:default}

/* ---- 結果パネル ---- */
.result{
  position:fixed;left:0;right:0;bottom:0;z-index:40;
  background:var(--panel);border-top:1px solid var(--line);
  border-radius:16px 16px 0 0;
  padding:16px 16px calc(18px + env(safe-area-inset-bottom));
  box-shadow:0 -12px 34px rgba(0,0,0,.5);
  animation:rise .2s ease-out;
}
@keyframes rise{from{transform:translateY(100%)}to{transform:none}}
.rtop{display:flex;align-items:center;margin-bottom:4px}
.rtop strong{font-size:15.5px}
.result .rmeta{font-size:12.5px;color:var(--muted);margin:0 0 14px}
.rbtns{display:flex;flex-direction:column;gap:9px}
.wide{
  width:100%;
  display:flex;align-items:center;justify-content:center;
  min-height:52px;border-radius:11px;border:0;
  background:var(--azure);color:#07121d;
  font-size:15.5px;font-weight:bold;text-decoration:none;cursor:pointer;
}
.wide.ghost{background:transparent;border:1px solid var(--line);color:var(--text);font-weight:normal}
.rhint{font-size:12px;color:var(--muted);line-height:1.65;margin:12px 0 0}
.x{
  margin-left:auto;width:34px;height:34px;border:0;border-radius:50%;
  background:transparent;color:var(--muted);font-size:15px;cursor:pointer;
}

/* ---- 見比べ（拡大表示） ---- */
.viewer{
  position:fixed;inset:0;z-index:60;background:#05090d;
  display:flex;flex-direction:column;
}
.viewer .libbar .t{flex:1;text-align:center;font-size:15px;font-weight:bold}
.viewer .libbar .x{color:#dbe8f5;margin:0}
.vstage{
  flex:1;min-height:0;display:flex;align-items:center;justify-content:center;
  padding:10px;overflow:auto;
}
.vwrap{position:relative;display:inline-block;line-height:0}
.vwrap img{
  max-width:100%;max-height:calc(100dvh - 230px);
  width:auto;height:auto;display:block;
  box-shadow:0 8px 30px rgba(0,0,0,.6);
}
.vquad{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible}
.vquad polygon{
  fill:rgba(88,166,232,.14);stroke:#58A6E8;stroke-width:2;
  vector-effect:non-scaling-stroke;stroke-dasharray:7 5;
}
.vbar{
  padding:12px 16px calc(14px + env(safe-area-inset-bottom));
  border-top:1px solid var(--line);background:var(--panel);
}
.vwhat{
  margin:0 0 11px;font-size:13px;color:var(--text);text-align:center;line-height:1.7;
}
.vwhat b{color:var(--azure);font-weight:bold}
.vtabs{display:flex;background:#0E1721;border:1px solid var(--line);border-radius:10px;padding:3px;gap:3px}
.vtabs button{
  flex:1;border:0;background:transparent;color:var(--muted);
  font-family:inherit;font-size:14px;padding:11px 4px;border-radius:7px;cursor:pointer;
}
.vtabs button.on{background:var(--azure);color:#07121d;font-weight:bold}

/* ---- どう直したかのラベル ---- */
.sheet .fix{
  position:absolute;top:0;right:0;
  display:flex;align-items:center;gap:5px;
  background:rgba(13,20,28,.78);color:#CFE4F6;
  font-size:11px;padding:5px 9px;border-bottom-left-radius:7px;
  max-width:72%;
}
.sheet .fix.none{color:#9FB0C2}
.sheet .fix .dot{
  width:6px;height:6px;border-radius:50%;background:#6FD08C;flex:0 0 auto;
}
.sheet .fix.none .dot{background:#5A6A7A}
.sheet .cmp{
  position:absolute;right:8px;bottom:54px;
  border:0;border-radius:999px;padding:8px 14px;
  background:rgba(13,20,28,.82);color:#fff;font-family:inherit;font-size:12.5px;
  cursor:pointer;box-shadow:0 2px 10px rgba(0,0,0,.4);
}

@media (min-width:700px){
  .sheets{max-width:620px}
  .desk{padding-bottom:calc(var(--dock-h) + 40px)}
}
@media (prefers-reduced-motion:reduce){
  *{animation:none !important;transition:none !important}
}

/* ---- 設定（保存先） ---- */
.gear{margin-left:10px;width:34px;height:34px;border:0;background:transparent;padding:0;cursor:pointer}
.gear svg{width:22px;height:22px;fill:none;stroke:#dbe8f5;stroke-width:1.6;stroke-linejoin:round}
.topbar .tally + .gear{margin-left:8px}
.topbar .gear:only-of-type{margin-left:auto}
.tally ~ .gear{margin-left:8px}

.sheetwrap{position:fixed;inset:0;z-index:50;background:rgba(5,9,13,.6);display:flex;align-items:flex-end}
.sheetwrap .panel{
  width:100%;max-height:88vh;overflow:auto;
  background:var(--panel);border-radius:16px 16px 0 0;border-top:1px solid var(--line);
  padding:16px 16px calc(20px + env(safe-area-inset-bottom));
  animation:rise .2s ease-out;
}
.dest{
  display:flex;gap:11px;align-items:flex-start;
  border:1px solid var(--line);border-radius:12px;padding:13px;margin-bottom:11px;cursor:pointer;
}
.dest.on{border-color:var(--azure);background:rgba(88,166,232,.08)}
.dest.off{opacity:.45}
.dest input[type=radio]{width:20px;height:20px;margin:1px 0 0;accent-color:var(--azure);flex:0 0 auto}
.dest .body{display:block;flex:1}
.dest .nm{display:block;font-size:14.5px;margin-bottom:3px}
.dest .nm em{font-style:normal;font-size:11.5px;color:var(--muted)}
.dest .nm em.ok{color:#6FD08C}
.dest .ds{display:block;font-size:12px;color:var(--muted);line-height:1.65}
.dest .sub{
  display:none;width:100%;margin-top:9px;padding:9px 10px;
  background:#0E1721;border:1px solid var(--line);border-radius:8px;
  color:var(--text);font-size:14px;
}
.dest.on .sub{display:block}
.dest .connect{
  display:none;margin-top:9px;padding:9px 14px;border-radius:8px;
  border:1px solid var(--azure);background:transparent;color:var(--azure);
  font-size:13.5px;cursor:pointer;
}
.dest .connect.show{display:inline-block}

.rbtns .row{display:flex;gap:9px}
.half{
  flex:1;display:flex;align-items:center;justify-content:center;
  min-height:46px;border-radius:10px;border:1px solid var(--line);
  background:transparent;color:var(--text);font-size:14px;text-decoration:none;cursor:pointer;
}
.wide.done{background:#2C7A4B;color:#fff}

.toast{
  position:fixed;left:50%;bottom:calc(var(--dock-h) + env(safe-area-inset-bottom) + 18px);
  transform:translateX(-50%);
  z-index:70;max-width:90%;
  background:#0B2E1C;border:1px solid #2C7A4B;color:#CFEFDC;
  padding:11px 16px;border-radius:999px;font-size:13.5px;white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis;
}
.toast.err{background:#3a1f22;border-color:#6b3237;color:#ffc9c9}

/* ---- 追加機能 ---- */
#readmode button{font-size:13px}
.fname{
  width:100%;margin:2px 0 10px;padding:10px 11px;
  background:#0E1721;border:1px solid var(--line);border-radius:9px;
  color:var(--text);font-size:14.5px;
}
.howto{display:none;margin-top:9px;font-size:12.5px;color:var(--azure)}
.dest.off .howto{display:inline-block}
.opt2{
  display:flex;gap:11px;align-items:flex-start;
  border-top:1px solid var(--line);padding:14px 2px 4px;margin-top:4px;cursor:pointer;
}
.opt2 input{width:20px;height:20px;margin:1px 0 0;accent-color:var(--azure);flex:0 0 auto}
.opt2 .nm{display:block;font-size:14.5px;margin-bottom:3px}
.opt2 .ds{display:block;font-size:12px;color:var(--muted);line-height:1.65}
.opt2.off{display:none}
.cardstep{
  max-width:560px;margin:0 auto 14px;
  background:rgba(88,166,232,.1);border:1px solid rgba(88,166,232,.4);
  color:#CFE4F6;border-radius:10px;padding:12px 14px;font-size:13.5px;line-height:1.7;
}
.cardstep button{
  margin-top:9px;padding:8px 14px;border-radius:8px;
  border:1px solid var(--azure);background:transparent;color:var(--azure);
  font-size:13px;cursor:pointer;
}

/* ---- アカウント ---- */
.account{margin-bottom:14px}
.account .ds{font-size:12.5px;color:var(--muted);margin:0 0 10px;line-height:1.7}
.account input{
  width:100%;margin-bottom:9px;padding:11px;
  background:#0E1721;border:1px solid var(--line);border-radius:9px;
  color:var(--text);font-size:15px;
}
.signed{
  display:flex;align-items:center;gap:10px;
  background:#0E1721;border:1px solid var(--line);border-radius:10px;padding:11px 13px;
  font-size:13.5px;
}
.signed button{
  margin-left:auto;border:0;background:transparent;color:var(--azure);
  font-size:13px;cursor:pointer;padding:4px;
}
.dest.locked{opacity:.45}
.dest.locked .howto{display:none}

/* ---- 保存したファイル ---- */
.library{
  position:fixed;inset:0;z-index:55;background:var(--ink);
  display:flex;flex-direction:column;
}
.libbar{
  display:flex;align-items:center;gap:6px;
  padding:calc(9px + env(safe-area-inset-top)) 10px 9px;
  background:linear-gradient(180deg,#1F4E79,#173c5e);
}
.libbar .t{flex:1;text-align:center;font-size:15.5px;font-weight:bold}
.libbar .x{color:#dbe8f5;margin:0}
.libwhere{
  margin:0;padding:11px 16px;font-size:12.5px;color:var(--muted);
  border-bottom:1px solid var(--line);
}
.liblist{flex:1;overflow:auto;padding:6px 12px calc(24px + env(safe-area-inset-bottom))}
.fileRow{
  display:flex;align-items:center;gap:12px;
  background:var(--panel);border:1px solid var(--line);border-radius:11px;
  padding:12px 13px;margin-bottom:9px;
}
.fileRow .ic{
  width:34px;height:42px;flex:0 0 auto;border-radius:3px;background:#fff;
  position:relative;box-shadow:0 2px 6px rgba(0,0,0,.4);
}
.fileRow .ic::after{
  content:"PDF";position:absolute;left:0;right:0;top:15px;
  font-size:8.5px;font-weight:bold;text-align:center;color:#c0392b;
}
.fileRow .meta{flex:1;min-width:0}
.fileRow .nm{
  font-size:14px;margin-bottom:3px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.fileRow .sub{font-size:11.5px;color:var(--muted)}
.fileRow .go{
  border:1px solid var(--line);border-radius:8px;background:transparent;
  color:var(--azure);font-size:13px;padding:9px 13px;cursor:pointer;flex:0 0 auto;
}
.libempty{text-align:center;color:var(--muted);font-size:13.5px;padding:60px 20px;line-height:1.9}
.library:not([hidden]) ~ .toast{bottom:calc(24px + env(safe-area-inset-bottom))}
.toast a{color:inherit;text-decoration:underline;margin-left:10px;font-weight:bold}

/* ---- 枠を手で合わせる ---- */
.cropper{
  position:fixed;inset:0;z-index:58;background:#05090d;
  display:flex;flex-direction:column;
}
.cropstage{
  flex:1;position:relative;margin:10px;
  display:flex;align-items:center;justify-content:center;
  touch-action:none;user-select:none;-webkit-user-select:none;
}
.cropstage img{
  max-width:100%;max-height:100%;display:block;
  pointer-events:none;-webkit-user-drag:none;
}
.cropsvg{position:absolute;pointer-events:none;overflow:visible}
.cropsvg polygon{
  fill:rgba(88,166,232,.16);stroke:#58A6E8;stroke-width:.5;
  vector-effect:non-scaling-stroke;
}
.handle{
  position:absolute;width:46px;height:46px;margin:-23px 0 0 -23px;
  border:0;background:transparent;padding:0;cursor:grab;touch-action:none;
}
.handle::after{
  content:"";position:absolute;left:11px;top:11px;width:24px;height:24px;
  border-radius:50%;background:#58A6E8;border:3px solid #fff;
  box-shadow:0 2px 8px rgba(0,0,0,.6);
}
.handle:active{cursor:grabbing}
.handle:active::after{transform:scale(1.15)}
.cropbar{
  padding:12px 16px calc(16px + env(safe-area-inset-bottom));
  border-top:1px solid var(--line);background:var(--panel);
}
.cropbar .hint{margin:0 0 11px;text-align:center}

/* ---- アプリの中でPDFを見る ---- */
.pdfview{
  position:fixed;inset:0;z-index:62;background:#05090d;
  display:flex;flex-direction:column;
}
.pdfview .libbar .t{
  flex:1;text-align:center;font-size:14.5px;font-weight:bold;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 4px;
}
.pdfview .libbar .x{color:#dbe8f5;margin:0;font-size:24px;line-height:1}
.pdfpages{
  flex:1;min-height:0;overflow:auto;
  padding:12px 10px;display:flex;flex-direction:column;align-items:center;gap:12px;
}
.pdfpages .pg{position:relative;width:100%;max-width:620px}
.pdfpages img{
  width:100%;display:block;background:#fff;border-radius:2px;
  box-shadow:0 6px 18px rgba(0,0,0,.5);min-height:120px;
}
.pdfpages .no{
  position:absolute;left:0;top:0;background:rgba(13,20,28,.72);color:#fff;
  font-size:11px;padding:4px 9px;border-bottom-right-radius:6px;
}
.pdfpages .msg{color:var(--muted);font-size:13.5px;padding:50px 20px;text-align:center;line-height:1.9}
.pdfbar{
  display:flex;gap:9px;
  padding:11px 16px calc(14px + env(safe-area-inset-bottom));
  border-top:1px solid var(--line);background:var(--panel);
}

/* ---- 画質の選択 ---- */
.qual{display:block;border-top:1px solid var(--line);padding:14px 2px 4px;margin-top:4px}
.qual .nm{display:block;font-size:14.5px;margin-bottom:9px}
.qual .seg{margin-bottom:8px}
.qual .ds{display:block;font-size:12px;color:var(--muted);line-height:1.65}

/* ---- 補正前→補正後の拭き取り ---- */
.sheet .pane{position:relative;line-height:0;overflow:hidden}
.sheet .pane img{width:100%;display:block}
.sheet .beforeimg{
  position:absolute;inset:0;width:100%;height:100%;
  object-fit:fill;pointer-events:none;
}
.sheet .divider{
  position:absolute;top:0;bottom:0;width:3px;margin-left:-1.5px;
  background:#58A6E8;box-shadow:0 0 0 1px rgba(0,0,0,.35);
  cursor:ew-resize;touch-action:none;z-index:3;
}
.sheet .divider::after{
  content:"";position:absolute;top:50%;left:50%;
  width:42px;height:42px;border-radius:50%;
  margin:-21px 0 0 0;transform:translateX(calc(-21px + var(--hx,0px)));transition:transform .18s;
  background:#58A6E8;border:3px solid #fff;box-shadow:0 2px 10px rgba(0,0,0,.5);
}
.sheet .divider::before{
  content:"";position:absolute;top:50%;left:50%;
  width:16px;height:16px;margin:-8px 0 0 0;z-index:4;
  transform:translateX(calc(-8px + var(--hx,0px)));transition:transform .18s;
  border-left:3px solid #07121d;border-right:3px solid #07121d;
}
.sheet .tag{
  position:absolute;bottom:10px;z-index:4;
  background:rgba(13,20,28,.85);color:#fff;font-size:11.5px;line-height:1.5;
  padding:4px 10px;border-radius:999px;transition:opacity .15s;
  box-shadow:0 1px 6px rgba(0,0,0,.4);
}
.sheet .tag.left{left:8px}
.sheet .tag.right{right:8px}
.sheet .pane .divider{transition:opacity .35s}
.sheet .pane.settled .divider{opacity:.55}
.sheet .pane.settled:hover .divider,
.sheet .pane.settled:active .divider{opacity:1}
/* 拭き取り中はボタンを隠してラベルを見せる */
.sheet .cmp{transition:opacity .2s}
.sheet .pane:not(.settled) ~ .cmp{opacity:0;pointer-events:none}

/* ================= タブと画面（v4.0.0） ================= */
body{padding-bottom:0}
.screen{display:none}
.screen.on{display:block}
.screen#pane-home,.screen#pane-tools{
  padding:0 20px calc(var(--tabs-h) + env(safe-area-inset-bottom) + 34px);
}
.screen a{color:inherit;text-decoration:none}

.title{font-size:24px;font-weight:bold;line-height:1.3;margin:12px 0 2px;letter-spacing:0}
.lede{color:var(--muted);font-size:12.5px;margin:0 0 18px;line-height:1.7}
.screen h2{font-size:13px;font-weight:bold;color:#A7BACC;margin:28px 0 12px}

/* 主役：読み取り枠 */
.hero{
  display:block;width:100%;text-align:center;cursor:pointer;
  background:var(--felt);border:1px solid var(--hair);border-radius:20px;
  padding:22px 20px 18px;color:inherit;font-family:inherit;
}
.hero .frame{position:relative;width:104px;height:132px;margin:0 auto 16px}
.hero .frame .pg{position:absolute;inset:9px;background:var(--paper);border-radius:3px;
  box-shadow:0 14px 26px -10px rgba(0,0,0,.78),0 2px 5px rgba(0,0,0,.4)}
.hero .frame .pg::before{content:"";position:absolute;left:15px;right:15px;top:22px;height:0;
  border-top:4px solid #2A3540;opacity:.8}
.hero .frame .pg::after{content:"";position:absolute;left:15px;right:23px;top:38px;bottom:24px;
  background:repeating-linear-gradient(#A9B4BF 0 3px,transparent 3px 12px);opacity:.6}
.hero .frame i{position:absolute;width:24px;height:24px;border:4px solid var(--azure);border-radius:4px}
.hero .frame i:nth-of-type(1){top:0;left:0;border-right:0;border-bottom:0}
.hero .frame i:nth-of-type(2){top:0;right:0;border-left:0;border-bottom:0}
.hero .frame i:nth-of-type(3){bottom:0;right:0;border-left:0;border-top:0}
.hero .frame i:nth-of-type(4){bottom:0;left:0;border-right:0;border-top:0}
.hero b{display:block;font-size:17px;font-weight:bold}
.hero span{display:block;font-size:12.5px;color:var(--muted);margin-top:3px}

/* 脇役 */
.pair{display:flex;gap:9px;margin-top:9px}
.pair button{flex:1;background:var(--felt);border:1px solid var(--hair);border-radius:14px;
  padding:13px 12px;display:flex;align-items:center;gap:9px;color:inherit;
  font-family:inherit;font-size:12.5px;font-weight:600;cursor:pointer}
.pair svg{width:19px;height:19px;flex:0 0 auto;color:#7FA8C9;fill:none;
  stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* 紙を横に並べる */
.docs{display:flex;gap:13px;overflow-x:auto;margin:0 -20px;padding:4px 20px 8px;scrollbar-width:none}
.docs::-webkit-scrollbar{display:none}
.docs .doc{flex:0 0 106px;border:0;background:none;padding:0;cursor:pointer;
  color:inherit;font-family:inherit;text-align:left}
.docs .sh{display:block;height:136px;background:var(--paper);border-radius:3px;position:relative;
  box-shadow:0 12px 22px -9px rgba(0,0,0,.8),0 2px 4px rgba(0,0,0,.45)}
.docs .sh::before{content:"";position:absolute;left:13px;right:13px;top:17px;height:0;
  border-top:4px solid #2A3540;opacity:.75}
.docs .sh::after{content:"";position:absolute;left:13px;right:22px;top:30px;bottom:18px;
  background:repeating-linear-gradient(#A9B4BF 0 3px,transparent 3px 11px);opacity:.55}
.docs .dn{display:block;font-size:11.5px;margin-top:9px;color:#CBD9E6;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.docs .dm{display:block;font-size:10.5px;color:var(--dim)}
.docs .none{color:var(--dim);font-size:12.5px;padding:6px 0 10px}

/* 罫線で区切る行 */
.rows{border-top:1px solid var(--hair)}
.rows .row{display:flex;align-items:center;gap:11px;width:100%;text-align:left;
  padding:15px 2px;border:0;border-bottom:1px solid var(--hair);background:none;
  color:inherit;font-family:inherit;cursor:pointer}
.rows .rl{flex:1;min-width:0}
.rows .rl b{display:block;font-size:14px;font-weight:600}
.rows .rl span{display:block;font-size:11.5px;color:var(--muted);margin-top:1px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rows .rt{font-size:11.5px;color:var(--azure);flex:0 0 auto}
.rows .chev{width:7px;height:7px;border-right:1.6px solid var(--dim);
  border-bottom:1.6px solid var(--dim);transform:rotate(-45deg);flex:0 0 auto;margin-right:3px}
.rows .dot{width:7px;height:7px;border-radius:50%;background:#59C07E;flex:0 0 auto}
.rows .dot.off{background:#3A4654}

/* ツール */
.gh{font-size:12px;font-weight:bold;color:var(--dim);margin:24px 0 11px}
.gh:first-of-type{margin-top:4px}
.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px 10px}
.tool{display:flex;flex-direction:column;align-items:center;gap:9px;min-width:0}
.tool .chip{width:52px;height:52px;border-radius:16px;display:grid;place-items:center;
  background:color-mix(in srgb,var(--c) 17%,transparent);
  border:1px solid color-mix(in srgb,var(--c) 32%,transparent);
  color:var(--c);transition:transform .14s}
.tool:active .chip{transform:scale(.92)}
.tool .chip svg{width:26px;height:26px}
.tool .tn{font-size:11px;text-align:center;line-height:1.4;color:#B9C8D6;
  max-width:100%;overflow-wrap:anywhere}

.ver{text-align:center;color:var(--dim);font-size:11px;margin:28px 0 6px;line-height:1.8}

/* 下タブ */
.tabs{
  position:fixed;left:14px;right:14px;bottom:calc(12px + env(safe-area-inset-bottom));
  z-index:45;display:flex;background:rgba(16,24,33,.9);backdrop-filter:blur(18px);
  border:1px solid #223040;border-radius:21px;padding:7px 4px;
  box-shadow:0 14px 30px -10px rgba(0,0,0,.9);
}
.tabs button{
  flex:1;background:none;border:0;color:var(--dim);font-family:inherit;
  padding:3px 0;display:grid;justify-items:center;gap:3px;font-size:10px;cursor:pointer;
}
.tabs button svg{width:21px;height:21px;fill:none;stroke:currentColor;
  stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.tabs button.on{color:var(--azure)}

@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
