/* Soft, raised surfaces on a pale blue-grey ground (after Yomoo's look, 鬼さん 2026-10-24). */
/* Colour patterns: 緑 (default), 白, 黒, 青. Switched in 設定 via html[data-theme]. */
:root {
  --bg: #e3ebe6;
  --card: #e8efea;
  --ink: #1f2a24;
  --muted: #66746c;
  --line: #ccd9d1;
  --accent: #2f5d50;
  --accent-ink: #2f5d50;
  --accent-soft: #d3e3da;
  --on-accent: #fff;
  --accent-glow: rgba(47, 93, 80, .32);
  --tab-off: #8b9a92;
  --underline: #95a69c;
  --ghost: rgba(0, 0, 0, .06);
  --cover-a: #d2e2d8; --cover-b: #b8cdbf; --cover-ink: #3f5c4c;
  --toast: #263a31;
  --warn: #9a5b13;
  --warn-soft: #f3e6d2;
  --danger: #c0485a;
  --danger-soft: #f3dade;
  --ok: #2f7a4a;
  --ok-soft: #d4ead9;
  --sh-dark: rgba(140, 162, 150, .45);
  --sh-light: rgba(255, 255, 255, .85);
  --raise: 6px 6px 14px var(--sh-dark), -6px -6px 14px var(--sh-light);
  --raise-sm: 3px 3px 8px var(--sh-dark), -3px -3px 8px var(--sh-light);
  --inset: inset 3px 3px 7px var(--sh-dark), inset -3px -3px 7px var(--sh-light);
  --radius: 16px;
  --tap: 48px;
  color-scheme: light;
}
:root[data-theme="blue"] {
  --bg: #e4eaee; --card: #e9eef1; --ink: #23292e; --muted: #6b7680; --line: #cfd8de;
  --accent: #5486bd; --accent-ink: #3f6f9f; --accent-soft: #d3e1ee; --accent-glow: rgba(84, 134, 189, .35);
  --tab-off: #8a949c; --underline: #9aa6af;
  --cover-a: #cfdbe6; --cover-b: #b9c9d8; --cover-ink: #4d6478; --toast: #2d3a45;
  --sh-dark: rgba(150, 166, 180, .45);
}
:root[data-theme="white"] {
  --bg: #eceeef; --card: #f2f3f4; --ink: #1d1f21; --muted: #6d7277; --line: #d6d9dc;
  --accent: #2b2e31; --accent-ink: #2b2e31; --accent-soft: #dfe2e5; --accent-glow: rgba(0, 0, 0, .25);
  --tab-off: #9a9fa4; --underline: #a3a8ad;
  --cover-a: #e0e3e6; --cover-b: #c8ccd0; --cover-ink: #4a4f54; --toast: #2b2e31;
  --sh-dark: rgba(160, 166, 172, .45);
}
:root[data-theme="black"] {
  --bg: #1f2326; --card: #24292c; --ink: #e9ecee; --muted: #9aa3a9; --line: #353b40;
  --accent: #7fbf9f; --accent-ink: #9dd3b8; --accent-soft: #2c3b34; --on-accent: #10201a; --accent-glow: rgba(0, 0, 0, .4);
  --tab-off: #6f787e; --underline: #59636a; --ghost: rgba(255, 255, 255, .08);
  --cover-a: #34413b; --cover-b: #2a3430; --cover-ink: #b9cbc1; --toast: #3a4a43;
  --warn: #e3b067; --warn-soft: #3d3324; --danger: #ef8f9c; --danger-soft: #42282c; --ok: #8fd3a6; --ok-soft: #233a2c;
  --sh-dark: rgba(0, 0, 0, .55); --sh-light: rgba(255, 255, 255, .045);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }

.icon { display: inline-flex; width: 24px; height: 24px; flex: 0 0 auto; }
.icon svg { width: 100%; height: 100%; }

.app-head { padding: 14px 20px 0; padding-top: calc(14px + env(safe-area-inset-top)); max-width: 720px; margin: 0 auto; }
.app-head h1 { margin: 0; font-size: 15px; letter-spacing: .12em; color: var(--accent-ink); font-weight: 700; }

.view { padding: 10px 18px calc(96px + env(safe-area-inset-bottom)); max-width: 720px; margin: 0 auto; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--bg); box-shadow: 0 -6px 14px var(--sh-dark);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--tab-off); text-decoration: none; font-size: 11px; font-weight: 600;
}
.tabbar a svg { width: 28px; height: 28px; }
.tabbar a.on { color: var(--accent); }

/* buttons and inputs */
.btn {
  min-height: var(--tap); padding: 8px 18px; border-radius: 14px;
  border: 0; background: var(--card); box-shadow: var(--raise-sm); cursor: pointer;
}
.btn:active { box-shadow: var(--inset); }
.btn.primary { background: var(--accent); color: var(--on-accent); font-weight: 700; border-radius: 999px; box-shadow: 0 6px 14px var(--accent-glow); }
.btn.danger { color: var(--danger); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .45; box-shadow: none; }
.icon-btn {
  min-width: var(--tap); min-height: var(--tap); border: 0; background: transparent;
  font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
}
.round-btn {
  width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--card);
  box-shadow: var(--raise-sm); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink);
}
.round-btn:active { box-shadow: var(--inset); }
.row-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.row-buttons > * { flex: 1 1 auto; }

input[type="text"], input[type="search"], input[type="number"], input[type="month"], input[type="date"], select, textarea {
  width: 100%; min-height: var(--tap); padding: 10px 16px;
  border: 0; border-radius: 14px; background: var(--card); box-shadow: var(--inset); outline: none;
}
input[type="search"] { border-radius: 999px; }
textarea { min-height: 180px; resize: vertical; border-radius: var(--radius); padding: 14px 16px; line-height: 1.7; }
input:focus-visible, select:focus-visible, textarea:focus-visible { box-shadow: var(--inset), 0 0 0 2px var(--accent-soft); }

/* Form fields: small blue label, underline (the edit screens) */
label.field { display: block; margin: 12px 0; }
label.field > span { display: block; font-size: 12px; color: var(--accent); margin-bottom: 0; }
label.field input, label.field select {
  background: transparent; box-shadow: none; border-radius: 0; padding: 6px 0;
  border-bottom: 1.5px solid var(--underline); min-height: 42px; font-size: 17px;
}
label.field input:focus { border-bottom-color: var(--accent); box-shadow: none; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.segmented { display: flex; gap: 4px; padding: 4px; border-radius: 16px; background: var(--card); box-shadow: var(--inset); }
.seg { flex: 1; min-height: 42px; border: 0; background: transparent; cursor: pointer; padding: 4px 6px; border-radius: 12px; color: var(--muted); }
.seg.on { background: var(--bg); color: var(--accent-ink); font-weight: 700; box-shadow: var(--raise-sm); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  min-height: 38px; padding: 4px 14px; border-radius: 10px;
  border: 1.5px solid var(--accent); background: transparent; color: var(--accent-ink); cursor: pointer; font-size: 14px;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.chip.ghost { border-color: transparent; background: var(--ghost); color: var(--muted); border-radius: 999px; }

.section-title { font-size: 14px; color: var(--ink); margin: 22px 0 8px; font-weight: 700; }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--raise); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* big tappable tiles (top of 読み取る) */
.tile {
  width: 100%; border: 0; border-radius: 20px; background: var(--card); box-shadow: var(--raise);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 200px; padding: 20px; cursor: pointer; color: var(--ink); font-size: 17px;
}
.tile:active { box-shadow: var(--inset); }
.tile .icon { width: 84px; height: 84px; }
.tile .icon svg { stroke-width: 1.3; }
.tile.small { min-height: 110px; margin-top: 18px; }
.tile.small .icon { width: 34px; height: 34px; }
.tile .sub { font-size: 12px; color: var(--muted); margin-top: -4px; }

/* toasts and sheets */
.toasts { position: fixed; left: 16px; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 30; display: grid; gap: 8px; }
.toast {
  background: var(--toast); color: #fff; border-radius: 14px; padding: 12px 16px;
  display: flex; align-items: center; gap: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.2);
}
.toast span { flex: 1; }
.toast-action { background: transparent; border: 1px solid #fff; color: #fff; border-radius: 10px; min-height: 40px; padding: 0 12px; }
.sheet-backdrop { position: fixed; inset: 0; background: rgba(40, 52, 62, .45); z-index: 20; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 94vh;
  background: var(--bg); border-radius: 28px 28px 0 0; display: flex; flex-direction: column;
  max-width: 720px; margin: 0 auto; box-shadow: 0 -8px 24px rgba(0,0,0,.12);
}
.sheet-head { display: grid; grid-template-columns: 72px 1fr 72px; align-items: center; padding: 14px 14px 4px; }
.sheet-head h2 { font-size: 17px; margin: 0; text-align: center; }
.sheet-body { overflow: auto; padding: 8px 20px calc(28px + env(safe-area-inset-bottom)); }
.confirm p { white-space: pre-wrap; }

/* shelf */
.search-row { display: flex; gap: 8px; align-items: center; position: relative; }
.search-row input { flex: 1; }
.search-row.with-icon input { padding-left: 46px; }
.search-row.with-icon > .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 14px 2px 8px; scrollbar-width: none; }
.filters .chip { flex: 0 0 auto; }
.toolbar { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin: 4px 0 10px; }
.toolbar .chip { border-color: transparent; background: var(--card); box-shadow: var(--raise-sm); border-radius: 999px; min-height: 34px; font-size: 13px; }
.count { font-size: 13px; color: var(--muted); }
.banner {
  display: flex; gap: 8px; align-items: center; justify-content: space-between;
  background: var(--warn-soft); color: var(--warn); border-radius: 14px;
  padding: 10px 14px; margin: 10px 0; font-size: 14px;
}
.banner .btn { min-height: 40px; padding: 4px 12px; }
.book-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.book-row {
  display: flex; gap: 14px; align-items: center; padding: 10px 12px;
  background: var(--card); border-radius: 16px; box-shadow: var(--raise-sm); cursor: pointer; min-height: 84px;
}
.book-row:active { box-shadow: var(--inset); }
.cover {
  width: 46px; height: 66px; flex: 0 0 46px; border-radius: 3px; object-fit: cover;
  background: linear-gradient(135deg, var(--cover-a), var(--cover-b)); color: var(--cover-ink); font-size: 10px; line-height: 1.25;
  display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; padding: 3px;
  box-shadow: 2px 3px 6px rgba(0,0,0,.18);
}
.cover.big { width: 116px; height: 166px; flex-basis: 116px; font-size: 14px; padding: 8px; }
.meta { flex: 1; min-width: 0; }
.meta .title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.45; }
.meta .sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badges { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.badge { font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--ghost); color: var(--ink); }
.badge.released { background: var(--danger-soft); color: var(--danger); }
.badge.not_owned { background: var(--warn-soft); color: var(--warn); }
.badge.ebook { background: var(--accent-soft); color: var(--accent-ink); }
.badge.stale { background: var(--warn-soft); color: var(--warn); }
.badge.review { background: var(--danger-soft); color: var(--danger); }
.more { text-align: center; padding: 12px; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 60px 0 20px; }
.empty .icon { width: 120px; height: 120px; color: var(--muted); }
.empty p { margin: 12px 0 0; }
.fab {
  position: fixed; right: 20px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 7;
  width: 60px; height: 60px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent);
  box-shadow: 0 8px 18px var(--accent-glow); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.fab .icon { width: 30px; height: 30px; }

/* scan */
.camera-box { position: relative; background: #000; border-radius: 20px; overflow: hidden; aspect-ratio: 4 / 3; max-height: 42vh; width: 100%; box-shadow: var(--raise); }
.camera-box video { width: 100%; height: 100%; object-fit: cover; display: block; }
.camera-box .guide {
  position: absolute; left: 12%; right: 12%; top: 38%; height: 24%;
  border: 3px solid rgba(255,255,255,.85); border-radius: 14px; pointer-events: none;
}
.scan-count { font-size: 20px; font-weight: 700; margin: 12px 0 6px; }
.scan-log { list-style: none; margin: 10px 0 0; padding: 0; }
.scan-log li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: baseline; }
.scan-log .state { font-size: 12px; padding: 0 8px; border-radius: 999px; flex: 0 0 auto; }
.state.created { background: var(--ok-soft); color: var(--ok); }
.state.duplicate { background: var(--accent-soft); color: var(--accent-ink); }
.state.missing { background: var(--danger-soft); color: var(--danger); }
.state.waiting { background: var(--ghost); color: var(--muted); }
.result-card { border-radius: 20px; padding: 20px; margin-top: 16px; text-align: center; box-shadow: var(--raise); }
.result-card .big { font-size: 30px; font-weight: 800; letter-spacing: .04em; }
.result-card .title { font-weight: 600; margin-top: 6px; }
.result-card .work { margin-top: 8px; font-size: 15px; }
.result-card.owned, .result-card.owned_ebook { background: var(--ok-soft); color: var(--ok); }
.result-card.not_owned, .result-card.unregistered { background: var(--card); color: var(--ink); }
.result-card.released { background: var(--danger-soft); color: var(--danger); }
.summary { margin-top: 12px; }
.status-line { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* detail */
.detail-head { display: flex; gap: 18px; align-items: flex-start; }
.detail-head .title { font-size: 19px; font-weight: 800; line-height: 1.45; margin-bottom: 4px; }
.kv { font-size: 14px; color: var(--muted); }
.tag-line { display: flex; gap: 12px; align-items: center; margin-top: 20px; }
.tag-line > .icon { color: var(--muted); width: 28px; height: 28px; }
.state-line { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; gap: 8px; }
.state-line .item { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; }
.state-line .item .icon { color: var(--muted); width: 28px; height: 28px; }
.state-line input[type="date"] { width: auto; min-height: 40px; padding: 4px 2px; font-weight: 800; font-size: 16px; background: transparent; box-shadow: none; }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.result-item { cursor: pointer; }
.tag-row { display: flex; gap: 6px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.tag-row .name { flex: 1; }
.tag-row .icon-btn { font-size: 18px; min-width: 40px; min-height: 40px; }
.tag-add { display: flex; gap: 8px; margin: 12px 0 4px; }
.tag-add input { flex: 1; }
.tag-add .btn { flex: 0 0 auto; }
.stat { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.stat:last-child { border-bottom: 0; }
details.card > summary { list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: '▾'; float: right; color: var(--muted); }
details.card[open] > summary::after { content: '▴'; }

.result-card { position: relative; }
.result-card .card-close { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; color: inherit; }
.theme-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.theme-pick button { border: 0; border-radius: 14px; padding: 10px 4px; background: var(--card); box-shadow: var(--raise-sm); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; }
.theme-pick button.on { box-shadow: var(--inset); font-weight: 700; color: var(--accent-ink); }
.theme-pick .swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(127,127,127,.35); }
.about-name { font-size: 18px; font-weight: 800; color: var(--accent-ink); }

/* shelf top (Yomoo-style: search + icon buttons, status buttons with counts) */
.shelf-top { display: flex; gap: 10px; align-items: center; }
.shelf-top .search-row { flex: 1; min-width: 0; }
.shelf-top .round-btn { flex: 0 0 48px; }
.status-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px 0 6px; }
.status-btn {
  min-height: 48px; border-radius: 12px; border: 1.5px solid var(--accent); background: transparent;
  color: var(--accent-ink); font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 4px 6px;
}
.status-btn .n { font-size: 13px; opacity: .8; }
.status-btn.on { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.active-filters { padding: 4px 0; }
.active-filters[hidden] { display: none; }
.pick-list { list-style: none; margin: 0; padding: 0; }
.pick-list button {
  width: 100%; min-height: 56px; border: 0; background: transparent; cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: space-between; padding: 0 6px; color: var(--ink);
}
.pick-list .icon { color: var(--accent); }
.head-action { border: 0; background: transparent; color: var(--accent-ink); font-weight: 800; font-size: 17px; min-height: 48px; cursor: pointer; justify-self: end; }
.sheet-action { display: flex; justify-content: flex-end; }

/* photo cover */
.photo-frame {
  width: 120px; height: 168px; margin: 4px auto 8px; border: 1.5px dashed var(--underline); border-radius: 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--muted); font-size: 12px; background: transparent; cursor: pointer; overflow: hidden; padding: 0;
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.photo-frame .icon { width: 32px; height: 32px; }
.cover-wrap { position: relative; flex: 0 0 auto; border: 0; padding: 0; background: transparent; cursor: pointer; }
.cover-wrap .cam { position: absolute; right: -6px; bottom: -6px; width: 34px; height: 34px; border-radius: 50%; background: var(--card); box-shadow: var(--raise-sm); display: flex; align-items: center; justify-content: center; color: var(--ink); }
.cover-wrap .cam .icon { width: 18px; height: 18px; }

/* scan: calm hint before the first read */
.scan-hint { text-align: center; color: var(--ink); padding: 26px 0 10px; }
.scan-hint .icon { width: 64px; height: 64px; color: var(--muted); }
.scan-hint p { margin: 6px 0 0; }
.scan-log li.scan-hint { display: block; border: 0; }

/* Typography (鬼さん 2026-10-25: fewer line breaks, a more refined feel).
   Headings and book titles in Mincho; body in a compact sans; Japanese lines break at phrase boundaries. */
:root {
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", "Noto Serif CJK JP", "Source Han Serif JP", serif;
  --sans: "Hiragino Sans", "Noto Sans JP", "Noto Sans CJK JP", system-ui, -apple-system, sans-serif;
  --gold: #a88b52;
}
:root[data-theme="black"] { --gold: #c9ad72; }
body { font-family: var(--sans); font-size: 15px; line-height: 1.65; letter-spacing: .02em; word-break: auto-phrase; line-break: strict; text-wrap: pretty; }
.small { font-size: 12px; }
.app-head h1 { font-family: var(--serif); font-size: 17px; letter-spacing: .2em; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.app-head h1::before { content: ''; width: 18px; height: 1px; background: var(--gold); }
.section-title { font-family: var(--serif); font-weight: 600; font-size: 14px; letter-spacing: .12em; display: flex; align-items: center; gap: 10px; }
.section-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); opacity: .45; }
.sheet-head h2 { font-family: var(--serif); font-weight: 600; letter-spacing: .14em; font-size: 16px; }
.meta .title, .detail-head .title, .result-card .title { font-family: var(--serif); font-weight: 600; letter-spacing: .03em; }
.detail-head .title { font-size: 18px; }
.meta .title { font-size: 15px; }
.result-card .big, .scan-count, .about-name { font-family: var(--serif); letter-spacing: .08em; }
.about-name { font-size: 17px; }
.tile { font-family: var(--serif); letter-spacing: .1em; font-size: 16px; }
.tile .sub { font-family: var(--sans); letter-spacing: .02em; }
/* controls stay on one line */
.seg, .chip, .status-btn, .btn, .tabbar a, .toolbar .count, .head-action { white-space: nowrap; }
.seg { font-size: 13.5px; padding: 4px 2px; }
.chip { font-size: 13px; padding: 4px 12px; }
.status-btn { font-size: 13px; }
.btn { font-size: 14.5px; padding: 8px 14px; }
.row-buttons > .btn { min-width: 0; }
label.field > span { font-size: 11.5px; letter-spacing: .06em; }
label.field input, label.field select { font-size: 16px; }
.kv, .meta .sub { font-size: 12.5px; }
.state-line .item { font-family: var(--serif); font-size: 16px; }
.state-line input[type="date"] { font-size: 15px; }
.tabbar a { font-size: 10.5px; letter-spacing: .08em; }
.toast { font-size: 14px; }

/* Long shelves (thousands of books): rows off screen are skipped by the browser until scrolled near. */
.book-row { content-visibility: auto; contain-intrinsic-size: auto 86px; }

/* photo cut-out */
.crop-stage { position: relative; width: 100%; margin: 0 auto; touch-action: none; user-select: none; border-radius: 10px; overflow: visible; }
.crop-photo { display: block; width: 100%; height: auto; border-radius: 10px; }
.crop-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.crop-lines polygon { fill: rgba(255, 255, 255, .12); stroke: var(--accent); stroke-width: .7; vector-effect: non-scaling-stroke; stroke-width: 2.5px; }
.crop-handle {
  position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  background: var(--card); border: 3px solid var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,.35); touch-action: none; cursor: grab;
}
.crop-handle::after { content: ''; position: absolute; inset: -12px; } /* bigger touch target */
.crop-handle.on { transform: scale(1.25); background: var(--accent); }

/* Close button within thumb reach (bottom right) on the long sheets */
.thumb-close { position: absolute; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); width: 58px; height: 58px; z-index: 2; box-shadow: 0 6px 16px rgba(0,0,0,.22), var(--raise-sm); }
.thumb-close .icon { width: 26px; height: 26px; }
.sheet.has-thumb .sheet-body { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
