:root {
  --bg: #0b1020; --bg-elev: #12182b; --bg-card: #182038; --bg-hover: #212b4a;
  --border: rgba(148, 163, 184, 0.16); --border-strong: rgba(148, 163, 184, 0.28);
  --text: #f1f5f9; --text-muted: #94a3b8;
  --accent: #e11d48; --accent-hover: #f43f5e; --accent-soft: rgba(225, 29, 72, 0.16);
  --gold: #f59e0b; --green: #10b981; --danger: #ef4444;
  --binder-sheet: #0e1425; --pocket-bg: rgba(255, 255, 255, 0.03);
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
  --radius: 14px; --radius-sm: 9px; --sidebar-w: 272px;
}
[data-theme="light"] {
  --bg: #f1f5f9; --bg-elev: #ffffff; --bg-card: #ffffff; --bg-hover: #f8fafc;
  --border: rgba(15, 23, 42, 0.1); --border-strong: rgba(15, 23, 42, 0.2);
  --text: #0f172a; --text-muted: #64748b;
  --binder-sheet: #e2e8f0; --pocket-bg: rgba(15, 23, 42, 0.04);
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
.muted-text { color: var(--text-muted); font-size: 0.86rem; }
.spacer { flex: 1; } .ml-auto { margin-left: auto; } .grow { flex: 1; }
.center-text { text-align: center; } .center-wrap { display: flex; justify-content: center; margin-top: 14px; }
.auth-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(circle at 20% 20%, rgba(225,29,72,0.22), transparent 45%), radial-gradient(circle at 80% 80%, rgba(245,158,11,0.18), transparent 45%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: 20px; padding: 32px 28px; box-shadow: var(--shadow); }
.auth-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.auth-logo h1 { margin: 0; font-size: 1.4rem; } .auth-logo p { margin: 2px 0 0; }
.auth-card h2 { margin: 0 0 6px; font-size: 1.15rem; }
.auth-subtext { margin: 0 0 20px; color: var(--text-muted); font-size: 0.9rem; line-height: 1.45; }
.auth-footnote { margin: 18px 0 0; font-size: 0.78rem; color: var(--text-muted); text-align: center; }
.app-shell { display: flex; height: 100vh; overflow: hidden; }
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 40; }
.sidebar { width: var(--sidebar-w); flex-shrink: 0; background: var(--bg-elev); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 50; }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 12px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 36px; height: 36px; border-radius: 10px; }
.brand-name { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em; }
.brand-tag { font-size: 0.72rem; color: var(--gold); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.sidebar-quick-actions { padding: 0 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 4px 10px 14px; }
.nav-section-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 8px 6px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; color: var(--text-muted); }
.nav-group { display: flex; flex-direction: column; gap: 3px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: none; background: transparent; color: var(--text); border-radius: var(--radius-sm); cursor: pointer; font-size: 0.92rem; text-align: left; transition: background 0.15s; }
.nav-item:hover { background: var(--bg-hover); }
.nav-item.active { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.nav-emoji { font-size: 1.05rem; width: 22px; text-align: center; flex-shrink: 0; }
.nav-color-bar { width: 4px; height: 18px; border-radius: 4px; flex-shrink: 0; }
.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge { font-size: 0.75rem; padding: 2px 7px; border-radius: 99px; background: rgba(148,163,184,0.16); color: var(--text-muted); font-weight: 600; }
.sidebar-footer { padding: 12px 12px 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.cache-pill { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: var(--radius-sm); background: var(--bg-card); border: 1px solid var(--border); cursor: pointer; transition: border-color 0.15s; }
.cache-pill:hover { border-color: var(--border-strong); }
.cache-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); flex-shrink: 0; box-shadow: 0 0 8px rgba(16,185,129,0.6); }
.cache-pill-text { flex: 1; min-width: 0; }
.cache-pill-text strong { display: block; font-size: 0.82rem; }
.cache-pill-text small { display: block; font-size: 0.74rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.footer-row { display: flex; gap: 4px; }
.ghost-btn { flex: 1; background: transparent; border: 1px solid transparent; color: var(--text-muted); padding: 6px 8px; border-radius: 8px; font-size: 0.78rem; cursor: pointer; }
.ghost-btn:hover { background: var(--bg-hover); color: var(--text); }
.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.share-banner { background: linear-gradient(90deg, #1d4ed8, #7c3aed); color: #fff; padding: 8px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 0.88rem; font-weight: 500; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; background: var(--bg-elev); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.view-title-row { display: flex; align-items: center; gap: 8px; }
.view-icon { font-size: 1.35rem; }
.view-heading h1 { margin: 0; font-size: 1.25rem; line-height: 1.2; }
.view-subtitle { font-size: 0.82rem; color: var(--text-muted); }
.view-mode-toggle, .scan-mode-pills { display: inline-flex; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 3px; }
.seg-btn { border: none; background: transparent; color: var(--text-muted); padding: 6px 11px; border-radius: 7px; font-size: 0.82rem; font-weight: 600; cursor: pointer; }
.seg-btn.active { background: var(--accent); color: #fff; }
.toolbar-strip { display: flex; align-items: center; gap: 8px; padding: 10px 20px; border-bottom: 1px solid var(--border); background: var(--bg); flex-wrap: wrap; }
.search-box { position: relative; display: flex; align-items: center; flex: 1; min-width: 200px; }
.search-box .search-icon { position: absolute; left: 11px; font-size: 0.88rem; pointer-events: none; opacity: 0.7; }
.search-box input { width: 100%; padding: 8px 12px 8px 34px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); font-size: 0.9rem; }
.search-box input:focus { outline: none; border-color: var(--accent); }
.lang-pills-bar { display: flex; align-items: center; gap: 6px; padding: 8px 20px; overflow-x: auto; border-bottom: 1px solid var(--border); background: var(--bg); }
.lang-pill { border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); border-radius: 99px; padding: 4px 10px; font-size: 0.78rem; white-space: nowrap; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.lang-pill:hover { border-color: var(--border-strong); }
.lang-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.main-scroll { flex: 1; overflow-y: auto; padding: 18px 20px 40px; }
.binder-pager { max-width: 980px; margin: 0 auto 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pager-info { text-align: center; } .pager-info strong { display: block; font-size: 0.95rem; } .pager-right { display: flex; gap: 6px; }
.binder-sheet { max-width: 980px; margin: 0 auto; background: var(--binder-sheet); border: 2px solid var(--border-strong); border-left: 14px solid var(--binder-accent, #e11d48); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); position: relative; }
.binder-grid { display: grid; gap: 14px; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
.binder-pocket { position: relative; border-radius: 12px; background: var(--pocket-bg); border: 1px solid var(--border); padding: 7px; display: flex; flex-direction: column; transition: transform 0.16s, border-color 0.16s; }
.binder-pocket:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.binder-pocket.empty { aspect-ratio: 63 / 88; border-style: dashed; align-items: center; justify-content: center; gap: 8px; color: var(--text-muted); cursor: pointer; }
.binder-pocket.empty:hover { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.pocket-slot-num { position: absolute; top: 6px; left: 8px; font-size: 0.7rem; font-weight: 700; color: var(--text-muted); opacity: 0.75; }
.empty-pocket-actions { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 8px; }
.empty-pocket-plus { width: 38px; height: 38px; border-radius: 50%; background: rgba(148,163,184,0.12); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 14px; }
.tcg-card-tile { position: relative; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 7px; transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s; }
.tcg-card-tile:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 10px 26px rgba(0,0,0,0.35); }
.card-art-wrap { position: relative; width: 100%; aspect-ratio: 63 / 88; border-radius: 8px; overflow: hidden; background: #0f172a; }
.card-art-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-art-fallback { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px; text-align: center; background: linear-gradient(145deg, #1e293b, #0f172a); color: var(--text-muted); font-size: 0.8rem; }
.card-art-wrap.foil::after { content: ""; position: absolute; inset: 0; background: linear-gradient(125deg, transparent 20%, rgba(255,255,255,0.18) 45%, rgba(250,204,21,0.15) 55%, transparent 75%); pointer-events: none; }
.badge-lang { position: absolute; top: 6px; left: 6px; background: rgba(11,16,32,0.84); color: #fff; backdrop-filter: blur(4px); padding: 2px 7px; border-radius: 99px; font-size: 0.72rem; font-weight: 700; border: 1px solid rgba(255,255,255,0.16); }
.badge-qty { position: absolute; top: 6px; right: 6px; background: var(--accent); color: #fff; padding: 2px 7px; border-radius: 99px; font-size: 0.72rem; font-weight: 800; }
.badge-grade { position: absolute; bottom: 6px; left: 6px; background: linear-gradient(135deg, #f59e0b, #d97706); color: #111827; padding: 2px 7px; border-radius: 6px; font-size: 0.68rem; font-weight: 800; }
.card-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card-title { font-weight: 700; font-size: 0.86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { font-size: 0.74rem; color: var(--text-muted); display: flex; justify-content: space-between; gap: 6px; }
.card-sub span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-tags-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.mini-tag { font-size: 0.68rem; padding: 2px 6px; border-radius: 5px; background: rgba(148,163,184,0.14); color: var(--text-muted); font-weight: 600; }
.mini-tag.holo { background: rgba(245,158,11,0.2); color: #fbbf24; }
.mini-tag.cond { background: rgba(16,185,129,0.16); color: #34d399; }
.empty-state { max-width: 480px; margin: 48px auto; text-align: center; padding: 32px 24px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 18px; }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 10px; }
.empty-state h3 { margin: 0 0 8px; }
.empty-state p { margin: 0 0 18px; color: var(--text-muted); font-size: 0.92rem; line-height: 1.5; }
.empty-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 15px; border-radius: var(--radius-sm); border: 1px solid transparent; font-weight: 600; font-size: 0.88rem; cursor: pointer; text-decoration: none; transition: background 0.15s, opacity 0.15s, border-color 0.15s; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; } .btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-card); color: var(--text); border-color: var(--border-strong); } .btn-secondary:hover:not(:disabled) { background: var(--bg-hover); }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: rgba(239,68,68,0.35); } .btn-danger-ghost:hover { background: rgba(239,68,68,0.12); }
.btn-sm { padding: 6px 11px; font-size: 0.82rem; } .btn-xs { padding: 4px 8px; font-size: 0.76rem; } .btn-lg { padding: 11px 18px; font-size: 0.96rem; } .btn-block { width: 100%; }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1rem; }
.icon-btn:hover { background: var(--bg-hover); } .icon-btn.small { width: 26px; height: 26px; font-size: 0.9rem; }
.input-field, .compact-select, .compact-num { border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font-size: 0.9rem; padding: 9px 11px; width: 100%; }
.input-field.input-lg { padding: 12px 14px; font-size: 1rem; }
.input-field:focus, .compact-select:focus { outline: none; border-color: var(--accent); }
.compact-select { width: auto; padding: 7px 10px; font-size: 0.83rem; } .compact-num { width: 64px; padding: 6px 8px; font-size: 0.83rem; }
.field-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field-group label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); }
.field-hint { font-size: 0.78rem; color: var(--text-muted); margin: 6px 0 0; }
.form-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.input-action-row { display: flex; gap: 8px; margin-top: 8px; }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.alert-error { padding: 10px 13px; border-radius: 9px; background: rgba(239,68,68,0.14); border: 1px solid rgba(239,68,68,0.4); color: #fca5a5; font-size: 0.86rem; margin-bottom: 12px; }
[data-theme="light"] .alert-error { color: #b91c1c; }
.modal-overlay { position: fixed; inset: 0; background: rgba(5,8,18,0.72); backdrop-filter: blur(4px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 14px; overflow-y: auto; }
.modal-card { width: 100%; max-height: 92vh; background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.modal-md { max-width: 540px; } .modal-lg { max-width: 780px; } .modal-xl { max-width: 980px; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-header h2 { margin: 0; font-size: 1.12rem; }
.modal-subtitle { margin: 3px 0 0; font-size: 0.82rem; color: var(--text-muted); }
.modal-body { padding: 16px 20px 20px; overflow-y: auto; flex: 1; }
.modal-footer-actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.scan-config-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.scan-action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.scan-big-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 24px 14px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--bg-card); color: var(--text); cursor: pointer; text-align: center; transition: border-color 0.15s, transform 0.15s; }
.scan-big-btn:hover { border-color: var(--accent); transform: translateY(-2px); }
.scan-big-btn.primary { background: linear-gradient(145deg, rgba(225,29,72,0.22), rgba(225,29,72,0.08)); border-color: rgba(225,29,72,0.5); }
.scan-big-icon { font-size: 2rem; } .scan-big-btn small { color: var(--text-muted); font-size: 0.76rem; }
.scan-video-wrap { position: relative; border-radius: 14px; overflow: hidden; background: #000; margin-bottom: 14px; }
.scan-video-wrap video { width: 100%; max-height: 440px; object-fit: cover; display: block; }
.scan-guide-overlay { position: absolute; inset: 10%; border: 2px dashed rgba(255,255,255,0.78); border-radius: 12px; pointer-events: none; }
.scan-guide-overlay.guide-card { inset: 8% 28%; }
.scan-guide-overlay.guide-grid { inset: 6% 12%; background-image: linear-gradient(to right, rgba(255,255,255,0.28) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,255,255,0.28) 1px, transparent 1px); background-size: 33.33% 33.33%; }
.scan-video-controls { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 10px; }
.scan-loading-banner { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 12px; background: var(--bg-card); border: 1px solid var(--border); margin: 10px 0; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.75s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.scan-preview-strip { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); margin-bottom: 12px; flex-wrap: wrap; }
.scan-preview-strip img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }
.scan-preview-actions { flex: 1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inline-check { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--text-muted); cursor: pointer; }
.badge-soft { font-size: 0.74rem; padding: 3px 8px; border-radius: 6px; background: rgba(148,163,184,0.16); color: var(--text-muted); }
.scan-review-summary { font-size: 0.88rem; margin-bottom: 10px; font-weight: 500; }
.scan-review-list { display: flex; flex-direction: column; gap: 10px; }
.scan-item-card { background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: 12px; padding: 12px; }
.scan-item-card.dimmed { opacity: 0.45; }
.scan-item-top { display: flex; gap: 12px; align-items: flex-start; }
.scan-check-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
.scan-slot-pill { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); }
.scan-item-thumb { width: 66px; aspect-ratio: 63 / 88; border-radius: 7px; overflow: hidden; background: #0f172a; flex-shrink: 0; }
.scan-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.scan-item-info { flex: 1; min-width: 0; }
.scan-item-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.scan-item-sub { font-size: 0.8rem; color: var(--text-muted); display: flex; gap: 6px; flex-wrap: wrap; margin: 3px 0 8px; }
.lang-chip { font-size: 0.75rem; padding: 2px 8px; border-radius: 99px; background: rgba(59,130,246,0.18); color: #93c5fd; font-weight: 600; }
[data-theme="light"] .lang-chip { color: #1d4ed8; }
.conf-pill { font-size: 0.7rem; padding: 2px 6px; border-radius: 5px; text-transform: uppercase; font-weight: 700; }
.conf-high { background: rgba(16,185,129,0.18); color: #34d399; }
.conf-medium { background: rgba(245,158,11,0.18); color: #fbbf24; }
.conf-low { background: rgba(239,68,68,0.18); color: #f87171; }
.scan-item-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.scan-candidates { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.cand-label { display: block; font-size: 0.74rem; color: var(--text-muted); margin-bottom: 6px; }
.cand-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.cand-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 0.76rem; cursor: pointer; white-space: nowrap; }
.cand-chip img { width: 22px; height: 31px; object-fit: cover; border-radius: 3px; }
.cand-chip small { color: var(--text-muted); }
.cand-chip.active { border-color: var(--accent); background: var(--accent-soft); }
.catalog-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.catalog-target-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); margin-bottom: 14px; font-size: 0.82rem; }
.catalog-target-bar label { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); }
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 11px; }
.catalog-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 7px; display: flex; flex-direction: column; gap: 6px; }
.catalog-card:hover { border-color: var(--border-strong); }
.custom-card-form { background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.custom-card-form h3 { margin: 0 0 4px; font-size: 1rem; }
.detail-layout { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
.detail-art-frame { width: 100%; aspect-ratio: 63 / 88; border-radius: 12px; overflow: hidden; background: #0f172a; border: 1px solid var(--border-strong); box-shadow: var(--shadow); }
.detail-art-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tcgdex-meta-box { margin-top: 12px; padding: 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); font-size: 0.78rem; display: flex; flex-direction: column; gap: 5px; }
.tcgdex-meta-box div { display: flex; justify-content: space-between; gap: 8px; }
.tcgdex-meta-box span { color: var(--text-muted); }
.emoji-picker, .color-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-opt { width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg); font-size: 1.2rem; cursor: pointer; }
.emoji-opt.active { border-color: var(--accent); background: var(--accent-soft); }
.color-opt { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.color-opt.active { border-color: #fff; transform: scale(1.12); box-shadow: 0 0 0 2px var(--accent); }
.share-box, .settings-block { padding: 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); margin-bottom: 14px; }
.settings-block h3 { margin: 0 0 4px; font-size: 0.96rem; }
.share-box-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: #475569; border-radius: 99px; cursor: pointer; transition: 0.2s; }
.slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: 0.2s; }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.cache-actions-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.sync-progress { margin-bottom: 14px; }
.progress-track { height: 8px; border-radius: 99px; background: var(--bg); overflow: hidden; margin-bottom: 6px; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--gold)); transition: width 0.25s; }
.cache-langs-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 9px; }
.cache-lang-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--bg-card); border: 1px solid var(--border); }
.cache-lang-info strong { display: block; font-size: 0.86rem; } .cache-lang-info small { display: block; font-size: 0.74rem; color: var(--text-muted); }
.toast-container { position: fixed; bottom: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 11px 16px; border-radius: 10px; background: var(--bg-elev); border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-size: 0.86rem; font-weight: 500; max-width: 340px; }
.toast.success { border-color: var(--green); } .toast.error { border-color: var(--danger); }
.mobile-only { display: none; } .empty-inline { padding: 18px; text-align: center; color: var(--text-muted); font-size: 0.88rem; }
@media (max-width: 860px) {
  .mobile-only { display: inline-flex; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; transform: translateX(-100%); transition: transform 0.22s ease; }
  .sidebar.open { transform: translateX(0); }
  .topbar { padding: 12px 14px; } .toolbar-strip, .lang-pills-bar { padding: 8px 14px; } .main-scroll { padding: 14px 12px 32px; }
  .binder-sheet { padding: 10px; border-left-width: 8px; } .binder-grid { gap: 8px; }
  .scan-action-grid { grid-template-columns: 1fr; } .detail-layout { grid-template-columns: 1fr; }
  .detail-art-frame { max-width: 240px; margin: 0 auto; } .form-grid-2 { grid-template-columns: 1fr; }
}