/* ==========================================================================
   InviteMaster · Dashboard — tema Dark Neon (Fase 8)
   Escuro por defeito. Neon ciano + violeta só em contornos, foco e estado ativo.
   Tokens em :root: os testes verificam o contraste do texto sobre as superfícies.
   ========================================================================== */
:root {
  color-scheme: dark;
  --bg: #07080d;          /* fundo da página */
  --bg-2: #0b0d15;        /* sidebar / faixas */
  --card: #11141f;        /* painéis e cartões */
  --card-2: #171b2a;      /* campos, linhas realçadas */
  --text: #e8ebf7;
  --muted: #a3acc9;
  --line: #262c45;
  --accent: #22e3ff;      /* ciano neon */
  --accent-2: #9b6bff;    /* violeta neon */
  --accent-text: #04121a; /* texto sobre ciano */
  --ok: #3ee89a; --warn: #ffc24a; --bad: #ff6b88;
  --pending: #ffc24a; --approved: #3ee89a; --used: #8fb4ff; --rejected: #ff6b88;
  --demo: #b794ff;
  --glow-a: 0 0 0 1px rgba(34, 227, 255, .16), 0 0 22px -10px rgba(34, 227, 255, .55);
  --glow-b: 0 0 0 1px rgba(155, 107, 255, .2), 0 0 22px -10px rgba(155, 107, 255, .55);
  --edge: linear-gradient(135deg, rgba(34, 227, 255, .5), rgba(155, 107, 255, .5));
  --radius: 14px; --radius-sm: 9px;
  --sans: "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, -apple-system, Roboto, sans-serif;
  --mono: "Cascadia Mono", ui-monospace, Consolas, "SF Mono", monospace;
  --sidebar-w: 252px;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; color: var(--text); font: 15px/1.5 var(--sans); letter-spacing: .005em;
  background:
    radial-gradient(900px 420px at 12% -8%, rgba(34, 227, 255, .07), transparent 60%),
    radial-gradient(760px 420px at 100% 0%, rgba(155, 107, 255, .08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1 { font-size: 1.12rem; margin: 0; font-weight: 650; letter-spacing: .01em; }
h2 { font-size: 1.1rem; margin: 0 0 .6rem; font-weight: 650; }
h3 { font-weight: 620; }
a { color: var(--accent); }
.muted { color: var(--muted); font-size: .9rem; }
.error { color: var(--bad); margin: .5rem 0; }
code, .mono { font-family: var(--mono); font-size: .88em; }
.num, td.num { font-variant-numeric: tabular-nums; }
::selection { background: rgba(155, 107, 255, .45); }
::-webkit-scrollbar { height: 10px; width: 10px; }
::-webkit-scrollbar-thumb { background: #2b3252; border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Campos ---------- */
button, select, input, textarea {
  font: inherit; color: var(--text); background: var(--card-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: .5rem .8rem; transition: border-color .15s, box-shadow .15s, background .15s, transform .08s;
}
input::placeholder, textarea::placeholder { color: #7a84a6; }
input:hover, select:hover, textarea:hover { border-color: #3a4370; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34, 227, 255, .22); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 1.05rem; height: 1.05rem; padding: 0; }
select { appearance: none; padding-right: 2rem; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }

/* ---------- Botões: hover, foco, a carregar, sucesso, erro ---------- */
button { cursor: pointer; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; }
button:hover:not(:disabled) { border-color: var(--accent); box-shadow: var(--glow-a); }
button:active:not(:disabled) { transform: translateY(1px); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: linear-gradient(135deg, #22e3ff, #5aa8ff 55%, #9b6bff); color: var(--accent-text); border-color: transparent; font-weight: 650; }
button.primary:hover:not(:disabled) { box-shadow: 0 0 0 1px rgba(34, 227, 255, .5), 0 0 26px -6px rgba(34, 227, 255, .8); border-color: transparent; filter: brightness(1.06); }
button.danger { color: var(--bad); border-color: rgba(255, 107, 136, .5); background: rgba(255, 107, 136, .06); }
button.danger:hover:not(:disabled) { border-color: var(--bad); box-shadow: 0 0 0 1px rgba(255, 107, 136, .25), 0 0 20px -8px rgba(255, 107, 136, .8); }
button.ghost { background: transparent; }
button.small { padding: .25rem .6rem; font-size: .85rem; }
button.loading { color: transparent !important; pointer-events: none; }
button.loading::after { content: ""; position: absolute; width: 1.05em; height: 1.05em; border: 2px solid rgba(255, 255, 255, .35); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
button.primary.loading::after { border-color: rgba(4, 18, 26, .3); border-top-color: var(--accent-text); }
button.is-ok { border-color: var(--ok) !important; box-shadow: 0 0 0 1px rgba(62, 232, 154, .3), 0 0 20px -8px var(--ok) !important; }
button.is-bad { border-color: var(--bad) !important; box-shadow: 0 0 0 1px rgba(255, 107, 136, .3), 0 0 20px -8px var(--bad) !important; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cartões e painéis (contorno em gradiente neon) ---------- */
.card, .counter, .cfg, .summary, .dialog {
  border: 1px solid transparent; border-radius: var(--radius);
  background: linear-gradient(var(--card), var(--card)) padding-box, var(--edge) border-box;
}
.card { padding: 1.1rem 1.2rem; margin: 0 0 1.1rem; box-shadow: var(--glow-a); animation: rise .35s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.card.flat { box-shadow: none; animation: none; }

/* ---------- Estrutura: sidebar + conteúdo ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 1rem; padding: 1.1rem .85rem; background: linear-gradient(180deg, var(--bg-2), #080a11); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .7rem; padding: .2rem .5rem .6rem; }
.brand svg { width: 34px; height: 34px; flex: none; filter: drop-shadow(0 0 8px rgba(34, 227, 255, .55)); }
.brand strong { display: block; font-size: 1.02rem; letter-spacing: .02em; }
.brand span { color: var(--muted); font-size: .8rem; }
.tabs { display: flex; flex-direction: column; gap: .2rem; }
.tab { justify-content: flex-start; width: 100%; text-align: left; background: transparent; border-color: transparent; color: var(--muted); padding: .62rem .75rem; border-radius: 11px; font-weight: 520; }
.tab .ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab:hover:not(:disabled) { color: var(--text); background: rgba(255, 255, 255, .04); border-color: transparent; box-shadow: none; }
.tab.active { color: var(--text); background: linear-gradient(90deg, rgba(34, 227, 255, .14), rgba(155, 107, 255, .08)); border-color: rgba(34, 227, 255, .28); box-shadow: inset 3px 0 0 var(--accent), 0 0 24px -12px rgba(34, 227, 255, .8); }
.tab.active .ico { color: var(--accent); filter: drop-shadow(0 0 5px rgba(34, 227, 255, .7)); }
.tab-group { margin: .9rem .75rem .2rem; color: #7d87ab; font-size: .78rem; font-weight: 600; }
.side-foot { margin-top: auto; padding: .6rem .5rem 0; border-top: 1px solid var(--line); }
.main { min-width: 0; padding: 0 1.4rem 2rem; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 0; flex-wrap: wrap; position: sticky; top: 0; z-index: 5; background: linear-gradient(180deg, var(--bg) 70%, transparent); }
.topbar .lead { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.menu-btn { display: none; padding: .4rem .55rem; }
.menu-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.scrim { display: none; }
.actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.badge { display: inline-block; padding: .12rem .6rem; border-radius: 99px; font-size: .8rem; border: 1px solid var(--line); background: var(--card-2); }
.badge.ok { color: var(--ok); border-color: rgba(62, 232, 154, .5); background: rgba(62, 232, 154, .08); }
.badge.bad { color: var(--bad); border-color: rgba(255, 107, 136, .55); background: rgba(255, 107, 136, .08); }
.badge.warn { color: var(--warn); border-color: rgba(255, 194, 74, .5); background: rgba(255, 194, 74, .08); }
.badge.neon { color: var(--accent); border-color: rgba(34, 227, 255, .5); background: rgba(34, 227, 255, .07); }
.counters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; padding: 0 0 1.1rem; }
.counter { padding: .8rem 1rem; display: flex; flex-direction: column; gap: .2rem; }
.counter .label { color: var(--muted); font-size: .84rem; }
.counter strong { font-size: 1.65rem; font-variant-numeric: tabular-nums; font-weight: 650; text-shadow: 0 0 18px rgba(34, 227, 255, .25); }

/* ---------- Faixa de demonstração ---------- */
.demo-banner { background: linear-gradient(90deg, rgba(155, 107, 255, .22), rgba(34, 227, 255, .1)); border-bottom: 1px solid rgba(155, 107, 255, .6); color: var(--text); padding: .55rem 1rem; margin: 0; font-weight: 600; text-align: center; }
.login-card .demo-banner { border: 1px solid var(--demo); border-radius: var(--radius-sm); font-size: .85rem; text-align: left; margin: 0 0 .4rem; }

/* ---------- Filtros, tabelas, paginação ---------- */
.filters, .config-toolbar { display: flex; gap: .7rem; align-items: end; flex-wrap: wrap; margin-bottom: .9rem; }
.filters label, .config-toolbar label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; color: var(--muted); }
.config-toolbar .grow { flex: 1 1 240px; }
.config-toolbar input[type=search] { width: 100%; }
.summary { margin: 0 0 .9rem; padding: .65rem .9rem; box-shadow: none; }
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: .84rem; background: rgba(255, 255, 255, .02); position: sticky; top: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(34, 227, 255, .045); }
td.wrap { white-space: normal; min-width: 14rem; max-width: 34rem; word-break: break-word; }
.status { font-weight: 620; }
.status.pending { color: var(--pending); } .status.approved { color: var(--approved); }
.status.used { color: var(--used); } .status.rejected { color: var(--rejected); } .status.paid { color: var(--used); }
.status.revoked { color: var(--rejected); text-decoration: line-through; }
.status.valid { color: var(--ok); }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: .9rem; gap: .6rem; }
.pill { font-size: .78rem; border: 1px solid var(--line); border-radius: 99px; padding: .06rem .6rem; color: var(--muted); background: var(--card-2); }
.pill.ok { color: var(--ok); border-color: rgba(62, 232, 154, .55); }
.pill.warn { color: var(--warn); border-color: rgba(255, 194, 74, .55); }
.pill.manual { color: var(--demo); border-color: rgba(183, 148, 255, .6); }
.pill.off { color: var(--bad); border-color: rgba(255, 107, 136, .55); }
.notice { background: rgba(255, 194, 74, .08); border: 1px solid rgba(255, 194, 74, .5); border-radius: var(--radius-sm); padding: .65rem .9rem; margin: 0 0 1rem; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card { max-width: 400px; width: 100%; margin: 0; display: flex; flex-direction: column; gap: .5rem; padding: 1.6rem; box-shadow: var(--glow-a), 0 30px 80px -30px rgba(155, 107, 255, .35); }
.login-card h1 { font-size: 1.5rem; text-shadow: 0 0 22px rgba(34, 227, 255, .45); }
.login-card input { width: 100%; }
.login-card label { color: var(--muted); font-size: .85rem; margin-top: .3rem; }

/* ---------- Diálogos ---------- */
.dialog { color: var(--text); max-width: 560px; width: calc(100% - 2rem); padding: 1.3rem; box-shadow: var(--glow-b), 0 40px 90px -30px #000; }
.dialog.wide { max-width: 780px; }
.dialog[open] { animation: rise .2s ease-out; }
.dialog::backdrop { background: rgba(3, 4, 9, .72); backdrop-filter: blur(3px); }
.dialog label { display: flex; flex-direction: column; gap: .3rem; margin-top: .85rem; color: var(--muted); font-size: .88rem; }
.dialog label.check { flex-direction: row; align-items: flex-start; gap: .55rem; color: var(--text); font-size: .95rem; }
.dialog label.check input { margin-top: .22rem; }
.dialog textarea, .dialog input[type=number], .dialog input[type=text], .dialog input[type=url] { width: 100%; }
.dialog-actions { display: flex; gap: .6rem; justify-content: flex-end; margin-top: 1.1rem; flex-wrap: wrap; }

dl { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: .6rem 0; }
dt { color: var(--muted); }
dd { margin: 0; word-break: break-word; }
ul.history { list-style: none; padding: 0; margin: .4rem 0 0; }
ul.history li { padding: .4rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); background: #0e2a1f; color: #d8ffee; border: 1px solid var(--ok); padding: .65rem 1.1rem; border-radius: var(--radius-sm); max-width: calc(100% - 2rem); z-index: 50; box-shadow: 0 0 28px -8px var(--ok); animation: rise .25s ease-out; }
.toast.bad { background: #3a1019; color: #ffe3e9; border-color: var(--bad); box-shadow: 0 0 28px -8px var(--bad); }
.toast.bad .error { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Configuração, auditoria, demonstração (Fase 6) ---------- */
.subtabs { display: flex; gap: .35rem; flex-wrap: wrap; }
.subtab.active { background: rgba(34, 227, 255, .14); color: var(--text); border-color: var(--accent); box-shadow: var(--glow-a); }
.config-list h3.group { margin: 1.2rem 0 .5rem; font-size: .95rem; color: var(--muted); }
.cfg { padding: .9rem 1rem; margin: 0 0 .85rem; box-shadow: none; }
.cfg.dirty { background: linear-gradient(var(--card), var(--card)) padding-box, linear-gradient(135deg, var(--warn), rgba(255, 194, 74, .3)) border-box; }
.cfg-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; }
.cfg-head h4 { margin: 0; font-size: 1rem; }
.cfg p { margin: .3rem 0; }
.cfg-editor textarea, .cfg-editor input, .cfg-editor select { width: 100%; font-family: inherit; }
.cfg-editor textarea { resize: vertical; min-height: 5rem; }
.cfg-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .55rem; }
.chips { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; margin: .4rem 0; }
.chip { font-family: var(--mono); font-size: .82rem; padding: .15rem .5rem; }
.ph-help { margin: .2rem 0 .4rem 1rem; padding: 0; }
.tg-preview { white-space: pre-wrap; word-break: break-word; border: 1px dashed #36406a; border-left: 4px solid var(--accent); border-radius: var(--radius-sm); padding: .65rem .85rem; margin: .3rem 0; background: rgba(34, 227, 255, .05); }
.tg-preview code, .tg-preview pre { font-family: var(--mono); background: rgba(255, 255, 255, .08); border-radius: 4px; padding: 0 .25rem; }
.tg-preview pre { padding: .4rem .6rem; }
.tg-preview a { color: var(--accent); }
.tg-spoiler { background: var(--muted); color: transparent; border-radius: 3px; }
.tg-spoiler:hover { color: var(--text); background: transparent; }
.counter-line, .status-line { margin: .2rem 0; }
.unsupported { margin-top: 1.4rem; border-top: 1px solid var(--line); padding-top: .8rem; }
.unsupported li { margin: .35rem 0; }
.demo-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin: .6rem 0; }
.admins { padding-left: 1.2rem; }

/* ---------- Fase 7: visão geral, utilizadores ---------- */
.ov-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .65rem; margin: .4rem 0 .9rem; }
.ov-grid .counter strong { font-size: 1.4rem; }
.user-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
#user-detail h3 { margin: 1.1rem 0 .4rem; font-size: .98rem; }
#user-detail .sec { border-top: 1px solid var(--line); padding-top: .55rem; margin-top: .85rem; }

/* ---------- Fase 8: loja e Storelist ---------- */
.shop-head { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .8rem; }
.shop-grid { display: grid; grid-template-columns: minmax(250px, 340px) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.shop-side .cat { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .55rem .65rem; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: .45rem; background: var(--card-2); }
.shop-side .cat.sel { border-color: var(--accent); box-shadow: var(--glow-a); }
.shop-side .cat .name { flex: 1 1 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: transparent; border: 0; padding: 0; text-align: left; justify-content: flex-start; }
.shop-side .cat .name:hover:not(:disabled) { box-shadow: none; color: var(--accent); }
.shop-side .cat.off .name { color: var(--muted); text-decoration: line-through; }
.shop-side h3 { margin: .9rem 0 .4rem; font-size: .92rem; color: var(--muted); }
.mini { display: inline-flex; gap: .25rem; }
.mini button { padding: .12rem .45rem; font-size: .8rem; }
.edit-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.edit-row input[type=text], .edit-row input[type=number] { flex: 1 1 160px; min-width: 0; }
.opt-box { display: grid; gap: .5rem; }
.opt-box .edit-row > .muted { flex: 0 0 5.5rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .8rem; }
.form-grid label, .field { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; color: var(--muted); }
.field-msg { min-height: 1.2em; font-size: .88rem; margin: .3rem 0 0; }
.field-msg.ok { color: var(--ok); } .field-msg.bad { color: var(--bad); }
.url-box { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.url-box input { flex: 1 1 320px; min-width: 0; font-family: var(--mono); font-size: .9rem; }
.url-current { word-break: break-all; font-family: var(--mono); font-size: .92rem; padding: .6rem .8rem; border-radius: var(--radius-sm); border: 1px dashed #36406a; background: rgba(34, 227, 255, .04); }
a.btn-link { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .9rem; border-radius: var(--radius-sm); border: 1px solid var(--accent); color: var(--accent); text-decoration: none; background: rgba(34, 227, 255, .06); }
a.btn-link:hover { box-shadow: var(--glow-a); }
a.btn-link[aria-disabled=true] { opacity: .4; pointer-events: none; border-color: var(--line); color: var(--muted); }

/* ---------- Responsivo ---------- */
@media (max-width: 1500px) { .shop-grid { grid-template-columns: minmax(0, 1fr); } #cat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: .5rem .7rem; } #cat-list .cat { margin-bottom: 0; } }
@media (max-width: 640px) { .shop-side .cat { flex-wrap: wrap; } .shop-side .cat .name { flex: 1 1 100%; } }
.shop-side, .shop-main { min-width: 0; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(84vw, 300px); height: 100%; z-index: 40; transform: translateX(-102%); transition: transform .22s ease; box-shadow: 20px 0 60px -20px #000; }
  .sidebar.open { transform: none; }
  .scrim.open { display: block; position: fixed; inset: 0; background: rgba(3, 4, 9, .6); z-index: 35; backdrop-filter: blur(2px); }
  .menu-btn { display: inline-flex; }
  .main { padding: 0 1rem 2rem; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .card { padding: .9rem; }
  .main { padding: 0 .6rem 1.5rem; }
  .filters { flex-direction: column; align-items: stretch; }
  .filters label, .filters input, .filters select, .filters button { width: 100%; }
  th, td { padding: .5rem .45rem; }
  dl { grid-template-columns: 1fr; gap: 0; }
  dt { margin-top: .4rem; }
  .dialog { padding: 1rem; }
  .dialog-actions button { flex: 1 1 auto; }
  .pager { gap: .5rem; }
  .pager .muted { text-align: center; flex: 1; }
  .subtabs { width: 100%; }
  .cfg-actions button, .demo-actions button { flex: 1 1 auto; }
  .ov-grid { grid-template-columns: repeat(2, 1fr); }
  .counters { grid-template-columns: repeat(2, 1fr); }
  .actions .muted { display: none; }
}

/* ---------- Movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

#prod-rows td { white-space: normal; }
#cat-list { margin-bottom: .8rem; }

/* ---------- Estatísticas (gráfico neon) ---------- */
.an-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .8rem 1.2rem; flex-wrap: wrap; margin-bottom: .6rem; }
.an-head h2 { margin: 0 0 .15rem; }
.an-head p { margin: 0; }
.an-chart { position: relative; margin: .4rem 0 1.1rem; padding: .9rem .7rem .6rem; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, rgba(155, 107, 255, .07), rgba(34, 227, 255, .03) 60%, transparent); box-shadow: var(--glow-b); min-width: 0; }
.an-chart svg { display: block; max-width: 100%; overflow: visible; touch-action: pan-y; }
.an-chart figcaption { margin: .4rem .3rem 0; font-size: .82rem; }
.an-grid { stroke: rgba(163, 172, 201, .14); stroke-width: 1; stroke-dasharray: 3 5; }
.an-axis { stroke: rgba(163, 172, 201, .35); stroke-width: 1; }
.an-tick { fill: var(--muted); font-size: 11px; font-family: var(--sans); }
.an-fill { opacity: .95; }
.an-halo { opacity: .55; }
.an-guide { stroke: rgba(34, 227, 255, .45); stroke-width: 1; stroke-dasharray: 4 4; }
.an-dot { fill: #0b0e18; stroke: var(--accent); stroke-width: 2; cursor: pointer; transition: r .15s ease, stroke-width .15s ease; outline: none; }
.an-dot.partial { fill: transparent; stroke-dasharray: 2 2; }
.an-dot.on, .an-dot:focus-visible { r: 6.5; stroke: #fff; stroke-width: 2.4; filter: drop-shadow(0 0 6px rgba(34, 227, 255, .9)); }
.an-hit { cursor: crosshair; }
.an-line.draw { animation: an-draw 1s ease-out forwards; }
@keyframes an-draw { to { stroke-dashoffset: 0; } }
.an-tip { position: absolute; z-index: 3; pointer-events: none; display: flex; flex-direction: column; gap: .12rem; min-width: 150px; max-width: 240px; padding: .5rem .7rem; font-size: .82rem; background: rgba(11, 14, 24, .96); border: 1px solid rgba(155, 107, 255, .6); border-radius: var(--radius-sm); box-shadow: var(--glow-b); }
.an-tip em { color: var(--warn); font-style: normal; font-size: .76rem; }
.an-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; pointer-events: none; text-align: center; padding: 1rem; }
.an-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .8rem; }
.an-card { display: flex; flex-direction: column; gap: .3rem; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card-2); min-width: 0; }
.an-card strong { font-size: 1.7rem; line-height: 1.1; color: var(--text); }
.an-card strong.an-na { font-size: 1.05rem; color: var(--muted); font-weight: 600; }
.an-card .an-sub { font-size: .8rem; }
.an-trend { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; margin-top: .15rem; font-size: .8rem; }
.an-why { flex: 1 1 100%; }
.pill.down { color: #c7a8ff; border-color: rgba(155, 107, 255, .65); }
.an-h3 { margin: 1.2rem 0 .4rem; font-size: .95rem; color: var(--muted); }
.an-notes { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: .86rem; display: grid; gap: .25rem; }
@media (max-width: 640px) { .an-head { flex-direction: column; } .an-cards { grid-template-columns: 1fr 1fr; } .an-card strong { font-size: 1.4rem; } .an-tip { max-width: 190px; } }
@media (max-width: 400px) { .an-cards { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .an-line.draw { animation: none; stroke-dashoffset: 0; } .an-dot { transition: none; } }
