:root {
  color-scheme: dark;
  --bg: #090b10;
  --panel: #121620;
  --panel-2: #181e2a;
  --line: #283043;
  --text: #f5f7fb;
  --muted: #9ba7ba;
  --accent: #e6397b;
  --accent-2: #ff7aa8;
  --owned: #36c995;
  --missing: #f2b84b;
  --future: #566176;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 85% 0%, rgba(230,57,123,.13), transparent 32rem),
    linear-gradient(180deg, #0d1017 0, var(--bg) 30rem);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }
button { cursor: pointer; }

.topbar {
  position: relative;
  min-height: 210px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  padding: 44px clamp(22px, 6vw, 90px) 32px;
  border-bottom: 1px solid var(--line);
}
.eyebrow, .kind {
  color: var(--accent-2);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .18em;
  margin: 0 0 8px;
}
h1 { font-size: clamp(2.3rem, 5vw, 4.8rem); line-height: .95; margin: 0; letter-spacing: -.055em; }
.subtitle { color: var(--muted); margin: 14px 0 0; font-size: 1.05rem; }
.mode-tabs { display:flex;gap:8px;margin-top:18px; }
.mode-tab {
  min-height:38px;
  padding:0 15px;
  border:1px solid var(--line);
  border-radius:999px;
  background:rgba(18,22,32,.85);
  color:var(--text);
  font-weight:750;
}
.mode-tab.active {
  border-color:var(--accent);
  background:var(--accent);
}
.area-option-list {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(250px,1fr));
  gap:12px;
  margin:18px 0;
}
.area-option {
  display:flex;
  align-items:flex-start;
  gap:14px;
  border:1px solid var(--line);
  background:rgba(14,18,28,.78);
  border-radius:18px;
  padding:16px;
  cursor:pointer;
  min-height:104px;
  transition:border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease;
}
.area-option:hover,
.area-option:focus-within {
  border-color:rgba(230,57,123,.65);
  background:rgba(26,31,45,.92);
  transform:translateY(-1px);
}
.area-option:has(input:checked) {
  border-color:rgba(230,57,123,.88);
  background:linear-gradient(135deg,rgba(230,57,123,.20),rgba(18,22,32,.92));
  box-shadow:0 14px 40px rgba(230,57,123,.10), inset 0 0 0 1px rgba(255,122,168,.12);
}
.area-option input,
.form-dialog .area-option input,
.status-block .area-option input {
  appearance:none;
  flex:0 0 28px;
  width:28px;
  height:28px;
  min-height:28px;
  margin:1px 0 0;
  padding:0;
  border:2px solid #556178;
  border-radius:9px;
  background:#0d121d;
  display:grid;
  place-items:center;
  cursor:pointer;
}
.area-option input::after {
  content:"";
  width:13px;
  height:8px;
  border-left:3px solid transparent;
  border-bottom:3px solid transparent;
  transform:rotate(-45deg) translate(1px,-1px);
}
.area-option input:checked {
  border-color:var(--accent);
  background:linear-gradient(135deg,var(--accent),#ff7aa8);
}
.area-option input:checked::after {
  border-left-color:#fff;
  border-bottom-color:#fff;
}
.area-option input:focus-visible {
  outline:3px solid rgba(255,122,168,.35);
  outline-offset:3px;
}
.area-option strong { display:block;color:var(--text); }
.area-option span { display:block;color:var(--muted);font-size:.92rem;line-height:1.4;margin-top:2px; }
.area-option > span > strong {
  font-size:1rem;
  margin-bottom:4px;
}
.backup-help-card,
.empty-collection-card {
  border:1px solid rgba(255,122,168,.22);
  background:linear-gradient(135deg,rgba(230,57,123,.13),rgba(18,22,32,.88));
  border-radius:20px;
  padding:18px;
  margin:16px 0;
  box-shadow:0 18px 50px rgba(0,0,0,.18);
}
.backup-help-card strong,
.empty-collection-card h2 {
  color:var(--text);
}
.backup-help-card p,
.empty-collection-card p {
  color:var(--muted);
  line-height:1.55;
  margin:8px 0 0;
}
.backup-help-card.compact {
  padding:14px 16px;
  margin:12px 0 16px;
  box-shadow:none;
}
.empty-collection-card {
  grid-column:1 / -1;
  max-width:760px;
  justify-self:center;
  text-align:left;
}
.empty-collection-card h2 {
  font-size:clamp(1.5rem,4vw,2.35rem);
  margin:0;
  letter-spacing:-.03em;
}
.empty-actions {
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:16px;
}
.placeholder-panel {
  border:1px solid var(--line);
  background:linear-gradient(135deg,rgba(18,22,32,.92),rgba(34,15,29,.72));
  border-radius:24px;
  padding:26px;
  box-shadow:0 24px 80px rgba(0,0,0,.24);
}
.placeholder-panel h2 { margin:0 0 8px; }
.placeholder-panel p { color:var(--muted);line-height:1.55; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.desktop-actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
.global-actions {
  position:absolute;
  top:18px;
  right:clamp(18px, 4vw, 42px);
  z-index:30;
  display:flex;
  gap:8px;
}
.primary-button {
  border:1px solid var(--accent); background:var(--accent); color:white; border-radius:12px;
  min-height:46px; padding:0 18px; font-weight:750;
}
.primary-button:disabled,
.primary-button.disabled {
  opacity:.55;
  cursor:not-allowed;
  filter:saturate(.65);
}
.secondary-button { background:#1f2635; border-color:#3a465e; }
.update-button { background:#27324a; border-color:#405172; }
.toolbar { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; margin-bottom:16px; align-items:start; }
.search-row {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  align-items:center;
}
.toolbar .search { min-width:0; }
.toolbar .filter-button { height:46px; margin:0; }
.filter-drawer {
  min-width:220px;
  position:relative;
}
.filter-drawer summary {
  list-style:none;
  height:46px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:0 18px;
  border:1px solid var(--line);
  border-radius:999px;
  background:#111723;
  color:var(--text);
  font-weight:800;
  cursor:pointer;
  user-select:none;
}
.filter-drawer summary::-webkit-details-marker {
  display:none;
}
.filter-drawer summary::after {
  content:"▾";
  color:var(--muted);
  font-size:.8rem;
  transition:transform .16s ease;
}
.filter-drawer[open] summary {
  border-color:rgba(230,57,123,.62);
  background:rgba(230,57,123,.12);
}
.filter-drawer[open] summary::after {
  transform:rotate(180deg);
}
.filter-drawer-content {
  position:absolute;
  right:0;
  top:calc(100% + 8px);
  z-index:12;
  width:min(720px, calc(100vw - 32px));
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
  gap:10px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:18px;
  background:rgba(12,16,25,.98);
  box-shadow:0 18px 46px rgba(0,0,0,.42);
}
.filter-drawer-content .advanced-filters {
  grid-column:1 / -1;
  margin:2px 0 0;
}
.filter-drawer-content #viewToggle {
  justify-self:start;
}
.advanced-filters {
  border:1px solid var(--line);
  border-radius:16px;
  background:rgba(18,22,32,.62);
  margin:-4px 0 16px;
  overflow:hidden;
}
.advanced-filters summary {
  cursor:pointer;
  padding:14px 16px;
  color:var(--text);
  font-weight:800;
}
.advanced-filter-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
  gap:12px;
  padding:0 16px 16px;
}
.advanced-filter-grid label {
  color:var(--muted);
  font-size:.84rem;
}
.advanced-filter-grid input {
  width:100%;
  margin-top:6px;
  min-height:42px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#0f1420;
  color:var(--text);
  padding:0 12px;
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  height: 46px;
  background: rgba(18,22,32,.85);
}
.search input { flex:1; min-width:0; width: min(260px, 42vw); border: 0; outline: 0; color: var(--text); background: transparent; }
.layout-cycle-button {
  flex:0 0 auto;
  min-width:74px;
  height:46px;
  border:1px solid rgba(255,255,255,.12);
  border-radius:14px;
  background:linear-gradient(135deg,rgba(230,57,123,.12),rgba(31,38,53,.92));
  color:#ffd9e7;
  font-weight:900;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:1px;
  cursor:pointer;
  padding:0 9px;
}
.layout-cycle-button img {
  display:block;
  width:22px;
  height:22px;
  object-fit:contain;
}
.layout-cycle-button small {
  display:block;
  font-size:.58rem;
  line-height:1;
  color:var(--muted);
  font-weight:850;
}
.layout-cycle-button:hover,
.layout-cycle-button:focus-visible {
  border-color:rgba(255,122,168,.72);
  background:linear-gradient(135deg,rgba(230,57,123,.24),rgba(39,50,74,.96));
  outline:none;
}
.layout-cycle-button[data-layout-mode="compact"] {
  color:#d7e5ff;
  border-color:rgba(122,167,255,.35);
}
.layout-cycle-button[data-layout-mode="gallery"] {
  color:#bcffe8;
  border-color:rgba(64,214,142,.35);
}
.reorder-mode-button.active {
  border-color:rgba(64,214,142,.62);
  background:linear-gradient(135deg,rgba(64,214,142,.18),rgba(31,38,53,.92));
  color:#bcffe8;
}
.reorder-mode-button:disabled {
  opacity:.55;
  cursor:not-allowed;
}
.sort-select {
  display:flex;
  align-items:center;
  gap:8px;
  min-height:46px;
  border:1px solid var(--line);
  border-radius:12px;
  padding:0 12px;
  background:rgba(18,22,32,.85);
  color:var(--muted);
  font-size:.86rem;
}
.sort-select select {
  width: min(330px, 34vw);
  border:0;
  outline:0;
  color:var(--text);
  background:transparent;
  font-weight:700;
}
.sort-select option {
  background:#151a25;
  color:var(--text);
}
.icon-button, .filter-button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 12px;
}
.icon-button { width: 46px; height: 46px; font-size: 1.3rem; }

main { padding: 26px clamp(22px, 6vw, 90px) 70px; }
.summary {
  display: flex;
  gap: 0;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(18,22,32,.78);
  overflow: hidden;
}
.summary > div { min-width: 145px; padding: 18px 24px; border-right: 1px solid var(--line); }
.summary strong { display: block; font-size: 1.45rem; }
.summary span { color: var(--muted); font-size: .8rem; }
.manga-mode .summary > div:nth-child(2),
.manga-mode .summary > div:nth-child(4) {
  display:none;
}
.manga-mode .summary > div {
  min-width:0;
  flex:1;
}
.manga-mode .summary > div:nth-child(5) {
  border-right:0;
}
.dashboard {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(168px,1fr));
  gap:10px;
  margin:12px 0 0;
}
.dashboard article {
  border:1px solid var(--line);
  border-radius:13px;
  background:rgba(18,22,32,.58);
  padding:13px 15px;
  min-height:76px;
}
.dashboard strong {
  display:block;
  font-size:1.14rem;
  line-height:1.12;
  margin-bottom:4px;
}
.dashboard span {
  color:var(--muted);
  display:block;
  font-size:.76rem;
  line-height:1.28;
}
.dashboard article.limit-warning {
  border-color:rgba(255,184,77,.55);
  background:linear-gradient(135deg,rgba(255,184,77,.14),rgba(18,22,32,.62));
}
.dashboard article.limit-warning strong {
  color:#ffd48a;
}
.dashboard article.dashboard-filter-card {
  cursor:pointer;
  transition:border-color .16s ease, background .16s ease, transform .16s ease;
}
.dashboard article.dashboard-filter-card:hover,
.dashboard article.dashboard-filter-card:focus-visible {
  border-color:rgba(230,57,123,.75);
  background:rgba(230,57,123,.12);
  outline:none;
}
.dashboard article.dashboard-filter-card.active {
  border-color:rgba(255,214,111,.8);
  background:linear-gradient(135deg,rgba(255,214,111,.18),rgba(18,22,32,.66));
}
.summary > div.dashboard-filter-card {
  cursor:pointer;
  transition:border-color .16s ease, background .16s ease;
}
.summary > div.dashboard-filter-card:hover,
.summary > div.dashboard-filter-card.active {
  background:linear-gradient(135deg,rgba(255,214,111,.14),rgba(18,22,32,.78));
}
.tile-settings-group {
  border:1px solid var(--line);
  border-radius:16px;
  margin:14px 0;
  background:linear-gradient(180deg,rgba(20,26,39,.72),rgba(14,18,28,.58));
  overflow:hidden;
}
.tile-settings-group summary {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:16px;
  cursor:pointer;
  list-style:none;
}
.tile-settings-group summary::-webkit-details-marker {
  display:none;
}
.tile-settings-group summary::after {
  content:"▾";
  color:var(--muted);
  font-size:1rem;
  transition:transform .16s ease;
}
.tile-settings-group:not([open]) summary::after {
  transform:rotate(-90deg);
}
.tile-settings-group summary strong {
  display:block;
}
.tile-settings-group summary small {
  display:block;
  margin-top:3px;
  color:var(--muted);
  font-size:.78rem;
}
.tile-settings-group[open] summary {
  border-bottom:1px solid rgba(255,255,255,.08);
}
.tile-option-list {
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
  padding:14px;
}
.settings-section-label {
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin:8px 0 12px;
  padding:6px 10px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:999px;
  color:var(--muted);
  background:rgba(255,255,255,.04);
  font-size:.78rem;
  font-weight:800;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.settings-tip-card {
  position:relative;
  display:grid;
  grid-template-columns:auto 1fr;
  gap:14px;
  align-items:center;
  border:1px solid rgba(230,57,123,.34);
  border-radius:18px;
  padding:14px;
  margin:0 0 14px;
  background:linear-gradient(135deg,rgba(230,57,123,.14),rgba(18,22,32,.75));
  cursor:pointer;
}
.settings-tip-card:hover,
.settings-tip-card:focus-visible {
  border-color:rgba(255,122,168,.72);
  outline:none;
}
.settings-tip-icon {
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border-radius:14px;
  background:rgba(230,57,123,.22);
  color:#ffd4e3;
  font-size:1.35rem;
  font-weight:900;
}
.settings-tip-card strong {
  display:block;
  margin-bottom:3px;
}
.settings-tip-card span {
  display:block;
  color:var(--muted);
  line-height:1.35;
  font-size:.92rem;
}
.settings-tip-actions {
  grid-column:1 / -1;
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:8px;
}
.settings-tip-action {
  min-height:34px;
  padding:0 14px;
  border-radius:12px;
  white-space:nowrap;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.settings-tip-dismiss {
  min-height:34px;
  border:1px solid rgba(255,255,255,.12);
  border-radius:999px;
  background:rgba(255,255,255,.06);
  color:var(--muted);
  padding:0 12px;
  font-size:.78rem;
  font-weight:800;
  line-height:1;
}
.settings-tip-dismiss:hover,
.settings-tip-dismiss:focus-visible {
  background:rgba(255,255,255,.12);
  color:var(--text);
}
.tile-option-card {
  display:grid;
  grid-template-columns:minmax(150px,1fr) auto minmax(150px,220px);
  align-items:center;
  gap:16px;
  border:1px solid var(--line);
  border-radius:15px;
  padding:12px 14px;
  background:rgba(8,12,20,.55);
  cursor:pointer;
  transition:border-color .16s ease, background .16s ease, transform .16s ease;
}
.tile-option-card:hover,
.tile-option-card:focus-within {
  border-color:rgba(230,57,123,.62);
  background:rgba(230,57,123,.09);
  transform:translateY(-1px);
}
.tile-option-card input {
  width:26px;
  height:26px;
  accent-color:var(--accent);
  justify-self:center;
}
.tile-option-name {
  display:grid;
  gap:3px;
  min-width:0;
  text-align:center;
}
.tile-option-name strong {
  font-size:.95rem;
}
.tile-option-name small {
  color:var(--muted);
  font-size:.78rem;
}
.tile-preview-card {
  display:grid;
  place-items:center;
  text-align:center;
  min-height:72px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  background:rgba(18,22,32,.72);
  padding:10px 12px;
}
.tile-preview-card strong {
  display:block;
  font-size:1.18rem;
  line-height:1.1;
}
.tile-preview-card span {
  display:block;
  color:var(--muted);
  font-size:.76rem;
  line-height:1.25;
}
.tile-option-card:has(input:checked) {
  border-color:rgba(54,201,149,.42);
  background:linear-gradient(135deg,rgba(54,201,149,.10),rgba(8,12,20,.58));
}
.tile-option-card:has(input:checked) .tile-preview-card {
  border-color:rgba(54,201,149,.34);
  background:rgba(54,201,149,.10);
}
.tile-option-card:has(input:not(:checked)) {
  opacity:.72;
}
.prepared-form-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
  gap:12px;
  margin:16px 0 20px;
  padding:14px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:16px;
  background:rgba(8,12,20,.38);
}
.prepared-add-panel {
  margin:18px 0 22px;
  border:1px solid rgba(230,57,123,.28);
  border-radius:18px;
  background:linear-gradient(135deg,rgba(230,57,123,.10),rgba(18,22,32,.72));
  overflow:hidden;
}
.prepared-add-panel:not([open]) {
  display:none;
}
.prepared-gallery {
  align-items:start;
  margin-top:18px;
  row-gap:18px;
}
.prepared-gallery > .prepared-add-panel {
  grid-column:1 / -1;
}
.prepared-control-card,
.prepared-empty-card {
  grid-column:1 / -1;
  border:1px solid var(--line);
  border-radius:18px;
  background:linear-gradient(145deg,rgba(18,22,32,.86),rgba(12,16,24,.76));
  padding:18px;
}
.prepared-empty-card {
  display:grid;
  gap:5px;
  min-height:110px;
  place-content:center;
  text-align:center;
  color:var(--muted);
}
.prepared-empty-card strong {
  color:var(--text);
  font-size:1.05rem;
}
.prepared-add-panel summary {
  list-style:none;
  min-height:54px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:0 18px;
  color:white;
  background:linear-gradient(135deg,var(--accent),#bd265f);
  font-weight:900;
  cursor:pointer;
  user-select:none;
}
.prepared-add-panel summary::-webkit-details-marker {
  display:none;
}
.prepared-add-panel summary::after {
  content:"▾";
  font-size:.85rem;
  transition:transform .16s ease;
}
.prepared-add-panel[open] summary::after {
  transform:rotate(180deg);
}
.prepared-add-panel[open] {
  position:fixed;
  left:50%;
  top:50%;
  z-index:80;
  width:min(760px, calc(100vw - 28px));
  max-height:min(84vh, 820px);
  transform:translate(-50%, -50%);
  box-shadow:0 30px 90px rgba(0,0,0,.58), 0 0 0 9999px rgba(0,0,0,.48);
  overflow:auto;
}
.prepared-add-panel .prepared-form-grid {
  margin:0;
  border:0;
  border-radius:0;
}
.prepared-hero {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:16px;
}
.prepared-hero h2 {
  margin:2px 0 6px;
}
.prepared-hero p:not(.eyebrow) {
  margin:0;
  color:var(--muted);
  line-height:1.45;
}
.prepared-hero-actions {
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:10px;
  flex:0 0 auto;
}
.prepared-filter-panel {
  border:1px solid rgba(122,167,255,.22);
  border-radius:18px;
  background:linear-gradient(135deg,rgba(122,167,255,.10),rgba(18,22,32,.72));
  margin:12px 0 18px;
  overflow:hidden;
}
.prepared-filter-panel summary {
  list-style:none;
  min-height:46px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 15px;
  color:var(--text);
  font-weight:900;
  cursor:pointer;
}
.prepared-filter-panel summary::-webkit-details-marker {
  display:none;
}
.prepared-filter-panel summary::after {
  content:"▾";
  color:var(--muted);
  transition:transform .16s ease;
}
.prepared-filter-panel[open] summary::after {
  transform:rotate(180deg);
}
.prepared-tools-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(170px,1fr));
  gap:10px;
  padding:0 14px 14px;
}
.prepared-tools-grid label {
  display:grid;
  gap:6px;
  color:var(--muted);
  font-size:.8rem;
}
.prepared-tools-grid input,
.prepared-tools-grid select {
  min-height:40px;
  border:1px solid var(--line);
  border-radius:11px;
  background:#101722;
  color:var(--text);
  padding:0 11px;
}
.prepared-toolbar-filters {
  grid-column:1 / -1;
}
.prepared-inline-filter-panel {
  grid-column:1 / -1;
  width:100%;
}
.prepared-collection-card {
  cursor:default;
}
.prepared-card-cover {
  position:relative;
  aspect-ratio:3 / 4.2;
  display:grid;
  place-items:center;
  overflow:hidden;
  background:
    radial-gradient(circle at 35% 25%, rgba(255,122,168,.22), transparent 0 30%),
    linear-gradient(145deg,#20283a,#111722);
}
.cards-collection-card .prepared-card-cover {
  background:
    radial-gradient(circle at 50% 20%, rgba(122,167,255,.22), transparent 0 28%),
    linear-gradient(145deg,#1c2740,#111722);
}
.games-collection-card .prepared-card-cover {
  background:
    radial-gradient(circle at 50% 25%, rgba(54,201,149,.20), transparent 0 30%),
    linear-gradient(145deg,#172b27,#111722);
}
.prepared-card-cover span {
  width:72px;
  height:72px;
  display:grid;
  place-items:center;
  border:1px solid rgba(255,255,255,.16);
  border-radius:22px;
  background:rgba(255,255,255,.08);
  color:white;
  font-size:1.55rem;
  font-weight:950;
  letter-spacing:.03em;
}
.prepared-card-cover small {
  position:absolute;
  right:10px;
  bottom:10px;
  padding:5px 8px;
  border-radius:999px;
  background:rgba(8,10,15,.78);
  color:#95ebcc;
  font-size:.72rem;
  font-weight:850;
}
.prepared-card-actions {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}
.prepared-card-actions .primary-button,
.prepared-card-actions .danger-button {
  min-height:36px;
  padding:0 12px;
  margin:0;
  border-radius:999px;
  font-size:.78rem;
}
.prepared-form-head {
  display:grid;
  gap:4px;
  padding:12px 14px;
  border:1px solid rgba(230,57,123,.20);
  border-radius:14px;
  background:linear-gradient(135deg,rgba(230,57,123,.10),rgba(255,255,255,.025));
}
.prepared-form-head strong {
  font-size:1.02rem;
}
.prepared-form-head span {
  color:var(--muted);
  font-size:.86rem;
  line-height:1.35;
}
.prepared-form-grid label {
  display:grid;
  gap:6px;
  min-width:0;
}
.prepared-form-grid label.wide,
.prepared-form-grid .wide,
.prepared-form-grid button[type="submit"] {
  grid-column:1 / -1;
}
.prepared-item-list {
  display:grid;
  gap:10px;
  margin:10px 0 18px;
}
.prepared-item-card {
  display:grid;
  grid-template-columns:1fr auto;
  gap:12px;
  align-items:center;
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px;
  background:rgba(18,22,32,.58);
}
.prepared-item-card strong,
.prepared-item-card span,
.prepared-item-card small {
  display:block;
}
.prepared-item-card span {
  color:var(--muted);
  font-size:.86rem;
  margin-top:3px;
}
.prepared-item-card small {
  color:var(--muted);
  margin-top:6px;
  line-height:1.35;
}
.prepared-item-actions {
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:8px;
}
.prepared-item-actions .primary-button,
.prepared-item-actions .danger-button {
  min-height:36px;
  padding:0 12px;
  margin:0;
  border-radius:999px;
  font-size:.78rem;
}
.card-tools {
  border:1px solid rgba(122,167,255,.22);
  border-radius:18px;
  background:linear-gradient(135deg,rgba(122,167,255,.10),rgba(18,22,32,.72));
  padding:14px;
  margin:14px 0 18px;
}
.card-tools-head {
  display:grid;
  gap:3px;
  margin-bottom:12px;
}
.card-tools-head strong {
  font-size:1.05rem;
}
.card-tools-head span {
  color:var(--muted);
  font-size:.84rem;
}
.card-tools-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(170px,1fr));
  gap:10px;
}
.card-tools-grid label {
  display:grid;
  gap:6px;
  color:var(--muted);
  font-size:.8rem;
}
.card-tools-grid input,
.card-tools-grid select {
  min-height:40px;
  border:1px solid var(--line);
  border-radius:11px;
  background:#101722;
  color:var(--text);
  padding:0 11px;
}
@media (max-width:720px) {
  .prepared-hero {
    display:grid;
  }
  .prepared-hero-actions {
    justify-content:stretch;
  }
  .prepared-hero-actions .primary-button,
  .prepared-hero-actions .secondary-button {
    flex:1 1 150px;
  }
}
.card-item-list {
  grid-template-columns:repeat(auto-fit,minmax(280px,1fr));
}
.card-entry-card {
  grid-template-columns:1fr;
  align-items:start;
  border-color:rgba(122,167,255,.18);
  background:
    radial-gradient(circle at 100% 0%, rgba(122,167,255,.10), transparent 13rem),
    rgba(18,22,32,.68);
}
.card-entry-card .prepared-item-actions {
  justify-content:flex-start;
}
.figure-card.review .card-note {
  color:#ffd66f;
}
.support-privacy-warning {
  display:block;
  margin-top:8px;
  color:#ffd48a;
  font-size:.82rem;
  line-height:1.35;
}
.filter-button { margin: 12px 14px 12px auto; padding: 0 18px; }
.filter-button.active { background: var(--accent); border-color: var(--accent); }
.notice { margin: 18px 0 24px; color: var(--muted); font-size: .88rem; }
.notice.error,.form-error { color:#ff8d9d; }
.success-text { color:#36c995 !important; font-weight:800; }
.mobile-install-hint {
  display:none;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:14px 0 4px;
  border:1px solid rgba(255,122,168,.35);
  border-radius:14px;
  background:rgba(230,57,123,.12);
  padding:12px 14px;
}
.mobile-install-hint strong,
.mobile-install-hint span {
  display:block;
}
.mobile-install-hint span {
  color:var(--muted);
  font-size:.78rem;
  line-height:1.35;
  margin-top:3px;
}
.mobile-install-hint .icon-button {
  flex:0 0 auto;
  width:36px;
  height:36px;
}
.mobile-install-hint.update-hint {
  border-color:rgba(64,214,142,.45);
  background:linear-gradient(135deg,rgba(64,214,142,.14),rgba(18,22,32,.78));
}

.check-section {
  border:1px solid var(--line);
  border-radius:18px;
  background:rgba(18,22,32,.78);
  padding:20px;
  margin:0 0 18px;
}
.check-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin-bottom:16px;
}
.credit-panel {
  min-width:120px;
  border:1px solid rgba(255,122,168,.35);
  border-radius:16px;
  background:rgba(230,57,123,.12);
  padding:14px 16px;
  text-align:center;
}
.credit-panel strong {
  display:block;
  font-size:2rem;
  line-height:1;
}
.credit-panel span {
  color:var(--muted);
  font-size:.78rem;
}
.check-actions {
  display:grid;
  grid-template-columns:repeat(3,minmax(160px,1fr)) repeat(3,auto);
  gap:10px;
  align-items:center;
  margin-bottom:10px;
}
.check-results {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(320px,1fr));
  gap:12px;
  margin-top:14px;
}
.check-empty,
.check-result {
  border:1px solid var(--line);
  border-radius:16px;
  background:#111722;
  padding:14px;
}
.check-empty strong,
.check-empty span {
  display:block;
}
.check-empty span {
  color:var(--muted);
  margin-top:5px;
}
.check-result {
  display:grid;
  grid-template-columns:86px 1fr;
  gap:13px;
  align-items:start;
}
.check-result.ready { border-color:rgba(54,201,149,.55); }
.check-result.error { border-color:rgba(255,141,157,.65); }
.check-result.new { border-color:rgba(242,184,75,.6); }
.check-result.unsure {
  border-color:rgba(242,184,75,.78);
  background:linear-gradient(135deg,rgba(242,184,75,.09),rgba(17,22,34,.92));
}
.check-result img {
  width:86px;
  height:122px;
  object-fit:cover;
  border-radius:11px;
  background:#202636;
}
.check-result-head {
  display:flex;
  justify-content:space-between;
  gap:10px;
}
.check-result-head strong,
.check-result-head small {
  display:block;
}
.check-result-head strong {
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.check-result-head small {
  color:var(--muted);
  margin-top:4px;
  font-size:.76rem;
}
.scan-status-badge {
  display:inline-flex;
  align-items:center;
  border-radius:999px;
  padding:3px 8px;
  font-size:.68rem;
  font-weight:850;
  border:1px solid rgba(255,255,255,.12);
}
.scan-status-badge.ok {
  color:#95ebcc;
  background:rgba(54,201,149,.12);
  border-color:rgba(54,201,149,.28);
}
.scan-status-badge.unsure,
.scan-status-badge.pending {
  color:#ffd47a;
  background:rgba(242,184,75,.13);
  border-color:rgba(242,184,75,.32);
}
.scan-status-badge.error {
  color:#ff9caf;
  background:rgba(255,141,157,.12);
  border-color:rgba(255,141,157,.3);
}
.scan-confidence-line.high { color:#95ebcc; }
.scan-confidence-line.medium { color:#ffd47a; }
.scan-confidence-line.low,
.scan-confidence-line.unknown { color:#ffb0bd; }
.check-links {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}
.check-links .text-button {
  border:1px solid var(--line);
  border-radius:999px;
  background:#1b2231;
  padding:7px 10px;
}
.check-links .text-button.action {
  border-color:var(--accent);
  background:rgba(230,57,123,.18);
  color:var(--text);
  font-weight:750;
}
.scan-help-box {
  margin-top:12px;
  border:1px solid rgba(242,184,75,.38);
  border-radius:14px;
  background:rgba(242,184,75,.08);
  padding:10px 11px;
}
.scan-help-box strong,
.scan-help-box span {
  display:block;
}
.scan-help-box strong {
  color:#ffd98a;
  font-size:.86rem;
}
.scan-help-box span {
  color:var(--muted);
  font-size:.76rem;
  margin-top:3px;
}
.scan-help-box .check-links {
  margin-top:9px;
}
.candidate-list {
  display:grid;
  gap:7px;
  margin-top:12px;
}
.candidate-list > small {
  color:var(--muted);
  font-size:.74rem;
}
.candidate-chip {
  width:100%;
  text-align:left;
  border:1px solid var(--line);
  border-radius:12px;
  background:#0e1420;
  color:var(--text);
  padding:9px 10px;
  cursor:pointer;
  position:relative;
}
.candidate-chip strong,
.candidate-chip span {
  display:block;
}
.candidate-chip strong {
  font-size:.86rem;
}
.candidate-chip span {
  color:var(--muted);
  font-size:.73rem;
  margin-top:3px;
}
.candidate-chip .candidate-confidence {
  display:inline-flex;
  margin-top:7px;
  border-radius:999px;
  padding:3px 8px;
  font-size:.68rem;
  font-style:normal;
  font-weight:850;
  background:rgba(255,255,255,.06);
  color:var(--muted);
}
.candidate-confidence.high { color:#95ebcc; }
.candidate-confidence.medium { color:#ffd47a; }
.candidate-confidence.low,
.candidate-confidence.unknown { color:#ffb0bd; }
.candidate-chip.active {
  border-color:var(--accent);
  background:rgba(230,57,123,.16);
}
.danger-text-button {
  color:#ff9caf !important;
  border-color:rgba(255,141,157,.34) !important;
  background:rgba(255,141,157,.08) !important;
}

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 22px; }
.manga-mode .gallery:not(.list) {
  grid-template-columns:repeat(auto-fill,minmax(176px,1fr));
  gap:16px;
}
.gallery.layout-compact:not(.list) {
  grid-template-columns:repeat(auto-fill,minmax(132px,1fr));
  gap:12px;
}
.gallery.layout-compact:not(.list) .card-body {
  padding:11px;
}
.gallery.layout-compact:not(.list) .card h2 {
  min-height:2.35em;
  margin-bottom:8px;
  font-size:.84rem;
  line-height:1.28;
}
.gallery.layout-compact:not(.list) .progress-meta,
.gallery.layout-compact:not(.list) .card-note {
  display:none;
}
.gallery.layout-compact:not(.list) .prepared-card-body .card-note,
.gallery.layout-compact:not(.list) .prepared-item-body .card-note {
  display:none;
}
.gallery.layout-compact:not(.list) .progress {
  height:4px;
  margin:6px 0 0;
}
.gallery.layout-compact:not(.list) .confidence {
  font-size:.56rem;
  padding:4px 6px;
}
.gallery.layout-gallery:not(.list) {
  grid-template-columns:repeat(auto-fill,minmax(68px,1fr));
  gap:8px;
}
.gallery.layout-gallery:not(.list) .card {
  border-radius:12px;
}
.gallery.layout-gallery:not(.list) .card-body,
.gallery.layout-gallery:not(.list) .progress,
.gallery.layout-gallery:not(.list) .progress-meta,
.gallery.layout-gallery:not(.list) .card-note,
.gallery.layout-gallery:not(.list) .confidence {
  display:none;
}
.gallery.layout-gallery:not(.list) .cover-wrap {
  aspect-ratio:3 / 4.2;
}
.draft-section {
  margin-top:42px;
  border:1px solid var(--line);
  border-radius:18px;
  background:rgba(18,22,32,.78);
  padding:22px;
}
.draft-head {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
}
.draft-head h2 { margin:0;font-size:1.35rem; }
.draft-info { color:var(--muted);font-size:.86rem;margin:8px 0 16px; }
.draft-list { display:grid;grid-template-columns:repeat(auto-fill,minmax(430px,1fr));gap:18px; }
.draft-card {
  position:relative;
  display:grid;
  grid-template-columns:108px 1fr;
  gap:18px;
  align-items:center;
  width:100%;
  min-height:150px;
  border:1px solid #344058;
  border-radius:17px;
  background:#171d29;
  color:var(--text);
  padding:14px;
  text-align:left;
  cursor:grab;
}
.draft-card:hover { border-color:var(--accent-2); }
.draft-card.ready {
  border-color:rgba(54,201,149,.75);
  background:rgba(54,201,149,.14);
}
.draft-card.error {
  border-color:rgba(255,132,151,.75);
  background:rgba(255,132,151,.12);
}
.draft-card.new {
  border-color:#405172;
}
.draft-card img {
  width:108px;
  aspect-ratio:3/4.2;
  object-fit:cover;
  border-radius:10px;
  background:#252c3a;
}
.draft-card strong { display:block;font-size:1.15rem;margin-bottom:9px;line-height:1.2; }
.draft-card small { display:block;color:var(--muted);font-size:.9rem;line-height:1.45; }
.draft-actions {
  position:absolute;
  right:14px;
  bottom:14px;
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:8px;
  max-width:calc(100% - 150px);
}
.draft-action-button {
  border:1px solid rgba(255,132,151,.55);
  border-radius:999px;
  background:rgba(255,255,255,.06);
  color:var(--text);
  padding:7px 12px;
  font-weight:800;
  cursor:pointer;
}
.draft-action-button.confirm {
  border-color:rgba(54,201,149,.65);
  background:rgba(54,201,149,.14);
  color:#bcffe8;
}
.draft-action-button.rescan {
  border-color:rgba(90,160,255,.65);
  background:rgba(90,160,255,.13);
  color:#d6e6ff;
}
.draft-action-button.delete {
  border-color:rgba(255,132,151,.55);
  background:rgba(255,132,151,.12);
  color:#ffd4dc;
}
.draft-action-button:hover {
  transform:translateY(-1px);
}
.draft-action-button.delete:hover {
  background:rgba(255,132,151,.22);
  border-color:rgba(255,132,151,.85);
}
.card {
  position:relative;
  min-width: 0;
  overflow: hidden;
  background: linear-gradient(145deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 15px;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  cursor:pointer;
}
.card.reorder-active {
  cursor:grab;
  border-color:rgba(122,167,255,.26);
  box-shadow:inset 0 0 0 1px rgba(122,167,255,.08);
}
.card.reorder-active::after {
  content:"";
  position:absolute;
  inset:7px;
  border:1px dashed rgba(122,167,255,.18);
  border-radius:12px;
  pointer-events:none;
  z-index:1;
}
.card:hover, .card:focus { transform: translateY(-4px); border-color: #59657d; box-shadow: 0 18px 45px rgba(0,0,0,.28); outline: none; }
.card.dragging,.draft-card.dragging {
  opacity:.82;
  cursor:grabbing;
  transform:scale(.965);
  border-color:rgba(255,122,168,.72);
  box-shadow:0 0 0 3px rgba(255,122,168,.18),0 22px 55px rgba(0,0,0,.42);
}
.card.drop-target,.draft-card.drop-target {
  border-color:var(--accent-2);
  transform:translateY(-2px);
  box-shadow:0 0 0 3px rgba(255,122,168,.22), 0 18px 45px rgba(0,0,0,.28);
}
.card.drop-target::before,
.draft-card.drop-target::before {
  content:"Hier einfügen";
  position:absolute;
  left:10px;
  right:10px;
  top:10px;
  z-index:6;
  min-height:26px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:linear-gradient(135deg,var(--accent),var(--accent-2));
  color:#fff;
  font-size:.68rem;
  font-weight:950;
  letter-spacing:.06em;
  text-transform:uppercase;
  box-shadow:0 10px 25px rgba(230,57,123,.32);
}
.reorder-controls {
  position:absolute;
  left:10px;
  bottom:10px;
  display:flex;
  gap:6px;
  z-index:4;
}
.draft-card .reorder-controls {
  left:auto;
  right:12px;
  bottom:12px;
}
.reorder-controls button {
  width:34px;
  height:34px;
  border:1px solid rgba(255,255,255,.18);
  border-radius:999px;
  background:rgba(9,11,16,.84);
  color:white;
  font-weight:800;
  box-shadow:0 8px 20px rgba(0,0,0,.32);
}
.reorder-controls button:hover {
  border-color:var(--accent-2);
  background:rgba(230,57,123,.9);
}
.card.highlight {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px rgba(255,122,168,.24), 0 18px 45px rgba(0,0,0,.28);
}
.figure-card {
  background:linear-gradient(145deg,#15202b,#11151e);
}
.figure-card.review {
  border-color:#f6c453;
  box-shadow:0 0 0 2px rgba(246,196,83,.45), 0 18px 45px rgba(246,196,83,.16);
  background:linear-gradient(145deg,#2d2611,#14151d);
}
.figure-card.wishlisted {
  border-color:var(--accent-2);
  box-shadow:0 0 0 2px rgba(255,122,168,.34), 0 18px 45px rgba(255,122,168,.12);
}
.figure-card .progress-meta {
  gap:10px;
  flex-wrap:wrap;
}
.figure-card .total-label {
  color:#95ebcc;
  font-weight:800;
}
.cover-wrap { position: relative; aspect-ratio: 3 / 4.2; background: #222836; overflow: hidden; }
.cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.confidence { position: absolute; top: 10px; right: 10px; padding: 5px 8px; border-radius: 999px; background: rgba(8,10,15,.8); color: #fff; font-size: .67rem; font-weight: 750; backdrop-filter: blur(5px); }
.confidence.high { color: #95ebcc; }
.confidence.medium { color: #ffd47a; }
.card-body { padding: 17px; }
.card h2 { min-height: 2.5em; font-size: 1.08rem; line-height: 1.25; margin: 0 0 16px; }
.manga-mode .gallery:not(.list) .card {
  border-radius:13px;
}
.manga-mode .gallery:not(.list) .card-body {
  padding:13px 14px 14px;
}
.manga-mode .gallery:not(.list) .card h2 {
  height:2.6em;
  min-height:2.6em;
  margin:0 0 10px;
  font-size:.98rem;
  line-height:1.3;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.manga-mode .gallery:not(.list) .progress-meta {
  font-size:.72rem;
}
.manga-mode .gallery:not(.list) .progress {
  height:4px;
  margin:6px 0 9px;
}
.manga-mode .gallery:not(.list) .card-note {
  min-height:1.35em;
  max-height:2.7em;
  overflow:hidden;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
}
.progress-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: .76rem; }
.progress { height: 5px; margin: 7px 0 12px; background: #2a3140; border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.card-note { color: var(--muted); font-size: .76rem; line-height: 1.4; margin: 0; }

.gallery.list { grid-template-columns: 1fr; gap: 10px; }
.gallery.list .card { display: grid; grid-template-columns: 90px 1fr; }
.figure-gallery.list .figure-card {
  grid-template-columns:90px minmax(0,1fr) 46px;
  align-items:center;
}
.gallery.list .cover-wrap { aspect-ratio: 3/4; }
.gallery.list .card h2 { min-height: auto; margin-bottom: 9px; }
.figure-drag-handle,
.series-drag-handle {
  justify-self:end;
  align-self:stretch;
  width:38px;
  min-height:42px;
  border:1px solid rgba(255,255,255,.16);
  border-radius:12px;
  background:rgba(9,11,16,.7);
  color:#dce6ff;
  font-size:1.25rem;
  font-weight:900;
  cursor:grab;
  display:grid;
  place-items:center;
  margin-right:8px;
  touch-action:none;
}
.series-drag-handle {
  position:absolute;
  left:10px;
  bottom:10px;
  z-index:5;
  width:38px;
  height:38px;
  min-height:38px;
  margin:0;
  border-radius:999px;
  background:linear-gradient(135deg,rgba(19,25,38,.94),rgba(9,11,16,.88));
  box-shadow:0 8px 20px rgba(0,0,0,.32);
}
.card.reorder-active .series-drag-handle {
  border-color:rgba(255,122,168,.45);
  color:#ffd9e7;
}
.figure-drag-handle:hover,
.series-drag-handle:hover {
  border-color:var(--accent-2);
  background:rgba(230,57,123,.2);
}
.figure-drag-handle:active,
.series-drag-handle:active {
  cursor:grabbing;
}

dialog {
  width: min(1000px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #11151e;
  color: var(--text);
  overflow: auto;
}
dialog::backdrop { background: rgba(0,0,0,.78); backdrop-filter: blur(5px); }
.close-button {
  position: sticky; float: right; top: 14px; right: 14px; z-index: 5;
  width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%;
  color: white; background: rgba(9,11,16,.9);
  display:flex;
  align-items:center;
  justify-content:center;
  line-height:1;
  padding:0;
}
.close-button:not(.back-close-button) {
  font-size:0;
}
.close-button:not(.back-close-button)::before {
  content:"×";
  display:block;
  font-size:1.55rem;
  line-height:1;
  transform:translateY(-1px);
}
.close-button.back-close-button {
  width:auto;
  min-width:94px;
  height:40px;
  padding:0 14px;
  border-radius:999px;
  font-size:.88rem;
  font-weight:850;
  letter-spacing:.01em;
  background:rgba(17,21,30,.94);
  display:flex;
  justify-content:center;
  align-items:center;
}
.detail-head { display: grid; grid-template-columns: 220px 1fr; gap: 30px; padding: 34px 34px 18px; background: linear-gradient(135deg, #191e2b, #10141d); }
.detail-cover { width: 100%; border-radius: 10px; aspect-ratio: 3/4.2; object-fit: cover; background: #252c3a; box-shadow: 0 18px 45px rgba(0,0,0,.35); }
.detail-head h2 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1; margin: 7px 0 16px; letter-spacing: -.04em; }
.detail-status-chips {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin:0 0 8px;
}
.detail-status-chips span {
  border:1px solid rgba(255,255,255,.12);
  border-radius:999px;
  background:rgba(255,255,255,.06);
  color:var(--muted);
  padding:4px 9px;
  font-size:.7rem;
  font-weight:900;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.detail-status-chips span.warning {
  border-color:rgba(255,178,64,.42);
  background:rgba(255,178,64,.12);
  color:#ffd08a;
}
.detail-status-chips span.private {
  border-color:rgba(236,56,135,.42);
  background:rgba(236,56,135,.12);
  color:#ff9ccc;
}
.detail-meta-panel {
  margin:0 34px 24px;
  border:1px solid rgba(255,255,255,.09);
  border-radius:18px;
  background:rgba(12,15,23,.34);
  padding:12px;
}
.manga-detail-meta {
  max-width:none;
}
.figure-detail-meta {
  max-width:none;
}
.detail-stats {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(130px,1fr));
  gap:8px;
  margin:0;
}
.detail-stats span {
  background:linear-gradient(135deg,rgba(39,48,68,.94),rgba(28,35,50,.9));
  border:1px solid rgba(122,167,255,.24);
  border-radius:11px;
  padding:9px 10px;
  font-size:.8rem;
  min-height:42px;
  min-width:0;
  overflow:hidden;
  overflow-wrap:anywhere;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.055),0 8px 18px rgba(0,0,0,.14);
}
.figure-detail-meta .detail-stats span {
  padding:10px 11px;
  font-size:.88rem;
  line-height:1.2;
  min-height:48px;
}
.detail-owned-total {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}
.detail-owned-total b {
  display:grid;
  gap:2px;
  min-width:0;
}
.detail-owned-total small {
  color:var(--muted);
  font-size:.7rem;
  font-weight:700;
  line-height:1.1;
}
.detail-stats .price-source {
  border-color:rgba(122,167,255,.42);
}
.detail-stats .price-source.mfc {
  border-color:rgba(54,201,149,.58);
  background:rgba(54,201,149,.12);
}
.detail-stats .price-source.manual {
  border-color:rgba(122,167,255,.54);
  background:rgba(122,167,255,.11);
}
.detail-stats .price-source.estimated {
  border-color:rgba(242,184,75,.58);
  background:rgba(242,184,75,.12);
}
.detail-stats .price-source.missing {
  border-color:rgba(255,132,151,.46);
  background:rgba(255,132,151,.1);
}
.price-source-note {
  margin: -8px 0 12px;
  color: var(--muted);
  font-size: .82rem;
}
.review-hint { color:#ffd66f; border:1px solid rgba(246,196,83,.45); background:rgba(246,196,83,.12); padding:10px 12px; border-radius:10px; }
.price-samples { padding:0 34px 34px; }
.price-samples h3 { margin:0 0 14px; }
.sample-list { display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px; }
.sample-list button {
  border:1px solid var(--line);
  border-radius:12px;
  background:#171d29;
  color:var(--text);
  padding:13px;
  text-align:left;
}
.sample-list strong { display:block;color:#95ebcc;font-size:1.05rem; }
.sample-list span,.sample-list small { display:block;color:var(--muted);font-size:.76rem;line-height:1.35;margin-top:4px; }
.empty-price-samples {
  border:1px solid rgba(64,81,114,.9);
  border-radius:12px;
  background:#171d29;
  padding:14px;
}
.empty-price-samples strong {
  display:block;
  color:#95ebcc;
  font-size:1.05rem;
}
.empty-price-samples span,
.empty-price-samples small {
  display:block;
  color:var(--muted);
  font-size:.78rem;
  line-height:1.35;
  margin-top:5px;
}
.external-link-grid { display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;margin:16px 0; }
.external-link-grid button {
  min-height:74px;
  border:1px solid var(--line);
  border-radius:18px;
  background:rgba(16,22,36,.92);
  color:var(--text);
  text-align:left;
  padding:14px;
  cursor:pointer;
}
.external-link-grid button strong { display:block;font-size:.95rem; }
.external-link-grid button small { display:block;color:var(--muted);font-size:.76rem;line-height:1.35;margin-top:5px; }
.external-link-grid button:hover { border-color:rgba(231,57,127,.65);transform:translateY(-1px); }
.image-result-grid { display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:12px;margin:12px 0 18px; }
.image-result-card {
  border:1px solid var(--line);
  border-radius:16px;
  background:#111827;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
.image-result-card img { width:100%;aspect-ratio:1/1;object-fit:cover;background:#20283a; }
.image-result-card span { display:block;padding:10px;color:var(--muted);font-size:.74rem;line-height:1.25;min-height:48px; }
.image-result-card .image-result-actions { display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:0 8px 8px; }
.image-result-card button { min-height:34px;border-radius:10px;font-size:.74rem;padding:0 8px; }
.source-link { color: var(--accent-2); }
.volumes-section { padding: 28px 34px 38px; }
.volumes-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; }
.volumes-toolbar h3 { margin: 0; }
.volume-actions { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 16px; }
.volume-actions .primary-button { min-height:38px; padding:0 12px; font-size:.78rem; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: .72rem; }
.legend i { width: 9px; height: 9px; display: inline-block; border-radius: 50%; margin-right: 4px; }
.volume-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.volume {
  position:relative;
  min-height: 128px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: #1b202c;
  overflow:hidden;
}
.volume strong { font-size: 1.05rem; }
.volume small { font-size: .63rem; color: var(--muted); }
.volume.owned { border-color: rgba(54,201,149,.55); background: rgba(54,201,149,.12); }
.volume.read { box-shadow: inset 0 0 0 2px rgba(122,167,255,.55); }
.volume.read small::after { content: " · GELESEN"; color: #a9c4ff; }
.volume.wished { border-color: rgba(255,122,168,.65); background: rgba(255,122,168,.13); }
.volume.missing { border-color: rgba(242,184,75,.55); background: rgba(242,184,75,.1); }
.volume.future { color: #7a8497; background: #151923; }
.volume .buy { color: #ffd47a; text-decoration: none; font-size: .74rem; }
.volume .read-toggle,
.volume .owned-toggle,
.volume-source-button {
  width: 94px;
  min-width: 94px;
  min-height: 32px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(122,167,255,.48);
  border-radius:999px;
  background:rgba(122,167,255,.12);
  color:#c8d8ff;
  font-size:.78rem;
  font-weight:800;
}
.volume .owned-toggle {
  border-color:rgba(54,201,149,.5);
  background:rgba(54,201,149,.12);
  color:#c7f4e4;
}
.volume-source-button {
  width:94px;
  min-width:94px;
  min-height:30px;
  border-color:rgba(242,184,75,.5);
  background:rgba(242,184,75,.12);
  color:#ffd47a;
}
.volume-wish-button {
  width:94px;
  min-width:94px;
  border-color:rgba(255,122,168,.5);
  background:rgba(255,122,168,.12);
  color:#ffd2e2;
}
.volume-buy-toggle {
  width:94px;
  min-width:94px;
}
.volume-buy-popover {
  position:absolute;
  inset:7px;
  z-index:2;
  display:grid;
  grid-template-columns:1fr;
  align-content:center;
  justify-items:center;
  gap:6px;
  border:1px solid rgba(242,184,75,.58);
  border-radius:10px;
  background:linear-gradient(180deg,rgba(18,22,32,.98),rgba(35,27,20,.98));
  box-shadow:0 14px 34px rgba(0,0,0,.36);
  padding:8px;
}
.volume-buy-popover[hidden] {
  display:none;
}
.volume-buy-title {
  color:var(--text);
  font-size:.72rem;
  font-weight:900;
  margin-bottom:1px;
}
.volume-buy-close {
  color:var(--muted);
  border-color:rgba(255,255,255,.12);
  background:rgba(255,255,255,.05);
}
.volume .wish { color: var(--accent-2); }
.volume .buy:hover { text-decoration: underline; }
.edit-hint { margin-top: 16px; color: var(--muted); font-size: .78rem; }
.text-button,.danger-button { border:0;background:transparent;padding:8px 0;color:var(--accent-2);margin-right:16px; }
.danger-button { color:#ff8497; }
.delete-confirm-content {
  max-width:520px;
  margin:0 auto;
  padding:18px;
  text-align:center;
}
.delete-confirm-content h2 {
  margin:8px 0 10px;
}
.delete-confirm-content p {
  color:var(--muted);
  line-height:1.45;
}
.delete-confirm-icon {
  width:54px;
  height:54px;
  display:grid;
  place-items:center;
  margin:0 auto 10px;
  border:1px solid rgba(255,132,151,.42);
  border-radius:18px;
  background:linear-gradient(135deg,rgba(255,132,151,.20),rgba(230,57,123,.10));
  color:#ffb4c0;
  font-size:1.4rem;
  font-weight:900;
}
.delete-confirm-content .form-actions {
  justify-content:center;
  margin-top:18px;
}
.delete-confirm-content .danger-button {
  min-height:42px;
  border:1px solid rgba(255,132,151,.45);
  border-radius:999px;
  background:rgba(255,132,151,.10);
  padding:0 18px;
  margin:0;
  font-weight:900;
}
.detail-action-row {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(132px,1fr));
  gap:8px;
  margin-top:12px;
}
.detail-action-button {
  min-height:40px;
  border:1px solid rgba(255,122,168,.34);
  border-radius:999px;
  background:linear-gradient(135deg,rgba(230,57,123,.18),rgba(31,38,53,.92));
  color:#ffd9e7;
  padding:0 12px;
  font-weight:800;
  font-size:.82rem;
  box-shadow:0 8px 22px rgba(0,0,0,.18);
}
.detail-action-button:hover {
  border-color:rgba(255,122,168,.72);
  background:linear-gradient(135deg,rgba(230,57,123,.32),rgba(39,50,74,.96));
}
.detail-action-button:disabled {
  opacity:.58;
  cursor:progress;
}
.detail-action-button.danger {
  border-color:rgba(255,132,151,.42);
  background:linear-gradient(135deg,rgba(255,132,151,.13),rgba(31,38,53,.92));
  color:#ff9aac;
}
.detail-action-button.danger:hover {
  border-color:rgba(255,132,151,.8);
  background:linear-gradient(135deg,rgba(255,132,151,.24),rgba(39,50,74,.96));
}
.danger-outline-button {
  color:#ff8497;
  border-color:rgba(255,132,151,.45);
}
.danger-outline-button:hover {
  border-color:rgba(255,132,151,.8);
  background:rgba(255,132,151,.08);
}
.form-dialog { width:min(650px,calc(100vw - 28px)); }
.form-dialog form,.update-content,.scan-form-content { padding:38px; }
.form-dialog h2,.update-dialog h2 { margin:6px 0 24px;font-size:2rem; }
.form-dialog label { display:grid;gap:7px;color:var(--muted);font-size:.82rem;margin-bottom:16px; }
.form-dialog input,.form-dialog textarea,.form-dialog select {
  width:100%;border:1px solid var(--line);border-radius:10px;background:#1a202c;color:white;padding:12px;
}
.form-dialog label.review-field-missing {
  color:#ff9aac;
}
.form-dialog label.review-field-missing input,
.form-dialog label.review-field-missing textarea,
.form-dialog label.review-field-missing select {
  border-color:rgba(255,99,132,.95);
  box-shadow:0 0 0 2px rgba(255,99,132,.16);
  background:rgba(78,24,39,.42);
}
.compact-options.review-section-missing {
  border-color:rgba(255,99,132,.9);
  box-shadow:0 0 0 2px rgba(255,99,132,.12);
}
.detail-action-button.review-edit-button {
  border-color:rgba(255,214,111,.72);
  background:linear-gradient(135deg,rgba(255,214,111,.22),rgba(230,57,123,.16));
  color:#ffe4a3;
}
.field-note {
  min-height:18px;
  margin:-8px 0 12px;
  color:var(--muted);
  font-size:.78rem;
  line-height:1.35;
}
.field-note.ok {
  color:#78e0b8;
}
.field-note.error {
  color:#ff8d9d;
}
.info-stack {
  display:grid;
  gap:12px;
  margin:12px 0 22px;
  color:var(--muted);
  line-height:1.5;
}
.info-stack p {
  margin:0;
}
.image-url-card {
  margin:18px 0;
  border:1px solid rgba(255,122,168,.28);
  border-radius:18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(230,57,123,.16), transparent 18rem),
    rgba(18,22,32,.86);
  padding:16px;
}
.image-url-card strong {
  display:block;
  color:var(--text);
  font-size:1rem;
  margin-bottom:3px;
}
.image-url-card span {
  display:block;
  color:var(--muted);
  font-size:.8rem;
  line-height:1.35;
}
.image-url-row {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
  margin-top:12px;
}
.image-url-row input {
  min-height:46px;
  width:100%;
  border:1px solid rgba(58,70,94,.9);
  border-radius:12px;
  background:#0f141f;
  color:var(--text);
  padding:0 14px;
  outline:0;
}
.image-url-row input:focus {
  border-color:rgba(255,122,168,.72);
  box-shadow:0 0 0 3px rgba(230,57,123,.12);
}
.image-url-card .field-note {
  margin:10px 2px 0;
}
.mfc-action-row {
  margin:-4px 0 12px;
}
.mfc-helper-card {
  background:linear-gradient(135deg,rgba(39,50,74,.58),rgba(18,22,32,.82));
}
.mfc-helper-card p {
  margin:0 0 8px;
  color:var(--muted);
  font-size:.78rem;
  line-height:1.4;
}
.mfc-helper-card p:last-child {
  margin-bottom:0;
}
.compact-options {
  border:1px solid rgba(64,81,114,.68);
  border-radius:13px;
  background:rgba(18,22,32,.55);
  padding:10px 12px;
  margin:0 0 14px;
}
.compact-options summary {
  cursor:pointer;
  color:#ffd9e7;
  font-weight:800;
  font-size:.86rem;
}
.compact-options[open] summary {
  margin-bottom:12px;
}
.compact-options label {
  margin-bottom:10px;
}
.compact-actions {
  grid-template-columns:repeat(auto-fit,minmax(120px,1fr));
  gap:8px;
}
.compact-actions .primary-button {
  min-height:38px;
  padding:8px 10px;
  font-size:.78rem;
}
.smart-search-box {
  margin:-2px 0 12px;
  border:1px solid rgba(255,122,168,.3);
  border-radius:16px;
  background:
    radial-gradient(circle at 100% 0%, rgba(230,57,123,.13), transparent 16rem),
    rgba(13,18,28,.86);
  padding:12px;
}
.smart-search-box > strong {
  display:block;
  color:#ffd9e7;
  margin-bottom:6px;
}
.smart-search-chips {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin:7px 0 10px;
}
.smart-search-chip {
  border:1px solid rgba(90,160,255,.45);
  border-radius:999px;
  background:rgba(90,160,255,.1);
  color:#dceaff;
  padding:6px 9px;
  font-size:.72rem;
  cursor:pointer;
}
.smart-search-chip:hover {
  border-color:rgba(90,160,255,.8);
  background:rgba(90,160,255,.18);
}
.smart-search-links {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:10px;
}
.compact-smart-links {
  grid-template-columns:repeat(auto-fit,minmax(120px,1fr));
  gap:8px;
}
.smart-search-link {
  text-align:left;
  display:grid;
  gap:3px;
  min-height:42px;
  padding:8px 10px;
}
.smart-search-link span {
  font-weight:800;
}
.smart-search-link small {
  color:var(--muted);
  font-size:.7rem;
  line-height:1.25;
}
.form-row { display:grid;grid-template-columns:1fr 1fr;gap:14px; }
.form-dialog .checkbox { display:flex;align-items:center;grid-template-columns:auto 1fr; }
.form-dialog .checkbox input { width:auto; }
.submit-button { width:100%; }
.form-actions { display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px; }
.form-actions .submit-button { width:auto; }
.photo-preview {
  min-height:160px;
  display:grid;
  place-items:center;
  gap:8px;
  margin-bottom:16px;
  border:1px dashed #3a465e;
  border-radius:14px;
  background:#151a25;
  color:var(--muted);
  overflow:hidden;
}
.photo-preview img {
  max-width:100%;
  max-height:280px;
  display:block;
  object-fit:contain;
}
.photo-preview small { padding:0 12px 12px;color:var(--muted); }
.quick-scan-result {
  margin-top:14px;
}
.quick-scan-result .check-result {
  margin:0;
}
.quick-scan-empty {
  border:1px solid var(--line);
  border-radius:16px;
  background:rgba(18,22,32,.72);
  padding:14px;
  color:var(--muted);
  line-height:1.45;
}
.isbn-camera-panel {
  position:relative;
  margin:0 0 14px;
  border:1px solid rgba(255,255,255,.14);
  border-radius:18px;
  overflow:hidden;
  background:#050812;
  min-height:220px;
}
.isbn-camera-video {
  width:100%;
  min-height:220px;
  max-height:360px;
  display:block;
  object-fit:cover;
  background:#050812;
}
.isbn-camera-frame {
  position:absolute;
  left:8%;
  right:8%;
  top:36%;
  height:28%;
  border:2px solid rgba(236,54,132,.95);
  border-radius:16px;
  box-shadow:0 0 0 999px rgba(0,0,0,.22), 0 0 22px rgba(236,54,132,.38);
  pointer-events:none;
}
.suggestion-box {
  margin:12px 0 16px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#171d29;
  overflow:hidden;
}
.suggestion-card {
  display:grid;
  grid-template-columns:86px 1fr;
  gap:14px;
  padding:12px;
  align-items:center;
}
.candidate-list { display:grid;gap:10px;margin-top:10px; }
.candidate-card {
  position:relative;
  overflow:hidden;
  display:grid;
  grid-template-columns:58px 1fr;
  gap:12px;
  align-items:center;
  width:100%;
  border:1px solid var(--line);
  border-radius:12px;
  background:#171d29;
  color:var(--text);
  padding:10px;
  text-align:left;
}
.candidate-longpress-bar {
  position:absolute;
  left:0;
  right:auto;
  bottom:0;
  width:0;
  height:4px;
  border-radius:0 999px 999px 0;
  background:linear-gradient(90deg,var(--accent),var(--accent-2));
  opacity:0;
  pointer-events:none;
}
.candidate-card.long-press-active .candidate-longpress-bar {
  opacity:1;
  animation:candidateLongPressFill 1.5s linear forwards;
}
@keyframes candidateLongPressFill {
  from { width:0; }
  to { width:100%; }
}
.candidate-card.selected {
  border-color:var(--accent-2);
  box-shadow:0 0 0 2px rgba(255,122,168,.22);
}
.candidate-card img {
  width:58px;
  aspect-ratio:3/4.2;
  object-fit:cover;
  border-radius:7px;
  background:#252c3a;
}
.candidate-card strong,.candidate-card small { display:block; }
.candidate-card small { color:var(--muted);font-size:.76rem;line-height:1.35;margin-top:3px; }
.candidate-card .existing-hit {
  color:#95ebcc;
  font-weight:800;
}
.candidate-card .candidate-actions {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:8px;
}
.candidate-card .mini-link {
  padding:5px 8px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#202737;
  color:var(--text);
  font-size:.72rem;
}
.suggestion-card img {
  width:86px;
  aspect-ratio:3/4.2;
  object-fit:cover;
  border-radius:8px;
  background:#252c3a;
}
.suggestion-card strong { display:block;margin-bottom:7px; }
.suggestion-card span { display:block;color:var(--muted);font-size:.82rem;margin-top:3px; }
.update-dialog { width:min(680px,calc(100vw - 28px)); }
.confirm-dialog {
  width:min(520px,calc(100vw - 32px));
  margin:auto;
}

#ticketCloseConfirmDialog {
  width:min(460px,calc(100vw - 32px));
  margin:auto;
}
.confirm-content { padding:34px; }
.confirm-content h2 { margin:6px 0 12px;font-size:2rem; }
.confirm-content p:not(.eyebrow) { color:var(--muted);line-height:1.5;margin:0 0 24px; }
.confirm-note {
  display:grid;
  gap:4px;
  border:1px solid rgba(255,122,168,.35);
  border-radius:14px;
  background:rgba(230,57,123,.12);
  padding:13px 14px;
  margin:14px 0 20px;
}
.confirm-note strong {
  font-size:1.05rem;
}
.confirm-note span {
  color:var(--muted);
  font-size:.82rem;
}
.confirm-note.danger-note {
  border-color:rgba(255,132,151,.5);
  background:linear-gradient(135deg,rgba(255,132,151,.16),rgba(18,22,32,.9));
}
.confirm-note.danger-note strong {
  color:#ffd2dc;
}
.danger-confirm-button {
  border-color:rgba(255,132,151,.7);
  background:linear-gradient(135deg,#e94f6d,#9f263d);
  color:white;
}
.danger-confirm-button:hover {
  border-color:rgba(255,180,191,.9);
  filter:brightness(1.06);
}
.success-button {
  border-color:rgba(54,201,149,.7);
  background:linear-gradient(135deg,#25b884,#157a5d);
  color:white;
}
.success-button:hover {
  border-color:rgba(145,245,210,.9);
  filter:brightness(1.06);
}
.confirm-skip {
  display:flex;
  align-items:center;
  gap:9px;
  color:var(--muted);
  font-size:.86rem;
  margin:0 0 18px;
}
.confirm-skip input {
  width:18px;
  height:18px;
  accent-color:var(--accent);
}
.spinner { width:38px;height:38px;border:4px solid #30394c;border-top-color:var(--accent);border-radius:50%;animation:spin .8s linear infinite;margin:25px auto; }
@keyframes spin { to { transform:rotate(360deg); } }
.update-result { display:flex;justify-content:space-between;gap:16px;padding:11px 0;border-bottom:1px solid var(--line); }
.update-result span { color:var(--muted); }
.update-result.failed span { color:#ff8d9d; }
.scan-progress-box {
  border:1px solid rgba(122,167,255,.22);
  border-radius:16px;
  background:rgba(12,16,26,.62);
  padding:14px;
  margin:0 0 12px;
}
.scan-progress-head {
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  font-size:.9rem;
}
.scan-progress-head span {
  color:var(--muted);
  font-weight:800;
}
.scan-progress-bar {
  height:9px;
  border-radius:999px;
  background:rgba(255,255,255,.08);
  overflow:hidden;
  margin:10px 0 8px;
}
.scan-progress-bar i {
  display:block;
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg,var(--accent),#ff78bd);
  transition:width .25s ease;
}
.scan-progress-box p {
  margin:0;
  color:var(--muted);
  font-size:.82rem;
  line-height:1.35;
}
.share-text {
  width:100%;
  margin:16px 0;
  border:1px solid var(--line);
  border-radius:12px;
  background:#151a25;
  color:var(--text);
  padding:12px;
  resize:vertical;
}
.friend-share-hero,
.friend-settings-card {
  border:1px solid var(--line);
  background:linear-gradient(135deg,rgba(18,22,32,.96),rgba(28,18,34,.78));
  border-radius:20px;
  padding:18px;
  margin:16px 0;
}
.friend-share-hero {
  display:flex;
  gap:14px;
  align-items:center;
  justify-content:space-between;
}
.friend-share-hero strong,
.friend-card strong {
  display:block;
}
.friend-share-hero span,
.friend-card span,
.section-title-row span {
  color:var(--muted);
  font-size:.86rem;
}
.friend-grid-section {
  margin:20px 0;
}
.section-title-row {
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:end;
  margin-bottom:10px;
}
.section-title-row h3,
.friend-settings-card h3 {
  margin:0 0 10px;
}
.friend-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:12px;
}
.friend-list-scroll {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:12px;
  max-height:260px;
  overflow:auto;
  padding-right:4px;
}
.friend-card {
  min-height:118px;
  border:1px solid var(--line);
  background:#111722;
  border-radius:18px;
  padding:14px;
  display:grid;
  gap:10px;
  cursor:pointer;
  position:relative;
}
.friend-card:hover,
.friend-card:focus-visible {
  border-color:rgba(230,57,123,.72);
  outline:none;
}
.add-friend-card {
  border-style:dashed;
  align-items:center;
  justify-items:center;
  text-align:center;
}
.add-friend-plus {
  width:46px;
  height:46px;
  border:1px dashed rgba(255,255,255,.42);
  border-radius:50%;
  display:grid;
  place-items:center;
  font-size:1.7rem;
  color:var(--accent-2);
}
.friend-avatar {
  width:44px;
  height:44px;
  border-radius:14px;
  background:linear-gradient(135deg,var(--accent),var(--accent-2));
  color:white;
  display:grid;
  place-items:center;
  font-weight:900;
  letter-spacing:.03em;
}
.friend-card-actions {
  position:absolute;
  top:10px;
  right:10px;
  display:flex;
  gap:6px;
}
.friend-card-actions .text-button {
  position:static;
  font-size:1.2rem;
  line-height:1;
  padding:2px 4px;
}
.danger-text-button {
  color:#ff8d9d;
}
.friend-toggle-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(120px,1fr));
  gap:10px;
  margin:10px 0 16px;
}
.dialog-back-button {
  width:auto;
  min-height:40px;
  padding:9px 14px;
  margin:0 0 12px auto;
  position:sticky;
  top:12px;
  right:0;
  z-index:6;
  display:flex;
  justify-content:center;
  align-items:center;
}
.share-subheading {
  display:flex;
  justify-content:center;
  align-items:center;
  min-height:34px;
  margin:14px 0 10px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:999px;
  background:rgba(255,255,255,.035);
  color:var(--text);
  font-weight:800;
  letter-spacing:.02em;
}
.friend-toggle {
  border:1px solid var(--line);
  border-radius:14px;
  background:#0d1119;
  padding:12px;
  display:flex;
  align-items:center;
  gap:10px;
}
.friend-toggle input {
  width:20px;
  height:20px;
}
.share-exclusion-group {
  margin:10px 0;
}
.share-exclusion-list {
  display:grid;
  gap:8px;
  margin-top:12px;
  max-height:260px;
  overflow:auto;
  padding-right:4px;
}
.share-exclusion-row {
  display:flex;
  align-items:center;
  gap:10px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#0d1119;
  padding:10px 12px;
}
.share-exclusion-row input {
  width:20px;
  height:20px;
  accent-color:var(--accent);
}
.share-exclusion-row span {
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.share-option-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:10px;
}
.share-export-summary {
  border:1px solid rgba(255,255,255,.09);
  border-radius:18px;
  background:rgba(13,17,25,.72);
  padding:12px;
  margin:8px 0 14px;
}
.share-summary-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(90px,1fr));
  gap:8px;
}
.share-summary-grid div {
  border:1px solid var(--line);
  border-radius:14px;
  background:#101622;
  padding:10px;
}
.share-summary-grid strong {
  display:block;
  font-size:1.15rem;
}
.share-summary-grid span {
  color:var(--muted);
  font-size:.8rem;
}
.share-export-summary ul {
  margin:10px 0 0;
  padding-left:18px;
  color:var(--muted);
  font-size:.85rem;
}
.friend-collection-filters {
  margin-bottom:14px;
}
.friend-collection-filters .active {
  border-color:rgba(230,57,123,.8);
  background:rgba(230,57,123,.18);
}
.friend-owner-filter-row {
  display:flex;
  gap:8px;
  overflow:auto;
  padding:0 0 12px;
  margin-bottom:8px;
}
.friend-owner-chip {
  border:1px solid var(--line);
  border-radius:999px;
  background:#0d1119;
  color:var(--text);
  padding:8px 12px;
  white-space:nowrap;
  font-weight:800;
}
.friend-owner-chip.active {
  border-color:rgba(255,183,74,.75);
  background:rgba(255,183,74,.14);
  color:var(--accent-2);
}
.friend-collection-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:12px;
}
.friend-collection-card {
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:18px;
  background:#0d1119;
  cursor:pointer;
}
.friend-collection-card:hover,
.friend-collection-card:focus-visible {
  border-color:rgba(230,57,123,.72);
  outline:none;
}
.friend-collection-cover {
  aspect-ratio:3/4;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,rgba(230,57,123,.16),rgba(255,183,74,.12));
  color:var(--muted);
  font-weight:800;
}
.friend-collection-cover img {
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.friend-collection-body {
  display:grid;
  gap:5px;
  padding:12px;
}
.friend-collection-body strong {
  line-height:1.2;
}
.friend-collection-body span,
.friend-collection-body small {
  color:var(--muted);
  font-size:.84rem;
}
.friend-collection-body em {
  width:max-content;
  border:1px solid rgba(255,183,74,.45);
  border-radius:999px;
  color:var(--accent-2);
  padding:3px 8px;
  font-size:.75rem;
  font-style:normal;
}
.wishlist-link { margin:0;padding:0; }
.status-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(145px,1fr));
  gap:12px;
  margin-bottom:20px;
}
.status-grid div {
  border:1px solid var(--line);
  border-radius:16px;
  background:linear-gradient(180deg,rgba(23,29,41,.96),rgba(15,19,29,.96));
  padding:15px 16px;
  min-height:78px;
  box-shadow:0 12px 34px rgba(0,0,0,.16);
}
.status-grid div.status-license.active {
  border-color:rgba(64,214,142,.55);
  background:linear-gradient(180deg, rgba(64,214,142,.16), #17251f);
}
.status-grid div.status-license.active strong {
  color:#6df0ae;
}
.status-grid div.status-license.inactive {
  border-color:rgba(255,93,122,.55);
  background:linear-gradient(180deg, rgba(255,93,122,.14), #271923);
}
.status-grid div.status-license.inactive strong {
  color:#ff8ca3;
}
.status-grid strong {
  display:block;
  font-size:1.22rem;
  line-height:1.1;
  margin-bottom:6px;
}
.status-grid span,
.status-block p span {
  color:var(--muted);
  font-size:.8rem;
}
.status-block {
  margin-top:18px;
  border-top:1px solid var(--line);
  padding-top:16px;
}
.collection-name-settings,
.value-settings-card {
  border:1px solid rgba(64,81,114,.68);
  border-radius:14px;
  background:rgba(18,22,32,.55);
  padding:14px;
  margin:12px 0 22px;
}
.collection-name-settings .form-actions {
  margin-top:10px;
}
.value-settings-card h4 {
  margin:0 0 6px;
}
.value-factor-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  margin:10px 0;
}
.value-settings-card .form-actions {
  margin-top:10px;
}
.collection-name-settings + .status-grid {
  margin-top:6px;
}
.status-block h3 {
  margin:0 0 10px;
}
.status-block p {
  margin:7px 0;
  overflow-wrap:anywhere;
}
.test-mode-card {
  border:1px solid rgba(233,52,124,.42);
  border-radius:16px;
  background:linear-gradient(135deg,rgba(233,52,124,.16),rgba(18,24,36,.95));
  padding:14px;
  margin:12px 0 16px;
}
.test-mode-card strong {
  display:block;
  margin-bottom:5px;
  font-size:1rem;
}
.test-mode-card p {
  color:var(--muted);
  margin-bottom:12px;
}
.beta-checklist {
  margin:10px 0 14px 18px;
  padding:0;
  color:var(--muted);
  font-size:.86rem;
}
.beta-checklist li {
  margin:5px 0;
}
.settings-tabs {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:18px 0 2px;
}
.settings-tab {
  border:1px solid var(--line);
  border-radius:999px;
  background:#121824;
  color:var(--text);
  min-height:38px;
  padding:0 14px;
  font-weight:800;
  cursor:pointer;
}
.settings-tab.active {
  border-color:var(--accent);
  background:linear-gradient(135deg,var(--accent),#c62366);
}
.settings-tab-private {
  border-color:rgba(255,105,130,.55);
  color:#ff9bad;
  box-shadow:inset 0 0 0 1px rgba(255,105,130,.12);
}
.settings-tab-private.active {
  border-color:#ff6b83;
  background:linear-gradient(135deg,#9d2437,#e23d5b);
  color:white;
}
.settings-panel {
  display:none;
}
.settings-panel.active {
  display:block;
}
.private-marker {
  display:inline-flex;
  align-items:center;
  gap:5px;
  border:1px solid rgba(255,105,130,.5);
  border-radius:999px;
  background:rgba(255,105,130,.12);
  color:#ff9bad;
  padding:3px 8px;
  font-size:.72rem;
  font-weight:900;
  vertical-align:middle;
}
.status-block label {
  display:grid;
  gap:6px;
  color:var(--muted);
  font-size:.82rem;
  margin:10px 0;
}
.status-block input {
  width:100%;
  border:1px solid var(--line);
  border-radius:10px;
  background:#1a202c;
  color:white;
  padding:11px 12px;
}
.sync-block .form-actions {
  margin:10px 0;
}
.sync-status-card {
  border:1px solid var(--line);
  border-radius:16px;
  padding:14px;
  margin:10px 0 14px;
  background:rgba(18,22,32,.72);
}
.sync-status-card strong {
  display:block;
  margin-bottom:6px;
}
.sync-status-card p {
  margin:0 0 6px;
}
.sync-status-card small {
  color:var(--muted);
  line-height:1.35;
}
.sync-status-card.active {
  border-color:rgba(64,214,142,.48);
  background:linear-gradient(180deg, rgba(64,214,142,.14), rgba(18,32,25,.74));
}
.sync-status-card.active strong {
  color:#6df0ae;
}
.sync-status-card.inactive {
  border-color:rgba(255,183,74,.38);
  background:linear-gradient(180deg, rgba(255,183,74,.11), rgba(31,24,18,.72));
}
.sync-status-card.inactive strong {
  color:#ffd08a;
}
.sync-config-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  margin:10px 0;
}
.backup-list {
  display:grid;
  gap:9px;
}
.backup-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#171d29;
  padding:11px 13px;
}
.backup-row strong,
.backup-row small {
  display:block;
}
.backup-row small {
  color:var(--muted);
  margin-top:4px;
  font-size:.74rem;
}

.support-user-tickets {
  margin-top:18px;
}

.support-compose {
  display:grid;
  gap:16px;
  margin:2px 0 20px;
  padding:18px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:20px;
  background:linear-gradient(180deg,rgba(255,255,255,.045),rgba(255,255,255,.018));
}

.public-contact-box {
  display:grid;
  gap:8px;
  margin:0 0 16px;
  padding:14px 16px;
  border:1px solid rgba(255,122,168,.26);
  border-radius:16px;
  background:rgba(230,57,123,.09);
}

.public-contact-box strong {
  color:var(--text);
}

.public-contact-box p {
  margin:0;
  color:var(--muted);
  line-height:1.45;
}

.public-contact-links {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.public-contact-links a,
.public-contact-links span {
  border:1px solid rgba(255,255,255,.1);
  border-radius:999px;
  background:rgba(255,255,255,.04);
  color:var(--text);
  padding:7px 10px;
  text-decoration:none;
  font-size:.86rem;
}

.support-compose .draft-info {
  margin:0;
  line-height:1.5;
}

.support-field {
  display:grid;
  gap:8px;
  margin:0;
  color:var(--muted);
  font-size:.84rem;
  font-weight:700;
}

.support-field select,
.support-field input,
.support-field textarea {
  width:100%;
  border:1px solid rgba(255,255,255,.12);
  border-radius:16px;
  background:#101722;
  color:var(--text);
  padding:14px 15px;
  font:inherit;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035);
}

.support-field select:focus,
.support-field input:focus,
.support-field textarea:focus {
  outline:none;
  border-color:rgba(255,122,168,.72);
  box-shadow:0 0 0 3px rgba(255,122,168,.16);
}

.field-hint {
  color:var(--muted);
  font-weight:500;
  font-size:.76rem;
}

.support-message-field textarea {
  min-height:170px;
  line-height:1.48;
  resize:vertical;
}

.support-upload-card {
  display:grid;
  gap:10px;
  border:1px solid rgba(255,122,168,.22);
  border-radius:16px;
  background:rgba(255,122,168,.06);
  padding:14px;
}
.support-upload-card strong {
  display:block;
  color:var(--text);
  margin-bottom:3px;
}
.support-upload-card span {
  color:var(--muted);
  font-size:.82rem;
  line-height:1.4;
}
.support-upload-card .primary-button {
  min-height:38px;
}

.support-footer {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}

.support-diagnostics-toggle {
  margin:0;
  padding:10px 12px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  background:rgba(255,255,255,.025);
}

.support-diagnostics-text {
  margin:0;
}

.support-replies {
  display:grid;
  gap:8px;
  margin-top:10px;
}

.support-reply {
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px;
  padding:10px;
  background:rgba(255,255,255,.03);
}

.support-reply p {
  margin:4px 0 0;
}

.support-inline-reply {
  display:block;
  margin-top:12px;
}
.shop-balance {
  display:flex;
  align-items:end;
  gap:10px;
  border:1px solid rgba(255,122,168,.35);
  border-radius:16px;
  background:linear-gradient(135deg, rgba(230,57,123,.18), rgba(38,45,65,.75));
  padding:16px;
  margin-bottom:14px;
}
.shop-balance strong {
  font-size:2.1rem;
  line-height:1;
}
.shop-balance span {
  color:var(--muted);
  padding-bottom:3px;
}
.shop-note {
  border:1px solid rgba(255,122,168,.35);
  border-radius:16px;
  background:rgba(255,122,168,.08);
  padding:14px;
  margin:0 0 16px;
}
.shop-note strong {
  display:block;
  margin-bottom:6px;
}
.shop-note p {
  color:var(--muted);
  margin:0 0 10px;
}
.shop-note ul {
  margin:0;
  padding-left:18px;
  color:var(--muted);
  line-height:1.55;
}
.shop-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:12px;
  margin:18px 0 6px;
}
.shop-card {
  display:grid;
  gap:10px;
  border:1px solid var(--line);
  border-radius:16px;
  background:#171d29;
  padding:16px;
}
.shop-card.featured {
  border-color:rgba(255,122,168,.55);
  box-shadow:0 0 0 1px rgba(255,122,168,.16), 0 14px 32px rgba(230,57,123,.12);
}
.shop-card.owned-product {
  border-color:rgba(54,201,149,.65);
  background:linear-gradient(135deg,rgba(54,201,149,.12),#171d29);
}
.shop-card.sync-card {
  background:linear-gradient(180deg, rgba(83,115,255,.11), #171d29);
  border-color:rgba(111,146,255,.38);
}
.shop-card.sync-card span {
  color:#93a8ff;
}
.shop-card span {
  color:var(--accent-2);
  font-size:.75rem;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.shop-card strong {
  font-size:1.35rem;
}
.shop-card small {
  color:var(--muted);
  line-height:1.35;
}
.disabled-button {
  opacity:.72;
  cursor:not-allowed;
}

@media (max-width: 700px) {
  body {
    background:
      radial-gradient(circle at 100% 0%, rgba(230,57,123,.2), transparent 18rem),
      linear-gradient(180deg, #0d1017 0, var(--bg) 24rem);
    -webkit-text-size-adjust: 100%;
  }

  .area-option-list {
    grid-template-columns:1fr;
    gap:10px;
  }

  .settings-tip-card {
    grid-template-columns:auto 1fr;
  }

  .settings-tip-card .primary-button {
    grid-column:1 / -1;
    width:100%;
  }

  .tile-option-list {
    grid-template-columns:1fr;
  }

  .tile-option-card {
    grid-template-columns:1fr auto;
  }

  .tile-option-name {
    text-align:left;
  }

  .tile-preview-card {
    grid-column:1 / -1;
    min-height:64px;
  }

  .area-option {
    min-height:auto;
    padding:14px;
    border-radius:16px;
    transform:none;
  }

  .area-option:hover,
  .area-option:focus-within {
    transform:none;
  }

  .area-option input,
  .form-dialog .area-option input,
  .status-block .area-option input {
    flex-basis:26px;
    width:26px;
    height:26px;
    min-height:26px;
  }

  .value-factor-grid {
    grid-template-columns:1fr;
  }

  .sync-config-grid {
    grid-template-columns:1fr;
  }

  .topbar {
    min-height: 0;
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 22px 14px 14px;
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(9,11,16,.94);
    backdrop-filter: blur(14px);
  }

  .global-actions {
    top: 18px;
    right: 14px;
  }

  .global-actions .icon-button {
    width: 42px;
    height: 42px;
  }

  .eyebrow {
    font-size: .62rem;
    margin-bottom: 5px;
  }

  .topbar .eyebrow,
  .topbar .subtitle {
    display: none;
  }

  .topbar #collectionEyebrow:not([hidden]) {
    display: block;
    max-width: calc(100vw - 170px);
    margin: 0 0 3px;
    background: linear-gradient(180deg, #a85cff 0%, #c64cff 42%, #ff18d6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    font-size: .68rem;
    font-weight: 740;
    line-height: 1.1;
    letter-spacing: .055em;
    text-transform: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  h1 {
    font-size: 2.05rem;
    letter-spacing: -.045em;
    max-width: calc(100vw - 170px);
    line-height: 1.02;
    overflow-wrap: anywhere;
  }

  .subtitle {
    max-height: 2.6em;
    overflow: hidden;
    margin-top: 8px;
    font-size: .76rem;
    line-height: 1.3;
  }

  .mode-tabs {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
  }

  .mode-tab {
    min-height: 42px;
  }

  .desktop-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
    gap: 8px;
    justify-content: stretch;
    overflow: visible;
    padding-bottom: 4px;
    scrollbar-width: thin;
    padding-right: 0;
  }

  .desktop-actions .primary-button,
  .desktop-actions .icon-button {
    min-width: 0;
    width: auto;
    white-space: nowrap;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 11px;
    font-size: .8rem;
  }

  .desktop-actions .icon-button {
    min-width: 108px;
    padding: 0 10px;
    font-size: .78rem;
  }

  #estimateFigureSalesButton {
    min-width: 126px;
  }

  main {
    padding: 14px 12px 82px;
  }

  .toolbar {
    position: static;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 0 -12px 12px;
    padding: 8px 12px;
    background: rgba(9,11,16,.9);
    border-bottom: 1px solid rgba(40,48,67,.72);
  }

  .search-row {
    grid-template-columns:minmax(0,1fr) 68px;
    gap:8px;
  }

  .filter-drawer {
    width:100%;
    min-width:0;
  }

  .filter-drawer summary {
    width:100%;
    height:42px;
    border-radius:14px;
  }

  .filter-drawer-content {
    position:static;
    width:100%;
    grid-template-columns:1fr;
    margin-top:8px;
    box-shadow:none;
  }

  .header-actions { width: 100%; }
  .search {
    flex: 1;
    height: 44px;
  }
  .search input { width: 100%; }

  .layout-cycle-button {
    min-width:68px;
    height:44px;
    border-radius:13px;
  }

  .sort-select {
    width:100%;
    min-height: 38px;
    padding: 0 8px;
    font-size: .75rem;
  }

  .sort-select select { width:100%; }

  #mangaFilterWrap,
  #mangaSortWrap,
  #figureSortWrap,
  #figureFilterWrap,
  #mobileSortWrap {
    grid-column: 1;
  }

  #mangaFilterWrap span,
  #mangaSortWrap span,
  #figureSortWrap span,
  #figureFilterWrap span,
  #mobileSortWrap span {
    display: none;
  }

  #missingOnly {
    grid-column: 1;
  }

  #viewToggle {
    width: 44px;
    height: 42px;
  }

  .filter-button {
    margin: 0;
    min-height: 38px;
    height: auto;
    padding: 0 12px;
    font-size: .78rem;
  }

  .summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding-bottom: 4px;
  }

  .figures-mode .summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .figures-mode .summary > div:nth-child(5) {
    grid-column: 1 / -1;
  }

  .summary > div {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgba(18,22,32,.82);
    padding: 12px 10px;
    text-align: left;
  }

  .figures-mode .summary > div {
    min-width:112px;
  }

  .summary strong {
    font-size: 1.05rem;
  }

  .summary span {
    font-size: .67rem;
  }

  .dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
  }

  .dashboard article {
    padding: 11px;
    min-height: 68px;
  }

  .dashboard strong {
    font-size: 1rem;
  }

  .dashboard span {
    font-size:.7rem;
  }

  .notice {
    margin: 12px 0 14px;
    font-size: .75rem;
    line-height: 1.35;
  }

  .mobile-install-hint {
    display:flex;
  }

  .mobile-install-hint .primary-button {
    min-height:38px;
    padding:0 12px;
    white-space:nowrap;
  }

  .check-section {
    margin: 0 -2px 14px;
    padding: 14px;
    border-radius: 15px;
  }

  .check-head {
    flex-direction: column;
    gap: 10px;
  }

  .credit-panel {
    width: 100%;
    min-width: 0;
    display:flex;
    justify-content:space-between;
    align-items:center;
    text-align:left;
  }

  .check-actions {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .check-actions .sort-select {
    grid-column: 1 / -1;
  }

  .check-actions .primary-button {
    min-height: 40px;
    padding: 0 10px;
    font-size: .78rem;
  }

  #checkPickFilesButton {
    grid-column: 1 / -1;
  }

  .check-results {
    grid-template-columns: 1fr;
  }

  .check-result {
    grid-template-columns: 72px 1fr;
    gap: 10px;
    padding: 11px;
  }

  .check-result img {
    width: 72px;
    height: 104px;
  }

  .check-links .text-button {
    padding: 6px 9px;
    font-size: .74rem;
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
  }

  .manga-mode .gallery:not(.list) {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
  }

  .gallery.layout-compact:not(.list) {
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:8px;
  }

  .gallery.layout-gallery:not(.list) {
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:6px;
  }

  .gallery.list {
    grid-template-columns: 1fr;
  }

  .gallery.list .card {
    grid-template-columns: 76px 1fr;
  }

  .figure-gallery.list .figure-card {
    grid-template-columns:76px minmax(0,1fr) 40px;
  }

  .figure-drag-handle {
    width:34px;
    min-height:38px;
    margin-right:4px;
    font-size:1.05rem;
  }

  .card {
    border-radius: 13px;
  }

  .card:hover,
  .card:focus {
    transform: none;
    box-shadow: none;
  }

  .card.dragging,
  .draft-card.dragging {
    transform:scale(.965);
    box-shadow:0 0 0 3px rgba(255,122,168,.18),0 18px 42px rgba(0,0,0,.36);
  }

  .card.drop-target,
  .draft-card.drop-target {
    transform:translateY(-2px);
    box-shadow:0 0 0 3px rgba(255,122,168,.22),0 14px 34px rgba(0,0,0,.3);
  }

  .card-body {
    padding: 11px;
  }

  .card h2 {
    min-height: 2.7em;
    margin-bottom: 9px;
    font-size: .88rem;
    line-height: 1.28;
  }

  .manga-mode .gallery:not(.list) .card h2 {
    height:2.55em;
    min-height:2.55em;
    margin-bottom:8px;
    font-size:.86rem;
    line-height:1.28;
  }

  .kind {
    font-size: .58rem;
    margin-bottom: 5px;
  }

  .progress-meta {
    gap: 5px;
    flex-direction: column;
    font-size: .66rem;
  }

  .progress {
    margin: 7px 0 8px;
  }

  .card-note {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 2.6em;
    overflow: hidden;
    font-size: .65rem;
  }

  .confidence {
    top: 7px;
    right: 7px;
    padding: 4px 6px;
    font-size: .55rem;
  }

  .reorder-controls {
    left: 7px;
    bottom: 7px;
  }

  .reorder-controls button {
    width: 30px;
    height: 30px;
  }

  .draft-section {
    margin-top: 20px;
    padding: 14px;
    border-radius: 15px;
  }

  .draft-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .draft-card {
    grid-template-columns: 82px 1fr;
    min-height: 116px;
    gap: 12px;
    padding: 10px 10px 54px;
  }

  .draft-card img {
    width: 82px;
  }

  .draft-card strong {
    font-size: .96rem;
  }

  .draft-card small {
    font-size: .74rem;
  }

  .draft-actions {
    left:10px;
    right:10px;
    bottom:10px;
    max-width:none;
    justify-content:flex-start;
  }

  .draft-action-button {
    padding:6px 9px;
    font-size:.72rem;
  }

  dialog {
    width: 100vw;
    max-width: 100vw;
    max-height: 100dvh;
    height: 100dvh;
    margin: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .close-button {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
  }

  .close-button.back-close-button {
    width:auto;
    min-width:92px;
    height:38px;
    padding:0 12px;
    font-size:.84rem;
  }

  .detail-head {
    grid-template-columns: 108px 1fr;
    padding: 24px 14px 12px;
    gap: 14px;
  }

  .detail-head h2 {
    font-size: 1.55rem;
    line-height: 1.04;
  }

  .detail-stats {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap: 6px;
    margin: 12px 0;
  }

  .detail-stats span {
    padding: 7px 9px;
    font-size: .7rem;
  }

  .figure-detail-meta .detail-stats span {
    padding: 8px 9px;
    font-size: .78rem;
    min-height: 46px;
  }

  .detail-meta-panel {
    margin:0 14px 18px;
    padding:10px;
    border-radius:15px;
  }

  .detail-action-row {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:7px;
  }

  .detail-action-button {
    min-height:38px;
    padding:0 9px;
    font-size:.76rem;
  }

  .volumes-section,
  .price-samples {
    padding: 18px 14px 28px;
  }

  .volumes-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .volume-actions {
    display:grid;
    grid-template-columns:1fr;
    gap:7px;
  }

  .volume-actions .primary-button {
    width:100%;
  }

  .volume-grid {
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    gap: 9px;
  }

  .volume {
    min-height: 124px;
    border-radius: 9px;
  }

  .volume strong {
    font-size: .95rem;
  }

  .volume small,
  .volume .buy {
    font-size: .72rem;
  }

  .volume .read-toggle,
  .volume .owned-toggle {
    width: 88px;
    min-width: 88px;
    min-height: 32px;
    font-size: .72rem;
  }

  .volume-source-button {
    width: 88px;
    min-width: 88px;
    min-height: 30px;
    font-size: .7rem;
  }

  .form-dialog,
  .update-dialog,
  .confirm-dialog {
    width: 100vw;
  }

  .form-dialog form,
  .update-content,
  .confirm-content,
  .scan-form-content {
    padding: 26px 14px 32px;
  }

  .form-dialog h2,
  .update-dialog h2,
  .confirm-content h2 {
    font-size: 1.55rem;
    margin-bottom: 18px;
  }

  .form-row,
  .form-actions {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .mfc-action-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .mfc-action-row .primary-button:first-child {
    grid-column: 1 / -1;
  }

  .image-url-card {
    padding:14px;
    border-radius:16px;
  }

  .image-url-row {
    grid-template-columns:1fr;
  }

  .image-url-row .primary-button {
    width:100%;
  }

  .form-dialog label {
    margin-bottom: 13px;
  }

  .form-dialog input,
  .form-dialog textarea,
  .form-dialog select {
    min-height: 44px;
    font-size: 16px;
  }

  .photo-preview {
    min-height: 130px;
  }

  .candidate-card,
  .suggestion-card {
    grid-template-columns: 64px 1fr;
  }

  .candidate-card img,
  .suggestion-card img {
    width: 64px;
  }

  .backup-row {
    align-items:flex-start;
    flex-direction:column;
  }

  .support-compose {
    padding:14px;
    border-radius:16px;
  }

  .support-footer {
    align-items:stretch;
    flex-direction:column;
  }

  .support-footer .primary-button {
    width:100%;
  }

  .support-message-field textarea {
    min-height:190px;
    font-size:16px;
  }
}

@media (max-width: 380px) {
  .gallery {
    gap: 9px;
  }

  .card-body {
    padding: 9px;
  }

  .card h2 {
    font-size: .8rem;
  }

  .desktop-actions {
    grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
  }
}

.gallery.layout-compact:not(.list) .card-note,
.gallery.layout-compact:not(.list) .prepared-card-body .card-note,
.gallery.layout-compact:not(.list) .prepared-item-body .card-note {
  display:none !important;
}
