/* Design System Auditor — standalone app page. Depends on tokens.css only. */
:root {
  --ax-bg: #f5f7fb;
  --ax-ink: #101828;
  --ax-ink-2: #475467;
  --ax-ink-3: #667085;
  --ax-line: #eaecf0;
  --ax-soft: #f9fafb;
  --ax-brand: #2563eb;
  --ax-tint: #eff6ff;
  --ax-red: #b42318; --ax-red-bg: #fef3f2; --ax-red-dot: #f04438;
  --ax-amber: #b54708; --ax-amber-bg: #fffaeb; --ax-amber-dot: #f79009;
  --ax-low: #344054; --ax-low-bg: #f2f4f7; --ax-low-dot: #475467;
  --ax-green: #05603a; --ax-green-bg: #ecfdf3; --ax-green-dot: #12b76a;
  --ax-shadow: 0 1px 2px rgba(16,24,40,.05), 0 4px 16px rgba(48,80,160,.07);
  --ax-shadow-hover: 0 2px 4px rgba(16,24,40,.06), 0 12px 28px rgba(48,80,160,.13);
  --ax-ease: cubic-bezier(.2,.7,.2,1);
  --ax-t: 180ms;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.ax { font-family: var(--font-family); background: var(--ax-bg); color: var(--ax-ink); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden; min-height: 100vh; }
.ax h1, .ax h2, .ax h3, .ax h4, .ax p, .ax ul, .ax ol { margin: 0; padding: 0; }
.ax ul, .ax ol { list-style: none; }
:where(.ax) a { color: inherit; text-decoration: none; }
:where(.ax) button, :where(.ax) input, :where(.ax) select { font-family: inherit; font-size: inherit; color: inherit; }
:where(.ax) button { cursor: pointer; }
.ax [hidden] { display: none !important; }
.ax :focus-visible { outline: 2px solid var(--ax-brand); outline-offset: 2px; border-radius: 6px; }
.ax-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: inline-block; }
.ax-skip { position: absolute; left: 12px; top: -48px; background: #000; color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 300; }
.ax-skip:focus { top: 12px; }
.ax-muted { color: var(--ax-ink-2); }
code { font-family: ui-monospace, Menlo, monospace; font-size: .92em; background: var(--ax-low-bg); padding: 1px 5px; border-radius: 4px; }
#main:focus { outline: none; }

/* ---------- Top bar ---------- */
.ax-top { height: 56px; background: #fff; border-bottom: 1px solid var(--ax-line); display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(16px, 3.4vw, 48px); position: sticky; top: 0; z-index: 20; }
.ax-top__l { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ax-brand { display: inline-flex; border-radius: 6px; }
.ax-brand img { display: block; }
.ax-top__sep { color: #98a2b3; }
.ax-top__title { color: var(--ax-ink-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ax-top__r { display: flex; align-items: center; gap: 12px; }
.ax-link { background: none; border: 0; padding: 6px 8px; border-radius: 6px; color: var(--ax-ink-2); font-weight: 400; font-size: 14px; transition: color var(--ax-t), background var(--ax-t); }
.ax-link:hover { color: var(--ax-ink); background: var(--ax-low-bg); }
.ax-link--strong { color: var(--ax-ink); font-weight: 500; }

/* ---------- Stepper ---------- */
.ax-steps { padding: 32px 16px 0; }
.ax-steps ol { display: flex; justify-content: center; align-items: center; max-width: 640px; margin: 0 auto; }
.ax-steps li { display: flex; align-items: center; gap: 8px; color: var(--ax-ink-3); font-size: 14px; position: relative; }
.ax-steps li:not(:last-child) { flex: 1 1 auto; }
.ax-steps li:not(:last-child)::after { content: ""; flex: 1; height: 2px; background: transparent; margin: 0 12px; min-width: 16px; border-radius: 2px; transition: background var(--ax-t); }
.ax-steps li.is-done:not(:last-child)::after { background: #000; }
.ax-steps__dot { width: 28px; height: 28px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 500; color: var(--ax-ink-2); box-shadow: 0 0 0 1px var(--ax-line) inset; position: relative; transition: all var(--ax-t) var(--ax-ease); flex: none; }
.ax-steps__dot .ico { display: none; font-size: 14px; stroke-width: 2.6; }
.ax-steps li.is-current .ax-steps__dot { box-shadow: 0 0 0 1.5px #000 inset; color: #000; background: #fff; }
.ax-steps li.is-current { color: var(--ax-ink); font-weight: 500; }
.ax-steps li.is-done .ax-steps__dot { background: #000; color: #fff; box-shadow: none; }
.ax-steps li.is-done .ax-steps__dot .n { display: none; }
.ax-steps li.is-done .ax-steps__dot .ico { display: block; }

/* ---------- Stage / panes ---------- */
#stage { padding: 0 16px 64px; }
.ax-pane { animation: ax-in 240ms var(--ax-ease) both; }
.ax-pane[data-dir="back"] { animation-name: ax-in-back; }
@keyframes ax-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes ax-in-back { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.ax-pane:focus, .ax-h:focus { outline: none; }

.ax-intro { text-align: center; max-width: 600px; margin: 28px auto 28px; }
.ax-intro h1 { font-size: clamp(28px, 6vw, 36px); line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
.ax-intro p { color: var(--ax-ink-2); font-size: 16px; line-height: 1.5; margin-top: 12px; }

.ax-card { background: #fff; border-radius: 16px; box-shadow: var(--ax-shadow); padding: 32px; margin: 0 auto; max-width: 560px; }
.ax-card--center { margin-top: 24px; max-width: 540px; padding: 32px; }
.ax-card--wide { margin-top: 24px; max-width: 640px; }

/* ---------- Buttons ---------- */
.ax-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 20px; border-radius: 8px; border: 1px solid transparent; font-weight: 500; font-size: 16px; line-height: 1.2; white-space: nowrap; transition: background var(--ax-t), box-shadow var(--ax-t), transform var(--ax-t), border-color var(--ax-t), opacity var(--ax-t); }
.ax-btn .ico { font-size: 18px; transition: transform var(--ax-t) var(--ax-ease); }
.ax-btn:hover .ico-arrow { transform: translateX(3px); }
.ax-btn:active { transform: translateY(1px); }
.ax-btn--dark { background: #000; color: #fff; }
.ax-btn--dark:hover { background: #1f2937; box-shadow: 0 6px 16px rgba(16,24,40,.22); }
.ax-btn--light { background: #fff; color: var(--ax-ink); box-shadow: 0 1px 2px rgba(16,24,40,.08), 0 0 0 1px var(--ax-line) inset; }
.ax-btn--light:hover { box-shadow: 0 4px 12px rgba(16,24,40,.1), 0 0 0 1px #d0d5dd inset; }
.ax-btn--block { width: 100%; }
.ax-btn--sm { min-height: 36px; padding: 6px 14px; font-size: 13px; }
.ax-btn[disabled], .ax-btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; pointer-events: none; }
.ax-btn.is-loading { pointer-events: none; }
.ax-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: ax-spin 700ms linear infinite; flex: none; }
@keyframes ax-spin { to { transform: rotate(360deg); } }
.ax-btnrow { display: flex; gap: 12px; }
.ax-btnrow > * { flex: 1; }

/* ---------- Connect ---------- */
.ax-filehead { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.ax-tile { width: 52px; height: 52px; border-radius: 12px; background: #f2f4f7; display: grid; place-items: center; flex: none; }
.ax-tile .ico { width: 18px; height: 27px; }
.ax-tile--sm { width: 40px; height: 40px; border-radius: 10px; }
.ax-tile--sm .ico { width: 14px; height: 21px; }
.ax-filehead h2 { font-size: 16px; font-weight: 500; line-height: 1.3; }
.ax-filehead p { font-size: 12.5px; color: var(--ax-ink-2); }
.ax-label { display: block; font-weight: 500; margin-bottom: 8px; font-size: 14px; }
.ax-field { position: relative; display: flex; align-items: center; }
.ax-field > .ico { position: absolute; left: 16px; color: var(--ax-ink-3); font-size: 16px; pointer-events: none; }
.ax-input { width: 100%; height: 46px; border: 1px solid var(--ax-line); border-radius: 8px; padding: 0 14px 0 44px; background: #fff; color: var(--ax-ink); font-size: 15px; transition: border-color var(--ax-t), box-shadow var(--ax-t); }
.ax-input::placeholder { color: #667085; }
.ax-input:hover { border-color: #d0d5dd; }
.ax-input:focus { outline: none; border-color: var(--ax-brand); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.ax-input[aria-invalid="true"] { border: 1.5px solid #d92d20; box-shadow: none; }
.ax-input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(217,45,32,.15); }
.ax-field.is-bad > .ico { color: #d92d20; }
.ax-hint { font-size: 12.5px; color: var(--ax-ink-2); margin: 8px 0 18px; min-height: 18px; overflow-wrap: anywhere; }
.ax-err { display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; color: #b42318; margin: 8px 0 18px; min-height: 18px; animation: ax-shake 260ms var(--ax-ease); }
.ax-err .ico { font-size: 14px; margin-top: 2px; }
@keyframes ax-shake { 20% { transform: translateX(-4px); } 60% { transform: translateX(4px); } 100% { transform: none; } }
.ax-samples { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px 0 0; font-size: 12.5px; color: var(--ax-ink-2); }
.ax-chipbtn { border: 1px dashed #c4cbd8; background: #fff; border-radius: 999px; padding: 4px 12px; font-size: 12.5px; color: var(--ax-ink); transition: all var(--ax-t); }
.ax-chipbtn:hover { border-color: var(--ax-brand); color: var(--ax-brand); background: var(--ax-tint); }
.ax-how { background: #f4f6fa; border-radius: 12px; padding: 16px; margin-top: 20px; }
.ax-how h3 { font-size: 14px; font-weight: 500; margin-bottom: 10px; }
.ax-how li { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ax-ink-2); padding: 5px 0; }
.ax-how li b { width: 22px; height: 22px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 500; color: var(--ax-ink); flex: none; }
.ax-note { display: flex; gap: 8px; font-size: 12px; color: var(--ax-ink-2); margin-top: 18px; line-height: 1.5; }
.ax-note .ico { font-size: 16px; margin-top: 1px; }
.ax-textlink { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 12.5px; font-weight: 500; background: none; border: 0; padding: 2px 0; color: var(--ax-ink); }
.ax-textlink .ico { font-size: 14px; transition: transform var(--ax-t) var(--ax-ease); }
.ax-textlink:hover .ico { transform: translateX(3px); }
.ax-textlink:hover { color: var(--ax-brand); }

/* ---------- Authorize / connected ---------- */
.ax-pair { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 20px; }
.ax-pair .ax-tile { width: 64px; height: 64px; border-radius: 16px; }
.ax-pair .ax-tile .ico { width: 24px; height: 36px; }
.ax-pair .ax-tile svg.ax-logo { width: 36px; height: 36px; }
.ax-pair__mid { display: flex; align-items: center; gap: 8px; color: var(--ax-ink-3); }
.ax-pair__mid i { display: block; width: 24px; border-top: 1.5px dashed #d0d5dd; }
.ax-pair.is-ok .ax-pair__mid { color: var(--ax-green-dot); }
.ax-pair.is-ok .ax-pair__mid i { border-top: 2px solid var(--ax-green-dot); }
.ax-pair__mid .ico { font-size: 16px; }
.ax-center { text-align: center; }
.ax-center h1 { font-size: 24px; line-height: 1.25; font-weight: 600; text-wrap: balance; }
.ax-center > p { color: var(--ax-ink-2); font-size: 14px; margin: 12px auto 20px; max-width: 440px; }
.ax-perms { border: 1px solid var(--ax-line); border-radius: 12px; text-align: left; margin-bottom: 20px; }
.ax-perms li { display: flex; gap: 14px; padding: 16px; align-items: flex-start; }
.ax-perms li + li { border-top: 1px solid var(--ax-line); }
.ax-perms .ax-ic { width: 36px; height: 36px; border-radius: 10px; background: #f2f4f7; display: grid; place-items: center; flex: none; font-size: 17px; }
.ax-perms b { display: block; font-weight: 500; font-size: 14px; }
.ax-perms span { display: block; font-size: 12.5px; color: var(--ax-ink-2); line-height: 1.45; margin-top: 2px; }
.ax-foot { font-size: 12px; color: var(--ax-ink-2); margin-top: 16px; text-align: center; line-height: 1.5; }
.ax-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--ax-green-bg); color: var(--ax-green); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 500; }
.ax-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ax-green-dot); }
.ax-filerow { display: flex; align-items: center; gap: 12px; border: 1px solid var(--ax-line); border-radius: 12px; padding: 14px 16px; text-align: left; margin-bottom: 20px; }
.ax-filerow > div { flex: 1; min-width: 0; }
.ax-filerow b { display: block; font-weight: 500; font-size: 14px; overflow-wrap: anywhere; }
.ax-filerow small { display: block; font-size: 12.5px; color: var(--ax-ink-2); overflow-wrap: anywhere; }
.ax-tag { background: #f2f4f7; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 500; flex: none; }
.ax-tag--demo { background: var(--ax-tint); color: #1d4ed8; }

/* ---------- Analyze ---------- */
.ax-srcrow { display: flex; align-items: center; gap: 12px; background: #f4f6fa; border-radius: 12px; padding: 12px 16px; margin-bottom: 24px; }
.ax-srcrow > div { flex: 1; min-width: 0; }
.ax-srcrow b { display: block; font-weight: 500; overflow-wrap: anywhere; }
.ax-srcrow small { color: var(--ax-ink-2); font-size: 12.5px; }
.ax-card--wide > h1 { font-size: 24px; font-weight: 600; line-height: 1.25; }
.ax-card--wide > .sub { color: var(--ax-ink-2); margin-top: 6px; }
.ax-prog__t { display: flex; justify-content: space-between; margin: 24px 0 8px; font-size: 13px; }
.ax-prog__t span:last-child { color: var(--ax-ink-3); }
.ax-prog { height: 8px; border-radius: 99px; background: #f2f4f7; overflow: hidden; }
.ax-prog i { display: block; height: 100%; width: 0; background: #000; border-radius: 99px; transition: width 260ms cubic-bezier(.3,.7,.3,1); }
.ax-prog.is-fail i { background: var(--ax-red-dot); }
.ax-asteps { border: 1px solid var(--ax-line); border-radius: 12px; margin-top: 20px; overflow: hidden; }
.ax-asteps li { display: flex; gap: 14px; padding: 14px 16px; align-items: center; transition: background var(--ax-t); }
.ax-asteps li + li { border-top: 1px solid var(--ax-line); }
.ax-asteps li.is-active { background: #f0f6ff; }
.ax-asteps li b { display: block; font-weight: 500; }
.ax-asteps li span.d { display: block; font-size: 12.5px; color: var(--ax-ink-2); }
.ax-asteps li.is-todo b, .ax-asteps li.is-todo span.d { color: var(--ax-ink-3); }
.ax-si { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 12px; background: #f2f4f7; color: var(--ax-ink-2); transition: all var(--ax-t); }
.ax-si .ico { display: none; font-size: 14px; stroke-width: 2.6; }
.ax-asteps li.is-done .ax-si { background: #000; color: #fff; }
.ax-asteps li.is-done .ax-si .n, .ax-asteps li.is-active .ax-si .n, .ax-asteps li.is-fail .ax-si .n { display: none; }
.ax-asteps li.is-done .ax-si .ico-ok { display: block; }
.ax-asteps li.is-active .ax-si { background: #fff; box-shadow: 0 0 0 1.5px #000 inset; }
.ax-asteps li.is-active .ax-si::after { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid #000; border-right-color: transparent; animation: ax-spin 800ms linear infinite; }
.ax-asteps li.is-fail .ax-si { background: var(--ax-red-bg); color: var(--ax-red); }
.ax-asteps li.is-fail .ico-bad { display: block; }
.ax-asteps li.is-fail { background: #fffbfa; }
.ax-afoot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; font-size: 12.5px; color: var(--ax-ink-2); }
.ax-fail { display: flex; gap: 12px; background: var(--ax-red-bg); border: 1px solid #fecdca; border-radius: 12px; padding: 14px 16px; margin-top: 20px; color: var(--ax-red); }
.ax-fail .ico { font-size: 18px; margin-top: 2px; }
.ax-fail b { display: block; font-weight: 500; }
.ax-fail span { font-size: 12.5px; color: #912018; }

/* ---------- Report shell ---------- */
.rp { display: grid; grid-template-columns: 208px minmax(0, 1fr) 340px; min-height: 100vh; background: var(--ax-bg); animation: ax-fade 240ms var(--ax-ease) both; }
@keyframes ax-fade { from { opacity: 0; } to { opacity: 1; } }
.rp-side { position: sticky; top: 0; height: 100vh; background: #f0f4fa; padding: 16px 16px 16px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; border-right: 1px solid var(--ax-line); }
.rp-side .ax-brand img { display: block; }
.rp-file { background: #fff; border-radius: 8px; padding: 10px 12px; font-size: 12px; box-shadow: var(--ax-shadow); }
.rp-file small { display: block; color: var(--ax-ink-3); font-size: 11.5px; }
.rp-file b { font-weight: 500; font-size: 13px; overflow-wrap: anywhere; }
.rp-nav { display: flex; flex-direction: column; gap: 2px; }
.rp-nav a, .rp-nav button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border-radius: 8px; border: 0; background: none; text-align: left; font-size: 13px; color: var(--ax-ink); transition: background var(--ax-t), color var(--ax-t); }
.rp-nav .ico { font-size: 16px; color: var(--ax-ink-2); }
.rp-nav a:hover, .rp-nav button:hover { background: rgba(255,255,255,.7); }
.rp-nav a[aria-current="page"] { background: #fff; font-weight: 500; box-shadow: 0 1px 2px rgba(16,24,40,.05); }
.rp-nav .cnt { margin-left: auto; font-size: 12px; font-weight: 500; }
.rp-nav__foot { margin-top: auto; }

.rp-main { padding: 24px; min-width: 0; }
.rp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.rp-head h1 { font-size: 22px; font-weight: 600; line-height: 1.3; }
.rp-head p { font-size: 12.5px; color: var(--ax-ink-2); }
.rp-head__a { display: flex; gap: 10px; position: relative; }
.rp-demo { display: flex; align-items: center; gap: 10px; margin-top: 16px; background: var(--ax-tint); border: 1px solid #d6e4ff; color: #1e3a8a; border-radius: 8px; padding: 10px 14px; font-size: 12.5px; }
.rp-demo .ico { font-size: 15px; color: var(--ax-brand); flex: none; }
.rp-demo span { flex: 1; }
.rp-demo b { font-weight: 500; font-size: 12px; color: var(--ax-brand); white-space: nowrap; }
.rp-menu { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border-radius: 10px; box-shadow: var(--ax-shadow-hover), 0 0 0 1px var(--ax-line); padding: 6px; min-width: 190px; z-index: 30; animation: ax-pop 150ms var(--ax-ease); }
@keyframes ax-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.rp-menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 6px; font-size: 13px; }
.rp-menu button:hover, .rp-menu button:focus-visible { background: var(--ax-low-bg); }
.rp-menu small { display: block; color: var(--ax-ink-3); font-size: 11.5px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.kpi { background: #fff; border-radius: 12px; padding: 14px 14px 12px; box-shadow: var(--ax-shadow); transition: transform var(--ax-t) var(--ax-ease), box-shadow var(--ax-t); animation: ax-rise 280ms var(--ax-ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--ax-shadow-hover); }
.kpi small { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ax-ink-2); }
.kpi small i { width: 6px; height: 6px; border-radius: 50%; background: var(--ax-red-dot); }
.kpi b { display: block; font-size: 28px; font-weight: 600; line-height: 1.2; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 11.5px; color: var(--ax-ink-3); }
@keyframes ax-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.tb { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.chip { border: 0; background: #fff; border-radius: 999px; padding: 7px 14px; font-size: 12.5px; box-shadow: 0 0 0 1px var(--ax-line) inset; transition: all var(--ax-t); display: inline-flex; gap: 6px; align-items: center; }
.chip small { font-size: 11px; color: var(--ax-ink-3); font-variant-numeric: tabular-nums; }
.chip:hover { box-shadow: 0 0 0 1px #c4cbd8 inset; transform: translateY(-1px); }
.chip[aria-pressed="true"] { background: #000; color: #fff; box-shadow: none; }
.chip[aria-pressed="true"] small { color: #d0d5dd; }
.tb__cat { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ax-ink-2); }
.sel { position: relative; }
.sel select { appearance: none; -webkit-appearance: none; background: #fff; border: 0; box-shadow: 0 0 0 1px var(--ax-line) inset; border-radius: 8px; padding: 7px 32px 7px 10px; font-size: 12.5px; color: var(--ax-ink); }
.sel .ico { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; font-size: 14px; }

.fl { display: flex; flex-direction: column; gap: 14px; }
.fc { background: #fff; border-radius: 12px; padding: 16px; box-shadow: var(--ax-shadow); cursor: pointer; border: 2px solid transparent; transition: transform var(--ax-t) var(--ax-ease), box-shadow var(--ax-t), border-color var(--ax-t); animation: ax-rise 300ms var(--ax-ease) both; animation-delay: calc(min(var(--i, 0), 10) * 40ms); }
.fc:hover { transform: translateY(-2px); box-shadow: var(--ax-shadow-hover); }
.fc.is-sel { border-color: #000; }
.fc.is-rev { opacity: .72; }
.fc__h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.fc__h h3 { font-size: 15px; font-weight: 500; line-height: 1.35; }
.fc__pills { display: flex; gap: 6px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.fc__aff { font-size: 11.5px; color: var(--ax-ink-3); margin-top: 2px; overflow-wrap: anywhere; }
.fc__sum { font-size: 13px; color: var(--ax-ink-2); margin: 12px 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; background: #f7f8fb; border-radius: 8px; padding: 10px; }
.tile { background: #fff; border-radius: 6px; padding: 8px 10px; font-size: 12px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.tile i { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1px rgba(16,24,40,.12) inset; }
.tile small { display: block; font-size: 11px; color: var(--ax-ink-3); overflow-wrap: anywhere; }
.tile b { display: block; font-weight: 500; font-size: 12px; overflow-wrap: anywhere; }
.fc__fix { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; margin-top: 12px; }
.fc__fix .ico { color: var(--ax-brand); font-size: 15px; margin-top: 2px; }
.fc__f { display: flex; justify-content: flex-end; margin-top: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 9px; font-size: 11.5px; font-weight: 500; background: var(--ax-low-bg); color: var(--ax-low); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill--high { background: var(--ax-red-bg); color: var(--ax-red); } .pill--high::before { background: var(--ax-red-dot); }
.pill--medium { background: var(--ax-amber-bg); color: var(--ax-amber); } .pill--medium::before { background: var(--ax-amber-dot); }
.pill--low { background: var(--ax-low-bg); color: var(--ax-low); } .pill--low::before { background: var(--ax-low-dot); }
.pill--demo { background: #f2f4f7; color: var(--ax-low); font-weight: 400; } .pill--demo::before { display: none; }
.pill--ok { background: var(--ax-green-bg); color: var(--ax-green); } .pill--ok::before { background: var(--ax-green-dot); }

.empty { background: #fff; border-radius: 12px; box-shadow: var(--ax-shadow); padding: 48px 24px; text-align: center; animation: ax-rise 300ms var(--ax-ease) both; }
.empty .ax-ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 14px; background: var(--ax-green-bg); color: var(--ax-green-dot); font-size: 24px; }
.empty .ax-ic--n { background: #f2f4f7; color: var(--ax-ink-2); }
.empty h2 { font-size: 18px; font-weight: 600; }
.empty p { color: var(--ax-ink-2); max-width: 420px; margin: 8px auto 20px; font-size: 13px; }

/* Overview + settings */
.ov { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.box { background: #fff; border-radius: 12px; padding: 18px; box-shadow: var(--ax-shadow); animation: ax-rise 300ms var(--ax-ease) both; animation-delay: 120ms; }
.box h2 { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.brow { display: grid; grid-template-columns: 96px 1fr 28px; align-items: center; gap: 10px; padding: 7px 0; font-size: 12.5px; }
.brow a { text-decoration: underline; text-decoration-color: transparent; }
.brow a:hover { text-decoration-color: currentColor; }
.bar { height: 8px; background: #f2f4f7; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ax-brand); border-radius: 99px; transition: width 400ms var(--ax-ease); }
.brow b { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.top3 li + li { border-top: 1px solid var(--ax-line); }
.top3 button { width: 100%; background: none; border: 0; display: flex; gap: 10px; align-items: center; justify-content: space-between; text-align: left; padding: 10px 0; font-size: 13px; }
.top3 button:hover b { color: var(--ax-brand); }
.top3 b { font-weight: 500; }
.ov .box--full { grid-column: 1 / -1; }
.set { max-width: 720px; margin-top: 16px; }
.set .box + .box { margin-top: 14px; }
.set__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
.set__row + .set__row { border-top: 1px solid var(--ax-line); }
.set__row b { display: block; font-weight: 500; font-size: 13.5px; }
.set__row span.d { font-size: 12.5px; color: var(--ax-ink-2); }
.sw { position: relative; width: 40px; height: 24px; border-radius: 99px; border: 0; background: #d0d5dd; flex: none; transition: background var(--ax-t); padding: 0; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.25); transition: transform var(--ax-t) var(--ax-ease); }
.sw[aria-checked="true"] { background: #000; }
.sw[aria-checked="true"]::after { transform: translateX(16px); }
.seg { display: inline-flex; background: #f2f4f7; border-radius: 8px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 6px; font-size: 12.5px; transition: all var(--ax-t); }
.seg button[aria-checked="true"] { background: #fff; font-weight: 500; box-shadow: 0 1px 2px rgba(16,24,40,.12); }
.set__note { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--ax-ink-2); margin-top: 14px; }

/* ---------- Details panel ---------- */
.dp { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: #fff; border-left: 1px solid var(--ax-line); padding: 24px 20px; }
.dp__h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.dp__h h2 { font-size: 14px; font-weight: 600; }
.ax-x { width: 32px; height: 32px; display: grid; place-items: center; background: none; border: 0; border-radius: 8px; color: var(--ax-ink-2); transition: background var(--ax-t); }
.ax-x:hover { background: var(--ax-low-bg); color: var(--ax-ink); }
.dp__pills { display: flex; gap: 6px; flex-wrap: wrap; }
.dp h3.t { font-size: 18px; font-weight: 600; line-height: 1.3; margin: 10px 0 18px; }
.dp h3.t:focus { outline: none; }
.dp h4 { font-size: 12.5px; font-weight: 600; margin: 18px 0 8px; }
.dp p.s { font-size: 12.5px; color: var(--ax-ink-2); }
.dp-aff { display: flex; flex-direction: column; gap: 8px; }
.dp-aff li { display: flex; gap: 10px; align-items: center; border: 1px solid var(--ax-line); border-radius: 8px; padding: 9px 10px; font-size: 12px; }
.dp-aff li .ico { color: var(--ax-ink-2); font-size: 14px; }
.dp-aff b { display: block; font-weight: 500; font-size: 12.5px; overflow-wrap: anywhere; }
.dp-aff small { font-size: 11px; color: var(--ax-ink-3); }
.cvr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cvr > div { border-radius: 10px; padding: 8px; font-size: 11px; }
.cvr .cur { background: #fef3f2; } .cvr .rec { background: #ecfdf3; }
.cvr .sw-box { height: 52px; border-radius: 6px; margin-bottom: 8px; display: grid; place-items: center; font-weight: 600; font-size: 14px; background: #fff; box-shadow: 0 0 0 1px rgba(16,24,40,.08) inset; text-align: center; padding: 0 4px; overflow-wrap: anywhere; }
.cvr b { display: block; font-weight: 500; font-size: 11.5px; }
.cvr small { display: block; color: var(--ax-ink-3); font-size: 11px; overflow-wrap: anywhere; }
.dp-steps li { display: flex; gap: 10px; font-size: 12.5px; color: var(--ax-ink-2); padding: 4px 0; }
.dp-steps b { width: 18px; height: 18px; border-radius: 50%; background: var(--ax-tint); color: var(--ax-brand); display: grid; place-items: center; font-size: 10.5px; font-weight: 500; flex: none; margin-top: 1px; }
.dp__act { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.dp__act .ax-btn { min-height: 40px; font-size: 13px; }
.dp__empty { text-align: center; color: var(--ax-ink-3); font-size: 12.5px; padding: 48px 12px; }
.dp__empty .ico { font-size: 28px; display: block; margin: 0 auto 10px; color: #98a2b3; }
.dp-back { display: none; }
.dp-fill { animation: ax-fade 200ms var(--ax-ease); }

/* ---------- Dialogs / toast ---------- */
.ax-dlg { border: 0; border-radius: 16px; padding: 0; width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: 0 24px 64px rgba(16,24,40,.28); color: var(--ax-ink); font-family: var(--font-family); overflow: hidden; }
.ax-dlg--wide { width: min(620px, calc(100vw - 32px)); }
.ax-dlg[open] { display: flex; flex-direction: column; animation: ax-pop2 200ms var(--ax-ease); }
.ax-dlg::backdrop { background: rgba(16,24,40,.45); animation: ax-fade 200ms ease; }
@keyframes ax-pop2 { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.ax-dlg__head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 8px; }
.ax-dlg__head h2 { font-size: 18px; font-weight: 600; }
.ax-dlg__body { padding: 8px 24px 16px; overflow-y: auto; font-size: 13.5px; }
.ax-dlg__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 24px 20px; }
.ax-dlg__foot .ax-btn { min-height: 40px; font-size: 14px; }
.ax-faq { border: 1px solid var(--ax-line); border-radius: 10px; margin-top: 10px; transition: border-color var(--ax-t), background var(--ax-t); }
.ax-faq[open] { background: #fafbfd; border-color: #d6e4ff; }
.ax-faq summary { padding: 12px 14px; font-weight: 500; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; border-radius: 10px; }
.ax-faq summary::-webkit-details-marker { display: none; }
.ax-faq summary::after { content: "+"; font-size: 18px; line-height: 1; color: var(--ax-ink-3); }
.ax-faq[open] summary::after { content: "\2212"; }
.ax-faq > div { padding: 0 14px 14px; color: var(--ax-ink-2); font-size: 13px; }
.ax-faq > div > * + * { margin-top: 8px; }
.ax-ol { list-style: decimal; padding-left: 18px !important; } .ax-ul { list-style: disc; padding-left: 18px !important; }
.ax-ol li, .ax-ul li { padding: 2px 0; }
.ax-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: #101828; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity 200ms, transform 200ms var(--ax-ease); z-index: 400; max-width: calc(100vw - 32px); }
.ax-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.rp-scrim { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1099px) {
  .rp { grid-template-columns: 208px minmax(0, 1fr); }
  .dp { position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100vw); height: auto; z-index: 60; box-shadow: -12px 0 40px rgba(16,24,40,.18); transform: translateX(105%); visibility: hidden; transition: transform 220ms var(--ax-ease), visibility 0s linear 220ms; }
  .dp.is-open { transform: none; visibility: visible; transition: transform 220ms var(--ax-ease); }
  .rp-scrim { display: block; position: fixed; inset: 0; background: rgba(16,24,40,.35); z-index: 55; opacity: 0; pointer-events: none; transition: opacity 200ms; }
  .rp-scrim.is-on { opacity: 1; pointer-events: auto; }
}
@media (max-width: 760px) {
  .ax-card { padding: 22px 18px; }
  .ax-steps { padding-top: 22px; }
  .ax-steps li:not(.is-current) .ax-steps__lbl { display: none; }
  .ax-steps li:not(:last-child)::after { margin: 0 8px; }
  .ax-btnrow { flex-direction: column-reverse; }
  .ax-afoot { flex-direction: column-reverse; align-items: stretch; text-align: center; }
  .ax-top__title { font-size: 13px; }
  .rp { grid-template-columns: minmax(0, 1fr); }
  .rp-side { position: sticky; top: 0; height: auto; z-index: 40; flex-direction: row; align-items: center; gap: 8px; padding: 8px 12px; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--ax-line); scrollbar-width: none; }
  .rp-side::-webkit-scrollbar { display: none; }
  .rp-side .ax-brand, .rp-file { display: none; }
  .rp-nav { flex-direction: row; gap: 4px; flex: none; }
  .rp-nav a, .rp-nav button { width: auto; white-space: nowrap; padding: 8px 12px; gap: 8px; }
  .rp-nav__foot { margin-top: 0; }
  .rp-nav__foot::before { content: ""; width: 1px; align-self: stretch; background: #d0d5dd; margin: 4px 4px; }
  .rp-main { padding: 16px 14px 32px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .ov { grid-template-columns: minmax(0, 1fr); }
  .tb__cat { margin-left: 0; width: 100%; }
  .tb__cat .sel { flex: 1; } .tb__cat select { width: 100%; }
  .fc__h { flex-direction: column; } .fc__pills { justify-content: flex-start; }
  .rp-head__a { width: 100%; } .rp-head__a .ax-btn { flex: 1; }
  .rp-demo { align-items: flex-start; flex-wrap: wrap; }
  .dp { top: auto; left: 0; right: 0; width: 100%; max-height: 86vh; border-radius: 16px 16px 0 0; transform: translateY(105%); }
  .dp.is-open { transform: none; }
  .dp::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: #d0d5dd; margin: -12px auto 14px; }
}
@media (max-width: 420px) {
  .brow { grid-template-columns: 84px 1fr 24px; }
  .cvr { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; transition-delay: 0ms !important; scroll-behavior: auto !important; }
}

#stage.is-report { padding: 0; }
.no-anim .fc, .no-anim .empty { animation: none; }
