:root {
    color-scheme: light;
    --bg: #ffffff;
    --bg-soft: #f7f8fa;
    --panel: #ffffff;
    --line: #e4e7ee;
    --line-soft: #eef0f5;
    --ink: #11141b;
    --ink-soft: #3f4756;
    --muted: #767f90;
    --accent: #3d5afe;
    --accent-soft: #eef1ff;
    --ok: #0f9d58;
    --warn: #b26a00;
    --danger: #c62828;
    --radius: 16px;
    --shadow: 0 2px 4px rgba(17,20,27,.04), 0 12px 32px rgba(17,20,27,.06);
    --gutter: 56px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font: 400 15px/1.65 "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

body:has(.auth) {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    display: grid;
    grid-template-rows: 80px minmax(0,1fr) auto;
}
body:has(.auth) main { min-height: 0; display: grid; }

a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.015em; }
p { margin: 0; }
img { max-width: 100%; display: block; }

.shell { width: min(1240px, calc(100% - 96px)); margin-inline: auto; }

.topbar { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line-soft); background: rgba(255,255,255,.88); backdrop-filter: blur(14px); }
.topbar-inner { display: flex; align-items: center; gap: 18px; height: 80px; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 750; letter-spacing: -.02em; }
.brand-mark { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 10px; background: var(--ink); color: #fff; font-size: 15px; font-weight: 800; }
.topbar nav { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; min-width: 32px; aspect-ratio: 1; flex: 0 0 32px; border-radius: 50%; object-fit: cover; background: var(--bg-soft); }
.user-menu { position: relative; }
.user-menu summary { list-style: none; }
.user-menu summary::-webkit-details-marker { display: none; }
.mobile-menu-trigger:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 3px; }
.user-menu[open] .avatar { box-shadow: 0 0 0 3px var(--accent-soft); }
.mobile-menu-trigger { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); cursor: pointer; }
.user-menu-dropdown { position: absolute; top: calc(100% + 12px); right: 0; z-index: 50; width: min(260px, calc(100vw - 32px)); padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 18px 45px rgba(17,20,27,.14); }
.user-menu-identity { margin-bottom: 4px; padding: 8px 10px 12px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.user-menu-identity strong, .user-menu-identity span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-identity strong { font-size: 13.5px; font-weight: 700; }
.user-menu-identity span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.user-menu form { margin: 0; }
.user-menu-action { width: 100%; min-height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 11px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-soft); font: inherit; font-size: 13px; font-weight: 600; text-align: left; cursor: pointer; }
.user-menu-action:hover { background: var(--bg-soft); color: var(--ink); }
.user-menu-signout { color: var(--danger); }
.user-menu-signout:hover { background: #fdf5f5; color: var(--danger); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 42px; padding: 0 18px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); color: var(--ink); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.btn:hover { border-color: #ccd2de; background: var(--bg-soft); }
.btn-primary { border-color: var(--ink); background: var(--ink); color: #fff; }
.btn-primary:hover { border-color: #000; background: #000; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { border-color: var(--line); background: var(--bg-soft); }
.btn-danger { border-color: #f0d4d4; background: #fdf5f5; color: var(--danger); }
.btn-danger:hover { border-color: #e4bcbc; background: #fbebeb; }
.btn-sm { min-height: 36px; padding: 0 13px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg { flex: 0 0 auto; }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: var(--gutter) 0 32px; }
.filters + .filters { padding: 0 0 36px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink-soft); font-size: 13px; font-weight: 550; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.chip:hover { border-color: #ccd2de; background: var(--bg-soft); }
.chip.is-active { border-color: var(--ink); background: var(--ink); color: #fff; }
.chip b { color: var(--muted); font-weight: 600; font-size: 11px; }
.chip.is-active b { color: rgba(255,255,255,.6); }

.search { margin-left: auto; }
.btn i { flex: 0 0 auto; font-size: 1.05em; line-height: 1; }
.search input { min-width: 260px; height: 38px; border: 1px solid var(--line); border-radius: 999px; padding: 0 18px; background: var(--panel); color: var(--ink); font: inherit; font-size: 13px; }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 32px; padding-bottom: 80px; }
.card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.card:hover { transform: translateY(-3px); border-color: #d6dbe5; box-shadow: var(--shadow); }
.card-shot { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #0e1016; }
.card-shot img { width: 100%; height: 100%; object-fit: cover; }
.card-shot .placeholder { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; color: #5b6478; font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.card-body { display: flex; flex-direction: column; gap: 10px; padding: 24px; }
.card-body h3 { font-size: 17px; font-weight: 700; }
.card-body p { color: var(--muted); font-size: 13.5px; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 4px; }
.pill { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; color: var(--muted); font-size: 11.5px; font-weight: 550; }
.pill-draft { border-color: #f0e2c6; background: #fdf8ee; color: var(--warn); }

.empty { display: grid; place-items: center; align-content: center; gap: 10px; padding: 110px 24px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }
.empty strong { color: var(--ink); font-size: 18px; }

.detail { display: grid; grid-template-columns: minmax(0,1.85fr) minmax(300px,.9fr); gap: 40px; padding: var(--gutter) 0 90px; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; color: var(--muted); font-size: 11.5px; }
.breadcrumbs a:hover { color: var(--accent); }
.stage { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.stage.is-fixed-preview { width: min(442px,100%); margin-inline: auto; }
.stage-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; }
.stage-head-actions { display: flex; align-items: center; gap: 12px; }
.preview-expand { display: none; align-items: center; gap: 7px; min-height: 32px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; background: var(--panel); color: var(--ink-soft); font: inherit; letter-spacing: 0; text-transform: none; cursor: pointer; }
.stage-frame { position: relative; width: 100%; aspect-ratio: 16 / 10; background: #0e1016; }
.stage.is-fixed-preview .stage-frame { aspect-ratio: 2 / 3; overflow: hidden; background: var(--panel); }
.stage-frame iframe { position: absolute; inset: 0 auto auto 0; width: calc(100% + 1px); height: calc(100% + 1px); border: 0; }
.stage-frame.is-checker { background-image: linear-gradient(45deg,#171a22 25%,transparent 25%),linear-gradient(-45deg,#171a22 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#171a22 75%),linear-gradient(-45deg,transparent 75%,#171a22 75%); background-size: 24px 24px; background-position: 0 0,0 12px,12px -12px,-12px 0; }

.aside { display: flex; flex-direction: column; gap: 24px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 28px; }
.panel h2 { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.panel > h1 { font-size: 23px; font-weight: 750; line-height: 1.3; letter-spacing: -.02em; }
.panel .body { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.kv span { color: var(--muted); }
.file-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; }
.file-row code { color: var(--ink-soft); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.file-row span { color: var(--muted); font-size: 11.5px; }

.form { display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { color: var(--ink-soft); font-size: 12.5px; font-weight: 600; }
.field input[type="text"], .field input[type="email"], .field input[type="password"], .field input[type="number"], .field input[type="file"], .field select, .field textarea {
    width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 11px; padding: 11px 14px; background: var(--panel); color: var(--ink); font: inherit; font-size: 14px;
}
.field textarea { min-height: 130px; resize: vertical; line-height: 1.65; }
.field textarea.code { min-height: 110px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; white-space: pre; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
.field .hint { color: var(--muted); font-size: 12.5px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px,1fr)); gap: 18px; }
.check { display: flex; align-items: center; gap: 11px; color: var(--ink); font-size: 14px; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.drop { display: grid; place-items: center; align-content: center; gap: 7px; min-height: 150px; padding: 28px; border: 1px dashed #c7cedb; border-radius: 13px; background: var(--bg-soft); color: var(--muted); text-align: center; cursor: pointer; }
.drop:hover, .drop.is-over { border-color: var(--accent); background: var(--accent-soft); color: var(--ink-soft); }
.drop strong { color: var(--ink); font-size: 14px; }
.drop small { font-size: 12.5px; }
.drop input { display: none; }
.drop-list { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 7px; }

.auth { display: grid; place-items: center; min-height: 0; padding: 24px; }
.auth-card { width: min(420px,100%); border: 1px solid var(--line); border-radius: 18px; background: var(--panel); padding: 32px; box-shadow: var(--shadow); text-align: center; }
.auth-icon { width: 50px; height: 50px; display: grid; place-items: center; margin: 0 auto 14px; border: 1px solid #dfe4ff; border-radius: 14px; background: var(--accent-soft); color: var(--accent); }
.auth-card h1 { font-size: 24px; font-weight: 750; }
.auth-subtitle { margin-top: 7px; margin-bottom: 22px; color: var(--muted); font-size: 14px; }
.auth-card .form { text-align: left; }
.btn-google { gap: 11px; min-height: 48px; font-size: 14px; }
.auth-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 16px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.auth-note svg { flex: 0 0 auto; color: var(--ok); }

.admin-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: var(--gutter) 0 28px; }
.admin-head h1 { font-size: 28px; font-weight: 750; }
.admin-head .btn-primary { margin-left: auto; }
.icon-btn { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); color: var(--ink-soft); font-size: 18px; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.icon-btn:hover { border-color: #ccd2de; background: var(--bg-soft); color: var(--ink); }
.manage-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: var(--gutter) 0 28px; }
.manage-title { min-width: 0; display: flex; align-items: center; gap: 14px; }
.manage-title > div { min-width: 0; }
.manage-title h1 { font-size: 28px; font-weight: 750; }
.manage-title p { margin-top: 4px; color: var(--muted); font-size: 13.5px; }
.manage-total, .manage-stat { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.manage-total { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }
.manage-list-wrap { padding-bottom: 80px; }
.manage-list, .member-list { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: 0 1px 2px rgba(17,20,27,.025); }
.manage-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 28px; padding: 20px 22px; border-bottom: 1px solid var(--line-soft); }
.manage-row:last-child { border-bottom: 0; }
.manage-row-main { min-width: 0; display: flex; align-items: center; gap: 15px; }
.manage-row-icon { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-size: 18px; }
.manage-row-copy { min-width: 0; }
.manage-row-title { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.manage-row-title h2 { overflow: hidden; text-overflow: ellipsis; font-size: 15px; font-weight: 700; white-space: nowrap; }
.manage-row-copy p { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.manage-row-side { display: flex; align-items: center; justify-content: flex-end; gap: 18px; }
.manage-empty { display: grid; place-items: center; gap: 6px; padding: 80px 24px; color: var(--muted); text-align: center; }
.manage-empty > i { margin-bottom: 6px; color: #a1a8b5; font-size: 30px; }
.manage-empty strong { color: var(--ink); font-size: 16px; }
.manage-empty span { font-size: 13px; }
.admin-dialog { width: min(520px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 20px; background: transparent; color: var(--ink); }
.admin-dialog::backdrop { background: rgba(8,10,16,.5); backdrop-filter: blur(4px); }
.admin-dialog-card { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: 0 24px 70px rgba(8,10,16,.24); }
.admin-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 24px 24px 20px; border-bottom: 1px solid var(--line-soft); }
.admin-dialog-title { min-width: 0; display: flex; align-items: center; gap: 13px; }
.admin-dialog-title > span { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent); font-size: 17px; }
.admin-dialog-title h2 { font-size: 19px; }
.admin-dialog-title p { margin-top: 3px; color: var(--muted); font-size: 12.5px; }
.dialog-close { width: 36px; height: 36px; flex-basis: 36px; border-color: transparent; font-size: 15px; }
.admin-dialog-body { padding: 24px; }
.admin-dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px 22px; border-top: 1px solid var(--line-soft); background: #fbfcfd; }
.admin-dialog-footer form { margin: 0; }
.dialog-actions { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.member-row { display: grid; grid-template-columns: minmax(260px,1fr) auto auto; align-items: center; gap: 30px; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); }
.member-row:last-child { border-bottom: 0; }
.member-identity { min-width: 0; display: flex; align-items: center; gap: 13px; }
.member-avatar { width: 44px; height: 44px; min-width: 44px; aspect-ratio: 1; flex: 0 0 44px; border-radius: 50%; object-fit: cover; background: var(--bg-soft); }
.member-avatar-fallback { display: grid; place-items: center; border: 1px solid var(--line); color: var(--muted); font-size: 19px; }
.member-copy { min-width: 0; }
.member-copy strong, .member-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-copy strong { font-size: 14px; font-weight: 700; }
.member-copy span { margin-top: 1px; color: var(--muted); font-size: 12.5px; }
.member-details { display: flex; align-items: center; gap: 22px; }
.member-detail span, .member-detail strong { display: block; white-space: nowrap; }
.member-detail span { color: var(--muted); font-size: 10.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.member-detail strong { margin-top: 2px; color: var(--ink-soft); font-size: 12.5px; font-weight: 600; }
.member-role { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11.5px; font-weight: 650; text-transform: capitalize; }
.member-role.is-admin { border-color: #cfe9d9; background: #f1faf5; color: var(--ok); }
.member-action { display: flex; justify-content: flex-end; }
.member-role.is-creator { border-color: #e4d4f0; background: #f8f2fc; color: #8a4fb0; }
.member-role-select { min-height: 34px; padding: 6px 30px 6px 12px; border: 1px solid var(--line); border-radius: 10px; background-color: #fff; font: inherit; font-size: 13px; font-weight: 600; color: inherit; cursor: pointer; }
.admin-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(300px,1fr); gap: 32px; padding-bottom: 80px; align-items: start; }
.stats-page { padding-bottom: 80px; }
.stats-tabs { width: fit-content; display: flex; gap: 5px; margin-bottom: 22px; padding: 5px; border: 1px solid var(--line); border-radius: 13px; background: var(--bg-soft); }
.stats-tab { min-height: 38px; display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; border-radius: 9px; color: var(--muted); font-size: 13px; font-weight: 650; }
.stats-tab:hover { color: var(--ink); }
.stats-tab.is-active { background: var(--panel); color: var(--ink); box-shadow: 0 1px 4px rgba(17,20,27,.09); }
.stats-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { position: relative; overflow: hidden; padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.stat-card > span { display: block; color: var(--muted); font-size: 11.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.stat-card > strong { display: block; margin-top: 7px; font-size: 28px; line-height: 1.15; letter-spacing: -.03em; }
.stat-card > i { position: absolute; top: 18px; right: 18px; color: #b4bac6; font-size: 18px; }
.stats-panel { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.stats-panel-head { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 20px; border-bottom: 1px solid var(--line-soft); }
.stats-panel-head h2 { font-size: 15px; }
.stats-panel-head p { margin-top: 3px; color: var(--muted); font-size: 12px; }
.stats-panel-head > i { color: #a1a8b5; font-size: 20px; }
.stats-chart-panel { margin-bottom: 20px; }
.stats-chart { height: 250px; display: grid; grid-template-columns: repeat(30,minmax(7px,1fr)); align-items: end; gap: 6px; padding: 32px 20px 20px; }
.stats-bar-column { height: 190px; display: grid; grid-template-rows: 18px minmax(0,1fr) 20px; align-items: end; text-align: center; }
.stats-bar-value { color: var(--muted); font-size: 9px; }
.stats-bar { width: min(16px,100%); min-height: 4px; justify-self: center; border-radius: 5px 5px 2px 2px; background: var(--ink); }
.stats-bar-column small { height: 20px; padding-top: 5px; color: var(--muted); font-size: 8.5px; white-space: nowrap; }
.stats-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.ranking-list { padding: 10px 20px 14px; }
.ranking-row { display: grid; grid-template-columns: minmax(115px,1fr) minmax(70px,1fr) auto; align-items: center; gap: 12px; min-height: 44px; border-bottom: 1px solid var(--line-soft); }
.ranking-row:last-child { border-bottom: 0; }
.ranking-label { min-width: 0; overflow: hidden; color: var(--ink-soft); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.ranking-label b { display: inline-grid; place-items: center; min-width: 31px; margin-right: 6px; padding: 2px 5px; border-radius: 5px; background: var(--bg-soft); color: var(--muted); font-size: 9.5px; }
.ranking-label.is-path { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; }
.ranking-track { height: 5px; overflow: hidden; border-radius: 999px; background: var(--bg-soft); }
.ranking-track span { height: 100%; display: block; border-radius: inherit; background: var(--accent); }
.ranking-row > strong { color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.stats-empty { padding: 30px 0; color: var(--muted); font-size: 13px; text-align: center; }
.stats-privacy { display: flex; align-items: center; gap: 7px; margin-top: 18px; color: var(--muted); font-size: 11.5px; }
.stats-privacy i { color: var(--ok); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; text-align: left; }
.table td { padding: 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .thumb { width: 86px; height: 54px; object-fit: cover; border-radius: 9px; background: #0e1016; }
.table-actions { display: flex; justify-content: flex-end; gap: 8px; }

.flash { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 15px 20px; border-radius: 12px; font-size: 14px; }
.flash-ok { border: 1px solid #cfe9d9; background: #f1faf5; color: #0b6b3c; }
.flash-warn { border: 1px solid #f0e2c6; background: #fdf8ee; color: #8a5200; }
/* Notices sit in their own row: a clear gap below, and above when nothing else gives one. */
.shell > :is(.flash, .errors):last-child { margin-bottom: 24px; }
.flash-top { padding-top: var(--gutter); }
.flash-top + .detail { padding-top: 0; }
.errors { margin: 0 0 12px; padding: 15px 20px 15px 38px; border: 1px solid #f0d4d4; border-radius: 12px; background: #fdf5f5; color: #9b2222; font-size: 13.5px; }

.donation-dialog { width: min(430px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 20px; background: transparent; color: var(--ink); }
.donation-dialog::backdrop { background: rgba(8,10,16,.55); backdrop-filter: blur(5px); }
.donation-card { position: relative; padding: 30px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: 0 24px 70px rgba(8,10,16,.24); text-align: center; }
.donation-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 34px; height: 34px; border: 0; border-radius: 9px; background: rgba(255,255,255,.92); color: var(--muted); font-size: 22px; cursor: pointer; }
.donation-close:hover { background: var(--bg-soft); color: var(--ink); }
.donation-icon { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 16px; background: #fff0f6; color: #e53e78; }
.donation-card h2 { margin-bottom: 22px; font-size: 22px; letter-spacing: -.01em; }
.donation-card:focus { outline: none; }
.donation-card h2 + p { margin-top: -14px; }
.donation-icon i { font-size: 24px; line-height: 1; }
.donation-card p { margin: 8px 0 22px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.donation-skip { display: inline-block; margin-top: 16px; padding: 0; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.pager { display: flex; gap: 8px; padding-bottom: 70px; }
.pager a, .pager span { min-width: 40px; height: 40px; display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); color: var(--muted); font-size: 13px; }
.pager a:hover { border-color: #ccd2de; color: var(--ink); }
.pager .is-current { border-color: var(--ink); background: var(--ink); color: #fff; }

.footer { padding: 36px 0 56px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 13px; }

@media (max-width: 1000px) {
    :root { --gutter: 36px; }
    .shell { width: min(1240px, calc(100% - 44px)); }
    .detail, .admin-grid { grid-template-columns: minmax(0,1fr); gap: 28px; }
    .search { margin-left: 0; width: 100%; }
    .search input { width: 100%; min-width: 0; }
    .panel { padding: 22px; }
    .card-body { padding: 20px; }
}

@media (max-width: 720px) {
    .stage-head { padding: 12px 14px; }
    .stage-head-actions > span { display: none; }
    .preview-expand { display: inline-flex; }
    .stage.is-fixed-preview:not(.is-expanded) .stage-frame { aspect-ratio: 16 / 10; transition: aspect-ratio .2s ease; }
    .stage.is-fixed-preview.is-expanded .stage-frame { aspect-ratio: 9 / 14; }
    .manage-head { flex-wrap: wrap; align-items: flex-start; padding: 36px 0 22px; }
    .manage-title { align-items: flex-start; }
    .manage-head > .btn { width: 100%; }
    .manage-list-wrap { padding-bottom: 56px; }
    .manage-row { grid-template-columns: minmax(0,1fr); gap: 16px; padding: 18px; }
    .manage-row-side { justify-content: space-between; gap: 12px; }
    .member-row { grid-template-columns: minmax(0,1fr); gap: 17px; padding: 18px; }
    .member-details { justify-content: space-between; gap: 14px; }
    .member-action, .member-action .btn, .member-role-select { width: 100%; }
    .admin-dialog-footer { align-items: stretch; flex-direction: column-reverse; }
    .admin-dialog-footer > form, .admin-dialog-footer > form .btn, .dialog-actions { width: 100%; }
    .dialog-actions { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
    .dialog-actions .btn { width: 100%; padding-inline: 10px; }
}

@media (max-width: 520px) {
    .stats-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .stats-grid { grid-template-columns: minmax(0,1fr); }
    .stats-chart { overflow-x: auto; grid-template-columns: repeat(30,12px); gap: 7px; }
    .stats-bar-column { min-width: 12px; }
    .ranking-row { grid-template-columns: minmax(100px,1fr) 70px auto; }
    .stats-tabs, .stats-tab { width: 100%; }
    .stats-tab { justify-content: center; }
    .auth { min-height: 0; padding: 20px 18px; }
    .auth-card { padding: 24px 20px; }
    .auth-icon { width: 46px; height: 46px; margin-bottom: 12px; border-radius: 14px; }
    .auth-card h1 { font-size: 22px; }
    .auth-subtitle { margin-top: 6px; margin-bottom: 18px; font-size: 13px; }
    .btn-google { min-height: 46px; }
    .auth-note { margin-top: 14px; font-size: 11.5px; white-space: nowrap; }
    .mobile-menu-trigger { display: grid; }
    .user-menu-dropdown { top: calc(100% + 10px); }
    .topbar nav { gap: 0; }
    .donation-card { padding: 32px 24px 28px; }
    .manage-title { gap: 11px; }
    .manage-title h1 { font-size: 24px; }
    .manage-title p { font-size: 12.5px; }
    .manage-row-side { align-items: stretch; flex-direction: column; }
    .manage-row-side .btn { width: 100%; }
    .admin-dialog-head, .admin-dialog-body { padding: 20px; }
    .admin-dialog-footer { padding: 16px 20px 20px; }
}
    .stats-summary { gap: 10px; }
    .stat-card { padding: 17px; }

/* Download page */
.license-icon { background: var(--accent-soft); color: var(--accent); }
.license-step p { margin-bottom: 18px; }
.license-docs { display: grid; gap: 10px; margin-bottom: 18px; text-align: left; }
.license-doc { display: flex; align-items: center; gap: 13px; width: 100%; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.license-doc:hover { border-color: #cbd3ff; background: var(--accent-soft); }
.license-doc > i { font-size: 20px; color: var(--accent); }
.license-doc span { display: grid; gap: 2px; }
.license-doc strong { font-size: 14px; }
.license-doc small { color: var(--muted); font-size: 12px; }
.license-doc::after { content: "\F285"; margin-left: auto; color: var(--muted); font-family: bootstrap-icons; }
.license-agree { min-height: 48px; }

.doc-dialog { width: min(720px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 18px; background: transparent; color: var(--ink); }
.doc-dialog::backdrop { background: rgba(8,10,16,.55); backdrop-filter: blur(5px); }
.doc-card { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: 0 24px 70px rgba(8,10,16,.24); }
.doc-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.doc-close { position: static; }
.doc-title { padding-left: 10px; font-size: 15px; font-weight: 750; }
.doc-card:focus { outline: none; }
.doc-text { flex: 1; min-height: 0; margin: 0; padding: 22px 26px; overflow: auto; color: var(--ink-soft); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.doc-foot { display: flex; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--line-soft); }

.get-page { padding: 34px 0 90px; }
.get-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin: 18px 0 28px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(135deg, #f4f6ff, #fff 60%); }
.get-hero-text { min-width: 0; }
.get-hero h1 { margin-top: 12px; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.2; letter-spacing: -.02em; }
.get-hero p { margin-top: 8px; color: var(--ink-soft); font-size: 14px; line-height: 1.55; }
.get-hero .get-expiry { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12.5px; }
.get-hero-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.get-layout { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(280px, .85fr); gap: 28px; align-items: start; }
.get-aside { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 20px; }
.snippets { display: grid; gap: 14px; }
.snippet { overflow: hidden; border: 1px solid #30363d; border-radius: 13px; background: #0d1117; transition: border-color .2s; }
.snippet.is-done { border-color: #2ea043; }
.snippet-head { display: flex; align-items: center; gap: 13px; padding: 12px 14px; border-bottom: 1px solid #21262d; background: #161b22; }
.snippet-step { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border-radius: 9px; background: #21262d; color: #e6edf3; font-size: 13px; font-weight: 800; }
.snippet.is-done .snippet-step { background: #238636; color: #fff; }
.snippet-title { min-width: 0; flex: 1; display: grid; gap: 2px; }
.snippet-title strong { color: #e6edf3; font-size: 14px; }
.snippet-copy { width: 36px; height: 36px; flex: 0 0 36px; justify-content: center; padding: 0; border-color: #30363d; background: #21262d; color: #e6edf3; font-size: 15px; }
.snippet-copy:hover { border-color: #8b949e; background: #30363d; color: #fff; }
.snippet-copy.is-copied, [data-copy-target].is-copied { border-color: var(--ok); background: var(--ok); color: #fff; }
.snippet-code { max-height: 96px; margin: 0; padding: 12px 14px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); background: #0d1117; color: #c9d1d9; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-all; }

.credit-card { text-align: center; border-color: #f6d3e2; background: linear-gradient(180deg, #fff6fa, #fff 70%); }
.credit-icon { width: 44px; height: 44px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 13px; background: #ffe4ef; color: #e53e78; font-size: 19px; }
.credit-card p { margin-top: 0; color: var(--ink-soft); font-size: 13.5px; line-height: 1.55; }
.copy-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 60; padding: 10px 16px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; transform: translateX(-50%); box-shadow: 0 12px 30px rgba(8,10,16,.25); }

@media (max-width: 1000px) {
    .get-layout { grid-template-columns: minmax(0, 1fr); }
    .get-aside { position: static; }
    .get-hero { flex-direction: column; align-items: stretch; }
    .get-hero-actions { justify-content: flex-start; }
}
@media (max-width: 520px) {
    .get-hero { padding: 20px; }
    .get-hero-actions > form, .get-hero-actions > form .btn { width: 100%; }
    .doc-text { padding: 16px; font-size: 12px; }
}
/* Platforms */
.platforms { display: inline-flex; align-items: center; gap: 5px; }
.platform { width: 24px; height: 24px; display: inline-grid; place-items: center; border-radius: 7px; font-size: 13px; line-height: 1; }
.platform-twitch { background: #f1eaff; color: #9146ff; }
.platform-youtube { background: #ffecec; color: #ff0000; }
.platform-kick { background: #0b0e0f; color: #53fc18; }

/* Preview mode */
.stage-head { position: relative; }
.preview-mode { position: relative; }
.preview-mode-trigger { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--ink-soft); font: inherit; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.preview-mode-trigger:hover, .preview-mode-trigger[aria-expanded="true"] { border-color: #cbd3ff; background: var(--accent-soft); color: var(--accent); }
.preview-mode-trigger b { max-width: 130px; overflow: hidden; padding: 2px 7px; border-radius: 6px; background: var(--bg-soft); color: var(--ink); font-weight: 700; letter-spacing: 0; text-overflow: ellipsis; text-transform: none; white-space: nowrap; }
.preview-mode-caret { font-size: 10px; transition: transform .15s; }
.preview-mode-trigger[aria-expanded="true"] .preview-mode-caret { transform: rotate(180deg); }
.preview-mode-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: min(320px, calc(100vw - 32px)); max-height: min(440px, 70vh); overflow: auto; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: 0 18px 45px rgba(17,20,27,.16); text-transform: none; letter-spacing: 0; }
.preview-mode-group { margin: 4px 2px 6px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.preview-mode-group:first-child { margin-top: 0; }
.preview-mode-options { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.preview-mode-options:last-child { margin-bottom: 0; }
.preview-mode-options button { min-height: 26px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink-soft); font: inherit; font-size: 11.5px; font-weight: 600; line-height: 1; cursor: pointer; }
.preview-mode-options button:hover { border-color: #cbd3ff; background: var(--accent-soft); color: var(--accent); }
.preview-mode-options button[aria-checked="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
@media (max-width: 720px) {
    .preview-mode-trigger > span { display: none; }
    .preview-mode-menu { position: fixed; top: var(--mode-menu-top, 80px); right: 16px; left: 16px; width: auto; max-height: calc(100vh - var(--mode-menu-top, 80px) - 16px); }
}
/* Tags */
.chip-tag { min-height: 28px; gap: 4px; padding: 0 11px; font-size: 12px; font-weight: 550; }

/* Admin list */
.admin-filters { display: grid; gap: 10px; padding-bottom: 22px; }
.admin-filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.admin-filter-label { min-width: 70px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.widget-table .thumb { display: block; }
.widget-table-thumb { width: 86px; }
.empty .btn { margin-top: 4px; }

@media (max-width: 720px) {
    .admin-head { gap: 8px; padding: 30px 0 20px; }
    .admin-head h1 { flex: 1 0 100%; font-size: 24px; }
    .admin-head .btn-ghost { padding: 0 10px; border-color: var(--line); }
    .admin-head .btn-primary { flex: 1 0 100%; margin-left: 0; }
    .admin-filter-group { flex-wrap: nowrap; overflow-x: auto; margin-inline: -22px; padding: 2px 22px; scrollbar-width: none; }
    .admin-filter-group::-webkit-scrollbar { display: none; }
    .admin-filter-group .chip { flex: 0 0 auto; }
    .admin-filter-label { flex: 0 0 auto; min-width: 84px; margin-right: 2px; }

    .widget-table, .widget-table tbody { display: block; }
    .widget-table thead { display: none; }
    .widget-table tr { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 4px 14px; align-items: start; padding: 14px 6px; border-bottom: 1px solid var(--line-soft); }
    .widget-table tr:last-child { border-bottom: 0; }
    .widget-table td { display: block; padding: 0; border: 0; }
    .widget-table-thumb { grid-row: 1 / span 3; width: auto; }
    .widget-table-title { min-width: 0; overflow-wrap: anywhere; }
    .widget-table-meta { color: var(--muted); font-size: 12.5px; }
    .widget-table-meta::before { content: attr(data-label) ": "; color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .04em; }
    .widget-table-meta[data-label="Category"] { display: inline-block; grid-column: 2; }
    .widget-table-meta[data-label="Files"] { display: none; }
    .widget-table-status { grid-column: 2; }
    .widget-table-actions { grid-column: 1 / -1; margin-top: 10px; }
    .widget-table .table-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .widget-table .table-actions > form, .widget-table .table-actions .btn { width: 100%; }
    .widget-table .table-actions .btn-ghost { border-color: var(--line); }
}

/* Likes and labels */
.card-shell { position: relative; display: flex; transition: transform .18s ease; }
.card-shell > .card { flex: 1; min-width: 0; }
.card-shell:hover { transform: translateY(-3px); }
.card-shell .card:hover { transform: none; }
.card-shell > .like-form, .card-shell > .like-btn { position: absolute; top: 12px; right: 12px; z-index: 2; }
.like-form { margin: 0; }
.like-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink-soft); font: inherit; font-size: 13px; font-weight: 650; line-height: 1; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.like-btn:hover { border-color: #f3bfd3; color: #e53e78; }
.like-btn.is-liked { border-color: #f6c3d6; background: #fff0f6; color: #e53e78; }
.like-btn i { font-size: 14px; }
.like-btn[disabled] { opacity: .7; }
.like-on-card { min-height: 32px; padding: 0 11px; border-color: rgba(255,255,255,.2); background: rgba(12,14,20,.6); color: #fff; backdrop-filter: blur(6px); }
.like-on-card:hover { border-color: rgba(255,255,255,.45); color: #fff; }
.like-on-card.is-liked { border-color: rgba(255,111,160,.55); background: rgba(12,14,20,.72); color: #fff; }
.like-on-card.is-liked i { color: #ff5c96; }
.like-btn.is-popping i { animation: like-pop .35s ease; }
@keyframes like-pop { 40% { transform: scale(1.35); } }
.rank-labels { display: flex; flex-wrap: wrap; gap: 6px; }
.rank-label { display: inline-flex; align-items: center; gap: 5px; min-height: 26px; padding: 0 10px; border-radius: 999px; background: #fff; font-size: 11.5px; font-weight: 750; line-height: 1; white-space: nowrap; box-shadow: 0 4px 14px rgba(8,10,16,.22); }
.rank-label i { font-size: 11px; }
.rank-downloaded { color: #2f54eb; }
.rank-popular { color: #ea580c; }
.rank-loved { color: #e53e78; }
.card-body .rank-labels { margin-top: -2px; }
.card-body .rank-label { min-height: 24px; padding: 0 9px; box-shadow: none; border: 1px solid var(--line); font-size: 11px; }
.rank-labels .rank-downloaded { border-color: #d6e0ff; background: #f3f6ff; }
.rank-labels .rank-popular { border-color: #fdd9bf; background: #fff6ef; }
.rank-labels .rank-loved { border-color: #f9cfe0; background: #fff3f8; }

/* Admin publish */
.btn-publish { border-color: #bfe3cd; background: #f1faf5; color: var(--ok); }
.btn-publish:hover { border-color: #9fd3b4; background: #e4f5eb; }
.btn-unpublish { color: var(--warn); }
@media (max-width: 720px) {
    .widget-table .table-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .widget-table .table-actions .btn { padding-inline: 8px; }
}

/* Listing */
.grid { grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 20px; padding-bottom: 48px; }
.card { border-radius: 14px; }
.card-shell > .like-form, .card-shell > .like-btn { top: 10px; right: 10px; }
.like-on-card { min-height: 28px; padding: 0 10px; font-size: 12px; }
.card-body { gap: 6px; padding: 14px 16px 15px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.card-title h2 { min-width: 0; overflow: hidden; font-size: 15.5px; font-weight: 750; letter-spacing: -.015em; text-overflow: ellipsis; white-space: nowrap; }
.card-title .platforms { flex: 0 0 auto; gap: 4px; }
.card-title .platform { width: 20px; height: 20px; border-radius: 6px; font-size: 11px; }
.card-body p { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 13px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: auto; padding-top: 4px; }
.card-body .rank-labels { gap: 4px; margin: 0; }
.card-body .rank-label { min-height: 22px; padding: 0 8px; gap: 4px; font-size: 10.5px; }
.card-body .rank-label i { font-size: 10px; }
.pager { padding-bottom: 48px; }
.pager a, .pager span { min-width: 34px; height: 34px; border-radius: 9px; }

.footer { padding: 28px 0 36px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; }
.footer-inner small { margin-left: auto; font-size: 12px; }

@media (max-width: 720px) {
    .grid { grid-template-columns: minmax(0,1fr); gap: 16px; }
    .footer-inner small { margin-left: 0; }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.card-body .rank-labels.is-compact { flex-wrap: nowrap; }
.card-body .rank-labels.is-compact .rank-label { width: 22px; min-height: 22px; padding: 0; justify-content: center; }
.card-body .rank-labels.is-compact .rank-label i { font-size: 10.5px; }

.home-result { margin-top: -8px; padding-bottom: 16px; color: var(--muted); font-size: 13px; }

.footer-inner > .brand { font-size: 14px; color: var(--ink); }
.footer-inner > .brand .brand-mark { width: 26px; height: 26px; flex-basis: 26px; border-radius: 8px; font-size: 12px; }
@media (max-width: 720px) { .footer-inner small { margin-left: auto; } }
.home-result { margin-top: -14px; padding-bottom: 24px; }
.grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; padding-bottom: 80px; }
.card { border-radius: 16px; }
.card-shell > .like-form, .card-shell > .like-btn { top: 14px; right: 14px; }
.card-body { gap: 10px; padding: 20px 22px 22px; }
.card-title h2 { font-size: 16.5px; }
.card-title .platform { width: 22px; height: 22px; font-size: 12px; }
.card-body p { font-size: 13.5px; line-height: 1.6; }
.card-foot { padding-top: 6px; }
.pager { padding-bottom: 80px; }
.pager a, .pager span { min-width: 38px; height: 38px; }
.footer { padding: 36px 0 44px; }
@media (max-width: 720px) {
    .grid { gap: 22px; padding-bottom: 56px; }
    .card-body { padding: 18px 18px 20px; }
}

/* Asset sidebar box */
.buy-box { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-soft); }
.buy-terms { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; color: var(--ink-soft); font-size: 13px; }
.buy-terms li { display: flex; align-items: center; gap: 8px; }
.buy-terms .bi-check-lg { color: var(--ok); }
.buy-terms .bi-x-lg { color: var(--danger); }
.user-menu-action > i { width: 17px; font-size: 15px; text-align: center; }
.manage-empty .btn { margin-top: 10px; }

.panel-buy .buy-box { padding: 0; border: 0; background: none; }
.panel-buy > .body { gap: 12px; }
.asset-title { margin: 0; color: var(--ink); font-size: 22px; font-weight: 750; line-height: 1.25; letter-spacing: -.01em; }
.panel > .body:first-child { margin-top: 0; }

/* Gallery */
.gallery-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: start; gap: 36px; padding: 40px 0 72px; }
.gallery-side { position: sticky; top: 24px; display: grid; gap: 22px; }
.gallery-search { position: relative; margin: 0; }
.gallery-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; pointer-events: none; }
.gallery-search input { width: 100%; min-width: 0; height: 38px; padding-left: 36px; }
.gallery-side-label { display: block; margin: 0 0 6px 12px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.gallery-cats { display: grid; gap: 2px; }
.gallery-cat { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border: 1px solid transparent; border-radius: 10px; color: var(--ink-soft); font-size: 13.5px; font-weight: 600; transition: background-color .12s ease; }
.gallery-cat i { width: 18px; color: var(--muted); font-size: 15px; text-align: center; }
.gallery-cat span { flex: 1; min-width: 0; }
.gallery-cat b { color: var(--muted); font-size: 11.5px; font-weight: 650; }
a.gallery-cat:not(.is-active):hover { background: var(--bg-soft); color: var(--ink); }
a.gallery-cat:not(.is-active):hover i { color: var(--ink-soft); }
.gallery-cat.is-active, .gallery-cat.is-active:hover { border-color: var(--ink); background: var(--ink); color: #fff; }
.gallery-cat.is-active i, .gallery-cat.is-active b { color: rgba(255,255,255,.7); }
.gallery-cat.is-disabled { color: #b3b9c6; cursor: not-allowed; }
.gallery-cat.is-disabled i { color: #c7ccd6; }
.gallery-tags div { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 0 12px; }
.gallery-tags a { color: var(--muted); font-size: 12.5px; font-weight: 550; line-height: 26px; }
.gallery-tags a:hover { color: var(--ink); }
.gallery-tags a.is-active { color: var(--accent); font-weight: 700; }
.gallery-main { min-width: 0; }
.gallery-main .home-result { margin: 0 0 16px; }
.gallery-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }

/* Chat widget card */
.cw-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); transition: border-color .18s, box-shadow .18s; }
.cw-card:hover { border-color: #d6dbe5; box-shadow: var(--shadow); }
.cw-foot { display: flex; gap: 8px; padding: 12px; }
.cw-stage { position: relative; overflow: hidden; }
.stage-frame.cw-stage, .stage-frame.is-portrait { aspect-ratio: 2 / 3; }
.cw-stage .cw-shot.is-landscape { object-fit: contain; object-position: top center; }
.cw-stage .cw-shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .2s; }
.cw-stage iframe { position: absolute; inset: 0 auto auto 0; z-index: 1; width: calc(100% + 1px); height: calc(100% + 1px); border: 0; opacity: 0; transition: opacity .25s; }
.cw-card.is-live .cw-stage iframe { opacity: 1; }
.cw-card.is-live .cw-shot { opacity: 0; }
.cw-overlay { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; justify-content: flex-start; padding: 12px; pointer-events: none; transition: opacity .2s; }
.cw-overlay > * { pointer-events: auto; }
.cw-top { display: flex; justify-content: flex-end; }
.cw-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding: 14px 16px; }
.cw-head .platforms { flex: 0 0 auto; gap: 4px; }
.cw-title { min-width: 0; color: var(--ink); }
.cw-title h2 { overflow: hidden; font-size: 15.5px; font-weight: 750; letter-spacing: -.015em; text-overflow: ellipsis; white-space: nowrap; }
.cw-title:hover h2 { color: var(--accent); }
.cw-card.is-loading .cw-overlay, .cw-card.is-live .cw-overlay { opacity: 0; pointer-events: none; }
.cw-card.is-loading .cw-overlay > *, .cw-card.is-live .cw-overlay > * { pointer-events: none; }
.cw-play { position: absolute; left: 50%; top: 50%; z-index: 3; width: 68px; height: 68px; display: grid; place-items: center; padding: 0 0 0 4px; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; background: rgba(12,14,20,.62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #fff; font-size: 34px; box-shadow: 0 10px 30px rgba(0,0,0,.35); cursor: pointer; opacity: 0; transform: translate(-50%, -50%) scale(.88); transition: opacity .18s, transform .18s, background .18s; }
.cw-stage:hover .cw-play, .cw-play:focus-visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.cw-play:hover { background: var(--accent); border-color: transparent; }
@media (hover: none) { .cw-play { opacity: 1; transform: translate(-50%, -50%) scale(.9); } }
.cw-play .cw-icon-stop { display: none; }
.cw-card.is-loading .cw-play, .cw-card.is-live .cw-play { opacity: 0; padding: 0; }
.cw-card.is-loading .cw-play .cw-icon-play, .cw-card.is-live .cw-play .cw-icon-play { display: none; }
.cw-card.is-loading .cw-play .cw-icon-stop, .cw-card.is-live .cw-play .cw-icon-stop { display: block; font-size: 28px; }
.cw-card.is-live .cw-stage:hover .cw-play, .cw-card.is-live .cw-play:focus-visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.cw-card.is-live .cw-play:hover { background: #e5484d; }
@media (hover: none) { .cw-card.is-live .cw-play { opacity: .7; transform: translate(-50%, -50%) scale(.8); } }
.cw-loading { position: absolute; inset: 0; z-index: 2; display: none; place-items: center; background: rgba(12,14,20,.35); }
.cw-loading span { width: 40px; height: 40px; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; animation: cw-spin .8s linear infinite; }
.cw-card.is-loading .cw-loading { display: grid; }
@keyframes cw-spin { to { transform: rotate(360deg); } }
.cw-download { min-height: 44px; }

@media (max-width: 860px) {
    .gallery-layout { grid-template-columns: 1fr; gap: 18px; padding-top: 24px; }
    .gallery-side { position: static; gap: 14px; }
    .gallery-side-label, .gallery-tags { display: none; }
    .gallery-cats { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
    .gallery-cats::-webkit-scrollbar { display: none; }
    .gallery-cat { flex: 0 0 auto; min-height: 34px; border-color: var(--line); border-radius: 999px; font-size: 12.5px; }
    .gallery-cat.is-active { border-color: var(--ink); }
}

/* Toolbar */
.gallery-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 16px; margin-bottom: 20px; }
/* Sort menu */
.sort-menu { position: relative; }
.sort-menu-trigger { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--muted); font-size: 13px; font-weight: 600; list-style: none; cursor: pointer; user-select: none; }
.sort-menu-trigger::-webkit-details-marker { display: none; }
.sort-menu-trigger b { color: var(--ink); font-weight: 700; }
.sort-menu-trigger i { font-size: 11px; transition: transform .15s; }
.sort-menu-trigger:hover, .sort-menu[open] .sort-menu-trigger { border-color: #cbd3ff; background: var(--accent-soft); }
.sort-menu[open] .sort-menu-trigger i { transform: rotate(180deg); }
.sort-menu-trigger:focus-visible { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
.sort-menu-list { position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; display: grid; gap: 2px; min-width: 180px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: 0 18px 45px rgba(17,20,27,.14); }
.sort-menu-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border-radius: 8px; color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.sort-menu-option:hover { background: var(--bg-soft); color: var(--ink); }
.sort-menu-option[aria-checked="true"] { color: var(--ink); font-weight: 700; }
.sort-menu-option i { color: var(--accent); font-size: 15px; }
@media (max-width: 520px) { .sort-menu-trigger > span { display: none; } }

@media (max-width: 720px) {
    .stage-frame.cw-stage { aspect-ratio: 16 / 10; transition: aspect-ratio .25s ease; }
    .cw-stage .cw-shot { object-position: top center; }
    .cw-card.is-loading .stage-frame.cw-stage, .cw-card.is-live .stage-frame.cw-stage { aspect-ratio: 2 / 3; }
}

/* Share */
.download-row { display: flex; gap: 8px; }
.share-btn { flex: 0 0 auto; width: 44px; min-height: 44px; padding: 0; font-size: 16px; }
.share-icon { background: var(--bg-soft); color: var(--ink); }
.share-dialog .donation-card p { margin-bottom: 18px; overflow-wrap: anywhere; }
.share-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.share-link { display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); font-size: 12px; font-weight: 600; text-decoration: none; transition: border-color .15s, background .15s; }
.share-link:hover { border-color: var(--ink-soft); background: var(--bg-soft); }
.share-link i { font-size: 20px; }
.share-copy { display: flex; gap: 8px; margin-top: 14px; }
.share-copy input { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-soft); color: var(--ink-soft); font: inherit; font-size: 12.5px; }

/* Text pages and errors */
.text-page { max-width: 720px; padding: 48px 0 80px; }
.text-page h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.text-page-date { margin-top: 6px; color: var(--muted); font-size: 13px; }
.text-page .pill-draft { margin-top: 12px; }
.text-page-body { margin-top: 28px; color: var(--ink-soft); font-size: 15px; line-height: 1.75; }
.text-page-body h2 { margin: 32px 0 10px; color: var(--ink); font-size: 18px; font-weight: 750; }
.text-page-body h3 { margin: 24px 0 8px; color: var(--ink); font-size: 16px; font-weight: 700; }
.text-page-body p, .text-page-body ul, .text-page-body ol { margin: 0 0 14px; }
.text-page-body ul, .text-page-body ol { padding-left: 22px; }
.text-page-body li { margin-bottom: 6px; }
.text-page-body a { color: var(--accent); text-decoration: underline; }
.text-page-body strong { color: var(--ink); }
.page-editor { max-width: 860px; padding-bottom: 80px; }
.page-editor textarea { min-height: 520px; }
.error-page { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 120px 0 140px; text-align: center; }
.error-code { color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .12em; }
.error-page h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.error-page .btn { margin-top: 10px; }
.kofi-embed { overflow: hidden; padding: 0; }
.kofi-embed iframe { display: block; box-sizing: border-box; }

/* Package assets (overlays…): their own video or thumbnail in place of the live preview */
.media-stage > video, .media-stage > img { background: #0e1016; }
.media-stage video, .media-stage img { display: block; width: 100%; height: auto; max-height: 78vh; object-fit: contain; }

.package-files { margin-top: 20px; }
.file-tree { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink-soft); }
.file-tree .file-tree { margin: 2px 0 4px 11px; padding-left: 12px; border-left: 1px solid var(--line-soft); }
.file-tree summary { display: flex; align-items: center; gap: 8px; padding: 4px 0; color: var(--ink); font-weight: 600; cursor: pointer; list-style: none; }
.file-tree summary::-webkit-details-marker { display: none; }
.file-tree-file { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.file-tree span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-tree small { margin-left: auto; padding-left: 12px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.file-tree .bi { flex: 0 0 auto; color: var(--muted); }
.cw-card:has(.pk-stage) { position: relative; }
.pk-stage { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #0e1016; }
.pk-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pk-stage .placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.pk-overlay { top: 49px; bottom: auto; }
.file-tree-more { padding-left: 22px; color: var(--muted); }
.upload-progress { display: grid; gap: 6px; }
.upload-track { height: 8px; overflow: hidden; border-radius: 99px; background: var(--line-soft); }
.upload-fill { width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .15s ease; }
.upload-label { color: var(--muted); font-size: 12.5px; }
.upload-progress.is-error .upload-fill { background: var(--danger); }
.upload-progress.is-error .upload-label { color: var(--danger); }
