/* Bookshelf application styles. */
:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17212b;
  background: #fbfaf7;
  --ink: #17212b;
  --muted: #66727c;
  --muted-strong: #4d5b66;
  --surface: #fffefb;
  --surface-soft: #fbfaf7;
  --surface-warm: #fff7e8;
  --line: #dde5ea;
  --line-strong: #c6d3dc;
  --blue: #102f8f;
  --blue-dark: #081e63;
  --blue-bright: #2f6bff;
  --blue-soft: #eaf1ff;
  --marigold: #f4b23b;
  --marigold-soft: #fff2d7;
  --coral: #e96f55;
  --coral-soft: #fff0ec;
  --shadow: rgba(23, 33, 43, 0.09);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scrollbar-gutter: stable;
}

@supports not (scrollbar-gutter: stable) {
  @media (min-width: 921px) {
    body {
      overflow-y: scroll;
    }
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100svh;
  background: linear-gradient(180deg, #ffffff 0%, #fbfaf7 48%, #f7f5ef 100%);
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.28rem; line-height: 1.05; font-weight: 670; }
h2 { font-size: clamp(1.55rem, 3vw, 2.7rem); line-height: 1.04; max-width: 760px; font-weight: 630; letter-spacing: 0; }
h3 { font-size: 1rem; line-height: 1.2; font-weight: 650; }

input, select, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 9px 11px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--blue-bright);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.15);
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--muted-strong);
}

button {
  min-height: 44px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  padding: 0 16px;
  font-weight: 560;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

button.secondary { background: var(--coral); border-color: var(--coral); }
button.secondary-action {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--blue-dark);
}
button.quiet, .text-button {
  background: var(--surface);
  color: var(--blue-dark);
  border: 1px solid var(--line-strong);
}
.text-button { width: 100%; }
.danger-text {
  color: var(--coral);
}

.auth-shell {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-stack {
  width: min(980px, 100%);
}

.auth-card {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 28px;
  align-items: center;
  padding: clamp(22px, 5vw, 52px);
  border: 1px solid rgba(61, 50, 39, 0.12);
  border-radius: 8px;
  background: rgba(255, 254, 251, 0.9);
  box-shadow: 0 24px 70px var(--shadow);
}

.auth-copy h1 {
  font-size: clamp(2.2rem, 6vw, 4.8rem);
  max-width: 620px;
  margin-top: 10px;
}

.lead {
  margin-top: 18px;
  max-width: 560px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.legal-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.legal-links button {
  width: auto;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 560;
}
.legal-links button:hover,
.legal-links button:focus-visible {
  color: var(--blue-dark);
}
.auth-legal-links {
  justify-content: center;
  margin-top: 14px;
}
.app-footer {
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding-top: 16px;
}
.app-footer-links {
  justify-content: flex-start;
  gap: 10px 14px;
}
.app-footer-links button,
.auth-legal-links button {
  color: var(--muted);
  font-size: 0.8rem;
}

.eyebrow {
  color: var(--coral);
  font-weight: 720;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.shelf-preview {
  min-height: 250px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 8px;
  position: relative;
  padding-bottom: 26px;
}

.spine {
  width: 38px;
  height: 160px;
  border-radius: 5px 5px 2px 2px;
  box-shadow: inset -9px 0 rgba(0, 0, 0, 0.12);
}
.spine.tall { height: 204px; }
.spine.red { background: var(--coral); }
.spine.green { background: var(--blue); }
.spine.blue { background: var(--blue-dark); }
.spine.gold { background: var(--marigold); }
.spine.ink { background: var(--ink); }
.shelf-line {
  position: absolute;
  width: min(360px, 100%);
  height: 12px;
  bottom: 14px;
  border-radius: 999px;
  background: var(--marigold);
}

.login-panel, .entry-panel, .book-board, .photo-workspace, .settings-layout, .sessions-layout {
  background: rgba(255, 254, 251, 0.94);
  border: 1px solid rgba(61, 50, 39, 0.12);
  border-radius: 8px;
  box-shadow: 0 14px 40px var(--shadow);
}

.login-panel { padding: 18px; display: grid; gap: 16px; }
.field-stack { display: grid; gap: 12px; }
.otp-destination {
  margin-top: -7px;
  color: var(--muted);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}
.otp-destination strong {
  color: var(--ink);
  font-weight: 560;
}
.inline-action { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.notice {
  background: var(--blue-soft);
  color: var(--blue-dark);
  border: 1px solid #c8d8ff;
  border-radius: 6px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.notice-action {
  border: 0;
  background: transparent;
  color: var(--blue-dark);
  font: inherit;
  font-weight: 520;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.app-boot-shell {
  min-height: 100svh;
  background: inherit;
}

.top-loading-indicator {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  height: 3px;
  width: 100%;
  overflow: hidden;
  opacity: 0;
  background: transparent;
  animation: reveal-top-loading 0.01s linear 420ms forwards;
}

.top-loading-indicator::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 42%;
  background: var(--blue-bright);
  border-radius: 999px;
  animation: slide-top-loading 1.05s ease-in-out infinite;
}

@keyframes reveal-top-loading {
  to { opacity: 1; }
}

@keyframes slide-top-loading {
  0% { transform: translateX(-120%); }
  55% { transform: translateX(145%); }
  100% { transform: translateX(260%); }
}

.product-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px 18px;
  background: var(--blue);
  color: #fff;
}

.brand-lockup { display: flex; gap: 12px; align-items: center; min-width: 0; }
.brand-lockup p { color: rgba(255, 255, 255, 0.72); font-size: 0.82rem; overflow-wrap: anywhere; }
.brand-lockup.compact p { color: var(--muted); }
.brand-mark {
  width: 44px;
  height: 54px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 5px 5px 2px 2px;
  background: var(--marigold);
  color: var(--ink);
  font-weight: 780;
  box-shadow: inset -8px 0 rgba(0, 0, 0, 0.12);
}

.nav-list { display: grid; gap: 8px; }
.nav-group {
  display: grid;
  gap: 6px;
}
.nav-menu-anchor {
  position: relative;
}
.nav-item {
  width: 100%;
  justify-content: start;
  display: flex;
  align-items: center;
  gap: 10px;
  border-color: transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 560;
}
.nav-item span, .mobile-tabs span {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.78rem;
}
.nav-item.active { background: #fff; color: var(--blue-dark); font-weight: 620; }
.nav-item.active span { background: var(--marigold); color: var(--ink); }
.nav-subgroup {
  display: grid;
  gap: 4px;
  padding: 4px 0 2px 42px;
}
.nav-subgroup p {
  margin: 0 0 2px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.7rem;
  font-weight: 620;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav-subitem {
  justify-content: start;
  text-align: left;
  min-height: 34px;
  padding: 0 10px;
  border-color: transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.88rem;
  font-weight: 480;
}
.nav-add-menu {
  position: absolute;
  z-index: 18;
  top: calc(100% + 6px);
  left: 42px;
  width: calc(100% - 42px);
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(15, 48, 148, 0.98);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}
.nav-add-menu .nav-subitem {
  width: 100%;
}
.nav-subitem:hover,
.nav-subitem:focus,
.nav-subitem.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.sidebar .text-button { margin-top: auto; background: rgba(255,255,255,0.1); color: #fff; border-color: rgba(255,255,255,0.28); }

.content-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 3vw, 34px);
}
.mobile-topbar, .mobile-tabs { display: none; }
.mobile-sign-out { display: none; }
.mobile-settings-signout { display: none; }
.view-stack { display: grid; gap: 18px; }
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
}

.legal-shell {
  min-height: 100svh;
  padding: clamp(18px, 3vw, 42px);
}
.legal-page {
  width: min(980px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 16px;
}
.legal-page-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}
.legal-page-header h1 {
  margin-top: 6px;
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1.02;
}
.legal-page-header p:not(.eyebrow) {
  margin-top: 8px;
  color: var(--muted);
}
.legal-page-header button {
  width: auto;
  white-space: nowrap;
}
.legal-page-nav {
  padding-bottom: 2px;
}
.legal-links--inline button {
  color: var(--blue-dark);
}
.legal-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(61, 50, 39, 0.12);
  border-radius: 8px;
  background: rgba(255, 254, 251, 0.94);
  box-shadow: 0 14px 40px var(--shadow);
}
.legal-card h2 {
  font-size: 1.05rem;
  line-height: 1.25;
}
.legal-card p,
.legal-card li {
  color: var(--muted);
  line-height: 1.58;
}
.legal-card ul {
  display: grid;
  gap: 8px;
  padding-left: 20px;
}
.legal-provider-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.legal-provider-links a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--blue-dark);
  font-size: 0.82rem;
  font-weight: 560;
  text-decoration: none;
  background: var(--surface);
}
.legal-provider-links a:hover,
.legal-provider-links a:focus-visible {
  border-color: var(--blue-dark);
}
.page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: end;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.stats-grid article {
  padding: 16px;
  border-radius: 8px;
  border: 1px solid rgba(61, 50, 39, 0.12);
  background: var(--surface);
}
.stats-grid span { color: var(--muted); font-size: 0.82rem; }
.stats-grid strong { display: block; margin-top: 8px; font-size: 2rem; font-weight: 640; color: var(--blue-dark); }

.library-layout,
.home-grid {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.home-grid {
  grid-template-columns: 1fr;
}
.dashboard-grid {
  display: block;
}
.dashboard-desktop-flow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.dashboard-mobile-flow {
  display: none;
}
.dashboard-column {
  min-width: 0;
  display: grid;
  gap: 18px;
  align-content: start;
}
.dashboard-card {
  width: 100%;
  display: inline-grid;
  gap: 14px;
  margin: 0;
  padding: 18px;
  break-inside: avoid;
  border: 1px solid rgba(61, 50, 39, 0.12);
  border-radius: 8px;
  background: rgba(255, 254, 251, 0.94);
  box-shadow: 0 14px 40px var(--shadow);
}
.dashboard-card--accent {
  border-color: rgba(12, 39, 121, 0.28);
  background: linear-gradient(180deg, #fffefb 0%, #f6f8ff 100%);
}
.dashboard-card--setup {
  border-color: rgba(247, 181, 53, 0.55);
  background: #fffaf0;
}
.dashboard-card--onboarding-hero {
  position: relative;
  overflow: hidden;
  min-height: 290px;
  align-content: end;
  gap: 18px;
  padding: 30px;
  padding-right: 220px;
  border: 0;
  border-radius: 18px;
  background:
    radial-gradient(circle at 88% 22%, rgba(244, 178, 59, 0.32) 0 72px, transparent 73px),
    linear-gradient(135deg, #081e63 0%, #102f8f 100%);
  color: #fff;
  box-shadow: 0 22px 54px rgba(8, 30, 99, 0.22);
}
.dashboard-card--onboarding-hero .eyebrow {
  color: #f7b89c;
}
.dashboard-card--onboarding-hero h3 {
  max-width: 100%;
  margin-top: 6px;
  color: #fff;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 620;
  line-height: 1.04;
}
.dashboard-card--onboarding-hero .dashboard-card__copy {
  position: relative;
  z-index: 1;
  max-width: 100%;
  color: rgba(255, 255, 255, 0.84);
}
.onboarding-hero-actions {
  position: relative;
  z-index: 1;
  width: max-content;
  max-width: 100%;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
}
.onboarding-hero-actions button {
  flex: 0 0 auto;
  border-color: #f7b53d;
  background: #f7b53d;
  color: #081e63;
}
.onboarding-hero-actions button.quiet {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.onboarding-spines {
  position: absolute;
  top: 38px;
  right: 28px;
  width: 148px;
  height: 162px;
  display: flex;
  align-items: end;
  gap: 8px;
  opacity: 0.92;
  pointer-events: none;
}
.onboarding-spines span {
  display: block;
  width: 18px;
  border-radius: 7px 7px 4px 4px;
  background: #fff;
  box-shadow: inset -5px 0 0 rgba(8, 30, 99, 0.1);
}
.onboarding-spines span:nth-child(1) {
  height: 92px;
  background: #f7b53d;
}
.onboarding-spines span:nth-child(2) {
  height: 128px;
  background: #fff8e5;
}
.onboarding-spines span:nth-child(3) {
  height: 112px;
  background: #e96f55;
}
.onboarding-spines span:nth-child(4) {
  height: 148px;
  background: #fbfaf7;
}
.onboarding-spines span:nth-child(5) {
  height: 104px;
  background: #f4b23b;
}
@media (min-width: 921px) and (max-width: 1120px) {
  .dashboard-card--onboarding-hero {
    padding-right: 188px;
  }
  .onboarding-spines {
    right: 22px;
    width: 124px;
    opacity: 0.82;
  }
  .onboarding-spines span {
    width: 15px;
  }
}
@media (min-width: 921px) and (max-width: 980px) {
  .dashboard-card--onboarding-hero {
    padding-right: 30px;
    padding-top: 168px;
  }
  .onboarding-spines {
    top: 28px;
  }
}
.dashboard-card--onboarding {
  border-radius: 14px;
  background: rgba(255, 254, 251, 0.98);
}
.dashboard-card--onboarding h3 {
  font-size: 1.22rem;
  font-weight: 620;
}
.onboarding-card-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}
.onboarding-card-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  color: var(--blue-dark);
  background: var(--blue-soft);
}
.onboarding-card-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
}
.onboarding-card-icon--coral {
  color: #9a2f1f;
  background: #fff0ec;
}
.onboarding-card-icon--gold {
  color: #684200;
  background: #fff0c2;
}
.onboarding-card-icon--blue {
  color: var(--blue-dark);
  background: #eaf1ff;
}
.reading-trail-visual {
  display: flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 8px 0 2px;
}
.reading-trail-visual span {
  position: relative;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--coral);
}
.reading-trail-visual span:not(:last-child) {
  margin-right: 28px;
}
.reading-trail-visual span:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 18px;
  top: 6px;
  width: 20px;
  border-top: 2px dashed #e7e4dc;
}
.reading-trail-visual span:nth-child(2) {
  background: var(--blue-dark);
}
.reading-trail-visual span:nth-child(3) {
  background: #c7cce8;
}
.reading-trail-visual span:nth-child(4) {
  border: 1px solid #ded8ca;
  background: #f5f3ee;
}
.dashboard-card--onboarding-setup {
  border-color: #ecd7a2;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff9e8 0%, #fffdf7 100%);
}
.dashboard-card--onboarding-setup h3 {
  font-size: 1.24rem;
  font-weight: 620;
}
.dashboard-card--quiet {
  box-shadow: none;
}
.dashboard-card--wide {
  display: inline-grid;
}
.dashboard-card__header,
.dashboard-card .board-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
}
.dashboard-card h3 {
  margin-top: 2px;
  font-size: 1.1rem;
  line-height: 1.25;
}
.dashboard-card__copy {
  color: var(--muted);
  line-height: 1.45;
}
.dashboard-add-menu {
  position: relative;
  justify-self: start;
}
.dashboard-add-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 24;
  min-width: 190px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 42px rgba(23, 33, 43, 0.18);
}
.dashboard-add-popover button {
  width: 100%;
}
.dashboard-book-link {
  width: 100%;
  min-height: auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}
.dashboard-book-link .book-title,
.dashboard-book-link .book-main p {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-book-link .book-main p {
  margin-top: 2px;
  color: var(--muted);
  font-weight: 520;
}
.dashboard-latest-list {
  display: grid;
  gap: 10px;
}
.dashboard-latest-book {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.dashboard-latest-book .book-open {
  min-width: 0;
}
.dashboard-stat-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.dashboard-stat-list button {
  min-height: 74px;
  display: grid;
  justify-items: start;
  gap: 5px;
  padding: 12px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}
.dashboard-stat-list span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 560;
}
.dashboard-stat-list strong {
  color: var(--blue-dark);
  font-size: 1.55rem;
  font-weight: 620;
}
.dashboard-tidy-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dashboard-tidy-list li {
  padding: 0;
  border-bottom: 1px solid var(--line);
}
.dashboard-tidy-list li:last-child {
  border-bottom: 0;
}
.dashboard-tidy-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 0;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
}
.dashboard-tidy-list button:hover,
.dashboard-tidy-list button:focus-visible {
  color: var(--blue-dark);
}
.dashboard-tidy-list strong {
  color: var(--blue-dark);
  font-weight: 620;
}
.dashboard-ai-usage {
  margin: -4px 0 0;
  color: var(--blue-dark);
  font-size: 0.88rem;
  font-weight: 560;
}
.guide-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.guide-link-list a {
  color: var(--blue-dark);
  font-weight: 560;
  text-decoration: none;
}
.guide-link-list a:hover,
.guide-link-list a:focus-visible {
  text-decoration: underline;
}
.dashboard-card-mini-section {
  display: grid;
  gap: 3px;
  margin-top: 2px;
}
.dashboard-card-mini-section h4 {
  margin: 0;
  color: var(--blue-dark);
  font-size: 0.82rem;
  font-weight: 560;
}
.dashboard-card-mini-section p,
.dashboard-card__fineprint {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.dashboard-card__fineprint {
  font-size: 0.82rem;
}

.dashboard-card--photo-guide {
  gap: 12px;
}
.photo-guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.photo-guide-option {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.photo-guide-option:focus-visible .photo-guide-thumb {
  outline: 2px solid var(--blue-dark);
  outline-offset: 2px;
}
.photo-guide-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}
.photo-guide-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.photo-guide-text {
  display: grid;
  gap: 2px;
}
.photo-guide-text strong {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 580;
  line-height: 1.2;
}
.photo-guide-text small,
.photo-guide-avoid {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}
.photo-guide-avoid {
  margin: 0;
}
.photo-guide-avoid strong {
  color: var(--ink);
  font-weight: 580;
}
.setup-callout--trial {
  border-color: rgba(250, 179, 41, 0.52);
  background: #fffaf0;
}
.entry-panel { padding: 18px; }
.split-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.book-board { padding: 18px; }
.board-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.book-list { display: grid; gap: 10px; }
.book-row, .session-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.book-row {
  grid-template-columns: minmax(250px, 0.85fr) minmax(240px, 1fr) auto;
  align-items: start;
}
.book-row.selectable {
  grid-template-columns: auto minmax(250px, 0.85fr) minmax(240px, 1fr) auto;
}
.book-row.selected {
  border-color: #b7c9ff;
  background: #f6f8ff;
}
.book-select-control {
  grid-column: 1;
  display: grid;
  place-items: center;
  min-height: 56px;
  margin: 0;
}
.book-select-control input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--blue);
}
.book-row.selectable .book-open {
  grid-column: 2;
}
.book-row.selectable .book-row-description {
  grid-column: 3;
}
.book-row.selectable .book-meta {
  grid-column: 4;
}
.book-row-button {
  width: 100%;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  text-align: left;
  color: var(--ink);
  border-color: var(--line);
}
.book-row-button:hover,
.book-row-button:focus {
  border-color: #b9c8d4;
  background: #fafcff;
}
.book-open {
  grid-column: 1;
  min-width: 0;
  min-height: 56px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.book-open:hover .book-title,
.book-open:focus .book-title {
  color: var(--blue-dark);
}
.book-title {
  font-size: 1rem;
  line-height: 1.32;
  font-weight: 450;
  color: var(--ink);
}
.book-main p, .session-row p { margin-top: 3px; color: var(--muted); overflow-wrap: anywhere; }
.cover-chip {
  width: 42px;
  height: 56px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 5px 5px 2px 2px;
  background: var(--blue);
  color: #fff;
  font-weight: 740;
  box-shadow: inset -8px 0 rgba(0, 0, 0, 0.12);
}
.book-cover-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.book-cover-thumb > span {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
}
.book-row-description {
  grid-column: 2;
  display: -webkit-box;
  margin-top: 2px;
  color: var(--muted-strong);
  font-size: 0.86rem;
  line-height: 1.45;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.book-meta { grid-column: 3; display: grid; justify-items: end; gap: 6px; color: var(--muted); font-size: 0.82rem; }
.book-sort-meta {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
  white-space: nowrap;
}
.book-status-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 560;
}
.book-status-control span {
  color: var(--muted);
}
.book-status-control > span {
  color: var(--muted);
  font-weight: 560;
}
.book-status-menu {
  position: relative;
  display: inline-flex;
}
.book-status-trigger {
  max-width: 150px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 560;
  line-height: 1.25;
  text-align: left;
}
.book-status-trigger > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.book-status-trigger.active {
  color: var(--blue-dark);
}
.book-status-trigger:hover,
.book-status-trigger:focus {
  color: var(--blue-dark);
}
.book-status-menu__options {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 28;
  min-width: 180px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 36px rgba(23, 33, 43, 0.16);
}
.book-status-menu__options button {
  width: 100%;
  min-height: 36px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-weight: 520;
}
.book-status-menu__options button:hover,
.book-status-menu__options button:focus {
  background: var(--blue-soft);
}
.book-status-menu__options button.active {
  color: var(--blue-dark);
}
.status-select {
  width: auto;
  min-width: 138px;
  min-height: 36px;
  padding: 5px 30px 5px 9px;
  color: var(--blue-dark);
  background: var(--blue-soft);
  border-color: transparent;
  font-size: 0.82rem;
}
.has-notes {
  color: var(--coral);
  font-size: 0.75rem;
}
.enrichment-state {
  color: var(--blue-dark);
  font-size: 0.76rem;
}
.enrichment-state.failed {
  color: var(--coral);
}
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: 0.78rem;
  font-weight: 680;
}
.muted-pill { background: var(--surface-warm); color: var(--muted); }

.empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
}
.compact-empty { min-height: 180px; }
.mini-shelf { display: flex; gap: 5px; align-items: end; height: 58px; }
.mini-shelf span { width: 18px; border-radius: 4px 4px 1px 1px; background: var(--coral); }
.mini-shelf span:nth-child(1) { height: 42px; }
.mini-shelf span:nth-child(2) { height: 56px; background: var(--blue); }
.mini-shelf span:nth-child(3) { height: 48px; background: var(--marigold); }

.photo-workspace, .settings-layout, .sessions-layout { padding: 20px; display: grid; gap: 18px; }
.add-workspace {
  align-content: start;
}
.manual-add-workspace {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid rgba(61, 50, 39, 0.12);
  border-radius: 8px;
  background: rgba(255, 254, 251, 0.96);
  box-shadow: 0 14px 40px var(--shadow);
}
.manual-add-workspace .review-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.heading-copy {
  max-width: 680px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
}
.add-mode-link {
  justify-self: start;
  min-height: 30px;
  margin-top: 2px;
  padding: 0;
  font-size: 0.86rem;
}
.todo-switcher,
.todo-card {
  padding: 18px 20px;
  border: 1px solid rgba(61, 50, 39, 0.12);
  border-radius: 8px;
  background: rgba(255, 254, 251, 0.94);
  box-shadow: 0 10px 26px rgba(23, 33, 43, 0.08);
}
.todo-switcher {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.todo-switcher h2 {
  margin: 0;
}
.todo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.todo-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}
.review-uploads-empty {
  grid-column: 1 / -1;
  min-height: 220px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
}
.review-uploads-empty h3 {
  font-size: 1.1rem;
  font-weight: 600;
}
.review-uploads-empty p {
  max-width: 420px;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}
.todo-card p:not(.eyebrow) {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}
.scan-name-row {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.scan-name-row .scan-name {
  min-width: 0;
  margin-top: 5px;
}

.scan-rename-button {
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.scan-rename-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
}

.scan-rename-button:hover,
.scan-rename-button:focus {
  color: var(--blue-dark);
  background: var(--blue-soft);
}

.scan-name-input {
  width: min(260px, 100%);
  min-height: 32px;
  margin-top: 2px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 540;
}

.review-upload-pagination {
  grid-column: 1 / -1;
}

.import-job {
  align-items: stretch;
  border-left: 0;
  grid-template-columns: 92px minmax(220px, 1fr) auto;
}
.import-thumb {
  position: relative;
  width: 92px;
  height: 92px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.2;
  text-align: center;
}
.import-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.manual-import-thumb {
  padding: 10px;
  background: #fff7df;
  color: var(--blue-dark);
  border-color: rgba(245, 177, 40, 0.42);
}
.manual-import-thumb span {
  font-size: 0.78rem;
  font-weight: 560;
}
.preview-button {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 32px;
  height: 32px;
  min-height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 254, 251, 0.94);
  color: var(--blue-dark);
  border-color: var(--line);
  box-shadow: 0 8px 16px rgba(23, 33, 43, 0.14);
}
.preview-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
}
.import-job-copy { min-width: 0; }
.import-job-copy h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.scan-name {
  font-size: 0.82rem;
  font-weight: 400;
}
.import-job-copy small,
.job-guidance {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.job-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  align-content: center;
  gap: 7px;
  min-width: 112px;
}
.job-actions .job-guidance {
  max-width: 220px;
  text-align: right;
}
.job-actions .text-button { width: auto; }
.manual-todo-card {
  grid-template-columns: minmax(0, 1fr) auto;
}
.review-page-heading {
  align-items: end;
  margin-bottom: 10px;
}
.review-back-link {
  width: auto;
  min-height: 0;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--blue-dark);
  background: transparent;
  box-shadow: none;
}
.review-context {
  margin-top: 3px;
  color: var(--muted);
}
.job-progress {
  width: min(420px, 100%);
  display: grid;
  gap: 5px;
  margin-top: 10px;
}
.job-progress progress {
  width: 100%;
  height: 8px;
  accent-color: var(--blue);
}
.job-progress span {
  color: var(--muted);
  font-size: 0.76rem;
}
.autosave-note,
.save-state {
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}
.save-state.error { color: var(--coral); }
.photo-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 24, 44, 0.54);
}
.photo-preview-modal {
  width: min(920px, 100%);
  max-height: min(88vh, 900px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(12, 24, 44, 0.3);
}
.photo-preview-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.photo-preview-bar h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}
.photo-preview-bar p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}
.photo-preview-stage {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  background: var(--surface-soft);
}
.photo-preview-stage img {
  width: 100%;
  height: 100%;
  max-height: calc(88vh - 62px);
  object-fit: contain;
}

.review-details-modal {
  width: min(780px, calc(100vw - 48px));
  max-height: min(86vh, 860px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(221, 229, 234, 0.95);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 28px 72px rgba(12, 24, 44, 0.34);
}
.review-details-modal .photo-preview-bar {
  padding: 16px 18px;
  background: var(--surface);
}
.review-details-modal .photo-preview-bar h3 {
  font-size: 1.05rem;
  font-weight: 620;
}
.review-details-modal .photo-preview-bar p {
  max-width: 580px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.review-details-modal .photo-preview-bar .icon-button {
  width: 40px;
  min-width: 40px;
  flex-basis: 40px;
  height: 40px;
  min-height: 40px;
  color: var(--blue-dark);
  font-size: 1rem;
}
.review-details-scroll {
  min-height: 0;
  overflow-y: auto;
  background: var(--surface-soft);
}
.review-details-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
  padding: 18px;
  background: var(--surface-soft);
}
.review-detail-field {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 7px;
  margin: 0;
}
.review-detail-field.wide {
  grid-column: 1 / -1;
}
.review-detail-field > span {
  min-height: 22px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 620;
}
.review-detail-field input,
.review-detail-field select,
.review-detail-field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  font-weight: 500;
}
.review-detail-field textarea {
  min-height: 132px;
  resize: vertical;
  line-height: 1.45;
}
.review-contributors-field {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.review-contributors-list {
  display: grid;
  gap: 8px;
}
.review-contributor-row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(128px, 0.7fr) 38px;
  gap: 8px;
  align-items: center;
}
.review-contributor-row .icon-button {
  width: 34px;
  height: 34px;
  min-width: 34px;
}
.review-add-contributor {
  justify-self: start;
  padding: 4px 0;
}
.subtitle-edit-stack {
  display: grid;
  gap: 8px;
}
.edit-field {
  display: grid;
  gap: 6px;
}
.edit-field-label {
  display: block;
  margin-bottom: 0;
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 650;
}
.subtitle-absent-toggle {
  min-height: 44px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted-strong);
  font-size: 0.86rem;
  font-weight: 560;
}
.subtitle-absent-toggle input {
  width: 17px;
  min-height: 17px;
  accent-color: var(--blue-dark);
}
.ai-suggestion-mark,
.ai-confidence {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 620;
  line-height: 1;
}
.ai-suggestion-mark {
  background: var(--blue-soft);
  color: var(--blue-dark);
}
.ai-confidence {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--line);
}
.review-details-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.review-details-suggestions {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.review-details-suggestions .review-cover-suggestion {
  flex: 0 0 auto;
  padding: 0;
  background: transparent;
}

.merge-preference {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.merge-preference button {
  min-height: 34px;
  padding: 0 10px;
  border-color: var(--line-strong);
  border-radius: 0;
  background: var(--surface);
  color: var(--blue-dark);
  font-size: 0.82rem;
}

.merge-preference button:first-child {
  border-radius: 6px 0 0 6px;
}

.merge-preference button:last-child {
  margin-left: -1px;
  border-radius: 0 6px 6px 0;
}

.merge-preference button.selected {
  position: relative;
  z-index: 1;
  border-color: var(--blue-dark);
  background: var(--blue-dark);
  color: #fff;
}

.confirm-dialog {
  width: min(460px, calc(100vw - 36px));
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 28px 72px rgba(12, 24, 44, 0.34);
}

.confirm-dialog h3 {
  margin: 0 0 6px;
  font-size: 1.08rem;
  font-weight: 560;
}

.confirm-dialog p {
  margin: 0;
  color: var(--muted);
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.mobile-review-details-screen {
  display: grid;
  gap: 14px;
}
.mobile-review-details-top {
  display: grid;
  gap: 10px;
}
.mobile-review-details-top .text-button {
  width: auto;
  justify-self: start;
}
.mobile-review-details-grid {
  display: grid;
  gap: 12px;
}
.mobile-review-details-actions {
  display: none;
}
.preview-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 42px;
  height: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border-color: var(--line-strong);
  background: rgba(255, 254, 251, 0.92);
  color: var(--blue-dark);
  font-size: 0;
  font-weight: 400;
  line-height: 0;
  transform: translateY(-50%);
  box-shadow: 0 10px 24px rgba(23, 33, 43, 0.16);
}
.preview-nav.previous {
  left: 12px;
}
.preview-nav.next {
  right: 12px;
}
.preview-nav svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: none;
  stroke: currentColor;
  pointer-events: none;
}
.upload-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr); gap: 16px; align-items: stretch; }
.desktop-upload-method-card {
  display: grid;
  align-content: stretch;
  gap: 12px;
  min-height: 0;
}
.upload-method-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}
.upload-method-tabs button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--blue-dark);
  font-size: 0.9rem;
  font-weight: 540;
  box-shadow: none;
}
.upload-method-tabs button.active {
  background: var(--blue-dark);
  color: #fff;
}
.upload-method-tabs button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.desktop-device-drop-zone,
.desktop-phone-upload-mode {
  min-height: 0;
}
.desktop-phone-upload-mode {
  display: grid;
  align-content: center;
  height: 100%;
  min-height: 300px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue-soft), var(--surface));
}
.desktop-phone-upload-mode .phone-upload-bridge {
  width: min(520px, calc(100% - 32px));
  margin: 0 auto;
  background: var(--surface);
}
.drop-zone {
  min-height: 300px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue-soft), var(--surface));
  text-align: center;
  cursor: default;
}
.mobile-photo-drop-zone {
  display: none;
}
.drop-zone input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }
.drop-zone:has(input:disabled) {
  cursor: default;
}
.drop-zone.uploading,
.drop-zone.processing {
  border-style: solid;
  border-color: #c8d8ff;
  background: var(--blue-soft);
}
.camera-mark {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 2.4rem;
  line-height: 1;
}
.drop-zone small, .retention-note { color: var(--muted); }
.desktop-copy {
  display: inline;
}
.mobile-copy {
  display: none;
}
.photo-source-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}
.photo-source-actions label {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--blue-dark);
  font-size: 0.95rem;
  font-weight: 540;
  line-height: 1;
  cursor: pointer;
}
.photo-source-actions label:not(.camera-source-action) {
  border-color: var(--blue-dark);
  background: var(--blue-dark);
  color: #fff;
}
.photo-source-actions .disabled-label {
  opacity: 0.55;
  cursor: not-allowed;
}
.camera-source-action {
  display: none !important;
}
.upload-side-panel {
  align-content: start;
  box-shadow: none;
}
.desktop-only-card {
  display: grid;
}
.phone-upload-bridge {
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}
.phone-upload-bridge__empty {
  display: grid;
  gap: 14px;
  justify-items: start;
}
.phone-upload-bridge__empty button {
  width: auto;
}
.phone-upload-bridge h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
}
.phone-upload-bridge p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}
.phone-upload-bridge__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}
.phone-upload-bridge__content {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
.phone-upload-qr {
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.phone-upload-qr svg {
  width: 104px;
  height: 104px;
  display: block;
}
.phone-upload-qr--empty {
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}
.phone-upload-bridge__link {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}
.phone-upload-bridge__link span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.phone-uploaded-photo-list .selected-photo-strip {
  grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
}
.shared-upload-photo-list .selected-photo-strip {
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
}
.upload-next-step {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}
.upload-status {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}
.upload-status-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.upload-status-row strong {
  color: var(--blue-dark);
}
.selected-photo-list {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}
.mobile-selected-photo-list {
  display: none;
}
.selected-photo-list-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.selected-photo-list-top h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
}
.selected-photo-list-top p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}
.selected-photo-list-top .text-button {
  width: auto;
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 0.78rem;
}
.selected-photo-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 8px;
}
.selected-photo-tile {
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
}
.selected-photo-preview {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}
.selected-photo-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.selected-photo-preview .image-fallback-label {
  display: none;
  padding: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.2;
  text-align: center;
}
.selected-photo-preview.image-load-failed .image-fallback-label {
  display: block;
}
.selected-photo-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--coral);
  font-size: 0;
  font-weight: 500;
  line-height: 0;
  box-shadow: 0 8px 18px rgba(23, 33, 43, 0.12);
}
.selected-photo-remove svg {
  width: 13px;
  height: 13px;
  display: block;
  fill: none;
  stroke: currentColor;
  pointer-events: none;
}
.mobile-start-scan-bar {
  display: none;
}
.upload-status-row span,
.upload-status p {
  color: var(--muted);
}
.upload-status p {
  line-height: 1.45;
}
.upload-status progress {
  width: 100%;
  height: 10px;
  accent-color: var(--blue);
}
.upload-status.processing {
  background: var(--blue-soft);
  border-color: #c8d8ff;
}
.upload-status.done {
  background: var(--blue-soft);
  border-color: #c8d8ff;
}
.upload-status.error {
  background: var(--coral-soft);
  border-color: #f4c7bd;
}
.upload-status.error .upload-status-row strong {
  color: var(--coral);
}
.setup-callout {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid #f1d391;
  border-radius: 8px;
  background: var(--marigold-soft);
}
.setup-callout p:not(.eyebrow) {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}
.phone-upload-shell {
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: 4px;
  background: var(--page);
}
.phone-upload-card {
  width: min(500px, 100%);
  min-height: calc(100vh - 8px);
  display: grid;
  align-content: start;
  gap: 24px;
  padding: 34px 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: none;
}
.phone-upload-card .brand-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.phone-upload-card .brand-tile {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--marigold);
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 700;
}
.phone-upload-card h1 {
  margin: 0;
  color: var(--ink);
  font-size: 1.85rem;
  font-weight: 620;
  line-height: 1.05;
}
.phone-upload-card p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 1rem;
}
.phone-upload-status {
  display: grid;
  gap: 8px;
  padding: 22px 24px;
  border: 1px solid #f1cdbf;
  border-radius: 16px;
  background: #fff4ed;
  color: var(--muted);
  line-height: 1.42;
}
.phone-upload-status strong {
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 620;
}
.phone-upload-status span {
  color: var(--muted);
  font-size: 1.05rem;
}
.phone-upload-status.active {
  border-color: #f1cdbf;
  background: #fff4ed;
  color: var(--ink);
}
.phone-upload-status.closed {
  background: var(--surface-soft);
}
.phone-upload-intro {
  display: grid;
  gap: 4px;
}
.phone-upload-intro h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 580;
}
.phone-upload-intro p {
  margin: 0;
  max-width: 42ch;
  color: var(--muted);
  line-height: 1.45;
}
.phone-source-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.phone-source-actions--initial {
  grid-template-columns: 1fr;
  gap: 14px;
}
.phone-source-actions label {
  min-height: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--blue-dark);
  border-radius: 14px;
  background: var(--blue-dark);
  color: #fff;
  font-size: 1.08rem;
  font-weight: 610;
  text-align: center;
}
.phone-source-actions label.quiet {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--blue-dark);
}
.phone-source-actions input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}
.phone-preview-list {
  display: grid;
  gap: 14px;
}
.phone-preview-list .selected-photo-list-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.phone-preview-list .selected-photo-list-top h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 620;
}
.phone-preview-list .selected-photo-list-top p {
  margin-top: 3px;
}
.phone-clear-action {
  color: var(--coral);
}
.phone-preview-list .selected-photo-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.phone-preview-list .selected-photo-tile,
.phone-preview-list .selected-photo-preview {
  width: 104px;
  height: 136px;
  flex: 0 0 auto;
}
.phone-preview-list .selected-photo-preview {
  border-radius: 13px;
  background:
    repeating-linear-gradient(45deg, rgba(61, 50, 39, 0.04) 0 8px, rgba(61, 50, 39, 0.01) 8px 16px),
    var(--surface-soft);
}
.phone-preview-list .selected-photo-remove {
  top: -9px;
  right: -9px;
}
.phone-upload-primary {
  width: 100%;
  min-height: 64px;
  border-radius: 14px;
  font-size: 1.12rem;
  font-weight: 620;
}
.phone-upload-actions {
  display: grid;
  gap: 14px;
}
.phone-upload-actions .text-button {
  background: transparent;
  border: 0;
  justify-self: center;
  min-height: auto;
  padding: 0;
  color: var(--muted);
  font-weight: 600;
}
.optional-details {
  display: grid;
  gap: 10px;
}
.optional-details summary {
  color: var(--blue-dark);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 560;
}
.settings-card { width: min(860px, 100%); }
.settings-view {
  gap: 16px;
}
.settings-view .settings-layout {
  padding: 20px 22px;
}
.settings-group-heading {
  align-items: end;
  margin-top: 10px;
}
.settings-group-heading:first-child {
  margin-top: 0;
}
.settings-group-heading p:not(.eyebrow) {
  max-width: 58ch;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}
.heading-edit-action,
.compact-text-action {
  width: auto;
  min-height: 34px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--blue-dark);
}
.settings-edit-icon {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue-dark);
}
.settings-edit-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
}
.settings-edit-icon:hover,
.settings-edit-icon:focus {
  background: var(--blue-soft);
}
.heading-edit-action:hover,
.heading-edit-action:focus,
.compact-text-action:hover,
.compact-text-action:focus {
  text-decoration: underline;
}
.settings-guide-inline {
  display: block;
  margin-top: 4px;
  font-size: 0.88rem;
}
.settings-guide-inline a {
  color: var(--blue-dark);
  font-weight: 560;
  text-decoration: none;
}
.settings-guide-inline a:hover,
.settings-guide-inline a:focus-visible {
  text-decoration: underline;
}
.key-state { display: flex; justify-content: space-between; gap: 12px; padding: 14px; border-radius: 8px; background: var(--blue-soft); }
.ai-settings-form {
  gap: 16px;
}
.ai-account-list {
  display: grid;
  gap: 12px;
}
.settings-add-account {
  justify-self: start;
  width: auto;
}
.ai-account-card {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.ai-account-card > .split-fields {
  display: none;
}
.ai-account-card--new {
  background: var(--surface-soft);
}
.ai-account-card__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
}
.ai-account-card-title {
  display: flex;
  align-items: start;
  gap: 8px;
  min-width: 0;
}
.ai-account-card-title > div {
  min-width: 0;
}
.ai-account-card__top strong {
  display: block;
  font-weight: 620;
}
.ai-account-card__top small,
.form-note {
  color: var(--muted);
  line-height: 1.4;
}
.ai-account-order {
  display: inline-flex;
  gap: 6px;
}
.ai-account-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.mini-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--muted-strong);
  font-size: 0.92rem;
  font-weight: 520;
}
.mini-toggle input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--blue-dark);
}
.ai-account-editor input[type="checkbox"] {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--blue-dark);
}
.small-action,
.secondary-action.compact {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 0.9rem;
  font-weight: 520;
}
.ai-account-order .icon-button {
  width: 34px;
  min-width: 34px;
  flex-basis: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
}
.ai-account-editor {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--blue-border);
  border-radius: 8px;
  background: var(--surface-soft);
}
.ai-account-editor__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.ai-account-editor__header strong {
  display: block;
  font-weight: 620;
}
.ai-account-editor__header small {
  color: var(--muted);
  line-height: 1.4;
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.settings-form-actions {
  justify-content: flex-end;
  gap: 10px;
}
.budget-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.budget-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.budget-item-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.budget-item-heading span {
  color: var(--muted);
  font-size: 0.9rem;
}
.budget-item input {
  margin-top: 4px;
}
.budget-summary strong {
  color: var(--blue-dark);
  font-size: 1.35rem;
  font-weight: 620;
}
.budget-item.editing {
  background: var(--surface-soft);
}
.budget-editor {
  display: grid;
  gap: 14px;
}
.settings-inline-actions {
  justify-content: flex-end;
  margin-top: 10px;
}
.settings-inline-actions button {
  min-height: 36px;
  padding: 0 12px;
}
.empty-inline-state {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
}
.empty-inline-state strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-weight: 620;
}
.session-list { display: grid; gap: 10px; }
.session-row { grid-template-columns: minmax(0, 1fr) auto; }

.library-tools {
  position: sticky;
  top: 0;
  z-index: 45;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(180px, 2fr) auto auto;
  gap: 12px;
  align-items: end;
  margin: -18px -18px 14px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid rgba(61, 50, 39, 0.08);
  background: rgba(255, 254, 251, 0.96);
  backdrop-filter: blur(14px);
  overflow: visible;
}
.library-tools > .book-filter-panel,
.library-tools > .bulk-selection-bar {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
}
.library-tools label { margin: 0; }
.library-tools label > span {
  display: block;
  margin-bottom: 6px;
}
.filter-field > span {
  color: var(--blue-dark);
  font-weight: 700;
}
.active-filter-chips {
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  align-self: end;
  min-height: 44px;
  padding-bottom: 5px;
}
.active-filter-chips--mobile {
  display: none;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 34px;
  padding: 5px 7px 5px 10px;
  border: 1px solid #c8d8ff;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: 0.82rem;
  font-weight: 520;
  white-space: nowrap;
}
.filter-chip > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.active-filter-chips--desktop > .filter-chip {
  max-width: clamp(136px, 18vw, 240px);
}
.filter-chip button {
  width: 22px;
  min-height: 22px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--coral);
  line-height: 1;
}
.filter-chip button:hover,
.filter-chip button:focus {
  background: rgba(245, 99, 77, 0.12);
}
.filter-chip-menu {
  position: relative;
  flex: 0 0 auto;
}
.filter-chip-more {
  min-height: 34px;
  cursor: pointer;
}
.filter-chip-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 32;
  width: min(360px, calc(100vw - 80px));
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 36px rgba(23, 33, 43, 0.16);
}
.filter-chip-popover__item {
  max-width: 100%;
  justify-content: space-between;
}
.filter-chip-measurer {
  position: absolute;
  left: -10000px;
  top: 0;
  height: 0;
  width: max-content;
  max-width: none;
  display: flex;
  gap: 8px;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
  white-space: nowrap;
}
.sort-summary {
  width: auto;
  min-height: 44px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.25;
  white-space: nowrap;
}
.sort-summary__icon {
  width: 12px;
  height: 12px;
  display: block;
  flex: 0 0 12px;
}
.sort-summary__mobile-icon {
  display: none;
}
.sort-summary.active {
  color: var(--blue-dark);
  font-weight: 560;
}
.sort-menu {
  position: relative;
  justify-self: end;
  display: inline-flex;
}
.sort-menu__options {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  min-width: 220px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 36px rgba(23, 33, 43, 0.16);
}
.sort-menu__options button {
  width: 100%;
  min-height: 36px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-weight: 520;
}
.sort-menu__options button:hover,
.sort-menu__options button:focus {
  background: var(--blue-soft);
}
.sort-menu__options button.active {
  color: var(--blue-dark);
}
.advanced-filter-toggle,
.clear-filters {
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--blue-dark);
}
.advanced-filter-toggle:hover,
.advanced-filter-toggle:focus,
.clear-filters:hover,
.clear-filters:focus {
  text-decoration: underline;
}
.clear-filters:disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.58;
}
.clear-filters:disabled:hover,
.clear-filters:disabled:focus {
  text-decoration: none;
}
.library-filter-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.library-action-separator {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1;
}
.book-filter-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0 0 16px;
  padding: 12px 0 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.filter-menu-field {
  position: relative;
  flex: 0 1 clamp(172px, 16vw, 220px);
  width: clamp(172px, 16vw, 220px);
  min-width: 0;
}
.filter-menu {
  position: relative;
  min-width: 0;
}
.filter-menu-trigger {
  width: 100%;
  min-height: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14px;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.25;
  text-align: left;
  font-weight: 520;
}
.filter-menu-trigger__text {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
}
.filter-menu-trigger__label {
  flex: 0 0 auto;
  color: var(--blue-dark);
  font-weight: 560;
}
.filter-menu-trigger__value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filter-menu-trigger.active {
  color: var(--blue-dark);
}
.filter-menu-trigger.active .filter-menu-trigger__value {
  color: var(--blue-dark);
}
.filter-menu-trigger:hover,
.filter-menu-trigger:focus {
  color: var(--blue-dark);
}
.filter-menu__options {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 34;
  width: min(340px, calc(100vw - 80px));
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 36px rgba(23, 33, 43, 0.16);
}

.filter-menu-search {
  position: sticky;
  top: -6px;
  z-index: 1;
  margin: -6px -6px 6px;
  padding: 6px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.filter-menu-search input {
  width: 100%;
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.86rem;
}

.filter-menu-empty {
  margin: 6px 8px 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.filter-menu__options button {
  width: 100%;
  min-height: 36px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-weight: 520;
}
.filter-menu__options button span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filter-menu__options button:hover,
.filter-menu__options button:focus {
  background: var(--blue-soft);
}
.filter-menu__options button.active {
  color: var(--blue-dark);
}
.book-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}
.book-page-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.page-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.page-menu-trigger {
  min-width: 58px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--blue-dark);
  font-size: 0.86rem;
  font-weight: 560;
  line-height: 1;
}

.page-menu-trigger:hover,
.page-menu-trigger:focus {
  background: var(--blue-soft);
  outline: none;
}

.page-menu__options {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 40;
  width: 86px;
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.page-menu__options button {
  width: 100%;
  min-height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 520;
  text-align: left;
}

.page-menu__options button:hover,
.page-menu__options button:focus,
.page-menu__options button.active {
  background: var(--blue-soft);
  color: var(--blue-dark);
}
.bulk-selection-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: -2px 0 14px;
  padding: 10px 12px;
  border: 1px solid #c8d8ff;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue-dark);
}
.bulk-selection-bar strong {
  margin-right: auto;
  font-weight: 580;
}
.bulk-selection-bar .text-button {
  width: auto;
  min-height: 34px;
  padding: 0 4px;
  border: 0;
  background: transparent;
}
.bulk-action-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.bulk-action-select span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
}
.bulk-action-select select {
  min-height: 36px;
  width: auto;
  min-width: 172px;
}
.bulk-selection-error {
  flex-basis: 100%;
  color: var(--coral);
  font-size: 0.82rem;
  font-weight: 560;
}
.bulk-action-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 33, 43, 0.42);
}
.bulk-action-dialog {
  width: min(520px, 100%);
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(23, 33, 43, 0.2);
}
.bulk-action-dialog__header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}
.bulk-action-dialog__header h3 {
  font-size: 1.24rem;
  font-weight: 560;
}
.bulk-action-dialog__header p,
.bulk-warning {
  color: var(--muted);
}
.bulk-action-dialog label {
  margin: 0;
}
.bulk-action-dialog label > span {
  display: block;
  margin-bottom: 6px;
  color: var(--blue-dark);
  font-size: 0.84rem;
  font-weight: 650;
}
.bulk-action-help {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}
.bulk-warning {
  padding: 10px 12px;
  border: 1px solid rgba(245, 99, 77, 0.32);
  border-radius: 8px;
  background: #fff4f1;
}
.bulk-action-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.bulk-feedback {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 85;
  width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid #c8d8ff;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  box-shadow: 0 16px 40px rgba(23, 33, 43, 0.18);
  font-weight: 520;
}
.bulk-feedback.error {
  border-color: rgba(245, 99, 77, 0.38);
  background: #fff4f1;
  color: var(--coral);
}
.advanced-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 0;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.advanced-filters label {
  margin: 0;
}
.advanced-filters label > span {
  display: block;
  margin-bottom: 6px;
}

.book-detail-shell {
  display: grid;
  gap: 0;
  padding-bottom: 88px;
}
.book-detail-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
}
.back-button,
.inline-button {
  width: auto;
  min-height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue-dark);
  font-weight: 560;
}
.back-button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.inline-button {
  padding: 0 4px;
  font-size: 0.86rem;
}
.back-button:hover,
.back-button:focus,
.inline-button:hover,
.inline-button:focus {
  color: var(--blue-bright);
  text-decoration: underline;
}
.book-detail-hero,
.edit-book-hero {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  gap: clamp(22px, 4vw, 48px);
  align-items: start;
  padding: clamp(24px, 4vw, 42px) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.detail-cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  box-shadow: inset -14px 0 rgba(0, 0, 0, 0.1), 0 14px 30px var(--shadow);
}
.detail-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.detail-cover > span {
  font-size: clamp(2.6rem, 7vw, 5.5rem);
  font-weight: 560;
}
.detail-heading {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 10px;
  padding-top: 8px;
}
.hero-field {
  max-width: 100%;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.field-edit {
  width: auto;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue-dark);
  font-size: 0.78rem;
  font-weight: 500;
}
.field-edit:hover,
.field-edit:focus {
  color: var(--blue-bright);
  text-decoration: underline;
}
.detail-view-primary > .field-edit,
.detail-view-secondary > .field-edit {
  justify-self: start;
}
.empty-field {
  color: #8a949c;
  font-style: italic;
}
.source-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.74rem;
}
.source-note a {
  color: inherit;
}
.source-note button {
  width: auto;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue-dark);
  font-size: inherit;
  font-weight: 560;
}
.cover-source-note {
  justify-content: center;
  margin-top: 0;
}
.review-source-note {
  margin-top: 0;
  font-size: 0.76rem;
}
.review-source-note button {
  min-height: 24px;
}
.review-cover-suggestion {
  width: max-content;
  max-width: 100%;
  display: grid;
  gap: 7px;
  padding: 14px 18px 12px;
  background: var(--surface-soft);
}

.review-cover-thumb {
  position: relative;
  width: 118px;
  aspect-ratio: 2 / 3;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: var(--surface-soft);
}

.review-cover-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.cover-thumb-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 5px;
}

.cover-thumb-actions .icon-button {
  width: 30px;
  min-width: 30px;
  flex-basis: 30px;
  height: 30px;
  min-height: 30px;
  background: rgba(255, 254, 251, 0.94);
  box-shadow: 0 8px 18px rgba(23, 33, 43, 0.14);
}

.quick-cover {
  display: grid;
  gap: 9px;
  color: var(--blue-dark);
  text-align: center;
}
.cover-preview-trigger {
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}
.cover-preview-trigger:focus-visible {
  outline: 3px solid rgba(25, 58, 162, 0.28);
  outline-offset: 4px;
}
.cover-upload-action {
  display: inline-grid;
  justify-self: center;
  color: var(--blue-dark);
  cursor: pointer;
}
.cover-actions {
  display: grid;
  justify-items: center;
  gap: 4px;
}
.cover-upload-action > span {
  font-size: 0.82rem;
  font-weight: 560;
}
.cover-upload-action input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}
.quick-hero-editor {
  width: min(620px, 100%);
}
.quick-editor {
  width: 100%;
  display: grid;
  gap: 9px;
}
.language-token-editor {
  display: grid;
  gap: 8px;
}
.language-entry-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 8px;
  align-items: start;
}
.language-input-wrap {
  position: relative;
  min-width: 0;
}
.language-input-wrap input {
  width: 100%;
}
.language-suggestions {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  z-index: 35;
  max-height: 190px;
  display: grid;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 36px rgba(23, 33, 43, 0.15);
}
.language-suggestions button {
  width: 100%;
  min-height: 36px;
  justify-content: flex-start;
  padding: 7px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 500;
  text-align: left;
}
.language-suggestions button:hover,
.language-suggestions button:focus {
  background: var(--blue-soft);
  color: var(--blue-dark);
}
.quick-editor-short {
  grid-template-columns: minmax(120px, 1fr) auto;
  align-items: start;
}
.quick-editor-short .field-error {
  grid-column: 1 / -1;
}
.quick-editor-short .quick-edit-actions {
  grid-column: 2;
  grid-row: 1;
}
.quick-editor-long textarea {
  width: 100%;
}
.quick-edit-actions {
  display: flex;
  justify-content: end;
  gap: 7px;
}
.quick-edit-actions button {
  min-height: 38px;
  padding: 0 12px;
}
.unsaved-edit-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 33, 43, 0.42);
}
.unsaved-edit-prompt {
  width: min(520px, 100%);
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(23, 33, 43, 0.22);
}
.unsaved-edit-prompt h2 {
  margin-top: 3px;
  font-size: 1.45rem;
  font-weight: 620;
}
.unsaved-edit-prompt > p:not(.eyebrow) {
  margin-top: 8px;
  color: var(--muted-strong);
  line-height: 1.5;
}
.unsaved-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}
.unsaved-edit-actions .text-button {
  width: auto;
  margin-right: auto;
}
.unsaved-edit-actions .danger-text {
  border-color: transparent;
  color: var(--coral);
}
.quick-edit-hint,
.field-error {
  color: var(--muted);
  font-size: 0.75rem;
}
.field-error {
  color: var(--coral);
}
.editable-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.editable-chip-list > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 3px 5px 3px 9px;
  border-radius: 999px;
  background: var(--marigold-soft);
  font-size: 0.8rem;
}
.editable-chip-list button {
  width: 22px;
  height: 22px;
  min-height: 22px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--coral);
}
.editable-chip-list button svg {
  width: 13px;
  height: 13px;
  display: block;
  fill: none;
  stroke: currentColor;
  pointer-events: none;
}
.quick-contributors {
  width: min(760px, 100%);
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.quick-contributor-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(120px, 170px) auto 38px;
  gap: 9px;
  align-items: center;
}
.quick-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  white-space: nowrap;
}
.quick-primary input {
  width: 17px;
  min-height: 17px;
  accent-color: var(--blue);
}
.quick-primary span {
  color: var(--muted-strong);
  font-size: 0.78rem;
}
.quick-add-person {
  justify-self: start;
}
.detail-heading h2 {
  max-width: 820px;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1.08;
}
.book-subtitle {
  color: var(--muted-strong);
  font-size: 1.15rem;
  line-height: 1.45;
}
.detail-by {
  margin-top: 8px;
  color: var(--ink);
  font-size: 1.08rem;
}
.other-contributors {
  color: var(--muted);
  line-height: 1.45;
}
.detail-status {
  width: min(260px, 100%);
  margin-top: 14px;
}
.detail-view-primary {
  width: min(780px, 100%);
  display: grid;
  gap: 12px;
  margin-top: 8px;
}
.detail-view-description {
  display: grid;
  gap: 8px;
}
.detail-fact-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.detail-fact-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.2;
}
.detail-fact-chip span {
  color: var(--muted);
}
.detail-notes-preview {
  display: grid;
  gap: 8px;
}
.detail-notes-preview p {
  max-width: 780px;
  color: var(--muted-strong);
  line-height: 1.58;
  white-space: pre-wrap;
}
.detail-view-secondary {
  display: grid;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.detail-edit-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
}
.detail-edit-sections .detail-section {
  border-bottom: 0;
}
.detail-status-field .detail-status {
  margin-top: 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.detail-section,
.edit-section {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}
.detail-section h3,
.edit-section h3 {
  margin-bottom: 14px;
}
.long-copy {
  max-width: 780px;
  white-space: pre-wrap;
  line-height: 1.65;
}
.detail-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.detail-overview .detail-section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.detail-summary-description {
  grid-column: 1 / -1;
}
.compact-description {
  max-width: none;
  line-height: 1.55;
}
.detail-compact-card h3 {
  margin-bottom: 8px;
}
.compact-detail-list .detail-field {
  grid-template-columns: minmax(110px, 0.34fr) minmax(0, 1fr);
  gap: 12px;
  padding: 7px 0;
  border-top: 1px solid rgba(221, 229, 234, 0.78);
}
.compact-detail-list .detail-field:first-child {
  border-top: 0;
}
.compact-detail-list .quick-editor {
  margin-top: 4px;
}
.detail-columns,
.edit-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
}
.detail-columns .detail-section,
.edit-columns .edit-section {
  border-bottom: 0;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}
.detail-list {
  display: grid;
  grid-template-columns: minmax(110px, 0.35fr) minmax(0, 1fr);
  gap: 12px 18px;
  margin: 0;
}
.field-detail-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.detail-field {
  display: grid;
  grid-template-columns: minmax(110px, 0.35fr) minmax(0, 1fr);
  gap: 18px;
  padding: 8px 0;
}
.detail-field dt {
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.detail-field dd {
  margin: 0;
}
.detail-list dt {
  color: var(--muted);
  font-size: 0.86rem;
}
.detail-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip-list span {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--marigold-soft);
  color: var(--ink);
  font-size: 0.8rem;
}
.detail-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0;
  color: var(--muted);
}
.edit-primary-fields {
  width: 100%;
  display: grid;
  gap: 14px;
}
.edit-book-main {
  width: 100%;
}
.edit-book-main .edit-primary-fields {
  max-width: 780px;
}
.edit-inline-section {
  width: 100%;
  display: grid;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.edit-inline-section h3 {
  margin: 0;
  font-size: 0.98rem;
}
.edit-description-section label {
  width: 100%;
}
.edit-description-section textarea {
  min-height: 142px;
  line-height: 1.55;
}
.cover-editor {
  display: grid;
  gap: 10px;
  color: var(--blue-dark);
  cursor: pointer;
  text-align: center;
}
.edit-cover-panel {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 6px;
}
.cover-editor > span:last-of-type {
  font-weight: 560;
}
.cover-editor input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}
.contributor-editor {
  display: grid;
  border-top: 1px solid var(--line);
}
.contributor-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(130px, 180px) auto 40px;
  gap: 12px;
  align-items: end;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.contributor-row label {
  margin: 0;
}
.primary-check {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.primary-check input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--blue);
}
.primary-check span {
  color: var(--muted-strong);
  font-size: 0.82rem;
}
.muted-copy {
  padding: 14px 0;
  color: var(--muted);
}
.enrich-toggle {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted-strong);
  font-size: 0.84rem;
  white-space: nowrap;
}
.enrich-toggle input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--blue);
}
.danger-zone {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 24px 0;
  color: var(--muted);
}
.danger-zone h3 { color: var(--ink); }
.danger-zone p { margin-top: 5px; }
.danger-button {
  background: var(--coral);
  border-color: var(--coral);
}
.sticky-save {
  display: none;
}

@media (max-width: 920px) {
  .product-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content-shell {
    width: 100%;
    padding: 12px 12px calc(84px + env(safe-area-inset-bottom));
  }
  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 25;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: -12px -12px 12px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(61, 50, 39, 0.1);
    background: rgba(255, 254, 251, 0.96);
    backdrop-filter: blur(14px);
  }
  .mobile-topbar .brand-lockup { flex: 1 1 auto; min-width: 0; }
  .mobile-topbar .brand-lockup > div:last-child { min-width: 0; }
  .mobile-topbar .brand-mark {
    width: 38px;
    height: 46px;
  }
  .mobile-topbar h1 {
    font-size: 1.02rem;
    font-weight: 600;
  }
  .mobile-topbar .brand-lockup p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.78rem;
  }
  .mobile-add-menu {
    position: relative;
    flex: 0 0 auto;
  }
  .mobile-add-trigger {
    width: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 50%;
    background: var(--blue-dark);
    border-color: var(--blue-dark);
    font-size: 1.55rem;
    font-weight: 450;
    line-height: 1;
  }
  .library-tools {
    top: 76px;
  }
  .mobile-add-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 30;
    width: min(236px, calc(100vw - 24px));
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 18px 44px rgba(23, 33, 43, 0.18);
  }
  .mobile-add-popover button {
    justify-content: center;
    width: 100%;
  }
  .mobile-tabs {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin: 0;
    padding: 8px 10px max(8px, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(61, 50, 39, 0.12);
    background: rgba(255, 254, 251, 0.97);
    box-shadow: 0 -12px 34px rgba(23, 33, 43, 0.12);
    backdrop-filter: blur(14px);
  }
  .mobile-tabs button {
    min-height: 50px;
    display: grid;
    place-items: center;
    gap: 2px;
    padding: 4px 2px;
    border-color: transparent;
    background: transparent;
    color: var(--blue-dark);
    font-size: 0.7rem;
    font-weight: 520;
  }
  .mobile-tabs button.active {
    background: var(--blue-dark);
    color: #fff;
  }
  .mobile-tabs span {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--blue-soft);
    color: var(--blue-dark);
    font-size: 0.72rem;
  }
  .mobile-tabs button.active span {
    background: var(--marigold);
    color: var(--ink);
  }
  .mobile-settings-signout {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    justify-content: flex-start;
    padding: 4px 0 12px;
  }
  .mobile-settings-signout .text-button {
    width: auto;
    min-height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--blue-dark);
    font-weight: 560;
  }
  .page-heading { align-items: start; flex-direction: column; }
  .legal-shell {
    padding: 18px 12px 28px;
  }
  .legal-page {
    gap: 12px;
  }
  .legal-page-header {
    align-items: start;
    flex-direction: column;
  }
  .legal-page-header h1 {
    font-size: clamp(1.9rem, 9vw, 2.6rem);
  }
  .legal-page-header button {
    width: 100%;
  }
  .legal-card {
    padding: 16px;
  }
  .legal-provider-links a {
    width: 100%;
    justify-content: center;
  }
  .page-heading h2 {
    font-size: clamp(1.7rem, 8vw, 2.55rem);
  }
  .heading-copy {
    font-size: 0.95rem;
  }
  .desktop-copy {
    display: none;
  }
  .desktop-only-card {
    display: none;
  }
  .mobile-copy {
    display: inline;
  }
  .add-mode-link {
    margin-top: 0;
  }
  .page-actions {
    justify-content: start;
  }
  .page-heading .todo-page-actions {
    display: none;
  }
  .page-heading .books-page-actions {
    display: none;
  }
  .library-layout, .upload-grid, .todo-grid { grid-template-columns: 1fr; }
  .desktop-upload-method-card {
    display: none;
  }
  .mobile-photo-drop-zone {
    display: grid;
  }
  .camera-source-action {
    display: inline-flex !important;
  }
  .photo-source-actions label:not(.camera-source-action) {
    border-color: var(--line-strong);
    background: var(--surface);
    color: var(--blue-dark);
  }
  .photo-source-actions .camera-source-action {
    border-color: var(--blue-dark);
    background: var(--blue-dark);
    color: #fff;
  }
  .desktop-selected-photo-list {
    display: none;
  }
  .mobile-selected-photo-list {
    display: grid;
  }
  .desktop-start-scan {
    display: none;
  }
  .mobile-start-scan-bar {
    position: sticky;
    bottom: calc(66px + env(safe-area-inset-bottom));
    z-index: 23;
    display: block;
    grid-column: 1 / -1;
    margin: 6px -12px -6px;
    padding: 10px 12px;
    border-top: 1px solid rgba(61, 50, 39, 0.12);
    background: rgba(255, 254, 251, 0.98);
    box-shadow: 0 -12px 28px rgba(23, 33, 43, 0.12);
  }
  .mobile-start-scan-bar button {
    width: 100%;
    min-height: 48px;
  }
  .phone-upload-shell {
    padding: 3px;
  }
  .phone-upload-card {
    min-height: calc(100vh - 6px);
    padding: 34px 28px;
    border-radius: 28px;
    box-shadow: none;
  }
  .phone-source-actions--initial {
    grid-template-columns: 1fr;
  }
  .phone-source-actions--secondary {
    grid-template-columns: 1fr 1fr;
  }
  .phone-upload-actions .phone-upload-primary {
    width: 100%;
  }
  .phone-upload-actions .text-button {
    width: auto;
  }
  .todo-switcher,
  .todo-card {
    align-items: stretch;
    flex-direction: column;
  }
  .todo-card {
    grid-template-columns: 76px minmax(0, 1fr);
  }
  .import-thumb {
    width: 76px;
    height: 76px;
  }
  .job-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .manual-todo-card {
    grid-template-columns: 1fr;
  }
  .mobile-sign-out {
    display: block;
  }
  .review-uploads-empty {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .upload-grid {
    grid-template-columns: 1fr;
  }
  .manual-sheet-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .manual-actions {
    justify-content: normal;
  }
  .manual-actions .enrich-toggle {
    margin-right: 0;
  }
  .detail-columns,
  .detail-overview,
  .detail-edit-sections,
  .edit-columns {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .advanced-filters {
    grid-template-columns: 1fr 1fr;
  }
  .detail-columns .detail-section,
  .detail-edit-sections .detail-section,
  .edit-columns .edit-section {
    border-bottom: 1px solid var(--line);
  }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .auth-shell { padding: 10px; }
  .auth-card { grid-template-columns: 1fr; padding: 20px; }
  .shelf-preview { min-height: 150px; order: -1; }
  .spine { width: 26px; height: 98px; }
  .spine.tall { height: 124px; }
  .inline-action, .split-fields { grid-template-columns: 1fr; }
  .book-row { grid-template-columns: auto minmax(0, 1fr); }
  .book-row-description { display: none; }
  .book-meta { grid-column: 1 / -1; justify-items: start; display: flex; flex-wrap: wrap; }
  .book-status-control {
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
  .book-status-trigger {
    max-width: 160px;
    min-height: 30px;
  }
  .book-status-menu__options {
    left: 0;
    right: auto;
  }
  .view-stack {
    gap: 14px;
  }
  .eyebrow {
    font-size: 0.68rem;
  }
  .page-heading {
    gap: 10px;
  }
  .page-heading h2 {
    font-size: clamp(1.58rem, 8vw, 2.15rem);
    line-height: 1.08;
  }
  .heading-copy {
    font-size: 0.9rem;
  }
  .add-mode-link {
    font-size: 0.82rem;
  }
  .page-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .stats-grid article {
    padding: 12px;
  }
  .stats-grid strong {
    margin-top: 4px;
    font-size: 1.72rem;
  }
  .dashboard-grid {
    display: block;
  }
  .dashboard-desktop-flow {
    display: none;
  }
  .dashboard-mobile-flow {
    display: grid;
    gap: 12px;
  }
  .dashboard-card {
    display: grid;
    gap: 12px;
    padding: 14px;
  }
  .dashboard-card--onboarding-hero {
    min-height: 0;
    padding: 22px;
    padding-top: 94px;
    border-radius: 14px;
  }
  .dashboard-card--onboarding-hero h3 {
    max-width: 100%;
    font-size: 1.72rem;
  }
  .dashboard-card--onboarding-hero .dashboard-card__copy {
    max-width: 100%;
  }
  .onboarding-hero-actions {
    display: flex;
    flex-wrap: wrap;
  }
  .onboarding-spines {
    top: 20px;
    right: 20px;
    width: 112px;
    height: 72px;
    gap: 6px;
    align-items: end;
  }
  .onboarding-spines span {
    width: 14px;
    border-radius: 5px 5px 3px 3px;
  }
  .onboarding-spines span:nth-child(1) { height: 44px; }
  .onboarding-spines span:nth-child(2) { height: 62px; }
  .onboarding-spines span:nth-child(3) { height: 52px; }
  .onboarding-spines span:nth-child(4) { height: 68px; }
  .onboarding-spines span:nth-child(5) { height: 48px; }
  .photo-guide-grid {
    grid-template-columns: 1fr;
  }
  .photo-guide-option {
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
  }
  .photo-guide-thumb {
    aspect-ratio: 1;
  }
  .dashboard-card--onboarding,
  .dashboard-card--onboarding-setup {
    border-radius: 12px;
  }
  .dashboard-card h3 {
    font-size: 1rem;
  }
  .dashboard-card__header,
  .dashboard-card .board-header {
    align-items: start;
  }
  .dashboard-card .board-header {
    display: grid;
    grid-template-columns: 1fr;
  }
  .dashboard-add-popover {
    position: static;
    margin-top: 8px;
    box-shadow: none;
  }
  .dashboard-latest-book {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .dashboard-latest-book .book-status-control {
    justify-self: start;
  }
  .dashboard-stat-list {
    grid-template-columns: 1fr 1fr;
  }
  .dashboard-stat-list button {
    min-height: 62px;
  }
  .book-board,
  .photo-workspace,
  .settings-layout,
  .sessions-layout {
    padding: 14px;
  }
  .ai-account-card__top,
  .ai-account-editor__header {
    align-items: stretch;
  }
  .ai-account-card__top {
    grid-template-columns: 1fr;
  }
  .ai-account-actions,
  .ai-account-order {
    margin-left: 0;
    width: auto;
  }
  .ai-account-actions {
    justify-content: flex-start;
  }
  .board-header {
    align-items: start;
    gap: 10px;
  }
  .board-header button {
    width: auto;
  }
  .book-row,
  .session-row {
    padding: 10px;
  }
  .cover-chip {
    width: 38px;
    height: 50px;
  }
  .library-tools {
    display: flex;
    top: 76px;
    z-index: 24;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: -14px -14px 14px;
    padding: 14px 14px 10px;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
  }
  .library-tools .search-field,
  .active-filter-chips {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .active-filter-chips {
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }
  .active-filter-chips--desktop {
    display: none;
  }
  .active-filter-chips--mobile {
    display: flex;
  }
  .active-filter-chips:empty {
    display: none;
  }
  .filter-chip {
    max-width: 82vw;
    flex: 0 0 auto;
  }
  .sort-menu,
  .sort-summary {
    justify-self: start;
  }
  .sort-menu {
    flex: 0 0 auto;
    align-self: center;
  }
  .sort-summary {
    min-height: 34px;
    padding: 0 2px;
    gap: 3px;
    font-size: 0.78rem;
  }
  .sort-summary__prefix {
    display: none;
  }
  .sort-summary__mobile-icon {
    display: block;
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
  }
  .sort-summary__mobile-icon {
    display: block;
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
  }
  .sort-summary__icon {
    width: 10px;
    height: 10px;
    flex-basis: 10px;
  }
  .sort-menu__options {
    left: 0;
    right: auto;
    width: min(260px, calc(100vw - 56px));
  }
  .book-filter-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 12px;
  }
  .library-tools > .book-filter-panel,
  .library-tools > .bulk-selection-bar {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
  }
  .filter-menu-field {
    width: 100%;
    flex-basis: auto;
  }
  .filter-menu-trigger {
    min-height: 38px;
  }
  .book-pagination {
    align-items: stretch;
    flex-direction: column;
  }
  .book-page-controls {
    justify-content: space-between;
  }
  .drop-zone {
    min-height: 190px;
  }
  .drop-zone.uploading,
  .drop-zone.processing {
    min-height: 165px;
  }
  .camera-mark {
    width: 58px;
    height: 58px;
    font-size: 2rem;
  }
  .upload-side-panel {
    padding: 12px;
  }
  .manual-sheet-toolbar {
    gap: 10px;
  }
  .manual-actions {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-content: normal;
    gap: 10px;
  }
  .manual-actions .enrich-toggle {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    min-height: 34px;
  }
  .manual-actions button {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    width: auto;
    min-width: 0;
    min-height: 40px;
    padding: 0 13px;
  }
  .advanced-filter-toggle {
    justify-self: start;
  }
  .library-filter-actions {
    flex: 1 1 auto;
    align-self: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 7px;
  }
  .library-action-separator {
    margin: 0 1px;
    font-size: 0.78rem;
  }
  .library-filter-actions .advanced-filter-toggle,
  .library-filter-actions .clear-filters {
    width: auto;
    min-height: 34px;
    padding: 0 3px;
    font-size: 0.78rem;
  }
  .advanced-filters {
    grid-template-columns: 1fr;
  }
  .bulk-selection-bar {
    position: static;
    bottom: auto;
    z-index: auto;
    margin: 0 0 12px;
    box-shadow: 0 14px 36px rgba(23, 33, 43, 0.16);
  }
  .bulk-selection-bar strong {
    flex-basis: 100%;
  }
  .bulk-action-select {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }
  .bulk-action-select select {
    width: 100%;
  }
  .book-open {
    grid-column: 1 / -1;
  }
  .book-row.selectable {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .book-row.selectable .book-open {
    grid-column: 2;
  }
  .book-row.selectable .book-row-description {
    display: none;
  }
  .book-row.selectable .book-meta {
    grid-column: 2;
  }
  .book-select-control {
    align-self: start;
    min-height: 50px;
  }
  .book-row .book-meta {
    padding-left: 54px;
  }
  .book-row.selectable .book-meta {
    padding-left: 0;
  }
  .bulk-action-backdrop {
    align-items: end;
    padding: 10px;
  }
  .bulk-action-dialog {
    width: 100%;
    max-height: min(82svh, 720px);
    overflow: auto;
  }
  .bulk-action-dialog__actions {
    position: sticky;
    bottom: -18px;
    margin: 4px -18px -18px;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--line);
  }
  .bulk-feedback {
    right: 12px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    width: calc(100vw - 24px);
  }
  .photo-preview-backdrop {
    padding: 10px;
  }
  .photo-preview-modal {
    max-height: 88svh;
  }
  .photo-preview-stage img {
    max-height: calc(88svh - 62px);
  }
  .preview-nav {
    width: 38px;
    height: 38px;
    min-height: 38px;
    font-size: 1.45rem;
  }
  .preview-nav.previous {
    left: 8px;
  }
  .preview-nav.next {
    right: 8px;
  }
  .book-detail-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .book-detail-toolbar > button,
  .book-detail-toolbar .page-actions button {
    width: 100%;
  }
  .editing .book-detail-toolbar .page-actions {
    display: none;
  }
  .book-detail-hero {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 18px;
    padding: 20px 0;
  }
  .edit-book-hero {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 20px 0;
  }
  .edit-book-hero .edit-cover-panel {
    justify-items: start;
  }
  .edit-book-hero .cover-editor {
    width: 112px;
    align-self: start;
    justify-self: start;
  }
  .detail-heading h2 {
    font-size: clamp(1.7rem, 9vw, 2.5rem);
  }
  .book-subtitle,
  .detail-by {
    font-size: 0.96rem;
  }
  .detail-status {
    grid-column: 1 / -1;
  }
  .detail-view-primary {
    width: 100%;
    gap: 10px;
  }
  .detail-view-secondary {
    gap: 12px;
    padding: 16px 0;
  }
  .detail-fact-chip {
    min-height: 28px;
    font-size: 0.78rem;
  }
  .contributor-row {
    grid-template-columns: minmax(0, 1fr) 44px;
  }
  .contributor-row > label:nth-child(1),
  .contributor-row > label:nth-child(2) {
    grid-column: 1 / -1;
  }
  .primary-check {
    grid-column: 1;
  }
  .contributor-row .icon-button {
    grid-column: 2;
    width: 40px;
    border-radius: 50%;
  }
  .detail-list {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .detail-field {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 10px 0;
  }
  .quick-editor-short {
    grid-template-columns: 1fr;
  }
  .quick-editor-short .quick-edit-actions {
    grid-column: 1;
    grid-row: auto;
  }
  .quick-contributor-row {
    grid-template-columns: 1fr 42px;
  }
  .quick-contributor-row > input,
  .quick-contributor-row > select {
    grid-column: 1 / -1;
  }
  .quick-primary {
    grid-column: 1;
  }
  .token-editor,
  .quick-contributors {
    position: fixed;
    z-index: 20;
    right: 0;
    bottom: 0;
    left: 0;
    max-height: min(72svh, 620px);
    overflow-y: auto;
    padding: 20px 14px max(16px, env(safe-area-inset-bottom));
    border: 1px solid var(--line);
    border-radius: 8px 8px 0 0;
    background: var(--surface);
    box-shadow: 0 -16px 36px rgba(23, 33, 43, 0.18);
  }
  .unsaved-edit-backdrop {
    place-items: end center;
    padding: 0;
  }
  .unsaved-edit-prompt {
    width: 100%;
    padding: 20px 14px max(16px, env(safe-area-inset-bottom));
    border-radius: 8px 8px 0 0;
  }
  .unsaved-edit-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .unsaved-edit-actions .text-button {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    margin: 0;
  }
  .detail-list dd {
    margin-bottom: 12px;
  }
  .detail-empty,
  .danger-zone {
    align-items: stretch;
    flex-direction: column;
  }
  .sticky-save {
    position: fixed;
    z-index: 10;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px 12px max(10px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 254, 251, 0.96);
    box-shadow: 0 -10px 28px var(--shadow);
    backdrop-filter: blur(12px);
  }
}


.review-list {
  display: grid;
  gap: 18px;
}

.review-card {
  display: grid;
  gap: 16px;
  padding: 20px 22px 22px;
  border: 1px solid rgba(61, 50, 39, 0.12);
  border-radius: 8px;
  background: rgba(255, 254, 251, 0.96);
  box-shadow: 0 14px 40px var(--shadow);
}

.review-card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}
.manual-sheet-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.row-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}
.manual-actions {
  flex: 0 1 auto;
  width: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.manual-actions .enrich-toggle {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  margin-right: 0;
}
.manual-actions button {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
}
.review-card-top > .group-actions:only-child {
  margin-left: auto;
}

.review-card-footer {
  display: flex;
  justify-content: flex-start;
  padding-top: 2px;
}

.sheet-footer {
  display: flex;
  justify-content: flex-start;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.review-body {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.manual-review-body {
  grid-template-columns: minmax(0, 1fr);
}

.manual-review-card .sheet-header,
.manual-review-card .sheet-row {
  grid-template-columns: minmax(220px, 1.45fr) minmax(180px, 1fr) minmax(82px, 120px) 188px;
}

.manual-review-card .sheet-panel {
  width: 100%;
}

.review-photo {
  margin: 0;
  width: 100%;
  position: sticky;
  top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-soft);
}

.review-photo img {
  display: block;
  width: 100%;
  height: min(270px, 34vw);
  max-height: 270px;
  object-fit: contain;
}

.review-photo-preview {
  right: 8px;
  bottom: 8px;
}

.mobile-scan-preview {
  display: none;
}

.group-actions,
.row-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 8px;
  flex-wrap: wrap;
}
.sheet-row .row-actions {
  flex-wrap: nowrap;
  justify-content: end;
  gap: 6px;
  min-width: 0;
}

.sheet-panel {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.sheet-header,
.sheet-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) minmax(118px, 0.8fr) minmax(72px, 86px) 156px;
  gap: 10px;
  align-items: center;
}

.sheet-header {
  padding: 10px 14px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 680;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}

.sheet-row {
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid #edf1f3;
  border-radius: 0;
  background: var(--surface);
}

.sheet-row:last-child {
  border-bottom: 0;
}

.sheet-row label,
.mobile-summary {
  display: none;
}

.sheet-cell {
  min-width: 0;
  position: relative;
}

.cell-value {
  width: 100%;
  min-height: 36px;
  display: block;
  padding: 7px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-value:hover,
.cell-value:focus {
  color: var(--blue-dark);
  box-shadow: inset 0 -2px 0 var(--blue-bright);
}

.role-value {
  color: var(--muted);
  font-size: 0.9rem;
}

.possible-duplicate-badge {
  width: fit-content;
  min-height: 0;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  padding: 3px 7px;
  border: 1px solid #f0d687;
  border-radius: 999px;
  background: #fff3cd;
  color: #6b4b00;
  font-size: 0.72rem;
  font-weight: 560;
  line-height: 1;
  vertical-align: middle;
  cursor: pointer;
}

.possible-duplicate-badge:hover,
.possible-duplicate-badge:focus {
  background: #ffedb0;
  box-shadow: 0 0 0 3px rgba(240, 214, 135, 0.34);
}

.duplicate-review-modal {
  width: min(840px, calc(100vw - 40px));
  max-height: min(760px, calc(100vh - 40px));
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 28px 72px rgba(12, 24, 44, 0.34);
  overflow: hidden;
}

.duplicate-review-bar {
  flex: 0 0 auto;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.duplicate-review-bar h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 560;
}

.duplicate-review-bar p {
  max-width: 56ch;
  margin: 3px 0 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.duplicate-review-body {
  display: grid;
  gap: 16px;
  padding: 18px;
  overflow-x: hidden;
  overflow-y: auto;
}

.duplicate-review-intro,
.duplicate-merge-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.duplicate-review-intro strong,
.duplicate-merge-panel strong {
  font-weight: 560;
}

.duplicate-review-intro p,
.duplicate-merge-panel p {
  margin: 3px 0 0;
  color: var(--muted);
}

.duplicate-review-list {
  display: grid;
  gap: 10px;
}

.duplicate-book-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.duplicate-book-card.selected {
  border-color: var(--blue-bright);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.duplicate-current-card {
  border-color: #efd081;
  background: linear-gradient(0deg, rgba(255, 184, 48, 0.08), rgba(255, 184, 48, 0.08)), var(--surface);
}

.duplicate-book-summary {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content max-content;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}

.duplicate-book-select {
  min-width: 0;
  min-height: 52px;
  display: grid;
  grid-template-columns: 18px 48px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.duplicate-book-select:hover,
.duplicate-book-select:focus {
  background: var(--surface-soft);
  box-shadow: none;
}

.duplicate-select-mark {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
}

.duplicate-book-card.selected .duplicate-select-mark {
  border-color: var(--blue-dark);
}

.duplicate-book-card.selected .duplicate-select-mark::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue-dark);
}

.duplicate-book-cover {
  width: 48px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--blue-dark);
  color: #fff;
  font-weight: 560;
  overflow: hidden;
}

.duplicate-book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.duplicate-current-cover {
  background: var(--amber);
  color: var(--blue-dark);
}

.duplicate-book-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.duplicate-card-kind {
  width: max-content;
  max-width: 100%;
  color: var(--coral);
  font-size: 0.68rem;
  font-weight: 620;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.duplicate-book-text strong,
.duplicate-book-text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.duplicate-book-text strong {
  color: var(--blue-dark);
  font-weight: 560;
}

.duplicate-book-text small {
  color: var(--muted);
  font-size: 0.86rem;
}

.duplicate-card-meta {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 3px 12px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.25;
  overflow: visible;
}

.duplicate-card-meta span {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.duplicate-card-meta span:first-child {
  color: var(--muted);
  font-weight: 500;
}

.duplicate-card-intent {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 560;
  white-space: nowrap;
}

.duplicate-card-intent.keep {
  border: 1px solid #efd081;
  background: #fff8e6;
  color: #6b4b00;
}

.duplicate-card-intent.merge {
  border: 1px solid var(--line);
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.duplicate-details-toggle {
  width: auto;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue-dark);
  font-size: 0.86rem;
  font-weight: 560;
}

.duplicate-details-toggle:hover,
.duplicate-details-toggle:focus {
  color: var(--blue-bright);
  text-decoration: underline;
  box-shadow: none;
}

.duplicate-book-details {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.duplicate-book-readonly {
  grid-template-columns: minmax(74px, 104px) minmax(0, 1fr);
  gap: 18px;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.duplicate-book-readonly .detail-cover {
  box-shadow: inset -8px 0 rgba(0, 0, 0, 0.1), 0 10px 22px rgba(23, 33, 43, 0.12);
}

.duplicate-book-readonly .detail-cover > span {
  font-size: clamp(2rem, 5vw, 3.3rem);
}

.duplicate-book-readonly .detail-heading {
  gap: 7px;
  padding-top: 0;
}

.duplicate-book-readonly h2 {
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.12;
  font-weight: 560;
}

.duplicate-book-readonly .book-subtitle {
  font-size: 1rem;
}

.duplicate-book-readonly .detail-by {
  margin-top: 0;
  font-size: 0.98rem;
}

.duplicate-book-readonly .detail-view-primary {
  width: 100%;
  gap: 10px;
  margin-top: 4px;
}

.duplicate-book-readonly .section-heading h3 {
  font-size: 0.9rem;
}

.duplicate-book-readonly .compact-description {
  max-height: 9.5rem;
  overflow: auto;
}

.duplicate-readonly-secondary {
  grid-column: 1 / -1;
  padding-top: 2px;
}

.duplicate-book-empty {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.duplicate-merge-panel {
  display: grid;
  grid-template-columns: minmax(200px, 0.85fr) minmax(240px, 1fr) max-content;
  align-items: center;
  gap: 12px 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.duplicate-merge-panel > div:first-child strong {
  white-space: nowrap;
}

.duplicate-merge-panel > div:first-child {
  min-width: 0;
}

.duplicate-merge-panel > div:first-child p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.merge-preference-wrap {
  grid-column: 2;
  display: grid;
  gap: 6px;
  min-width: 0;
  align-self: center;
}

.merge-preference-radio {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  align-items: center;
  color: var(--muted-strong);
  font-size: 0.86rem;
}

.merge-preference-option {
  position: relative;
  display: grid;
  min-width: 0;
}

.merge-preference-option-top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
}

.merge-preference-radio label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  cursor: pointer;
  min-width: 0;
}

.merge-preference-radio label span {
  white-space: nowrap;
}

.merge-preference-radio input[type="radio"] {
  width: 15px;
  min-width: 15px;
  height: 15px;
  min-height: 15px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  accent-color: var(--blue-dark);
}

.merge-info-icon {
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
}

.merge-info-icon:hover,
.merge-info-icon:focus {
  color: var(--blue-dark);
  background: var(--blue-soft);
  box-shadow: none;
}

.merge-info-text {
  position: absolute;
  left: 22px;
  top: auto;
  bottom: calc(100% + 5px);
  z-index: 5;
  width: min(280px, 72vw);
  max-width: 38ch;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(23, 33, 43, 0.14);
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.merge-preference-error {
  margin: 0;
  font-size: 0.78rem;
}

.duplicate-review-actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.duplicate-review-actions button {
  min-width: 116px;
  white-space: nowrap;
}

@media (min-width: 641px) {
  .sheet-cell.title-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }

  .sheet-cell.title-cell .cell-value {
    width: auto;
    max-width: 100%;
  }
}

.details-button {
  min-height: 36px;
  padding: 0 10px;
}

.cell-editor,
.role-editor {
  width: 100%;
  min-height: 38px;
  padding: 6px 8px;
  border-radius: 5px;
  border: 2px solid var(--blue-bright);
  background: var(--surface);
}

.role-editor {
  color: var(--muted-strong);
  font-size: 0.9rem;
}
.cell-save-state {
  position: absolute;
  right: 4px;
  top: 50%;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  pointer-events: none;
}

.cell-save-dot {
  width: 14px;
  height: 14px;
  display: block;
  border-radius: 999px;
}

.cell-save-state.saving .cell-save-dot {
  border: 2px solid rgba(10, 29, 86, 0.18);
  border-top-color: var(--blue-dark);
  animation: cell-save-spin 0.75s linear infinite;
}

.cell-save-state.saved .cell-save-dot {
  background: var(--blue-dark);
  animation: cell-save-pop 0.22s ease-out;
}

.cell-save-state.saved .cell-save-dot::after {
  content: "";
  width: 7px;
  height: 4px;
  display: block;
  margin: 4px 0 0 3px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
}

.cell-save-state.error .cell-save-dot {
  background: var(--coral);
}

@keyframes cell-save-spin {
  to { transform: rotate(360deg); }
}

@keyframes cell-save-pop {
  from { opacity: 0; transform: scale(0.75); }
  to { opacity: 1; transform: scale(1); }
}

.manual-row {
  background: var(--surface-soft);
}

.manual-sheet-panel {
  min-height: 220px;
}

.icon-button {
  width: 36px;
  min-width: 36px;
  flex: 0 0 36px;
  height: 36px;
  min-height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted-strong);
  border-color: var(--line);
  font-size: 0;
  line-height: 0;
}
.icon-button svg {
  width: 17px;
  height: 17px;
  display: block;
  fill: none;
  stroke: currentColor;
  pointer-events: none;
}

.icon-button:hover,
.icon-button:focus {
  background: var(--coral-soft);
  border-color: #f4c7bd;
  color: var(--coral);
}

.icon-button.danger {
  color: var(--coral);
}
.icon-button.success {
  color: var(--blue-dark);
}
.icon-button.success:hover,
.icon-button.success:focus {
  background: #edf7f4;
  border-color: #b9d7cf;
  color: var(--blue-dark);
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-empty {
  background: var(--surface);
}

input:disabled,
select:disabled {
  color: var(--muted);
  background: #f2f4f5;
}

@media (max-width: 640px) {
  .review-card-top,
  .page-actions,
  .review-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .page-actions button {
    width: 100%;
  }
  .review-actions button {
    width: 100%;
  }
  .review-fields {
    grid-template-columns: 1fr;
  }
  .review-body {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .group-actions,
  .row-actions {
    justify-content: stretch;
  }
  .group-actions button,
  .row-actions button {
    flex: 1 1 120px;
  }
  .group-actions.manual-actions {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
    justify-content: normal;
    align-items: center;
  }
  .group-actions.manual-actions button {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    padding-inline: 13px;
  }
  .group-actions.manual-actions .enrich-toggle {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    flex: 0 1 auto;
    min-width: 0;
    white-space: nowrap;
  }
  .sheet-header {
    display: none;
  }
  .sheet-row {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 10px;
    padding: 14px;
  }
  .manual-review-card .sheet-row {
    grid-template-columns: 1fr;
  }
  .sheet-row .row-actions {
    width: 100%;
    justify-content: stretch;
    flex-wrap: nowrap;
  }
  .sheet-row .row-actions .details-button {
    flex: 1 1 auto;
    min-width: 0;
  }
  .sheet-row .row-actions .icon-button {
    flex: 0 0 40px;
  }
  .sheet-row label {
    display: block;
  }
  .sheet-row:not(.expanded) {
    cursor: pointer;
  }
  .sheet-row:not(.expanded) .by-cell,
  .sheet-row:not(.expanded) .role-cell {
    display: none;
  }
  .sheet-row:not(.expanded) label {
    display: none;
  }
  .sheet-row:not(.expanded) .mobile-summary {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .cell-value {
    min-height: 34px;
    padding: 4px 0;
  }
  .sheet-row.expanded .cell-save-state {
    top: auto;
    bottom: 10px;
    transform: none;
  }
  .review-photo img {
    height: auto;
    max-height: 210px;
  }
  .review-photo {
    display: none;
  }
  .mobile-scan-preview {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 64px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--blue-dark);
    text-align: left;
    font-weight: 560;
  }
  .mobile-scan-preview img {
    width: 52px;
    height: 48px;
    border-radius: 7px;
    object-fit: cover;
  }
  .mobile-scan-preview small {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 520;
  }
  .review-card {
    gap: 12px;
    padding: 14px;
  }
  .review-card-top {
    gap: 8px;
  }
  .review-card-top > .group-actions:only-child {
    width: 100%;
  }
  .review-card-top .autosave-note {
    display: none;
  }
  .review-card-top .group-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .review-card-top .group-actions button {
    width: 100%;
  }
  .todo-card {
    gap: 10px;
    padding: 12px;
  }
  .import-job-copy h3 {
    font-size: 0.94rem;
  }
  .scan-name {
    font-size: 0.78rem;
  }
  .job-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .job-actions button,
  .job-actions .text-button {
    width: 100%;
  }
  .review-uploads-empty {
    min-height: 180px;
    padding: 22px 0;
  }
  .review-uploads-empty button {
    width: 100%;
  }
  .upload-grid {
    grid-template-columns: 1fr;
  }
  .drop-zone {
    min-height: 230px;
    padding: 18px;
  }
  .photo-source-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }
  .photo-source-actions label {
    width: 100%;
    min-height: 46px;
  }
  .selected-photo-list {
    padding: 10px;
  }
  .mobile-review-details-screen {
    min-height: calc(100svh - 168px);
    padding-bottom: 104px;
  }
  .mobile-review-details-top {
    position: sticky;
    top: 67px;
    z-index: 12;
    margin: -2px -12px 2px;
    padding: 12px;
    border-bottom: 1px solid rgba(61, 50, 39, 0.1);
    background: rgba(255, 254, 251, 0.96);
    backdrop-filter: blur(14px);
  }
  .mobile-review-details-top .text-button {
    min-height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 0.86rem;
  }
  .mobile-review-details-top .eyebrow {
    margin-bottom: 4px;
  }
  .mobile-review-details-top h2 {
    display: -webkit-box;
    max-width: none;
    overflow: hidden;
    font-size: clamp(1.35rem, 8vw, 2rem);
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .mobile-review-details-grid {
    gap: 10px;
  }
  .mobile-review-details-screen .review-details-suggestions {
    display: grid;
    gap: 10px;
    padding: 0;
    border: 0;
    background: transparent;
    overflow: visible;
  }
  .confirm-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .possible-duplicate-badge {
    margin-top: 6px;
  }
  .duplicate-review-backdrop {
    z-index: 58;
    place-items: stretch;
    padding: 0;
    background: var(--surface);
  }
  .duplicate-review-modal {
    width: 100%;
    max-height: none;
    min-height: 100svh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .duplicate-review-bar {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 14px 14px;
  }
  .duplicate-review-bar h3 {
    font-size: 1rem;
  }
  .duplicate-review-body {
    gap: 14px;
    padding: 14px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
  .duplicate-review-intro,
  .duplicate-merge-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .duplicate-review-intro .quiet,
  .duplicate-review-actions button {
    width: 100%;
  }
  .duplicate-book-summary {
    min-height: 70px;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }
  .duplicate-book-select {
    grid-template-columns: 18px 44px minmax(0, 1fr);
    gap: 10px;
  }
  .duplicate-book-cover {
    width: 44px;
    height: 56px;
  }
  .duplicate-details-toggle {
    grid-column: 1;
    justify-self: start;
    font-size: 0.8rem;
    margin-left: 72px;
  }
  .duplicate-card-intent {
    justify-self: start;
    margin-left: 72px;
    font-size: 0.74rem;
  }
  .duplicate-card-meta {
    gap: 7px;
    font-size: 0.72rem;
  }
  .duplicate-book-details {
    padding: 0 10px 10px;
  }
  .duplicate-book-readonly {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    padding-top: 12px;
  }
  .duplicate-book-readonly h2 {
    font-size: 1.18rem;
  }
  .duplicate-book-readonly .book-subtitle,
  .duplicate-book-readonly .detail-by {
    font-size: 0.9rem;
  }
  .duplicate-book-readonly .detail-view-primary {
    grid-column: 1 / -1;
  }
  .duplicate-readonly-secondary {
    padding-top: 0;
  }
  .merge-preference-radio {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .merge-preference-wrap,
  .duplicate-review-actions {
    grid-column: auto;
  }
  .duplicate-review-actions {
    justify-self: stretch;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .merge-info-text {
    max-width: none;
  }
  .mobile-review-details-screen .review-cover-suggestion {
    padding: 0;
  }
  .mobile-review-details-screen .review-cover-thumb {
    width: 96px;
  }
  .mobile-review-details-grid .review-detail-field {
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 10px 26px rgba(23, 33, 43, 0.05);
  }
  .mobile-review-details-grid .review-detail-field.wide {
    grid-column: auto;
  }
  .mobile-review-details-grid .review-detail-field > span {
    min-height: auto;
    font-size: 0.74rem;
  }
  .mobile-review-details-grid .review-detail-field textarea {
    min-height: 132px;
  }
  .mobile-review-details-grid .review-contributors-field {
    padding: 12px;
  }
  .mobile-review-details-grid .review-contributor-row {
    grid-template-columns: minmax(0, 1fr) 112px 36px;
    gap: 6px;
  }
  .mobile-review-details-actions {
    position: fixed;
    right: 0;
    bottom: calc(66px + env(safe-area-inset-bottom));
    left: 0;
    z-index: 22;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid rgba(61, 50, 39, 0.12);
    background: rgba(255, 254, 251, 0.98);
    box-shadow: 0 -10px 28px rgba(23, 33, 43, 0.12);
  }
  .mobile-review-details-actions button {
    min-height: 46px;
    padding: 0 10px;
  }
  .row-actions .icon-button {
    width: 40px;
    min-width: 40px;
    flex: 0 0 40px;
    border-radius: 50%;
  }
  .row-actions .details-button {
    flex: 1 1 auto;
  }
  .settings-group-heading {
    align-items: start;
    gap: 12px;
    margin-top: 14px;
  }
  .settings-group-heading > button {
    width: 100%;
  }
  .settings-group-heading .heading-edit-action {
    width: auto;
  }
  .settings-add-account {
    width: 100%;
  }
  .budget-summary {
    grid-template-columns: 1fr;
  }
  .settings-form-actions,
  .settings-inline-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .settings-form-actions button,
  .settings-inline-actions button {
    width: 100%;
  }
  .ai-account-card__top {
    gap: 10px;
  }
}

@media (max-width: 340px) {
  .manual-actions,
  .group-actions.manual-actions {
    grid-template-columns: 1fr;
    justify-items: start;
  }
  .manual-actions button {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    width: auto;
    flex-basis: auto;
  }
  .manual-actions .enrich-toggle {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    width: auto;
    flex-basis: auto;
    justify-content: flex-start;
  }
}






