@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&family=Noto+Serif+JP:wght@500;600;700&display=swap');

:root { --ink: #252a27; --muted: #777b75; --line: #e1ddd4; --paper: #f7f3ec; --card: #fffdf9; --green: #416a57; --green-dark: #2f5143; --orange: #b86a33; --shadow: 0 24px 70px rgba(59, 50, 37, .10); }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; color: var(--ink); background: radial-gradient(circle at 15% 0%, #fffdf9 0, transparent 30rem), var(--paper); font-family: Manrope, "Noto Sans JP", sans-serif; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
.app-shell { width: min(100% - 32px, 760px); margin: 0 auto; padding: 24px 0 56px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 44px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 13px; font-weight: 800; letter-spacing: .12em; text-decoration: none; }
.brand-mark { display: grid; width: 48px; height: 48px; place-items: center; color: #ff243f; background: #173a2e; border: 1px solid rgba(255, 255, 255, .12); border-radius: 14px; box-shadow: 0 7px 16px rgba(24, 55, 44, .20); }
.brand-mark svg { width: 44px; height: 44px; overflow: visible; }
.icon-book-outline { fill: none; stroke: #fffdf9; stroke-linejoin: round; stroke-linecap: round; stroke-width: 2.6; }
.icon-crosshair { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5; filter: drop-shadow(0 0 2px rgba(255, 36, 63, .52)); }
.icon-crosshair-ticks { stroke-width: 1.8; }
.topbar-note, .eyebrow { color: var(--muted); font-family: "DM Mono", monospace; font-size: 10px; letter-spacing: .16em; }
.hero { padding: 42px clamp(20px, 7vw, 64px) 48px; background: var(--card); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); }
.eyebrow { margin-bottom: 14px; color: var(--green); }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 580px; margin-bottom: 18px; font-family: "Noto Serif JP", serif; font-size: clamp(31px, 6vw, 52px); font-weight: 600; line-height: 1.35; letter-spacing: -.055em; }
h1 em { color: var(--green); font-style: normal; }
.hero > p { max-width: 520px; margin-bottom: 28px; color: var(--muted); font-size: 14px; line-height: 1.9; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; border: 0; border-radius: 999px; font-weight: 800; transition: transform .2s, box-shadow .2s, background .2s; }
.primary-button { width: 100%; color: #fffdf9; background: var(--green-dark); box-shadow: 0 12px 22px rgba(47, 81, 67, .18); }
.primary-button:hover, .primary-button:focus-visible { background: #213c31; transform: translateY(-2px); box-shadow: 0 15px 28px rgba(47, 81, 67, .24); }
.button-icon { font-size: 25px; font-weight: 400; line-height: 1; transform: rotate(-28deg); }
.permission-note, .source-note { color: var(--muted); font-size: 11px; line-height: 1.6; text-align: center; }
.permission-note { margin: 12px 0 34px; }
.manual-form { padding: 18px; background: #f4f0e8; border-radius: 16px; }
.manual-form label { display: block; margin-bottom: 9px; color: var(--muted); font-size: 11px; font-weight: 700; }
.manual-row { display: flex; gap: 8px; }
.manual-row input { min-width: 0; flex: 1; height: 46px; padding: 0 14px; color: var(--ink); background: #fffdf9; border: 1px solid var(--line); border-radius: 10px; outline: 0; }
.manual-row input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(65, 106, 87, .13); }
.secondary-button { min-width: 76px; padding: 0 18px; color: var(--green-dark); background: #dce8df; }
.secondary-button:hover, .secondary-button:focus-visible { background: #c8ddce; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.steps div { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.steps span { display: grid; width: 24px; height: 24px; flex: 0 0 24px; place-items: center; color: var(--green-dark); background: #e3eee5; border-radius: 50%; font-family: "DM Mono", monospace; }
.steps strong { font-weight: 700; }
.view-card, .result-card { padding: clamp(20px, 5vw, 34px); background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-family: "Noto Serif JP", serif; font-size: clamp(20px, 4vw, 27px); line-height: 1.5; }
.icon-button { width: 36px; height: 36px; flex: 0 0 36px; color: var(--muted); background: #f1ede5; border: 0; border-radius: 50%; font-size: 25px; line-height: 1; }
.scanner-frame { position: relative; overflow: hidden; min-height: 280px; background: #18201c; border-radius: 16px; }
#reader { width: 100%; min-height: 280px; }
#reader video { display: block; width: 100% !important; min-height: 280px; object-fit: cover; }
#reader__dashboard_section, #reader__dashboard_section_csr, #reader__dashboard_section_swaplink { display: none !important; }
.scan-guide { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.scan-guide span { display: block; width: 72%; height: 28%; min-height: 86px; max-height: 140px; border: 2px solid rgba(255, 255, 255, .92); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .24); }
.status-line { min-height: 36px; margin: 15px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; text-align: center; }
.camera-picker { display: flex; align-items: center; gap: 10px; margin-top: 14px; color: var(--muted); font-size: 11px; }
.camera-picker select { min-width: 0; flex: 1; height: 36px; padding: 0 8px; color: var(--ink); background: #f4f0e8; border: 1px solid var(--line); border-radius: 8px; }
.loading-card { padding: 72px 24px; text-align: center; }
.loading-card h2 { margin-bottom: 8px; font-family: "Noto Serif JP", serif; font-size: 22px; }
.loading-card p { margin: 0; color: var(--muted); font-family: "DM Mono", monospace; font-size: 11px; }
.spinner { width: 34px; height: 34px; margin: 0 auto 24px; border: 3px solid #dce8df; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.result-topline { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 22px; }
.success-badge { color: var(--green); font-size: 11px; font-weight: 800; }
.barcode-text { color: var(--muted); font-family: "DM Mono", monospace; font-size: 10px; }
.book-row { display: grid; grid-template-columns: 132px 1fr; gap: 22px; align-items: center; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.book-cover-wrap { display: grid; overflow: hidden; width: 132px; height: 184px; place-items: center; background: #ece6dc; border-radius: 4px 10px 10px 4px; box-shadow: 7px 8px 0 #e3dbcf, 0 12px 20px rgba(45, 38, 29, .12); }
#book-cover { width: 100%; height: 100%; object-fit: cover; }
.cover-placeholder { display: grid; width: 100%; height: 100%; place-items: center; color: #fffdf9; background: linear-gradient(145deg, #718d78, #324d3e); font-family: "DM Mono", monospace; font-size: 11px; letter-spacing: .12em; line-height: 1.8; text-align: center; }
.book-publisher { margin-bottom: 8px; color: var(--orange); font-family: "DM Mono", monospace; font-size: 10px; }
.book-copy h2 { margin-bottom: 12px; font-family: "Noto Serif JP", serif; font-size: clamp(21px, 4vw, 29px); line-height: 1.45; }
.book-authors, .book-published { margin-bottom: 5px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.book-published { font-family: "DM Mono", monospace; font-size: 10px; }
.review-panel { margin: 28px 0; padding: 20px; background: #f4f0e8; border-radius: 16px; }
.panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.panel-heading .eyebrow { margin-bottom: 5px; }
.panel-heading h3 { margin: 0; font-family: "Noto Serif JP", serif; font-size: 19px; }
.panel-hint { color: var(--muted); font-size: 10px; }
.review-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.review-link { display: flex; align-items: center; gap: 10px; min-height: 61px; padding: 12px; color: var(--ink); background: #fffdf9; border: 1px solid var(--line); border-radius: 11px; text-decoration: none; transition: transform .2s, border-color .2s, box-shadow .2s; }
.review-link:hover, .review-link:focus-visible { border-color: var(--green); transform: translateY(-2px); box-shadow: 0 8px 15px rgba(59, 50, 37, .08); }
.review-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--green); }
.review-link.orange .review-dot { background: var(--orange); }.review-link.yellow .review-dot { background: #e5af32; }.review-link.red .review-dot { background: #c84c46; }
.review-copy { display: grid; gap: 2px; min-width: 0; flex: 1; }.review-copy strong { font-size: 12px; }.review-copy small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }.arrow { color: var(--muted); font-size: 17px; }
.text-button { padding: 0; color: var(--green); background: transparent; border: 0; font-size: 11px; font-weight: 800; }.centered-button { display: block; margin: 17px auto 0; }.text-button:hover { text-decoration: underline; }
.source-note { margin: 24px 0 0; }
.error-card { padding: 58px 24px; text-align: center; }.error-icon { display: grid; width: 42px; height: 42px; margin: 0 auto 20px; place-items: center; color: #9b6339; background: #f1dfcf; border-radius: 50%; font-weight: 800; }.error-card h2 { margin-bottom: 12px; font-family: "Noto Serif JP", serif; font-size: 23px; }.error-card p { min-height: 44px; margin-bottom: 25px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.history-section { margin-top: 32px; }.section-heading.compact { align-items: center; margin-bottom: 13px; }.section-heading.compact h2 { font-size: 20px; }.history-list { display: grid; gap: 7px; }.history-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px 9px 9px; color: var(--ink); text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 11px; }.history-item:hover { border-color: var(--green); }.history-item img, .history-thumb { display: grid; width: 36px; height: 50px; flex: 0 0 36px; place-items: center; overflow: hidden; color: #fffdf9; background: var(--green); font-family: "DM Mono", monospace; font-size: 9px; object-fit: cover; }.history-copy { display: grid; gap: 4px; min-width: 0; flex: 1; }.history-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }.history-copy span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }.history-item > :last-child { color: var(--muted); font-size: 22px; }
[hidden] { display: none !important; }
@media (max-width: 560px) { .app-shell { width: min(100% - 20px, 760px); padding-top: 16px; }.topbar { margin-bottom: 26px; }.topbar-note { font-size: 8px; }.hero { padding: 32px 18px 28px; border-radius: 20px; }.steps { gap: 6px; }.steps div { display: grid; justify-items: start; gap: 5px; font-size: 9px; }.view-card, .result-card { padding: 19px 15px; border-radius: 19px; }.book-row { grid-template-columns: 105px 1fr; gap: 15px; }.book-cover-wrap { width: 105px; height: 150px; }.book-copy h2 { font-size: 19px; }.review-panel { padding: 14px; }.review-links { grid-template-columns: 1fr; }.panel-heading { align-items: flex-start; display: grid; gap: 4px; }.panel-hint { font-size: 9px; }.scanner-frame, #reader, #reader video { min-height: 250px; } }
