:root {
  --bg: #0b0d0d;
  --panel: #111514;
  --panel-2: #171c1a;
  --panel-3: #202624;
  --line: #2b322f;
  --line-soft: rgba(255, 255, 255, 0.07);
  --text: #f4f7f5;
  --muted: #8e9b96;
  --muted-2: #65716d;
  --lime: #d7ff59;
  --lime-soft: rgba(215, 255, 89, 0.12);
  --orange: #ff6b42;
  --purple: #9b7bff;
  --pink: #ff73b5;
  --green: #42d789;
  --red: #ff5c62;
  --blue: #6aa6ff;
  --black: #080a09;
  --white: #f4f6f5;
  --page: #202523;
  --radius: 16px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 88% -10%, rgba(215, 255, 89, 0.08), transparent 24rem),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI Variable", "Segoe UI", Inter, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  overflow: hidden;
}

button, input, select { font: inherit; }
button { color: inherit; }

button, select, input { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell { min-height: 100vh; display: flex; }

.sidebar {
  position: relative;
  z-index: 30;
  width: 228px;
  min-width: 228px;
  height: 100vh;
  padding: 24px 16px 16px;
  display: flex;
  flex-direction: column;
  background: rgba(15, 18, 17, 0.96);
  border-right: 1px solid var(--line-soft);
  backdrop-filter: blur(18px);
}

.brand { display: flex; gap: 11px; align-items: center; padding: 0 8px 24px; }
.brand strong { display: block; font-size: 1.08rem; letter-spacing: -0.03em; }
.brand small { color: var(--muted-2); font-size: 0.62rem; font-weight: 800; letter-spacing: 0.16em; }
.brand-mark { position: relative; display: flex; width: 34px; height: 30px; gap: 2px; }
.brand-mark span { width: 16px; height: 27px; border: 2px solid var(--lime); background: var(--lime); }
.brand-mark span:first-child { border-radius: 7px 2px 2px 7px; transform: rotate(-3deg); }
.brand-mark span:last-child { border-radius: 2px 7px 7px 2px; background: transparent; transform: rotate(3deg); }
.brand-mark::after { content: ""; position: absolute; left: 14px; top: 11px; width: 6px; height: 6px; background: var(--orange); border: 2px solid var(--panel); border-radius: 50%; }

.eyebrow { color: var(--muted-2); font-size: 0.69rem; font-weight: 800; letter-spacing: 0.13em; }
.section-label-row { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 8px; }
.sidebar-section { padding-bottom: 17px; border-bottom: 1px solid var(--line-soft); }
.binder-list { display: grid; gap: 4px; max-height: 160px; overflow: auto; scrollbar-width: thin; }
.binder-list-empty { padding: 13px 10px; display: flex; align-items: center; gap: 9px; color: var(--muted-2); border: 1px dashed var(--line); border-radius: 10px; }
.binder-list-empty span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; background: var(--lime-soft); color: var(--lime); }
.binder-list-empty p { margin: 0; font-size: .74rem; }
.binder-option { width: 100%; border: 0; background: transparent; padding: 9px 10px; border-radius: 9px; display: grid; grid-template-columns: 10px 1fr auto; gap: 9px; align-items: center; color: var(--muted); text-align: left; cursor: pointer; }
.binder-option:hover { background: var(--panel-2); color: var(--text); }
.binder-option.active { background: var(--panel-3); color: var(--text); }
.binder-option .cover-dot { width: 7px; height: 20px; border-radius: 2px; background: var(--lime); }
.binder-option[data-cover="orange"] .cover-dot { background: var(--orange); }
.binder-option[data-cover="purple"] .cover-dot { background: var(--purple); }
.binder-option[data-cover="pink"] .cover-dot { background: var(--pink); }
.binder-option[data-cover="green"] .cover-dot { background: var(--green); }
.binder-option[data-cover="red"] .cover-dot { background: var(--red); }
.binder-option[data-cover="blue"] .cover-dot { background: var(--blue); }
.binder-option[data-cover="black"] .cover-dot { background: var(--black); box-shadow: 0 0 0 1px #4a504d; }
.binder-option[data-cover="white"] .cover-dot { background: var(--white); }
.binder-option span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; font-size: 0.86rem; }
.binder-option small { color: var(--muted-2); font-size: 0.7rem; }

.icon-button { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); cursor: pointer; }
.icon-button:hover { border-color: #46514c; background: var(--panel-3); }
.icon-button.small { width: 25px; height: 25px; border: 0; border-radius: 7px; color: var(--lime); font-size: 1.1rem; }

.sidebar-nav { display: grid; gap: 4px; padding: 17px 0; border-bottom: 1px solid var(--line-soft); }
.nav-item { border: 0; background: transparent; padding: 10px 11px; border-radius: 9px; display: flex; align-items: center; gap: 10px; color: var(--muted); cursor: pointer; text-align: left; font-size: 0.88rem; font-weight: 650; }
.nav-item:hover, .nav-item.active { background: var(--panel-3); color: var(--text); }
.nav-item.active svg { color: var(--lime); }
.nav-item:disabled { opacity: .42; cursor: not-allowed; background: transparent; }

.collection-summary { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: center; padding: 20px 8px; }
.collection-summary .eyebrow { grid-column: 1 / -1; }
.summary-ring { --progress: 0deg; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--lime) var(--progress), var(--panel-3) 0); position: relative; }
.summary-ring::before { content: ""; position: absolute; width: 38px; height: 38px; border-radius: 50%; background: var(--panel); }
.summary-ring span { position: relative; font-size: 0.68rem; font-weight: 800; }
.collection-summary strong { display: block; font-size: 0.86rem; }
.collection-summary small { display: block; margin-top: 2px; color: var(--muted-2); font-size: 0.68rem; }

.sidebar-note { margin-top: auto; display: flex; gap: 9px; padding: 12px; border: 1px solid rgba(215, 255, 89, 0.16); background: linear-gradient(135deg, rgba(215, 255, 89, 0.08), rgba(215, 255, 89, 0.02)); border-radius: 12px; }
.sidebar-note p { margin: 0; color: var(--muted); font-size: 0.68rem; line-height: 1.45; }
.sidebar-note strong { color: var(--text); }
.note-icon { color: var(--lime); }
.sidebar-foot { padding: 14px 8px 0; color: var(--muted-2); font-size: 0.62rem; }

.main-area { flex: 1; min-width: 0; height: 100vh; display: flex; flex-direction: column; }
.topbar { height: 68px; min-height: 68px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); background: rgba(11, 13, 13, 0.78); backdrop-filter: blur(16px); }
.crumbs { display: flex; gap: 9px; align-items: center; color: var(--muted-2); font-size: 0.82rem; }
.crumbs strong { color: var(--text); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.saved-state { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.72rem; margin-right: 6px; }
.saved-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(215, 255, 89, 0.08); }
.saved-state.saving i { background: var(--orange); }

.button { min-height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-weight: 750; font-size: 0.8rem; transition: 140ms ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: #11130f; background: var(--lime); border-color: var(--lime); box-shadow: 0 8px 24px rgba(215, 255, 89, 0.1); }
.button.primary:hover { background: #e2ff84; }
.button.secondary { background: var(--panel-2); color: var(--text); }
.button.secondary:hover { border-color: #4b5752; }
.button.account-button { color: var(--lime); background: var(--lime-soft); border-color: rgba(215, 255, 89, .24); text-decoration: none; }
.button.account-button[data-authenticated="true"] { width: 38px; padding: 0; border-radius: 50%; color: #111; background: var(--lime); font-weight: 900; }
.button.wide { width: 100%; margin-top: 3px; }
.mobile-menu { display: none; }

.workspace { flex: 1; min-height: 0; display: flex; }
.workspace[hidden], .welcome-home[hidden], [hidden] { display: none !important; }

.welcome-home { position: relative; flex: 1; min-height: 0; height: calc(100vh - 68px); padding: clamp(38px, 6vw, 88px); display: grid; grid-template-columns: minmax(320px, .9fr) minmax(420px, 1.1fr); align-items: center; gap: clamp(36px, 7vw, 100px); overflow-y: auto; overflow-x: hidden; isolation: isolate; }
.welcome-home::before { content: ""; position: absolute; z-index: -1; width: 38vw; height: 38vw; min-width: 420px; min-height: 420px; right: -10vw; top: 5%; border-radius: 50%; background: radial-gradient(circle, rgba(215,255,89,.11), rgba(215,255,89,.02) 42%, transparent 70%); filter: blur(4px); }
.welcome-copy { max-width: 630px; }
.welcome-copy .eyebrow { color: var(--lime); }
.welcome-copy h1 { max-width: 720px; margin: 13px 0 20px; font-size: clamp(2.6rem, 5vw, 5.2rem); line-height: .96; letter-spacing: -.065em; }
.welcome-copy > p { max-width: 590px; margin: 0; color: var(--muted); font-size: clamp(1rem, 1.3vw, 1.15rem); line-height: 1.68; }
.welcome-actions { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 10px; }
.welcome-actions .button { min-height: 46px; padding-inline: 19px; font-size: .88rem; }
.welcome-primary::after { content: "→"; font-size: 1rem; }
.welcome-features { margin-top: clamp(35px, 5vw, 62px); display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); border-top: 1px solid var(--line-soft); }
.welcome-features div { padding: 18px 16px 0 0; }
.welcome-features div + div { padding-left: 16px; border-left: 1px solid var(--line-soft); }
.welcome-features strong, .welcome-features span { display: block; }
.welcome-features strong { font-size: .86rem; }
.welcome-features span { margin-top: 4px; color: var(--muted-2); font-size: .72rem; line-height: 1.45; }

.welcome-visual { position: relative; width: min(100%, 720px); min-height: 520px; display: grid; place-items: center; }
.welcome-orbit { position: absolute; border: 1px solid rgba(215,255,89,.14); border-radius: 50%; }
.welcome-orbit-one { width: 92%; aspect-ratio: 1; }
.welcome-orbit-two { width: 68%; aspect-ratio: 1; border-color: rgba(255,255,255,.07); }
.welcome-binder { position: relative; width: min(92%, 650px); aspect-ratio: 1.52 / 1; padding: 24px 27px 24px 35px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; border: 13px solid #171d1a; border-left-width: 26px; border-right-width: 26px; border-radius: 21px 31px 31px 21px; background: #101312; box-shadow: 0 38px 110px rgba(0,0,0,.57), 0 0 0 1px rgba(215,255,89,.06); transform: perspective(1100px) rotateX(4deg) rotateY(-7deg) rotateZ(-1deg); }
.welcome-binder::before { content: ""; position: absolute; inset: -13px; border-radius: inherit; background: linear-gradient(118deg, rgba(215,255,89,.11), transparent 23%, transparent 77%, rgba(255,255,255,.035)); pointer-events: none; }
.welcome-spine { position: absolute; z-index: 3; left: 50%; top: 18px; bottom: 18px; width: 20px; transform: translateX(-50%); border-radius: 9px; background: linear-gradient(90deg, rgba(0,0,0,.42), rgba(255,255,255,.07) 48%, rgba(0,0,0,.34)); }
.welcome-spine span { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%) rotate(90deg); color: rgba(255,255,255,.13); font-size: .5rem; font-weight: 900; letter-spacing: .24em; }
.welcome-page { min-width: 0; padding: 15px; border: 1px solid rgba(255,255,255,.06); background: linear-gradient(145deg, #272d2a, #202523); box-shadow: inset 0 0 30px rgba(0,0,0,.2); }
.welcome-page:first-of-type { border-radius: 12px 3px 3px 12px; }
.welcome-page:last-of-type { border-radius: 3px 12px 12px 3px; }
.welcome-page small { display: block; margin-bottom: 7px; color: var(--muted-2); font-size: .56rem; font-weight: 850; letter-spacing: .13em; }
.welcome-pockets { height: calc(100% - 18px); display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); grid-template-rows: repeat(3,minmax(0,1fr)); gap: 8px; }
.welcome-pockets i { position: relative; border: 1px dashed rgba(255,255,255,.13); border-radius: 8px; background: rgba(255,255,255,.018); }
.welcome-pockets i::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(125deg, rgba(255,255,255,.07), transparent 23%, transparent 72%, rgba(255,255,255,.025)); }
.welcome-pockets .featured { display: grid; place-items: center; color: var(--lime); border-color: rgba(215,255,89,.42); background: var(--lime-soft); font-style: normal; font-size: 1.15rem; }
.welcome-visual-note { position: absolute; right: 2%; bottom: 4%; padding: 12px 15px; display: flex; align-items: center; gap: 10px; border: 1px solid rgba(215,255,89,.22); border-radius: 13px; background: rgba(17,21,20,.94); box-shadow: 0 16px 42px rgba(0,0,0,.38); backdrop-filter: blur(12px); }
.welcome-visual-note > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: #111; background: var(--lime); }
.welcome-visual-note strong, .welcome-visual-note small { display: block; }
.welcome-visual-note strong { font-size: .76rem; }
.welcome-visual-note small { margin-top: 2px; color: var(--muted); font-size: .66rem; }
.catalog-panel { width: 318px; min-width: 318px; height: calc(100vh - 68px); overflow-y: auto; border-right: 1px solid var(--line-soft); background: #0e1110; padding: 20px 17px 24px; scrollbar-width: thin; transition: margin 200ms ease, opacity 160ms ease; }
.catalog-panel.collapsed { margin-left: -318px; opacity: 0; pointer-events: none; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.panel-heading h1 { margin: 3px 0 0; font-size: 1.28rem; letter-spacing: -0.04em; }
.panel-close { width: 30px; height: 30px; font-size: 1.25rem; }
.segmented { padding: 3px; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); margin-bottom: 15px; }
.segment { min-height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 0.76rem; font-weight: 750; }
.segment.active { background: var(--panel-3); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.search-form { display: grid; gap: 11px; }
.search-box { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 11px; border: 1px solid var(--line); background: var(--panel-2); border-radius: 11px; }
.search-box:focus-within { border-color: rgba(215, 255, 89, 0.55); box-shadow: 0 0 0 3px rgba(215, 255, 89, 0.06); }
.search-box svg { color: var(--muted); }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 0.82rem; }
.search-box input::placeholder { color: var(--muted-2); }
kbd { padding: 2px 6px; color: var(--muted-2); background: var(--panel-3); border: 1px solid var(--line); border-radius: 5px; font-family: inherit; font-size: 0.67rem; }
.filter-row { display: grid; grid-template-columns: 1.35fr 1fr; gap: 8px; }
.filter-row label, .custom-form > label:not(.upload-zone), .modal label { display: grid; gap: 5px; color: var(--muted); font-size: 0.68rem; font-weight: 700; }
select, .custom-form input, .modal input { width: 100%; min-width: 0; height: 37px; border: 1px solid var(--line); border-radius: 9px; padding: 0 9px; color: var(--text); background: var(--panel-2); outline: none; font-size: 0.75rem; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 13px) 15px, calc(100% - 9px) 15px; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; padding-right: 23px; }
.results-meta { display: flex; align-items: center; justify-content: space-between; margin: 18px 1px 10px; color: var(--muted); font-size: 0.71rem; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--lime); cursor: pointer; font-size: 0.7rem; }
.card-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.result-card { position: relative; min-width: 0; border: 1px solid var(--line-soft); background: var(--panel-2); border-radius: 12px; overflow: hidden; transition: 150ms ease; }
.result-card:hover { border-color: #48534e; transform: translateY(-2px); }
.result-image { position: relative; aspect-ratio: 2.5 / 3.5; margin: 8px 8px 0; overflow: hidden; border-radius: 8px; background: linear-gradient(145deg, #303a36, #171b1a); }
.result-preview { width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.result-image img { width: 100%; height: 100%; object-fit: contain; display: block; }
.result-image-fallback { width: 100%; height: 100%; display: grid; place-items: center; padding: 12px; color: var(--muted); text-align: center; font-size: .75rem; }
.add-card { position: absolute; right: 7px; bottom: 7px; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.17); border-radius: 50%; background: rgba(11, 13, 13, 0.88); color: var(--lime); cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,.4); }
.add-card:hover { color: #0b0d0d; background: var(--lime); }
.result-copy { padding: 9px; min-width: 0; }
.result-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.72rem; }
.result-copy small { display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted-2); font-size: 0.62rem; }
.catalog-status { margin-top: 18px; padding: 12px; border-radius: 10px; background: var(--panel-2); color: var(--muted); text-align: center; font-size: 0.73rem; }
.result-skeleton { aspect-ratio: 2.5 / 4.2; border-radius: 12px; background: linear-gradient(90deg, var(--panel-2), var(--panel-3), var(--panel-2)); background-size: 240% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -240% 0; } }

.custom-intro { text-align: center; padding: 9px 7px 20px; }
.custom-art { width: 74px; aspect-ratio: 2.5 / 3.5; margin: 0 auto 13px; display: grid; place-items: center; border: 1px dashed #59645f; border-radius: 10px; background: linear-gradient(145deg, rgba(215,255,89,.1), transparent); color: var(--lime); font-size: 1.6rem; }
.custom-intro h2 { margin: 0; font-size: 1rem; }
.custom-intro p { margin: 7px 0 0; color: var(--muted); font-size: 0.72rem; }
.custom-form { display: grid; gap: 11px; }
.or { display: flex; align-items: center; gap: 7px; color: var(--muted-2); font-size: 0.65rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.upload-zone { min-height: 130px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 1px dashed #49534f; border-radius: 12px; background: var(--panel-2); color: var(--muted); cursor: pointer; text-align: center; }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--lime); background: var(--lime-soft); }
.upload-zone input { position: absolute; opacity: 0; pointer-events: none; }
.upload-zone svg { color: var(--lime); width: 1.4rem; height: 1.4rem; }
.upload-zone strong { color: var(--text); font-size: 0.75rem; }
.upload-zone small { font-size: 0.62rem; }

.binder-workspace { min-width: 0; flex: 1; height: calc(100vh - 68px); overflow: hidden; display: flex; flex-direction: column; background: radial-gradient(circle at 50% 35%, rgba(255,255,255,.025), transparent 38%); }
.binder-toolbar { min-height: 76px; padding: 13px 22px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line-soft); }
.binder-title-block { min-width: 0; }
.title-line { display: flex; align-items: center; gap: 9px; }
.title-line input { width: min(310px, 40vw); border: 0; outline: 0; padding: 0; background: transparent; color: var(--text); font-size: 1.45rem; line-height: 1.15; font-weight: 760; letter-spacing: -0.05em; text-overflow: ellipsis; }
.count-pill { padding: 3px 8px; border-radius: 100px; background: var(--panel-3); color: var(--muted); font-size: 0.65rem; }
.privacy-toggle { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 100px; border: 1px solid var(--line); color: var(--muted); font-size: .63rem; font-weight: 750; cursor: pointer; }
.privacy-toggle input { width: 8px; height: 8px; margin: 0; appearance: none; border: 0; border-radius: 50%; background: var(--muted-2); }
.privacy-toggle input:checked { background: var(--lime); box-shadow: 0 0 0 3px rgba(215,255,89,.08); }
.view-controls { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.layout-control { height: 35px; display: inline-flex; align-items: center; gap: 7px; padding: 0 8px 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); color: var(--muted-2); font-size: .62rem; font-weight: 750; }
.layout-control select { width: 66px; height: 27px; border: 0; padding-left: 4px; background-color: transparent; font-weight: 800; }
.zoom-control { height: 35px; display: inline-flex; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.zoom-control button { height: 100%; min-width: 31px; padding: 0 8px; border: 0; border-right: 1px solid var(--line-soft); background: transparent; color: var(--muted); cursor: pointer; font-size: .76rem; font-weight: 800; }
.zoom-control button:last-child { border-right: 0; }
.zoom-control button:hover:not(:disabled) { color: var(--lime); background: var(--lime-soft); }
.zoom-control button:disabled { opacity: .35; cursor: not-allowed; }
#zoomValue { min-width: 48px; color: var(--text); font-size: .65rem; }
.tool-button { min-height: 35px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); color: var(--muted); cursor: pointer; font-size: 0.7rem; font-weight: 750; }
.tool-button:hover { color: var(--text); border-color: #4b5752; }
.tool-button.danger-tool { color: #ff9a7d; border-color: rgba(255,107,66,.25); }
.tool-button.danger-tool:hover { color: #ffc0ae; border-color: rgba(255,107,66,.5); background: rgba(255,107,66,.08); }
.title-edit { width: 30px; height: 30px; flex: 0 0 auto; }

.binder-stage-wrap { flex: 1; min-height: 0; display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px; align-items: center; padding: 16px 14px 8px; overflow: auto; }
.binder-stage { position: relative; width: min(100%, 880px); max-height: 100%; aspect-ratio: 1.52 / 1; margin: 0 auto; padding: 16px 18px 16px 26px; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; border: 10px solid #171d1a; border-left-width: 22px; border-right-width: 22px; border-radius: 18px 26px 26px 18px; background: #101312; box-shadow: 0 30px 90px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,255,255,.035); zoom: var(--binder-zoom, 1); transition: zoom 150ms ease; }
.binder-stage[data-layout="4x3"] { aspect-ratio: 1.9 / 1; }
.binder-stage[data-layout="5x4"] { aspect-ratio: 1.78 / 1; }
.binder-stage::before { content: ""; position: absolute; inset: -10px; border-radius: inherit; pointer-events: none; background: linear-gradient(115deg, rgba(215,255,89,.10), transparent 18%, transparent 78%, rgba(255,255,255,.03)); }
.binder-stage::after { content: ""; position: absolute; left: -16px; top: 9%; bottom: 9%; width: 8px; border: 2px solid #313a36; border-radius: 6px; box-shadow: 0 0 0 2px #0e1110; }
.binder-spine { position: absolute; z-index: 3; left: 50%; top: 12px; bottom: 12px; width: 18px; transform: translateX(-50%); border-radius: 8px; background: linear-gradient(90deg, rgba(0,0,0,.34), rgba(255,255,255,.06) 46%, rgba(0,0,0,.28)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.025), 0 0 20px rgba(0,0,0,.35); }
.binder-spine span { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(90deg); color: #5a635f; font-size: 0.5rem; font-weight: 800; letter-spacing: .32em; }
.page { position: relative; min-width: 0; padding: 14px 14px 11px; background: linear-gradient(145deg, #252b28, var(--page)); border: 1px solid rgba(255,255,255,.055); box-shadow: inset 0 0 30px rgba(0,0,0,.22); }
.page-left { border-radius: 11px 3px 3px 11px; }
.page-right { border-radius: 3px 11px 11px 3px; }
.pocket-grid { width: 100%; height: calc(100% - 20px); display: grid; grid-template-columns: repeat(var(--page-columns, 3), minmax(0, 1fr)); grid-template-rows: repeat(var(--page-rows, 3), minmax(0, 1fr)); gap: clamp(4px, .55vw, 9px); }
.pocket { position: relative; min-width: 0; min-height: 0; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.11); border-radius: clamp(5px, .6vw, 9px); background: rgba(255,255,255,.025); overflow: hidden; box-shadow: inset 0 0 12px rgba(0,0,0,.2); }
.pocket::after { content: ""; position: absolute; z-index: 2; inset: 0; border-radius: inherit; background: linear-gradient(125deg, rgba(255,255,255,.13), transparent 19%, transparent 72%, rgba(255,255,255,.04)); pointer-events: none; }
.pocket.empty { border-style: dashed; }
.pocket.empty span { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid rgba(255,255,255,.10); border-radius: 50%; color: #55605b; font-size: .9rem; transition: 150ms ease; }
.pocket.empty:hover { border-color: rgba(215,255,89,.4); background: rgba(215,255,89,.025); }
.pocket.empty:hover span { color: var(--lime); border-color: rgba(215,255,89,.32); }
.pocket.drag-over { border-color: var(--lime); background: rgba(215,255,89,.08); }
.pocket-card { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); padding: 0; border: 0; border-radius: clamp(4px, .5vw, 7px); overflow: hidden; cursor: zoom-in; background: #111; box-shadow: 0 4px 10px rgba(0,0,0,.34); }
.pocket-card:active { cursor: grabbing; }
.pocket-card img { width: 100%; height: 100%; object-fit: contain; display: block; background: #121514; }
.pocket-card .card-fallback { width: 100%; height: 100%; display: none; place-items: center; padding: 9px; background: radial-gradient(circle at 50% 35%, rgba(215,255,89,.15), transparent 35%), #171c1a; color: var(--muted); text-align: center; font-size: .65rem; font-weight: 800; }
.remove-card { position: absolute; z-index: 4; top: 5px; right: 5px; width: 23px; height: 23px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; background: rgba(8,10,9,.82); color: white; opacity: 0; cursor: pointer; transition: 120ms ease; }
.pocket:hover .remove-card, .remove-card:focus { opacity: 1; }
.page-number { height: 20px; display: flex; align-items: start; justify-content: space-between; color: #69736f; font-size: .57rem; font-weight: 800; letter-spacing: .12em; }
.page-number small { font-size: .54rem; color: #535d58; letter-spacing: 0; }
.page-arrow { width: 34px; height: 50px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); color: var(--muted); cursor: pointer; }
.page-arrow:hover:not(:disabled) { border-color: rgba(215,255,89,.32); color: var(--lime); }
.page-arrow:disabled { opacity: .28; cursor: not-allowed; }
.page-footer { min-height: 43px; padding: 2px 60px 13px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; color: var(--muted-2); font-size: .66rem; }
.page-footer > :last-child { justify-self: end; }
.footer-link, .inline-link { border: 0; padding: 0; background: transparent; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; }
.footer-link:hover, .inline-link:hover { color: var(--lime); }
.page-dots { display: flex; gap: 5px; justify-content: center; }
.page-dot { width: 6px; height: 6px; border: 0; border-radius: 50%; padding: 0; background: #3b4541; cursor: pointer; }
.page-dot.active { width: 18px; border-radius: 6px; background: var(--lime); }

.modal { width: min(430px, calc(100vw - 32px)); overflow-x: hidden; border: 1px solid var(--line); border-radius: 18px; padding: 0; color: var(--text); background: var(--panel); box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(3,5,4,.74); backdrop-filter: blur(6px); }
.modal form { position: relative; padding: 25px; }
.modal > article { position: relative; padding: 25px; }
.dialog-close { position: absolute; right: 16px; top: 16px; }
.modal h2 { margin: 5px 0 6px; font-size: 1.5rem; letter-spacing: -.04em; }
.modal p { margin: 0 0 20px; color: var(--muted); font-size: .82rem; }
.modal input { height: 43px; font-size: .83rem; }
.cover-choices { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.cover-choices input { position: absolute; opacity: 0; pointer-events: none; }
.cover { display: block; width: 48px; height: 62px; border-radius: 5px 10px 10px 5px; background: var(--lime); box-shadow: inset 6px 0 rgba(0,0,0,.17); cursor: pointer; }
.cover.orange { background: var(--orange); }
.cover.purple { background: var(--purple); }
.cover.pink { background: var(--pink); }
.cover.green { background: var(--green); }
.cover.red { background: var(--red); }
.cover.blue { background: var(--blue); }
.cover.black { background: var(--black); border: 1px solid #414744; }
.cover.white { background: var(--white); }
.cover-choices input:checked + .cover { outline: 2px solid white; outline-offset: 3px; }
.layout-choices { margin: 19px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; border: 0; }
.layout-choices legend { grid-column: 1 / -1; margin-bottom: 7px; color: var(--muted); font-size: .68rem; font-weight: 700; }
.layout-choices label { display: block !important; cursor: pointer; }
.layout-choices input { position: absolute; opacity: 0; pointer-events: none; }
.layout-choices label > span { min-height: 54px; padding: 9px 5px; display: grid; place-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); text-align: center; }
.layout-choices strong, .layout-choices small { display: block; }
.layout-choices strong { color: var(--text); font-size: .76rem; }
.layout-choices small { color: var(--muted-2); font-size: .56rem; }
.layout-choices input:checked + span { border-color: rgba(215,255,89,.55); background: var(--lime-soft); box-shadow: inset 0 0 0 1px rgba(215,255,89,.12); }
.modal menu { display: flex; justify-content: flex-end; gap: 8px; padding: 0; margin: 24px 0 0; }
.profile-fields { display: grid; gap: 12px; }
.profile-modal { width: min(620px, calc(100vw - 32px)); }
.profile-photo-row { margin: 16px 0; display: flex; align-items: center; gap: 13px; }
.profile-photo-picker { position: relative; width: 68px; height: 68px; flex: 0 0 auto; display: grid !important; place-items: center; overflow: hidden; border: 1px dashed #52605a; border-radius: 20px; background: var(--panel-2); color: var(--lime); cursor: pointer; }
.profile-photo-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.profile-photo-picker img { width: 100%; height: 100%; object-fit: cover; }
.profile-photo-picker > span { font-size: 1.4rem; }
.profile-photo-row > div { display: grid; gap: 3px; }
.profile-photo-row strong { font-size: .78rem; }
.profile-photo-row small { color: var(--muted); font-size: .65rem; }
.profile-photo-row .inline-link { width: max-content; margin-top: 3px; font-size: .65rem; }
.profile-two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.private-field-note { margin-top: 4px; color: var(--muted-2); font-size: .61rem; font-weight: 500; }
.profile-fields textarea { min-height: 86px; resize: vertical; border: 1px solid var(--line); border-radius: 9px; padding: 9px; color: var(--text); background: var(--panel-2); outline: none; font: inherit; font-size: .78rem; }
.profile-fields textarea:focus { border-color: rgba(215,255,89,.55); }
.username-field { height: 43px; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.username-field span { padding-left: 11px; color: var(--muted); }
.username-field input { border: 0; background: transparent; }
.profile-accent { margin-top: 16px; color: var(--muted); font-size: .68rem; font-weight: 700; }
.profile-accent .cover-choices { margin-top: 10px; }
.profile-accent .cover { width: 38px; height: 46px; }
.form-error { margin-top: 14px; padding: 10px 12px; border: 1px solid rgba(255,107,66,.28); border-radius: 9px; background: rgba(255,107,66,.08); color: #ff9a7d; font-size: .72rem; }
.form-error.success { border-color: rgba(215,255,89,.25); background: var(--lime-soft); color: var(--lime); }
.choice-row { margin-top: 14px; padding: 12px; display: flex !important; grid-template-columns: none !important; align-items: flex-start; gap: 10px !important; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); cursor: pointer; }
.choice-row input { width: 17px; height: 17px; margin-top: 2px; flex: 0 0 auto; accent-color: var(--lime); }
.choice-row strong, .choice-row small { display: block; }
.choice-row strong { color: var(--text); font-size: .74rem; }
.choice-row small { margin-top: 3px; color: var(--muted); font-size: .65rem; font-weight: 500; line-height: 1.45; }
.account-tools { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.account-tools > div { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 7px; }
.button.danger { border: 1px solid rgba(255,107,66,.35); background: rgba(255,107,66,.09); color: #ff9a7d; }
.button.danger:hover { background: rgba(255,107,66,.17); }
.danger-copy { color: #ff9a7d; }
.privacy-modal { width: min(560px, calc(100vw - 32px)); }
.privacy-copy { max-height: min(55vh, 520px); overflow: auto; padding-right: 8px; }
.privacy-copy p { margin: 0 0 14px; line-height: 1.65; }
.privacy-copy strong { color: var(--text); }

.card-detail-dialog { width: min(980px, calc(100vw - 30px)); max-height: min(820px, calc(100vh - 30px)); padding: 0; border: 1px solid var(--line); border-radius: 22px; color: var(--text); background: #0d100f; box-shadow: var(--shadow); }
.card-detail-dialog::backdrop { background: rgba(3,5,4,.82); backdrop-filter: blur(8px); }
.card-detail-dialog > article { position: relative; max-height: min(820px, calc(100vh - 30px)); overflow: auto; padding: clamp(20px, 3vw, 34px); }
.card-detail-content { display: grid; grid-template-columns: minmax(260px, .78fr) minmax(330px, 1.22fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
.card-detail-media { position: sticky; top: 0; min-height: 390px; padding: clamp(18px, 3vw, 30px); display: grid; place-items: center; border: 1px solid var(--line); border-radius: 18px; background: radial-gradient(circle at 50% 30%, rgba(215,255,89,.12), transparent 35%), #111514; }
.card-detail-media img { display: block; width: min(100%, 380px); max-height: 68vh; object-fit: contain; filter: drop-shadow(0 22px 32px rgba(0,0,0,.46)); }
.card-detail-copy { min-width: 0; padding-right: 12px; }
.card-detail-copy h2 { margin: 6px 38px 8px 0; font-size: clamp(1.7rem, 4vw, 2.65rem); line-height: 1; letter-spacing: -.055em; }
.card-meta-row { display: flex; flex-wrap: wrap; gap: 7px; }
.card-meta-row span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 100px; color: var(--muted); background: var(--panel-2); font-size: .64rem; }
.detail-loading { margin-top: 18px; padding: 12px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: var(--panel-2); font-size: .72rem; }
.detail-loading i { width: 14px; height: 14px; border: 2px solid #46504c; border-top-color: var(--lime); border-radius: 50%; animation: detail-spin .8s linear infinite; }
@keyframes detail-spin { to { transform: rotate(360deg); } }
.detail-note { margin-top: 18px; padding: 11px 12px; border: 1px solid rgba(255,107,66,.25); border-radius: 10px; color: #ffaf97; background: rgba(255,107,66,.07); font-size: .7rem; }
.detail-section { margin-top: 22px; padding-top: 19px; border-top: 1px solid var(--line-soft); }
.detail-label { display: block; margin-bottom: 9px; color: var(--lime); font-size: .59rem; font-weight: 850; letter-spacing: .15em; }
.detail-section > p { margin: 8px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.65; }
.expansion-head { display: flex; align-items: center; gap: 10px; }
.expansion-head img { width: 28px; height: 28px; object-fit: contain; }
.expansion-head strong, .expansion-head small { display: block; }
.expansion-head strong { font-size: .91rem; }
.expansion-head small { margin-top: 2px; color: var(--muted); font-size: .67rem; }
.flavor-text { padding: 12px 14px; border-left: 2px solid var(--lime); background: var(--lime-soft); color: var(--text) !important; font-style: italic; }
.card-fact { margin-top: 10px; padding: 11px 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--panel-2); }
.card-fact strong { display: block; font-size: .74rem; }
.card-fact p, .card-rule { margin: 4px 0 0; color: var(--muted); font-size: .7rem; line-height: 1.5; }
.card-rule { padding: 10px 12px; border-radius: 9px; background: rgba(255,255,255,.035); }
.price-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.price-heading small { color: var(--muted-2); font-size: .58rem; }
.market-prices { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.market-prices > div { padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); }
.market-prices span, .market-prices strong { display: block; }
.market-prices span { color: var(--muted); font-size: .62rem; }
.market-prices strong { margin-top: 3px; color: var(--lime); font-size: 1.06rem; }
.price-unavailable { margin: 0 !important; }
.tcg-link { margin-top: 11px; display: inline-flex; color: var(--lime); font-size: .7rem; font-weight: 800; text-decoration: none; }
.tcg-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.community-modal { width: min(1080px, calc(100vw - 30px)); max-height: min(820px, calc(100vh - 30px)); border: 1px solid var(--line); border-radius: 22px; padding: 0; color: var(--text); background: #0d100f; box-shadow: var(--shadow); }
.community-modal::backdrop { background: rgba(3,5,4,.78); backdrop-filter: blur(7px); }
.community-shell { padding: clamp(20px, 3vw, 34px); overflow: auto; max-height: min(820px, calc(100vh - 30px)); }
.community-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--line-soft); }
.community-head h2 { margin: 4px 0 4px; font-size: clamp(1.55rem, 3vw, 2.25rem); letter-spacing: -.055em; }
.community-head p { margin: 0; color: var(--muted); font-size: .82rem; }
.community-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 15px; padding-top: 22px; }
.profile-card { position: relative; overflow: hidden; min-height: 258px; padding: 17px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(145deg, var(--panel-2), #111413); }
.profile-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--card-accent, var(--lime)); }
.profile-card[data-accent="orange"] { --card-accent: var(--orange); }
.profile-card[data-accent="purple"] { --card-accent: var(--purple); }
.profile-card[data-accent="pink"] { --card-accent: var(--pink); }
.profile-card[data-accent="green"] { --card-accent: var(--green); }
.profile-card[data-accent="red"] { --card-accent: var(--red); }
.profile-card[data-accent="blue"] { --card-accent: var(--blue); }
.profile-card[data-accent="black"] { --card-accent: #3b403e; }
.profile-card[data-accent="white"] { --card-accent: var(--white); }
.profile-identity { display: flex; align-items: center; gap: 10px; }
.profile-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--card-accent, var(--lime)); color: #111; font-weight: 900; }
.profile-avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.profile-identity strong, .profile-identity small { display: block; }
.profile-identity strong { font-size: .86rem; }
.profile-identity small { color: var(--muted); font-size: .68rem; }
.profile-card > p { min-height: 40px; margin: 14px 0; color: var(--muted); font-size: .72rem; }
.mini-binders { margin-top: auto; display: grid; gap: 8px; }
.mini-binder { padding: 9px; display: grid; grid-template-columns: 1fr auto; gap: 8px; border: 1px solid var(--line-soft); border-radius: 11px; background: rgba(0,0,0,.17); }
.mini-binder strong { align-self: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .68rem; }
.mini-cards { display: flex; }
.mini-cards img, .mini-card-empty { width: 25px; height: 35px; object-fit: cover; border: 1px solid #303835; border-radius: 3px; background: var(--panel-3); margin-left: -5px; }
.mini-cards img:first-child, .mini-card-empty:first-child { margin-left: 0; }
.profile-card-foot { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; color: var(--muted-2); font-size: .64rem; }
.profile-card-foot button { border: 0; padding: 0; background: transparent; color: var(--card-accent, var(--lime)); font-size: .66rem; font-weight: 800; cursor: pointer; }
.community-empty { padding: 70px 20px; text-align: center; }
.community-empty > span { color: var(--lime); font-size: 2rem; }
.community-empty h3 { margin: 10px 0 5px; font-size: 1.05rem; }
.community-empty p { margin: 0; color: var(--muted); font-size: .78rem; }
.community-skeleton { min-height: 258px; border-radius: 16px; background: linear-gradient(90deg, var(--panel-2), var(--panel-3), var(--panel-2)); background-size: 240% 100%; animation: shimmer 1.4s linear infinite; }
.community-error { grid-column: 1 / -1; padding: 30px; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); text-align: center; }
.profile-detail { grid-column: 1 / -1; --card-accent: var(--lime); }
.profile-detail[data-accent="orange"] { --card-accent: var(--orange); }
.profile-detail[data-accent="purple"] { --card-accent: var(--purple); }
.profile-detail[data-accent="pink"] { --card-accent: var(--pink); }
.profile-detail[data-accent="green"] { --card-accent: var(--green); }
.profile-detail[data-accent="red"] { --card-accent: var(--red); }
.profile-detail[data-accent="blue"] { --card-accent: var(--blue); }
.profile-detail[data-accent="black"] { --card-accent: #3b403e; }
.profile-detail[data-accent="white"] { --card-accent: var(--white); }
.profile-detail-head { margin: 20px 0 24px; padding: 20px; display: flex; gap: 14px; align-items: flex-start; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(135deg, color-mix(in srgb, var(--card-accent) 10%, transparent), transparent 42%), var(--panel-2); }
.profile-detail-head .profile-avatar { width: 54px; height: 54px; font-size: 1.2rem; }
.profile-detail-head h3 { margin: 0; font-size: 1.25rem; }
.profile-detail-head small { color: var(--muted); }
.profile-detail-head p { margin: 8px 0 0; color: var(--muted); font-size: .78rem; }
.public-binders { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.public-binder-card { min-height: 170px; padding: 16px; display: grid; grid-template-columns: 1fr auto; gap: 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel-2); }
.public-binder-card[data-cover] { border-top: 3px solid var(--cover-accent, var(--lime)); }
.public-binder-card[data-cover="orange"] { --cover-accent: var(--orange); }
.public-binder-card[data-cover="purple"] { --cover-accent: var(--purple); }
.public-binder-card[data-cover="pink"] { --cover-accent: var(--pink); }
.public-binder-card[data-cover="green"] { --cover-accent: var(--green); }
.public-binder-card[data-cover="red"] { --cover-accent: var(--red); }
.public-binder-card[data-cover="blue"] { --cover-accent: var(--blue); }
.public-binder-card[data-cover="black"] { --cover-accent: #3b403e; }
.public-binder-card[data-cover="white"] { --cover-accent: var(--white); }
.public-binder-card strong, .public-binder-card small { display: block; }
.public-binder-card strong { margin-top: 5px; font-size: .95rem; }
.public-binder-card small { margin-top: 4px; color: var(--muted); font-size: .68rem; }
.public-binder-preview { display: grid; grid-template-columns: repeat(2, 44px); gap: 4px; align-content: center; }
.public-binder-preview img, .public-binder-preview .mini-card-empty { width: 44px; height: 61px; object-fit: cover; border-radius: 5px; background: var(--panel-3); }

.toast { position: fixed; z-index: 100; right: 22px; bottom: 22px; min-width: 260px; max-width: calc(100vw - 30px); padding: 12px 15px; display: flex; gap: 11px; align-items: center; border: 1px solid rgba(215,255,89,.23); border-radius: 13px; background: rgba(23,28,26,.96); box-shadow: var(--shadow); transform: translateY(24px); opacity: 0; pointer-events: none; transition: 220ms ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--lime); color: #111; font-weight: 900; }
.toast strong, .toast small { display: block; }
.toast strong { font-size: .78rem; }
.toast small { color: var(--muted); font-size: .68rem; margin-top: 1px; }
.mobile-overlay { display: none; }

@media (max-width: 1120px) {
  .welcome-home { grid-template-columns: minmax(300px, .9fr) minmax(350px, 1.1fr); padding-inline: clamp(28px, 4vw, 52px); gap: 30px; }
  .welcome-visual { min-height: 440px; }
  .catalog-panel { width: 286px; min-width: 286px; }
  .catalog-panel.collapsed { margin-left: -286px; }
  .binder-stage-wrap { grid-template-columns: 32px minmax(0,1fr) 32px; padding-left: 7px; padding-right: 7px; }
  .binder-stage { padding: 12px 14px 12px 20px; border-left-width: 16px; border-right-width: 16px; }
  .page { padding: 10px; }
}

@media (max-width: 880px) {
  body { overflow: auto; }
  .sidebar { position: fixed; transform: translateX(-105%); transition: transform 200ms ease; box-shadow: 18px 0 50px rgba(0,0,0,.45); }
  .sidebar.open { transform: translateX(0); }
  .mobile-overlay { position: fixed; inset: 0; z-index: 25; display: block; background: rgba(0,0,0,.55); opacity: 0; pointer-events: none; transition: opacity 180ms ease; }
  .mobile-overlay.show { opacity: 1; pointer-events: auto; }
  .main-area { height: auto; min-height: 100vh; }
  .mobile-menu { display: inline-grid; }
  .crumbs span { display: none; }
  .topbar { position: sticky; top: 0; z-index: 20; padding: 0 12px; gap: 10px; }
  .topbar .button.secondary, .saved-copy { display: none; }
  .topbar #communityButton { display: inline-flex; width: 38px; padding: 0; font-size: 0; }
  .community-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .public-binders { grid-template-columns: 1fr; }
  .welcome-home { height: auto; min-height: calc(100vh - 68px); grid-template-columns: 1fr; padding: 56px clamp(24px, 7vw, 70px) 72px; }
  .welcome-copy { max-width: 720px; }
  .welcome-copy h1 { max-width: 760px; }
  .welcome-visual { width: min(100%, 700px); min-height: 470px; justify-self: center; }
  .workspace { min-height: calc(100vh - 68px); }
  .catalog-panel { position: fixed; z-index: 24; left: 0; top: 68px; bottom: 0; height: auto; width: min(340px, 90vw); min-width: 0; transform: translateX(-105%); margin: 0 !important; opacity: 1 !important; box-shadow: 18px 0 60px rgba(0,0,0,.48); transition: transform 200ms ease; }
  .catalog-panel.open { transform: translateX(0); }
  .binder-workspace { height: calc(100vh - 68px); }
  .binder-toolbar { align-items: center; }
  .layout-control > span { display: none; }
  .binder-stage-wrap { padding-top: 10px; }
  .binder-stage { aspect-ratio: .82/1; grid-template-columns: 1fr; width: min(100%, 540px); border-width: 10px 20px; padding: 14px 18px; }
  .binder-stage[data-layout="4x3"] { aspect-ratio: 1.05/1; }
  .binder-stage[data-layout="5x4"] { aspect-ratio: .95/1; }
  .binder-spine, .page-right { display: none; }
  .page-left { border-radius: 11px; }
  .page-footer { padding-left: 45px; padding-right: 45px; }
  .page-footer { grid-template-columns: 1fr auto; }
  .card-detail-content { grid-template-columns: 1fr; }
  .card-detail-media { position: relative; min-height: 300px; }
  .card-detail-media img { max-height: 55vh; }
}

@media (max-width: 560px) {
  .profile-two-columns { grid-template-columns: 1fr; }
  .welcome-home { padding: 38px 18px 55px; gap: 26px; }
  .welcome-copy h1 { margin-top: 10px; font-size: clamp(2.35rem, 13vw, 3.3rem); }
  .welcome-actions { display: grid; }
  .welcome-actions .button { width: 100%; }
  .welcome-features { grid-template-columns: 1fr; }
  .welcome-features div { padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
  .welcome-features div + div { padding-left: 0; border-left: 0; }
  .welcome-visual { min-height: 330px; }
  .welcome-binder { width: 105%; padding: 14px 16px 14px 21px; gap: 4px; border-width: 9px 15px; }
  .welcome-page { padding: 8px; }
  .welcome-pockets { gap: 4px; }
  .welcome-visual-note { right: -2%; bottom: -2%; }
  .top-actions .button.primary { padding-inline: 10px; }
  .crumbs { flex: 1; min-width: 0; }
  .crumbs strong { max-width: 32vw; }
  .binder-toolbar { min-height: 70px; padding: 10px 14px; }
  .binder-toolbar { flex-wrap: wrap; gap: 9px; }
  .title-line { flex-wrap: wrap; }
  .title-line input { width: auto; min-width: 150px; flex: 1; font-size: 1.17rem; }
  .view-controls { width: 100%; justify-content: flex-start; }
  .layout-control { flex: 1; min-width: 82px; }
  .layout-control select { width: 100%; }
  .view-controls .tool-button { width: 35px; padding: 0; justify-content: center; font-size: 0; }
  .view-controls .tool-button svg { width: 1rem; height: 1rem; }
  .binder-stage-wrap { grid-template-columns: 27px minmax(0,1fr) 27px; padding-left: 3px; padding-right: 3px; }
  .page-arrow { width: 27px; height: 44px; border-radius: 9px; }
  .binder-stage { aspect-ratio: .78/1; max-height: 74vh; padding: 13px; border-width: 9px 14px; }
  .binder-stage[data-layout="4x3"] { aspect-ratio: 1/1; }
  .binder-stage[data-layout="5x4"] { aspect-ratio: .91/1; }
  .page { padding: 10px; }
  .pocket-grid { gap: 6px; }
  .page-footer { padding: 0 35px 10px; }
  .saved-state { display: none; }
  .topbar #accountLink { width: 38px; min-width: 38px; padding: 0; font-size: .72rem; }
  .privacy-toggle { display: none; }
  .community-grid { grid-template-columns: 1fr; }
  .public-binder-card { grid-template-columns: 1fr; }
  .public-binder-preview { grid-template-columns: repeat(4, 38px); }
  .public-binder-preview img, .public-binder-preview .mini-card-empty { width: 38px; height: 53px; }
  .community-modal { width: calc(100vw - 16px); max-height: calc(100vh - 16px); border-radius: 16px; }
  .community-shell { max-height: calc(100vh - 16px); padding: 18px; }
  .toast { right: 15px; bottom: 15px; }
  .card-detail-dialog { width: calc(100vw - 14px); max-height: calc(100vh - 14px); border-radius: 16px; }
  .card-detail-dialog > article { max-height: calc(100vh - 14px); padding: 17px; }
  .card-detail-media { min-height: 250px; padding: 14px; }
  .card-detail-copy { padding-right: 0; }
  .market-prices { grid-template-columns: 1fr; }
  .layout-choices { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* El catálogo ocupa la pantalla para que las ilustraciones sean fáciles de comparar. */
.catalog-panel {
  position: fixed;
  inset: 14px;
  z-index: 80;
  width: min(1540px, calc(100vw - 28px));
  min-width: 0;
  height: calc(100dvh - 28px);
  max-height: none;
  margin: auto !important;
  padding: 0;
  overflow: hidden;
  border: 1px solid #363d39;
  border-radius: 18px;
  background: #171a19;
  color: var(--text);
  box-shadow: 0 34px 110px rgba(0,0,0,.72);
  transform: none;
  opacity: 1;
  transition: none;
}
.catalog-panel[open] { display: grid; grid-template-rows: auto auto minmax(0, 1fr); }
.catalog-panel::backdrop { background: rgba(0,0,0,.78); backdrop-filter: blur(8px); }
.catalog-panel .panel-heading { min-height: 72px; align-items: center; margin: 0; padding: 14px 23px; border-bottom: 1px solid var(--line); }
.catalog-panel .panel-heading h1 { margin: 2px 0 0; font-size: 1.34rem; }
.catalog-panel .panel-close { width: 36px; height: 36px; }
.catalog-modebar { min-height: 62px; padding: 10px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); background: #1a1e1c; }
.catalog-modebar .segmented { width: min(360px, 100%); margin: 0; }
.catalog-modebar .segment { min-height: 36px; font-size: .82rem; }
.catalog-target { color: var(--muted); font-size: .78rem; }
.catalog-panel #catalogTab.active { min-height: 0; display: grid; grid-template-columns: 248px minmax(0,1fr); }
.catalog-filters { min-height: 0; padding: 24px 17px; border-right: 1px solid var(--line); background: #191d1b; overflow-y: auto; }
.catalog-filter-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 22px; }
.catalog-filter-heading h2 { margin: 0; font-size: .9rem; }
.catalog-filter-heading .text-button { font-size: .78rem; }
.catalog-filters .filter-row { display: grid; grid-template-columns: 1fr; gap: 18px; }
.catalog-filters .filter-row label { gap: 8px; color: #bec9c3; font-size: .82rem; }
.catalog-filters select { height: 42px; font-size: .82rem; }
.filter-hint { margin: 25px 0 0; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; line-height: 1.5; }
.catalog-content { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto auto minmax(0,1fr); }
.catalog-content .search-form { padding: 17px 22px; border-bottom: 1px solid var(--line); }
.catalog-content .search-box { min-height: 44px; max-width: none; }
.catalog-content .search-box input { font-size: .9rem; }
.catalog-content .results-meta { margin: 0; padding: 15px 22px 5px; font-size: .78rem; }
.catalog-content .results-meta span:last-child { color: var(--muted-2); }
.catalog-scroll { min-height: 0; padding: 15px 22px 28px; overflow-y: auto; scrollbar-width: thin; }
.catalog-scroll .card-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); align-items: start; gap: 26px 17px; }
.catalog-scroll .result-card { border: 0; border-radius: 0; background: transparent; overflow: visible; }
.catalog-scroll .result-card:hover { transform: none; }
.catalog-scroll .result-image { margin: 0; border-radius: 11px; box-shadow: 0 8px 24px rgba(0,0,0,.24); }
.catalog-scroll .result-image img { object-fit: cover; }
.catalog-scroll .result-copy { padding: 10px 1px 0; }
.catalog-scroll .result-copy strong { color: #f4f7f5; font-size: .89rem; }
.catalog-scroll .result-copy small { margin-top: 3px; color: #a0ada6; font-size: .73rem; }
.catalog-scroll .add-card { position: static; width: 100%; height: 37px; margin-top: 10px; border: 0; border-radius: 8px; background: var(--lime); color: #101310; box-shadow: none; font-size: .8rem; font-weight: 800; }
.catalog-scroll .add-card:hover { background: #e5ff96; color: #101310; }
.catalog-scroll .result-skeleton { aspect-ratio: 2.5 / 4.4; }
.catalog-panel #customTab.active { min-height: 0; display: grid; grid-template-columns: minmax(240px, .8fr) minmax(320px, 1fr); align-content: center; align-items: center; gap: clamp(20px, 5vw, 75px); padding: clamp(22px, 5vw, 75px); overflow-y: auto; }
.catalog-panel .custom-intro { text-align: left; }
.catalog-panel .custom-art { margin-left: 0; }
.catalog-panel .custom-intro h2 { font-size: 1.5rem; }
.catalog-panel .custom-intro p { max-width: 340px; font-size: .9rem; }
.catalog-panel .custom-form { width: min(100%, 490px); gap: 17px; }
.catalog-panel .custom-form label { font-size: .81rem; }
.catalog-panel .custom-form input { height: 42px; font-size: .84rem; }
.catalog-panel .upload-zone { min-height: 165px; }

.pocket.empty.selected { border-style: solid; border-color: var(--lime); background: rgba(215,255,89,.035); box-shadow: 0 0 0 2px rgba(215,255,89,.15); }
.empty-pocket-trigger { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; font-size: 1rem; }
.pocket.empty:hover .empty-pocket-trigger { border-color: rgba(215,255,89,.48); color: var(--lime); }
.empty-pocket-actions { position: absolute; z-index: 3; inset: 8px; display: none; align-content: center; gap: 7px; }
.pocket.empty.selected .empty-pocket-trigger { display: none; }
.pocket.empty.selected .empty-pocket-actions { display: grid; }
.empty-pocket-actions button { width: 100%; min-height: 32px; padding: 4px 5px; border: 1px solid #4c5550; border-radius: 7px; background: #2c322f; color: #fff; cursor: pointer; font-size: clamp(.55rem, .75vw, .72rem); font-weight: 750; line-height: 1.15; }
.empty-pocket-actions button:hover { border-color: var(--lime); background: #394235; }

@media (max-width: 900px) {
  .catalog-panel { inset: 7px; width: calc(100vw - 14px); height: calc(100dvh - 14px); border-radius: 13px; }
  .catalog-panel #catalogTab.active { grid-template-columns: 185px minmax(0,1fr); }
  .catalog-filters { padding: 18px 11px; }
  .catalog-scroll .card-results { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 18px 12px; }
}
@media (max-width: 640px) {
  .catalog-panel[open] { grid-template-rows: auto auto minmax(0,1fr); }
  .catalog-panel .panel-heading { min-height: 61px; padding: 10px 14px; }
  .catalog-modebar { min-height: 55px; padding: 8px 12px; }
  .catalog-target { display: none; }
  .catalog-panel #catalogTab.active { display: flex; flex-direction: column; }
  .catalog-filters { order: 2; overflow: visible; padding: 8px 12px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .catalog-filter-heading { margin-bottom: 7px; }
  .catalog-filters .filter-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .catalog-filters .filter-row label { font-size: .72rem; }
  .catalog-filters select { height: 36px; font-size: .73rem; }
  .filter-hint { display: none; }
  .catalog-content { order: 1; min-height: 0; display: contents; }
  .catalog-content .search-form { order: 1; padding: 10px 12px; }
  .catalog-content .results-meta { order: 3; padding: 10px 12px 0; }
  .catalog-content .results-meta span:last-child { display: none; }
  .catalog-scroll { order: 4; min-height: 0; flex: 1; padding: 10px 12px 18px; }
  .catalog-scroll .card-results { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px 10px; }
  .catalog-panel #customTab.active { grid-template-columns: 1fr; align-content: start; gap: 8px; padding: 20px; }
  .catalog-panel .custom-intro { padding: 0 0 10px; }
  .catalog-panel .custom-art { display: none; }
}
