/* Бьёрн Контроль — светлая Material-тема в стиле шаблона «Materially» (CodedThemes/MUI).
   Roboto, синий primary #2196f3 + фиолетовый secondary, мягкие тени, скруглённые карточки.
   Тёмная тема сохранена как [data-theme="dark"]. Классы не менялись — все страницы работают. */
:root{
  --bg:#eef2f6; --surface:#ffffff; --surface-2:#f6f9fc; --surface-3:#eef2f7;
  --border:#e7ecf3; --border-2:#dbe2ec;
  --text:#364152; --muted:#647184; --muted-2:#9aa4b2;
  --primary:#2196f3; --primary-2:#1e88e5;
  --accent:#673ab7; --accent-2:#5e35b1;
  --green:#00c853; --amber:#ffab00; --red:#f44336; --cyan:#00bcd4; --violet:#7c4dff;
  --ring:rgba(33,150,243,.28);
  --r:12px; --r-sm:8px;
  --shadow:0 2px 14px rgba(32,40,45,.08);
  --shadow-lg:0 10px 30px rgba(32,40,45,.16);
  --card:var(--surface); --panel:var(--surface-2);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg); color:var(--text);
  font-family:'Roboto',system-ui,-apple-system,Segoe UI,Helvetica,Arial,sans-serif;
  font-size:14.5px; line-height:1.5; -webkit-font-smoothing:antialiased;
}
h1,h2,h3{font-family:'Roboto',system-ui,sans-serif;font-weight:600;letter-spacing:.1px}
.mono{font-family:'Roboto Mono',ui-monospace,Menlo,monospace}
a{color:var(--primary-2);text-decoration:none}
a:hover{text-decoration:underline}
.num{font-variant-numeric:tabular-nums}

/* ── Layout ── */
.app{display:flex;min-height:100vh}
.sidebar{
  width:250px;flex:0 0 250px;background:var(--surface);border-right:1px solid var(--border);
  padding:18px 16px;position:sticky;top:0;height:100vh;overflow-y:auto;
}
.brand{display:flex;align-items:center;gap:11px;padding:4px 8px 20px;font-weight:700;font-size:19px;color:#1e2532}
.brand .logo{width:34px;height:34px;border-radius:9px;background:linear-gradient(135deg,#42a5f5,#1565c0);display:flex;align-items:center;justify-content:center;color:#fff;font-size:15px;box-shadow:0 4px 12px rgba(33,150,243,.4)}
.nav{display:flex;flex-direction:column;gap:2px}
.nav a{
  display:flex;align-items:center;gap:12px;padding:11px 14px;border-radius:10px;
  color:var(--muted);font-weight:500;font-size:14.5px;transition:background .16s,color .16s;cursor:pointer;
}
.nav a:hover{background:var(--surface-3);color:var(--text);text-decoration:none}
.nav a.active{background:#e3f2fd;color:var(--primary-2);font-weight:600}
.nav a.active svg{color:var(--primary-2)}
.nav svg{width:18px;height:18px;flex:0 0 18px;color:var(--muted-2)}
.nav a:hover svg{color:var(--muted)}
.nav .sep{height:1px;background:var(--border);margin:12px 6px}
.side-foot{margin-top:auto;padding:16px 8px 0;color:var(--muted-2);font-size:12px}

.main{flex:1 1 auto;min-width:0;display:flex;flex-direction:column}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px 28px;
  position:sticky;top:0;background:var(--surface);box-shadow:0 1px 4px rgba(32,40,45,.06);z-index:5}
.topbar h1{font-size:20px;margin:0;font-weight:600;color:#1e2532}
.content{padding:24px 28px 60px;max-width:1340px;width:100%}

/* ── Cards / grid ── */
.grid{display:grid;gap:18px}
.g2{grid-template-columns:repeat(2,1fr)}
.g3{grid-template-columns:repeat(3,1fr)}
.g4{grid-template-columns:repeat(4,1fr)}
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--r);padding:20px;box-shadow:var(--shadow)}
.card.h{transition:box-shadow .18s,transform .18s}
.card.h:hover{box-shadow:var(--shadow-lg);transform:translateY(-2px)}
.card-t{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:14px}
.card-t h3{font-size:12.5px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.06em;margin:0}
.section-t{font-size:16px;font-weight:600;margin:28px 0 14px;color:#1e2532;display:flex;align-items:center;gap:9px}
.section-t svg{width:19px;height:19px;color:var(--primary)}

/* ── Материально: градиентные стат-карточки ── */
.statgrid{display:grid;grid-template-columns:repeat(4,1fr);gap:18px;margin-bottom:6px}
.statcard{position:relative;overflow:hidden;border-radius:var(--r);padding:22px 20px;color:#fff;box-shadow:var(--shadow)}
.statcard .sc-v{font-size:28px;font-weight:700;line-height:1.05}
.statcard .sc-l{font-size:13px;opacity:.9;margin-top:5px;font-weight:500}
.statcard .sc-sub{font-size:12px;opacity:.75;margin-top:2px}
.statcard .sc-ic{position:absolute;right:16px;top:16px;opacity:.55}
.statcard .sc-ic svg{width:24px;height:24px}
.statcard::before{content:"";position:absolute;width:130px;height:130px;border-radius:50%;background:rgba(255,255,255,.10);right:-24px;bottom:-52px}
.statcard::after{content:"";position:absolute;width:130px;height:130px;border-radius:50%;background:rgba(255,255,255,.08);right:26px;bottom:-84px}
.statcard.blue{background:linear-gradient(135deg,#42a5f5 0%,#1565c0 100%)}
.statcard.purple{background:linear-gradient(135deg,#7e57c2 0%,#512da8 100%)}
.statcard.teal{background:linear-gradient(135deg,#26c6da 0%,#00838f 100%)}
.statcard.amber{background:linear-gradient(135deg,#ffb74d 0%,#f57c00 100%)}
.statcard.light{background:#fff;color:var(--text);border:1px solid var(--border)}
.statcard.light .sc-l{opacity:.7} .statcard.light::before,.statcard.light::after{display:none}

/* ── KPI ── */
.kpi{display:flex;flex-direction:column;gap:3px}
.kpi .v{font-size:27px;font-weight:700;line-height:1.1;color:#1e2532}
.kpi .l{font-size:12.5px;color:var(--muted)}
.kpi .sub{font-size:12px;color:var(--muted-2)}
.delta{font-size:12px;font-weight:600}
.delta.up{color:var(--green)} .delta.down{color:var(--red)}

/* ── Bot cards ── */
.bots{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.bot{background:var(--surface);border:1px solid var(--border);border-radius:var(--r);padding:16px 17px;display:flex;gap:13px;align-items:flex-start;box-shadow:var(--shadow);transition:box-shadow .18s,transform .18s}
.bot:hover{box-shadow:var(--shadow-lg);transform:translateY(-2px)}
.bot .ic{width:42px;height:42px;border-radius:11px;background:#e3f2fd;display:flex;align-items:center;justify-content:center;flex:0 0 42px}
.bot .ic svg{width:21px;height:21px;color:var(--primary-2)}
.bot .nm{font-weight:600;font-size:15px;display:flex;align-items:center;gap:8px;color:#1e2532}
.bot .rl{font-size:12.5px;color:var(--muted);margin-top:2px;line-height:1.35}
.bot .meta{font-size:11.5px;color:var(--muted-2);margin-top:6px}
.dot{width:9px;height:9px;border-radius:50%;display:inline-block;flex:0 0 9px}
.dot.up{background:var(--green);box-shadow:0 0 7px rgba(0,200,83,.55)}
.dot.down{background:var(--red);box-shadow:0 0 7px rgba(244,67,54,.5)}

/* ── Badges ── */
.badge{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:600;padding:4px 10px;border-radius:999px;color:var(--muted);background:var(--surface-3)}
.badge.ok{color:#009624;background:rgba(0,200,83,.13)}
.badge.err{color:#d32f2f;background:rgba(244,67,54,.12)}
.badge.warn{color:#c67c00;background:rgba(255,171,0,.15)}
.badge.pub{color:#009624;background:rgba(0,200,83,.13)} .badge.cancelled{color:var(--muted-2);background:var(--surface-3)}
.tag{display:inline-block;font-size:11px;padding:3px 9px;border-radius:6px;background:#ede7f6;color:var(--accent);margin-right:4px;font-weight:500}

/* ── Buttons ── */
.btn{display:inline-flex;align-items:center;gap:7px;font-family:inherit;font-size:13.5px;font-weight:600;padding:9px 16px;border-radius:var(--r-sm);border:1px solid var(--border-2);background:var(--surface);color:var(--text);cursor:pointer;transition:background .16s,box-shadow .16s,border-color .16s}
.btn:hover{background:var(--surface-3);text-decoration:none;box-shadow:0 2px 8px rgba(32,40,45,.08)}
.btn svg{width:15px;height:15px}
.btn-primary{background:var(--primary);border-color:var(--primary);color:#fff;box-shadow:0 3px 10px rgba(33,150,243,.35)}
.btn-primary:hover{background:var(--primary-2);border-color:var(--primary-2);box-shadow:0 5px 14px rgba(33,150,243,.45)}
.btn-blue{background:var(--primary);border-color:var(--primary);color:#fff;box-shadow:0 3px 10px rgba(33,150,243,.35)}
.btn-blue:hover{background:var(--primary-2);border-color:var(--primary-2)}
.btn-ghost{background:transparent;border-color:transparent;color:var(--muted);box-shadow:none}
.btn-ghost:hover{background:var(--surface-3);color:var(--text);box-shadow:none}
.btn-danger{color:var(--red);border-color:rgba(244,67,54,.35);background:transparent}
.btn-danger:hover{background:rgba(244,67,54,.09)}
.btn-sm{padding:6px 12px;font-size:12.5px}
.btn:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:none;box-shadow:0 0 0 3px var(--ring)}

/* ── Forms ── */
input,textarea,select{font-family:inherit;font-size:14px;color:var(--text);background:var(--surface);border:1px solid var(--border-2);border-radius:var(--r-sm);padding:10px 13px;width:100%}
input:focus,textarea:focus,select:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 3px var(--ring)}
textarea{resize:vertical;min-height:64px;line-height:1.45}
label{display:block;font-size:12px;color:var(--muted);margin-bottom:6px;font-weight:500}
.field{margin-bottom:13px}
.row{display:flex;gap:10px;flex-wrap:wrap}
.row>.field{flex:1 1 140px}

/* ── Tables / lists ── */
.feed{display:flex;flex-direction:column;gap:10px}
.fi{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-sm);padding:14px 16px;display:flex;gap:13px;align-items:flex-start;box-shadow:var(--shadow);transition:box-shadow .16s}
.fi:hover{box-shadow:var(--shadow-lg)}
.fi .k{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--muted-2);flex:0 0 54px;padding-top:2px}
.fi .bd{flex:1 1 auto;min-width:0}
.fi .ti{font-size:14px;line-height:1.4;word-break:break-word}
.fi .mt{font-size:12px;color:var(--muted-2);margin-top:5px;display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.fi .tm{flex:0 0 auto;font-size:11.5px;color:var(--muted-2);white-space:nowrap}

table{width:100%;border-collapse:collapse;font-size:13.5px}
th{text-align:left;color:var(--muted);font-weight:600;font-size:12px;text-transform:uppercase;letter-spacing:.04em;padding:9px 12px;border-bottom:1px solid var(--border)}
td{padding:10px 12px;border-bottom:1px solid var(--border)}
tr:hover td{background:var(--surface-2)}

/* ── Progress / bar ── */
.bar{height:8px;background:var(--surface-3);border-radius:999px;overflow:hidden}
.bar>span{display:block;height:100%;border-radius:999px;background:var(--primary)}
.bar.amber>span{background:var(--amber)} .bar.green>span{background:var(--green)} .bar.red>span{background:var(--red)}

/* ── Misc ── */
.muted{color:var(--muted)} .small{font-size:12.5px} .right{margin-left:auto}
.flex{display:flex;align-items:center;gap:10px}
.between{display:flex;align-items:center;justify-content:space-between;gap:12px}
.wrap{flex-wrap:wrap}
.hr{height:1px;background:var(--border);margin:16px 0;border:0}
.pill-row{display:flex;gap:6px;flex-wrap:wrap}
.notice{background:#fff8e1;border:1px solid #ffe082;border-left:3px solid var(--amber);border-radius:var(--r-sm);padding:12px 15px;font-size:13px;color:#7a5c00}
.cover{width:54px;height:54px;border-radius:8px;object-fit:cover;flex:0 0 54px;background:var(--surface-3);border:1px solid var(--border)}
.delta{font-size:12px;font-weight:600;margin-top:2px;display:inline-block}
.delta.up{color:var(--green)} .delta.down{color:var(--red)}
.live-banner{display:flex;align-items:center;gap:9px;background:#e8f5e9;border:1px solid #c8e6c9;border-left:3px solid var(--green);border-radius:var(--r-sm);padding:12px 16px;margin-bottom:16px;font-size:14px;color:#1b5e20}
.live-banner svg{width:17px;height:17px;color:#2e7d32}
.pulse{width:8px;height:8px;border-radius:50%;background:var(--green);animation:pulse 1.8s infinite;flex:0 0 8px}
@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(0,200,83,.5)}70%{box-shadow:0 0 0 8px rgba(0,200,83,0)}100%{box-shadow:0 0 0 0 rgba(0,200,83,0)}}
.postimg{width:100%;max-width:220px;border-radius:10px;border:1px solid var(--border);display:block}
/* аккордеон площадки: плавное раскрытие/скрытие на месте (grid-rows 0fr→1fr) */
#pf-wrap{display:grid;grid-template-rows:0fr;transition:grid-template-rows .38s cubic-bezier(.4,0,.2,1)}
#pf-wrap.open{grid-template-rows:1fr;margin-top:16px}
#pf-wrap>#pf-panel{overflow:hidden;min-height:0}
a.card.h.pf-active{outline:2px solid var(--primary);outline-offset:-2px}
.platform-panel{animation:pfFade .4s ease}
@keyframes pfFade{from{opacity:0}to{opacity:1}}
/* индикатор загрузки HTMX */
.htmx-indicator{display:none}
.htmx-request .htmx-indicator,.htmx-request.htmx-indicator{display:flex}
.spin{display:inline-block;width:15px;height:15px;border:2px solid var(--border-2);border-top-color:var(--primary);border-radius:50%;animation:spin .7s linear infinite;vertical-align:middle;margin-right:8px}
@keyframes spin{to{transform:rotate(360deg)}}
.loadbox{align-items:center;gap:8px;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--r-sm);padding:11px 14px;margin-top:8px;color:var(--text);font-size:13px}
/* живой граф работы ботов */
.bots-wrap{position:relative}
svg.botflow{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:3;overflow:visible}
svg.botflow path.edge{fill:none;stroke:var(--border-2);stroke-width:1.5;stroke-dasharray:5 5;opacity:.55}
svg.botflow path.edge.active{stroke:var(--primary);stroke-width:2.5;opacity:1;stroke-dasharray:7 4;animation:antmarch .5s linear infinite}
@keyframes antmarch{to{stroke-dashoffset:-22}}
.bot.active{border-color:var(--primary)!important;box-shadow:0 0 0 1px var(--primary),0 6px 18px -4px rgba(33,150,243,.5)}
.bot-act{font-size:12px;color:var(--primary-2);font-weight:600;margin-top:4px;min-height:1px;display:flex;align-items:center;gap:5px}
.bot-act:not(:empty)::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--primary);animation:pulse 1.4s infinite;flex:0 0 7px}
.bot.bot-open{border-color:var(--primary)!important;box-shadow:0 0 0 1px var(--primary)}
#botpanel-wrap{display:grid;grid-template-rows:0fr;transition:grid-template-rows .38s cubic-bezier(.4,0,.2,1)}
#botpanel-wrap.open{grid-template-rows:1fr;margin-top:16px}
#botpanel-wrap>#botpanel{overflow:hidden;min-height:0}
/* ромб-раскладка ботов (Менеджер в центре) */
@media(min-width:1081px){
  .bots{grid-template-columns:repeat(6,1fr);grid-auto-rows:minmax(0,1fr)}
  .bots .bot[data-bot="analytics"]{grid-area:1/2/2/4}
  .bots .bot[data-bot="smm"]{grid-area:1/4/2/6}
  .bots .bot[data-bot="orchestrator"]{grid-area:2/3/3/5}
  .bots .bot[data-bot="ads"]{grid-area:3/1/4/3}
  .bots .bot[data-bot="wp"]{grid-area:3/3/4/5}
  .bots .bot[data-bot="video"]{grid-area:3/5/4/7}
}
@media(max-width:1080px){svg.botflow{display:none}}
details.edit{margin-top:10px}
details.edit>summary{cursor:pointer;color:var(--primary-2);font-size:13px;list-style:none;font-weight:600}
details.edit>summary::-webkit-details-marker{display:none}
.editbox{margin-top:12px;padding:15px;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--r-sm)}

/* ── Toast ── */
#toast{position:fixed;right:20px;bottom:20px;z-index:50;display:flex;flex-direction:column;gap:8px}
.toast{background:#fff;border:1px solid var(--border);border-left:4px solid var(--green);border-radius:var(--r-sm);padding:13px 17px;box-shadow:var(--shadow-lg);font-size:13.5px;max-width:380px;color:var(--text);animation:slide .2s ease}
.toast.err{border-left-color:var(--red)}
@keyframes slide{from{transform:translateY(8px);opacity:0}to{transform:translateY(0);opacity:1}}

/* ── Login ── */
.login-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:20px;
  background:linear-gradient(135deg,#e3f2fd 0%,#eef2f6 55%,#ede7f6 100%)}
.login{width:100%;max-width:380px;background:var(--surface);border:1px solid var(--border);border-radius:16px;padding:36px 34px;box-shadow:var(--shadow-lg)}
.login .logo{width:52px;height:52px;border-radius:14px;background:linear-gradient(135deg,#42a5f5,#1565c0);display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700;font-size:22px;margin:0 auto 20px;box-shadow:0 6px 18px rgba(33,150,243,.4)}
.login h1{text-align:center;font-size:20px;margin:0 0 4px;color:#1e2532}
.login p{text-align:center;color:var(--muted);font-size:13px;margin:0 0 24px}
.login .err{color:var(--red);font-size:13px;text-align:center;margin-bottom:12px}

/* mobile burger */
.burger{display:none;background:none;border:0;color:var(--text);cursor:pointer}
.burger svg{width:24px;height:24px}

@media(max-width:1080px){.g4{grid-template-columns:repeat(2,1fr)}.bots{grid-template-columns:repeat(2,1fr)}.g3{grid-template-columns:repeat(2,1fr)}.statgrid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:760px){
  .sidebar{position:fixed;left:0;top:0;z-index:30;transform:translateX(-100%);transition:transform .2s;box-shadow:var(--shadow-lg)}
  .sidebar.open{transform:translateX(0)}
  .burger{display:block}
  .content{padding:16px}
  .topbar{padding:14px 16px}
  .g2,.g3,.g4,.bots,.statgrid{grid-template-columns:1fr}
  .scrim{position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:20;display:none}
  .scrim.open{display:block}
}
@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}

/* ── Тёмная тема (альтернативная, по переключателю) ── */
[data-theme="dark"]{
  --bg:#0a0e14; --surface:#111723; --surface-2:#161e2c; --surface-3:#1b2433;
  --border:#232d3e; --border-2:#2c3850;
  --text:#e6edf3; --muted:#8b98ab; --muted-2:#5e6b7e;
  --primary:#42a5f5; --primary-2:#64b5f6;
  --accent:#b39ddb; --accent-2:#9575cd;
  --green:#22c55e; --amber:#f5a623; --red:#ef4444; --cyan:#22d3ee; --violet:#a78bfa;
  --ring:rgba(66,165,245,.4);
  --shadow:0 4px 14px rgba(0,0,0,.35); --shadow-lg:0 12px 32px rgba(0,0,0,.45);
  --card:var(--surface); --panel:var(--surface-2);
}
[data-theme="dark"] body{color:var(--text)}
[data-theme="dark"] .brand,[data-theme="dark"] .topbar h1,[data-theme="dark"] .bot .nm,
[data-theme="dark"] .kpi .v,[data-theme="dark"] .section-t{color:var(--text)}
[data-theme="dark"] .nav a.active{background:var(--surface-3);color:var(--primary-2)}
[data-theme="dark"] .bot .ic{background:var(--surface-3)}
[data-theme="dark"] .tag{background:var(--surface-3);color:var(--accent)}
[data-theme="dark"] .notice{background:var(--surface-2);border-color:var(--border-2);color:var(--muted)}
[data-theme="dark"] .live-banner{background:var(--surface-2);border-color:var(--border-2);color:var(--text)}
[data-theme="dark"] .live-banner svg{color:var(--muted)}
[data-theme="dark"] .toast{background:var(--surface-3);border-color:var(--border-2)}
[data-theme="dark"] .login-wrap{background:var(--bg)}
[data-theme="dark"] .badge{background:var(--surface-2)}

/* переключатель темы */
.theme-toggle{background:var(--surface-3);border:1px solid var(--border);border-radius:var(--r-sm);width:38px;height:38px;display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--muted);padding:0}
.theme-toggle:hover{background:var(--surface-2);color:var(--text)}
.theme-toggle svg{width:18px;height:18px}

/* Большое окно ошибки по центру экрана */
.errmodal{position:fixed;inset:0;z-index:9999;display:flex;align-items:center;justify-content:center;
  background:rgba(30,40,55,.5);backdrop-filter:blur(3px);animation:errfade .16s ease-out;padding:24px}
@keyframes errfade{from{opacity:0}to{opacity:1}}
.errcard{max-width:560px;width:100%;background:var(--surface);border:2px solid var(--red);
  border-radius:18px;box-shadow:0 24px 80px rgba(30,40,55,.35);padding:34px 32px;text-align:center;
  animation:errpop .18s cubic-bezier(.2,.9,.3,1.2)}
@keyframes errpop{from{transform:scale(.9);opacity:.4}to{transform:scale(1);opacity:1}}
.erricon{font-size:52px;line-height:1;margin-bottom:10px}
.errttl{font-size:24px;font-weight:700;color:var(--red);margin-bottom:12px}
.errmsg{font-size:17px;line-height:1.5;color:var(--text);
  white-space:pre-wrap;word-break:break-word;margin-bottom:24px;max-height:44vh;overflow:auto}
.errbtn{font-size:16px;padding:11px 34px}
.errcard.okcard{border-color:var(--green)}
.erricon.okicon{color:var(--green)}
.errttl.okttl{color:#009624}

/* ── Очередь: сводка 2×2 + аккордеон секций ── */
.qgrid{display:grid;grid-template-columns:repeat(2,1fr);gap:16px;margin-bottom:18px}
.qgrid.slim{grid-template-columns:repeat(4,1fr);gap:10px}
.qcard{appearance:none;font:inherit;text-align:left;color:var(--text);background:var(--surface);border:1px solid var(--border);
  border-radius:var(--r);padding:18px 20px;cursor:pointer;box-shadow:var(--shadow);transition:transform .18s ease,box-shadow .18s ease}
.qcard:hover{transform:translateY(-2px);box-shadow:var(--shadow-lg)}
.qcard:active{transform:scale(.99)}
.qcard.on{box-shadow:0 0 0 2px var(--primary),var(--shadow)}
.qgrid.slim .qcard{padding:11px 14px;border-radius:10px}
.qc-top{display:flex;align-items:center;justify-content:space-between;color:var(--muted)}
.qc-num{font-size:27px;font-weight:700;color:#1e2532;transition:font-size .18s}
.qgrid.slim .qc-num{font-size:18px}
.qc-name{font-weight:600;font-size:16px;color:var(--text);margin-top:6px;transition:margin .18s}
.qgrid.slim .qc-name{margin-top:2px;font-size:13px}
.qc-sub{font-size:12px;color:var(--muted);margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition:opacity .15s,max-height .2s}
.qgrid.slim .qc-sub{display:none}
.qsec{display:grid;grid-template-rows:0fr;opacity:0;overflow:hidden;transition:grid-template-rows .28s ease,opacity .22s ease}
.qsec.open{grid-template-rows:1fr;opacity:1}
.qsec-in{min-height:0;overflow:hidden;padding-bottom:8px}
[data-theme="dark"] .qc-num,[data-theme="dark"] .qcard{color:var(--text)}
.cover.genph{display:flex;align-items:center;justify-content:center;font-size:26px;background:var(--surface-3);border:1px dashed var(--border-2)}
@media(prefers-reduced-motion:reduce){.qcard,.qsec,.qc-num,.qc-name{transition:none}}
