/* ==========================================================================
   TyCMS - Fluent Design system
   Made by Tyleo Dv. Delaware | https://tyleo.dev
   ========================================================================== */

/* ---------- Tokens ---------- */
/* Theme fallbacks: zero specificity so [data-theme="..."] (themes.css / custom slots) always wins */
:where(:root) {
    --bg-color: #161616; --surface-color: #16161675; --surface-hover: rgba(102,0,0,.9);
    --text-main: #fff; --text-muted: #acacac; --accent: #ff0000;
    --glass-blur: 28px;
    --glass-alpha: .72;
}
:root {
    --font-ui: 'Plus Jakarta Sans', 'Segoe UI Light', 'Segoe UI', system-ui, sans-serif;
    --font-code: 'JetBrains Mono', 'Lucida Console', monospace;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 18px;
    --ease: cubic-bezier(.2, .8, .2, 1);
    --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
    --border: color-mix(in srgb, var(--text-main) 13%, transparent);
    --border-strong: color-mix(in srgb, var(--text-main) 24%, transparent);
    --glass: color-mix(in srgb, var(--surface-color) calc(var(--glass-alpha) * 100%), transparent);
    --glass-solid: color-mix(in srgb, var(--surface-color) 92%, var(--bg-color));
    --field: color-mix(in srgb, var(--text-main) 6%, transparent);
    --field-hover: color-mix(in srgb, var(--text-main) 10%, transparent);
    --accent-soft: color-mix(in srgb, var(--accent) 18%, transparent);
    --accent-text: #fff;
    --danger: #ef4444; --success: #22c55e; --warning: #f59e0b; --info: #3b82f6;
    --shadow-sm: 0 2px 8px rgba(0,0,0,.18);
    --shadow: 0 10px 34px rgba(0,0,0,.28), 0 2px 8px rgba(0,0,0,.16);
    --shadow-lg: 0 24px 70px rgba(0,0,0,.42);
    --dock-h: 86px;
    color-scheme: dark;
}
:root.theme-light { color-scheme: light; --accent-text: #fff; --shadow: 0 10px 30px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.08); }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
/* The page colour is painted by <html> (the canvas, below everything). <body> stays transparent:
   an opaque body would be painted ABOVE the fixed background image (.app-bg, negative z-index) and hide it. */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--bg-color); transition: background-color .35s var(--ease); }
body {
    font-family: var(--font-ui); font-size: 15px; line-height: 1.55;
    background: transparent; color: var(--text-main);
    -webkit-font-smoothing: antialiased; overflow-x: hidden;
    transition: background-color .35s var(--ease), color .35s var(--ease);
}
img, video, iframe { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
code, pre, kbd, .mono { font-family: var(--font-code); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5em 0; }
::selection { background: var(--accent); color: #fff; }
[hidden] { display: none !important; }
.muted { color: var(--text-muted); }
.small { font-size: .85em; }
.nowrap { white-space: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text-main) 18%, transparent); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Icons (SVG only, perfectly centered) ---------- */
.ico { width: 1em; height: 1em; display: inline-block; vertical-align: -.125em; flex: 0 0 auto; overflow: visible; }
.ico.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.app-icon { display: inline-flex; align-items: center; justify-content: center; width: 1em; height: 1em; line-height: 1; }
.app-icon .ico { width: 100%; height: 100%; vertical-align: 0; }
.app-icon img { width: 100%; height: 100%; object-fit: contain; }
.app-icon-mask { -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; }

/* ---------- Background (branding / easter egg) ---------- */
.app-bg { position: fixed; inset: 0; z-index: -2; background-size: cover; background-position: center; }
.app-bg::after { content: ''; position: absolute; inset: 0; background: color-mix(in srgb, var(--bg-color) 45%, transparent); }

/* ---------- Acrylic surfaces ---------- */
.glass, .card, .tb-glass {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 1px 0 0 rgba(255,255,255,.04) inset, var(--shadow-sm);
}
.card { padding: 20px; position: relative; }
.card + .card { margin-top: 0; }
.card-title { font-size: 1rem; font-weight: 700; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.card-title .ico { color: var(--accent); }
.card-sub { color: var(--text-muted); font-size: .88em; margin: -8px 0 14px; }
.card.pad-0 { padding: 0; overflow: hidden; }

html.has-bg :is(.glass, .card, .tb-glass) { backdrop-filter: blur(var(--glass-blur)) saturate(1.4); -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 38px; padding: 0 16px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--field); color: var(--text-main);
    font-weight: 600; font-size: .9rem; cursor: pointer; white-space: nowrap; text-decoration: none !important;
    transition: background .18s, border-color .18s, transform .12s, box-shadow .18s, color .18s;
    user-select: none;
}
.btn:hover { background: var(--field-hover); border-color: var(--border-strong); }
.btn:active { transform: scale(.97); }
.btn:disabled, .btn.disabled { opacity: .5; pointer-events: none; }
.btn .ico { width: 15px; height: 15px; }
.btn-accent { background: var(--accent); border-color: transparent; color: var(--accent-text); box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-accent:hover { background: color-mix(in srgb, var(--accent) 86%, #fff); border-color: transparent; }
.btn-outline { background: transparent; border-color: var(--accent); color: var(--accent); }
.btn-outline:hover { background: var(--accent-soft); border-color: var(--accent); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--field); }
.btn-danger { background: color-mix(in srgb, var(--danger) 16%, transparent); border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { height: 30px; padding: 0 11px; font-size: .8rem; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 1rem; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }
.btn-block { width: 100%; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.btn-group .btn.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

/* ---------- Forms (scoped: never style the dock search input) ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > label, .label { font-size: .78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.field .hint { font-size: .8rem; color: var(--text-muted); }
.field > label.switch, .field > label.check { text-transform: none; letter-spacing: 0; font-size: .9rem; font-weight: 500; color: var(--text-main); }
.input, .field input[type=text], .field input[type=password], .field input[type=email], .field input[type=number],
.field input[type=url], .field input[type=search], .field input[type=datetime-local], .field input[type=date], .field select, .field textarea, .select, .textarea {
    width: 100%; min-height: 40px; padding: 9px 12px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--field); color: var(--text-main);
    font: inherit; font-size: .92rem; outline: none; transition: border-color .18s, background .18s, box-shadow .18s;
}
.field textarea, .textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.input:hover, .field input:hover, .field select:hover, .field textarea:hover { background: var(--field-hover); }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus, .select:focus, .textarea:focus {
    border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--field-hover);
}
.field select, .select { appearance: none; padding-right: 34px;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.field select option, .select option { background: var(--bg-color); color: var(--text-main); }
.input.mono, .field .mono { font-family: var(--font-code); font-size: .85rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 16px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
.input-group { display: flex; gap: 8px; align-items: stretch; }
.input-group .input, .input-group input { flex: 1 1 auto; min-width: 0; }

/* Switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: .92rem; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { position: relative; width: 42px; height: 24px; border-radius: 24px; background: var(--field-hover); border: 1px solid var(--border-strong); transition: background .2s, border-color .2s; flex: 0 0 auto; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-muted); transition: transform .25s var(--ease-spring), background .2s; }
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--accent-soft); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: .92rem; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }

/* ---------- Badges / alerts ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 22px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; background: var(--field-hover); color: var(--text-muted); white-space: nowrap; }
.badge .ico { width: 11px; height: 11px; }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-success { background: color-mix(in srgb, var(--success) 18%, transparent); color: var(--success); }
.badge-warning { background: color-mix(in srgb, var(--warning) 18%, transparent); color: var(--warning); }
.badge-danger { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--field); margin-bottom: 14px; font-size: .92rem; }
.alert .ico { margin-top: 3px; }
.alert-error { border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.alert-error .ico { color: var(--danger); }
.alert-success { border-color: color-mix(in srgb, var(--success) 45%, transparent); background: color-mix(in srgb, var(--success) 12%, transparent); }
.alert-success .ico { color: var(--success); }
.alert-info .ico { color: var(--accent); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid color-mix(in srgb, var(--text-main) 6%, transparent); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--text-main) 4%, transparent); }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions form { display: inline; }
.table a.title-link { color: var(--text-main); font-weight: 600; }
.table a.title-link:hover { color: var(--accent); }
.empty { padding: 48px 20px; text-align: center; color: var(--text-muted); }
.empty .ico { width: 42px; height: 42px; opacity: .45; margin-bottom: 10px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: var(--radius); background: var(--field); border: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: var(--radius-sm); border: 0; background: transparent; color: var(--text-muted); font-weight: 600; font-size: .86rem; cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .18s, color .18s; }
.tab:hover { color: var(--text-main); background: var(--field); }
.tab.active { background: var(--accent); color: var(--accent-text); }
.tab .ico { width: 14px; height: 14px; }
.tab-panel { display: none; animation: fadeUp .3s var(--ease); }
.tab-panel.active { display: block; }

/* ---------- Animations ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
/* Page changes: the browser keeps the current page on screen until the next one is ready, then cross-fades
   (cross-document view transitions). Dock and header are shared elements: they stay still. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .16s; animation-timing-function: ease-out; }
.dock { view-transition-name: ty-dock; }
.site-header { view-transition-name: ty-header; }
.admin-top { view-transition-name: ty-admin-top; }
::view-transition-group(ty-dock), ::view-transition-group(ty-header), ::view-transition-group(ty-admin-top) { animation-duration: 0s; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
/* Page entry: content is visible from the first frame (no opacity fade = no blank page between navigations) */
@keyframes pageIn { from { transform: translateY(6px); } to { transform: none; } }
.page-enter { animation: pageIn .22s var(--ease); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ==========================================================================
   DOCK (macOS style) - based on DOCK.txt model
   ========================================================================== */
.dock { position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 1000; perspective: 800px; max-width: calc(100vw - 24px); }
.dock-items {
    display: flex; align-items: flex-end; gap: 4px; padding: 10px 14px;
    background: color-mix(in srgb, var(--dock-bg) 82%, transparent);
    backdrop-filter: blur(40px) saturate(1.5); -webkit-backdrop-filter: blur(40px) saturate(1.5);
    border: 1px solid var(--dock-border); border-radius: 20px;
    box-shadow: 0 1px 0 0 rgba(255,255,255,.06) inset, 0 10px 40px rgba(0,0,0,.35), 0 2px 8px rgba(0,0,0,.2);
}
.dock-separator { width: 1px; height: 28px; background: var(--border-strong); margin: 0 4px; align-self: center; opacity: .5; flex-shrink: 0; }
.dock-item {
    display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; padding: 0;
    background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 12px;
    color: var(--text-muted); cursor: pointer; position: relative; transform-origin: bottom center; flex-shrink: 0;
    text-decoration: none !important;
    transition: transform .25s var(--ease-spring), color .2s, background .2s, border-color .2s, box-shadow .2s;
}
.theme-light .dock-item { background: rgba(0,0,0,.035); border-color: rgba(0,0,0,.08); }
.dock-item:hover { transform: scale(1.35); color: var(--text-main); background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); box-shadow: 0 4px 16px rgba(0,0,0,.25); }
.dock-item.active { color: var(--accent); border-color: var(--accent); background: rgba(255,255,255,.06); box-shadow: 0 0 12px rgba(255,255,255,.05) inset; }
.dock-item.active::after { content: ''; position: absolute; bottom: -3px; left: 50%; transform: translateX(-50%); width: 5px; height: 5px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 6px var(--accent); }
.dock-item .ico { pointer-events: none; width: 22px; height: 22px; vertical-align: 0; }
.dock-item .dock-label { position: absolute; font-size: .6rem; font-weight: 800; bottom: 3px; right: 4px; line-height: 1; }

/* Dock icon colors (Colored mode) */
.dock-c-red { color: #f87171; } .dock-c-green { color: #4ade80; } .dock-c-teal { color: #2dd4bf; }
.dock-c-amber { color: #fbbf24; } .dock-c-purple { color: #c084fc; } .dock-c-yellow { color: #facc15; }
.dock-c-blue { color: #60a5fa; } .dock-c-silver { color: #94a3b8; } .dock-c-pink { color: #f472b6; }
.dock-c-cyan { color: #22d3ee; } .dock-c-admin { color: #94a3b8; } .dock-c-orange { color: #fb923c; }
.dock-item[class*="dock-c-"]:hover { color: var(--accent); }
.dock-item.dock-c-admin:hover { color: #FF0000; border-color: rgba(255,0,0,.3); background: rgba(255,0,0,.08); }
.dock-item[class*="dock-c-"].active { color: var(--accent); }
.dock-item.dock-c-admin.active { color: #FF0000; border-color: #FF0000; }
.dock-c-red.dock-neighbor-1, .dock-c-red.dock-neighbor-2 { color: #f87171; }
.dock-c-green.dock-neighbor-1, .dock-c-green.dock-neighbor-2 { color: #4ade80; }
.dock-c-teal.dock-neighbor-1, .dock-c-teal.dock-neighbor-2 { color: #2dd4bf; }
.dock-c-amber.dock-neighbor-1, .dock-c-amber.dock-neighbor-2 { color: #fbbf24; }
.dock-c-purple.dock-neighbor-1, .dock-c-purple.dock-neighbor-2 { color: #c084fc; }
.dock-c-yellow.dock-neighbor-1, .dock-c-yellow.dock-neighbor-2 { color: #facc15; }
.dock-c-blue.dock-neighbor-1, .dock-c-blue.dock-neighbor-2 { color: #60a5fa; }
.dock-c-pink.dock-neighbor-1, .dock-c-pink.dock-neighbor-2 { color: #f472b6; }
.dock-c-cyan.dock-neighbor-1, .dock-c-cyan.dock-neighbor-2 { color: #22d3ee; }
.dock-c-orange.dock-neighbor-1, .dock-c-orange.dock-neighbor-2 { color: #fb923c; }
.dock-c-admin.dock-neighbor-1, .dock-c-admin.dock-neighbor-2 { color: #94a3b8; }

/* Accented mode: every icon follows the accent color */
.dock-accented .dock-item[class*="dock-c-"],
.dock-accented .dock-item[class*="dock-c-"].dock-neighbor-1,
.dock-accented .dock-item[class*="dock-c-"].dock-neighbor-2 { color: var(--accent); }
.dock-accented .dock-item[class*="dock-c-"]:hover { color: var(--text-main); }
.dock-accented .dock-item.dock-c-admin:hover { color: var(--text-main); border-color: var(--accent); background: var(--accent-soft); }

/* Tooltip */
.dock-item::before {
    content: attr(data-tip); position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%) scale(.8);
    background: var(--glass-solid); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border); color: var(--text-main); font-family: var(--font-ui); font-size: .7rem; font-weight: 600;
    padding: 4px 10px; border-radius: 6px; white-space: nowrap; pointer-events: none; opacity: 0;
    transition: opacity .15s, transform .15s; box-shadow: 0 4px 12px rgba(0,0,0,.25); z-index: 10;
}
.dock-item:hover::before { opacity: 1; transform: translateX(-50%) scale(1); }
.dock-item.dock-neighbor-1 { transform: scale(1.15); }
.dock-item.dock-neighbor-2 { transform: scale(1.06); }

/* Dock search - collapsed = REAL 0px width (high specificity, beats any global input rule) */
.dock-search { display: flex; align-items: center; position: relative; flex: 0 0 auto; }
.dock .dock-search .search-input,
.dock .dock-search input.search-input[type="search"],
.dock .dock-search input.search-input[type="text"] {
    width: 0; min-width: 0; max-width: 0; padding: 0; margin: 0; border: 0; flex: 0 0 auto;
    background: transparent; color: var(--text-main); font-family: inherit; font-size: .85em; outline: none;
    border-radius: 10px; opacity: 0; box-shadow: none; min-height: 0; height: 0;
    transition: width .3s cubic-bezier(.4,0,.2,1), max-width .3s cubic-bezier(.4,0,.2,1), padding .3s, margin .3s, opacity .3s;
}
.dock .dock-search.expanded .search-input,
.dock .dock-search.expanded input.search-input[type="search"],
.dock .dock-search.expanded input.search-input[type="text"] {
    width: 180px; max-width: 180px; height: 38px; padding: 8px 14px; margin-left: 6px;
    background: rgba(0,0,0,.25); border: 1px solid var(--border); opacity: 1;
}
.theme-light .dock .dock-search.expanded .search-input { background: rgba(255,255,255,.6); }
.dock-search .search-input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ---------- Dropups (mosaic, outside the dock: never follow icon animation) ---------- */
.dock-dropup { position: fixed; bottom: 88px; left: 50%; transform: translateX(-50%) scale(.95); z-index: 1500; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s var(--ease-spring); }
.dock-dropup.visible { opacity: 1; pointer-events: auto; transform: translateX(-50%) scale(1); }
.dropup-panel {
    background: color-mix(in srgb, var(--dock-bg) 88%, transparent);
    backdrop-filter: blur(40px) saturate(1.5); -webkit-backdrop-filter: blur(40px) saturate(1.5);
    border: 1px solid var(--dock-border); border-radius: 16px; padding: 16px;
    box-shadow: 0 1px 0 0 rgba(255,255,255,.06) inset, 0 10px 40px rgba(0,0,0,.35), 0 2px 8px rgba(0,0,0,.2);
    width: 90vw; max-width: 560px; max-height: 56vh; overflow-y: auto;
}
.dropup-title { font-size: .78em; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; padding: 0 2px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mosaic { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.mosaic-tile {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 84px; padding: 12px 8px;
    border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--border); color: var(--text-main);
    font-size: .76rem; font-weight: 600; text-align: center; cursor: pointer; text-decoration: none !important;
    transition: transform .15s, border-color .2s, background .2s;
}
.mosaic-tile .ico { width: 24px; height: 24px; color: var(--accent); }
.mosaic-tile:hover { transform: scale(1.04); border-color: var(--accent); background: var(--accent-soft); }
.mosaic-tile.active { border-color: var(--accent); background: var(--accent-soft); }
.mosaic-tile .tile-code { font-size: 1.3rem; font-weight: 800; color: var(--accent); letter-spacing: .04em; line-height: 1; }

/* Theme popup */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 8px; }
.theme-section-title { grid-column: 1 / -1; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin: 8px 2px 0; }
.theme-card { padding: 10px; border-radius: 10px; cursor: pointer; border: 2px solid transparent; transition: border-color .2s, transform .15s; text-align: left; font: inherit; }
.theme-card:hover { transform: scale(1.04); }
.theme-card.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.theme-card .theme-name { font-size: .72em; font-weight: 700; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.theme-palette { display: flex; gap: 3px; }
.theme-swatch { width: 18px; height: 18px; border-radius: 5px; border: 1px solid rgba(128,128,128,.25); }

/* ---------- Modals (app UI: no native browser prompts) ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 3000; background: rgba(0,0,0,.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadeIn .2s; }
.modal-backdrop.closing { animation: fadeIn .18s reverse forwards; }
.modal {
    width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column;
    background: var(--glass-solid); backdrop-filter: blur(40px) saturate(1.5); -webkit-backdrop-filter: blur(40px) saturate(1.5);
    border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); animation: popIn .25s var(--ease-spring);
}
.modal.modal-lg { max-width: 920px; } .modal.modal-xl { max-width: 1200px; height: calc(100vh - 32px); } .modal.modal-sm { max-width: 400px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 1.02rem; flex: 1; display: flex; align-items: center; gap: 10px; }
.modal-head h3 .ico { color: var(--accent); }
.modal-body { padding: 18px; overflow: auto; flex: 1 1 auto; min-height: 0; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }

/* About */
.about-banner {
    width: 100%; aspect-ratio: 4 / 1; margin: 0 0 16px; background-color: var(--accent);
    -webkit-mask: url('../banner.png') center / contain no-repeat; mask: url('../banner.png') center / contain no-repeat;
}
.about-box { padding: 10px; text-align: center; }
.about-sign { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; font-size: .92rem; }
.about-sign .app-icon { width: 22px; height: 22px; }
.about-sign .sep { opacity: .35; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; top: 16px; right: 16px; z-index: 4000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; max-width: calc(100vw - 32px); }
.toast {
    display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 420px; padding: 12px 14px; border-radius: var(--radius);
    background: var(--glass-solid); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); border: 1px solid var(--border-strong);
    box-shadow: var(--shadow); pointer-events: auto; animation: toastIn .35s var(--ease-spring); font-size: .9rem;
}
.toast .ico { width: 18px; height: 18px; color: var(--accent); }
.toast.success .ico { color: var(--success); } .toast.error .ico { color: var(--danger); }
.toast.out { animation: toastOut .25s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }

/* ---------- Color picker (in-app) ---------- */
.color-input { display: flex; align-items: center; gap: 8px; }
.color-swatch-btn { width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); cursor: pointer; padding: 0; flex: 0 0 auto;
    background-image: linear-gradient(45deg, #8884 25%, transparent 25%, transparent 75%, #8884 75%), linear-gradient(45deg, #8884 25%, transparent 25%, transparent 75%, #8884 75%);
    background-size: 10px 10px; background-position: 0 0, 5px 5px; position: relative; overflow: hidden; }
.color-swatch-btn span { position: absolute; inset: 0; }
.cp { width: 280px; padding: 14px; user-select: none; }
.cp-sv { position: relative; height: 170px; border-radius: 10px; cursor: crosshair; background-image: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent); }
.cp-thumb { position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.4); transform: translate(-50%, -50%); pointer-events: none; }
.cp-slider { position: relative; height: 14px; border-radius: 10px; margin-top: 12px; cursor: pointer; }
.cp-hue { background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }
.cp-alpha { background-image: linear-gradient(45deg, #8886 25%, transparent 25%, transparent 75%, #8886 75%), linear-gradient(45deg, #8886 25%, transparent 25%, transparent 75%, #8886 75%); background-size: 10px 10px; background-position: 0 0, 5px 5px; }
.cp-alpha-fill { position: absolute; inset: 0; border-radius: 10px; }
.cp-slider .cp-thumb { top: 50%; }
.cp-row { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.cp-preview { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border-strong); flex: 0 0 auto; }
.cp-swatches { display: grid; grid-template-columns: repeat(9, 1fr); gap: 5px; margin-top: 12px; }
.cp-swatches button { aspect-ratio: 1; border-radius: 6px; border: 1px solid var(--border); cursor: pointer; padding: 0; }
.popover { position: fixed; z-index: 3500; background: var(--glass-solid); backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-lg); animation: popIn .18s var(--ease); }

/* ---------- Icon browser ---------- */
.ib { display: grid; grid-template-columns: 200px 1fr; gap: 14px; height: 100%; min-height: 0; }
.ib-cats { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding-right: 4px; }
.ib-cats button { text-align: left; border: 0; background: transparent; color: var(--text-muted); padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: .82rem; display: flex; justify-content: space-between; gap: 6px; }
.ib-cats button:hover { background: var(--field); color: var(--text-main); }
.ib-cats button.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.ib-main { display: flex; flex-direction: column; min-height: 0; gap: 10px; }
.ib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; overflow-y: auto; align-content: start; padding: 2px; }
.ib-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 84px; padding: 6px; border-radius: 10px; border: 1px solid var(--border); background: var(--field); cursor: pointer; color: var(--text-main); transition: transform .12s, border-color .15s, background .15s; }
.ib-item:hover { border-color: var(--accent); transform: scale(1.05); background: var(--accent-soft); }
.ib-item.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.ib-item .ico { width: 24px; height: 24px; }
.ib-item span { font-size: .62rem; color: var(--text-muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-field { display: flex; align-items: center; gap: 8px; }
.icon-preview { width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--field); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.icon-preview .ico { width: 20px; height: 20px; }

/* ---------- Font browser ---------- */
.fb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; overflow-y: auto; align-content: start; padding: 2px; }
.fb-card { padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--field); cursor: pointer; transition: border-color .15s, transform .12s; min-height: 108px; display: flex; flex-direction: column; gap: 6px; }
.fb-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.fb-card.active { border-color: var(--accent); background: var(--accent-soft); }
.fb-card .fb-sample { font-size: 1.5rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-card .fb-name { font-size: .78rem; font-weight: 700; display: flex; justify-content: space-between; gap: 6px; color: var(--text-muted); }
.fb-card .fb-text { font-size: .85rem; color: var(--text-muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ---------- Media library / picker ---------- */
.media-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: .88rem; }
.crumbs button { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; padding: 4px 8px; border-radius: 6px; font-weight: 600; }
.crumbs button:hover { background: var(--field); color: var(--text-main); }
.crumbs button:last-child { color: var(--text-main); }
.crumbs .ico { width: 10px; height: 10px; opacity: .5; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.media-item { position: relative; border-radius: 12px; border: 1px solid var(--border); background: var(--field); overflow: hidden; cursor: pointer; transition: border-color .15s, transform .15s; user-select: none; }
.media-item:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.media-item.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.media-thumb { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--text-main) 4%, transparent); overflow: hidden; }
.media-thumb img, .media-thumb video { width: 100%; height: 100%; object-fit: cover; }
.media-thumb .ico { width: 38px; height: 38px; color: var(--text-muted); }
.media-item.folder .media-thumb .ico { color: #facc15; width: 48px; height: 48px; }
.media-meta { padding: 8px 10px; font-size: .78rem; }
.media-meta .n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.media-meta .s { color: var(--text-muted); font-size: .72rem; }
.media-check { position: absolute; top: 8px; left: 8px; width: 22px; height: 22px; border-radius: 6px; background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.4); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s; color: #fff; }
.media-check .ico { width: 12px; height: 12px; }
.media-item:hover .media-check, .media-item.selected .media-check { opacity: 1; }
.media-item.selected .media-check { background: var(--accent); border-color: var(--accent); }
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--text-muted); transition: border-color .2s, background .2s; cursor: pointer; }
.dropzone.over, .dropzone:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--text-main); }
.dropzone .ico { width: 30px; height: 30px; color: var(--accent); margin-bottom: 6px; }
.upload-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.upload-row { display: flex; align-items: center; gap: 10px; font-size: .82rem; }
.progress { height: 6px; border-radius: 6px; background: var(--field-hover); overflow: hidden; flex: 1; }
.progress > span { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.storage-drop-overlay { position: fixed; inset: 0; z-index: 2500; background: color-mix(in srgb, var(--accent) 18%, transparent); border: 3px dashed var(--accent); display: none; align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 700; pointer-events: none; }
.storage-drop-overlay.on { display: flex; }

/* ==========================================================================
   ADMIN SHELL (full width, zero side margins)
   ========================================================================== */
.admin-body { min-height: 100vh; }
.admin-top {
    position: sticky; top: 0; z-index: 900; display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 24px;
    background: color-mix(in srgb, var(--bg-color) 72%, transparent); backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-bottom: 1px solid var(--border);
}
.admin-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text-main); text-decoration: none !important; font-size: .95rem; }
.admin-brand .app-icon { width: 26px; height: 26px; }
.admin-top .crumb-sep { color: var(--text-muted); opacity: .5; }
.admin-top h1 { font-size: 1.05rem; margin: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-top .top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.admin-main { padding: 24px 24px calc(var(--dock-h) + 40px); width: 100%; }
.admin-grid { display: grid; gap: 16px; grid-template-columns: repeat(12, 1fr); }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-6 { grid-column: span 6; } .span-4 { grid-column: span 4; } .span-3 { grid-column: span 3; } .span-9 { grid-column: span 9; }
.stat { display: flex; gap: 14px; align-items: center; }
.stat-ico { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); flex: 0 0 auto; }
.stat-ico .ico { width: 22px; height: 22px; }
.stat b { font-size: 1.6rem; display: block; line-height: 1.1; font-weight: 800; }
.stat span { color: var(--text-muted); font-size: .82rem; }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid color-mix(in srgb, var(--text-main) 6%, transparent); font-size: .9rem; }
.list-plain li:last-child { border-bottom: 0; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.mode-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.mode-card { position: relative; cursor: pointer; padding: 22px; border-radius: var(--radius-lg); border: 2px solid var(--border); background: var(--glass); transition: border-color .2s, transform .2s; display: flex; flex-direction: column; gap: 10px; }
.mode-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.mode-card input { position: absolute; opacity: 0; }
.mode-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.mode-card .ico { width: 30px; height: 30px; color: var(--accent); }
.mode-card h3 { margin: 0; font-size: 1.05rem; }
.mode-card p { margin: 0; color: var(--text-muted); font-size: .86rem; }
.mode-card .badge { position: absolute; top: 14px; right: 14px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.copy-box { display: flex; gap: 8px; align-items: center; }
.copy-box code { flex: 1; min-width: 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--field); border: 1px solid var(--border); font-size: .78rem; overflow-x: auto; white-space: nowrap; }
.qr { background: #fff; padding: 12px; border-radius: 12px; display: inline-block; }
.qr svg, .qr canvas { display: block; width: 180px; height: 180px; }
.nt { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.nt-children { margin: 3px 0 2px 22px; padding-left: 10px; border-left: 1px dashed var(--border-strong); min-height: 30px; }
.nt-children:empty::after { content: ''; display: block; height: 28px; border: 1px dashed var(--border); border-radius: 8px; opacity: .6; }
.nt-item.collapsed > .nt-children { display: none; }
.nt-row { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 6px 0 4px; border-radius: 8px; border: 1px solid transparent; background: var(--field); cursor: pointer; user-select: none; transition: background .12s, border-color .12s; }
.nt-row:hover { background: var(--field-hover); }
.nt-row.selected { border-color: color-mix(in srgb, var(--accent) 70%, transparent); background: var(--accent-soft); }
.nt-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.nt-handle { cursor: grab; color: var(--text-muted); display: flex; padding: 4px 2px; }
.nt-handle .ico { width: 12px; height: 12px; }
.nt-caret { width: 20px; height: 20px; border: 0; background: none; color: var(--text-muted); display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; visibility: hidden; border-radius: 5px; }
.nt-caret .ico { width: 10px; height: 10px; transition: transform .15s var(--ease); }
.nt-row.is-folder .nt-caret { visibility: visible; }
.nt-item.collapsed > .nt-row .nt-caret .ico { transform: rotate(-90deg); }
.nt-icon { width: 22px; height: 22px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; color: var(--accent); }
.nt-icon .ico { width: 15px; height: 15px; }
.nt-row.is-folder .nt-icon { color: var(--warning); }
.nt-label { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 40px; }
.nt-row.is-folder .nt-label { font-weight: 700; }
.nt-meta { flex: 1 1 auto; min-width: 0; color: var(--text-muted); font-family: var(--font-code); font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nt-row.is-folder .nt-meta { font-family: var(--font-ui); }
.nt-ext { color: var(--text-muted); display: flex; } .nt-ext .ico { width: 11px; height: 11px; }
.nt-row .btn-sm.btn-icon { width: 28px; height: 28px; min-width: 28px; padding: 0; opacity: 0; transition: opacity .12s; }
.nt-row:hover .btn-icon, .nt-row.selected .btn-icon, .nt-row:focus-within .btn-icon { opacity: 1; }
@media (hover: none) { .nt-row .btn-sm.btn-icon { opacity: 1; } }
.nt-kind { margin-bottom: 12px; }
.nt-kind .tab[disabled] { opacity: .4; cursor: not-allowed; }
.nt-icon-prev { display: inline-flex; width: 16px; height: 16px; color: var(--accent); }
.nt-icon-prev .ico { width: 100%; height: 100%; }
.nt-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.nt-inspector .field { margin-bottom: 10px; }
.sortable-ghost { opacity: .35; }
.sortable-chosen { box-shadow: var(--shadow); }

/* ==========================================================================
   PUBLIC SITE
   ========================================================================== */
.site-body { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1 0 auto; width: 100%; }
.site-header { z-index: 800; display: flex; align-items: center; gap: 18px; width: 100%; }
.site-header.sticky { position: sticky; top: 0; }
.site-header .brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none !important; min-width: 0; }
.site-header .brand .app-icon { width: 30px; height: 30px; flex: 0 0 auto; }
.site-header .brand-text { display: flex; flex-direction: column; min-width: 0; }
.site-header .brand-title { font-weight: 800; font-size: 1.1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-header .brand-sub { font-size: .75em; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-nav { display: flex; gap: 4px; align-items: center; flex: 1; flex-wrap: wrap; }
.site-nav.align-right { justify-content: flex-end; } .site-nav.align-center { justify-content: center; } .site-nav.align-left { justify-content: flex-start; }
.site-nav a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 10px; color: inherit; font-weight: 600; font-size: .9em; opacity: .85; text-decoration: none !important; transition: background .15s, opacity .15s; }
.site-nav a:hover, .site-nav a.active { opacity: 1; background: color-mix(in srgb, currentColor 10%, transparent); }
.site-nav a.active { color: var(--accent); }
.site-nav .ico { width: 14px; height: 14px; }
.site-nav a, .nav-folder-btn { white-space: nowrap; }
/* Folders = drop-down menus, sub-folders = side sub-menus */
.nav-folder { position: relative; }
.nav-folder-btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 10px; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 600; font-size: .9em; opacity: .85; cursor: pointer; transition: background .15s, opacity .15s; }
.nav-folder-btn:hover, .nav-folder.open > .nav-folder-btn { opacity: 1; background: color-mix(in srgb, currentColor 10%, transparent); }
.nav-folder-btn.active { color: var(--accent); opacity: 1; }
.site-nav .nav-caret { width: 10px; height: 10px; opacity: .7; transition: transform .2s var(--ease); }
.nav-folder.open > .nav-folder-btn .nav-caret { transform: rotate(180deg); }
.nav-subfolder.open > .nav-folder-btn .nav-caret { transform: none; }
.nav-dropdown { position: absolute; top: calc(100% + 6px); left: 0; min-width: 220px; max-width: 320px; padding: 6px; display: none; flex-direction: column; gap: 2px; z-index: 60;
    /* theme surface layered on the opaque page colour: never see-through, even with translucent theme surfaces */
    background: linear-gradient(var(--surface-color), var(--surface-color)), var(--bg-color); color: var(--text-main);
    border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 1rem; }
.nav-dropdown::before { content: ''; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }   /* hover bridge */
.nav-folder.open > .nav-dropdown { display: flex; animation: popIn .16s var(--ease); }
@media (hover: hover) { .nav-folder:hover > .nav-dropdown { display: flex; } }
.nav-dropdown a, .nav-dropdown .nav-folder-btn { display: flex; width: 100%; justify-content: flex-start; padding: 8px 10px; border-radius: 8px; opacity: 1; font-size: .9rem; }
.nav-dropdown a:hover, .nav-dropdown .nav-folder-btn:hover, .nav-dropdown .nav-folder.open > .nav-folder-btn { background: var(--field-hover); }
.nav-dropdown a span, .nav-dropdown .nav-folder-btn span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.nav-dropdown .nav-ext { width: 10px; height: 10px; opacity: .5; }
.nav-subfolder > .nav-dropdown { top: -7px; left: calc(100% + 6px); }
.nav-subfolder > .nav-dropdown::before { top: 0; bottom: 0; left: -8px; right: auto; width: 8px; height: auto; }
.nav-folder.flip-x > .nav-dropdown { left: auto; right: 0; }
.nav-subfolder.flip-x > .nav-dropdown { right: calc(100% + 6px); }
.nav-subfolder.flip-x > .nav-dropdown::before { left: auto; right: -8px; }
.nav-empty { padding: 8px 10px; color: var(--text-muted); }
.site-footer { width: 100%; }
.site-footer .footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; text-align: left; margin-bottom: 18px; }
.site-footer .footer-nav { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-bottom: 12px; }
.site-footer .footer-nav a { color: inherit; opacity: .8; }
.site-footer .prose p:last-child { margin-bottom: 0; }
.container { width: 100%; padding: 32px 24px; }
.container-read { width: 100%; max-width: 900px; margin: 0 auto; padding: 40px 24px; }
.page-hero { padding: 48px 24px 12px; }
.page-hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -.02em; margin: 0; }
.page-hero p { color: var(--text-muted); margin: 10px 0 0; font-size: 1.05rem; }

/* Blog cards */
.post-grid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 18px; }
.post-card { display: flex; flex-direction: column; overflow: hidden; color: var(--text-main); text-decoration: none !important; transition: transform .25s var(--ease), border-color .2s, box-shadow .25s; }
.post-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 50%, transparent); box-shadow: var(--shadow); }
.post-card .cover { aspect-ratio: 16 / 9; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.post-card .cover.is-empty, .post-list .pl-thumb.is-empty { background: var(--accent-soft); }
.post-card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.post-card:hover .cover img { transform: scale(1.05); }
.post-card .cover .ico { width: 44px; height: 44px; color: var(--accent); opacity: .5; }
.post-card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-card h3 { font-size: 1.1rem; margin: 0; }
.post-card p { color: var(--text-muted); font-size: .9rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card .meta { margin-top: auto; font-size: .78rem; color: var(--text-muted); display: flex; gap: 10px; align-items: center; }
/* Latest posts: list mode */
.post-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.post-list a { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--field); color: var(--text-main); text-decoration: none !important; transition: background .18s, border-color .18s; }
.post-list a:hover { background: var(--field-hover); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.post-list .pl-thumb { flex: 0 0 auto; width: 64px; height: 48px; border-radius: var(--radius-sm); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.post-list .pl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-list .pl-thumb .ico { width: 20px; height: 20px; color: var(--accent); opacity: .6; }
.post-list .pl-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.post-list strong { font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-list .pl-desc { color: var(--text-muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-list .pl-date { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: .78rem; white-space: nowrap; }
@media (max-width: 600px) {
    .post-list a { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 12px; }
    .post-list a:has(.pl-thumb) { grid-template-columns: auto minmax(0, 1fr); }
    .post-list .pl-thumb { grid-row: span 2; align-self: center; }
    .post-list .pl-date { grid-column: -2 / -1; }
}
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--border); color: var(--text-main); padding: 0 10px; text-decoration: none !important; }
.pager a:hover { border-color: var(--accent); } .pager .current { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

/* Article */
.article-head { padding: 56px 24px 20px; max-width: 980px; margin: 0 auto; }
.article-head h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -.02em; margin: 12px 0; }
.article-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--text-muted); font-size: .88rem; align-items: center; }
.article-meta .ico { color: var(--accent); }
.article-cover { width: 100%; max-height: 520px; object-fit: cover; }
.article-body { max-width: 980px; margin: 0 auto; padding: 24px; }
.article-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 980px; margin: 0 auto; padding: 0 24px 24px; }
.article-nav a { padding: 16px; color: var(--text-main); text-decoration: none !important; display: flex; flex-direction: column; gap: 4px; }
.article-nav a small { color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.article-nav a.next { text-align: right; align-items: flex-end; }
.comments { max-width: 980px; margin: 0 auto; padding: 0 24px 48px; }
.comment { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 800; flex: 0 0 auto; text-transform: uppercase; }
.comment .who { font-weight: 700; font-size: .9rem; } .comment .when { color: var(--text-muted); font-size: .78rem; margin-left: 8px; }
.comment .txt { margin-top: 4px; font-size: .94rem; white-space: pre-wrap; word-break: break-word; }

/* Prose (markdown / DIY) */
.prose { font-size: 1.02rem; line-height: 1.75; word-wrap: break-word; }
.prose h1, .prose h2, .prose h3, .prose h4 { margin: 1.6em 0 .6em; scroll-margin-top: 90px; }
.prose h1 { font-size: 2em; } .prose h2 { font-size: 1.55em; } .prose h3 { font-size: 1.25em; }
.prose > :first-child { margin-top: 0; }
.prose img { border-radius: var(--radius); margin: 1em auto; height: auto; }
.prose blockquote { margin: 1.2em 0; padding: .6em 1.2em; border-left: 4px solid var(--accent); background: var(--field); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text-muted); }
.prose pre { background: color-mix(in srgb, #000 40%, var(--bg-color)); color: #e6e6e6; padding: 16px; border-radius: var(--radius); overflow-x: auto; font-size: .86em; border: 1px solid var(--border); }
.prose code { font-size: .88em; padding: .15em .4em; border-radius: 5px; background: var(--field-hover); }
.prose pre code { padding: 0; background: none; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .94em; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.prose th { background: var(--field); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .3em; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose hr { margin: 2em 0; }

/* ==========================================================================
   BLOCKS (home page engine)
   ========================================================================== */
.tb-layout { width: 100%; }
.tb-section { width: 100%; position: relative; }
/* Home: full width but with a gutter so content never touches the screen edges (section style padding overrides it) */
.site-main > .tb-layout > .tb-section { padding: 16px clamp(16px, 2.5vw, 32px); }
.site-main > .tb-layout { padding-bottom: 24px; }
.tb-grid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: var(--gap, 16px); grid-auto-flow: dense; }
.tb-cell { min-width: 0; display: flex; flex-direction: column; gap: var(--gap, 16px); }
.tb-block { min-width: 0; position: relative; }
.tb-block.tb-glass { padding: 20px; }
.tb-group { display: flex; flex-direction: column; gap: var(--gap); }
.tb-group-row { flex-direction: row; flex-wrap: wrap; align-items: stretch; }
.tb-group-row > .tb-block { flex: 1 1 200px; }
.tb-group-grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); }
.tb-title { margin: 0; font-weight: 800; letter-spacing: -.02em; }
h1.tb-title { font-size: clamp(2.2rem, 6vw, 4rem); } h2.tb-title { font-size: clamp(1.6rem, 4vw, 2.6rem); } h3.tb-title { font-size: 1.4rem; }
.tb-subtitle { font-size: 1.15rem; color: var(--text-muted); margin: 0; }
.tb-text { line-height: 1.7; }
.tb-quote { margin: 0; padding: 18px 22px; border-left: 4px solid var(--accent); font-size: 1.15rem; font-style: italic; }
.tb-quote p { margin: 0; } .tb-quote cite { display: block; margin-top: 10px; font-size: .85rem; color: var(--text-muted); font-style: normal; }
.tb-code { margin: 0; padding: 16px; border-radius: var(--radius); background: color-mix(in srgb, #000 40%, var(--bg-color)); color: #e6e6e6; overflow-x: auto; font-size: .85rem; }
.tb-divider { border: 0; border-top: 1px solid var(--border-strong); margin: 8px 0; }
.tb-btn { margin: 4px 0; }
.tb-button { display: flex; } .tb-button[style*="text-align:center"] { justify-content: center; } .tb-button[style*="text-align:right"] { justify-content: flex-end; }
.tb-feature { display: flex; flex-direction: column; gap: 10px; }
.tb-feature-ico { width: 52px; height: 52px; border-radius: 15px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.tb-feature-ico .ico { width: 24px; height: 24px; }
[style*="text-align:center"] > .tb-feature { align-items: center; }
.tb-feature h3 { margin: 0; font-size: 1.1rem; } .tb-feature p { margin: 0; color: var(--text-muted); }
.tb-social { display: flex; gap: 10px; flex-wrap: wrap; }
[style*="text-align:center"] > .tb-social { justify-content: center; }
.tb-social a { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--field); border: 1px solid var(--border); color: var(--text-main); transition: transform .2s var(--ease-spring), background .2s, color .2s; }
.tb-social a:hover { transform: translateY(-3px) scale(1.06); background: var(--accent); color: #fff; }
.tb-social .ico { width: 18px; height: 18px; }
.tb-image { margin: 0; } .tb-image img { width: 100%; border-radius: var(--radius); }
.tb-image figcaption { font-size: .85rem; color: var(--text-muted); margin-top: 8px; text-align: center; }
.tb-empty { display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; min-height: 120px; border: 2px dashed var(--border); border-radius: var(--radius); color: var(--text-muted); }
.tb-empty .ico { width: 30px; height: 30px; opacity: .5; }
.tb-slider { position: relative; overflow: hidden; border-radius: var(--radius); background: transparent; }
.tb-slides, .tb-slide { position: absolute; inset: 0; }
.tb-slide { opacity: 0; transition: opacity .8s var(--ease), transform 6s linear; transform: scale(1.04); }
.tb-slide.active { opacity: 1; transform: scale(1); }
.tb-slide img { width: 100%; height: 100%; object-fit: var(--fit, cover); }
.tb-slider-prev, .tb-slider-next { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); background: rgba(0,0,0,.35); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(10px); z-index: 2; opacity: 0; transition: opacity .2s; }
.tb-slider:hover .tb-slider-prev, .tb-slider:hover .tb-slider-next { opacity: 1; }
.tb-slider-prev { left: 12px; } .tb-slider-next { right: 12px; }
.tb-dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; z-index: 2; }
.tb-dots span { width: 8px; height: 8px; border-radius: 8px; background: rgba(255,255,255,.5); transition: width .3s, background .3s; }
.tb-dots span.active { width: 22px; background: #fff; }
.tb-mosaic { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 8px; grid-auto-flow: dense; }
.tb-mosaic a { display: block; overflow: hidden; border-radius: 10px; aspect-ratio: 1; }
.tb-mosaic a:nth-child(5n+1) { grid-row: span 2; grid-column: span 2; }
.tb-mosaic img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.tb-mosaic a:hover img { transform: scale(1.06); }
.lightbox { position: fixed; inset: 0; z-index: 3200; background: rgba(0,0,0,.88); display: flex; align-items: center; justify-content: center; padding: 24px; animation: fadeIn .2s; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; filter: drop-shadow(0 18px 40px rgba(0,0,0,.45)); animation: popIn .25s var(--ease-spring); }
.tb-ratio { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; }
.tb-ratio iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tb-video { width: 100%; border-radius: var(--radius); background: transparent; }
.tb-iframe { width: 100%; border: 0; border-radius: var(--radius); background: #fff; }
.tb-rss-title { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; margin: 0 0 10px; }
.tb-rss-title .ico { color: var(--accent); }
.tb-rss-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.tb-rss-list a { display: flex; gap: 12px; padding: 10px; border-radius: 10px; color: var(--text-main); text-decoration: none !important; transition: background .15s; }
.tb-rss-list a:hover { background: var(--field); }
.tb-rss-list img { width: 72px; height: 54px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; }
.tb-rss-list strong { display: block; font-size: .94rem; line-height: 1.35; }
.tb-rss-list small { color: var(--text-muted); font-size: .76rem; }
.tb-rss-list p { margin: 4px 0 0; color: var(--text-muted); font-size: .84rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tb-tabs-bar { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 8px; overflow-x: auto; }
.tb-tabs-bar button { border: 0; background: transparent; padding: 10px 14px; cursor: pointer; color: var(--text-muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tb-tabs-bar button.active { color: var(--accent); border-bottom-color: var(--accent); }
.tb-tab-panel { display: none; } .tb-tab-panel.active { display: block; animation: fadeIn .25s; }
.tb-files, .tb-indexof { border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; background: var(--field); display: flex; flex-direction: column; max-height: var(--ix-h, 520px); }
.tb-files > ul, .tb-indexof > .ix-list { overflow: auto; flex: 1 1 auto; min-height: 0; }
.tb-files-head, .ix-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-weight: 700; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tb-files-head .ico, .ix-head .ico { color: var(--accent); }
.tb-files ul, .ix-list { list-style: none; margin: 0; padding: 4px; }
.tb-files li a, .ix-list a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text-main); text-decoration: none !important; font-size: .9rem; }
.tb-files li a:hover, .ix-list a:hover { background: var(--field-hover); }
.tb-files .n, .ix-list .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-files .s, .ix-list .s { color: var(--text-muted); font-size: .78rem; white-space: nowrap; }
.tb-files .dl { opacity: .5; } .tb-files li.muted { padding: 10px; }
.ix-list .ico { color: var(--text-muted); } .ix-list .dir .ico { color: #facc15; }
.ix-crumbs { display: flex; gap: 4px; flex-wrap: wrap; font-weight: 500; font-size: .85rem; }
.ix-crumbs button { border: 0; background: transparent; color: var(--accent); cursor: pointer; padding: 2px 4px; }
.tb-loading { padding: 20px; text-align: center; color: var(--text-muted); }
.tb-countdown { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.tb-countdown div { min-width: 86px; padding: 14px; border-radius: var(--radius); background: var(--field); border: 1px solid var(--border); text-align: center; }
.tb-countdown b { display: block; font-size: 2rem; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.tb-countdown span { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.tb-countdown-label { text-align: center; margin: 10px 0 0; color: var(--text-muted); }
.tb-card { border-radius: var(--radius); overflow: hidden; background: var(--glass); border: 1px solid var(--border); height: 100%; display: flex; flex-direction: column; }
.tb-card-img { aspect-ratio: 16 / 9; overflow: hidden; } .tb-card-img img { width: 100%; height: 100%; object-fit: cover; }
.tb-card-body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; align-items: flex-start; }
.tb-card-body h3 { margin: 0; } .tb-card-body p { margin: 0; color: var(--text-muted); flex: 1; }
.tb-anim { opacity: 0; transition: opacity .8s var(--ease), transform .8s var(--ease); }
.tb-anim-slide { transform: translateY(30px); } .tb-anim-zoom { transform: scale(.92); }
.tb-anim.in { opacity: 1; transform: none; }

/* Splash screen plugin */
.splash { position: fixed; inset: 0; z-index: 5000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: var(--bg-color); color: var(--text-main); transition: opacity .6s var(--ease), visibility .6s; text-align: center; padding: 24px; }
.splash.done { opacity: 0; visibility: hidden; }
.splash .app-icon { width: 84px; height: 84px; animation: popIn .8s var(--ease-spring); }
.splash h1 { font-size: clamp(2rem, 6vw, 3.4rem); margin: 0; font-weight: 800; animation: fadeUp .8s .1s var(--ease) both; }
.splash p { margin: 0; color: var(--text-muted); animation: fadeUp .8s .2s var(--ease) both; }
.splash .bar { width: min(280px, 70vw); height: 4px; border-radius: 4px; background: var(--field-hover); overflow: hidden; margin-top: 10px; }
.splash .bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }

/* ==========================================================================
   AUTH - Immersive login (no block background, branding first)
   ========================================================================== */
.auth-body { min-height: 100vh; overflow: hidden; }
.auth-stage { position: relative; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px 120px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 18px; margin-bottom: 42px; animation: fadeUp .7s var(--ease) both; text-align: center; }
.auth-brand .app-icon { width: clamp(72px, 14vw, 120px); height: clamp(72px, 14vw, 120px); filter: drop-shadow(0 10px 40px color-mix(in srgb, var(--accent) 50%, transparent)); }
.auth-brand h1 { font-size: clamp(2.4rem, 8vw, 4.6rem); font-weight: 800; letter-spacing: -.035em; margin: 0; line-height: 1; }
.auth-brand p { margin: 0; color: var(--text-muted); font-size: 1.02rem; }
.auth-form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 18px; animation: fadeUp .7s .12s var(--ease) both; }
.auth-step-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .16em; color: var(--text-muted); text-align: center; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; }
.auth-step-label .ico { color: var(--accent); }
.auth-dots { display: flex; gap: 8px; justify-content: center; }
.auth-dots span { width: 8px; height: 8px; border-radius: 8px; background: var(--border-strong); transition: width .35s var(--ease), background .3s; }
.auth-dots span.on { width: 26px; background: var(--accent); }
.auth-dots span.done { background: color-mix(in srgb, var(--accent) 55%, transparent); }
.auth-field { position: relative; }
.auth-field input {
    width: 100%; height: 58px; padding: 0 52px 0 4px; background: transparent; border: 0; border-bottom: 2px solid var(--border-strong);
    color: var(--text-main); font: inherit; font-size: 1.25rem; font-weight: 500; outline: none; border-radius: 0; text-align: center;
    transition: border-color .25s;
}
.auth-field input::placeholder { color: color-mix(in srgb, var(--text-main) 35%, transparent); font-weight: 400; }
.auth-field input:focus { border-bottom-color: var(--accent); }
.auth-field input.code { letter-spacing: .45em; font-family: var(--font-code); font-size: 1.5rem; padding-left: 52px; }
.auth-field .go { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 22px color-mix(in srgb, var(--accent) 45%, transparent); transition: transform .2s var(--ease-spring); }
.auth-field .go:hover { transform: translateY(-50%) scale(1.08); }
.auth-field .go .ico { width: 16px; height: 16px; }
.auth-who { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; }
.auth-who .avatar { width: 30px; height: 30px; font-size: .8rem; }
.auth-who button { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-size: .82rem; text-decoration: underline; text-underline-offset: 3px; }
.auth-error { text-align: center; color: var(--danger); font-size: .9rem; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.auth-extra { display: flex; justify-content: center; }
.auth-plain-input input { width: 100%; height: 50px; padding: 0 4px; background: transparent; border: 0; border-bottom: 2px solid var(--border-strong); color: var(--text-main); font: inherit; font-size: 1.05rem; outline: none; transition: border-color .25s; border-radius: 0; }
.auth-plain-input input:focus { border-bottom-color: var(--accent); }
.auth-plain-input select { width: 100%; height: 50px; background: transparent; color: var(--text-main); border: 0; border-bottom: 2px solid var(--border-strong); font: inherit; font-size: 1.05rem; outline: none; }
.auth-plain-input select option { background: var(--bg-color); }
.auth-plain-input label { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--text-muted); font-weight: 700; }
.auth-foot { position: fixed; left: 0; right: 0; bottom: 96px; text-align: center; font-size: .78rem; color: var(--text-muted); }

/* ==========================================================================
   CONTENT EDITOR (posts / pages)
   ========================================================================== */
.editor-shell { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.editor-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.editor-side { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 190px); overflow-y: auto; padding-right: 2px; }
.title-input { width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--border); color: var(--text-main); font: inherit; font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; padding: 6px 0 12px; outline: none; letter-spacing: -.01em; }
.title-input:focus { border-bottom-color: var(--accent); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-height: 60vh; }
.split.single { grid-template-columns: 1fr; }
.pane { min-width: 0; display: flex; flex-direction: column; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; background: var(--glass); }
.pane-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.pane-head .ico { color: var(--accent); }
.pane-body { flex: 1; min-height: 0; overflow: auto; }
.pane-body.preview { padding: 20px; }
.preview-frame { width: 100%; height: 100%; min-height: 60vh; border: 0; background: #fff; }
.CodeMirror { height: 100%; min-height: 60vh; font-family: var(--font-code); font-size: 13.5px; line-height: 1.6; background: transparent; color: var(--text-main); }
.CodeMirror-gutters { background: transparent; border-right: 1px solid var(--border); }
.CodeMirror-linenumber { color: color-mix(in srgb, var(--text-main) 30%, transparent); }
.CodeMirror-cursor { border-left: 2px solid var(--accent); }
.CodeMirror-selected, .CodeMirror-focused .CodeMirror-selected { background: var(--accent-soft) !important; }
.CodeMirror-matchingbracket { color: var(--accent) !important; text-decoration: underline; }
.cm-s-default .cm-header { color: var(--accent); }
.cm-s-default .cm-keyword { color: #c678dd; } .cm-s-default .cm-string { color: #98c379; } .cm-s-default .cm-number { color: #d19a66; }
.cm-s-default .cm-tag { color: #e06c75; } .cm-s-default .cm-attribute { color: #d19a66; } .cm-s-default .cm-property { color: #61afef; }
.cm-s-default .cm-comment { color: #7f848e; font-style: italic; } .cm-s-default .cm-def { color: #61afef; } .cm-s-default .cm-variable-2 { color: #e5c07b; }
.cm-s-default .cm-qualifier, .cm-s-default .cm-builtin { color: #e5c07b; } .cm-s-default .cm-atom { color: #56b6c2; } .cm-s-default .cm-link { color: var(--accent); }
.theme-light .cm-s-default .cm-string { color: #50a14f; } .theme-light .cm-s-default .cm-keyword { color: #a626a4; }
.CodeMirror-hints { background: var(--glass-solid); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--shadow); font-family: var(--font-code); font-size: 12.5px; z-index: 5000; padding: 4px; }
.CodeMirror-hint { color: var(--text-main); border-radius: 5px; padding: 3px 8px; }
li.CodeMirror-hint-active { background: var(--accent); color: #fff; }
.md-textarea { width: 100%; height: 100%; min-height: 60vh; border: 0; background: transparent; color: var(--text-main); padding: 14px; font-family: var(--font-code); font-size: 13.5px; resize: none; outline: none; }

/* DIY rich editor */
.diy-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; background: var(--glass-solid); }
.diy-toolbar .sep { width: 1px; background: var(--border); margin: 4px 4px; }
.diy-toolbar button { width: 34px; height: 34px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text-main); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.diy-toolbar button:hover { background: var(--field-hover); border-color: var(--border); }
.diy-toolbar button.on { background: var(--accent-soft); color: var(--accent); }
.diy-toolbar button .ico { width: 14px; height: 14px; }
.diy-toolbar select { height: 34px; border-radius: 8px; background: var(--field); color: var(--text-main); border: 1px solid var(--border); padding: 0 8px; font: inherit; font-size: .82rem; max-width: 160px; }
.diy-toolbar select option { background: var(--bg-color); }
.diy-area { min-height: 60vh; padding: 24px; outline: none; }
.diy-area:empty::before { content: attr(data-placeholder); color: var(--text-muted); }
.diy-area table { border-collapse: collapse; width: 100%; } .diy-area td, .diy-area th { border: 1px solid var(--border-strong); padding: 6px 10px; min-width: 40px; }

/* ==========================================================================
   BLOCK EDITOR
   ========================================================================== */
.editor-page .admin-main { padding: 0 0 calc(var(--dock-h) + 10px); }
.be { display: grid; grid-template-columns: 250px minmax(0, 1fr) 330px; height: calc(100vh - 64px - var(--dock-h) - 10px); min-height: 520px; }
.be-palette, .be-inspector { overflow-y: auto; border-right: 1px solid var(--border); background: color-mix(in srgb, var(--bg-color) 60%, transparent); padding: 14px; }
.be-inspector { border-right: 0; border-left: 1px solid var(--border); }
.be-canvas { overflow: auto; padding: 22px; position: relative; }
.be-palette h4, .be-inspector h4 { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin: 14px 0 8px; }
.be-palette h4:first-child, .be-inspector h4:first-child { margin-top: 0; }
.be-pal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.be-pal-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px 4px; min-height: 66px; border-radius: 10px; border: 1px solid var(--border); background: var(--field); cursor: grab; font-size: .68rem; font-weight: 600; text-align: center; color: var(--text-main); transition: border-color .15s, transform .12s, background .15s; user-select: none; }
.be-pal-item:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.be-pal-item .ico { width: 18px; height: 18px; color: var(--accent); }
.be-pal-item.disabled { opacity: .4; }
.be-section { position: relative; border: 1px dashed var(--border-strong); border-radius: 14px; padding: 34px 12px 12px; margin-bottom: 16px; transition: border-color .15s; }
.be-section:hover, .be-section.sel { border-color: var(--accent); }
.be-section-bar, .be-cell-bar { position: absolute; display: flex; gap: 2px; align-items: center; z-index: 3; }
.be-section-bar { top: 4px; left: 8px; right: 8px; font-size: .7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.be-section-bar .lbl { margin-right: auto; display: flex; align-items: center; gap: 6px; cursor: grab; }
.be-tool { width: 26px; height: 26px; border: 0; border-radius: 6px; background: transparent; color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.be-tool:hover { background: var(--field-hover); color: var(--text-main); }
.be-tool.danger:hover { background: var(--danger); color: #fff; }
.be-tool .ico { width: 12px; height: 12px; }
.be-grid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 10px; grid-auto-flow: dense; }
.be-cell { position: relative; min-height: 110px; border-radius: 10px; background: color-mix(in srgb, var(--text-main) 3%, transparent); border: 1px solid var(--border); padding: 30px 8px 8px; display: flex; flex-direction: column; gap: 8px; transition: border-color .15s, background .15s; }
.be-cell:hover { border-color: var(--border-strong); }
.be-cell.sel { border-color: var(--accent); background: var(--accent-soft); }
.be-cell-bar { top: 3px; right: 4px; left: 6px; }
.be-cell-bar .lbl { margin-right: auto; font-size: .62rem; color: var(--text-muted); font-weight: 700; cursor: grab; display: flex; align-items: center; gap: 4px; }
.be-drop { flex: 1; min-height: 48px; display: flex; flex-direction: column; gap: 8px; border-radius: 8px; }
.be-drop:empty { border: 2px dashed var(--border); }
.be-drop:empty::after { content: attr(data-empty); margin: auto; font-size: .72rem; color: var(--text-muted); padding: 12px; text-align: center; }
.be-block { position: relative; border-radius: 9px; background: var(--glass-solid); border: 1px solid var(--border); padding: 8px 10px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.be-block:hover { border-color: var(--border-strong); }
.be-block.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.be-block-head { display: flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 700; }
.be-block-head .handle { cursor: grab; color: var(--text-muted); display: flex; }
.be-block-head .handle .ico { width: 12px; height: 12px; }
.be-block-head .t-ico { color: var(--accent); display: flex; } .be-block-head .t-ico .ico { width: 13px; height: 13px; }
.be-block-head .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.be-block-head .acts { display: flex; gap: 1px; opacity: 0; transition: opacity .15s; }
.be-block:hover > .be-block-head .acts, .be-block.sel > .be-block-head .acts { opacity: 1; }
.be-block-sum { font-size: .76rem; color: var(--text-muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.be-block-sum img { max-height: 60px; border-radius: 6px; margin-top: 4px; }
.be-children { margin-top: 8px; padding: 8px; border-radius: 8px; border: 1px dashed var(--border-strong); display: flex; flex-direction: column; gap: 6px; min-height: 44px; }
.be-children.row { flex-direction: row; flex-wrap: wrap; } .be-children.row > .be-block { flex: 1 1 140px; }
.be-children:empty::after { content: attr(data-empty); margin: auto; font-size: .7rem; color: var(--text-muted); }
.be-add-section { width: 100%; padding: 16px; border: 2px dashed var(--border-strong); border-radius: 14px; background: transparent; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; transition: border-color .15s, color .15s, background .15s; }
.be-add-section:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.be-inspector .field { margin-bottom: 10px; }
.be-inspector .field > label { font-size: .68rem; }
.be-inspector .input, .be-inspector .field input, .be-inspector .field select, .be-inspector .field textarea { min-height: 34px; padding: 7px 10px; font-size: .85rem; }
.be-inspector .field textarea { min-height: 90px; }
.be-inspector .field textarea.code { font-family: var(--font-code); font-size: .78rem; min-height: 180px; }
.be-inspector .two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
.be-insp-empty { color: var(--text-muted); font-size: .85rem; text-align: center; padding: 30px 10px; }
.be-insp-empty .ico { width: 34px; height: 34px; opacity: .4; display: block; margin: 0 auto 10px; }
.be-list-item { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.be-list-item .input { flex: 1; min-width: 0; }
.be-list-thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: var(--field); flex: 0 0 auto; }
.be-preview { display: none; }
.be.previewing .be-canvas > .be-edit { display: none; }
.be.previewing .be-preview { display: block; }
.be.previewing .be-preview .tb-anim { opacity: 1; transform: none; }
.be-mobile .be-canvas > * { max-width: 420px; margin-inline: auto; }
.be-panel-toggle { display: none; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1200px) {
    .be { grid-template-columns: 210px minmax(0, 1fr) 290px; }
    .editor-shell { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 1024px) {
    .span-8, .span-6, .span-4, .span-9 { grid-column: span 12; } .span-3 { grid-column: span 6; }
    .post-grid { grid-template-columns: repeat(min(var(--cols, 3), 2), minmax(0, 1fr)); }
    .editor-shell { grid-template-columns: 1fr; }
    .editor-side { position: static; max-height: none; }
    .be { grid-template-columns: minmax(0, 1fr); height: auto; }
    .be-palette, .be-inspector { position: fixed; top: 64px; bottom: calc(var(--dock-h) + 6px); z-index: 950; width: min(330px, 88vw); transform: translateX(-105%); transition: transform .3s var(--ease); border-radius: 0 16px 16px 0; box-shadow: var(--shadow-lg); background: var(--glass-solid); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); }
    .be-inspector { right: 0; left: auto; transform: translateX(105%); border-radius: 16px 0 0 16px; }
    .be-palette.open, .be-inspector.open { transform: none; }
    .be-panel-toggle { display: inline-flex; }
    .be-canvas { min-height: 60vh; }
}
@media (max-width: 768px) {
    :root { --dock-h: 58px; }
    body { font-size: 14.5px; }
    .admin-top { padding: 10px 14px; min-height: 56px; gap: 10px; }
    .admin-top .crumb-sep, .admin-brand span { display: none; }
    .admin-main { padding: 14px 12px calc(var(--dock-h) + 30px); }
    .span-3 { grid-column: span 12; }
    .split { grid-template-columns: 1fr; }
    .tb-grid { grid-template-columns: 1fr; }
    .tb-cell { grid-column: 1 / -1 !important; grid-row: auto !important; }
    .tb-group-grid { grid-template-columns: 1fr; }
    .post-grid { grid-template-columns: 1fr; }
    .tb-mosaic { grid-template-columns: repeat(2, 1fr); }
    .tb-mosaic a:nth-child(5n+1) { grid-column: span 2; }
    .site-header { flex-wrap: wrap; height: auto !important; padding-top: 10px !important; padding-bottom: 10px !important; }
    .site-nav { flex-basis: 100%; flex-wrap: wrap; justify-content: flex-start !important; }
    .nav-dropdown { max-width: calc(100vw - 24px); }
    .nav-subfolder > .nav-dropdown { position: static; display: none; box-shadow: none; border: 0; background: transparent; padding: 0 0 0 14px; min-width: 0; }
    .nav-subfolder.open > .nav-dropdown { display: flex; }
    .nav-subfolder > .nav-folder-btn .nav-caret { transform: rotate(90deg); }
    .article-nav { grid-template-columns: 1fr; }
    .ib { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .ib-cats { flex-direction: row; overflow-x: auto; max-height: none; padding-bottom: 4px; }
    .ib-cats button { white-space: nowrap; }
    .modal.modal-xl { height: calc(100vh - 20px); }
    .modal-backdrop { padding: 10px; }
    .be-grid { grid-template-columns: 1fr; } .be-cell { grid-column: auto !important; grid-row: auto !important; }
    .toasts { top: auto; bottom: calc(var(--dock-h) + 14px); right: 10px; left: 10px; }
    .toast { min-width: 0; max-width: none; }
    .auth-foot { bottom: 70px; }

    /* Dock mobile (DOCK.txt) */
    .dock { left: 0; right: 0; bottom: 0; transform: none; padding: 0 6px; max-width: none; }
    .dock-items { width: 100%; padding: 6px 8px; gap: 2px; border-radius: 14px 14px 0 0; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; justify-content: flex-start; }
    .dock-items::-webkit-scrollbar { display: none; }
    .dock-item { width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; }
    .dock-item .ico { width: 17px; height: 17px; }
    .dock-item:hover { transform: scale(1.1); }
    .dock-item.dock-neighbor-1 { transform: scale(1.05); }
    .dock-item.dock-neighbor-2 { transform: none; }
    .dock-separator { height: 20px; margin: 0 2px; flex-shrink: 0; }
    .dock-item::before { display: none; }
    .dock .dock-search.expanded .search-input { width: 110px; max-width: 110px; height: 34px; padding: 6px 10px; }
    .dock-dropup { bottom: 56px; left: 6px; right: 6px; transform: scale(.95) !important; }
    .dock-dropup.visible { transform: scale(1) !important; }
    .dock-dropup .dropup-panel { width: 100%; max-width: none; max-height: 60vh; padding: 12px; border-radius: 14px; }
    .theme-card { padding: 8px; } .theme-card .theme-name { font-size: .65em; }
    .mosaic { grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); }
}
@media (max-width: 480px) {
    .dock-item { width: 34px; height: 34px; }
    .dock-item .ico { width: 16px; height: 16px; }
    .form-grid { grid-template-columns: 1fr; }
}
.dock-form { display: contents; }

/* ==========================================================================
   AUDIO (plugins): audio block + background music in the dock
   ========================================================================== */

.tb-audio { border-radius: var(--radius); border: 1px solid var(--border); background: var(--glass); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.ta-main { display: flex; gap: 16px; align-items: center; min-width: 0; }
.ta-cover { flex: 0 0 auto; width: 112px; height: 112px; border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.ta-cover img { width: 100%; height: 100%; object-fit: cover; }
.ta-cover.is-empty, .ta-thumb.is-empty, .bga-cover.is-empty { background: var(--accent-soft); color: var(--accent); }
.ta-cover.is-empty .ico { width: 38px; height: 38px; opacity: .7; }
.ta-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ta-title { font-weight: 800; font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ta-artist { color: var(--text-muted); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.2em; }
.ta-controls { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.ta-btn { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: var(--field); color: var(--text-main); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; transition: background .15s, transform .12s; }
.ta-btn:hover { background: var(--field-hover); }
.ta-btn:active { transform: scale(.94); }
.ta-btn .ico { width: 13px; height: 13px; }
.ta-play { width: 42px; height: 42px; background: var(--accent); border-color: transparent; color: var(--accent-text); }
.ta-play:hover { background: var(--accent); filter: brightness(1.1); }
.ta-play .ico { width: 15px; height: 15px; }
.ta-time, .ta-dur { font-family: var(--font-code); font-size: .72rem; color: var(--text-muted); min-width: 34px; text-align: center; }
.ta-seek { -webkit-appearance: none; appearance: none; height: 18px; background: transparent; cursor: pointer; flex: 1 1 auto; min-width: 60px; margin: 0; }
.ta-seek::-webkit-slider-runnable-track, .bga-sliders input::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--accent) var(--p, 0%), color-mix(in srgb, var(--text-main) 18%, transparent) var(--p, 0%)); }
.ta-seek::-moz-range-track, .bga-sliders input::-moz-range-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--accent) var(--p, 0%), color-mix(in srgb, var(--text-main) 18%, transparent) var(--p, 0%)); }
.ta-seek::-webkit-slider-thumb, .bga-sliders input::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4px; border-radius: 50%; background: var(--text-main); border: 0; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.ta-seek::-moz-range-thumb, .bga-sliders input::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--text-main); border: 0; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.tb-audio.compact .ta-cover { width: 64px; height: 64px; }
.tb-audio.compact .ta-title { font-size: .98rem; }
.tb-audio.compact .ta-controls { margin-top: 2px; }
.ta-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 340px; overflow: auto; border-top: 1px solid var(--border); padding-top: 8px; }
.ta-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; border: 0; background: transparent; color: var(--text-main); cursor: pointer; text-align: left; font: inherit; }
.ta-item:hover { background: var(--field-hover); }
.ta-item.active { background: var(--accent-soft); }
.ta-item.active .ta-it-title { color: var(--accent); }
.ta-thumb { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 6px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.ta-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ta-thumb .ico { width: 14px; height: 14px; }
.ta-it-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ta-it-title { font-weight: 600; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ta-it-artist { font-size: .76rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ta-it-dur { font-family: var(--font-code); font-size: .72rem; color: var(--text-muted); }
@media (max-width: 600px) { .ta-cover { width: 76px; height: 76px; } .ta-time, .ta-dur { display: none; } }

/* dock: music button (animated bars while playing) */
.dock-audio { position: relative; }
.dock-audio .eq { position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); display: none; gap: 2px; align-items: flex-end; height: 8px; pointer-events: none; }
.dock-audio .eq i { display: block; width: 2px; height: 3px; border-radius: 1px; background: currentColor; animation: eq 0.9s ease-in-out infinite; }
.dock-audio .eq i:nth-child(2) { animation-delay: -.3s; } .dock-audio .eq i:nth-child(3) { animation-delay: -.6s; }
.dock-audio.playing .eq { display: flex; }
.dock-audio.playing > .ico { transform: translateY(-3px) scale(.86); }
.dock-audio.waiting > .ico { animation: pulseIco 1.6s ease-in-out infinite; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 8px; } }
@keyframes pulseIco { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .dock-audio .eq i { animation: none; height: 6px; } }

/* dock: background music panel (mosaic) */
.bga { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#audioDropup .dropup-panel { width: min(400px, calc(100vw - 24px)); }
.bga .mosaic-tile { min-height: 74px; }
.bga-now { grid-column: 1 / -1; flex-direction: row !important; justify-content: flex-start !important; gap: 14px !important; padding: 10px !important; text-align: left; cursor: default; }
.bga-now:hover { transform: none !important; }
.bga-cover { flex: 0 0 auto; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.bga-cover img { width: 100%; height: 100%; object-fit: cover; }
.bga-meta { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bga-title { font-weight: 800; font-size: .95rem; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bga-artist { font-size: .8rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bga .mosaic-tile.active { border-color: var(--accent); background: var(--accent-soft); }
.bga-sliders { grid-column: 1 / -1; cursor: default; gap: 8px !important; padding: 10px 12px !important; }
.bga-sliders:hover { transform: none !important; }
.bga-row { display: flex; align-items: center; gap: 8px; width: 100%; }
.bga-row .ico { width: 14px !important; height: 14px !important; color: var(--text-muted) !important; flex: 0 0 auto; }
.bga-sliders input { -webkit-appearance: none; appearance: none; height: 18px; background: transparent; cursor: pointer; flex: 1 1 auto; min-width: 0; margin: 0; }
.bga-time, .bga-dur { font-family: var(--font-code); font-size: .7rem; color: var(--text-muted); min-width: 32px; text-align: center; }

/* admin: audio preview (library, plugins page) */
.media-audio { display: flex; gap: 16px; align-items: center; }
.media-audio > img, .media-audio .ma-cover, .media-audio .ma-ph { flex: 0 0 auto; width: 120px; height: 120px; border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; object-fit: cover; }
.media-audio .ma-cover img { width: 100%; height: 100%; object-fit: cover; }
.media-audio .ma-ph, .media-audio .ma-cover.is-empty { background: var(--accent-soft); color: var(--accent); }
.media-audio .ma-ph .ico, .media-audio .ma-cover.is-empty .ico { width: 36px; height: 36px; }
.media-audio > div { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.media-audio strong { font-size: 1.1rem; }
.media-audio span { color: var(--text-muted); font-size: .88rem; }
.media-audio audio { width: 100%; margin-top: 8px; }
.be-list-ico { display: flex; align-items: center; justify-content: center; color: var(--accent); background: var(--accent-soft); }
.be-list-ico .ico { width: 16px; height: 16px; }

/* navigation: image icons (SVG / PNG logos) */
.nav-img { width: 1em; height: 1em; object-fit: contain; flex: 0 0 auto; display: inline-block; vertical-align: -.125em; }
.site-nav .nav-img { width: 16px; height: 16px; }
.mosaic-tile .nav-img { width: 24px; height: 24px; }
.nt-icon .nav-img { width: 16px; height: 16px; }
.nt-icon-prev .nav-img { width: 16px; height: 16px; }
.is-busy { pointer-events: none; opacity: .85; }
.splash-seen .splash { display: none !important; }
