/* Books & Movies — shared shelf (Worker/KV), mobile-first scrapbook */

.bm { --bm-leaf: #5f7a5a; --bm-petal: #f7e4dc; }

.bm .lede { margin-bottom: 1.25rem; }

.bm-notice {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem;
  background: #fff4dc; border: 1px dashed rgba(196, 120, 90, 0.55);
  border-radius: 12px; padding: 0.65rem 0.85rem; margin: 0 0 1rem;
  font-size: 0.93rem; line-height: 1.4;
}
.bm-notice[hidden] { display: none; }
.bm-notice span { flex: 1 1 14rem; }

.bm-filters {
  display: grid; gap: 0.5rem; margin: 0 0 0.9rem;
}
.bm-chiprow {
  display: flex; gap: 0.4rem; overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; padding-bottom: 2px;
}
.bm-chiprow::-webkit-scrollbar { display: none; }

.bm-chip, .bm-pick {
  flex: 0 0 auto; min-height: var(--tap, 44px); padding: 0.45rem 1rem;
  border-radius: 999px; background: rgba(255, 252, 248, 0.92);
  border: 1.5px solid rgba(196, 120, 90, 0.25); color: var(--charcoal);
  font: 600 0.95rem/1 var(--font-body); cursor: pointer; touch-action: manipulation;
}
.bm-chip.is-on, .bm-pick.is-on {
  background: var(--bm-petal); border-color: var(--terracotta);
  box-shadow: var(--shadow-soft);
}

.bm-tabs {
  position: relative;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.3rem;
  background: rgba(247, 241, 232, 0.94); backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 0.45rem 0; margin: 0 0 1rem;
  border-bottom: 1px solid rgba(196, 120, 90, 0.18);
}
.bm-tab {
  min-height: 52px; padding: 0.35rem 0.2rem; border-radius: 12px;
  border: 1.5px solid transparent; background: transparent;
  font: 600 0.86rem/1.15 var(--font-body); color: rgba(44, 42, 40, 0.72);
  cursor: pointer; touch-action: manipulation;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.bm-tab.is-on { background: var(--white); color: var(--charcoal); border-color: rgba(196, 120, 90, 0.35); box-shadow: var(--shadow-soft); }
.bm-count { font-size: 0.75rem; color: var(--terracotta); min-height: 0.9em; }

.bm-panel[hidden] { display: none; }

.bm-btn {
  min-height: 48px; padding: 0.6rem 1.1rem; border-radius: 14px;
  font: 600 1rem/1.1 var(--font-body); cursor: pointer; touch-action: manipulation;
  border: 1.5px solid rgba(196, 120, 90, 0.35); background: var(--white); color: var(--charcoal);
}
.bm-btn-primary { background: var(--terracotta); border-color: var(--terracotta); color: #fff; }
.bm-btn-ghost { background: transparent; }
.bm-btn-danger { color: #a23b2a; border-color: rgba(162, 59, 42, 0.35); background: #fff; }
.bm-btn-add {
  width: 100%; min-height: 56px; margin: 0 0 1rem; font-size: 1.05rem;
  background: linear-gradient(165deg, rgba(247, 228, 220, 0.9), rgba(95, 122, 90, 0.1));
  border: 1.5px dashed rgba(196, 120, 90, 0.55); border-radius: 16px;
}
.bm-btn-add[hidden] { display: none; }
.bm-btn:disabled { opacity: 0.6; }

.bm-list { display: grid; gap: 1rem; }
@media (min-width: 700px) { .bm-list { grid-template-columns: 1fr 1fr; } }

.bm-group-title {
  grid-column: 1 / -1; margin: 0.4rem 0 -0.25rem;
  font: 600 1.35rem/1.2 var(--font-hand); color: var(--terracotta);
}

/* scrapbook card */
.bm-card {
  position: relative; background: var(--white); border-radius: var(--radius);
  padding: 1.05rem 1rem 0.9rem; box-shadow: var(--shadow);
  border: 1px solid rgba(196, 120, 90, 0.12);
}
.bm-card:nth-child(odd) { transform: rotate(-0.4deg); }
.bm-card:nth-child(even) { transform: rotate(0.35deg); }
.bm-card::before {
  content: ""; position: absolute; top: -9px; left: 50%; width: 74px; height: 18px;
  transform: translateX(-50%) rotate(-2deg); background: var(--tape); border-radius: 2px;
}
.bm-card:nth-child(even)::before { background: var(--tape-blush); transform: translateX(-50%) rotate(2deg); }

.bm-entry { display: grid; grid-template-columns: 76px 1fr; gap: 0.85rem; align-items: start; }
.bm-cover {
  width: 76px; height: 108px; border-radius: 6px; object-fit: cover;
  background: var(--paper); box-shadow: 0 3px 8px rgba(44, 42, 40, 0.12);
  display: flex; align-items: center; justify-content: center; font-size: 2rem;
}
.bm-title { font: 600 1.35rem/1.2 var(--font-display); margin: 0 0 0.15rem; word-break: break-word; }
.bm-sub { margin: 0 0 0.35rem; color: rgba(44, 42, 40, 0.7); font-size: 0.95rem; }
.bm-badges { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.25rem 0; }
.bm-badge {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.03em; padding: 0.15rem 0.55rem;
  border-radius: 999px; background: rgba(168, 181, 160, 0.3); color: rgba(44, 42, 40, 0.8);
}
.bm-badge.is-want { background: rgba(232, 196, 184, 0.55); }
.bm-stars { color: var(--terracotta); letter-spacing: 0.08em; font-size: 1.05rem; }
.bm-stars .off { color: rgba(44, 42, 40, 0.18); }
.bm-text { margin: 0.4rem 0 0; white-space: pre-wrap; word-break: break-word; }
.bm-why { font-family: var(--font-hand); font-size: 1.3rem; line-height: 1.25; color: #4b4642; }
.bm-meta { font-size: 0.82rem; color: rgba(44, 42, 40, 0.58); margin: 0.35rem 0 0; }
.bm-link { font-size: 0.9rem; color: var(--bm-leaf); font-weight: 600; margin: 0 0 0.25rem; }
.bm-sign { font-family: var(--font-hand); font-size: 1.25rem; color: var(--terracotta); margin: 0.3rem 0 0; }

.bm-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.75rem; grid-column: 1 / -1; }
.bm-actions .bm-btn { flex: 1 1 auto; min-height: 44px; padding: 0.45rem 0.7rem; font-size: 0.93rem; }

.bm-rev-group { display: grid; gap: 0.6rem; }
.bm-rev-item { border-top: 1px dashed rgba(196, 120, 90, 0.3); padding-top: 0.6rem; }
.bm-rev-item:first-of-type { border-top: 0; padding-top: 0; }

/* forms */
.bm-form { background: linear-gradient(165deg, rgba(247, 228, 220, 0.65), rgba(255, 252, 248, 0.95)); grid-column: 1 / -1; }
.bm-form h3 { font: 600 1.4rem/1.2 var(--font-display); margin: 0 0 0.4rem; }
.bm-field { display: block; margin: 0.8rem 0 0; }
.bm-label {
  display: block; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--bm-leaf); margin: 0 0 0.35rem;
}
.bm-input, .bm-textarea, .bm-select {
  width: 100%; min-height: 48px; border: 1.5px solid rgba(44, 42, 40, 0.16); border-radius: 12px;
  padding: 0.65rem 0.8rem; background: #fffdf9; color: var(--charcoal);
  font: 400 16px/1.4 var(--font-body); /* 16px avoids iOS zoom */
}
.bm-textarea { min-height: 110px; resize: vertical; }
.bm-input:focus, .bm-textarea:focus, .bm-select:focus { outline: 2px solid var(--blush); border-color: var(--terracotta); }
.bm-picks { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.bm-starpick { display: flex; gap: 0.25rem; align-items: center; }
.bm-starpick button {
  width: 48px; height: 48px; border-radius: 12px; border: 1.5px solid rgba(196, 120, 90, 0.25);
  background: #fffdf9; font-size: 1.5rem; line-height: 1; color: rgba(44, 42, 40, 0.2); cursor: pointer;
  touch-action: manipulation; padding: 0;
}
.bm-starpick button.is-on { color: var(--terracotta); background: var(--bm-petal); }
.bm-hint { font-size: 0.82rem; color: rgba(44, 42, 40, 0.6); margin: 0.3rem 0 0; }
.bm-error { color: #a23b2a; font-weight: 600; font-size: 0.92rem; margin: 0.6rem 0 0; }
.bm-form-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 1rem; }

.bm-empty {
  grid-column: 1 / -1; text-align: center; padding: 1.6rem 1rem; border-radius: var(--radius);
  background: rgba(255, 252, 248, 0.7); border: 1.5px dashed rgba(196, 120, 90, 0.35);
}
.bm-empty .bm-empty-art { font-size: 2.2rem; }
.bm-empty p { margin: 0.3rem 0 0; }
.bm-empty .hand { font-size: 1.45rem; color: var(--terracotta); }
.bm-loading { text-align: center; color: rgba(44, 42, 40, 0.6); }
.bm-loading[hidden] { display: none; }
