:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f4f6;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #2563eb;
  --danger: #b91c1c;
  --bar: rgba(255,255,255,.94);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0f16;
  --panel: #131a24;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --line: #263241;
  --accent: #60a5fa;
  --danger: #f87171;
  --bar: rgba(11,15,22,.94);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #0b0f16;
    --panel: #131a24;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --line: #263241;
    --accent: #60a5fa;
    --danger: #f87171;
    --bar: rgba(11,15,22,.94);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: -apple-system,BlinkMacSystemFont,"Helvetica Neue","Yu Gothic UI","Yu Gothic",sans-serif; }
body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
button, input, select { font: inherit; }
button { color: inherit; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  min-height: calc(58px + env(safe-area-inset-top));
  padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bar); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.app-title { font-weight: 800; font-size: 19px; line-height: 1.1; }
.app-subtitle { color: var(--muted); font-size: 11px; margin-top: 3px; }
.icon-button {
  width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); font-size: 24px;
}
.content { max-width: 780px; margin: 0 auto; padding: 12px; }
.tabbar {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
  height: calc(64px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5,1fr);
  background: var(--bar); backdrop-filter: blur(16px); border-top: 1px solid var(--line);
}
.tab { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); }
.tab span { font-size: 20px; line-height: 1; }
.tab small { font-size: 10px; }
.tab.active { color: var(--accent); font-weight: 700; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 10px; }
.section-title { font-size: 17px; font-weight: 800; margin: 4px 2px 10px; }
.toolbar { display: flex; gap: 8px; margin-bottom: 10px; overflow-x: auto; }
.pill { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 8px 12px; white-space: nowrap; }
.pill.active { background: var(--accent); color: white; border-color: var(--accent); }
.thread-row { width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); padding: 12px; background: var(--panel); }
.thread-row:last-child { border-bottom: 0; }
.thread-title { font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; }
.thread-meta { margin-top: 6px; color: var(--muted); font-size: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.thread-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.back { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 8px 10px; }
.thread-heading { font-weight: 800; font-size: 16px; line-height: 1.45; }
.favorite { margin-left: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 8px 10px; }
.favorite.on { color: #eab308; }
.post { padding: 12px; border-bottom: 1px solid var(--line); background: var(--panel); }
.post:last-child { border-bottom: 0; }
.post-head { color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.post-number { color: var(--accent); font-weight: 800; margin-right: 7px; }
.post-body { margin-top: 7px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.anchor { border: 0; padding: 0; background: transparent; color: var(--accent); text-decoration: underline; }
.external-link { color: var(--accent); text-decoration: underline; word-break: break-all; }
.form { padding: 12px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.input { width: 100%; border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 10px; padding: 11px 12px; min-height: 44px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.primary { width: 100%; border: 0; border-radius: 11px; background: var(--accent); color: white; font-weight: 800; padding: 12px; min-height: 46px; }
.secondary { width: 100%; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); padding: 11px; }
.danger { color: var(--danger); }
.empty, .loading, .error { padding: 28px 16px; text-align: center; color: var(--muted); }
.error { color: var(--danger); }
.setting { padding: 13px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.setting:last-child { border-bottom: 0; }
.setting-text strong { display: block; }
.setting-text small { display: block; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.switch { width: 22px; height: 22px; }
.toast {
  position: fixed; z-index: 50; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom));
  transform: translateX(-50%); max-width: min(90vw,480px);
  background: #111827; color: #fff; padding: 10px 14px; border-radius: 10px; font-size: 13px;
  box-shadow: 0 6px 30px rgba(0,0,0,.25);
}
.note { color: var(--muted); font-size: 12px; line-height: 1.55; margin: 8px 2px 14px; }
mark { padding: 0; background: #fde68a; color: #111827; }


/* v0.6: in-thread search and reply heatmap */
.thread-searchbar {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto 42px 42px 42px;
  gap: 6px;
  align-items: center;
  margin-bottom: 7px;
}
.thread-search-input { min-width: 0; }
.thread-search-count { min-width: 42px; text-align: center; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.thread-search-button {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  font-weight: 800;
}
.reply-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 2px 8px;
  color: var(--muted);
  font-size: 11px;
}
.reply-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; }
.heat-1 { background: #eab308; }
.heat-2 { background: #f97316; }
.heat-3 { background: #dc2626; }
.reply-heat-1 { box-shadow: inset 4px 0 0 #eab308; background: color-mix(in srgb, var(--panel) 94%, #eab308 6%); }
.reply-heat-2 { box-shadow: inset 4px 0 0 #f97316; background: color-mix(in srgb, var(--panel) 90%, #f97316 10%); }
.reply-heat-3 { box-shadow: inset 5px 0 0 #dc2626; background: color-mix(in srgb, var(--panel) 86%, #dc2626 14%); }
.reply-count-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 999px;
  color: white;
  font-size: 10px;
  font-weight: 800;
  vertical-align: 1px;
}
.post.search-hit { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: -2px; }
.post.search-current { outline: 3px solid var(--accent); outline-offset: -3px; }
.reply-rail {
  position: fixed;
  z-index: 24;
  right: max(5px, env(safe-area-inset-right));
  top: calc(72px + env(safe-area-inset-top));
  bottom: calc(78px + env(safe-area-inset-bottom));
  width: 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 18%, transparent);
  pointer-events: none;
}
.reply-rail-marker {
  position: absolute;
  left: 0;
  width: 12px;
  min-width: 12px;
  height: 8px;
  border: 0;
  border-radius: 999px;
  transform: translateY(-50%);
  padding: 0;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--panel) 70%, transparent);
  pointer-events: auto;
  cursor: pointer;
}
.date-note { margin: -3px 0 12px; color: var(--muted); font-size: 11px; line-height: 1.45; }
@media (max-width: 560px) {
  .thread-searchbar { grid-template-columns: minmax(0,1fr) 38px 38px 38px; }
  .thread-search-count { grid-column: 1 / -1; grid-row: 2; text-align: left; min-height: 14px; }
  .reply-rail { width: 9px; right: 2px; }
  .reply-rail-marker { width: 9px; min-width: 9px; }
}


/* v0.7: readable posts, Imgur previews, same-ID grouping */
.post-body {
  white-space: pre-wrap;
  word-break: normal;
  overflow-wrap: anywhere;
}
.post-id {
  border: 0;
  background: transparent;
  padding: 1px 4px;
  margin: 0 3px;
  border-radius: 5px;
  font-size: inherit;
  cursor: pointer;
}
.id-heat-0 { color: var(--muted); }
.id-heat-1 { color: #16a34a; background: color-mix(in srgb, #16a34a 10%, transparent); }
.id-heat-2 { color: #2563eb; background: color-mix(in srgb, #2563eb 10%, transparent); }
.id-heat-3 { color: #ea580c; background: color-mix(in srgb, #ea580c 12%, transparent); }
.id-heat-4 { color: #dc2626; background: color-mix(in srgb, #dc2626 14%, transparent); font-weight: 800; }

.image-preview-grid {
  margin-top: 10px;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.image-preview-link {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg);
}
.image-preview {
  display: block;
  width: auto;
  height: auto;
  max-width: min(240px, 72vw);
  max-height: 220px;
  object-fit: contain;
}
@media (max-width: 560px) {
  .image-preview { max-width: min(180px, 43vw); max-height: 180px; }
}

.id-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0,0,0,.48);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
}
.id-panel {
  width: min(720px, 100%);
  max-height: 72vh;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 50px rgba(0,0,0,.35);
}
.id-panel-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.id-close {
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  font-size: 22px;
}
.id-panel-list { overflow: auto; max-height: calc(72vh - 64px); }
.id-post-item {
  width: 100%;
  text-align: left;
  display: block;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  padding: 12px;
}
.id-post-meta { color: var(--accent); font-size: 12px; font-weight: 800; margin-bottom: 5px; }
.id-post-text { white-space: pre-wrap; line-height: 1.5; overflow-wrap: anywhere; }
.flash-post { animation: flashPost .9s ease-out; }
@keyframes flashPost {
  0% { outline: 4px solid var(--accent); outline-offset: -4px; }
  100% { outline-color: transparent; }
}


/* v0.8: image viewer, internal-thread long press menu, reply tree */
.post-number {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
}
.post-number-replied {
  cursor: pointer;
  border-radius: 5px;
  padding: 1px 4px;
  margin-left: -4px;
}
.post-number-replied.heat-1 { color: #16a34a; background: color-mix(in srgb, #16a34a 11%, transparent); }
.post-number-replied.heat-2 { color: #2563eb; background: color-mix(in srgb, #2563eb 12%, transparent); }
.post-number-replied.heat-3 { color: #ea580c; background: color-mix(in srgb, #ea580c 14%, transparent); }
.post-number-replied.heat-4 { color: #dc2626; background: color-mix(in srgb, #dc2626 16%, transparent); }

.heat-4 { background: #dc2626; }
.legend-dot.heat-4 { background: #dc2626; }
.reply-heat-4 { box-shadow: inset 5px 0 0 #dc2626; background: color-mix(in srgb, var(--panel) 84%, #dc2626 16%); }

.reply-legend-note { color: var(--muted); }

.internal-thread-link {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  -webkit-touch-callout: none;
  user-select: text;
}

.image-preview-link {
  appearance: none;
  padding: 0;
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
}

.image-viewer-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(0,0,0,.96);
  color: #fff;
  display: grid;
  grid-template-rows: auto minmax(0,1fr);
}
.image-viewer-topbar {
  min-height: calc(54px + env(safe-area-inset-top));
  padding: calc(7px + env(safe-area-inset-top)) 10px 7px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,.84);
}
.image-viewer-counter {
  text-align: center;
  font-size: 13px;
  color: #ddd;
}
.image-viewer-controls { display: flex; gap: 5px; }
.viewer-button {
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.1);
  color: #fff;
  border-radius: 9px;
  min-width: 38px;
  height: 38px;
  padding: 0 9px;
  font-size: 18px;
}
.image-viewer-stage {
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.image-viewer-stage.zoomed {
  align-items: flex-start;
  justify-content: flex-start;
}
.image-viewer-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: top left;
  transition: transform .12s ease-out;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}
.image-viewer-stage.zoomed .image-viewer-image {
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}

.action-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 115;
  background: rgba(0,0,0,.42);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
}
.action-sheet {
  width: min(560px,100%);
  display: grid;
  gap: 8px;
}
.action-sheet-url {
  background: var(--panel);
  border-radius: 13px;
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
  border: 1px solid var(--line);
}
.action-sheet-button {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
}
.primary-action { color: var(--accent); }
.cancel-action { margin-top: 3px; }

.reply-tree-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(0,0,0,.48);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
}
.reply-tree-panel {
  width: min(820px,100%);
  max-height: 82vh;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 60px rgba(0,0,0,.38);
}
.reply-tree-panel-head {
  min-height: 54px;
  padding: 9px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.reply-tree-scroll {
  max-height: calc(82vh - 54px);
  overflow: auto;
  padding: 9px;
  -webkit-overflow-scrolling: touch;
}
.reply-tree-node {
  position: relative;
  margin: 0 0 8px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
}
.reply-tree-children {
  margin-left: 14px;
  padding: 8px 0 0 11px;
  border-left: 2px solid color-mix(in srgb, var(--accent) 36%, var(--line));
}
.reply-tree-head {
  padding: 8px 10px 4px;
  color: var(--muted);
  font-size: 12px;
}
.reply-tree-number {
  color: var(--accent);
  font-weight: 800;
}
.reply-tree-body {
  padding: 3px 10px 10px;
  white-space: pre-wrap;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.reply-tree-clipped,
.reply-tree-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
}


/* v0.9: visited board rows, activity gradient, center-tap quick search */
.thread-row .thread-title {
  font-weight: 400;
  letter-spacing: 0;
}
.thread-row.thread-viewed .thread-title {
  font-weight: 800;
  letter-spacing: .005em;
}
.thread-speed {
  transition: color .15s ease;
}
.thread-speed.speed-hot {
  text-shadow: 0 0 0 currentColor;
}

.quick-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 125;
  background: rgba(0,0,0,.34);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.quick-search-panel {
  width: min(620px, 100%);
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 18px 60px rgba(0,0,0,.34);
}
.quick-search-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 10px;
}
.quick-search-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 8px;
  align-items: center;
}
.quick-search-count {
  min-width: 42px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.quick-search-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 7px;
  margin-top: 10px;
}
.quick-search-actions .secondary,
.quick-search-actions .primary {
  min-height: 42px;
  padding: 8px;
}
@media (max-width: 560px) {
  .quick-search-overlay {
    align-items: flex-start;
    padding-top: calc(18vh + env(safe-area-inset-top));
  }
  .quick-search-actions {
    grid-template-columns: 1fr 1fr;
  }
}


/* v0.11: red activity scale, URL shortening display */
.thread-speed {
  font-variant-numeric: tabular-nums;
}
.thread-speed.speed-hot {
  letter-spacing: .01em;
}
.thread-speed.speed-very-hot {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.external-link,
.internal-thread-link {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
}


/* v0.14 settings */
.setting-select {
  max-width: 180px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  padding: 7px 10px;
}


/* v0.15: board hierarchy + unread/resume */
.board-thread-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
}
.board-thread-main {
  min-width: 0;
}
.board-thread-date {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
  margin-bottom: 4px;
  font-weight: 400;
}
.board-thread-stats {
  min-width: 76px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
}
.board-thread-stats .thread-speed {
  font-size: 10px;
  line-height: 1.15;
  white-space: nowrap;
}
.thread-replies {
  color: var(--text);
  font-size: 16px;
  line-height: 1.1;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.thread-replies span {
  margin-left: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}
.thread-unread {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.thread-unread.has-unread {
  color: var(--accent);
  font-weight: 800;
}
.thread-row .thread-title {
  line-height: 1.4;
}
.thread-row.thread-viewed .thread-title {
  font-weight: 800;
}
.thread-row:not(.thread-viewed) .thread-title {
  font-weight: 400;
}

.unread-boundary {
  position: relative;
  z-index: 1;
  min-height: 34px;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, var(--panel));
  border-top: 2px solid color-mix(in srgb, var(--accent) 72%, var(--line));
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
  font-size: 12px;
}
.unread-boundary strong {
  font-variant-numeric: tabular-nums;
}
.post-unread .post-number {
  font-weight: 800;
}

@media (max-width: 560px) {
  .board-thread-layout {
    gap: 8px;
  }
  .board-thread-stats {
    min-width: 66px;
  }
  .thread-replies {
    font-size: 15px;
  }
}


/* v0.16: history search */
.history-search-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.history-search-count {
  min-width: 42px;
  text-align: right;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}


/* v0.17: pull-to-refresh */
.pull-refresh-indicator {
  position: fixed;
  z-index: 45;
  top: calc(54px + env(safe-area-inset-top));
  left: 50%;
  transform: translate(-50%, calc(-44px + var(--pull-distance, 0px)));
  min-width: 134px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  box-shadow: 0 5px 18px rgba(0,0,0,.14);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease, color .12s ease;
}
.pull-refresh-indicator.visible {
  opacity: 1;
}
.pull-refresh-indicator.armed {
  color: var(--accent);
}
.pull-refresh-indicator.refreshing {
  color: var(--accent);
  transform: translate(-50%, 8px);
}
.pull-refresh-indicator.refreshing .pull-refresh-icon {
  animation: pullSpin .8s linear infinite;
}
.pull-refresh-icon {
  display: inline-block;
  font-size: 15px;
}
@keyframes pullSpin {
  to { transform: rotate(360deg); }
}

/* v0.17: edge back / forward gesture cue */
.edge-gesture-indicator {
  position: fixed;
  z-index: 130;
  top: 50%;
  width: 42px;
  height: 64px;
  margin-top: -32px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  color: var(--accent);
  box-shadow: 0 8px 26px rgba(0,0,0,.18);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  line-height: 1;
  opacity: calc(.35 + var(--edge-progress, 0) * .65);
  pointer-events: none;
  backdrop-filter: blur(12px);
}
.edge-gesture-indicator.visible {
  display: flex;
}
.edge-gesture-indicator.back {
  left: 0;
  border-left: 0;
  border-radius: 0 18px 18px 0;
  transform: translateX(calc(-18px + var(--edge-progress, 0) * 18px));
}
.edge-gesture-indicator.forward {
  right: 0;
  border-right: 0;
  border-radius: 18px 0 0 18px;
  transform: translateX(calc(18px - var(--edge-progress, 0) * 18px));
}


/* v0.18: anywhere swipe cue */
.edge-gesture-indicator.back {
  left: 12px;
  border-left: 1px solid var(--line);
  border-radius: 18px;
  transform: translateX(calc(-10px + var(--edge-progress, 0) * 10px));
}
.edge-gesture-indicator.forward {
  right: 12px;
  border-right: 1px solid var(--line);
  border-radius: 18px;
  transform: translateX(calc(10px - var(--edge-progress, 0) * 10px));
}
