/* 技ノート
   ホーム：読書ビューアの本棚を流用（色は動画向けに青緑・ダーク基調）
   再生画面：試作v0.1。テーマに関係なく暗い背景 */
:root {
  --bg: #f2f5f4;
  --fg: #16201e;
  --sub: #5b6966;
  --line: #d3dcda;
  --card: #ffffff;
  --accent: #0c7f72;
  --on-accent: #ffffff;
  --scrim: rgba(0, 0, 0, .32);
  --tile: #dfe6e4;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0f1514;
  --fg: #e5eeec;
  --sub: #93a4a1;
  --line: #2a3735;
  --card: #18211f;
  --accent: #4fcfbb;
  --on-accent: #052a25;
  --scrim: rgba(0, 0, 0, .55);
  --tile: #1f2a28;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
body { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- ホーム ---------- */
#home {
  height: 100dvh;
  overflow-y: auto;
  padding: calc(env(safe-area-inset-top) + 16px) max(20px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 24px) max(20px, env(safe-area-inset-left));
  max-width: 1040px;
  margin: 0 auto;
  overscroll-behavior-y: contain;
}
.home-head { display: flex; align-items: center; justify-content: space-between; }
.home-head h1 { font-size: 22px; margin: 8px 0; font-weight: 700; letter-spacing: .04em; }

/* 動画を開くボタン：控えめなタイル */
.open-row { display: flex; gap: 10px; margin: 14px 0 18px; }
.open-tile {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--fg);
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  transition: background .15s, transform .1s;
}
.open-tile:active { transform: scale(.98); background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
.open-tile .ico {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}
.open-tile svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.open-tile .lbl { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 520px) {
  .open-tile { flex-direction: column; justify-content: center; gap: 7px; padding: 12px 8px 11px; text-align: center; font-size: 13px; }
  .open-tile .ico { width: 34px; height: 34px; }
  .open-tile .lbl { max-width: 100%; }
}

/* 検索・並べ替え */
#shelf-tools { position: relative; }
.shelf-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 40px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--fg) 7%, transparent);
  color: var(--sub);
}
.shelf-search svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.shelf-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--fg);
  font: inherit;
  font-size: 16px; /* iOSで勝手に拡大されないよう16px以上 */
}
.shelf-search input::placeholder { color: var(--sub); }
.shelf-bar { display: flex; align-items: center; gap: 8px; margin: 10px 0 14px; }
.shelf-bar .text-btn { margin-left: auto; padding: 6px 4px 6px 10px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  font-size: 13px;
  white-space: nowrap;
}
.chip svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#saved-only svg { display: none; }
#saved-only[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
#saved-only[aria-pressed="true"] svg { display: block; }
.sort-wrap { position: relative; }
.menu {
  position: absolute;
  z-index: 5;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  padding: 6px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
}
.menu button {
  display: flex;
  align-items: center;
  width: 100%;
  border: 0;
  background: none;
  padding: 11px 12px 11px 34px;
  border-radius: 9px;
  font-size: 15px;
  text-align: left;
  position: relative;
}
.menu button:active { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.menu button[aria-checked="true"] { color: var(--accent); font-weight: 600; }
.menu button[aria-checked="true"]::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 50%;
  width: 10px;
  height: 5px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-70%) rotate(-45deg);
}

/* 動画の一覧：正方形のタイル（中央を切り抜き）＋下に名前 */
.shelf-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 16px 12px;
}
@media (min-width: 600px) { .shelf-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 20px 16px; } }
.shelf-grid li { cursor: pointer; min-width: 0; }
.shelf-grid .cover {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  background: var(--tile);
  transition: transform .12s;
}
.shelf-grid li:active .cover { transform: scale(.97); }
.shelf-grid img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.shelf-grid .ph {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--sub);
}
.shelf-grid .ph svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.shelf-grid .dur {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .62);
  color: #fff;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}
.shelf-grid .title {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}
/* 保存済み（この端末で電波なしでも見られる）の印 */
.shelf-grid .ok {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 0 0 2px var(--bg);
}
.shelf-grid .ok svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
/* 編集中：1回目のタップで確認、2回目で一覧から外す */
.shelf-grid .del, .shelf-grid .confirm { display: none; }
#home.editing .shelf-grid .del {
  display: grid;
  place-items: center;
  position: absolute;
  top: -7px;
  left: -7px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #3a3a3c;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--bg);
  z-index: 2;
}
#home.editing .shelf-grid li:not(.armed) .cover { animation: wiggle .28s ease-in-out infinite alternate; }
@keyframes wiggle { from { transform: rotate(-.8deg); } to { transform: rotate(.8deg); } }
#home.editing .shelf-grid li.armed .del { background: #c0392b; }
#home.editing .shelf-grid li.armed .confirm {
  display: grid;
  place-items: center;
  position: absolute;
  inset: 0;
  padding: 8px;
  border-radius: 10px;
  background: rgba(192, 57, 43, .88);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}
.shelf-empty { color: var(--sub); font-size: 14px; line-height: 1.7; text-align: center; margin: 36px 12px; }
.version { text-align: center; color: var(--sub); font-size: 11px; margin-top: 36px; }
@media (prefers-reduced-motion: reduce) { #home.editing .shelf-grid li .cover { animation: none !important; } }

.icon-btn {
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
}
.icon-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.text-btn { border: 0; background: none; color: var(--accent); font-size: 15px; padding: 8px; }

/* ---------- パネル（設定） ---------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 20; }
.sheet {
  position: fixed;
  z-index: 21;
  background: var(--card);
  color: var(--fg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.sheet.bottom {
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 80dvh;
  padding: 8px 20px calc(env(safe-area-inset-bottom) + 20px);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, .18);
  max-width: 640px;
  margin: 0 auto;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 10px; }
.sheet-head h3 { margin: 0; font-size: 16px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.setting > span { font-size: 14px; flex: none; }
.seg { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 2px; flex-wrap: wrap; justify-content: flex-end; }
.seg button { border: 0; background: none; padding: 8px 12px; font-size: 13px; border-radius: 8px; }
.seg button.on { background: var(--accent); color: var(--on-accent); }
.note { color: var(--sub); font-size: 12px; line-height: 1.6; margin: 10px 0 4px; }
@media (max-width: 480px) {
  .setting { flex-wrap: wrap; }
  .setting > span { width: 100%; }
  .seg { width: 100%; justify-content: stretch; }
  .seg button { flex: 1; padding: 8px 6px; }
  #home { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
}

/* ---------- 読み込み中・お知らせ ---------- */
#loading {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-content: center;
  justify-items: center;
  background: var(--scrim);
  color: #fff;
}
.spinner { width: 36px; height: 36px; border: 3px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#loading p { margin: 14px 0 0; font-size: 14px; text-align: center; padding: 0 24px; line-height: 1.6; }
#loading-bar { width: min(70vw, 320px); height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .3); margin-top: 12px; overflow: hidden; }
#loading-bar i { display: block; height: 100%; width: 0; background: #fff; transition: width .2s; }
#toast {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top) + 64px);
  transform: translateX(-50%);
  z-index: 40;
  max-width: 90vw;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(30, 30, 32, .92);
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* ---------- 再生画面（試作v0.1） ---------- */
#player {
  --p-surface: #172020;
  --p-surface-2: #1d2827;
  --p-line: #2c3a38;
  --p-fg: #e5eeec;
  --p-muted: #93a4a1;
  --p-accent: #4fcfbb;
  --p-accent-ink: #052a25;
  --p-accent-soft: rgba(79, 207, 187, .16);
  --p-loop: #f0b440;
  --p-stage: #050807;
  --p-tile: #1f2a29;
  --p-glass: rgba(23, 32, 32, .76);
  --p-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
  position: fixed;
  inset: 0;
  z-index: 10;
  background: #0e1413;
  color: var(--p-fg);
  display: grid;
  gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) max(16px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 10px) max(16px, env(safe-area-inset-left));
  grid-template-columns: minmax(150px, 184px) minmax(0, 1fr) minmax(150px, 184px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "top top top" "left stage right" "strip strip strip";
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
#p-top { grid-area: top; display: flex; align-items: center; gap: 8px; min-width: 0; }
#p-info { flex: 1; min-width: 0; display: flex; align-items: baseline; justify-content: center; gap: 10px; white-space: nowrap; overflow: hidden; }
#p-name { overflow: hidden; text-overflow: ellipsis; color: var(--p-muted); font-size: 12.5px; min-width: 0; }
#p-time { font-family: var(--p-mono); font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 600; }
#p-frame { font-family: var(--p-mono); font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--p-muted); }
#p-zoom { font-size: 12px; color: var(--p-accent); font-weight: 600; }

.p-btn {
  min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--p-line);
  background: var(--p-surface); color: var(--p-fg);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; line-height: 1.15;
  transition: background-color .12s, border-color .12s, transform .06s;
}
.p-btn:active { transform: scale(.97); background: var(--p-surface-2); }
.p-btn:focus-visible { outline: 2px solid var(--p-accent); outline-offset: 2px; }
.p-btn.on { background: var(--p-accent-soft); border-color: var(--p-accent); }
.p-btn.primary { background: var(--p-accent); border-color: var(--p-accent); color: var(--p-accent-ink); font-weight: 600; }
.p-btn.slim { min-height: 38px; padding: 0 12px; font-size: 13px; }
.p-btn small { display: block; font-size: 10.5px; color: var(--p-muted); font-family: var(--p-mono); font-variant-numeric: tabular-nums; }
.p-btn .stack { display: flex; flex-direction: column; align-items: center; }
.p-btn svg { width: 18px; height: 18px; flex: none; }

.p-panel { display: flex; flex-direction: column; gap: 8px; align-self: center; min-width: 0; z-index: 2; }
.p-panel .p-btn { white-space: nowrap; }
#p-left { grid-area: left; }
#p-right { grid-area: right; }
.p-label { font-size: 11px; letter-spacing: .08em; color: var(--p-muted); margin-top: 4px; }
.p-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.p-speed { font-family: var(--p-mono); font-variant-numeric: tabular-nums; font-weight: 600; }
#p-play { min-height: 56px; font-size: 16px; }
.p-step { min-height: 56px; font-weight: 600; padding: 0 6px; }
.p-step .arrow { font-size: 18px; line-height: 1.1; }

#p-stage { grid-area: stage; position: relative; overflow: hidden; border-radius: 14px; background: var(--p-stage); touch-action: none; min-height: 0; }
#p-zoomer { position: absolute; inset: 0; transform-origin: 0 0; will-change: transform; }
#p-zoomer.anim { transition: transform .2s ease-out; }
#p-video { width: 100%; height: 100%; object-fit: contain; display: block; background: var(--p-stage); }
#p-video.mirror { transform: scaleX(-1); }
#p-busy { position: absolute; right: 12px; top: 10px; font-size: 11px; color: #cfd9d7; background: rgba(0, 0, 0, .45); padding: 2px 8px; border-radius: 99px; }
#p-flash { position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; background: rgba(0, 0, 0, .45); display: grid; place-items: center; opacity: 0; transition: opacity .35s; pointer-events: none; }
#p-flash.show { opacity: 1; transition: none; }
#p-flash svg { width: 34px; height: 34px; fill: #fff; }

#p-strip { grid-area: strip; position: relative; height: 68px; border-radius: 12px; overflow: hidden; background: var(--p-surface-2); border: 1px solid var(--p-line); touch-action: none; cursor: grab; }
#p-strip:active { cursor: grabbing; }
#p-canvas { width: 100%; height: 100%; display: block; }
#p-head { position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: var(--p-accent); border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); pointer-events: none; }
#p-thumbvideo { position: fixed; left: 0; top: 0; width: 4px; height: 4px; opacity: .01; pointer-events: none; z-index: -1; }

/* 横長の動画を横向きで見るとき：動画を全幅にして、左右のパネルを半透明で重ねる */
#player.wide #p-stage { grid-column: 1 / -1; }
#player.wide .p-panel { background: var(--p-glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); padding: 10px; border-radius: 16px; margin: 0 10px; }
#player.wide #p-left { margin-right: 0; }
#player.wide #p-right { margin-left: 0; }
#player.wide.hidepanels .p-panel { opacity: 0; pointer-events: none; }
#p-panel { display: none; }
#player.wide #p-panel { display: inline-flex; }

/* 縦向き（スマホなど） */
@media (max-aspect-ratio: 1/1) {
  #player {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "top top" "stage stage" "strip strip" "left right";
    gap: 8px;
  }
  .p-panel { align-self: start; gap: 6px; }
  .p-label { margin-top: 0; }
  #p-play, .p-step { min-height: 48px; }
  #p-strip { height: 58px; }
  #p-info { flex-direction: column; align-items: center; gap: 0; }
  #player.wide .p-panel { background: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0; margin: 0; }
  #player.wide #p-panel { display: none; }
  #player.wide.hidepanels .p-panel { opacity: 1; pointer-events: auto; }
}
@media (max-width: 420px) {
  .p-btn { padding: 0 8px; }
  #p-top .label-long { display: none; }
}

#p-sheet { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: grid; place-items: center; z-index: 20; padding: 16px; }
#p-sheet .card { width: min(440px, 100%); max-height: 100%; overflow: auto; background: var(--p-surface); color: var(--p-fg); border-radius: 18px; padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--p-line); }
#p-sheet h2 { margin: 0; font-size: 17px; }
#p-sheet .field { display: flex; flex-direction: column; gap: 6px; }
#p-sheet .field > span, #p-sheet .field label span { font-size: 12.5px; color: var(--p-muted); }
.p-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
#p-sheet select { min-height: 44px; border-radius: 12px; border: 1px solid var(--p-line); background: var(--p-surface-2); color: var(--p-fg); padding: 0 10px; font: inherit; }
#p-sheet .note { color: var(--p-muted); margin: 0; }
#p-sheet .actions { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { #p-zoomer.anim, .p-btn, #p-flash { transition: none; } }

/* ---------- アカウント ---------- */
.account-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
#account-text { font-size: 12px; color: var(--sub); overflow-wrap: anywhere; }
.small-btn { border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.primary { border: 0; border-radius: 14px; background: var(--accent); color: var(--on-accent); font-weight: 600; }

/* ---------- Googleドライブの選択画面（読書ビューアから流用） ---------- */
.sheet.full {
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
  overflow: hidden;
}
.drive-head { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.drive-head h3 { flex: 1; margin: 0; font-size: 16px; text-align: center; }
#drive-crumbs {
  display: flex;
  gap: 2px;
  align-items: center;
  overflow-x: auto;
  white-space: nowrap;
  padding: 8px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
#drive-crumbs button { border: 0; background: none; color: var(--accent); padding: 6px 4px; font-size: 13px; flex: none; }
#drive-crumbs button:last-child { color: var(--fg); font-weight: 600; }
#drive-crumbs .sep { color: var(--sub); flex: none; }
.drive-tools { display: flex; gap: 8px; padding: 8px 12px; }
.drive-tools input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 16px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--fg);
}
#drive-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.drow {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.4;
  min-height: 52px;
}
.drow svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.drow.folder svg { color: var(--accent); }
.drow .nm { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.drow .sz { font-size: 12px; color: var(--sub); flex: none; font-variant-numeric: tabular-nums; }
.drow .chk {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--sub);
  flex: none;
  display: grid;
  place-items: center;
}
.drow.sel { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.drow.sel .chk { background: var(--accent); border-color: var(--accent); }
.drow.sel .chk::after { content: ''; width: 9px; height: 5px; border: 2px solid var(--on-accent); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.drow .saved { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); flex: none; }
.drive-msg { padding: 24px 16px; color: var(--sub); font-size: 14px; text-align: center; line-height: 1.7; }
.drive-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px calc(env(safe-area-inset-bottom) + 10px);
  border-top: 1px solid var(--line);
  background: var(--card);
}
#drive-count { flex: 1; font-size: 13px; color: var(--sub); }
.drive-foot .primary { padding: 12px 22px; font-size: 15px; }
.drive-foot .primary:disabled { opacity: .4; }
#loading p { white-space: pre-line; }
