/* Kubo Archive — v4 layout: rounded "bento" surfaces, floating tab bar, themeable in dark and light mode.
   Theme colors (--bg, --surface, --surface2, --brand, --brand2, --text, --muted, --on-brand) are set by archive.js. */
:root{
  color-scheme:dark;
  --bg:#121214;--surface:#1b1b1f;--surface2:#232329;--brand:#e4e4ea;--brand2:#9aa0b5;--text:#f6f6f8;--muted:#a7a7b1;--on-brand:#121214;
  --line:color-mix(in srgb,var(--text) 10%,transparent);
  --line2:color-mix(in srgb,var(--text) 17%,transparent);
  --thumb:color-mix(in srgb,var(--bg) 78%,#000);
  --radius:24px;
  --mono:ui-monospace,SFMono-Regular,"JetBrains Mono",Menlo,Consolas,monospace;
  --shadow:0 1px 2px #0003,0 12px 32px -14px #0008;
}
:root[data-mode="light"]{--thumb:color-mix(in srgb,var(--surface2) 70%,var(--brand) 6%);--shadow:0 1px 2px #1a10300d,0 12px 30px -14px #1a103026}
:root[data-size="s"] body{zoom:.92}
:root[data-size="l"] body{zoom:1.1}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;min-height:100vh;padding-bottom:calc(96px + env(safe-area-inset-bottom));background:var(--bg);color:var(--text);font:15px/1.5 Inter,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;-webkit-font-smoothing:antialiased}
main{width:min(1180px,92%);margin:auto}
:root{--ease:cubic-bezier(.2,.8,.2,1);--spring:cubic-bezier(.34,1.45,.64,1)}
a{color:inherit;text-decoration:none}
button,input,select,textarea{font:inherit;color:inherit;background:var(--surface);border:1px solid var(--line2);border-radius:14px;padding:11px 14px}
button,a,select{cursor:pointer}
button{transition:background .2s,border-color .2s,color .2s,box-shadow .2s,transform .2s var(--spring)}
button:active:not(:disabled){transform:scale(.96)}
button:hover{background:var(--surface2)}
button:disabled{cursor:default}
input::placeholder,textarea::placeholder{color:var(--muted)}
select option{background:var(--surface2);color:var(--text)}
:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
h1,h2,h3{letter-spacing:-.03em;line-height:1.15}
h1{font-size:clamp(32px,5.5vw,56px);margin:0}
h2{margin:0 0 14px;font-size:21px}
p{line-height:1.6}
.muted,small,p{color:var(--muted)}
.row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.between{justify-content:space-between}
.ico{width:19px;height:19px;vertical-align:middle;flex-shrink:0}
[hidden]{display:none!important}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.white{background:var(--brand);color:var(--on-brand);border-color:transparent;font-weight:650}
.white:hover{background:var(--brand);filter:brightness(1.08)}
.badge{display:inline-block;font:600 10px/1.4 var(--mono);text-transform:uppercase;letter-spacing:.05em;padding:2px 7px;border-radius:7px;border:1px solid var(--line2);background:transparent;color:var(--muted)}
.accent{color:var(--accent)}
code{overflow-wrap:anywhere}

/* ---- top bar ---- */
header{position:sticky;top:0;z-index:20;background:color-mix(in srgb,var(--bg) 82%,transparent);backdrop-filter:blur(18px) saturate(1.3);-webkit-backdrop-filter:blur(18px) saturate(1.3);border-bottom:1px solid var(--line)}
.topbar{width:min(1180px,92%);margin:auto;display:flex;align-items:center;justify-content:space-between;gap:12px;height:66px}
.brand{display:inline-flex;align-items:center;gap:11px;min-width:0}
.brand b{font-size:17px;letter-spacing:-.02em;white-space:nowrap}
.logo{display:block;width:34px;height:39px;flex:none;transition:transform .3s}
.brand:hover .logo{transform:scale(1.07) rotate(-3deg)}
.nav-actions,#account{display:flex;align-items:center;gap:8px;flex:none}
.login-button{display:inline-flex;align-items:center;gap:8px;min-height:42px;padding:0 15px;font-weight:650;white-space:nowrap}
.login-button .ico{width:18px;height:18px}
.profile-button{display:grid;place-items:center;width:42px;height:42px;padding:2px;border-radius:50%}
.profile-avatar{position:relative;display:grid;place-items:center;width:100%;aspect-ratio:1;border-radius:50%;overflow:hidden;background:var(--surface2);font-weight:750;color:var(--muted)}
.profile-avatar img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.avatar{display:inline-grid;place-items:center;width:28px;height:28px;background:var(--surface2);border:1px solid var(--line2);border-radius:50%;font-size:11px;color:var(--text)}

/* ---- tab bar ---- */
.tabbar{position:fixed;left:50%;bottom:calc(14px + env(safe-area-inset-bottom));transform:translateX(-50%);z-index:30;display:flex;gap:2px;padding:6px;border-radius:999px;background:color-mix(in srgb,var(--surface2) 86%,transparent);border:1px solid var(--line2);backdrop-filter:blur(22px) saturate(1.4);-webkit-backdrop-filter:blur(22px) saturate(1.4);box-shadow:0 14px 40px -10px #000a;transition:transform .4s var(--ease),opacity .25s ease}
body.typing .tabbar{transform:translate(-50%,calc(100% + 40px));opacity:0;pointer-events:none}
body.typing.chat-route>main{margin-bottom:10px}
:root[data-mode="light"] .tabbar{box-shadow:0 12px 36px -8px #1a103033}
.tabbar a{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;width:86px;height:56px;border-radius:999px;color:var(--muted);font-size:11px;font-weight:600;transition:color .25s,transform .25s var(--spring)}
.tabbar a:active{transform:scale(.92)}
.tabbar a span{position:absolute;bottom:8px;transition:opacity .2s,transform .3s var(--ease)}
.tabbar a:hover{color:var(--text)}
.tabbar .ico{width:23px;height:23px;transform:translateY(-8px);transition:transform .35s var(--spring)}
.tabbar a.on{color:var(--brand)}
.tabbar a.on span{opacity:0;transform:translateY(6px)}
.tabbar a.on .ico{transform:translateY(-2px) scale(1.17)}
.tabbar a::after{content:"";position:absolute;bottom:6px;width:5px;height:5px;border-radius:50%;background:var(--brand);transform:scale(0);transition:transform .35s var(--spring)}
.tabbar a.on::after{transform:scale(1)}
@media(max-width:380px){.tabbar a{width:76px}}

/* ---- home ---- */
.hero{padding:40px 0 4px}
.eyebrow{display:flex;align-items:center;gap:8px;font:500 12px var(--mono);letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.dot{width:7px;height:7px;border-radius:50%;background:var(--brand);box-shadow:0 0 0 4px color-mix(in srgb,var(--brand) 20%,transparent)}
.hero h1{margin:14px 0 10px;font-weight:750;letter-spacing:-.04em;max-width:15ch}
.hero h1 em{font-style:normal;background:var(--brand);color:var(--on-brand);padding:0 .14em;border-radius:.18em;-webkit-box-decoration-break:clone;box-decoration-break:clone}
.hero p{margin:0;font-size:16px;max-width:48ch}
.add-project{margin-top:18px;padding:11px 18px;border-radius:999px}
.search{display:flex;flex-direction:column;gap:12px;margin:24px 0 20px;scroll-margin-top:86px}
.searchfield{display:flex;align-items:center;gap:12px;height:58px;padding:0 22px;border-radius:999px;background:var(--surface);border:1px solid var(--line2);transition:border-color .15s,box-shadow .15s}
.searchfield:focus-within{border-color:var(--brand);box-shadow:0 0 0 4px color-mix(in srgb,var(--brand) 16%,transparent)}
.searchfield .ico{color:var(--muted)}
.searchfield input{flex:1;min-width:0;height:100%;padding:0;background:none;border:0;outline:none;font-size:16px}
.searchfield kbd{font:500 11px var(--mono);color:var(--muted);border:1px solid var(--line2);border-radius:7px;padding:3px 7px}
@media(pointer:coarse){.searchfield kbd{display:none}}
.filters{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px}
.chip-row{display:flex;gap:8px;min-width:0;max-width:100%;overflow-x:auto;scrollbar-width:none;padding:2px}
.chip-row::-webkit-scrollbar{display:none}
.chips{display:flex;gap:8px}
.chip{display:inline-flex;align-items:center;gap:7px;height:40px;padding:0 16px;border-radius:999px;background:transparent;font-weight:550;color:var(--muted);white-space:nowrap}
.chip:hover{color:var(--text);background:var(--surface)}
.chip[aria-checked="true"]{background:var(--brand);border-color:var(--brand);color:var(--on-brand)}
.chip-count{font:500 11px var(--mono);opacity:.7}
.chip-count:empty{display:none}
.manage-filters{border-style:dashed}
.list-tools{display:flex;gap:8px;align-items:center}
.seg{position:relative;display:inline-flex;padding:3px;border-radius:999px;background:var(--surface);border:1px solid var(--line2)}
.seg::before{content:"";position:absolute;top:3px;bottom:3px;left:0;width:var(--thumb-w,0);transform:translateX(var(--thumb-x,0));border-radius:999px;background:var(--surface2);box-shadow:inset 0 0 0 1px var(--line2);opacity:var(--thumb-on,0)}
.seg.seg-ready::before{transition:transform .38s var(--ease),width .38s var(--ease),opacity .2s}
.seg button{position:relative;z-index:1}
.seg button{height:32px;padding:0 13px;border:0;border-radius:999px;background:none;font-size:13px;font-weight:550;color:var(--muted);box-shadow:none;white-space:nowrap}
.seg button:hover{color:var(--text)}
.seg button[aria-checked="true"]{color:var(--text)}
.seg-icon button{width:38px;padding:0;display:grid;place-items:center}
.seg-icon .ico{width:17px;height:17px}
@media(max-width:600px){.list-tools{width:100%;justify-content:space-between;gap:6px}#sort{flex:1;min-width:0}#sort button{flex:1;padding:0 6px;font-size:12.5px}}

/* ---- cards ---- */
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:16px}
#grid:focus{outline:none}
article{position:relative;display:flex;flex-direction:column;overflow:hidden;border-radius:var(--radius);background:var(--surface);border:1px solid var(--line);box-shadow:var(--shadow);transition:transform .25s,border-color .25s;animation:appear .28s ease both}
article:hover{transform:translateY(-3px);border-color:color-mix(in srgb,var(--accent,var(--brand)) 60%,transparent)}
article>a{display:flex;flex-direction:column;height:100%}
.thumb{position:relative;aspect-ratio:16/9;margin:10px 10px 0;border-radius:calc(var(--radius) - 8px);overflow:hidden;background:var(--thumb);border:1px solid var(--line);display:grid;place-items:center}
.thumb svg{width:100%;height:100%;display:block}
.thumb img{width:100%;height:100%;object-fit:cover;display:block}
.body{display:flex;flex-direction:column;gap:6px;padding:14px 16px 16px;flex:1}
.body small.accent{font:600 11px var(--mono);letter-spacing:.08em}
.body h3{font-size:19px;margin:0}
.body p{margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.project-author{margin:4px 0 0;gap:8px;font-size:13px}
.project-author>.profile-avatar{width:26px;height:26px;flex:0 0 26px;font-size:10px}
.foot{margin-top:auto;padding-top:12px;border-top:1px solid var(--line);color:var(--muted);font:12px var(--mono)}
.card-vote-counts{display:inline-flex;align-items:center;gap:4px;font-variant-numeric:tabular-nums;white-space:nowrap}
.card-vote-counts .ico{width:13px;height:13px;vertical-align:-2px}
@media(min-width:760px){
  .grid.bento{grid-template-columns:repeat(3,minmax(0,1fr))}
  .grid.bento>article:first-child{grid-column:span 2;grid-row:span 2}
  .grid.bento>article:first-child .thumb{aspect-ratio:auto;flex:1;min-height:280px}
  .grid.bento>article:first-child .body h3{font-size:26px}
}
/* list layout (Home's list switch) */
.layout-list .grid,.layout-list .grid.bento{grid-template-columns:1fr;gap:10px}
.layout-list .grid>article{grid-column:auto!important;grid-row:auto!important}
.layout-list article>a{flex-direction:row;align-items:center}
.layout-list .thumb,.layout-list .grid.bento>article:first-child .thumb{width:112px;min-height:0;aspect-ratio:4/3;flex:none;margin:8px}
.layout-list .body{padding:8px 14px 8px 4px;gap:3px;min-width:0}
.layout-list .body h3,.layout-list .grid.bento>article:first-child .body h3{font-size:17px}
.layout-list .foot{border:0;padding-top:2px}
.layout-list article:hover{transform:none}
.no-counts .card-vote-counts{display:none}
#app.route-in{animation:route-in .34s var(--ease) backwards}
@keyframes route-in{from{opacity:0;transform:translateY(10px)}}
@keyframes appear{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

.pagination{display:flex;justify-content:center;flex-wrap:wrap;gap:6px;margin-top:22px}
.pagination:empty{display:none}
.pagination button{min-height:44px;min-width:44px;padding:0 12px;border-radius:999px}
.pagination [aria-current="page"]{background:var(--brand);border-color:var(--brand);color:var(--on-brand);font-weight:750}
.pagination button:disabled{opacity:.45}
.pagination button:disabled:hover{background:var(--surface)}

/* ---- panels, project page ---- */
.panel{position:relative;padding:22px;margin-bottom:14px;border-radius:var(--radius);background:var(--surface);border:1px solid var(--line);box-shadow:var(--shadow)}
.detail{max-width:860px;margin:26px auto}
.detail h1{font-size:clamp(28px,5vw,40px)}
.detail>p:first-child a,.back-link{display:inline-flex;align-items:center;gap:6px;padding:9px 15px;border-radius:999px;border:1px solid var(--line2);background:var(--surface);font-weight:600;font-size:14px}
.tag{align-self:flex-start;display:inline-block;font:600 11px var(--mono);letter-spacing:.08em;text-transform:uppercase;padding:4px 9px;border-radius:8px;border:1px solid color-mix(in srgb,var(--accent,var(--brand)) 45%,transparent);color:var(--accent,var(--brand))}
:root[data-mode="light"] .tag{color:color-mix(in srgb,var(--accent,var(--brand)) 70%,#000)}
.project-head{display:flex;flex-direction:column;gap:10px}
.project-head h1{margin:2px 0 0}
.project-summary{margin:0;font-size:16px}
.download-open{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:54px;margin-top:6px;border-radius:18px;font-size:16px}
.file-count{font:600 11px var(--mono);padding:3px 8px;border-radius:999px;background:color-mix(in srgb,var(--on-brand) 15%,transparent)}
.project-actions{margin-top:2px}
.download-count{display:inline-flex;align-items:center;gap:6px;padding:9px 13px;border:1px solid var(--line2);border-radius:12px;color:var(--muted);font-size:13px}
.download-count b{color:var(--text)}
.content-text{white-space:pre-wrap;overflow-wrap:anywhere}
.project-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px;margin-bottom:14px}
.project-gallery.single{grid-template-columns:1fr}
.project-gallery button{padding:0;border:0;background:none;border-radius:18px;overflow:hidden;aspect-ratio:16/10}
.project-gallery button:hover{background:none;filter:brightness(1.06)}
.project-gallery img{width:100%;height:100%;object-fit:cover;display:block}
.photo-view{display:block;max-width:100%;max-height:75vh;margin:0 auto 12px;border-radius:14px}

/* ---- dialogs ---- */
dialog{background:var(--bg);color:var(--text);border:1px solid var(--line2);border-radius:26px;width:min(700px,92%);padding:22px;box-shadow:0 30px 80px -10px #000c}
dialog::backdrop{background:#0008;backdrop-filter:blur(6px)}
dialog[open]{animation:appear .2s ease both}
dialog>button[data-close-dialog]{margin-top:12px}
.dialog-header button[data-close-dialog],.profile-close{display:grid;place-items:center;width:40px;height:40px;padding:0;border-radius:50%;font-size:20px;line-height:1}
@media(max-width:600px){
  .sheet-dialog{width:100%;max-width:none;max-height:88dvh;margin:auto 0 0;border-radius:28px 28px 0 0;border-bottom:0;padding:12px 18px calc(22px + env(safe-area-inset-bottom))}
  .sheet-dialog::before{content:"";display:block;width:40px;height:5px;border-radius:3px;background:var(--line2);margin:0 auto 12px}
  .sheet-dialog[open]{animation:sheet-up .26s cubic-bezier(.2,.8,.2,1) both}
}
@keyframes sheet-up{from{transform:translateY(40px);opacity:0}to{transform:none;opacity:1}}
form label{display:block;margin:15px 0}
form label input:not([type=checkbox]):not([type=radio]),form label textarea,form label select{display:block;width:100%;margin-top:8px}
.download-files{display:flex;flex-direction:column;gap:8px}
.download-file{display:flex;align-items:center;gap:12px;padding:10px 10px 10px 12px;border-radius:18px;background:var(--surface);border:1px solid var(--line)}
.file-type{display:grid;place-items:center;width:46px;height:46px;flex:none;border-radius:14px;font:700 11px var(--mono);letter-spacing:.04em;background:color-mix(in srgb,var(--brand) 16%,transparent);color:var(--brand)}
.file-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.file-info b,.file-info small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.file-info small{font:11px var(--mono)}
.file-get{display:grid;place-items:center;width:46px;height:46px;padding:0;border-radius:14px;flex:none}
.download-note{margin:14px 0 0;padding:12px 14px;border-radius:14px;background:var(--surface2);font-size:13px;line-height:1.45}
.profile-dialog{width:min(500px,94%);max-height:86dvh;overflow-y:auto;padding:16px 20px 20px}
.profile-heading{gap:8px;margin-bottom:8px}
.profile-heading h2{margin:0}
.profile-dialog .profile-avatar{width:88px;margin:4px auto 12px;border:1px solid var(--line2);font-size:1.5rem}
.profile-name{text-align:center;font-size:1.1rem;overflow-wrap:anywhere}
.profile-dialog .profile-logout{width:100%;margin-top:16px}
.profile-logout:disabled{cursor:wait;opacity:.65}
.profile-status{margin:12px 0 0;text-align:center;color:var(--muted)}

/* ---- settings & themes ---- */
.settings-page{max-width:660px}
.settings-page h1{font-size:clamp(28px,5vw,34px);margin:4px 0 16px}
.settings-group{margin-bottom:18px}
.section-title{margin:0 0 8px 6px;font:600 12px var(--mono);letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.settings-list{border-radius:var(--radius);background:var(--surface);border:1px solid var(--line);overflow:hidden}
.setting-row{display:flex;align-items:center;flex-wrap:wrap;gap:12px 14px;width:100%;min-height:64px;padding:12px 16px;border:0;border-top:1px solid var(--line);border-radius:0;background:none;text-align:left;box-shadow:none;cursor:pointer}
.setting-row:first-child{border-top:0}
a.setting-row:hover,button.setting-row:hover{background:var(--surface2)}
.setting-row .grow{flex:1;min-width:160px;display:flex;flex-direction:column;gap:2px}
.setting-row .grow small{font-size:13px;line-height:1.35}
.setting-row>.ico:last-child{color:var(--muted)}
.setting-row select{padding:8px 12px;border-radius:12px;background:var(--surface2)}
.setting-row .seg button{height:30px}
.row-icon{display:grid;place-items:center;width:36px;height:36px;flex:none;border-radius:11px;background:color-mix(in srgb,var(--brand) 16%,transparent);color:var(--brand)}
.row-icon .ico{width:18px;height:18px}
.theme-dots{display:flex}
.theme-dots i{width:15px;height:15px;border-radius:50%;margin-left:-5px;border:2px solid var(--surface)}
.danger,.danger .row-icon{color:#e5484d}
.danger .row-icon{background:#e5484d22}
.settings-page .account-card{margin-bottom:20px}
.settings-account{min-height:68px}
.settings-account .profile-avatar{width:42px;height:42px;flex:none}
.settings-account .grow{min-width:0}
.account-card .discord-login{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:52px;border:0;border-radius:0;background:#5865f2;color:#fff;font-weight:650}
.account-card .discord-login:hover{background:#6d79ff}
.settings-page .setting-row{min-height:52px;padding:9px 14px}
.settings-page .row-icon{width:30px;height:30px;border-radius:9px}
.settings-page .row-icon .ico{width:16px;height:16px}
.settings-reset{display:flex;align-items:center;gap:7px;margin:4px auto 0;padding:8px 14px;border:0;border-radius:999px;background:none;box-shadow:none;color:#e5484d;font-size:13px;font-weight:600}
.settings-reset .ico{width:15px;height:15px}
.settings-reset:hover{background:#e5484d1a}
.switch{appearance:none;-webkit-appearance:none;position:relative;flex:none;width:50px;height:30px;padding:0;margin:0;border:0;border-radius:15px;background:var(--line2);cursor:pointer;transition:background .3s ease}
.switch::after{content:"";position:absolute;top:3px;left:3px;width:24px;height:24px;border-radius:12px;background:#fff;box-shadow:0 1px 3px #0005;transition:left .4s var(--spring),width .25s var(--ease),background .3s}
.switch:active::after{width:30px}
.switch:checked{background:var(--brand)}
.switch:checked::after{left:calc(100% - 27px);background:var(--on-brand)}
.switch:checked:active::after{left:calc(100% - 33px)}
:root[data-mode="light"] .switch:checked::after{background:#fff}
.modes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:10px}
.mode-tile{display:flex;flex-direction:column;gap:10px;padding:8px 8px 12px;border-radius:22px;border:2px solid var(--line);background:var(--surface);text-align:left}
.mode-tile[aria-checked="true"]{border-color:var(--brand)}
.mode-tile:disabled{opacity:.55}
.mode-label{display:flex;align-items:center;gap:8px;padding:0 6px;font-weight:650;font-size:14px}
.mode-tile[aria-checked="true"] .mode-label{color:var(--brand)}
.current-theme{display:grid;gap:14px;padding:10px;border-radius:var(--radius);background:var(--surface);border:1px solid var(--line)}
@media(min-width:600px){.current-theme{grid-template-columns:1.2fr 1fr;align-items:center}}
.current-info{display:flex;flex-direction:column;gap:14px;padding:4px 8px 8px}
.current-info>div:first-child{display:flex;flex-direction:column}
.current-name{font-size:22px;letter-spacing:-.02em}
.palette{display:flex;gap:6px}
.palette i{flex:1;height:28px;border-radius:9px;border:1px solid var(--line)}
.current-info .white{display:flex;align-items:center;justify-content:center;gap:8px;min-height:50px;border-radius:16px}
.theme-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
@media(min-width:600px){.themes-dialog{width:min(760px,94%)}.theme-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
.theme-card{display:flex;flex-direction:column;gap:8px;padding:6px 6px 10px;border-radius:22px;border:2px solid var(--line);background:var(--surface);text-align:left;color:var(--text)}
.theme-card:hover{border-color:var(--line2);background:var(--surface)}
.theme-card.on{border-color:var(--brand)}
.t-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 6px}
.t-name{font-weight:650;font-size:14px}
.t-check{display:grid;place-items:center;width:20px;height:20px;border-radius:50%;font-size:11px;background:var(--brand);color:var(--on-brand);opacity:0;transform:scale(.6);transition:.2s}
.theme-card.on .t-check{opacity:1;transform:none}
/* mini window preview */
.mini{position:relative;display:block;aspect-ratio:4/3;border-radius:16px;overflow:hidden;background:var(--m-bg);border:1px solid color-mix(in srgb,var(--m-text) 12%,transparent)}
.mini-slot{display:block}
.mini-slot.lg .mini{aspect-ratio:16/11}
.mini i,.mini b{display:block}
.m-top{display:flex;align-items:center;gap:5px;padding:8% 8% 0}
.m-logo{width:12%;aspect-ratio:1;border-radius:26%;background:var(--m-brand)}
.m-line{height:5px;border-radius:3px;background:var(--m-text);opacity:.85}
.m-pill{margin-left:auto;width:14%;height:7px;border-radius:4px;background:var(--m-muted);opacity:.45}
.m-hero{display:flex;flex-direction:column;gap:4px;margin:8% 8% 0}
.m-h1{width:62%;height:7px}
.m-accent{width:38%;height:7px;background:var(--m-brand);opacity:1}
.m-cards{display:grid;grid-template-columns:1.6fr 1fr;gap:5px;margin:7% 8% 0}
.m-card{display:flex;align-items:flex-end;gap:2px;height:32px;padding:5px;border-radius:8px;background:var(--m-surface);border:1px solid color-mix(in srgb,var(--m-text) 10%,transparent)}
.mini-slot.lg .m-card{height:58px}
.m-card i{flex:1;border-radius:2px;background:var(--m-brand)}
.m-card-2 i{background:var(--m-brand2);opacity:.75}
.m-tab{position:absolute;left:50%;bottom:6%;transform:translateX(-50%);display:flex;gap:8px;padding:5px 10px;border-radius:999px;background:var(--m-s2);border:1px solid color-mix(in srgb,var(--m-text) 10%,transparent)}
.m-tab i{width:9px;height:9px;border-radius:3px;background:var(--m-muted);opacity:.6}
.m-tab i.on{background:var(--m-brand);opacity:1}

/* ---- discussions & chat ---- */
.comments-panel{padding:clamp(12px,4vw,22px)}
.comments-heading{padding-bottom:12px;border-bottom:1px solid var(--line)}
.comments-heading h2{margin:0}
.comment-count{color:var(--muted);font-size:12px}
.comment-empty{margin:0;padding:16px 0}
.comment-item{padding:14px 0}
.comment-item+.comment-item{border-top:1px solid var(--line)}
.comment-meta{display:flex;flex-wrap:wrap;align-items:baseline;gap:5px 8px}
.comment-meta b{margin-right:auto;overflow-wrap:anywhere}
.comment-role{text-transform:uppercase;letter-spacing:.07em;background:transparent}
.comment-meta time{color:var(--muted);font:11px var(--mono);white-space:nowrap}
.no-times .discussion-item time{display:none}
.comment-form{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:8px;border-top:1px solid var(--line);padding-top:12px}
.comment-form textarea{width:100%;min-width:0;min-height:48px;max-height:180px;resize:vertical;padding:12px 16px;border-radius:24px;font-size:16px;line-height:22px;background:var(--bg)}
.comment-form textarea:focus-visible{outline:2px solid var(--brand);outline-offset:1px}
.comment-send{min-height:48px;padding:0 20px;border-color:transparent;border-radius:24px;font-weight:700;color:var(--on-brand);background:var(--brand)}
.comment-send:hover{background:var(--brand);filter:brightness(1.08)}
.discussion-list{min-width:0;overflow-x:clip}
.discussion-item{display:grid;grid-template-columns:36px minmax(0,1fr);column-gap:10px;position:relative;border-radius:14px;touch-action:pan-y;transform:translateX(var(--swipe-offset,0px));transition:transform .16s ease,background .16s ease}
.discussion-item.swiping{transition:none;background:var(--surface2);user-select:none}
.discussion-item .avatar{width:36px;height:36px;border-radius:12px;font-weight:700}
.discussion-item .avatar,.discussion-item .ico{pointer-events:none}
.discussion-item .comment-meta{min-height:22px;font-size:.875rem}
.discussion-item p{margin:4px 0 5px;color:var(--text);font-size:1rem;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere}
.discussion-actions,.vote-controls{display:inline-flex;align-items:center;gap:4px}
.vote-controls{max-width:100%}
.vote-button,.reply-shortcut,.cancel-reply{display:inline-grid;place-items:center;width:44px;min-height:44px;padding:0;border-radius:12px;box-shadow:none;color:var(--muted)}
.vote-button{display:inline-flex;justify-content:center;align-items:center;gap:5px;width:auto;min-width:44px;padding:0 9px;font-variant-numeric:tabular-nums}
.discussion-actions .vote-button,.reply-shortcut{border-color:transparent;background:transparent}
.discussion-actions .vote-button:hover,.reply-shortcut:hover{background:var(--surface2);color:var(--text)}
.vote-button[aria-pressed="true"]{border-color:var(--brand);color:var(--brand);background:color-mix(in srgb,var(--brand) 14%,var(--surface))}
.vote-button .ico,.reply-shortcut .ico,.cancel-reply .ico{width:17px;height:17px}
.reply-quote,.reply-preview{display:flex;align-items:center;gap:8px;min-width:0;border-left:2px solid var(--brand);border-radius:0 10px 10px 0;background:var(--surface2)}
.reply-quote{max-width:100%;padding:6px 9px;margin:3px 0 7px;font-size:.8125rem;color:var(--muted)}
.reply-quote b,.reply-quote span,.reply-preview strong,.reply-preview small{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.reply-quote b{flex:0 1 auto;max-width:55%;color:var(--text)}
.reply-quote span{flex:1 1 0}
.reply-preview{grid-column:1/-1;justify-content:space-between;padding:0 4px 0 10px}
.reply-preview div{min-width:0;display:grid;gap:3px;padding:6px 0}
.cancel-reply{border:0;background:transparent;flex:none}
.chat-route{display:flex;flex-direction:column;height:100vh;height:var(--chat-height,100dvh);min-height:0;padding-bottom:0}
.chat-route>header{flex:none;position:relative}
.chat-route>main{display:flex;flex:1;min-height:0;margin:10px auto calc(88px + env(safe-area-inset-bottom))}
@media(pointer:coarse){
  .reply-shortcut:not(:focus-visible){position:absolute;opacity:0;pointer-events:none}
}
.chat-panel{display:grid;grid-template-rows:auto minmax(0,1fr) auto;flex:1;min-width:0;margin:0;padding:0;overflow:hidden}
.chat-heading{padding:14px clamp(14px,3vw,24px);border-bottom:1px solid var(--line)}
.chat-heading h1{margin:0;font-size:clamp(1.25rem,4vw,1.6rem)}
.chat-feed{min-height:0;overflow-y:auto;overscroll-behavior-y:contain;padding:4px clamp(12px,3vw,24px);scrollbar-width:thin}
.chat-message{padding:12px 0 6px}
.chat-message+.chat-message{border-top:1px solid var(--line)}
.chat-panel .comment-form{padding:10px clamp(10px,3vw,20px);background:var(--surface2)}
.chat-panel .comment-form textarea{max-height:min(22vh,180px)}

/* ---- effects, motion ---- */
.backlink:hover{color:var(--text)}
:root:not([data-mode="light"]) body:not(.no-glow) article:hover{box-shadow:var(--shadow),0 0 36px -10px color-mix(in srgb,var(--accent,var(--brand)) 55%,transparent)}
body:not(.no-glow) .white{box-shadow:0 8px 22px -10px color-mix(in srgb,var(--brand) 80%,transparent)}
body:not(.no-glow) .logo{filter:drop-shadow(0 0 8px color-mix(in srgb,var(--text) 30%,transparent))}
.no-motion *,.no-motion *::before,.no-motion *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
@media(max-width:550px){
  .topbar{height:60px}
  .brand b{font-size:15px}
  .brand .logo{width:30px;height:35px}
  .login-button{padding:0 12px}
  .hero{padding:26px 0 0}
  .panel{padding:16px}
  .chat-route>main{width:96%}
  .chat-panel{padding:0}
}
