/* ═══════════ Faxama Ticket — OLED · Dark Red · Liquid Glass ═══════════ */
:root {
  --a-rgb: 225, 29, 46;          /* accent (customizable) */
  --a: rgb(var(--a-rgb));
  --a2: color-mix(in srgb, var(--a) 70%, #fff);
  --a-dark: color-mix(in srgb, var(--a) 45%, #000);
  --bg: #000;
  --glass: rgba(18, 18, 20, var(--glass-alpha, .55));
  --glass-2: rgba(28, 28, 32, .6);
  --blur: 22px;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .13);
  --text: #f2f2f4;
  --muted: #8a8a96;
  --dim: #55555f;
  --green: #22c55e;
  --amber: #f59e0b;
  --blue: #3b82f6;
  --cyan: #06b6d4;
  --violet: #8b5cf6;
  --r: 18px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --side-w: 272px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.55 "Segoe UI", Inter, system-ui, -apple-system, Roboto, sans-serif; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--a2); text-decoration: none; }
[hidden] { display: none !important; }
::selection { background: rgba(var(--a-rgb), .45); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(var(--a-rgb), .6); }
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent; }
.ic { width: 18px; height: 18px; flex: none; }
.red { color: var(--a); text-shadow: 0 0 24px rgba(var(--a-rgb), .6); }
.muted { color: var(--muted); }
.mono { font-family: Consolas, "SF Mono", monospace; }

/* ── Liquid background ── */
.fx { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .5; mix-blend-mode: screen; animation: liquid 22s ease-in-out infinite; }
.b1 { width: 46vw; height: 46vw; left: -12vw; top: -18vw; background: radial-gradient(circle, rgba(var(--a-rgb), .55), transparent 65%); }
.b2 { width: 38vw; height: 38vw; right: -10vw; top: 25%; background: radial-gradient(circle, rgba(140, 10, 25, .6), transparent 65%); animation-delay: -7s; }
.b3 { width: 34vw; height: 34vw; left: 30%; bottom: -20vw; background: radial-gradient(circle, rgba(var(--a-rgb), .35), transparent 65%); animation-delay: -14s; }
@keyframes liquid { 0%, 100% { transform: translate(0, 0) scale(1); border-radius: 50%; } 33% { transform: translate(6vw, 4vw) scale(1.12); border-radius: 42% 58% 60% 40%; } 66% { transform: translate(-4vw, 6vw) scale(.92); border-radius: 58% 42% 38% 62%; } }
.gridlines { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 46px 46px; mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 75%); }
.vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 40%, #000 100%); }
body.no-fx .fx .blob { display: none; }

/* ── Liquid glass ── */
.glass { position: relative; background: linear-gradient(160deg, rgba(255,255,255,.065), rgba(255,255,255,.015) 40%, rgba(255,255,255,.01)), var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(170%); -webkit-backdrop-filter: blur(var(--blur)) saturate(170%);
  border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), inset 0 -1px 0 rgba(0,0,0,.4), 0 20px 50px rgba(0,0,0,.55); }
.glass::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.22), rgba(255,255,255,0) 30%, rgba(255,255,255,0) 70%, rgba(var(--a-rgb), .35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }

/* 3D tilt + glare */
[data-tilt] { transform-style: preserve-3d; transition: transform .5s var(--ease), box-shadow .3s; will-change: transform; }
[data-tilt]::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.14), transparent 45%); }
[data-tilt]:hover::after { opacity: 1; }
body.no-tilt [data-tilt] { transform: none !important; }

/* ── Login ── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; perspective: 1200px; }
.login-card { width: min(440px, 100%); border-radius: 28px; padding: 36px 34px 26px; text-align: center; animation: rise .8s var(--ease); }
.logo3d { perspective: 800px; margin: -10px auto 6px; width: 200px; height: 200px; }
.logo3d img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 18px 40px rgba(var(--a-rgb), .55)); animation: spin3d 9s ease-in-out infinite; transform-style: preserve-3d; }
@keyframes spin3d { 0%, 100% { transform: rotateY(-14deg) rotateX(6deg) translateY(0); } 50% { transform: rotateY(14deg) rotateX(-4deg) translateY(-10px); } }
.login-card h1 { margin: 8px 0 4px; font-size: 30px; letter-spacing: -.02em; }
.login-card p { color: var(--muted); margin: 0 0 18px; }
.login-error { color: #ff6b78 !important; min-height: 1.4em; margin: 12px 0 0 !important; }
.login-foot { display: flex; justify-content: center; gap: 16px; font-size: 12px; color: var(--dim); margin-top: 10px; flex-wrap: wrap; }
@keyframes rise { from { opacity: 0; transform: translateY(30px) rotateX(12deg) scale(.96); } }

/* ── Layout ── */
#app { display: flex; min-height: 100vh; }
.sidebar { width: var(--side-w); flex: none; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 16px 12px; border-radius: 0 24px 24px 0; border-left: 0; z-index: 40; transition: width .4s var(--ease), transform .4s var(--ease); }
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 14px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); min-width: 0; }
.brand img { width: 46px; height: 46px; filter: drop-shadow(0 4px 16px rgba(var(--a-rgb), .55)); transition: transform .5s var(--spring); }
.brand:hover img { transform: rotate(-8deg) scale(1.08); }
.brand span { display: flex; flex-direction: column; line-height: 1; white-space: nowrap; }
.brand b { font-size: 18px; letter-spacing: .14em; font-weight: 800; }
.brand small { font-size: 11px; letter-spacing: .5em; color: var(--a); font-weight: 800; margin-top: 4px; }
.guild { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: linear-gradient(120deg, rgba(var(--a-rgb), .16), rgba(255,255,255,.02)); border: 1px solid rgba(var(--a-rgb), .22); margin-bottom: 10px; }
.guild .av { width: 36px; height: 36px; border-radius: 11px; }
.guild div { min-width: 0; }
.guild b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guild small { color: var(--muted); display: flex; align-items: center; gap: 6px; }
.nav { flex: 1; overflow-y: auto; overflow-x: hidden; margin: 0 -4px; padding: 0 4px; }
.group { margin-bottom: 4px; }
.group-head { width: 100%; display: flex; align-items: center; gap: 8px; padding: 12px 10px 6px; background: none; border: 0; color: var(--dim); font: inherit; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
.group-head:hover { color: var(--muted); }
.group-head .chev { margin-left: auto; width: 14px; height: 14px; transition: transform .3s var(--ease); }
.group.closed .chev { transform: rotate(-90deg); }
.group-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .35s var(--ease); }
.group.closed .group-body { grid-template-rows: 0fr; }
.group-body > div { overflow: hidden; display: flex; flex-direction: column; gap: 2px; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; transition: color .2s, background .2s, transform .25s var(--ease); }
.nav a:hover { color: var(--text); background: rgba(255,255,255,.04); transform: translateX(3px); }
.nav a.active { color: #fff; background: linear-gradient(90deg, rgba(var(--a-rgb), .32), rgba(var(--a-rgb), .04)); box-shadow: inset 0 0 0 1px rgba(var(--a-rgb), .25); }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--a); box-shadow: 0 0 16px 2px rgba(var(--a-rgb), .8); }
.nav a.active .ic { color: var(--a); filter: drop-shadow(0 0 6px rgba(var(--a-rgb), .8)); }
.nav .count { margin-left: auto; min-width: 22px; text-align: center; background: var(--a); color: #fff; font-size: 11px; font-weight: 800; border-radius: 99px; padding: 1px 7px; box-shadow: 0 0 12px rgba(var(--a-rgb), .7); }
.live-list { max-height: 230px; overflow-y: auto; }
.live-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--muted); font-size: 13px; transition: background .2s, color .2s; }
.live-item:hover, .live-item.active { background: rgba(255,255,255,.05); color: var(--text); }
.live-item .av { width: 26px; height: 26px; font-size: 11px; }
.live-item .lt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-item i { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px var(--amber); flex: none; }
.live-item i.ok { background: var(--green); box-shadow: 0 0 8px var(--green); }
.live-empty { padding: 8px 12px; color: var(--dim); font-size: 12px; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; margin-top: 8px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--line); cursor: pointer; transition: background .2s; }
.me:hover { background: rgba(255,255,255,.06); }
.me .av { width: 36px; height: 36px; }
.me div { flex: 1; min-width: 0; }
.me b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* collapsed sidebar (desktop only) */
@media (min-width: 901px) {
  body.compact { --side-w: 84px; }
  body.compact .brand span, body.compact .guild div, body.compact .nav a span.lbl, body.compact .nav .count, body.compact .group-head span,
  body.compact .group-head .chev, body.compact .me div, body.compact .me > .ic, body.compact .live-group { display: none; }
  body.compact .nav a { justify-content: center; padding: 12px; }
  body.compact .guild, body.compact .me { justify-content: center; }
  body.compact .side-top { flex-direction: column; }
  body.compact .group.closed .group-body { grid-template-rows: 1fr; }
  body.compact .collapse-btn .ic { transform: rotate(180deg); }
}

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 12px; z-index: 30; margin: 12px 22px 0; display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 18px; border-radius: 18px; }
.crumb { font-weight: 700; display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; }
.crumb span { color: var(--muted); font-weight: 500; }
.clock { margin-left: auto; display: flex; align-items: center; gap: 10px; padding: 6px 14px; border-radius: 12px; background: rgba(0,0,0,.35); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.clock b { font-size: 15px; letter-spacing: .04em; white-space: nowrap; }
.clock small { white-space: nowrap; }
.clock small { color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--text); cursor: pointer; transition: background .2s, transform .2s var(--spring), border-color .2s; flex: none; }
.icon-btn:hover { background: rgba(var(--a-rgb), .15); border-color: rgba(var(--a-rgb), .4); transform: translateY(-2px); }
.icon-btn:active { transform: scale(.92); }
.icon-btn .dotn { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--a); box-shadow: 0 0 10px var(--a); }
.menu-btn { display: none; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 99px; background: rgba(0,0,0,.35); border: 1px solid var(--line); font-size: 12px; color: var(--muted); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: pulse 2s infinite; flex: none; }
.dot.red { background: var(--a); animation-name: pulseR; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
@keyframes pulseR { 0% { box-shadow: 0 0 0 0 rgba(var(--a-rgb), .7); } 70% { box-shadow: 0 0 0 9px rgba(var(--a-rgb), 0); } 100% { box-shadow: 0 0 0 0 rgba(var(--a-rgb), 0); } }
main { padding: 24px 22px 120px; }
.page > * { animation: enter .6s var(--ease) both; }
.page > *:nth-child(2) { animation-delay: .06s; } .page > *:nth-child(3) { animation-delay: .12s; } .page > *:nth-child(4) { animation-delay: .18s; } .page > *:nth-child(5) { animation-delay: .24s; } .page > *:nth-child(6) { animation-delay: .3s; }
@keyframes enter { from { opacity: 0; transform: translateY(18px) rotateX(6deg); filter: blur(4px); } }
body.no-anim *, body.no-anim *::before, body.no-anim *::after { animation-duration: .001s !important; animation-delay: 0s !important; transition-duration: .001s !important; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 28px; letter-spacing: -.02em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Cards ── */
.card { border-radius: var(--r); padding: 20px; margin-bottom: 18px; }
.card h2 { margin: 0; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.card h2 .ic { color: var(--a); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.card.error { color: #ff8a95; border-color: rgba(var(--a-rgb), .5); display: flex; gap: 10px; align-items: center; }
.grid { display: grid; gap: 18px; }
.grid > .card { margin: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.start { align-items: start; }
.empty { color: var(--muted); text-align: center; padding: 30px 10px; }
.empty .big { display: block; font-size: 36px; margin-bottom: 6px; filter: grayscale(.2); }

/* Hero */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; border-radius: 26px; padding: 28px 30px; margin-bottom: 18px; overflow: hidden;
  background: radial-gradient(circle at 90% 20%, rgba(var(--a-rgb), .45), transparent 45%), radial-gradient(circle at 0% 100%, rgba(var(--a-rgb), .18), transparent 50%), linear-gradient(120deg, rgba(25,8,10,.85), rgba(10,10,12,.7)); }
.hero h1 { margin: 6px 0 6px; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.02em; }
.hero p { margin: 0 0 18px; color: #c9c9d1; max-width: 560px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--a2); }
.hero-logo { width: 190px; height: 190px; perspective: 900px; }
.hero-logo img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 20px 40px rgba(var(--a-rgb), .6)); transition: transform .25s ease-out; animation: floaty 6s ease-in-out infinite; }
@keyframes floaty { 50% { translate: 0 -10px; } }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.stat { border-radius: var(--r); padding: 18px 20px; overflow: hidden; }
.stat-top { display: flex; justify-content: space-between; align-items: flex-start; }
.stat span { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat b { display: block; font-size: 34px; line-height: 1.1; margin-top: 8px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); font-size: 12px; }
.stat .bubble { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: rgba(var(--c, var(--a-rgb)), .14); color: rgb(var(--c, var(--a-rgb))); box-shadow: 0 0 24px rgba(var(--c, var(--a-rgb)), .25), inset 0 0 0 1px rgba(var(--c, var(--a-rgb)), .3); }
.stat .bubble .ic { width: 22px; height: 22px; }
.stat .spark { margin-top: 10px; height: 34px; width: 100%; display: block; }
.trend { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: rgba(34,197,94,.12); color: var(--green); margin-left: 6px; }
.trend.down { background: rgba(var(--a-rgb), .14); color: var(--a2); }

.ov-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
.ov-grid > .card { margin: 0; }
.c8 { grid-column: span 8; } .c4 { grid-column: span 4; } .c6 { grid-column: span 6; } .c5 { grid-column: span 5; } .c7 { grid-column: span 7; }

/* Charts */
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.gl { stroke: rgba(255,255,255,.06); stroke-dasharray: 3 5; }
.lbl { fill: var(--dim); font-size: 11px; }
.line { fill: none; stroke: var(--a); stroke-width: 3; stroke-linecap: round; filter: drop-shadow(0 4px 10px rgba(var(--a-rgb), .6)); stroke-dasharray: 3000; stroke-dashoffset: 3000; animation: draw 1.6s var(--ease) forwards; }
.area { opacity: 0; animation: fade 1s .5s forwards; }
.hover-line { stroke: rgba(255,255,255,.25); stroke-dasharray: 4 4; }
.hover-dot { fill: #000; stroke: var(--a); stroke-width: 3; filter: drop-shadow(0 0 8px var(--a)); }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
.tip { position: absolute; pointer-events: none; transform: translate(-50%, -120%); background: #0a0a0c; border: 1px solid var(--line-2); border-radius: 10px; padding: 7px 11px; font-size: 12px; white-space: nowrap; box-shadow: 0 10px 30px rgba(0,0,0,.6); opacity: 0; transition: opacity .15s; }
.tip b { display: block; font-size: 14px; }
.tip.show { opacity: 1; }
.big-num { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.gauge { display: flex; flex-direction: column; align-items: center; }
.gauge svg { width: 100%; max-width: 280px; overflow: visible; }
.gauge path.seg { fill: none; stroke-width: 16; stroke-linecap: round; stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw 1.4s var(--ease) forwards; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; width: 100%; margin-top: 10px; }
.legend div { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); min-width: 0; }
.legend div span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.legend b { margin-left: auto; color: var(--text); }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding-left: 28px; position: relative; }
.bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .stack { width: 100%; max-width: 38px; position: relative; border-radius: 8px 8px 4px 4px; background: rgba(var(--a-rgb), .18); overflow: hidden; transform-origin: bottom; animation: growY .9s var(--ease) both; min-height: 4px; }
.bars .stack i { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(var(--a2), var(--a)); border-radius: 6px 6px 4px 4px; box-shadow: 0 0 18px rgba(var(--a-rgb), .5); }
.bars small { color: var(--dim); font-size: 11px; }
@keyframes growY { from { transform: scaleY(0); } }
.keys { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.keys span { display: inline-flex; gap: 6px; align-items: center; }
.keys i { width: 9px; height: 9px; border-radius: 3px; }

/* Lists */
.list { display: flex; flex-direction: column; gap: 6px; }
.li { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.02); border: 1px solid transparent; transition: background .2s, border-color .2s, transform .3s var(--ease); }
.li:hover { background: rgba(255,255,255,.045); border-color: var(--line); transform: translateX(4px); }
.li .grow { flex: 1; min-width: 0; }
.li .grow b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .grow small { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .date { width: 74px; flex: none; font-size: 12px; font-weight: 700; }
.li .date small { display: block; color: var(--dim); font-weight: 500; }
.li.bar { padding-left: 18px; }
.li.bar::before { content: ""; position: absolute; left: 6px; top: 10px; bottom: 10px; width: 4px; border-radius: 4px; background: var(--bc, var(--a)); box-shadow: 0 0 10px var(--bc, var(--a)); }
.av { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; flex: none !important; object-fit: cover; background: #222; box-shadow: 0 0 0 2px rgba(255,255,255,.06); }
.medal { width: 26px; text-align: center; font-size: 18px; flex: none; }
.rbar { height: 6px; background: rgba(255,255,255,.07); border-radius: 9px; overflow: hidden; margin-top: 6px; }
.rbar i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--a-dark), var(--a)); box-shadow: 0 0 10px rgba(var(--a-rgb), .6); transform-origin: left; animation: growX 1.1s var(--ease) both; }
@keyframes growX { from { transform: scaleX(0); } }
.review { padding: 14px; border-radius: 14px; background: rgba(255,255,255,.025); border: 1px solid var(--line); }
.review p { margin: 6px 0 0; color: #cfcfd6; white-space: pre-wrap; word-break: break-word; }
.review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; }
.badge.open { background: rgba(34,197,94,.1); color: #4ade80; border-color: rgba(34,197,94,.25); }
.badge.closed { background: rgba(255,255,255,.05); color: var(--muted); border-color: var(--line); }
.badge.wait { background: rgba(245,158,11,.1); color: #fbbf24; border-color: rgba(245,158,11,.25); }
.badge.claimed, .badge.admin { background: rgba(var(--a-rgb), .12); color: var(--a2); border-color: rgba(var(--a-rgb), .3); }
.badge.staff { background: rgba(6,182,212,.1); color: #22d3ee; border-color: rgba(6,182,212,.25); }
.badge.plain::before { display: none; }
.stars { color: #fbbf24; letter-spacing: 1px; text-shadow: 0 0 10px rgba(251,191,36,.4); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
th { text-align: left; padding: 4px 14px; color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; white-space: nowrap; }
td { padding: 11px 14px; background: rgba(255,255,255,.025); white-space: nowrap; transition: background .2s; border-top: 1px solid transparent; border-bottom: 1px solid transparent; }
td:first-child { border-radius: 12px 0 0 12px; } td:last-child { border-radius: 0 12px 12px 0; }
tbody tr { animation: enter .45s var(--ease) both; }
tr:hover td { background: rgba(var(--a-rgb), .07); border-color: rgba(var(--a-rgb), .14); }
td.wrap { white-space: normal; max-width: 420px; word-break: break-word; }
.who { display: flex; align-items: center; gap: 10px; }
.who .av { width: 30px; height: 30px; font-size: 12px; }
.when b { display: block; font-weight: 600; } .when small { color: var(--dim); }
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 10px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.search { position: relative; flex: 1; min-width: 200px; }
.search .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-left: 40px !important; }
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 13px; background: rgba(0,0,0,.45); border: 1px solid var(--line); }
.seg button { position: relative; background: none; border: 0; color: var(--muted); font: inherit; font-weight: 700; font-size: 13px; padding: 7px 14px; border-radius: 10px; cursor: pointer; transition: color .2s, background .25s; }
.seg button.on { color: #fff; background: linear-gradient(135deg, var(--a), var(--a-dark)); box-shadow: 0 6px 20px rgba(var(--a-rgb), .45); }
.seg button:hover:not(.on) { color: var(--text); }
.chip-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-filter button { background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--muted); font: inherit; font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 99px; cursor: pointer; transition: all .2s; }
.chip-filter button.on { background: rgba(var(--a-rgb), .18); color: #fff; border-color: rgba(var(--a-rgb), .5); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field > span { font-weight: 700; font-size: 13px; }
.field small { color: var(--muted); font-size: 12px; }
input[type=text], input[type=number], input[type=search], select, textarea {
  width: 100%; background: rgba(0,0,0,.5); color: var(--text); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 13px; font: inherit; transition: border-color .2s, box-shadow .25s, background .2s; }
textarea { resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: rgba(255,255,255,.22); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--a); box-shadow: 0 0 0 4px rgba(var(--a-rgb), .2), 0 0 24px rgba(var(--a-rgb), .2); }
select { appearance: none; cursor: pointer; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a96' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
select option { background: #111; }
input[type=range] { width: 100%; accent-color: var(--a); }
.color-field { display: flex; align-items: center; gap: 10px; }
input[type=color] { width: 48px; height: 42px; border: 1px solid var(--line-2); background: none; border-radius: 12px; padding: 4px; cursor: pointer; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 1; }
.row > .btn, .row > .seg, .row > .icon-btn { flex: none; }
.toggle { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.025); border: 1px solid var(--line); margin-bottom: 10px; cursor: pointer; user-select: none; transition: background .2s, border-color .2s; }
.toggle:hover { background: rgba(255,255,255,.05); }
.toggle input { display: none; }
.toggle .slider { width: 46px; height: 26px; background: rgba(255,255,255,.1); border-radius: 99px; position: relative; transition: background .3s; flex: none; box-shadow: inset 0 1px 3px rgba(0,0,0,.5); }
.toggle .slider::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: transform .45s var(--spring); box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.toggle input:checked + .slider { background: linear-gradient(90deg, var(--a-dark), var(--a)); box-shadow: 0 0 16px rgba(var(--a-rgb), .5); }
.toggle input:checked + .slider::after { transform: translateX(20px); }
.toggle .t-text b { display: block; font-weight: 700; }
.toggle .t-text small { color: var(--muted); }
.toggle.bare { padding: 0; background: none; border: 0; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.picker .chips { margin-bottom: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.05); border: 1px solid var(--line-2); border-radius: 99px; padding: 4px 8px 4px 10px; font-size: 12px; font-weight: 600; animation: pop .3s var(--spring); }
.chip i { width: 9px; height: 9px; border-radius: 50%; }
.chip button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }
.chip button:hover { color: var(--a); }
@keyframes pop { from { opacity: 0; transform: scale(.85); } }
.sec { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.sec .bubble { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(var(--a-rgb), .14); color: var(--a); box-shadow: inset 0 0 0 1px rgba(var(--a-rgb), .3), 0 0 20px rgba(var(--a-rgb), .2); flex: none; }
.sec h2 { margin: 0; font-size: 15px; }
.sec p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }

/* Buttons */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255,255,255,.05); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; overflow: hidden; isolation: isolate;
  transition: transform .25s var(--spring), box-shadow .3s, border-color .2s, background .2s, filter .2s; }
.btn::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.18) 50%, transparent 70%); transform: translateX(-120%); transition: transform .7s var(--ease); }
.btn:hover::after { transform: translateX(120%); }
.btn:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.25); }
.btn:active { transform: translateY(0) scale(.96); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: linear-gradient(135deg, var(--a2) -30%, var(--a) 45%, var(--a-dark)); border-color: rgba(255,255,255,.12); color: #fff; box-shadow: 0 10px 26px rgba(var(--a-rgb), .4), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-primary:hover { box-shadow: 0 14px 34px rgba(var(--a-rgb), .6), inset 0 1px 0 rgba(255,255,255,.3); }
.btn-ghost { background: rgba(255,255,255,.04); backdrop-filter: blur(10px); }
.btn-danger { background: rgba(var(--a-rgb), .12); border-color: rgba(var(--a-rgb), .4); color: var(--a2); }
.btn-danger:hover { background: rgba(var(--a-rgb), .25); }
.btn-success { background: linear-gradient(135deg, #34d399, #15803d); border-color: transparent; color: #fff; box-shadow: 0 10px 26px rgba(34,197,94,.3); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn-sm .ic { width: 15px; height: 15px; }
.btn-lg { padding: 14px 22px; font-size: 15px; width: 100%; border-radius: 14px; }
.btn-icon { width: 34px; height: 34px; padding: 0; }
.btn-icon.danger:hover { color: var(--a); border-color: rgba(var(--a-rgb), .5); }
.btn-discord { background: #5865f2; color: #fff; border: 0; box-shadow: 0 12px 30px rgba(88,101,242,.45); }
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading::before { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Dropdown menu */
.dropdown { position: fixed; z-index: 90; min-width: 240px; max-width: 340px; border-radius: 16px; padding: 6px; animation: drop .25s var(--ease); max-height: 70vh; overflow-y: auto; }
@keyframes drop { from { opacity: 0; transform: translateY(-8px) scale(.97); } }
.dd-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px; background: none; border: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: background .15s; }
.dd-item:hover { background: rgba(var(--a-rgb), .14); }
.dd-item small { display: block; color: var(--muted); font-size: 12px; }
.dd-item.danger { color: var(--a2); }
.dd-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.dd-title { padding: 8px 12px 4px; font-size: 11px; font-weight: 800; letter-spacing: .12em; color: var(--dim); text-transform: uppercase; }

/* Categories */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.cat-card { border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.cat-card.off { opacity: .5; filter: saturate(.3); }
.cat-top { display: flex; gap: 14px; align-items: center; }
.cat-emoji { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 28px; flex: none; background: radial-gradient(circle at 30% 20%, rgba(var(--a-rgb), .45), rgba(var(--a-rgb), .08)); box-shadow: inset 0 0 0 1px rgba(var(--a-rgb), .35), 0 10px 26px rgba(var(--a-rgb), .25); transform: translateZ(30px); }
.cat-top b { font-size: 16px; display: block; }
.cat-top p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.cat-meta { display: flex; gap: 14px; color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.cat-actions { display: flex; gap: 8px; align-items: center; margin-top: auto; }
.cat-actions .toggle { margin-right: auto; }
.cat-new { min-height: 200px; border-radius: var(--r); border: 2px dashed rgba(var(--a-rgb), .3); background: rgba(var(--a-rgb), .03); color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; transition: all .3s var(--ease); }
.cat-new:hover { border-color: var(--a); color: #fff; background: rgba(var(--a-rgb), .1); transform: translateY(-4px); }
.cat-new span { display: block; font-size: 34px; color: var(--a); }
.q-row { display: grid; grid-template-columns: 1.3fr 1.3fr 120px 80px 34px; gap: 8px; align-items: center; margin-bottom: 8px; animation: enter .3s var(--ease); }

/* Discord preview (3D) */
.preview-stage { perspective: 1400px; }
.preview { background: #313338; border-radius: 14px; padding: 16px; font-family: "gg sans", "Segoe UI", sans-serif; transform: rotateX(var(--rx, 8deg)) rotateY(var(--ry, -10deg)); transform-style: preserve-3d; transition: transform .4s var(--ease); box-shadow: 0 40px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.06); }
.preview-stage:hover .preview { --rx: 0deg; --ry: 0deg; }
.d-msg { display: flex; gap: 14px; }
.d-msg > img { width: 40px; height: 40px; border-radius: 50%; }
.d-name { font-weight: 600; color: #fff; display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.d-name em { font-style: normal; background: #5865f2; font-size: 10px; padding: 1px 5px; border-radius: 4px; }
.d-embed { background: #2b2d31; border-left: 4px solid var(--a); border-radius: 4px; padding: 12px 16px; max-width: 480px; color: #dbdee1; }
.d-embed h4 { margin: 0 0 6px; color: #fff; }
.d-embed .desc { white-space: pre-wrap; font-size: 14px; }
.d-embed img.big { max-width: 100%; border-radius: 4px; margin-top: 10px; }
.d-embed .thumb { float: right; width: 70px; height: 70px; border-radius: 4px; margin-left: 10px; object-fit: cover; }
.d-embed .foot { font-size: 12px; color: #949ba4; margin-top: 8px; clear: both; }
.d-select { margin-top: 8px; max-width: 480px; background: #1e1f22; border-radius: 4px; padding: 10px 12px; color: #949ba4; display: flex; justify-content: space-between; }
.d-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.d-btn { padding: 6px 14px; border-radius: 4px; color: #fff; font-size: 14px; background: #4e5058; }
.d-btn.primary { background: #5865f2; } .d-btn.success { background: #248046; } .d-btn.danger { background: #da373c; }
.sticky { position: sticky; top: 96px; }

/* ── Live chat ── */
.chat-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr) 300px; gap: 16px; height: calc(100vh - 150px); min-height: 520px; }
.chat-list, .chat-main, .chat-info { border-radius: var(--r); display: flex; flex-direction: column; min-height: 0; margin: 0; }
.chat-list { padding: 14px; }
.chat-list .search { flex: none; }
.chat-list .scroll { overflow-y: auto; flex: 1; margin: 10px -6px 0; padding: 0 6px; display: flex; flex-direction: column; gap: 4px; }
.chat-list a { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; color: var(--text); border: 1px solid transparent; transition: background .2s, border-color .2s; }
.chat-list a:hover { background: rgba(255,255,255,.04); }
.chat-list a.active { background: rgba(var(--a-rgb), .14); border-color: rgba(var(--a-rgb), .35); }
.chat-list a div { flex: 1; min-width: 0; }
.chat-list a b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list a small { color: var(--muted); font-size: 12px; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.chat-head .grow { flex: 1; min-width: 0; }
.chat-head b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head small { color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .btn { flex: none; }
.msgs { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; scroll-behavior: smooth; }
/* chat bubbles */
.msg { display: flex; gap: 10px; align-items: flex-end; margin-top: 14px; animation: msgIn .35s var(--ease); }
.msg.cont { margin-top: 3px; }
.msg.right { flex-direction: row-reverse; }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.m-av { width: 34px; flex: none; }
.m-av .av { width: 34px; height: 34px; font-size: 13px; }
.m-col { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; max-width: min(74%, 640px); }
.msg.right .m-col { align-items: flex-end; }
.m-head { display: flex; align-items: center; gap: 6px; padding: 0 6px; font-size: 12px; }
.m-head b { font-weight: 700; }
.m-tag { background: rgba(var(--a-rgb), .18); color: var(--a2); font-size: 9px; font-weight: 800; letter-spacing: .08em; padding: 2px 6px; border-radius: 5px; }
.bubble-m { padding: 9px 14px 6px; border-radius: 18px 18px 18px 6px; background: rgba(255,255,255,.07); border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(0,0,0,.25); min-width: 70px; max-width: 100%; }
.msg.right .bubble-m { border-radius: 18px 18px 6px 18px; background: linear-gradient(135deg, var(--a2) -40%, var(--a) 40%, var(--a-dark)); border-color: rgba(255,255,255,.12); box-shadow: 0 6px 20px rgba(var(--a-rgb), .3); }
.msg.cont.left .bubble-m { border-top-left-radius: 6px; }
.msg.cont.right .bubble-m { border-top-right-radius: 6px; }
.msg.right .m-text { color: #fff; }
.msg.right .mention { background: rgba(255,255,255,.22); color: #fff; }
.msg.right .m-text a { color: #fff; text-decoration: underline; }
.m-time { display: block; text-align: right; font-size: 10.5px; color: var(--dim); margin-top: 3px; white-space: nowrap; }
.msg.right .m-time { color: rgba(255,255,255,.75); }
.m-time.solo { padding: 0 6px; margin: 0; }
.msg.sys { flex-direction: column; align-items: center; gap: 6px; margin: 18px auto 6px; width: 100%; }
.msg.sys .m-embed { width: min(100%, 560px); max-width: 560px; }
.sys-head { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.sys-head .av { width: 20px; height: 20px; font-size: 9px; }
.sys-head small { color: var(--dim); }
.sys-text { font-size: 13px; color: var(--muted); text-align: center; }
.m-bot { background: #5865f2; color: #fff; font-size: 9px; font-weight: 800; padding: 1px 5px; border-radius: 4px; letter-spacing: .05em; }
.m-text { white-space: pre-wrap; word-break: break-word; color: #dcdce2; }
.m-text code { background: rgba(255,255,255,.08); padding: 1px 5px; border-radius: 5px; font-size: 13px; }
.m-text pre { background: rgba(0,0,0,.5); border: 1px solid var(--line); padding: 10px; border-radius: 10px; white-space: pre-wrap; margin: 4px 0; }
.mention { background: rgba(var(--a-rgb), .2); color: var(--a2); padding: 0 3px; border-radius: 4px; font-weight: 600; }
.m-embed { margin-top: 6px; max-width: 520px; background: rgba(255,255,255,.035); border: 1px solid var(--line); border-left: 4px solid var(--ec, var(--a)); border-radius: 8px; padding: 10px 14px; font-size: 13px; }
.m-embed .e-author { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12px; margin-bottom: 4px; }
.m-embed .e-author img { width: 18px; height: 18px; border-radius: 50%; }
.m-embed .e-title { font-weight: 800; margin-bottom: 4px; }
.m-embed .e-desc { white-space: pre-wrap; color: #cfcfd6; word-break: break-word; }
.m-embed .e-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px 12px; margin-top: 8px; }
.m-embed .e-fields b { display: block; font-size: 12px; }
.m-embed .e-foot { color: var(--dim); font-size: 11px; margin-top: 6px; }
.m-att img { max-width: 320px; max-height: 260px; border-radius: 10px; margin-top: 6px; display: block; border: 1px solid var(--line); }
.m-att a.file { display: inline-flex; gap: 8px; align-items: center; margin-top: 6px; padding: 8px 12px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.day-sep { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: 11px; font-weight: 700; margin: 12px 0 6px; text-transform: uppercase; letter-spacing: .1em; }
.day-sep::before, .day-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.composer { display: flex; gap: 10px; align-items: flex-end; padding: 12px 14px; border-top: 1px solid var(--line); }
.composer textarea { min-height: 46px; max-height: 160px; resize: none; border-radius: 14px; }
.composer .btn { height: 46px; }
.chat-closed { padding: 16px; text-align: center; color: var(--muted); border-top: 1px solid var(--line); }
.chat-info { padding: 18px; overflow-y: auto; }
.chat-info .kv { margin-top: 12px; }
.typing-hint { font-size: 11px; color: var(--dim); padding: 0 16px 8px; }
.chat-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 30px; }
.chat-empty img { width: 140px; opacity: .9; filter: drop-shadow(0 10px 30px rgba(var(--a-rgb), .5)); animation: floaty 5s ease-in-out infinite; }

/* KV / drawer details */
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 10px 14px; padding: 16px; border-radius: 14px; background: rgba(255,255,255,.025); border: 1px solid var(--line); font-size: 13px; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; word-break: break-word; }
.answer { padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.025); border-left: 3px solid var(--a); margin-top: 10px; }
.answer span { font-size: 12px; color: var(--muted); font-weight: 700; }
.answer p { margin: 4px 0 0; white-space: pre-wrap; word-break: break-word; }

/* Team */
.callout { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; border-radius: 18px; margin-bottom: 18px; background: linear-gradient(120deg, rgba(var(--a-rgb), .14), rgba(255,255,255,.02)); border: 1px solid rgba(var(--a-rgb), .3); }
.callout .ic { width: 24px; height: 24px; color: var(--a); margin-top: 2px; }
.callout ul { margin: 6px 0 4px; padding-left: 18px; color: #cfcfd6; }
.level { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.025); margin-bottom: 10px; }
.level ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); }

/* Audit timeline */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 4px; bottom: 4px; width: 2px; background: linear-gradient(var(--a), transparent); opacity: .5; }
.t-day { margin: 18px 0 8px -26px; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.t-day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.t-item { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; transition: background .2s; animation: enter .4s var(--ease) both; }
.t-item:hover { background: rgba(255,255,255,.03); }
.t-item::before { content: ""; position: absolute; left: -21px; top: 18px; width: 10px; height: 10px; border-radius: 50%; background: var(--tc, var(--a)); box-shadow: 0 0 10px var(--tc, var(--a)); }
.t-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.04); border: 1px solid var(--line); flex: none; font-size: 16px; }
.t-item .grow { flex: 1; min-width: 0; }
.t-item .grow b { font-weight: 700; }
.t-item .grow p { margin: 2px 0 0; color: var(--muted); font-size: 13px; word-break: break-word; }
.t-item time { color: var(--dim); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Customizer */
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 40px; height: 40px; border-radius: 12px; border: 2px solid transparent; cursor: pointer; transition: transform .25s var(--spring), border-color .2s; box-shadow: 0 6px 18px rgba(0,0,0,.5); }
.swatch:hover { transform: scale(1.1) rotate(-4deg); }
.swatch.on { border-color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.15), 0 0 20px currentColor; }

/* Modal / drawer */
dialog { color: var(--text); border: 1px solid var(--line-2); border-radius: 24px; padding: 0; width: min(860px, 94vw); max-height: 90vh; background: rgba(12,12,14,.92); backdrop-filter: blur(30px) saturate(160%); box-shadow: 0 40px 120px rgba(0,0,0,.8), 0 0 0 1px rgba(var(--a-rgb), .12); }
dialog[open] { animation: modalIn .4s var(--spring); }
dialog::backdrop { background: rgba(0,0,0,.7); backdrop-filter: blur(6px); }
dialog.drawer { margin: 0 0 0 auto; inset: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(520px, 100vw); max-width: 100vw; border-radius: 24px 0 0 24px; overflow-x: hidden; overflow-y: auto; }
dialog.drawer[open] { animation: slideIn .45s var(--ease); }
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(.95); } }
@keyframes slideIn { from { transform: translateX(100%); } }
#modal-body { padding: 24px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 18px; }
.modal-head h2 { margin: 0; font-size: 20px; }

/* Save bar / toasts */
.savebar { position: fixed; left: 50%; bottom: 24px; z-index: 70; display: flex; justify-content: space-between; align-items: center; gap: 20px; width: min(720px, calc(100vw - 32px)); padding: 10px 10px 10px 20px; border-radius: 16px;
  transform: translate(-50%, 160px); opacity: 0; visibility: hidden; pointer-events: none; transition: transform .5s var(--spring), opacity .3s, visibility .3s; }
.savebar.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; pointer-events: auto; }
.savebar.shake { animation: shake .45s; border-color: rgba(var(--a-rgb), .8); background: rgba(70,8,14,.85); }
.savebar div { display: flex; gap: 8px; }
@keyframes shake { 20%, 60% { transform: translate(calc(-50% - 9px), 0); } 40%, 80% { transform: translate(calc(-50% + 9px), 0); } }
#toasts { position: fixed; top: 16px; right: 16px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
#toasts[popover] { inset: 16px 16px auto auto; margin: 0; padding: 0; border: 0; background: transparent; overflow: visible; color: var(--text); }
#toasts[popover]:not(:popover-open) { display: none; }
.toast { display: flex; gap: 10px; align-items: center; max-width: 380px; padding: 12px 16px; border-radius: 14px; background: rgba(14,14,16,.92); backdrop-filter: blur(16px); border: 1px solid var(--line-2); box-shadow: 0 20px 50px rgba(0,0,0,.6); animation: toastIn .5s var(--spring); }
.toast .ic { color: var(--green); }
.toast.err { border-color: rgba(var(--a-rgb), .5); } .toast.err .ic { color: var(--a); }
.toast.live { border-color: rgba(var(--a-rgb), .4); } .toast.live .ic { color: var(--a); }
.toast.out { animation: toastOut .3s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(60px) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(60px); } }

/* Skeleton */
.sk { border-radius: var(--r); background: linear-gradient(90deg, rgba(255,255,255,.03) 25%, rgba(255,255,255,.07) 50%, rgba(255,255,255,.03) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Mobile tab bar */
.tabbar { display: none; }

@media (max-width: 1280px) {
  .chat-layout { grid-template-columns: 260px minmax(0, 1fr); }
  .chat-info { display: none; }
  .chat-layout.show-info .chat-info { display: flex; position: fixed; right: 12px; top: 90px; bottom: 90px; width: min(340px, 92vw); z-index: 50; }
}
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .c8, .c4, .c6, .c5, .c7 { grid-column: span 12; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-105%); width: 280px !important; }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 35; background: rgba(0,0,0,.6); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .3s; }
  .scrim.show { opacity: 1; pointer-events: auto; }
  .menu-btn { display: inline-grid; }
  .collapse-btn { display: none; }
  .topbar { margin: 10px 12px 0; }
  .clock small, .top-actions .pill, .crumb span { display: none; }
  main { padding: 18px 12px 110px; }
  .g2, .g3, .review-grid { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero p { margin-inline: auto; }
  .hero .actions { justify-content: center; }
  .hero-logo { width: 140px; height: 140px; margin: 0 auto; grid-row: 1; }
  .q-row { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .chat-layout { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 190px); }
  .chat-head { padding: 12px; gap: 8px; }
  .m-att img { max-width: 100%; }
  .eyebrow { flex-wrap: wrap; justify-content: center; }
  .chat-layout.has-ticket .chat-list { display: none; }
  .chat-layout:not(.has-ticket) .chat-main { display: none; }
  .tabbar { display: flex; position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 45; border-radius: 20px; padding: 6px; justify-content: space-around; }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 4px; border-radius: 14px; color: var(--muted); font: inherit; font-size: 10px; font-weight: 700; background: none; border: 0; cursor: pointer; position: relative; }
  .tabbar .active { color: #fff; background: rgba(var(--a-rgb), .2); }
  .tabbar .active .ic { color: var(--a); filter: drop-shadow(0 0 6px var(--a)); }
  .tabbar .count { position: absolute; top: 2px; right: calc(50% - 20px); background: var(--a); color: #fff; font-size: 9px; border-radius: 99px; padding: 0 5px; }
  .savebar { bottom: 90px; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat b { font-size: 26px; }
  .stat .bubble { width: 36px; height: 36px; }
  .kv { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 22px; }
  .clock { padding: 6px 10px; }
  .clock .ic { display: none; }
  .clock b { font-size: 13px; }
  .crumb { font-size: 14px; }
  .hide-sm { display: none; }
  .topbar { gap: 8px; padding: 8px; }
  .legend { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}
