/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== Lock Screen ===== */
.lock-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.lock-screen.hidden { display: none; }
.lock-box {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; padding: 40px 32px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  width: 100%; max-width: 320px;
  animation: fadeUp 0.25s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.lock-icon { border-radius: 14px; margin-bottom: 2px; }
.lock-title { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em; }
.lock-sub { font-size: 0.82rem; color: var(--text-2); }
.lock-input-wrap { width: 100%; }
.lock-input-wrap input {
  width: 100%; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text); font-size: 1rem; outline: none;
  transition: border-color var(--t), box-shadow var(--t);
  text-align: center; letter-spacing: 0.08em;
}
.lock-input-wrap input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.lock-error { font-size: 0.8rem; color: var(--red); }
.lock-error.hidden { display: none; }

/* ===== Color System (Dusty Blue — unified with icon) ===== */
:root {
  /* icon's main color: #8299b3 */
  --accent:       #8299b3;
  --accent-2:     #9fb4c8;
  --accent-soft:  rgba(130,153,179,0.13);
  --accent-glow:  rgba(130,153,179,0.20);

  --bg:           #0c1118;
  --bg-2:         #121820;
  --bg-3:         #192330;
  --bg-card:      #111820;
  --border:       #1e2d3e;
  --border-hover: #2c4158;

  --text:         #d6e5f0;
  --text-2:       #85a3bb;
  --text-3:       #46637a;

  --green:        #5aaa7a;
  --yellow:       #c9a84c;
  --blue:         #5b90c9;
  --red:          #c96060;
  --orange:       #c98b4c;

  --radius:       13px;
  --radius-sm:    8px;
  --radius-xs:    5px;
  --shadow:       0 8px 32px rgba(0,0,0,0.55);
  --t:            0.16s ease;
}

/* ===== Base ===== */
html { font-size: 15px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100vh; line-height: 1.55;
}
input, select, textarea, button { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ===== Header ===== */
.header {
  position: sticky; top: 0; z-index: 100; height: 56px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1440px; margin: 0 auto; height: 100%;
  padding: 0 20px; display: flex; align-items: center; gap: 14px;
}
.logo {
  display: flex; align-items: center; gap: 9px;
  font-size: 1rem; font-weight: 800; letter-spacing: -0.025em;
  white-space: nowrap; flex-shrink: 0;
}
.logo img { border-radius: 7px; }
.header-search { flex: 1; max-width: 360px; margin: 0 auto; }
.header-right { margin-left: auto; flex-shrink: 0; display: flex; align-items: center; gap: 6px; }

.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 14px; transition: all var(--t);
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box svg { color: var(--text-3); flex-shrink: 0; }
.search-box input { background: none; border: none; outline: none; color: var(--text); font-size: 0.875rem; width: 100%; }
.search-box input::placeholder { color: var(--text-3); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  border: none; transition: all var(--t); white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 2px 10px var(--accent-glow); }
.btn-primary:hover { background: var(--accent-2); transform: translateY(-1px); }
.btn-ghost { background: var(--bg-3); color: var(--text-2); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--border); color: var(--text); }
.btn-danger { background: rgba(201,96,96,0.12); color: var(--red); border: 1px solid transparent; }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { padding: 5px 11px; font-size: 0.8rem; }

/* ===== Stats Bar ===== */
.stats-bar {
  display: flex; gap: 10px; padding: 14px 20px; max-width: 1440px; margin: 0 auto;
}
.stat-card {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 8px; cursor: pointer;
  transition: all var(--t); text-align: center;
}
.stat-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.stat-icon { font-size: 1.1rem; line-height: 1; }
.stat-value { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.04em; color: var(--text); }
.stat-label { font-size: 0.7rem; color: var(--text-3); font-weight: 600; letter-spacing: 0.04em; }
.stat-total .stat-value { color: var(--accent); }

/* ===== Filter Bar ===== */
.filter-bar { max-width: 1440px; margin: 0 auto; padding: 0 20px 14px; }
.tabs-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin-bottom: 10px; }
.tabs-wrap::-webkit-scrollbar { display: none; }
.tabs { display: flex; gap: 4px; min-width: max-content; }
.tab {
  padding: 7px 14px; border-radius: 999px;
  background: none; border: 1px solid var(--border); color: var(--text-3);
  cursor: pointer; font-size: 0.82rem; font-weight: 600;
  transition: all var(--t); white-space: nowrap;
}
.tab:hover { color: var(--text-2); border-color: var(--border-hover); }
.tab.active { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 2px 8px var(--accent-glow); }

.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-select {
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text-2); padding: 6px 10px; border-radius: var(--radius-sm);
  font-size: 0.82rem; cursor: pointer; outline: none; transition: all var(--t);
}
.filter-select:focus { border-color: var(--accent); color: var(--text); }

/* ===== Main Content ===== */
.main-content { max-width: 1440px; margin: 0 auto; padding: 0 20px 40px; }

/* ===== Book Grid ===== */
.book-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

/* ===== Series Group ===== */
.series-group {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  transition: all var(--t); position: relative;
  display: flex; flex-direction: column;
}
.series-group:not(.open):hover {
  border-color: var(--accent); transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.45), 0 0 0 1px var(--accent-soft);
}
.series-group.open { grid-column: 1 / -1; }

/* Collapsed: show as book card */
.series-card-view { display: flex; flex-direction: column; flex: 1; }
.series-group.open .series-card-view { display: none; }

/* Expanded: compact header row */
.series-open-header {
  display: none; align-items: center; gap: 12px;
  padding: 11px 14px; border-bottom: 1px solid var(--border);
}
.series-group.open .series-open-header { display: flex; }
.series-thumb {
  width: 36px; height: 50px; border-radius: 4px; overflow: hidden; flex-shrink: 0;
  background: var(--bg-3);
}
.series-thumb img { width: 100%; height: 100%; object-fit: cover; }
.series-header-info { flex: 1; min-width: 0; }
.series-header-title {
  font-size: 0.88rem; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.series-header-sub { font-size: 0.72rem; color: var(--text-3); margin-top: 2px; }
.series-chevron { flex-shrink: 0; color: var(--text-3); }

/* N冊 badge on cover */
.series-vol-badge {
  position: absolute; top: 7px; right: 7px;
  background: rgba(10,18,30,0.82); color: var(--text);
  padding: 2px 7px; border-radius: 4px;
  font-size: 0.7rem; font-weight: 700;
  backdrop-filter: blur(4px);
}

.series-volumes { display: none; padding: 10px; }
.series-group.open .series-volumes { display: block; }
.series-volumes .book-grid { grid-template-columns: repeat(3, 1fr); }

/* ===== Book Card ===== */
.book-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  transition: all var(--t); position: relative;
  display: flex; flex-direction: column;
}
.book-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: 0 12px 36px rgba(0,0,0,0.45), 0 0 0 1px var(--accent-soft); }

/* Cover */
.card-cover {
  width: 100%; aspect-ratio: 2/3;
  background: var(--bg-3); position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 16px; text-align: center;
}
.cover-initial { font-size: 2rem; font-weight: 900; letter-spacing: -0.05em; line-height: 1; }
.cover-title-text { font-size: 0.68rem; font-weight: 600; opacity: 0.65; line-height: 1.3; word-break: break-all; }

/* Card type badges (top-left corner) */
.card-type-badges { position: absolute; top: 7px; left: 7px; display: flex; gap: 4px; }
.type-badge {
  padding: 2px 6px; border-radius: 4px; font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.03em; backdrop-filter: blur(6px);
}
.type-e      { background: rgba(90,130,170,0.85);  color: #fff; }
.type-p      { background: rgba(80,110,90,0.85);   color: #fff; }
.type-tanwa  { background: rgba(150,100,170,0.85); color: #fff; }
.type-novel  { background: rgba(170,120,70,0.85);  color: #fff; }

/* Status badge top-right */
.card-status {
  position: absolute; top: 7px; right: 7px;
  padding: 2px 7px; border-radius: 4px; font-size: 0.62rem; font-weight: 700;
  backdrop-filter: blur(6px);
}
.status-unread    { background: rgba(30,45,62,0.85); color: var(--text-3); }
.status-reading   { background: rgba(91,144,201,0.85); color: #fff; }
.status-completed { background: rgba(90,170,122,0.85); color: #fff; }

/* Sequel bell */
.card-sequel-bell {
  position: absolute; bottom: 7px; right: 7px;
  font-size: 0.75rem; background: rgba(201,168,76,0.9);
  border-radius: 4px; padding: 1px 5px; line-height: 1.4;
}

/* Completed badge */
.card-completed-badge {
  position: absolute; bottom: 7px; left: 7px;
  font-size: 0.65rem; font-weight: 700;
  background: rgba(90,170,122,0.92);
  color: #fff; border-radius: 4px; padding: 1px 5px; line-height: 1.4;
}

/* Card info */
.card-info { padding: 9px 10px 10px; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.card-title {
  font-size: 0.82rem; font-weight: 700; line-height: 1.3; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-author { font-size: 0.7rem; color: var(--text-3); }
.card-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.genre-tag {
  padding: 1px 7px; border-radius: 999px;
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-3); font-size: 0.65rem; font-weight: 600;
}
.vol-info { font-size: 0.7rem; color: var(--text-2); margin-top: auto; }
.vol-complete { color: var(--green); }

/* Service chips */
.card-services { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.svc-chip {
  display: inline-flex; align-items: center;
  padding: 2px 7px; border-radius: 4px;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.03em;
  text-decoration: none; cursor: pointer; transition: opacity var(--t);
}
.svc-chip:hover { opacity: 0.8; }
.svc-chip.no-link { cursor: default; opacity: 0.6; }

/* Service colors */
.svc-beltoon    { background: #6a52a8; color: #fff; }
.svc-bookwalker { background: #b86030; color: #fff; }
.svc-dmm        { background: #a84040; color: #fff; }
.svc-honto      { background: #3a8855; color: #fff; }
.svc-kindle     { background: #2d5fa0; color: #fff; }
.svc-renta      { background: #a84078; color: #fff; }
.svc-jumpplus   { background: #882020; color: #fff; }
.svc-ebookjapan { background: #8a6a20; color: #fff; }
.svc-cmoa       { background: #c05a20; color: #fff; }
.svc-other      { background: #4a6275; color: #fff; }
.svc-physical   { background: #3a5248; color: #fff; }

/* ===== Empty State ===== */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; padding: 80px 20px; color: var(--text-3); text-align: center;
}
.hidden { display: none !important; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.72); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); width: 100%; max-width: 520px;
  max-height: 92vh; display: flex; flex-direction: column;
  animation: slideUp 0.2s cubic-bezier(.16,1,.3,1); box-shadow: var(--shadow);
}
.modal-lg { max-width: 680px; }
@keyframes slideUp { from { transform: translateY(18px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header { padding: 18px 20px 0; display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.02em; }
.modal-close { background: var(--bg-3); border: none; color: var(--text-3); cursor: pointer; padding: 5px; border-radius: 6px; transition: all var(--t); line-height: 0; }
.modal-close:hover { color: var(--text); background: var(--border); }
.modal-body { padding: 16px 20px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* Modal sections */
.form-section { display: flex; flex-direction: column; gap: 10px; }
.section-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.section-sublabel { font-size: 0.72rem; color: var(--text-3); font-weight: 600; }

/* ISBN row */
.isbn-row { display: flex; gap: 8px; }
.isbn-row input { flex: 1; background: var(--bg-3); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius-sm); padding: 7px 10px; font-size: 0.875rem; outline: none; transition: all var(--t); }
.isbn-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.isbn-status { font-size: 0.8rem; padding: 5px 8px; border-radius: var(--radius-xs); }
.isbn-status.loading { color: var(--text-2); background: var(--bg-3); }
.isbn-status.success { color: var(--green); background: rgba(90,170,122,0.1); }
.isbn-status.error   { color: var(--red); background: rgba(201,96,96,0.1); }

.dup-warn { display: flex; align-items: center; gap: 6px; padding: 7px 10px; background: rgba(201,168,76,0.1); border: 1px solid rgba(201,168,76,0.25); border-radius: var(--radius-xs); font-size: 0.8rem; color: var(--yellow); }

/* Form groups */
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 0.75rem; font-weight: 600; color: var(--text-3); }
.req { color: var(--accent); }
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm);
  padding: 7px 10px; font-size: 0.875rem; outline: none; transition: all var(--t);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.form-group textarea { resize: vertical; min-height: 72px; font-family: inherit; }

.form-row-cover { display: grid; grid-template-columns: 88px 1fr; gap: 12px; }

/* Cover upload */
.cover-upload { cursor: pointer; }
.cover-preview {
  width: 88px; aspect-ratio: 2/3;
  background: var(--bg-3); border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; color: var(--text-3); font-size: 0.68rem; transition: all var(--t); overflow: hidden;
}
.cover-preview:hover { border-color: var(--accent); color: var(--accent); }
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }

/* Type checks */
.type-checks { display: flex; gap: 16px; }
.flag-checks { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.type-check { display: flex; align-items: center; gap: 6px; font-size: 0.875rem; cursor: pointer; white-space: nowrap; }
.type-check input { accent-color: var(--accent); cursor: pointer; }

/* Service grid */
.service-section { display: flex; flex-direction: column; gap: 8px; padding: 10px; background: var(--bg-3); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.service-grid { display: flex; flex-direction: column; gap: 7px; }
.svc-row { display: flex; align-items: center; gap: 8px; }
.svc-badge { padding: 2px 6px; border-radius: 4px; font-size: 0.65rem; font-weight: 700; flex-shrink: 0; min-width: 34px; text-align: center; }
.svc-name { font-size: 0.78rem; color: var(--text-2); min-width: 96px; flex-shrink: 0; }
.svc-row input { flex: 1; background: var(--bg-2); border: 1px solid var(--border); color: var(--text-2); border-radius: var(--radius-xs); padding: 5px 8px; font-size: 0.78rem; outline: none; transition: all var(--t); }
.svc-row input:focus { border-color: var(--accent); color: var(--text); }

/* Volume row */
.vol-row { display: flex; align-items: flex-end; gap: 8px; }
.vol-row .form-group { flex: 1; }
.vol-sep { font-size: 1.2rem; color: var(--text-3); padding-bottom: 7px; }
.vol-row input { width: 100%; }

/* Status radio */
.status-radio { display: flex; gap: 20px; }
.radio-label { display: flex; align-items: center; gap: 6px; font-size: 0.875rem; cursor: pointer; }
.radio-label input { accent-color: var(--accent); cursor: pointer; }

/* ===== Detail Modal ===== */
.detail-layout { display: grid; grid-template-columns: 140px 1fr; gap: 20px; }
.detail-cover {
  width: 140px; aspect-ratio: 2/3; border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--border);
  background: var(--bg-3); display: flex; align-items: center; justify-content: center;
}
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-meta { display: flex; flex-direction: column; gap: 10px; }
.detail-book-title { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.025em; line-height: 1.25; }
.detail-author { font-size: 0.9rem; color: var(--text-2); }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-stat { font-size: 0.85rem; color: var(--text-2); }
.detail-services { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.detail-notes { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 0.875rem; color: var(--text-2); line-height: 1.7; white-space: pre-wrap; }
.detail-added { font-size: 0.75rem; color: var(--text-3); }

.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }
.pill-unread    { background: var(--bg-3); color: var(--text-3); }
.pill-reading   { background: rgba(91,144,201,0.15); color: var(--blue); }
.pill-completed { background: rgba(90,170,122,0.15); color: var(--green); }
.pill-sequel    { background: rgba(201,168,76,0.15); color: var(--yellow); }
.pill-ebook     { background: rgba(90,130,170,0.15); color: var(--blue); }
.pill-physical  { background: rgba(80,130,100,0.15); color: var(--green); }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 22px; right: 22px; z-index: 300;
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text); padding: 10px 18px; border-radius: var(--radius);
  font-size: 0.85rem; box-shadow: var(--shadow);
  animation: slideIn 0.2s cubic-bezier(.16,1,.3,1);
}
@keyframes slideIn { from { transform: translateX(14px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ===== Scrollbar ===== */
/* ===== Sync Button ===== */
.btn-icon {
  width: 36px; height: 36px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-3); color: var(--text-2);
  transition: color var(--t), border-color var(--t), background var(--t);
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn-icon[data-status="ok"] { color: var(--green); border-color: rgba(90,170,122,0.35); }
.btn-icon[data-status="syncing"] { color: var(--accent); animation: spin 1s linear infinite; }
.btn-icon[data-status="error"] { color: var(--red); border-color: rgba(201,96,96,0.35); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Sync Modal ===== */
.sync-desc { font-size: 0.78rem; color: var(--text-3); margin-bottom: 10px; }
.sync-code-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.sync-code-display {
  font-family: 'SF Mono', 'Fira Code', monospace; font-size: 1.4rem; font-weight: 700;
  letter-spacing: 0.15em; color: var(--accent);
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 16px; flex: 1; text-align: center;
}
.sync-join-row { display: flex; gap: 8px; align-items: center; }
.sync-join-row input { flex: 1; text-transform: uppercase; letter-spacing: 0.1em; font-size: 1rem; }
.sync-btns-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }

/* ===== Desktop (Mac) — 小さめカード ===== */
@media (min-width: 641px) {
  .book-grid { grid-template-columns: repeat(10, 1fr); gap: 8px; }
  .series-volumes .book-grid { grid-template-columns: repeat(10, 1fr); }
  .card-info { padding: 5px 6px 7px; }
  .card-title { font-size: 0.68rem; }
  .card-author { font-size: 0.6rem; }
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .stats-bar { gap: 6px; padding: 10px 12px; }
  .stat-card { padding: 8px 4px; }
  .stat-value { font-size: 1.1rem; }
  .filter-bar { padding: 0 12px 10px; }
  .main-content { padding: 0 8px 32px; }
  .book-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .series-volumes .book-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .card-info { padding: 6px 7px 8px; }
  .card-title { font-size: 0.73rem; }
  .card-author { display: none; }
  .detail-layout { grid-template-columns: 1fr; }
  .form-row-cover { grid-template-columns: 1fr; }
}
