/* Be Vietnam Pro, self-hosted (Vietnamese + Latin subsets) */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/be-vietnam-pro-400-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/be-vietnam-pro-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/be-vietnam-pro-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets/fonts/be-vietnam-pro-500-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets/fonts/be-vietnam-pro-500-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets/fonts/be-vietnam-pro-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets/fonts/be-vietnam-pro-600-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets/fonts/be-vietnam-pro-600-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets/fonts/be-vietnam-pro-600-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/fonts/be-vietnam-pro-700-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/fonts/be-vietnam-pro-700-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/fonts/be-vietnam-pro-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ================= tokens ================= */
* { box-sizing: border-box; }
:root {
  --bg: #0b0c0f; --panel: #111318; --panel-2: #161920; --panel-3: #1d2129;
  --line: rgba(255,255,255,.07); --line-2: rgba(255,255,255,.12); --line-3: rgba(255,255,255,.2);
  --text: #eceef2; --muted: #8b919d; --faint: #5f6570;
  --accent: #ef3340; --accent-2: #ff6a3d; --accent-soft: rgba(239,51,64,.12);
  --ok: #34d399; --alpha: #60a5fa; --emission: #fbbf24; --danger: #f87171;
  --font: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif;
  --top: 56px;
  color-scheme: dark;
}
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; text-decoration: none; }
.i { width: 16px; height: 16px; flex: none; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; flex: none; }
:focus-visible { outline: 2px solid rgba(239,51,64,.7); outline-offset: 2px; }
::selection { background: rgba(239,51,64,.35); }
* { scrollbar-width: thin; scrollbar-color: #2a2f39 transparent; }

.boot { height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); }
.boot img { width: 56px; height: 56px; object-fit: contain; animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .5; transform: scale(.94); } }
body.route-loading::after { content: ""; position: fixed; top: 0; left: 0; z-index: 200; height: 2px; width: 40%; background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: loadbar 1s ease-in-out infinite; }
@keyframes loadbar { from { transform: translateX(-100%); } to { transform: translateX(350%); } }

/* ================= buttons ================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel-2); font-weight: 600; font-size: 13px; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s, filter .15s; }
.btn:hover:not(:disabled) { background: var(--panel-3); border-color: var(--line-3); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn.primary { border-color: transparent; color: #fff; background: linear-gradient(180deg, var(--accent-2), var(--accent)); box-shadow: 0 8px 22px -10px rgba(239,51,64,.8), inset 0 1px 0 rgba(255,255,255,.2); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); background: linear-gradient(180deg, var(--accent-2), var(--accent)); }
.btn.ghost { background: transparent; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn.discord { height: 46px; width: 100%; color: #fff; border: 0; background: #5865f2; font-size: 14px; }
.btn.discord:hover { background: #4752c4; }
.btn.discord svg { width: 20px; height: 20px; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); transition: all .15s; }
.icon-btn:hover:not(:disabled) { color: var(--text); background: var(--panel-3); border-color: var(--line); }
.icon-btn.danger:hover:not(:disabled) { color: #fff; background: rgba(239,51,64,.85); border-color: transparent; }
.icon-btn.glass { width: 36px; height: 36px; color: #fff; background: rgba(8,9,12,.55); backdrop-filter: blur(8px); border-color: rgba(255,255,255,.14); }
.link { border: 0; background: none; padding: 0; color: var(--muted); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--text); }

/* ================= top bar ================= */
.top { position: relative; z-index: 40; height: var(--top); display: flex; align-items: center; gap: 14px; padding: 0 16px 0 20px; border-bottom: 1px solid var(--line); background: var(--bg); }
.brand { display: flex; align-items: center; gap: 8px; margin-right: 8px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.brand img { width: 28px; height: 28px; object-fit: contain; }
.brand em { font-style: normal; font-weight: 500; color: var(--muted); }
.nav { display: flex; gap: 2px; }
.nav-tab { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; transition: color .15s, background .15s; }
.nav-tab:hover { color: var(--text); background: var(--panel); }
.nav-tab.on { color: var(--text); background: var(--panel-2); }
.search { display: flex; align-items: center; gap: 8px; width: min(400px, 30vw); height: 36px; margin-left: 8px; padding: 0 8px 0 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); transition: border-color .15s, box-shadow .15s; }
.search:focus-within { border-color: var(--line-2); box-shadow: 0 0 0 3px rgba(239,51,64,.15); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); }
.search input::placeholder { color: var(--faint); }
.search input::-webkit-search-cancel-button { filter: invert(.6); }
kbd { font: 600 10px/1 var(--font); padding: 4px 6px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.quota { display: flex; flex-direction: column; gap: 4px; width: 150px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.quota i { display: block; height: 4px; border-radius: 4px; background: var(--panel-3); overflow: hidden; }
.quota b { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.user { position: relative; }
.user-btn { display: grid; place-items: center; padding: 0; border: 0; background: none; border-radius: 50%; }
.me { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--panel-3); display: block; }
.user-menu { position: absolute; right: 0; top: 44px; width: 240px; padding: 6px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: 0 20px 50px -12px rgba(0,0,0,.8); }
.user-menu[hidden] { display: none; }
.um-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.um-head strong { display: block; font-size: 13px; }
.um-head span { font-size: 12px; color: var(--muted); }
.um-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font-size: 13px; font-weight: 500; }
.um-item:hover { background: var(--panel-3); }

/* ================= page ================= */
.main { height: calc(100vh - var(--top)); overflow-y: auto; }
.page { max-width: 1600px; margin: 0 auto; padding: 26px 32px 140px; }
.page.narrow { max-width: 980px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 26px; letter-spacing: -.025em; }
.page-head h1 small { margin-left: 6px; font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.hint { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.hint .i { width: 14px; height: 14px; color: var(--accent); }
.summary { display: flex; gap: 18px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.summary b { color: var(--text); font-weight: 600; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.pill { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .02em; transition: all .15s; }
.pill small { margin-left: 3px; font-weight: 500; opacity: .65; }
.pill:hover { color: var(--text); border-color: var(--line-2); }
.pill.on { background: var(--text); color: var(--bg); border-color: var(--text); }

/* month groups */
.month + .month { margin-top: 10px; }
.month-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: baseline; gap: 12px; margin: 0 -32px; padding: 16px 32px 12px; font-size: 16px; letter-spacing: -.01em; background: linear-gradient(var(--bg) 78%, transparent); }
.month-head::before { content: ""; align-self: center; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(239,51,64,.18); }
.month-head small { font-size: 12px; font-weight: 500; color: var(--muted); }

/* tags */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .03em; color: var(--muted); background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.tags.sm .tag { height: 21px; padding: 0 7px; font-size: 10px; }
.tag.flag::before { content: ""; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; }
.tag.alpha { color: #bcd7fd; border-color: rgba(96,165,250,.3); background: rgba(96,165,250,.1); }
.tag.alpha::before { background: var(--alpha); }
.tag.emission { color: #fde3a1; border-color: rgba(251,191,36,.3); background: rgba(251,191,36,.1); }
.tag.emission::before { background: var(--emission); box-shadow: 0 0 8px var(--emission); }
.av { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; background: var(--panel-3); flex: none; display: inline-block; }
.av.lg { width: 36px; height: 36px; }

/* ================= product cards ================= */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.pcard { position: relative; display: flex; flex-direction: column; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; cursor: pointer; outline: 0; transition: transform .2s cubic-bezier(.2,.7,.2,1), border-color .15s, box-shadow .2s; }
.pcard:hover, .pcard:focus-visible { transform: translateY(-2px); border-color: var(--line-2); box-shadow: 0 18px 40px -24px rgba(0,0,0,.9); }
.pcard.open { border-color: rgba(239,51,64,.6); box-shadow: 0 0 0 1px rgba(239,51,64,.6); }
.pcard.picked { border-color: rgba(255,255,255,.4); box-shadow: 0 0 0 1px rgba(255,255,255,.4); }
.pc-media { position: relative; aspect-ratio: 16 / 10; background: var(--panel-3); overflow: hidden; }
.pc-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.pcard:hover .pc-media img { transform: scale(1.04); }
.pc-files { position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 7px; font-size: 11px; font-weight: 800; color: #fff; background: rgba(8,9,12,.6); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.12); }
.pc-files .i { width: 12px; height: 12px; }
.pc-pick { position: absolute; top: 10px; left: 10px; z-index: 2; opacity: 0; transition: opacity .15s; cursor: pointer; }
.pcard:hover .pc-pick:not(.disabled), .pcard.picked .pc-pick, body.has-selection .pc-pick:not(.disabled) { opacity: 1; }
.pc-pick input { position: absolute; opacity: 0; pointer-events: none; }
.pc-pick span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: transparent; background: rgba(8,9,12,.55); border: 1.5px solid rgba(255,255,255,.75); backdrop-filter: blur(8px); transition: all .15s; }
.pc-pick span .i { width: 15px; height: 15px; stroke-width: 2.6; }
.pc-pick input:checked + span { color: #fff; background: var(--accent); border-color: var(--accent); }
.pc-pick.disabled { display: none; }
.pc-drop { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #fff; opacity: 0; pointer-events: none; transition: opacity .15s, background .15s; }
.pc-drop div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0 16px; }
.pc-drop .i { width: 26px; height: 26px; margin-bottom: 4px; }
.pc-drop span { font-size: 12px; opacity: .9; }
body.dragging .pcard { border-style: dashed; border-color: rgba(255,255,255,.22); }
body.dragging .pcard * { pointer-events: none; }
body.dragging .pcard.hover { border-style: solid; border-color: var(--accent); transform: scale(1.02); box-shadow: 0 0 0 3px rgba(239,51,64,.35); }
body.dragging .pcard.hover .pc-drop { opacity: 1; background: rgba(239,51,64,.6); backdrop-filter: blur(2px); }
.pc-body { display: flex; flex-direction: column; gap: 9px; flex: 1; padding: 12px 14px; }
.pc-title em { display: block; margin-bottom: 1px; font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: .1em; color: var(--accent); }
.pc-title h3 { margin: 0; font-size: 15px; line-height: 1.3; letter-spacing: -.01em; overflow-wrap: anywhere; }
.pc-foot { display: flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 9px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); white-space: nowrap; }
.pc-foot .av { width: 18px; height: 18px; }
.pc-who { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pc-foot b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.empty-state { display: grid; justify-items: center; gap: 6px; padding: 80px 20px; text-align: center; color: var(--muted); }
.empty-state h3 { margin: 6px 0 0; color: var(--text); font-size: 17px; }
.empty-state p { margin: 0 0 12px; }
.empty-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.empty-icon .i { width: 24px; height: 24px; }

/* selection bar */
.selection-bar { position: fixed; left: 50%; bottom: 22px; z-index: 50; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 18px; border-radius: 14px; background: rgba(28,32,40,.94); backdrop-filter: blur(16px); border: 1px solid var(--line-2); box-shadow: 0 24px 50px -16px rgba(0,0,0,.85); transform: translate(-50%, 140%); opacity: 0; pointer-events: none; transition: transform .25s cubic-bezier(.2,.8,.2,1), opacity .2s; }
.selection-bar.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.sel-count { margin-right: 8px; font-size: 13px; }
.sel-count span { display: block; font-size: 11px; color: var(--muted); }

/* ================= drawer ================= */
#drawer .scrim { position: fixed; inset: var(--top) 0 0 0; z-index: 60; background: rgba(4,5,7,.55); backdrop-filter: blur(2px); animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: var(--top); right: 0; bottom: 0; z-index: 70; width: min(960px, 72vw); display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; background: var(--bg); border-left: 1px solid var(--line-2); box-shadow: -40px 0 80px -30px rgba(0,0,0,.8); }
.drawer.enter { animation: slide .28s cubic-bezier(.2,.8,.2,1); }
@keyframes slide { from { transform: translateX(48px); opacity: 0; } }
.dr-hero { position: relative; height: 240px; flex: none; overflow: hidden; background: var(--panel); }
.dr-hero > img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; display: block; }
.dr-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,12,15,.25), rgba(11,12,15,.35) 40%, var(--bg)); }
.dr-tools { position: sticky; top: 0; z-index: 3; height: 0; display: flex; justify-content: flex-end; gap: 6px; padding-right: 14px; overflow: visible; }
.dr-tools .icon-btn { margin-top: 14px; }
.dr-tools .icon-btn.glass.danger:hover { background: var(--accent); }
.dr-title { position: absolute; left: 28px; right: 28px; bottom: 16px; }
.dr-title h1 { margin: 2px 0 10px; font-size: 30px; line-height: 1.1; letter-spacing: -.03em; text-shadow: 0 2px 16px rgba(0,0,0,.6); overflow-wrap: anywhere; }
.pcol { font-size: 11px; font-weight: 800; letter-spacing: .1em; color: var(--accent); }
.dr-body { flex: none; padding: 10px 28px 140px; }
.dr-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.dr-meta b { color: var(--text); font-weight: 600; }
.desc { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-size: 13px; white-space: pre-line; }
.skeleton { border-radius: 12px; background: var(--panel); animation: pulse 1.1s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .45; } }

/* composer */
.composer { margin-top: 18px; padding: 16px; border-radius: 16px; background: linear-gradient(180deg, var(--panel), #0f1116); border: 1px solid var(--line-2); }
.composer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.composer-head h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; }
.composer-head h3 .i { color: var(--accent); }
.composer-head .hint { margin: 0; font-size: 12px; }
.composer-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 14px; }
.step { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 7px; border-radius: 5px; font-size: 11px; font-weight: 800; color: #fff; background: var(--accent); vertical-align: 1px; }
.note-box { display: flex; flex-direction: column; gap: 8px; }
.note-box label { font-size: 12px; font-weight: 600; color: var(--muted); }
.note-box textarea { flex: 1; min-height: 112px; resize: vertical; padding: 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); outline: 0; transition: border-color .15s; }
.note-box textarea:focus { border-color: var(--line-3); }
.note-box textarea::placeholder { color: var(--faint); }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.preset { height: 26px; padding: 0 10px; border-radius: 999px; border: 1px dashed var(--line-2); background: none; color: var(--muted); font-size: 12px; }
.preset:hover { color: var(--text); border-style: solid; }
.dz { position: relative; display: flex; flex-direction: column; min-height: 200px; border-radius: 12px; border: 1.5px dashed rgba(255,255,255,.14); background: radial-gradient(120% 100% at 50% 0%, rgba(239,51,64,.06), transparent 60%); transition: border-color .2s, background .2s; }
.dz:hover, body.dragging-open .dz { border-color: rgba(239,51,64,.55); background: radial-gradient(120% 100% at 50% 0%, rgba(239,51,64,.12), transparent 70%); }
.dz.has-files { border-style: solid; border-color: var(--line-2); background: var(--bg); }
.dz-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 16px; text-align: center; }
.dz-empty strong { font-size: 14px; }
.dz-empty span { font-size: 12px; color: var(--muted); }
.dz-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 6px; border-radius: 12px; color: var(--accent); background: var(--accent-soft); }
.dz-icon .i { width: 22px; height: 22px; }
.dz-icon.spin .i { animation: bob 1s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-3px); } }
.dz-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.dz-actions.center { justify-content: center; }
.dz.has-files .dz-actions { margin: 0; padding: 10px; border-top: 1px solid var(--line); }
.dz-label { display: flex; align-items: center; gap: 4px; padding: 10px 12px 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.dz-label .link { margin-left: auto; }
.staged { flex: 1; display: flex; flex-direction: column; gap: 4px; max-height: 220px; padding: 4px 8px 8px; overflow-y: auto; }
.srow { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto 26px; gap: 10px; align-items: center; padding: 5px 6px 5px 8px; border-radius: 8px; background: var(--panel-2); }
.sname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.srow b { font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.x { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--muted); }
.x:hover { background: var(--panel-3); color: var(--text); }
.ext { display: grid; place-items: center; height: 30px; border-radius: 7px; font-size: 10px; font-weight: 800; letter-spacing: .04em; color: #ffb4a8; background: var(--accent-soft); }
.ext.sm { display: inline-grid; height: 22px; min-width: 36px; padding: 0 4px; font-size: 9px; border-radius: 5px; }

/* drawer tabs */
.dtabs { display: flex; gap: 4px; margin: 26px 0 12px; border-bottom: 1px solid var(--line); }
.dtabs button { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-weight: 600; font-size: 13px; }
.dtabs button small { padding: 1px 6px; border-radius: 5px; background: var(--panel-2); font-size: 11px; color: var(--muted); }
.dtabs button:hover { color: var(--text); }
.dtabs button.on { color: var(--text); border-bottom-color: var(--accent); }

/* file browser */
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; font-size: 12px; }
.crumbs button { height: 26px; padding: 0 8px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-weight: 600; }
.crumbs button:hover { background: var(--panel-2); color: var(--text); }
.crumbs button:last-of-type { color: var(--text); }
.crumbs > .i { width: 12px; height: 12px; color: var(--faint); }
.flist { display: flex; flex-direction: column; gap: 4px; }
.frow { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; width: 100%; padding: 7px 8px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); text-align: left; transition: border-color .15s, background .15s; }
.frow:hover { border-color: var(--line-2); background: var(--panel-2); }
.frow.folder { cursor: pointer; }
.ficon { display: grid; place-items: center; height: 30px; border-radius: 7px; }
.ficon.folder { color: var(--emission); background: rgba(251,191,36,.1); }
.fname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.fname small { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 11px; font-weight: 400; color: var(--muted); }
.fsize { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.factions { display: flex; gap: 2px; }
.fopen { display: grid; place-items: center; width: 32px; color: var(--muted); }
.fmore { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.empty-mini { display: flex; align-items: center; gap: 10px; padding: 18px; border-radius: 12px; border: 1px dashed var(--line-2); color: var(--muted); font-size: 13px; }

/* history timeline */
.tl { position: relative; margin: 0; padding: 0; list-style: none; }
.tl::before { content: ""; position: absolute; left: 21px; top: 18px; bottom: 18px; width: 2px; background: linear-gradient(var(--line-2), transparent); }
.ver-item { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; margin-bottom: 10px; }
.node { position: relative; z-index: 1; display: grid; place-items: center; width: 44px; height: 26px; margin-top: 12px; border-radius: 8px; font-size: 11px; font-weight: 800; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line-2); }
.latest .node { color: #fff; background: var(--accent); border-color: transparent; box-shadow: 0 0 0 4px rgba(239,51,64,.18); }
.ver-card { padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.latest .ver-card { border-color: rgba(239,51,64,.28); }
.ver-head { display: flex; align-items: center; gap: 10px; }
.badge { padding: 3px 7px; border-radius: 5px; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ok); background: rgba(52,211,153,.1); }
.ver-note { font-weight: 600; overflow-wrap: anywhere; }
.ver-note.muted { font-weight: 500; font-style: italic; color: var(--faint); }
.ver-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.ver-meta .av { width: 18px; height: 18px; }
.ver-meta b { color: var(--text); font-weight: 600; }
.ver-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; max-width: 280px; height: 28px; padding: 0 9px 0 4px; border-radius: 7px; background: var(--bg); border: 1px solid var(--line); font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fchip.more { padding: 0 9px; color: var(--muted); }

/* drop hint when a product is open */
#drop-hint { position: fixed; inset: var(--top) 0 0 auto; width: min(960px, 72vw); z-index: 80; display: none; place-items: center; background: rgba(11,12,15,.72); backdrop-filter: blur(4px); pointer-events: none; }
body.dragging-open #drop-hint { display: grid; }
.drop-card { display: grid; justify-items: center; gap: 4px; padding: 34px 48px; border-radius: 18px; border: 2px dashed var(--accent); background: rgba(239,51,64,.1); text-align: center; }
.drop-card .i { width: 34px; height: 34px; margin-bottom: 6px; color: var(--accent); }
.drop-card span { color: var(--muted); }
.drop-card strong { font-size: 22px; letter-spacing: -.02em; }

/* ================= tray ================= */
.tray { position: fixed; right: 20px; bottom: 20px; z-index: 90; width: 380px; border-radius: 16px; background: rgba(22,25,32,.95); backdrop-filter: blur(16px); border: 1px solid var(--line-2); box-shadow: 0 30px 60px -20px rgba(0,0,0,.85); overflow: hidden; animation: rise .25s cubic-bezier(.2,.7,.2,1); }
.tray[hidden] { display: none; }
.tray.has-error { border-color: rgba(248,113,113,.4); }
@keyframes rise { from { transform: translateY(20px); opacity: 0; } }
.tray-head { display: flex; align-items: center; gap: 10px; padding: 12px 10px 12px 14px; cursor: pointer; }
.tray.min .tray-list, .tray.min .tray-stats { display: none; }
.tray.min .tray-head .icon-btn:first-of-type .i { transform: rotate(180deg); }
.ring { --p: 0; flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--panel-3) 0); }
.ring.ok { background: var(--ok); }
.ring span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--panel-2); font-size: 10px; font-weight: 800; }
.ring.ok span { color: var(--ok); }
.tray-title { flex: 1; min-width: 0; }
.tray-title b { display: block; font-size: 13px; }
.tray-title span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tray-stats { display: flex; gap: 12px; padding: 0 14px 8px; font-size: 11px; color: var(--muted); }
.tray-stats .err { color: var(--danger); }
.tray-list { max-height: 280px; overflow-y: auto; padding: 6px; border-top: 1px solid var(--line); }
.titem { display: grid; grid-template-columns: 38px minmax(0, 1fr) 20px; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 10px; }
.tname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.tsub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tbar { display: block; height: 3px; margin-top: 5px; border-radius: 3px; background: var(--panel-3); overflow: hidden; }
.tbar b { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .2s linear; }
.titem.done .tbar b { background: var(--ok); }
.titem.error .tbar b { background: var(--danger); }
.titem.error .tsub { color: var(--danger); }
.titem.wait { opacity: .6; }
.tstate { display: grid; place-items: center; color: var(--muted); }
.titem.done .tstate { color: var(--ok); }
.titem.error .tstate { color: var(--danger); }
.tmore { padding: 6px 8px; font-size: 11px; color: var(--muted); }

/* ================= dialogs ================= */
dialog.modal { width: min(520px, 92vw); padding: 0; border-radius: 18px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); box-shadow: 0 40px 80px -20px rgba(0,0,0,.9); }
dialog.modal.small { width: min(440px, 92vw); }
dialog::backdrop { background: rgba(4,5,7,.7); backdrop-filter: blur(4px); }
dialog[open] { animation: pop .2s cubic-bezier(.2,.8,.2,1); }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
dialog.modal form { display: flex; flex-direction: column; gap: 16px; padding: 20px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; }
.modal-head h2 { margin: 2px 0 0; font-size: 19px; letter-spacing: -.02em; }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); }
.field input, .field textarea { width: 100%; padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line-2); outline: 0; transition: border-color .15s, box-shadow .15s; }
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--line-3); box-shadow: 0 0 0 3px rgba(239,51,64,.12); }
.field small { font-size: 11px; color: var(--faint); }
.field small b { color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.drop-image { position: relative; display: block; aspect-ratio: 16 / 7; border-radius: 12px; border: 1.5px dashed rgba(255,255,255,.18); background: radial-gradient(120% 100% at 50% 0%, rgba(239,51,64,.08), transparent 60%); overflow: hidden; cursor: pointer; transition: border-color .15s; }
.drop-image:hover { border-color: rgba(239,51,64,.6); }
.drop-image.has-image { border-style: solid; border-color: var(--line-2); }
#banner-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; }
#banner-label strong { font-size: 13px; }
#banner-label small { font-size: 11px; color: var(--muted); }
.banner-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner-meta { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; padding: 18px 12px 10px; text-align: left; background: linear-gradient(transparent, rgba(0,0,0,.8)); }
dialog.preview { width: min(1100px, 94vw); max-height: 92vh; padding: 0; border-radius: 16px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); overflow: hidden; }
.preview-head { display: flex; align-items: center; gap: 6px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line); }
.preview-head strong { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.preview-stage { display: grid; place-items: center; min-height: 300px; max-height: calc(92vh - 54px); padding: 12px; background: repeating-conic-gradient(#14161b 0 25%, #191c22 0 50%) 0 0 / 20px 20px; }
.preview-stage img { max-width: 100%; max-height: calc(92vh - 80px); object-fit: contain; }
.preview-status { color: var(--muted); }

/* ================= admin ================= */
.member-form { margin-bottom: 18px; padding: 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-2); }
.mf-main { display: flex; flex-direction: column; gap: 8px; }
.mf-main label { font-size: 13px; font-weight: 600; }
.mf-row { display: flex; gap: 8px; }
.mf-row input { flex: 1; height: 38px; padding: 0 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line-2); outline: 0; font-variant-numeric: tabular-nums; }
.mf-row input:focus { border-color: var(--line-3); box-shadow: 0 0 0 3px rgba(239,51,64,.12); }
.mf-row .btn { height: 38px; }
.mf-main small { font-size: 12px; color: var(--muted); }
.mf-main small b { color: var(--text); font-weight: 600; }
.member-list { display: flex; flex-direction: column; gap: 6px; }
.mrow { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto 190px 36px; gap: 14px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.mcopy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.mcopy code { font-size: 12px; color: var(--muted); }
.role { padding: 3px 9px; border-radius: 6px; font-size: 11px; font-weight: 800; letter-spacing: .04em; color: var(--muted); background: var(--panel-3); }
.role.admin { color: #ffb4a8; background: var(--accent-soft); }
.madded { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.madded small { color: var(--faint); }
.you { justify-self: center; font-size: 11px; font-weight: 800; color: var(--ok); }

/* ================= login ================= */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(60% 50% at 50% 0%, rgba(239,51,64,.16), transparent 70%), var(--bg); overflow-y: auto; }
.login-card { width: min(400px, 100%); display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 36px 30px 28px; border-radius: 22px; background: rgba(17,19,24,.85); border: 1px solid var(--line-2); box-shadow: 0 40px 80px -30px rgba(0,0,0,.9); text-align: center; }
.login-logo { width: 64px; height: 64px; object-fit: contain; }
.login-card h1 { margin: 4px 0 0; font-size: 24px; letter-spacing: -.02em; }
.login-card h1 span { font-weight: 500; color: var(--muted); }
.login-card p { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.login-card .btn.ghost { width: 100%; }
.login-card small { margin-top: 6px; font-size: 12px; color: var(--faint); }
.login-error { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; border-radius: 10px; font-size: 13px; color: var(--danger); background: rgba(248,113,113,.1); }

/* ================= toast ================= */
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 300; display: flex; align-items: center; gap: 8px; max-width: min(560px, 90vw); padding: 10px 16px; border-radius: 12px; background: var(--panel-3); border: 1px solid var(--line-2); box-shadow: 0 20px 40px -16px rgba(0,0,0,.8); font-weight: 600; font-size: 13px; opacity: 0; pointer-events: none; transform: translate(-50%, 16px); transition: all .2s; }
.toast .i { color: var(--ok); }
.toast.error { border-color: rgba(248,113,113,.4); }
.toast.error .i { color: var(--danger); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
body:has(.selection-bar.show) .toast { bottom: 96px; }

/* ================= smaller screens ================= */
@media (max-width: 1100px) {
  .quota { display: none; }
  .drawer, #drop-hint { width: 100vw; }
  .composer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .top { gap: 8px; padding: 0 10px; }
  .brand span, .brand em, .nav-tab, kbd { font-size: 0; gap: 0; }
  .brand em { display: none; }
  .search { width: auto; flex: 1; margin: 0; }
  .top .btn.primary { padding: 0 10px; font-size: 0; gap: 0; }
  .page { padding: 18px 14px 140px; }
  .month-head { margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .dr-body { padding: 10px 14px 140px; }
  .dr-title { left: 14px; right: 14px; }
  .tray { left: 10px; right: 10px; width: auto; bottom: 10px; }
  .mrow { grid-template-columns: 36px minmax(0, 1fr) auto 36px; }
  .madded { display: none; }
}
