:root {
  --bg: #f6f1e8;
  --bg-deep: #ede4d5;
  --bg-soft: #fbf7f0;
  --surface: rgba(255, 250, 242, 0.84);
  --surface-strong: #f3ebde;
  --surface-dark: #17362d;
  --surface-ink: #0f241f;
  --text: #21352f;
  --text-muted: #66766d;
  --text-soft: #7a8880;
  --text-soft-strong: #59675f;
  --brand: #0f5b45;
  --brand-strong: #0c4637;
  --brand-soft: #dce9e1;
  --accent: #d4a73b;
  --accent-soft: #f0e1b6;
  --danger: #a85843;
  --success: #2f6d4c;
  --border: rgba(19, 58, 46, 0.12);
  --border-strong: rgba(19, 58, 46, 0.18);
  --shadow-soft: 0 18px 38px rgba(48, 44, 35, 0.08);
  --shadow-card: 0 22px 60px rgba(45, 39, 30, 0.11);
  --shadow-book: 0 18px 30px rgba(31, 23, 15, 0.18);
  --radius-xs: 12px;
  --radius-sm: 18px;
  --radius-md: 28px;
  --radius-lg: 38px;
  --content: 1220px;
  --topbar: 82px;
  --bottom-nav: 96px;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  overscroll-behavior-y: none;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  color: var(--text);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at top left, rgba(212, 167, 59, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(15, 91, 69, 0.08), transparent 34%),
    linear-gradient(180deg, #fcf8f2 0%, var(--bg) 48%, #f0e7d9 100%);
}

body.app-booting .app-shell,
body.app-booting #modal-root,
body.app-booting #toast-root {
  visibility: hidden;
}

.boot-splash {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  gap: 0.55rem;
  background:
    radial-gradient(circle at 50% 24%, rgba(212, 167, 59, 0.16), transparent 18%),
    radial-gradient(circle at 50% 68%, rgba(15, 91, 69, 0.09), transparent 26%),
    linear-gradient(180deg, #fbf7f0 0%, #f3ebde 100%);
  transition: opacity 220ms ease, transform 220ms ease;
}

.boot-splash-mark-wrap {
  width: 108px;
  height: 108px;
  display: grid;
  place-items: center;
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(244, 236, 224, 0.96));
  box-shadow: 0 24px 48px rgba(31, 23, 15, 0.12);
}

.boot-splash-mark {
  width: 64px;
  height: 64px;
}

.boot-splash-title {
  font-family: var(--font-display);
  font-size: 2.65rem;
  line-height: 0.94;
  color: var(--brand-strong);
}

.boot-splash-subtitle {
  color: var(--text-soft-strong);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.boot-splash-subtitle.is-pending {
  opacity: 0;
}

.boot-timeout-card {
  width: min(24rem, calc(100% - 2rem));
  margin-top: 1rem;
  padding: 1rem 1.05rem;
  border-radius: 22px;
  background: rgba(255, 251, 244, 0.9);
  box-shadow: 0 18px 34px rgba(31, 23, 15, 0.12);
  text-align: center;
}

.boot-timeout-card strong {
  display: block;
  color: var(--brand-strong);
}

.boot-timeout-card p {
  margin: 0.45rem 0 0;
  color: var(--text-muted);
}

.boot-timeout-button {
  margin-top: 0.85rem;
}

body.app-ready .boot-splash {
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
}

img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.app-shell {
  min-height: 100vh;
  padding-bottom: calc(var(--bottom-nav) + env(safe-area-inset-bottom));
  overflow-x: clip;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  width: min(var(--content), calc(100% - 1rem));
  margin: 0.8rem auto 0;
  padding: 0.85rem 1rem;
  background: rgba(251, 246, 237, 0.76);
  border: 1px solid rgba(19, 58, 46, 0.08);
  border-radius: 28px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-soft);
}

.brand-wrap { display: inline-flex; align-items: center; gap: 0.95rem; }
.brand-mark { width: 50px; height: 50px; filter: drop-shadow(0 6px 12px rgba(15, 91, 69, 0.12)); }

.brand-title {
  display: block;
  font-family: var(--font-display);
  color: var(--brand-strong);
  font-size: 2.2rem;
  line-height: 0.94;
  letter-spacing: -0.03em;
}

.brand-subtitle {
  color: var(--text-muted);
  font-size: 0.94rem;
  margin-top: 0.2rem;
}

.app-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.topbar-actions { display: inline-flex; align-items: center; gap: 0.75rem; }

.icon-button,
.language-trigger,
.action-button,
.ghost-button,
.danger-button,
.small-button,
.chip-button,
.toolbar-button {
  border: 0;
  border-radius: 999px;
  min-height: 48px;
  padding: 0 1.15rem;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.icon-button:hover,
.language-trigger:hover,
.action-button:hover,
.ghost-button:hover,
.danger-button:hover,
.small-button:hover,
.chip-button:hover,
.toolbar-button:hover {
  transform: translateY(-1px);
}

.icon-button {
  width: 46px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #174f3e, #103b30);
  color: #fff;
  box-shadow: 0 16px 28px rgba(15, 91, 69, 0.2);
}

.icon { font-size: 1.25rem; font-weight: 700; }

.language-picker { position: relative; }

.add-menu-wrap {
  position: relative;
}

.add-menu {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  min-width: 200px;
  display: grid;
  gap: 0.35rem;
  padding: 0.45rem;
  background: linear-gradient(180deg, rgba(255, 251, 244, 0.98), rgba(247, 239, 227, 0.96));
  border: 1px solid rgba(19, 58, 46, 0.08);
  border-radius: 22px;
  box-shadow: 0 22px 40px rgba(31, 23, 15, 0.16), 0 6px 14px rgba(15, 91, 69, 0.08);
  transform-origin: top right;
  animation: addMenuPop 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.add-menu[hidden] {
  display: none;
}

.add-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  background: transparent;
  border: 0;
  color: var(--text);
  text-align: left;
}

.add-menu-item:hover {
  background: rgba(15, 91, 69, 0.07);
}

.add-menu-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.language-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  width: 78px;
  min-width: 78px;
  padding-inline: 0.85rem;
  background: rgba(255, 252, 246, 0.82);
  color: var(--brand-strong);
  border: 1px solid rgba(19, 58, 46, 0.08);
  box-shadow: none;
  justify-content: center;
}

#language-label {
  display: inline-block;
  min-width: 2ch;
  text-align: center;
}

.language-trigger img { width: 18px; height: 18px; }

.language-menu {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  min-width: 220px;
  background: rgba(255, 251, 244, 0.96);
  border: 1px solid rgba(19, 58, 46, 0.1);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  padding: 0.45rem;
}

.language-option {
  width: 100%;
  text-align: left;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  background: transparent;
  border: 0;
  color: var(--text);
}

.language-option.is-current {
  background: rgba(15, 91, 69, 0.08);
  color: var(--brand-strong);
  font-weight: 700;
}

.demo-banner,
.screen,
.modal-card,
.dashboard-hero,
.metric-card,
.box-card,
.book-card,
.section-card,
.scanner-card,
.export-card,
.timeline-card,
.photo-card,
.gallery-card,
.empty-card,
.banner-card,
.label-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.demo-banner {
  margin: 0.8rem auto 0;
  width: min(var(--content), calc(100% - 1rem));
  padding: 0.7rem 1rem;
}

.banner-copy-compact strong {
  display: block;
  margin: 0;
  color: var(--text-soft-strong);
  font-size: 0.95rem;
  font-weight: 600;
}

.app-main {
  width: min(var(--content), calc(100% - 1rem));
  margin: 1rem auto 2.25rem;
}

#app-root {
  position: relative;
}

#app-root.route-enter > .screen {
  animation: routeFadeSlide 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

#app-root.route-enter > .scanner-page {
  animation: none;
}

.screen { padding: 1.15rem; }
.screen-stack { display: grid; gap: 1.15rem; }

.dashboard-screen {
  overflow-x: clip;
}

.dashboard-hero {
  --hero-headline: #f4ead7;
  --hero-body: #d7c8b2;
  --hero-accent: #c89b3c;
  --hero-overlay: #071814;
  --hero-button-text: #102d24;
  --hero-secondary-text: #f4ead7;
  --hero-overlay-opacity: 0.64;
  --hero-vignette: 0.2;
  --hero-grain: 0.05;
  --hero-shadow: 0.32;
  --hero-highlight: 0.26;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.95fr);
  gap: 1.6rem;
  padding: 1.8rem;
  position: relative;
  isolation: isolate;
  background: linear-gradient(145deg, rgba(18, 72, 56, 0.98), rgba(12, 42, 34, 0.94));
  color: var(--hero-headline);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  min-height: 412px;
  align-items: stretch;
}

.dashboard-hero-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.dashboard-hero-media {
  position: absolute;
  inset: 0;
  background-color: #15392f;
  background-position: center right;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0;
  transform: scale(1.035);
  pointer-events: none;
  transition: opacity 900ms ease, transform 900ms ease;
  filter: saturate(0.76) contrast(1.08) brightness(0.76);
}

.dashboard-hero-media.is-current {
  opacity: 1;
  transform: scale(1);
}

.dashboard-hero.is-hero-transitioning .dashboard-hero-media.is-next {
  opacity: 1;
  transform: scale(1);
}

.dashboard-hero-wash,
.dashboard-hero-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.dashboard-hero-wash {
  z-index: 1;
  opacity: 1;
  transition: opacity 900ms ease;
}

.dashboard-hero-wash.is-next {
  opacity: 0;
}

.dashboard-hero.is-hero-transitioning .dashboard-hero-wash.is-next {
  opacity: 1;
}

.dashboard-hero-grain {
  z-index: 2;
  opacity: calc(var(--hero-grain) * 0.88);
  background-image:
    radial-gradient(circle at 20% 22%, rgba(255, 255, 255, 0.18) 0 0.7px, transparent 0.8px),
    radial-gradient(circle at 74% 66%, rgba(255, 255, 255, 0.12) 0 0.8px, transparent 0.95px),
    radial-gradient(circle at 52% 44%, rgba(0, 0, 0, 0.22) 0 0.75px, transparent 0.9px);
  background-size: 18px 18px, 21px 21px, 24px 24px;
  mix-blend-mode: soft-light;
}

.dashboard-hero-copy,
.dashboard-hero .hero-art {
  position: relative;
  z-index: 3;
}

.dashboard-hero h1,
.section-heading,
.screen-title,
.modal-title,
.hero-title,
.box-card h3,
.book-card h3 {
  font-family: var(--font-display);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.dashboard-hero h1 {
  margin: 0;
  color: var(--hero-headline);
  font-size: clamp(2.8rem, 4.7vw, 4.5rem);
  max-width: min(15ch, 100%);
  text-wrap: balance;
  overflow-wrap: normal;
  hyphens: none;
  font-weight: 700;
  text-shadow: 0 22px 40px rgba(0, 0, 0, 0.28);
}

.dashboard-hero-copy {
  min-width: 0;
  display: grid;
  align-content: center;
  padding: 0.15rem 0;
}

.hero-copy-layer {
  display: grid;
  align-content: start;
  gap: 0.8rem;
  transition: opacity 900ms ease, transform 900ms ease;
}

.hero-copy-layer.is-next {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(16px);
}

.dashboard-hero.is-hero-transitioning .hero-copy-layer.is-current {
  opacity: 0;
  transform: translateY(-12px);
}

.dashboard-hero.is-hero-transitioning .hero-copy-layer.is-next {
  opacity: 1;
  transform: translateY(0);
}

.dashboard-hero-copy p {
  max-width: 50ch;
  text-wrap: pretty;
  overflow-wrap: normal;
  hyphens: none;
  margin: 0;
  color: var(--hero-body);
  font-size: 1rem;
  line-height: 1.48;
  text-shadow: 0 16px 30px rgba(0, 0, 0, 0.22);
}

.hero-eyebrow {
  margin-bottom: 0.15rem;
  color: var(--hero-accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.dashboard-hero .hero-art {
  display: grid;
  align-items: center;
  justify-items: end;
  min-height: 100%;
}

.dashboard-hero .hero-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.dashboard-hero .hero-action {
  min-width: 140px;
}

.dashboard-hero .hero-action-primary {
  background: color-mix(in srgb, var(--hero-accent) 24%, #fff 76%);
  color: var(--hero-button-text);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 18px 34px rgba(12, 28, 24, 0.2);
}

.dashboard-hero .hero-action-secondary {
  background: rgba(255, 248, 240, 0.08);
  color: var(--hero-secondary-text);
  border-color: rgba(255, 248, 240, 0.22);
  backdrop-filter: blur(8px);
}

.hero-art-layer {
  width: 100%;
  transition: opacity 900ms ease, transform 900ms ease;
}

.hero-art-layer.is-next {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(18px);
}

.dashboard-hero.is-hero-transitioning .hero-art-layer.is-current {
  opacity: 0;
  transform: translateY(-12px);
}

.dashboard-hero.is-hero-transitioning .hero-art-layer.is-next {
  opacity: 1;
  transform: translateY(0);
}

.hero-collage {
  position: relative;
  width: min(100%, 450px);
  min-height: 338px;
}

.hero-collage-panel,
.hero-collage-cover,
.hero-collage-stamp {
  position: absolute;
}

.hero-collage-panel {
  overflow: hidden;
  border: 1px solid rgba(255, 247, 236, 0.28);
  box-shadow: 0 30px 54px rgba(8, 12, 10, calc(0.22 + var(--hero-shadow) * 0.42));
}

.hero-collage-photo-frame {
  inset: 1rem 0.6rem 1rem 4.8rem;
  border-radius: 30px 30px 20px 20px;
  background: rgba(255, 250, 244, 0.08);
}

.hero-collage-photo {
  position: absolute;
  inset: 0;
  background-color: rgba(7, 24, 20, 0.24);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  filter: saturate(0.74) contrast(1.08) brightness(0.82);
}

.hero-collage-photo-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, calc(0.05 + var(--hero-highlight) * 0.2)), rgba(255, 255, 255, 0) 24%),
    linear-gradient(90deg, rgba(4, 10, 8, 0.18), rgba(4, 10, 8, 0) 24%),
    radial-gradient(circle at 100% 18%, rgba(0, 0, 0, 0.24), rgba(0, 0, 0, 0) 36%);
}

.hero-collage-checkout-card {
  top: -0.35rem;
  right: 0.4rem;
  width: 34%;
  display: grid;
  gap: 0.38rem;
  padding: 0.9rem 0.9rem 0.82rem;
  background: color-mix(in srgb, var(--hero-overlay) 18%, #f3ead9 82%);
  color: #20372e;
  border-radius: 10px 18px 12px 10px;
  transform: rotate(2.8deg);
}

.hero-collage-kicker {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--hero-accent) 68%, #5c5038 32%);
}

.hero-collage-checkout-card strong,
.hero-collage-map-fragment strong,
.hero-collage-botanical strong,
.hero-collage-cover-caption,
.hero-collage-stamp {
  font-family: var(--font-display);
}

.hero-collage-checkout-card strong {
  font-size: 1.04rem;
  line-height: 1.02;
}

.hero-collage-checkout-card span:last-child {
  font-size: 0.72rem;
  line-height: 1.35;
  color: rgba(32, 55, 46, 0.82);
}

.hero-collage-map-fragment {
  left: 0;
  bottom: 1.55rem;
  width: 31%;
  min-height: 112px;
  padding: 0.88rem 0.82rem 0.78rem;
  background: linear-gradient(180deg, rgba(241, 231, 210, 0.94), rgba(226, 211, 182, 0.84));
  border-radius: 14px 12px 24px 12px;
  transform: rotate(-4.5deg);
}

.hero-collage-map-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(115deg, rgba(72, 88, 74, 0.2) 0 1px, transparent 1px),
    linear-gradient(12deg, rgba(72, 88, 74, 0.12) 0 1px, transparent 1px);
  background-size: 42px 42px, 26px 26px;
  mix-blend-mode: multiply;
}

.hero-collage-map-fragment strong {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 8ch;
  color: #31463b;
  font-size: 0.92rem;
  line-height: 1.02;
}

.hero-collage-botanical {
  right: 2rem;
  bottom: 0.15rem;
  width: 25%;
  min-height: 126px;
  padding: 0.9rem 0.8rem 0.72rem;
  background: linear-gradient(180deg, rgba(231, 225, 206, 0.95), rgba(212, 220, 197, 0.86));
  border-radius: 18px 12px 16px 24px;
  transform: rotate(-3.5deg);
}

.hero-collage-botanical-mark {
  position: absolute;
  inset: 0;
}

.hero-collage-botanical-mark::before,
.hero-collage-botanical-mark::after {
  content: "";
  position: absolute;
  background: linear-gradient(180deg, rgba(87, 114, 79, 0.82), rgba(117, 143, 103, 0.5));
  border-radius: 999px;
}

.hero-collage-botanical-mark::before {
  width: 2px;
  height: 78px;
  left: 28%;
  top: 26px;
  transform: rotate(8deg);
}

.hero-collage-botanical-mark::after {
  width: 42px;
  height: 20px;
  left: calc(28% - 4px);
  top: 44px;
  border-radius: 100% 12% 100% 12%;
  transform: rotate(-24deg);
  box-shadow: 18px 26px 0 -8px rgba(92, 120, 84, 0.72);
}

.hero-collage-botanical strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 4.85rem;
  color: #3a5141;
  font-size: 0.88rem;
  line-height: 1.04;
}

.hero-collage-stamp {
  left: 3.2rem;
  top: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  min-height: 80px;
  padding: 0.45rem;
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, var(--hero-accent) 84%, #8a6428 16%);
  color: color-mix(in srgb, var(--hero-accent) 78%, #77541d 22%);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: rotate(-10deg);
  background: rgba(255, 245, 226, 0.08);
  box-shadow: 0 14px 30px rgba(8, 12, 10, 0.22);
}

.hero-collage-cover {
  width: 94px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 247, 236, 0.28);
  box-shadow: 0 26px 38px rgba(10, 12, 10, 0.28);
  background: rgba(255, 255, 255, 0.14);
}

.hero-collage-cover .cover-thumb,
.hero-collage-cover img,
.hero-collage-cover .cover-placeholder {
  width: 100%;
  aspect-ratio: 0.72;
  border-radius: 0;
  box-shadow: none;
  border: 0;
}

.hero-collage-cover-1 {
  right: 6rem;
  top: 4.6rem;
  transform: rotate(-4.5deg);
}

.hero-collage-cover-2 {
  right: -0.2rem;
  top: 7.4rem;
  transform: rotate(5.5deg);
}

.hero-collage-cover-caption {
  display: block;
  padding: 0.4rem 0.5rem 0.52rem;
  background: rgba(11, 24, 20, 0.76);
  color: #f2e8d6;
  font-size: 0.7rem;
  line-height: 1.1;
}

.quick-actions,
.metrics-grid,
.box-grid,
.books-grid,
.export-grid,
.filters-row,
.toolbar,
.detail-grid,
.form-grid,
.settings-grid,
.gallery-grid,
.photo-slots,
.recent-grid {
  display: grid;
  gap: 1rem;
}

.quick-actions {
  grid-template-columns: repeat(2, minmax(0, max-content));
  align-items: start;
  margin-top: 1.3rem;
}

.quick-actions-visual {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-actions-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.box-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.books-grid { grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); }
.recent-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.photo-slots { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.metric-card,
.box-card,
.book-card,
.section-card,
.scanner-card,
.export-card,
.timeline-card,
.photo-card,
.gallery-card,
.empty-card,
.banner-card,
.label-card {
  padding: 1.15rem;
}

.metric-card {
  display: grid;
  gap: 0.35rem;
  justify-items: start;
  align-content: start;
  min-height: 118px;
  padding: 1rem;
  background: rgba(249, 239, 222, 0.12);
  border-color: rgba(255, 248, 240, 0.12);
  box-shadow: none;
}

.dashboard-summary-strip {
  padding: 0.55rem 0.8rem;
}

.dashboard-metrics-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
}

.dashboard-summary-strip .metric-card {
  justify-items: center;
  text-align: center;
  min-height: 132px;
  background: transparent;
  border-right: 1px solid rgba(19, 58, 46, 0.08);
  border-radius: 0;
}

.dashboard-summary-strip .metric-card:last-child {
  border-right: 0;
}

.dashboard-summary-strip .metric-label {
  color: var(--text);
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.92rem;
}

.dashboard-summary-strip .metric-value {
  color: #111;
  font-size: clamp(2rem, 4vw, 2.9rem);
}

.dashboard-summary-strip .metric-icon {
  background: rgba(15, 91, 69, 0.08);
}

.dashboard-summary-strip .metric-icon .app-icon {
  filter: none;
}

.metric-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(255, 248, 240, 0.14);
}

.metric-icon .app-icon {
  width: 24px;
  height: 24px;
  filter: brightness(0) saturate(100%) invert(94%) sepia(18%) saturate(291%) hue-rotate(330deg) brightness(104%) contrast(96%);
}

.metric-label {
  color: rgba(255, 243, 224, 0.82);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-value {
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
}

.collection-section {
  background: linear-gradient(180deg, rgba(255, 250, 242, 0.82), rgba(241, 233, 221, 0.88));
}

.action-button,
.ghost-button,
.danger-button,
.small-button,
.chip-button,
.toolbar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-weight: 700;
}

.icon-action-button .button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.icon-action-button .button-icon .app-icon {
  width: 20px;
  height: 20px;
}

.action-button {
  width: auto;
  min-width: 148px;
  background: linear-gradient(180deg, #166349, #104735);
  color: #fff;
  box-shadow: 0 16px 28px rgba(15, 91, 69, 0.22);
}

.ghost-button,
.chip-button,
.toolbar-button,
.small-button {
  background: rgba(255, 251, 244, 0.82);
  color: var(--brand-strong);
  border: 1px solid rgba(19, 58, 46, 0.14);
  box-shadow: none;
}

.hero-action {
  background: rgba(255, 248, 240, 0.14);
  color: #fff;
  border-color: rgba(255, 248, 240, 0.28);
}

.visual-action {
  min-height: 118px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem;
  border-radius: 28px;
}

.dashboard-action-card {
  min-height: 168px;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-align: center;
  background: rgba(255, 251, 244, 0.92);
  color: var(--text);
}

.dashboard-action-card .visual-action-icon {
  width: 82px;
  height: 82px;
  border-radius: 999px;
  background: #eef2df;
}

.dashboard-action-card .visual-action-icon .app-icon {
  width: 38px;
  height: 38px;
  filter: none;
}

.dashboard-action-card .visual-action-label {
  font-size: 1rem;
  font-weight: 800;
}

.dashboard-action-card.export-accent,
.dashboard-action-icon.export-accent {
  background: #f6edd0;
}

.visual-action-primary {
  align-items: flex-start;
}

.visual-action-icon {
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: rgba(255, 248, 240, 0.12);
}

.visual-action-icon .app-icon {
  width: 30px;
  height: 30px;
}

.visual-action-label {
  font-size: 1rem;
  line-height: 1.15;
}

.collection-hero-action {
  max-width: 240px;
}

.danger-button {
  background: #fff1ed;
  color: var(--danger);
  border: 1px solid rgba(168, 88, 67, 0.18);
  box-shadow: none;
}

.small-button {
  min-height: 40px;
  padding-inline: 0.95rem;
}

.chip-button.is-active {
  background: var(--brand-soft);
  color: var(--brand-strong);
  border-color: rgba(15, 91, 69, 0.16);
}

.box-detail-breadcrumb {
  margin-bottom: -0.2rem;
}

.box-detail-tags .meta-pill {
  background: rgba(255, 255, 255, 0.92);
  color: #1f2a26;
  border-color: rgba(21, 32, 28, 0.18);
}

.box-detail-hero-side {
  display: grid;
  align-content: start;
  gap: 0.9rem;
}

.box-detail-primary-actions {
  justify-content: flex-start;
}

.box-detail-toolbar {
  align-items: stretch;
}

.box-detail-art {
  justify-items: start;
}

.box-action-square {
  border-radius: 18px;
}

.box-action-round {
  border-radius: 999px;
}

.box-action-primary {
  background: #1e2422;
  color: #fff;
  border-color: rgba(0, 0, 0, 0.28);
  box-shadow: 0 12px 24px rgba(26, 26, 26, 0.18);
}

.box-action-primary .app-icon {
  filter: brightness(0) saturate(100%) invert(100%);
}

.box-action-secondary {
  background: rgba(255, 255, 255, 0.96);
  color: #1f2a26;
  border: 1px solid rgba(21, 32, 28, 0.18);
}

.box-action-neutral {
  background: rgba(246, 242, 233, 0.96);
  color: #1f2a26;
  border: 1px solid rgba(21, 32, 28, 0.14);
}

.box-action-danger {
  background: #fff6f3;
  color: #7f2f20;
  border: 1px solid rgba(127, 47, 32, 0.22);
}

.box-filter-chip {
  min-height: 38px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: #1f2a26;
  border: 1px solid rgba(21, 32, 28, 0.16);
}

.box-filter-chip.is-active {
  background: #1f2a26;
  color: #fff;
  border-color: rgba(0, 0, 0, 0.24);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.screen-header,
.section-header,
.detail-header,
.form-header,
.toolbar,
.subsection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.screen-title {
  margin: 0;
  color: var(--brand-strong);
  font-size: clamp(2.25rem, 4vw, 3.35rem);
}

.section-heading {
  margin: 0;
  color: var(--brand-strong);
  font-size: 1.95rem;
}

.supporting-text,
.muted,
.hint,
.meta-text { color: var(--text-soft-strong); line-height: 1.65; }

.box-meta,
.book-meta,
.inline-list,
.meta-pills,
.label-meta,
.scanner-help,
.export-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.box-meta-soft .meta-pill {
  background: rgba(255, 248, 240, 0.12);
  color: #fff;
  border-color: rgba(255, 248, 240, 0.12);
}

.pill,
.meta-pill,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 0.78rem;
  border-radius: 999px;
  background: rgba(15, 91, 69, 0.08);
  color: var(--brand-strong);
  border: 1px solid rgba(15, 91, 69, 0.08);
  font-size: 0.84rem;
  font-weight: 700;
}

.badge-ready { background: rgba(49, 116, 76, 0.12); color: var(--success); }
.badge-exported { background: rgba(212, 167, 59, 0.18); color: #7e5b09; }
.badge-missing { background: rgba(168, 88, 67, 0.12); color: var(--danger); }

.cover-thumb,
.photo-thumb {
  aspect-ratio: 0.72;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, #fffaf1, #eadcc0);
  border: 1px solid rgba(15, 91, 69, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-book);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.cover-thumb:hover,
.book-card:hover .cover-thumb,
.box-card:hover .collection-collage,
.collection-collage-link:hover .collection-collage {
  transform: translateY(-3px);
  box-shadow: 0 24px 42px rgba(31, 23, 15, 0.22);
}

.cover-thumb img,
.photo-thumb img,
.collection-collage-item img { width: 100%; height: 100%; object-fit: cover; }

.cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.05rem;
  background: linear-gradient(155deg, #184836, #102d26);
  color: #fff;
}

.cover-placeholder strong { font-family: var(--font-display); font-size: 1.1rem; }
.cover-placeholder span { color: rgba(255,255,255,0.76); font-size: 0.88rem; margin-top: 0.35rem; }

.book-card,
.box-card {
  background: linear-gradient(180deg, rgba(255, 250, 242, 0.9), rgba(247, 239, 227, 0.88));
}

.recent-section-card {
  padding-bottom: 0.7rem;
}

.recent-grid-covers {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding-bottom: 0.2rem;
}

.recent-grid-covers .book-card {
  min-width: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.recent-grid-covers .book-card-body {
  gap: 0.65rem;
}

.recent-grid-covers .cover-thumb {
  border-radius: 18px;
}

.recent-grid-covers .book-card-copy {
  padding: 0 0.15rem;
}

.recent-grid-covers .book-card h3 {
  font-size: 1rem;
  line-height: 1.08;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recent-grid-covers .book-card-author,
.recent-grid-covers .meta-pills,
.recent-grid-covers .book-card-footer {
  display: none;
}

.recent-view-all {
  gap: 0.35rem;
}

.dashboard-collections-section {
  background: linear-gradient(180deg, rgba(255, 250, 242, 0.74), rgba(241, 233, 221, 0.84));
}

.mobile-sheet-screen {
  border-radius: 32px 32px 0 0;
  background: rgba(255, 250, 242, 0.94);
  box-shadow: 0 -18px 42px rgba(35, 28, 20, 0.08);
  animation: sheetRise 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.mobile-sheet-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.85rem;
}

.mobile-sheet-copy {
  min-width: 0;
}

.mobile-sheet-close,
.compact-toolbar-button {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(15, 91, 69, 0.08);
  color: var(--brand-strong);
  border: 1px solid rgba(19, 58, 46, 0.08);
  font-weight: 700;
}

.mobile-sheet-breadcrumb,
.mobile-sheet-nav-spacer {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.mobile-sheet-breadcrumb {
  color: var(--brand-strong);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.mobile-sheet-actions {
  display: flex;
  justify-content: flex-end;
}

.book-detail-pills {
  margin-top: -0.25rem;
}

.book-sheet-screen .form-grid,
.settings-sheet-screen .settings-grid,
.export-sheet-screen .export-grid {
  gap: 0.9rem;
}

.export-summary-card .metrics-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.book-card .book-card-body,
.box-card .box-card-body,
.photo-card-body,
.gallery-card-body {
  display: grid;
  gap: 0.95rem;
}

.box-card .box-card-body {
  min-height: 232px;
  align-content: start;
}

.book-card h3,
.box-card h3 {
  margin: 0;
  font-size: 1.4rem;
  color: var(--brand-strong);
}

.book-card-copy { display: grid; gap: 0.7rem; }

.book-card-author {
  min-height: 2.5em;
}

.book-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.book-card-link {
  color: var(--brand);
  font-weight: 700;
  font-size: 1.15rem;
}

.book-card-meta-item {
  color: var(--text-soft-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.review-pill-wanted {
  background: rgba(47, 109, 76, 0.12);
  color: var(--success);
}

.review-pill-maybe {
  background: rgba(212, 167, 59, 0.14);
  color: #9b6c00;
}

.review-pill-notwanted {
  background: rgba(168, 88, 67, 0.12);
  color: var(--danger);
}

.review-section-card {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.book-detail-info-stack {
  gap: 0.9rem;
}

.book-detail-intro {
  display: grid;
  gap: 0.35rem;
}

.book-detail-intro .muted {
  margin: 0;
}

.book-detail-meta-list {
  display: grid;
  gap: 0.8rem;
}

.book-detail-gallery-compact .gallery-card-body {
  gap: 0;
}

.book-detail-gallery-compact .cover-thumb {
  margin: 0 auto;
}

.box-card-topline,
.box-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.box-card-heading {
  align-items: flex-start;
  flex-direction: column;
}

.box-card-heading h3 {
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.box-card-heading .muted {
  width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.box-card-mark {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(15, 91, 69, 0.08);
  color: var(--brand-strong);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.box-card-mark .app-icon {
  width: 24px;
  height: 24px;
}

.card-actions-icons {
  justify-content: flex-end;
}

.box-card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.box-card-action-link {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding-inline: 0.7rem;
  font-size: 0.82rem;
}

.box-card-actions .small-button {
  background: rgba(255, 251, 244, 0.96);
  border-color: rgba(19, 58, 46, 0.18);
}

.box-card-actions .small-button:hover {
  background: rgba(233, 243, 238, 0.98);
}

.box-card-actions .box-card-action-link:nth-child(2) {
  background: rgba(220, 233, 225, 0.9);
  color: var(--brand-strong);
  border-color: rgba(15, 91, 69, 0.2);
}

.box-card-actions .box-card-action-link:nth-child(3) {
  background: rgba(255, 248, 240, 0.96);
}

.box-card-action-delete {
  border-color: rgba(168, 88, 67, 0.22);
}

.icon-only-button {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 16px;
}

.icon-only-button .app-icon {
  width: 18px;
  height: 18px;
}

.collection-collage-link { display: block; }

.collection-collage {
  position: relative;
  min-height: 180px;
  margin-bottom: 1rem;
}

.collection-collage-stack {
  display: block;
}

.collection-collage-shadow {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(246, 239, 227, 0.96), rgba(233, 223, 207, 0.98));
  border: 1px solid rgba(15, 91, 69, 0.06);
  box-shadow: 0 14px 24px rgba(31, 23, 15, 0.1);
}

.collection-collage-shadow-back {
  transform: translate(12px, -6px) rotate(4deg);
}

.collection-collage-shadow-mid {
  transform: translate(6px, -3px) rotate(2deg);
}

.collection-collage-item {
  position: relative;
  z-index: 2;
  aspect-ratio: 0.9;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-book);
  background: #e9dfcf;
}

.collection-collage-item-lead {
  width: calc(100% - 12px);
}

.collection-collage.is-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 164px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(232, 224, 209, 0.8), rgba(244, 237, 225, 0.88));
  box-shadow: inset 0 0 0 1px rgba(15, 91, 69, 0.06);
}

.collection-collage-empty-cta {
  color: var(--brand-strong);
  text-align: center;
}

.collection-collage-empty-cta strong {
  font-size: 0.92rem;
  letter-spacing: 0.04em;
}

.empty-box-actions {
  display: grid;
  gap: 0.55rem;
  width: min(100%, 220px);
  margin-top: 0.1rem;
}

.scanner-mini-button-label {
  width: auto;
  min-width: 120px;
  padding-inline: 0.8rem;
  font-size: 0.78rem;
}

.collection-collage-empty {
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.collection-collage-empty .app-icon {
  width: 30px;
  height: 30px;
  opacity: 0.55;
}

.empty-card p,
.section-card p,
.box-card p,
.book-card p,
.export-card p,
.banner-card p,
.label-card p {
  color: var(--text-soft-strong);
}

.toolbar { padding: 0.35rem 0 0.1rem; }
.filters-row { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.detail-grid { grid-template-columns: 1.15fr 0.85fr; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery-grid { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }

.book-detail-info {
  grid-column: 2;
}

.book-detail-gallery {
  grid-column: 1;
  grid-row: 1;
}

.field { display: grid; gap: 0.38rem; }

.field label {
  font-weight: 700;
  color: var(--brand-strong);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 50px;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(19, 58, 46, 0.12);
  background: rgba(255, 252, 246, 0.88);
  color: var(--text);
}

.field textarea { min-height: 132px; resize: vertical; }
.field.is-wide { grid-column: 1 / -1; }

.photo-slot-actions,
.inline-actions,
.export-actions,
.card-actions,
.modal-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.scanner-shell { display: grid; gap: 1rem; }

.scanner-page {
  background: linear-gradient(180deg, rgba(18, 28, 24, 0.98), rgba(13, 20, 18, 0.98));
  border-color: rgba(255, 248, 240, 0.06);
  box-shadow: 0 28px 60px rgba(17, 15, 10, 0.24);
  animation: scannerEnter 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.scanner-page .screen-title,
.scanner-page .supporting-text,
.scanner-page .hint,
.scanner-page .section-heading,
.scanner-page .field label {
  color: #fff;
}

.scanner-page .supporting-text,
.scanner-page .hint {
  color: rgba(255, 248, 240, 0.78);
}

.scanner-page-topbar,
.scanner-header-copy,
.scanner-top-actions,
.scanner-bottom-overlay {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
}

.scanner-page-topbar {
  align-items: center;
  flex-wrap: nowrap;
}

.scanner-top-actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 0.45rem;
  min-width: 0;
}

.scanner-header-copy {
  display: grid;
  gap: 0.35rem;
}

.scanner-top-button {
  background: rgba(255, 248, 240, 0.1);
  color: #fff;
  border-color: rgba(255, 248, 240, 0.16);
}

.scanner-top-button.is-active {
  background: rgba(212, 167, 59, 0.22);
  border-color: rgba(212, 167, 59, 0.44);
}

.scanner-top-button:disabled {
  opacity: 0.48;
  cursor: wait;
}

.scanner-top-button-text {
  min-width: 0;
  max-width: 88px;
  min-height: 44px;
  padding: 0.68rem 0.72rem;
  border-radius: 15px;
  font-size: 0.74rem;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scanner-card {
  overflow: hidden;
  background: linear-gradient(180deg, rgba(11, 20, 18, 0.96), rgba(19, 30, 27, 0.96));
  border-color: rgba(255, 248, 240, 0.08);
  box-shadow: 0 28px 60px rgba(17, 15, 10, 0.28);
  padding: 0.9rem;
}

.scanner-frame {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
}

.scanner-status-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.75rem;
  padding: 0.8rem 0.95rem;
  border-radius: 20px;
  background: rgba(255, 248, 240, 0.08);
  border: 1px solid rgba(255, 248, 240, 0.1);
  color: #fff;
}

.scanner-status-warning {
  border-color: rgba(212, 167, 59, 0.38);
  background: rgba(212, 167, 59, 0.12);
}

.scanner-status-error {
  border-color: rgba(214, 114, 89, 0.38);
  background: rgba(214, 114, 89, 0.12);
}

.scanner-status-card strong {
  display: block;
  margin-bottom: 0.2rem;
}

.scanner-status-card p {
  margin: 0;
  color: rgba(255, 248, 240, 0.78);
}

.scanner-status-list {
  margin: 0.45rem 0 0;
  padding-left: 1rem;
  color: rgba(255, 248, 240, 0.82);
}

.scanner-status-list li + li {
  margin-top: 0.2rem;
}

.scanner-debug-section {
  margin-bottom: 0.5rem;
  background: rgba(255, 248, 240, 0.05);
  border: 1px solid rgba(255, 248, 240, 0.08);
  border-radius: 14px;
  color: #fff;
  overflow: hidden;
}

.scanner-debug-toggle {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: none;
  border: none;
  color: rgba(255, 248, 240, 0.78);
  font-size: 0.72rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.scanner-debug-toggle:hover {
  color: #fff;
  background: rgba(255, 248, 240, 0.04);
}

.scanner-debug-body {
  padding: 0.1rem 0.75rem 0.5rem;
}

.scanner-debug-row {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.15rem 0;
  font-size: 0.72rem;
  color: rgba(255, 248, 240, 0.72);
}

.scanner-debug-row-stack {
  display: grid;
  gap: 0.25rem;
}

.scanner-debug-row strong {
  color: rgba(255, 248, 240, 0.92);
  text-align: right;
  word-break: break-word;
  font-weight: 500;
}

.scanner-debug-pre {
  margin: 0;
  max-height: 10.5rem;
  overflow: auto;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  background: rgba(7, 24, 20, 0.48);
  color: rgba(255, 248, 240, 0.88);
  font-size: 0.68rem;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

.scanner-debug-select-wrap {
  display: grid;
  gap: 0.3rem;
  margin-top: 0.45rem;
  color: rgba(255, 248, 240, 0.72);
  font-size: 0.72rem;
}

.scanner-debug-select {
  width: 100%;
  min-height: 2.35rem;
  padding: 0.4rem 0.65rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 248, 240, 0.14);
  background: rgba(255, 248, 240, 0.08);
  color: #fff;
}

.scanner-debug-expand-btn {
  display: block;
  width: 100%;
  padding: 0.3rem 0 0.1rem;
  background: none;
  border: none;
  color: rgba(255, 248, 240, 0.5);
  font-size: 0.68rem;
  text-align: left;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.scanner-debug-expand-btn:hover {
  color: rgba(255, 248, 240, 0.8);
}

.scanner-debug-expanded {
  border-top: 1px solid rgba(255, 248, 240, 0.06);
  margin-top: 0.2rem;
  padding-top: 0.2rem;
}

.scanner-progress-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(212, 167, 59, 0.45);
  animation: scannerPulse 1.25s ease-out infinite;
}

.scanner-view {
  min-height: 320px;
  border-radius: 24px;
  overflow: hidden;
  background: #111;
}

#scanner-view video {
  object-fit: cover !important;
}

.scanner-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scanner-overlay::before {
  content: "";
  display: block;
  width: min(var(--scanner-guide-width, 240px), calc(100% - 1.5rem));
  height: min(var(--scanner-guide-height, 240px), calc(100% - 1.5rem));
  border: 2px solid rgba(255,255,255,0.92);
  box-shadow:
    0 0 0 9999px rgba(0, 0, 0, 0.38),
    0 0 26px rgba(212, 167, 59, 0.24);
}

.scanner-overlay-square::before {
  border-radius: 30px;
}

.scanner-overlay-barcode::before {
  border-radius: 24px;
}

.scanner-guide-line {
  position: absolute;
  width: min(var(--scanner-line-width, 180px), calc(100% - 3rem));
  height: 3px;
  border-radius: 999px;
  background: rgba(212, 167, 59, 0.95);
  box-shadow: 0 0 18px rgba(212, 167, 59, 0.72);
}


.scanner-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  padding-top: 0.95rem;
}

.scanner-controls .small-button {
  background: rgba(255, 248, 240, 0.12);
  color: #fff;
  border-color: rgba(255, 248, 240, 0.2);
}

.scanner-page .section-card,
.scanner-page .banner-card {
  background: rgba(255, 248, 240, 0.06);
  border-color: rgba(255, 248, 240, 0.08);
}

.scanner-page .field input {
  background: rgba(255, 248, 240, 0.08);
  color: #fff;
  border-color: rgba(255, 248, 240, 0.12);
}

.scanner-page .field input::placeholder {
  color: rgba(255, 248, 240, 0.48);
}

.scanner-empty {
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  color: rgba(255,255,255,0.86);
}

.scanner-icon-button {
  width: 52px;
  min-width: 52px;
  height: 52px;
  padding: 0;
  font-size: 1.25rem;
  background: rgba(255, 248, 240, 0.08);
  color: #fff;
  border-color: rgba(255, 248, 240, 0.14);
}

.scanner-bottom-overlay {
  margin-top: 0.8rem;
  flex-wrap: nowrap;
}

.scanner-support-row {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.scanner-utility-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
}

.scanner-focus-hint {
  margin: 0;
  color: rgba(255, 248, 240, 0.8);
  font-size: 0.8rem;
  line-height: 1.45;
}

.scanner-mode-badge {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 1rem;
  border-radius: 999px;
  background: rgba(255, 248, 240, 0.08);
  border: 1px solid rgba(255, 248, 240, 0.12);
  color: rgba(255, 248, 240, 0.92);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.scanner-mini-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 0.45rem;
  min-width: 0;
}

.scanner-mini-button {
  width: auto;
  min-width: 0;
  min-height: 46px;
  padding: 0.68rem 0.72rem;
  border-radius: 16px;
  background: rgba(255, 248, 240, 0.1);
  color: #fff;
  border-color: rgba(255, 248, 240, 0.14);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scanner-mini-button-text {
  width: auto;
  min-width: 0;
  max-width: 94px;
  padding-inline: 0.72rem;
  font-size: 0.74rem;
  line-height: 1;
}

.scanner-utility-actions .scanner-icon-button {
  width: 46px;
  min-width: 46px;
  height: 46px;
  font-size: 1.1rem;
}

.scanner-manual-card {
  padding: 1rem;
}

.scanner-manual-form {
  gap: 0.85rem;
}

.export-card-visual,
.settings-card,
.empty-card-visual {
  justify-items: start;
}

.export-stack-compact {
  display: grid;
  gap: 0.7rem;
}

.export-card-panel {
  display: grid;
  gap: 0.65rem;
  padding: 0.8rem 0.95rem;
}

.export-card-row {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
}

.export-card-row-compact {
  padding: 0;
  gap: 0.8rem;
}

.export-card-head {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
}

.export-card-copy {
  display: grid;
  gap: 0.15rem;
}

.export-divider {
  height: 1px;
  background: rgba(19, 58, 46, 0.08);
}

.empty-card-link {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.export-card-icon,
.settings-card-icon,
.empty-card-icon {
  width: 64px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  background: rgba(15, 91, 69, 0.08);
  color: var(--brand-strong);
  font-size: 1.8rem;
}

.export-card-icon .app-icon,
.settings-card-icon .app-icon,
.empty-card-icon .app-icon {
  width: 32px;
  height: 32px;
}

.export-card-label {
  margin: 0;
  color: var(--text-soft-strong);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.export-card-visual {
  justify-items: center;
  text-align: center;
  gap: 0.85rem;
}

.export-actions-row {
  display: inline-flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.export-actions-compact {
  gap: 0.45rem;
}

.toolbar-action-button {
  min-height: 38px;
  padding-inline: 0.8rem;
  background: rgba(15, 91, 69, 0.06);
  border: 1px solid rgba(15, 91, 69, 0.08);
  box-shadow: none;
}

.export-summary-grid .metric-card {
  min-height: 104px;
  padding: 0.8rem 0.65rem;
}

.export-summary-grid .metric-value {
  font-size: 1.7rem;
}

.export-summary-grid .metric-label {
  font-size: 0.78rem;
}

.export-card-visual .export-actions {
  width: 100%;
  justify-content: center;
}

.label-preview {
  display: grid;
  gap: 1rem;
  justify-items: center;
  padding: 1rem;
  background: linear-gradient(180deg, #fffaf1, #efe5d3);
  border: 1px dashed rgba(15, 91, 69, 0.25);
  border-radius: 22px;
}

.qr-target canvas,
.qr-target img { margin: 0 auto; }

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0.7rem;
  transform: translateX(-50%);
  z-index: 35;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.55rem;
  width: min(760px, calc(100% - 1rem));
  padding: 0.7rem;
  background: rgba(248, 242, 233, 0.9);
  border: 1px solid rgba(19, 58, 46, 0.08);
  border-radius: 30px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-card);
  --nav-active-index: 0;
}

.bottom-nav::before {
  content: "";
  position: absolute;
  top: 0.7rem;
  bottom: 0.7rem;
  left: calc(0.7rem + ((100% - 1.4rem) / 5) * var(--nav-active-index));
  width: calc((100% - 1.4rem) / 5);
  border-radius: 24px;
  background: rgba(15, 91, 69, 0.11);
  box-shadow: inset 0 0 0 1px rgba(15, 91, 69, 0.06);
  transition: left 240ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms ease;
  pointer-events: none;
}

.bottom-nav-link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 66px;
  border-radius: 24px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.bottom-nav-link.is-current {
  color: var(--brand-strong);
}

.bottom-nav-link-accent.is-current {
  color: #fff;
}

.bottom-nav-link-accent {
  background: linear-gradient(180deg, #165d47, #0f4636);
  color: #fff;
  box-shadow: 0 18px 28px rgba(15, 91, 69, 0.22);
  transform: translateY(-8px);
}

.bottom-nav-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bottom-nav-icon img {
  width: 24px;
  height: 24px;
}

.bottom-nav-link-accent .bottom-nav-icon img,
.scanner-icon-button .app-icon,
.action-button .app-icon,
.hero-action .app-icon,
.visual-action .app-icon {
  filter: brightness(0) saturate(100%) invert(100%);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(14, 28, 23, 0.56);
  backdrop-filter: blur(10px);
}

.modal-card {
  width: min(720px, 100%);
  padding: 1.15rem;
  background: rgba(255, 250, 242, 0.95);
  box-shadow: var(--shadow-card);
}

.toast-root {
  position: fixed;
  top: 108px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: grid;
  gap: 0.8rem;
  width: min(520px, calc(100% - 1rem));
}

.toast {
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: rgba(17, 38, 33, 0.96);
  color: #fff;
  box-shadow: var(--shadow-card);
}

.hidden { display: none !important; }

@keyframes scannerPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(212, 167, 59, 0.42);
  }
  70% {
    transform: scale(1.08);
    box-shadow: 0 0 0 14px rgba(212, 167, 59, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(212, 167, 59, 0);
  }
}

@keyframes routeFadeSlide {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sheetRise {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes scannerEnter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes addMenuPop {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  #app-root.route-enter > .screen,
  .mobile-sheet-screen,
  .scanner-page {
    animation: none;
  }

  .add-menu {
    animation: none;
  }

  .icon-button,
  .language-trigger,
  .action-button,
  .ghost-button,
  .danger-button,
  .small-button,
  .chip-button,
  .toolbar-button {
    transition: none;
  }
}

@media (min-width: 900px) {
  .metrics-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1440px) {
  :root {
    --content: 1320px;
  }

  .topbar {
    width: min(var(--content), calc(100% - 2rem));
    padding: 0.95rem 1.15rem;
  }

  .app-main,
  .demo-banner,
  .bottom-nav {
    width: min(var(--content), calc(100% - 2rem));
  }

  .dashboard-hero {
    padding: 1.7rem;
  }

  .dashboard-hero h1 {
    max-width: 14ch;
  }

  .recent-grid-covers {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 899px) and (orientation: landscape) {
  .topbar {
    margin-top: 0.45rem;
    padding: 0.62rem 0.78rem;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .brand-title {
    font-size: 1.46rem;
  }

  .brand-subtitle {
    font-size: 0.8rem;
  }

  .dashboard-screen .dashboard-hero {
    grid-template-columns: minmax(0, 1.18fr) minmax(220px, 0.82fr);
    gap: 0.95rem;
    padding: 1.08rem;
  }

  .dashboard-hero h1 {
    font-size: 2rem;
    max-width: 13ch;
  }

  .dashboard-actions-grid,
  .dashboard-metrics-grid,
  .recent-grid-covers {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .dashboard-action-card {
    min-height: 104px;
  }

  .bottom-nav {
    width: min(760px, calc(100% - 1.2rem));
  }
}

@media (min-width: 641px) and (max-width: 820px) {
  .dashboard-screen .dashboard-hero {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .dashboard-hero .hero-art {
    justify-items: start;
  }

  .hero-collage {
    width: min(100%, 420px);
  }

  .dashboard-actions-grid,
  .dashboard-metrics-grid,
  .recent-grid-covers,
  .box-grid,
  .books-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 899px) {
  .topbar,
  .app-main,
  .demo-banner,
  .bottom-nav {
    width: calc(100% - 1rem);
  }

  .topbar {
    margin-top: 0.55rem;
    padding: 0.74rem 0.85rem;
  }

  .brand-wrap {
    gap: 0.75rem;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
  }

  .brand-title {
    font-size: 1.72rem;
  }

  .brand-subtitle {
    font-size: 0.84rem;
  }

  .topbar-actions {
    gap: 0.55rem;
  }

  .icon-button {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .language-trigger {
    min-height: 44px;
    width: 72px;
    min-width: 72px;
    padding-inline: 0.6rem;
    gap: 0.45rem;
  }

  .language-trigger span {
    font-size: 0.88rem;
  }

  .screen {
    padding: 1rem;
  }

  .dashboard-screen .dashboard-hero {
    gap: 0.9rem;
    padding: 1.05rem;
    border-radius: 28px;
  }

  .dashboard-hero h1 {
    font-size: 2.1rem;
    max-width: 13ch;
    line-height: 0.98;
  }

  .dashboard-hero-copy p {
    max-width: 42ch;
    font-size: 0.96rem;
  }

  .detail-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-screen .dashboard-hero {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .dashboard-hero .hero-art {
    justify-items: center;
  }

  .dashboard-actions-grid,
  .dashboard-metrics-grid,
  .recent-grid-covers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scanner-page-topbar {
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  .topbar,
  .app-main,
  .demo-banner,
  .bottom-nav {
    width: calc(100% - 0.8rem);
  }

  .topbar {
    margin-top: 0.5rem;
    padding: 0.72rem 0.8rem;
    border-radius: 30px;
  }

  .brand-wrap {
    gap: 0.72rem;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .brand-title { font-size: 1.52rem; }
  .brand-subtitle {
    margin-top: 0.12rem;
    font-size: 0.82rem;
  }

  .topbar-actions {
    gap: 0.5rem;
  }

  .icon-button {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .language-trigger {
    min-height: 44px;
    width: 72px;
    min-width: 72px;
    padding-inline: 0.6rem;
    gap: 0.45rem;
  }

  .language-trigger span {
    font-size: 0.88rem;
  }

  .screen { padding: 1rem; }
  .screen-title { font-size: 2rem; }
  .dashboard-screen .dashboard-hero {
    gap: 0.9rem;
    padding: 0.95rem;
    border-radius: 28px;
    position: relative;
    min-height: 0;
  }

  .dashboard-hero-copy {
    gap: 0.45rem;
    position: relative;
    inset: auto;
    z-index: 3;
    padding: 0;
    border-radius: 0;
    background: none;
    border: 0;
    backdrop-filter: none;
    box-shadow: none;
    align-content: start;
    align-items: start;
    justify-items: start;
    text-align: left;
  }

  .hero-copy-layer,
  .hero-copy-layer.is-next {
    position: static;
    transform: none;
  }

  .dashboard-hero.is-hero-transitioning .hero-copy-layer.is-current,
  .dashboard-hero.is-hero-transitioning .hero-copy-layer.is-next {
    opacity: 1;
    transform: none;
  }

  .dashboard-hero h1 {
    font-size: 1.95rem;
    max-width: 14ch;
    line-height: 1;
    font-weight: 650;
  }

  .hero-eyebrow {
    margin-bottom: 0.25rem;
    font-size: 0.68rem;
    letter-spacing: 0.12em;
  }

  .dashboard-hero-copy p {
    max-width: 31ch;
    font-size: 0.89rem;
    line-height: 1.34;
  }

  .dashboard-hero-media,
  .dashboard-hero-media.is-current,
  .dashboard-hero.is-hero-transitioning .dashboard-hero-media.is-next {
    opacity: 1;
    transform: none;
  }

  .hero-actions-row {
    justify-content: flex-start;
    margin-top: 0.45rem;
  }

  .hero-action {
    min-width: 0;
    flex: 1 1 calc(50% - 0.4rem);
  }

  .dashboard-hero .hero-art {
    display: grid;
    min-height: 232px;
    height: auto;
  }

  .hero-collage {
    width: min(100%, 314px);
    min-height: 238px;
  }

  .hero-collage-photo-frame {
    inset: 0.7rem 0.15rem 0.45rem 2.4rem;
  }

  .hero-collage-checkout-card {
    width: 36%;
    right: 0;
    padding: 0.62rem 0.62rem 0.58rem;
  }

  .hero-collage-checkout-card strong {
    font-size: 0.82rem;
  }

  .hero-collage-checkout-card span:last-child,
  .hero-collage-kicker {
    font-size: 0.6rem;
  }

  .hero-collage-map-fragment {
    width: 31%;
    min-height: 86px;
    bottom: 0.95rem;
    padding: 0.62rem 0.58rem 0.55rem;
  }

  .hero-collage-map-fragment strong {
    font-size: 0.74rem;
  }

  .hero-collage-botanical {
    width: 24%;
    right: 0.7rem;
    min-height: 92px;
    padding: 0.62rem 0.5rem 0.46rem;
  }

  .hero-collage-botanical strong {
    margin-top: 3.5rem;
    font-size: 0.66rem;
  }

  .hero-collage-botanical-mark::before {
    height: 56px;
    top: 18px;
  }

  .hero-collage-botanical-mark::after {
    width: 28px;
    height: 14px;
    top: 32px;
    box-shadow: 12px 18px 0 -6px rgba(92, 120, 84, 0.72);
  }

  .hero-collage-stamp {
    left: 0.9rem;
    top: 0.6rem;
    min-width: 56px;
    min-height: 56px;
    font-size: 0.58rem;
    border-width: 1.5px;
  }

  .hero-collage-cover {
    width: 64px;
  }

  .hero-collage-cover-1 {
    right: 4rem;
    top: 3.6rem;
  }

  .hero-collage-cover-2 {
    right: -0.2rem;
    top: 5.6rem;
  }

  .hero-collage-cover-caption {
    padding: 0.28rem 0.34rem 0.36rem;
    font-size: 0.58rem;
  }
  .quick-actions,
  .metrics-grid,
  .scanner-controls {
    grid-template-columns: 1fr 1fr;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .quick-actions-visual {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-actions-grid,
  .dashboard-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-summary-strip .metric-card:nth-child(2) {
    border-right: 0;
  }

  .dashboard-summary-strip .metric-card:nth-child(-n + 2) {
    border-bottom: 1px solid rgba(19, 58, 46, 0.08);
  }

  .recent-grid-covers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-screen {
    gap: 0.65rem;
  }

  .demo-banner {
    margin-top: 0.6rem;
    padding: 0.62rem 0.9rem;
    border-radius: 24px;
  }

  .banner-copy-compact strong {
    font-size: 0.88rem;
  }

  .dashboard-collections-section {
    display: none;
  }

  .box-grid {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .box-card,
  .book-card,
  .section-card,
  .empty-card {
    padding: 0.95rem;
  }

  .box-card .box-card-body {
    min-height: 0;
    gap: 0.8rem;
  }

  .box-card h3 {
    font-size: 1.22rem;
  }

  .box-card-heading .muted {
    -webkit-line-clamp: 2;
  }

  .box-card-actions {
    gap: 0.45rem;
  }

  .box-card-action-link {
    min-height: 36px;
    padding-inline: 0.58rem;
    font-size: 0.78rem;
    letter-spacing: -0.01em;
  }

  .collection-collage {
    min-height: 160px;
    margin-bottom: 0.82rem;
  }

  .collection-collage.is-empty {
    min-height: 148px;
    gap: 0.5rem;
  }

  .collection-collage-empty {
    width: 46px;
    height: 46px;
  }

  .collection-collage-empty .app-icon {
    width: 24px;
    height: 24px;
  }

  .collection-collage-empty-cta strong {
    font-size: 0.84rem;
  }

  .empty-box-actions {
    width: min(100%, 200px);
    gap: 0.45rem;
  }

  .mobile-sheet-screen {
    padding-top: 0.55rem;
    padding-bottom: calc(var(--bottom-nav) + env(safe-area-inset-bottom) + 1rem);
    border-radius: 28px 28px 0 0;
  }

  .mobile-sheet-header {
    position: sticky;
    top: calc(var(--topbar) + 0.45rem);
    z-index: 5;
    margin: -0.2rem -0.2rem 0;
    padding: 0.1rem 0.15rem 0.35rem;
    background: linear-gradient(180deg, rgba(255, 250, 242, 0.98), rgba(255, 250, 242, 0.82));
    backdrop-filter: blur(18px);
  }

  .mobile-sheet-header .screen-title {
    font-size: 1.42rem;
    line-height: 1.04;
  }

  .mobile-sheet-copy .supporting-text {
    margin-top: 0.15rem;
    line-height: 1.35;
  }

  .compact-toolbar-button {
    font-size: 0.85rem;
  }

  .book-sheet-screen .section-card,
  .book-detail-sheet-screen .section-card,
  .book-detail-sheet-screen .gallery-card,
  .export-sheet-screen .export-card,
  .settings-sheet-screen .settings-card {
    border-radius: 24px;
  }

  .export-sheet-screen,
  .settings-sheet-screen {
    gap: 0.7rem;
  }

  .export-sheet-screen .export-grid,
  .settings-sheet-screen .settings-grid {
    gap: 0.65rem;
  }

  .export-stack-compact {
    gap: 0.55rem;
  }

  .export-sheet-screen .export-card,
  .settings-sheet-screen .settings-card,
  .export-sheet-screen .export-summary-card {
    padding: 0.9rem;
  }

  .export-sheet-screen .export-card-panel {
    padding: 0.7rem 0.8rem;
  }

  .export-sheet-screen .export-card-row {
    grid-template-columns: 1fr;
    gap: 0.7rem;
    padding: 0.78rem 0.85rem;
  }

  .export-sheet-screen .export-card-row-compact {
    padding: 0;
  }

  .export-sheet-screen .section-heading,
  .settings-sheet-screen .section-heading {
    font-size: 1.18rem;
  }

  .export-sheet-screen .export-card-icon,
  .settings-sheet-screen .settings-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    font-size: 1.35rem;
  }

  .export-sheet-screen .export-card-icon .app-icon,
  .settings-sheet-screen .settings-card-icon .app-icon {
    width: 24px;
    height: 24px;
  }

  .export-sheet-screen .export-card-label {
    margin-top: 0;
  }

  .settings-sheet-screen p,
  .export-sheet-screen p,
  .settings-sheet-screen .muted,
  .export-sheet-screen .muted {
    margin: 0;
    line-height: 1.35;
  }

  .settings-sheet-screen .inline-actions,
  .export-sheet-screen .export-actions {
    gap: 0.55rem;
  }

  .export-sheet-screen .export-actions-row {
    justify-content: flex-start;
  }

  .export-sheet-screen .toolbar-action-button {
    min-height: 36px;
    padding-inline: 0.75rem;
  }

  .book-sheet-screen .photo-slots,
  .settings-sheet-screen .settings-grid,
  .export-sheet-screen .export-grid,
  .export-summary-card .metrics-grid {
    grid-template-columns: 1fr;
  }

  .book-sheet-screen .inline-actions,
  .book-detail-sheet-screen .inline-actions,
  .settings-sheet-screen .inline-actions,
  .export-sheet-screen .export-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .book-detail-sheet-screen .detail-grid {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .book-detail-sheet-screen {
    gap: 0.7rem;
  }

  .book-detail-sheet-screen .mobile-sheet-header {
    margin-bottom: 0.1rem;
  }

  .book-detail-sheet-screen .book-detail-pills {
    margin-top: 0;
  }

  .book-detail-sheet-screen .book-detail-info {
    grid-column: auto;
    padding: 0.95rem;
  }

  .book-detail-sheet-screen .book-detail-gallery {
    grid-column: auto;
    grid-row: auto;
    padding: 0.85rem;
  }

  .book-detail-sheet-screen .book-detail-info-stack {
    gap: 0.75rem;
  }

  .book-detail-sheet-screen .book-detail-meta-list {
    gap: 0.65rem;
  }

  .book-detail-sheet-screen .meta-text {
    line-height: 1.45;
  }

  .book-detail-sheet-screen .book-detail-gallery-compact .cover-thumb {
    width: min(100%, 260px);
  }

  .book-detail-sheet-screen .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .box-detail-screen {
    gap: 0.8rem;
  }

  .box-detail-screen .collection-hero {
    grid-template-columns: 1fr;
    gap: 0.8rem;
    padding: 1rem;
  }

  .box-detail-screen .hero-art {
    justify-items: start;
  }

  .box-detail-primary-actions,
  .box-detail-toolbar,
  .filters-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
  }

  .box-detail-primary-actions > :first-child,
  .box-detail-toolbar > :first-child {
    grid-column: 1 / -1;
  }

  .box-detail-primary-actions .box-action-square,
  .box-detail-toolbar .box-action-square,
  .box-detail-primary-actions .box-action-round,
  .box-detail-toolbar .box-action-round {
    width: 100%;
    justify-content: center;
  }

  .box-detail-tags {
    gap: 0.45rem;
  }

  .box-filter-chip {
    justify-content: center;
    padding-inline: 0.7rem;
  }

  .detail-header,
  .form-header,
  .screen-header {
    display: none;
  }

  .dashboard-action-card {
    min-height: 112px;
    padding: 0.72rem 0.6rem;
    border-radius: 24px;
    gap: 0.72rem;
  }

  .dashboard-action-card .visual-action-icon {
    width: 52px;
    height: 52px;
  }

  .dashboard-action-card .visual-action-icon .app-icon {
    width: 24px;
    height: 24px;
  }

  .dashboard-action-card .visual-action-label {
    font-size: 0.84rem;
    line-height: 1.04;
  }

  .dashboard-summary-strip {
    padding: 0.2rem;
    border-radius: 26px;
    background: rgba(255, 250, 242, 0.96);
  }

  .dashboard-summary-strip .metric-card {
    min-height: 98px;
    padding: 0.68rem 0.4rem;
    border-radius: 20px;
    border-right: 0;
    background: linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(246, 239, 228, 0.92));
    box-shadow: 0 10px 20px rgba(35, 28, 20, 0.05);
  }

  .dashboard-summary-strip .metric-value {
    font-size: 1.7rem;
  }

  .dashboard-summary-strip .metric-label {
    font-size: 0.8rem;
    line-height: 1.08;
  }

  .dashboard-summary-strip .metric-icon {
    width: 38px;
    height: 38px;
    border-radius: 14px;
  }

  .dashboard-summary-strip .metric-icon .app-icon {
    width: 20px;
    height: 20px;
  }

  .export-card-icon {
    width: 72px;
    height: 72px;
    border-radius: 24px;
  }

  .export-card-icon .app-icon {
    width: 36px;
    height: 36px;
  }

  .export-card-label {
    font-size: 0.72rem;
  }

  .scanner-page-topbar,
  .scanner-bottom-overlay {
    align-items: center;
  }

  .action-button,
  .ghost-button,
  .danger-button,
  .toolbar-button {
    width: 100%;
  }

  .bottom-nav {
    bottom: 0.45rem;
    padding: 0.5rem;
    border-radius: 28px;
  }

  .bottom-nav-link-accent {
    transform: translateY(-5px);
  }

  .bottom-nav-link span:last-child {
    font-size: 0.64rem;
  }

  .bottom-nav-link {
    min-height: 60px;
    gap: 0.28rem;
    border-radius: 20px;
    letter-spacing: 0;
  }

  .bottom-nav-icon {
    width: 24px;
    height: 24px;
  }

  .bottom-nav-icon img {
    width: 21px;
    height: 21px;
  }

}
