/* BookScanner — clean flight-search style */
:root {
  --navy: #05203c;
  --navy-2: #0b3157;
  --blue: #0062e3;
  --blue-hover: #024daf;
  --blue-soft: #e3f0ff;
  --bg: #eff3f8;
  --surface: #ffffff;
  --line: #dde3ea;
  --line-strong: #c2c9cd;
  --text: #161616;
  --muted: #545860;
  --subtle: #68697f;
  --green: #0c838a;
  --green-soft: #e1f6f4;
  --red: #c91e3e;
  --red-soft: #fdecef;
  --amber-soft: #fff5e0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(37, 32, 31, 0.12);
  --shadow-hover: 0 4px 14px rgba(37, 32, 31, 0.16);
  --max: 1120px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Noto Sans TC",
    -apple-system,
    BlinkMacSystemFont,
    "PingFang TC",
    "Microsoft JhengHei",
    "Segoe UI",
    sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

:focus-visible {
  outline: 3px solid #84baff;
  outline-offset: 2px;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.25;
}

p {
  margin: 0;
}

.eyebrow {
  color: var(--subtle);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
}

/* ---------- Top bar ---------- */
.topbar {
  background: var(--navy);
  color: #fff;
}

.topbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-mark {
  width: 26px;
  height: 26px;
  fill: #fff;
}

.brand-zh {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  padding-left: 8px;
}

.topnav {
  display: flex;
  gap: 4px;
  flex: 1;
}

.topnav a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.92);
}

.topnav a:hover {
  background: rgba(255, 255, 255, 0.1);
}

.topnav a.active {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

.auth-area {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.user-email {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-button {
  background: var(--blue);
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-weight: 700;
  font-size: 14px;
}

.auth-button:hover {
  background: var(--blue-hover);
}

.auth-button.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.auth-button.ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ---------- Hero / search ---------- */
.hero {
  background: var(--navy);
  color: #fff;
  padding: 40px 24px 56px;
}

.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 900;
  letter-spacing: -0.01em;
  max-width: 760px;
}

.hero-copy {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
}

.search-form {
  margin-top: 28px;
}

.search-card {
  display: flex;
  gap: 4px;
  background: var(--navy-2);
  padding: 4px;
  border-radius: 14px;
}

.search-field {
  flex: 1;
  background: #fff;
  border-radius: 10px 4px 4px 10px;
  padding: 10px 18px 8px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.search-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.search-field input {
  border: 0;
  outline: none;
  font-size: 18px;
  padding: 2px 0 4px;
  color: var(--text);
  background: transparent;
  width: 100%;
}

.search-field input::placeholder {
  color: #9ba3ad;
}

.search-field:focus-within {
  box-shadow: inset 0 0 0 2px var(--blue);
}

#search-button {
  background: var(--blue);
  color: #fff;
  border: 0;
  border-radius: 4px 10px 10px 4px;
  padding: 0 40px;
  font-size: 18px;
  font-weight: 700;
}

#search-button:hover {
  background: var(--blue-hover);
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

.quick-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  margin-right: 4px;
}

.quick-actions button {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
}

.quick-actions button:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.6);
}

/* ---------- Layout ---------- */
.app-shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px 48px;
}

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-top: 32px;
}

.section-head {
  margin-bottom: 16px;
}

.section-head h2,
.status-bar h2 {
  font-size: 22px;
  font-weight: 700;
}

/* ---------- Store strip ---------- */
.store-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: -28px;
  position: relative;
  overflow: hidden;
}

.store-item {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 1px solid var(--line);
}

.store-item:first-child {
  border-left: 0;
}

.store-item strong {
  font-size: 15px;
}

.store-item span {
  font-size: 13px;
  color: var(--subtle);
}

/* ---------- Results ---------- */
.content-area {
  margin-top: 32px;
}

.status-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.result-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.result-count {
  color: var(--subtle);
  font-size: 14px;
  margin-top: 2px;
}

.sort-tabs {
  display: flex;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.sort-tabs button {
  background: transparent;
  border: 0;
  border-left: 1px solid var(--line);
  padding: 10px 20px;
  text-align: left;
  display: flex;
  flex-direction: column;
  min-width: 108px;
  position: relative;
  color: var(--text);
}

.sort-tabs button:first-child {
  border-left: 0;
}

.sort-tabs button strong {
  font-size: 14px;
}

.sort-tabs button span {
  font-size: 12px;
  color: var(--subtle);
}

.sort-tabs button:hover {
  background: #f5f7fa;
}

.sort-tabs button[aria-pressed="true"] {
  background: var(--navy);
  color: #fff;
}

.sort-tabs button[aria-pressed="true"] span {
  color: rgba(255, 255, 255, 0.75);
}

.message {
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--blue);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
}

.results-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.book-card {
  display: grid;
  grid-template-columns: 1fr 240px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: box-shadow 0.15s ease;
  overflow: hidden;
}

.book-card:hover {
  box-shadow: var(--shadow-hover);
}

.card-main {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 18px;
  padding: 18px 20px;
  min-width: 0;
}

.cover-wrap,
.wishlist-cover-wrap {
  position: relative;
  width: 88px;
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: #e8edf3;
  flex-shrink: 0;
}

.book-cover,
.wishlist-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.book-cover:not([src]) {
  display: none;
}

.cover-fallback,
.modal-cover-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--subtle);
  text-align: center;
  padding: 6px;
  background: linear-gradient(160deg, #e8edf3, #d6dee8);
}

.book-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.source-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--subtle);
  text-transform: uppercase;
}

.book-main h3 {
  font-size: 17px;
  font-weight: 700;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.authors {
  color: var(--muted);
  font-size: 14px;
  margin-top: 2px;
}

.book-card .description,
.book-card .offer-table-slot,
.book-card .service-statuses-slot {
  display: none;
}

.metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0;
  font-size: 12px;
  color: var(--subtle);
}

.metadata div {
  display: flex;
  gap: 4px;
}

.metadata dt {
  font-weight: 500;
}

.metadata dd {
  margin: 0;
  color: var(--muted);
}

.categories,
.modal-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.categories:empty,
.modal-categories:empty {
  display: none;
}

.categories span,
.modal-categories span {
  font-size: 12px;
  background: #f1f4f8;
  color: var(--muted);
  border-radius: 4px;
  padding: 2px 8px;
}

/* Offer comparison rows */
.offer-table {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: 4px;
}

.offer-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 7px 12px;
  font-size: 13px;
  text-decoration: none;
  border-top: 1px solid var(--line);
}

.offer-row:first-child {
  border-top: 0;
}

.offer-head {
  background: #f7f9fb;
  font-size: 12px;
  color: var(--subtle);
  font-weight: 500;
}

a.offer-row:hover {
  background: #f5f8fc;
}

a.offer-row span:first-child {
  font-weight: 700;
}

a.offer-row span:nth-child(2) {
  color: var(--subtle);
}

a.offer-row span:last-child {
  font-weight: 700;
  text-align: right;
}

.offer-row.best {
  background: var(--green-soft);
}

.offer-row.best span:last-child {
  color: var(--green);
}

/* Price panel (right side of a card) */
.price-panel {
  border-left: 1px solid var(--line);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  background: #fff;
}

.best-deal {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  margin-top: auto;
}

.best-deal span {
  font-size: 12px;
  color: var(--subtle);
}

.best-deal strong {
  font-size: 26px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.best-deal em {
  font-style: normal;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.best-deal-cta {
  display: block;
  background: var(--blue);
  color: #fff;
  text-align: center;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-weight: 700;
  font-size: 15px;
}

.best-deal:hover .best-deal-cta {
  background: var(--blue-hover);
}

.price-empty {
  display: none;
  margin-top: auto;
  font-size: 13px;
  color: var(--subtle);
}

.best-deal[hidden] + .price-empty {
  display: block;
}

.card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.save-button,
.detail-button,
.ghost-button {
  background: #fff;
  color: var(--blue);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 700;
}

.save-button:hover,
.detail-button:hover,
.ghost-button:hover:not(:disabled) {
  background: var(--blue-soft);
  border-color: var(--blue);
}

.save-button.saved {
  color: var(--red);
  border-color: #f2b8c3;
  background: var(--red-soft);
}

.primary-button {
  background: var(--blue);
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 700;
}

.primary-button:hover:not(:disabled) {
  background: var(--blue-hover);
}

.buy-links,
.modal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.buy-links a,
.modal-links a {
  font-size: 12px;
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
}

.buy-links a:hover,
.modal-links a:hover {
  text-decoration: underline;
}

.service-statuses {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.service-status {
  font-size: 13px;
  color: var(--muted);
  padding-left: 14px;
  position: relative;
}

.service-status::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}

.service-status.available::before {
  background: var(--green);
}

.service-status.error::before {
  background: var(--red);
}

.service-status.link_only::before {
  background: #f5a623;
}

/* ---------- Book modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 32, 60, 0.55);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 50;
}

.book-modal {
  position: relative;
  background: #fff;
  border-radius: 16px;
  width: min(820px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 28px;
  box-shadow: 0 24px 60px rgba(5, 32, 60, 0.35);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: #f1f4f8;
  font-size: 22px;
  line-height: 1;
  color: var(--text);
}

.modal-close:hover {
  background: #e3e8ee;
}

.modal-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 28px;
}

.modal-cover-wrap {
  position: relative;
  width: 160px;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: #e8edf3;
}

.modal-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-cover:not([src]) {
  display: none;
}

.modal-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.modal-source {
  font-size: 12px;
  font-weight: 700;
  color: var(--subtle);
  text-transform: uppercase;
}

.modal-content h2 {
  font-size: 24px;
  padding-right: 40px;
}

.modal-authors {
  color: var(--muted);
}

.modal-save .save-button {
  width: 100%;
}

.modal-metadata {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 16px;
  margin: 0;
  padding: 14px;
  background: #f7f9fb;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.modal-metadata dt {
  color: var(--subtle);
  font-size: 12px;
}

.modal-metadata dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.modal-description-block h3 {
  font-size: 15px;
  margin-bottom: 6px;
}

.modal-description {
  color: var(--muted);
  font-size: 14px;
  white-space: pre-line;
}

/* ---------- Wishlist ---------- */
.wishlist-area .status-bar {
  align-items: flex-start;
}

.wishlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.wishlist-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.wishlist-cover-wrap {
  width: 72px;
}

.wishlist-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.wishlist-body h3 {
  font-size: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wishlist-best {
  font-size: 13px;
  color: var(--subtle);
  margin-top: 4px;
}

.wishlist-best a {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  text-decoration: none;
}

.wishlist-best a span {
  font-size: 12px;
  color: var(--subtle);
}

.wishlist-best strong {
  font-size: 20px;
  font-weight: 900;
  color: var(--text);
}

.wishlist-best em {
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
}

.wishlist-checked {
  font-size: 12px;
  color: var(--subtle);
}

.wishlist-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.wishlist-actions button {
  padding: 6px 12px;
  font-size: 13px;
}

/* ---------- Kobo library tool ---------- */
.library-panel {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.library-copy {
  color: var(--muted);
  font-size: 14px;
  max-width: 560px;
  margin-bottom: 12px;
}

.file-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-weight: 700;
  font-size: 14px;
  color: var(--blue);
  cursor: pointer;
}

.file-picker:hover {
  background: var(--blue-soft);
  border-color: var(--blue);
}

.file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.file-name {
  margin-top: 6px;
  font-size: 13px;
  color: var(--subtle);
}

.library-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.library-table-wrap {
  overflow-x: auto;
}

.library-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.library-table th,
.library-table td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.library-table th {
  color: var(--subtle);
  font-weight: 500;
  background: #f7f9fb;
}

.library-table td:first-child {
  white-space: normal;
  min-width: 180px;
}

[class^="confidence-"] {
  font-weight: 700;
}

.confidence-high {
  color: var(--green);
}

.confidence-medium {
  color: #b26b00;
}

.confidence-low,
.confidence-unresolved {
  color: var(--red);
}

/* ---------- Auth modal ---------- */
.auth-modal {
  width: min(440px, 100%);
}

.auth-modal h2 {
  font-size: 22px;
  margin-bottom: 6px;
}

.auth-copy {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
}

.auth-form {
  display: flex;
  gap: 8px;
}

.auth-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 15px;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.auth-form button {
  background: var(--blue);
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-weight: 700;
  white-space: nowrap;
}

.auth-form button:hover:not(:disabled) {
  background: var(--blue-hover);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--subtle);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.google-button {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-weight: 700;
  color: var(--text);
}

.google-button:hover {
  background: #f5f7fa;
}

.auth-modal .message {
  margin: 16px 0 0;
  box-shadow: none;
  background: #f7f9fb;
}

/* ---------- Footer ---------- */
.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px 24px 40px;
  color: var(--subtle);
  font-size: 12px;
  border-top: 1px solid var(--line);
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .topbar-inner {
    gap: 16px;
  }

  .topnav {
    display: none;
  }

  .user-email {
    display: none;
  }

  .book-card {
    grid-template-columns: 1fr;
  }

  .price-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 14px 20px 18px;
  }

  .best-deal {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 8px;
  }

  .best-deal em {
    margin-bottom: 0;
  }

  .best-deal-cta {
    width: 100%;
    margin-top: 10px;
  }

  .card-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .card-actions .save-button,
  .card-actions .detail-button {
    flex: 1;
  }

  .card-actions .buy-links {
    width: 100%;
  }

  .status-bar,
  .result-tools {
    flex-direction: column;
    align-items: stretch;
  }

  .sort-tabs button {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
  }
}

@media (max-width: 560px) {
  .topbar-inner,
  .app-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero {
    padding: 28px 16px 48px;
  }

  .brand-zh {
    display: none;
  }

  .search-card {
    flex-direction: column;
  }

  .search-field {
    border-radius: 10px 10px 4px 4px;
  }

  #search-button {
    border-radius: 4px 4px 10px 10px;
    padding: 12px;
  }

  .store-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .store-item:nth-child(3) {
    border-left: 0;
  }

  .store-item:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .sort-tabs button span {
    display: none;
  }

  .card-main {
    grid-template-columns: 64px 1fr;
    gap: 14px;
    padding: 16px;
  }

  .cover-wrap {
    width: 64px;
  }

  .offer-row {
    grid-template-columns: 64px 1fr auto;
    gap: 8px;
  }

  .panel {
    padding: 18px 16px;
  }

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

  .modal-backdrop {
    padding: 0;
    align-items: end;
  }

  .book-modal {
    border-radius: 16px 16px 0 0;
    max-height: 92vh;
    padding: 22px 18px;
  }

  .modal-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .modal-cover-wrap {
    width: 110px;
  }

  .modal-metadata {
    grid-template-columns: 1fr;
  }

  .auth-form {
    flex-direction: column;
  }
}
