/*
 * MEO NextGen — Developer / Admin design system
 * DEV DEVELOPER area only (/developer/ and /nextgen/ management pages).
 * Presentation only: no page depends on this file for behaviour.
 * Created 2026-10-06.
 */

:root {
    --ng-ink: #0F1B33;
    --ng-ink-2: #34405A;
    --ng-muted: #5D6880;
    --ng-faint: #8A93A8;
    --ng-line: #E3E8F1;
    --ng-line-2: #CDD5E3;
    --ng-bg: #F2F5FA;
    --ng-surface: #FFFFFF;
    --ng-surface-2: #F7F9FC;

    --ng-navy: #0B1630;
    --ng-navy-2: #13254A;

    --ng-brand: #1E63AE;
    --ng-brand-dark: #154C87;
    --ng-teal: #0B8A99;

    /* Module accents */
    --ng-sba: #1E63AE;
    --ng-sba-2: #2F86D6;
    --ng-sba-tint: #E7F0FB;
    --ng-emq: #6A3FD0;
    --ng-emq-2: #9064EE;
    --ng-emq-tint: #F0EAFD;
    --ng-ff: #0B8A99;
    --ng-ff-2: #16AFAF;
    --ng-ff-tint: #E2F4F5;
    --ng-ai: #C2560F;
    --ng-ai-2: #E7892F;
    --ng-ai-tint: #FCEEDF;
    --ng-cls: #34479A;
    --ng-cls-2: #5A6FD0;
    --ng-cls-tint: #E9ECFA;
    --ng-src: #1F8A52;
    --ng-src-2: #35B377;
    --ng-src-tint: #E3F5EB;

    /* Semantic */
    --ng-ok: #1F8A52;
    --ng-ok-tint: #E3F5EB;
    --ng-warn: #A8600C;
    --ng-warn-tint: #FCF0DD;
    --ng-danger: #BE3434;
    --ng-danger-tint: #FBE9E9;

    --ng-r-lg: 20px;
    --ng-r: 14px;
    --ng-r-sm: 10px;
    --ng-r-xs: 7px;

    --ng-e1: 0 1px 2px rgba(15, 27, 51, .05), 0 2px 8px rgba(15, 27, 51, .04);
    --ng-e2: 0 2px 6px rgba(15, 27, 51, .05), 0 14px 34px rgba(15, 27, 51, .09);
    --ng-e3: 0 10px 24px rgba(15, 27, 51, .10), 0 30px 60px rgba(15, 27, 51, .14);

    --ng-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --ng-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --ng-width: 1240px;

    --accent: var(--ng-brand);
    --accent-2: var(--ng-sba-2);
    --accent-tint: var(--ng-sba-tint);
}

/* Module scoping: any element can carry an accent */
.m-dashboard { --accent: #1E63AE; --accent-2: #0B8A99; --accent-tint: #E7F0FB; }
.m-questions { --accent: #2A4F9E; --accent-2: #5B5FD6; --accent-tint: #ECEEFB; }
.m-sba { --accent: var(--ng-sba); --accent-2: var(--ng-sba-2); --accent-tint: var(--ng-sba-tint); }
.m-emq { --accent: var(--ng-emq); --accent-2: var(--ng-emq-2); --accent-tint: var(--ng-emq-tint); }
.m-ff { --accent: var(--ng-ff); --accent-2: var(--ng-ff-2); --accent-tint: var(--ng-ff-tint); }
.m-ai { --accent: var(--ng-ai); --accent-2: var(--ng-ai-2); --accent-tint: var(--ng-ai-tint); }
.m-cls { --accent: var(--ng-cls); --accent-2: var(--ng-cls-2); --accent-tint: var(--ng-cls-tint); }
.m-src { --accent: var(--ng-src); --accent-2: var(--ng-src-2); --accent-tint: var(--ng-src-tint); }

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.ng {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(1200px 420px at 100% -10%, rgba(11, 138, 153, .07), transparent 60%),
        radial-gradient(900px 380px at -10% 0%, rgba(30, 99, 174, .07), transparent 60%),
        var(--ng-bg);
    color: var(--ng-ink);
    font: 15px/1.5 var(--ng-font);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.ng a { color: var(--accent); }
.ng a:hover { color: var(--ng-ink); }
.ng :focus-visible { outline: 3px solid rgba(30, 99, 174, .45); outline-offset: 2px; border-radius: 6px; }

.ng-num { font-variant-numeric: tabular-nums; }
.ng-mono { font-family: var(--ng-mono); font-size: .86em; }
.ng-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ng-skip {
    position: absolute; left: 12px; top: -60px; z-index: 100;
    background: var(--ng-ink); color: #fff !important; padding: 10px 14px; border-radius: 8px;
}
.ng-skip:focus { top: 12px; }

/* ---------------------------------------------------------------
   App bar
   --------------------------------------------------------------- */
.ng-appbar {
    position: sticky; top: 0; z-index: 40;
    background: linear-gradient(100deg, var(--ng-navy) 0%, var(--ng-navy-2) 100%);
    color: #fff;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 6px 20px rgba(8, 17, 38, .18);
}
.ng-appbar-inner {
    width: min(calc(100% - 32px), var(--ng-width));
    margin: 0 auto;
    display: flex; align-items: center; gap: 22px;
    min-height: 64px;
}
.ng-brand {
    display: flex; align-items: center; gap: 11px;
    color: #fff !important; text-decoration: none; flex: none;
}
.ng-brand-mark {
    width: 36px; height: 36px; border-radius: 11px; flex: none;
    display: grid; place-items: center;
    background: linear-gradient(135deg, #0B8A99 0%, #1868B4 55%, #2C4FA3 100%);
    box-shadow: 0 4px 14px rgba(11, 138, 153, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.ng-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.ng-brand-text strong { font-size: 15px; letter-spacing: .01em; }
.ng-brand-text small { font-size: 11px; color: #9FB4D6; letter-spacing: .08em; text-transform: uppercase; margin-top: 3px; }

.ng-nav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.ng-nav::-webkit-scrollbar { display: none; }
.ng-nav a {
    display: inline-flex; align-items: center; gap: 7px; flex: none;
    padding: 8px 12px; border-radius: 9px;
    color: #C5D2E8 !important; text-decoration: none; font-size: 13.5px; font-weight: 600;
    transition: background-color .15s ease, color .15s ease;
}
.ng-nav a svg { opacity: .8; }
.ng-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff !important; }
.ng-nav a[aria-current="page"] {
    background: rgba(255, 255, 255, .13); color: #fff !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.ng-nav a[aria-current="page"] svg { opacity: 1; }
.ng-env {
    flex: none; display: inline-flex; align-items: center; gap: 7px;
    padding: 5px 10px; border-radius: 999px;
    background: rgba(231, 137, 47, .16); color: #FFC98F; font-size: 11px; font-weight: 700; letter-spacing: .08em;
    box-shadow: inset 0 0 0 1px rgba(231, 137, 47, .35);
}
.ng-env::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #F2A14E; box-shadow: 0 0 0 3px rgba(242, 161, 78, .25); }

/* ---------------------------------------------------------------
   Page shell / hero
   --------------------------------------------------------------- */
.ng-main { width: min(calc(100% - 32px), var(--ng-width)); margin: 0 auto; padding: 22px 0 70px; }
.ng-main.narrow { max-width: 1080px; }

.ng-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 14px; font-size: 13px; color: var(--ng-muted); list-style: none; padding: 0; }
.ng-crumbs li { display: inline-flex; align-items: center; gap: 6px; }
.ng-crumbs li + li::before { content: ""; width: 6px; height: 6px; border-right: 1.6px solid var(--ng-faint); border-top: 1.6px solid var(--ng-faint); transform: rotate(45deg); margin-right: 4px; }
.ng-crumbs a { color: var(--ng-ink-2) !important; text-decoration: none; font-weight: 600; }
.ng-crumbs a:hover { color: var(--accent) !important; text-decoration: underline; }
.ng-crumbs [aria-current] { color: var(--ng-ink); font-weight: 700; }

.ng-hero {
    position: relative; overflow: hidden;
    border-radius: var(--ng-r-lg);
    padding: 26px 28px;
    color: #fff;
    background:
        radial-gradient(600px 220px at 95% -20%, rgba(255, 255, 255, .20), transparent 60%),
        linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);
    box-shadow: var(--ng-e2);
    margin-bottom: 22px;
}
.ng-hero::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
        linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px) 0 0 / 28px 28px,
        linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px) 0 0 / 28px 28px;
    -webkit-mask-image: linear-gradient(100deg, transparent 35%, #000 100%);
    mask-image: linear-gradient(100deg, transparent 35%, #000 100%);
}
.ng-hero > * { position: relative; z-index: 1; }
.ng-hero-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.ng-hero-title { display: flex; gap: 16px; align-items: center; min-width: 0; }
.ng-hero-icon {
    width: 54px; height: 54px; flex: none; border-radius: 16px;
    display: grid; place-items: center;
    background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
    font-weight: 800; font-size: 17px; letter-spacing: .02em;
}
.ng-eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .82; margin: 0 0 4px; }
.ng-hero h1 { margin: 0; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.15; letter-spacing: -.01em; }
.ng-hero p.lead { margin: 8px 0 0; max-width: 680px; color: rgba(255, 255, 255, .86); font-size: 14.5px; }
.ng-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ng-hero-actions .ng-search { width: min(440px, 100%); }
.ng-hero-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.ng-hero-stat {
    padding: 10px 14px; border-radius: 12px; min-width: 112px;
    background: rgba(255, 255, 255, .13); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}
.ng-hero-stat b { display: block; font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ng-hero-stat span { font-size: 12px; opacity: .85; }

/* ---------------------------------------------------------------
   Buttons
   --------------------------------------------------------------- */
.ng-btn,
.ng button.ng-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 40px; padding: 9px 16px;
    border-radius: var(--ng-r-sm);
    border: 1px solid var(--ng-line-2);
    background: var(--ng-surface);
    color: var(--ng-ink) !important;
    font: inherit; font-size: 14px; font-weight: 650; line-height: 1.15;
    text-decoration: none !important; cursor: pointer; white-space: nowrap;
    box-shadow: 0 1px 1px rgba(15, 27, 51, .04);
    transition: transform .14s ease, box-shadow .14s ease, background-color .14s ease, border-color .14s ease, color .14s ease;
}
.ng-btn:hover { border-color: var(--ng-ink-2); transform: translateY(-1px); box-shadow: var(--ng-e1); }
.ng-btn:active { transform: translateY(0); }
.ng-btn-primary {
    color: #fff !important; border-color: transparent;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 30%, transparent), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.ng-btn-primary:hover { border-color: transparent; filter: brightness(1.06); box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 36%, transparent); }
.ng-btn-dark { color: #fff !important; background: var(--ng-ink); border-color: var(--ng-ink); }
.ng-btn-dark:hover { background: #000; }
.ng-btn-soft { background: var(--accent-tint); border-color: transparent; color: var(--accent) !important; }
.ng-btn-soft:hover { border-color: var(--accent); }
.ng-btn-warn { background: var(--ng-warn-tint); border-color: #E6C48D; color: #7A4508 !important; }
.ng-btn-warn:hover { border-color: var(--ng-warn); }
.ng-btn-danger { color: var(--ng-danger) !important; border-color: #E8BDBD; background: #fff; }
.ng-btn-danger:hover { background: var(--ng-danger-tint); border-color: var(--ng-danger); }
.ng-btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.ng-btn-ghost:hover { background: rgba(15, 27, 51, .05); border-color: transparent; box-shadow: none; }
.ng-btn-onhero { background: rgba(255, 255, 255, .14); color: #fff !important; border-color: rgba(255, 255, 255, .32); box-shadow: none; }
.ng-btn-onhero:hover { background: rgba(255, 255, 255, .24); border-color: #fff; }
.ng-btn-light { background: #fff; color: var(--accent) !important; border-color: transparent; box-shadow: 0 6px 18px rgba(0, 0, 0, .14); }
.ng-btn-light:hover { color: var(--ng-ink) !important; }
.ng-btn-sm { min-height: 32px; padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.ng-btn-lg { min-height: 48px; padding: 12px 20px; font-size: 15px; }
.ng-btn[disabled],
.ng-btn.is-disabled { opacity: .45; pointer-events: none; transform: none; box-shadow: none; }

/* ---------------------------------------------------------------
   Pills / badges
   --------------------------------------------------------------- */
.ng-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 9px; border-radius: 999px;
    font-size: 12px; font-weight: 700; line-height: 1.35; white-space: nowrap;
    background: #EEF1F6; color: var(--ng-ink-2);
    box-shadow: inset 0 0 0 1px rgba(15, 27, 51, .06);
}
.ng-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.ng-pill-lg { padding: 6px 12px; font-size: 13px; }

.ng-type {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 9px 3px 4px; border-radius: 8px;
    font-size: 12px; font-weight: 800; letter-spacing: .03em; white-space: nowrap;
}
.ng-type i {
    font-style: normal; display: grid; place-items: center;
    width: 20px; height: 20px; border-radius: 6px; color: #fff; font-size: 10.5px;
}
.ng-type-sba { background: var(--ng-sba-tint); color: var(--ng-sba); }
.ng-type-sba i { background: linear-gradient(135deg, var(--ng-sba), var(--ng-sba-2)); }
.ng-type-emq { background: var(--ng-emq-tint); color: var(--ng-emq); }
.ng-type-emq i { background: linear-gradient(135deg, var(--ng-emq), var(--ng-emq-2)); }
.ng-type-other { background: #EEF1F6; color: var(--ng-ink-2); }
.ng-type-other i { background: var(--ng-muted); }

/* Status colours — raw SQL status value is always printed */
.st-draft { background: #EEF0F4; color: #4B5468; }
.st-generated { background: #E8EEF9; color: #2C4A86; }
.st-in_review, .st-needs_review { background: var(--ng-warn-tint); color: #8A4E08; }
.st-stored, .st-sent_to_stock { background: #ECEAFB; color: #4A3BA6; }
.st-ready_web, .st-approved { background: #DDF3F5; color: #076B77; }
.st-published { background: var(--ng-ok-tint); color: #146B3E; box-shadow: inset 0 0 0 1px rgba(31, 138, 82, .25); }
.st-retired { background: #F1E7E7; color: #8A3A3A; }
.st-unknown { background: #EEF1F6; color: var(--ng-ink-2); }

.ng-dest { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 650; color: var(--ng-ink-2); white-space: nowrap; }
.ng-dest svg { color: var(--ng-faint); }

.ng-visible-flag { font-size: 11px; font-weight: 700; color: var(--ng-ok); white-space: nowrap; }

/* ---------------------------------------------------------------
   Cards / panels
   --------------------------------------------------------------- */
.ng-card {
    background: var(--ng-surface);
    border: 1px solid var(--ng-line);
    border-radius: var(--ng-r);
    box-shadow: var(--ng-e1);
    margin-bottom: 18px;
}
.ng-card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 15px 20px; border-bottom: 1px solid var(--ng-line);
}
.ng-card-head h2,
.ng-card-head h3 { margin: 0; font-size: 15.5px; display: flex; align-items: center; gap: 9px; }
.ng-card-head h2 .ic,
.ng-card-head h3 .ic { color: var(--accent); display: inline-grid; }
.ng-card-head .sub { font-size: 12.5px; color: var(--ng-muted); font-weight: 500; }
.ng-card-body { padding: 18px 20px; }
.ng-card-foot { padding: 14px 20px; border-top: 1px solid var(--ng-line); background: var(--ng-surface-2); border-radius: 0 0 var(--ng-r) var(--ng-r); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.ng-section-title {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    margin: 30px 0 14px;
}
.ng-section-title h2 { margin: 0; font-size: 19px; letter-spacing: -.005em; }
.ng-section-title p { margin: 0; color: var(--ng-muted); font-size: 13.5px; }

.ng-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.ng-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.ng-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }

/* ---------------------------------------------------------------
   Dashboard — Question type cards (SBA / EMQ)
   --------------------------------------------------------------- */
.ng-qtype {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column;
    border-radius: var(--ng-r-lg);
    background: var(--ng-surface);
    border: 1px solid var(--ng-line);
    box-shadow: var(--ng-e1);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.ng-qtype:hover { transform: translateY(-3px); box-shadow: var(--ng-e3); border-color: color-mix(in srgb, var(--accent) 40%, var(--ng-line)); }
.ng-qtype-top {
    position: relative;
    padding: 22px 22px 20px;
    color: #fff;
    background:
        radial-gradient(420px 160px at 100% 0%, rgba(255, 255, 255, .22), transparent 60%),
        linear-gradient(125deg, var(--accent) 0%, var(--accent-2) 100%);
}
.ng-qtype-top::after {
    content: ""; position: absolute; right: -20px; bottom: -36px; width: 180px; height: 180px; border-radius: 50%;
    border: 26px solid rgba(255, 255, 255, .08); pointer-events: none;
}
.ng-qtype-link { position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
.ng-qtype-link:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }
.ng-qtype-head { display: flex; align-items: center; gap: 16px; }
.ng-qtype-mono {
    width: 66px; height: 66px; flex: none; border-radius: 18px;
    display: grid; place-items: center;
    font-size: 21px; font-weight: 850; letter-spacing: .03em;
    background: rgba(255, 255, 255, .18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .32), 0 10px 24px rgba(0, 0, 0, .12);
}
.ng-qtype-head h3 { margin: 0; font-size: 21px; line-height: 1.15; letter-spacing: -.01em; }
.ng-qtype-head p { margin: 4px 0 0; font-size: 13.5px; color: rgba(255, 255, 255, .86); }
.ng-qtype-count { margin-top: 18px; display: flex; align-items: baseline; gap: 10px; }
.ng-qtype-count b { font-size: 44px; line-height: 1; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ng-qtype-count span { font-size: 13px; color: rgba(255, 255, 255, .85); }
.ng-qtype-body { padding: 18px 22px 6px; flex: 1; }
.ng-qtype-foot { position: relative; z-index: 3; padding: 14px 22px 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.ng-qtype-foot .ng-btn { flex: 1 1 auto; }
.ng-qtype-body .ng-kv-row a,
.ng-qtype-body .ng-chiprow a { position: relative; z-index: 3; }

.ng-mini-label { font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .09em; color: var(--ng-faint); margin: 0 0 8px; }

/* Stacked status bar */
.ng-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: #EDF0F5; gap: 2px; }
.ng-bar span { display: block; min-width: 4px; }
.b-draft { background: #A7AFBF; }
.b-generated { background: #6C88C4; }
.b-in_review, .b-needs_review { background: #E0A03E; }
.b-stored, .b-sent_to_stock { background: #8676DB; }
.b-ready_web, .b-approved { background: #23A9B7; }
.b-published { background: #2AA466; }
.b-retired { background: #C98585; }
.b-unknown { background: #B5BCCB; }
.ng-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 10px 0 16px; font-size: 12.5px; color: var(--ng-ink-2); list-style: none; padding: 0; }
.ng-legend li { display: inline-flex; align-items: center; gap: 6px; }
.ng-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.ng-legend b { font-variant-numeric: tabular-nums; }

.ng-chiprow { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.ng-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 12px; border-radius: 10px;
    background: var(--ng-surface-2); border: 1px solid var(--ng-line);
    color: var(--ng-ink-2) !important; text-decoration: none; font-size: 13px; font-weight: 650;
    transition: border-color .14s ease, background-color .14s ease, color .14s ease;
}
.ng-chip b { font-variant-numeric: tabular-nums; color: var(--ng-ink); }
.ng-chip:hover { border-color: var(--accent); background: var(--accent-tint); color: var(--accent) !important; }
.ng-chip.is-active { background: var(--ng-ink); border-color: var(--ng-ink); color: #fff !important; }
.ng-chip.is-active b { color: #fff; }

/* Module tiles (F&F, AI, Classification, Sources) */
.ng-module {
    position: relative; display: flex; flex-direction: column;
    background: var(--ng-surface); border: 1px solid var(--ng-line); border-radius: var(--ng-r-lg);
    box-shadow: var(--ng-e1); overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.ng-module::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.ng-module:hover { transform: translateY(-2px); box-shadow: var(--ng-e2); border-color: color-mix(in srgb, var(--accent) 35%, var(--ng-line)); }
.ng-module-head { display: flex; gap: 14px; align-items: flex-start; padding: 22px 22px 6px; }
.ng-module-icon {
    width: 48px; height: 48px; flex: none; border-radius: 14px; display: grid; place-items: center;
    color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 28%, transparent);
}
.ng-module-head h3 { margin: 0; font-size: 18px; letter-spacing: -.005em; }
.ng-module-head p { margin: 3px 0 0; font-size: 13px; color: var(--ng-muted); }
.ng-module-figure { margin-left: auto; text-align: right; }
.ng-module-figure b { display: block; font-size: 32px; font-weight: 800; line-height: 1; color: var(--ng-ink); font-variant-numeric: tabular-nums; }
.ng-module-figure span { font-size: 11.5px; color: var(--ng-muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.ng-module-body { padding: 14px 22px 4px; flex: 1; }
.ng-module-foot { padding: 12px 22px 20px; display: flex; gap: 10px; flex-wrap: wrap; }

/* Lifecycle pipeline */
.ng-pipe { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin: 4px 0 8px; list-style: none; padding: 0; }
.ng-pipe li {
    position: relative; padding: 9px 6px 8px; border-radius: 10px; text-align: center;
    background: var(--ng-surface-2); border: 1px solid var(--ng-line);
}
.ng-pipe li b { display: block; font-size: 18px; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--ng-faint); }
.ng-pipe li span { display: block; font-size: 10.5px; font-weight: 700; color: var(--ng-muted); letter-spacing: .02em; margin-top: 3px; word-break: break-word; }
.ng-pipe li.has b { color: var(--ng-ink); }
.ng-pipe li.has { background: #fff; border-color: var(--ng-line-2); }
.ng-pipe li.is-live { background: var(--ng-ok-tint); border-color: rgba(31, 138, 82, .35); }
.ng-pipe li.is-live b { color: #146B3E; }
.ng-pipe li.is-live::after { content: "candidate-visible"; display: block; font-size: 9px; font-weight: 800; color: var(--ng-ok); text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }
.ng-pipe-extra { font-size: 12px; color: var(--ng-muted); margin: 6px 0 0; }

.ng-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.ng-kv > div { padding: 12px 14px; border-radius: 12px; background: var(--ng-surface-2); border: 1px solid var(--ng-line); }
.ng-kv b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ng-kv span { font-size: 12px; color: var(--ng-muted); }
.ng-kv a { text-decoration: none; color: inherit !important; display: block; }

.ng-kv-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--ng-line); font-size: 14px; }
.ng-kv-row:last-child { border-bottom: 0; }
.ng-kv-row b { font-variant-numeric: tabular-nums; }

/* Activity list */
.ng-activity { list-style: none; margin: 0; padding: 0; }
.ng-activity li { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--ng-line); }
.ng-activity li:last-child { border-bottom: 0; }
.ng-activity .t { flex: 1; min-width: 0; }
.ng-activity .t a { font-weight: 700; color: var(--ng-ink) !important; text-decoration: none; }
.ng-activity .t a:hover { color: var(--ng-brand) !important; text-decoration: underline; }
.ng-activity .t small { display: block; color: var(--ng-muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ng-activity time { font-size: 12px; color: var(--ng-faint); white-space: nowrap; }

/* Callouts */
.ng-callout {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 14px 16px; border-radius: 12px; margin-bottom: 18px;
    background: var(--ng-surface); border: 1px solid var(--ng-line); font-size: 14px;
}
.ng-callout .ic { flex: none; margin-top: 1px; }
.ng-callout p { margin: 0; }
.ng-callout p + p { margin-top: 6px; }
.ng-callout-info { background: #EEF4FC; border-color: #C9DBF2; color: #1A3E6B; }
.ng-callout-ok { background: var(--ng-ok-tint); border-color: #A9D9BE; color: #135F37; }
.ng-callout-warn { background: var(--ng-warn-tint); border-color: #EBCB98; color: #6E3F06; }
.ng-callout-error { background: var(--ng-danger-tint); border-color: #E6B3B3; color: #7E1F1F; }

/* ---------------------------------------------------------------
   Segmented type switch (Questions list)
   --------------------------------------------------------------- */
.ng-switch { display: grid; grid-template-columns: 1fr 1.35fr 1.35fr; gap: 12px; margin-bottom: 18px; }
.ng-switch a {
    position: relative; display: flex; align-items: center; gap: 13px;
    padding: 14px 16px; border-radius: 16px; text-decoration: none;
    background: var(--ng-surface); border: 1.5px solid var(--ng-line);
    color: var(--ng-ink) !important; box-shadow: var(--ng-e1);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background-color .15s ease;
}
.ng-switch a:hover { transform: translateY(-2px); box-shadow: var(--ng-e2); border-color: var(--accent); }
.ng-switch .mono {
    width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center;
    font-weight: 850; font-size: 14px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.ng-switch .lbl { display: flex; flex-direction: column; min-width: 0; }
.ng-switch .lbl strong { font-size: 15px; line-height: 1.2; }
.ng-switch .lbl small { color: var(--ng-muted); font-size: 12.5px; }
.ng-switch .cnt { margin-left: auto; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ng-switch a[aria-current="true"] {
    background: linear-gradient(125deg, var(--accent) 0%, var(--accent-2) 100%);
    color: #fff !important; border-color: transparent;
    box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 32%, transparent);
}
.ng-switch a[aria-current="true"] .mono { background: rgba(255, 255, 255, .2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
.ng-switch a[aria-current="true"] .lbl small { color: rgba(255, 255, 255, .85); }
.ng-switch a[aria-current="true"]::after {
    content: "Selected"; position: absolute; top: -9px; right: 14px;
    background: var(--ng-ink); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    padding: 2px 8px; border-radius: 999px;
}

/* ---------------------------------------------------------------
   Filter bar & forms
   --------------------------------------------------------------- */
.ng-filters {
    display: grid; grid-template-columns: minmax(220px, 2fr) repeat(5, minmax(120px, 1fr));
    gap: 10px; align-items: end;
}
.ng-filters .actions { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ng-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ng-field > label,
.ng-label {
    font-size: 11.5px; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; color: var(--ng-muted);
}
.ng input[type=text],
.ng input[type=search],
.ng input:not([type]),
.ng select,
.ng textarea {
    width: 100%; min-height: 42px;
    padding: 9px 12px;
    border: 1px solid var(--ng-line-2); border-radius: var(--ng-r-sm);
    background: #fff; color: var(--ng-ink);
    font: inherit; font-size: 14.5px;
    transition: border-color .14s ease, box-shadow .14s ease;
}
.ng select {
    -webkit-appearance: none; appearance: none; padding-right: 34px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235D6880' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
}
.ng textarea { min-height: 110px; line-height: 1.55; resize: vertical; }
.ng textarea.large { min-height: 200px; }
.ng input:focus,
.ng select:focus,
.ng textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.ng select:disabled { background-color: #F0F2F7; color: var(--ng-faint); }
.ng-search { position: relative; }
.ng-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ng-faint); pointer-events: none; }
.ng-search input { padding-left: 38px !important; }
.ng-filter-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--ng-muted); }
.ng-filter-tags .ng-pill { background: var(--accent-tint); color: var(--accent); }

.ng-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ng-form-grid .full { grid-column: 1 / -1; }
.ng-form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ng-hint { font-size: 12.5px; color: var(--ng-muted); margin: 4px 0 0; }

.ng-sticky-actions {
    position: sticky; bottom: 0; z-index: 20;
    display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
    margin-top: 22px; padding: 14px 16px;
    background: rgba(255, 255, 255, .94);
    border: 1px solid var(--ng-line); border-radius: 14px;
    box-shadow: 0 -6px 24px rgba(15, 27, 51, .08);
}
.ng-sticky-actions .spacer { flex: 1; }

/* ---------------------------------------------------------------
   Tables — become stacked cards on phones
   --------------------------------------------------------------- */
.ng-table-wrap { background: var(--ng-surface); border: 1px solid var(--ng-line); border-radius: var(--ng-r); box-shadow: var(--ng-e1); overflow: hidden; }
.ng-table-scroll { overflow-x: auto; }
.ng-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.ng-table th {
    position: sticky; top: 0;
    text-align: left; padding: 11px 14px;
    font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ng-muted);
    background: var(--ng-surface-2); border-bottom: 1px solid var(--ng-line); white-space: nowrap;
}
.ng-table td { padding: 12px 14px; border-bottom: 1px solid var(--ng-line); vertical-align: top; }
.ng-table tbody tr:last-child td { border-bottom: 0; }
.ng-table tbody tr { transition: background-color .12s ease; }
.ng-table tbody tr:hover { background: #F7FAFE; }
.ng-table .id { font-family: var(--ng-mono); font-size: 12.5px; color: var(--ng-muted); white-space: nowrap; }
.ng-table .id a { font-weight: 700; text-decoration: none; }
.ng-table .strong { font-weight: 650; color: var(--ng-ink); }
.ng-table .muted { color: var(--ng-muted); }
.ng-table .nowrap { white-space: nowrap; }
.ng-table .act { text-align: right; white-space: nowrap; }
.ng-table .rowlink { color: var(--ng-ink) !important; font-weight: 650; text-decoration: none; }
.ng-table .rowlink:hover { color: var(--accent) !important; text-decoration: underline; }
.ng-table .path { font-size: 12.5px; color: var(--ng-muted); line-height: 1.45; }
.ng-table .empty-row td { text-align: center; color: var(--ng-muted); padding: 36px 14px; font-style: italic; }
.ng-table .compact td { padding: 7px 10px; }
.ng-table.ng-dense td { padding: 8px 11px; }
.ng-table.ng-dense th { padding: 9px 11px; }

.ng-only-mobile { display: none; }

/* ---------------------------------------------------------------
   Pager
   --------------------------------------------------------------- */
.ng-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 14px 0; }
.ng-pager .info { font-size: 13.5px; color: var(--ng-muted); }
.ng-pager .info b { color: var(--ng-ink); font-variant-numeric: tabular-nums; }
.ng-pager .ctrl { display: flex; gap: 8px; align-items: center; }
.ng-pager .page { font-size: 13.5px; font-weight: 700; padding: 0 6px; font-variant-numeric: tabular-nums; }

.ng-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.ng-toolbar .grp { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------
   Record (review) layouts
   --------------------------------------------------------------- */
.ng-meta-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.ng-meta-grid > div { padding: 12px 16px; border-right: 1px solid var(--ng-line); border-bottom: 1px solid var(--ng-line); min-width: 0; }
.ng-meta-grid > div:nth-child(4n) { border-right: 0; }
.ng-meta-grid .v { font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; margin-top: 3px; }

.ng-path { display: flex; flex-wrap: wrap; gap: 4px 2px; align-items: center; font-size: 13px; line-height: 1.5; }
.ng-path span { padding: 2px 8px; border-radius: 6px; background: var(--ng-surface-2); border: 1px solid var(--ng-line); color: var(--ng-ink-2); }
.ng-path span + span::before { content: none; }
.ng-path i { color: var(--ng-faint); font-style: normal; padding: 0 2px; }

.ng-stem { font-size: 17px; line-height: 1.7; color: var(--ng-ink); }
.ng-stem.header { font-size: 15.5px; color: var(--ng-ink-2); }
.ng-option {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 12px 14px; margin: 8px 0; border-radius: 12px;
    border: 1px solid var(--ng-line); background: #fff; font-size: 15px; line-height: 1.5;
}
.ng-option .ltr {
    flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
    font-weight: 800; font-size: 13.5px; background: var(--ng-surface-2); border: 1px solid var(--ng-line-2); color: var(--ng-ink-2);
}
.ng-option .txt { flex: 1; min-width: 0; padding-top: 4px; overflow-wrap: anywhere; }
.ng-option.correct { border-color: rgba(31, 138, 82, .45); background: var(--ng-ok-tint); }
.ng-option.correct .ltr { background: var(--ng-ok); border-color: var(--ng-ok); color: #fff; }
.ng-option .tag { flex: none; align-self: center; font-size: 11px; font-weight: 800; color: var(--ng-ok); text-transform: uppercase; letter-spacing: .06em; }
.ng-prose { line-height: 1.65; font-size: 14.5px; }
.ng-prose p { margin: 0 0 8px; }
.ng-prose pre { white-space: pre-wrap; font-family: inherit; margin: 0; }

.ng-statusbar {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    padding: 14px 18px; border-radius: 14px; margin-bottom: 18px;
    background: var(--ng-surface); border: 1px solid var(--ng-line); box-shadow: var(--ng-e1);
}
.ng-statusbar .seg { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ng-statusbar .div { width: 1px; align-self: stretch; background: var(--ng-line); }
.ng-statusbar .spacer { flex: 1; }

.ng-flow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; list-style: none; margin: 0; padding: 0; }
.ng-flow li { padding: 5px 10px; border-radius: 999px; background: var(--ng-surface-2); border: 1px solid var(--ng-line); color: var(--ng-muted); font-weight: 700; }
.ng-flow li.on { background: var(--ng-ink); border-color: var(--ng-ink); color: #fff; }
.ng-flow li.live.on { background: var(--ng-ok); border-color: var(--ng-ok); }
.ng-flow .arr { padding: 0; border: 0; background: none; color: var(--ng-faint); }

.ng-rel {
    display: flex; justify-content: space-between; align-items: center; gap: 14px;
    padding: 12px 14px; border: 1px solid var(--ng-line); border-radius: 12px; margin-bottom: 10px; background: #fff;
}
.ng-rel .body { min-width: 0; flex: 1; }
.ng-rel .body .hdr { margin-top: 5px; font-size: 14px; }
.ng-rel .body .trail { margin-top: 5px; font-size: 12.5px; color: var(--ng-muted); overflow-wrap: anywhere; }
.ng-rel form { margin: 0; flex: none; }
.ng-empty { color: var(--ng-muted); font-style: italic; padding: 6px 0; }

.ng-readonly { padding: 10px 12px; background: var(--ng-surface-2); border: 1px dashed var(--ng-line-2); border-radius: var(--ng-r-sm); color: var(--ng-ink-2); font-family: var(--ng-mono); font-size: 13px; overflow-wrap: anywhere; }

.ng-two-col { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.ng-aside { position: sticky; top: 84px; }

/* Classification drill */
.ng-drill { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.ng-drill a {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 13px 15px; border-radius: 12px; text-decoration: none;
    background: #fff; border: 1px solid var(--ng-line); color: var(--ng-ink) !important; font-weight: 650;
    transition: border-color .14s ease, transform .14s ease, box-shadow .14s ease;
}
.ng-drill a:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--ng-e1); }
.ng-drill a span { overflow-wrap: anywhere; }
.ng-drill a b { flex: none; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--accent-tint); color: var(--accent); font-variant-numeric: tabular-nums; }

.ng-levels { display: flex; gap: 4px; flex-wrap: wrap; list-style: none; padding: 0; margin: 0 0 14px; }
.ng-levels li { font-size: 11px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; background: #EEF1F6; color: var(--ng-muted); }
.ng-levels li.done { background: var(--accent-tint); color: var(--accent); }
.ng-levels li.now { background: var(--accent); color: #fff; }

.ng-footer { width: min(calc(100% - 32px), var(--ng-width)); margin: 0 auto; padding: 0 0 34px; color: var(--ng-faint); font-size: 12.5px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ng-footer a { color: var(--ng-muted) !important; }

/* ---------------------------------------------------------------
   Responsive
   --------------------------------------------------------------- */
@media (max-width: 1180px) {
    .ng-brand-text { display: none; }
}

@media (max-width: 1100px) {
    .ng-table .opt { display: none; }
    .ng-table td.act { white-space: normal; }
    .ng-table td.act .ng-btn { display: flex; width: 100%; margin: 3px 0; }
    .ng-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ng-filters .ng-search-field { grid-column: 1 / -1; }
    .ng-pipe { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .ng-two-col { grid-template-columns: 1fr; }
    .ng-aside { position: static; }
}

@media (max-width: 900px) {
    .ng-grid-2,
    .ng-grid-3 { grid-template-columns: minmax(0, 1fr); }
    .ng-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ng-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ng-meta-grid > div:nth-child(4n) { border-right: 1px solid var(--ng-line); }
    .ng-meta-grid > div:nth-child(2n) { border-right: 0; }
    .ng-switch { grid-template-columns: 1fr 1fr; }
    .ng-switch a:first-child { grid-column: 1 / -1; }
    .ng-brand-text small { display: none; }
}

@media (max-width: 760px) {
    body.ng { font-size: 15px; }
    .ng-appbar-inner { flex-wrap: wrap; gap: 6px 12px; min-height: 0; padding: 10px 0 8px; }
    .ng-nav { order: 3; flex-basis: 100%; margin: 0 -4px; padding-bottom: 2px; }
    .ng-nav a { padding: 7px 10px; font-size: 13px; }
    .ng-env { margin-left: auto; }
    .ng-main { padding-top: 16px; }
    .ng-hero { padding: 20px 18px; border-radius: 16px; }
    .ng-hero-icon { width: 46px; height: 46px; border-radius: 13px; }
    .ng-hero-actions { width: 100%; }
    .ng-hero-actions .ng-btn { flex: 1 1 auto; }
    .ng-hero-stat { flex: 1 1 calc(50% - 10px); min-width: 0; }
    .ng-filters { grid-template-columns: 1fr 1fr; }
    .ng-filters .actions .ng-btn { flex: 1 1 auto; }
    .ng-form-grid,
    .ng-form-grid-3 { grid-template-columns: 1fr; }
    .ng-pipe { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .ng-qtype-count b { font-size: 38px; }
    .ng-module-head { flex-wrap: wrap; }
    .ng-card-head, .ng-card-body { padding-left: 16px; padding-right: 16px; }
    .ng-rel { flex-direction: column; align-items: stretch; }
    .ng-activity li { flex-wrap: wrap; padding: 11px 16px; row-gap: 6px; }
    .ng-activity .t { flex: 1 1 calc(100% - 90px); }
    .ng-activity time { margin-left: auto; }
    .ng-rel .ng-btn { width: 100%; }
    .ng-sticky-actions .ng-btn { flex: 1 1 auto; }
    .ng-sticky-actions .spacer { display: none; }
    .ng-statusbar .div { display: none; }
    .ng-pager .ctrl { width: 100%; justify-content: space-between; }

    /* Stacked responsive tables */
    .ng-table-wrap { background: transparent; border: 0; box-shadow: none; overflow: visible; }
    .ng-table-scroll { overflow: visible; }
    .ng-table.ng-stack thead { display: none; }
    .ng-table.ng-stack,
    .ng-table.ng-stack tbody,
    .ng-table.ng-stack tr,
    .ng-table.ng-stack td { display: block; width: 100%; }
    .ng-table.ng-stack tr {
        background: #fff; border: 1px solid var(--ng-line); border-radius: 14px;
        box-shadow: var(--ng-e1); margin-bottom: 12px; padding: 6px 0; overflow: hidden;
    }
    .ng-table.ng-stack tbody tr:hover { background: #fff; }
    .ng-table.ng-stack td {
        display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 10px; align-items: start;
        padding: 7px 16px; border-bottom: 0; text-align: left;
    }
    .ng-table.ng-stack td::before {
        content: attr(data-label);
        font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--ng-faint); padding-top: 3px;
    }
    .ng-table.ng-stack td.act { text-align: left; }
    .ng-table.ng-stack td.head-cell {
        display: flex; align-items: center; justify-content: space-between; gap: 10px;
        padding: 8px 16px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--ng-line);
    }
    .ng-table.ng-stack td.head-cell::before { content: none; }
    .ng-table.ng-stack td:empty { display: none; }
    .ng-table.ng-stack td.ng-hide-mobile { display: none; }
    .ng-only-mobile { display: inline-flex; }
    .ng-table.ng-stack .empty-row td { display: block; }
    .ng-table.ng-stack .empty-row td::before { content: none; }
}

@media (max-width: 480px) {
    .ng-grid-4 { grid-template-columns: 1fr 1fr; }
    .ng-filters { grid-template-columns: 1fr; }
    .ng-switch { grid-template-columns: 1fr; }
    .ng-switch a:first-child { grid-column: auto; }
    .ng-meta-grid { grid-template-columns: 1fr; }
    .ng-meta-grid > div { border-right: 0 !important; }
    .ng-pipe { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ng-qtype-head { align-items: flex-start; }
    .ng-qtype-mono { width: 54px; height: 54px; font-size: 18px; border-radius: 15px; }
    .ng-module-figure { margin-left: 0; text-align: left; width: 100%; display: flex; align-items: baseline; gap: 8px; }
    .ng-table.ng-stack td { grid-template-columns: 88px minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    .ng *, .ng *::before, .ng *::after { transition: none !important; }
}

@media print {
    .ng-appbar, .ng-sticky-actions, .ng-footer { display: none; }
    body.ng { background: #fff; }
}

/* ==================================================================
   Question bank structure — Type → Basic / Clinical → Title
   Destination (delivery channel) and Publication status (SQL value)
   use deliberately different visual languages:
     Destination = outlined square chips with a channel icon
     Status      = rounded colour pills with a status dot
   ================================================================== */
:root {
    --ng-basic: #0E7490;
    --ng-basic-tint: #E0F2F7;
    --ng-clinical: #B4235A;
    --ng-clinical-tint: #FCE7EF;
}

.ng-axis {
    display: flex; align-items: center; gap: 6px;
    margin: 0 0 7px; font-size: 10.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--ng-muted);
}
.ng-axis svg { color: var(--ng-faint); }
.ng-axis small { font-size: 10.5px; font-weight: 600; letter-spacing: .02em; text-transform: none; color: var(--ng-faint); }
.ng-axis.sm { margin: 0; font-size: 9.5px; min-width: 74px; padding-top: 5px; }

.ng-dchips, .ng-schips { display: flex; flex-wrap: wrap; gap: 6px; }

.ng-dchip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 9px; border-radius: 7px;
    border: 1.5px solid var(--ng-line-2); background: #fff;
    font-size: 12.5px; font-weight: 650; color: var(--ng-ink-2) !important; text-decoration: none; line-height: 1.3;
    transition: border-color .14s ease, background-color .14s ease;
}
.ng-dchip svg { color: var(--ng-muted); }
.ng-dchip b { font-variant-numeric: tabular-nums; color: var(--ng-ink); }
a.ng-dchip:hover { border-color: var(--ng-ink-2); background: var(--ng-surface-2); }
.ng-dchip.is-zero { opacity: .5; border-style: dashed; }
.ng-dchip i { font-style: normal; font-weight: 900; font-size: 11px; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; }
.ng-dchip.is-rule-ok { border-color: #C69214; background: #FFF8E6; opacity: 1; }
.ng-dchip.is-rule-ok i { background: #C69214; color: #fff; }
.ng-dchip.is-rule-off { border-color: var(--ng-danger); background: var(--ng-danger-tint); opacity: 1; border-style: solid; }
.ng-dchip.is-rule-off i { background: var(--ng-danger); color: #fff; }

.ng-schips .ng-pill { text-decoration: none; font-size: 11.5px; padding: 3px 9px; }
.ng-schips .ng-pill b { font-variant-numeric: tabular-nums; }
.ng-schips a.ng-pill:hover { filter: brightness(.96); box-shadow: inset 0 0 0 1px currentColor; }

.ng-gbadge {
    display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase;
    background: #EEF1F6; color: var(--ng-ink-2);
}
.g-basic .ng-gbadge { background: var(--ng-basic-tint); color: var(--ng-basic); }
.g-clinical .ng-gbadge { background: var(--ng-clinical-tint); color: var(--ng-clinical); }

/* Trial allocation rule */
.ng-trialrule {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    margin: 14px 0 0; padding: 12px 14px; border-radius: 12px;
    border: 1.5px solid #E7C66B; background: linear-gradient(120deg, #FFF8E6 0%, #FFFDF6 100%);
}
.ng-trialrule .ic { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: #C69214; color: #fff; }
.ng-trialrule .tx { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ng-trialrule .tx strong { font-size: 14px; color: #5E4306; }
.ng-trialrule .tx span { font-size: 12.5px; color: #6F5A26; }
.ng-trialrule.is-warn { border-color: #E6B3B3; background: var(--ng-danger-tint); }
.ng-trialrule.is-warn .ic { background: var(--ng-danger); }
.ng-trialrule.is-warn .tx strong, .ng-trialrule.is-warn .tx span { color: #7E1F1F; }
.ng-trialrule.is-compact { margin: 10px 0 0; padding: 8px 10px; gap: 9px; }
.ng-trialrule.is-compact .ic { width: 28px; height: 28px; border-radius: 8px; }
.ng-trialrule.is-compact .tx strong { font-size: 12.5px; }

/* Group panels (Questions page) */
.ng-structure { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; align-items: start; }
.ng-structure.single { grid-template-columns: minmax(0, 1fr); }
.ng-gpanel {
    position: relative; background: var(--ng-surface); border: 1px solid var(--ng-line); border-radius: var(--ng-r-lg);
    box-shadow: var(--ng-e1); padding: 0 18px 18px; overflow: hidden;
}
.ng-gpanel::before { content: ""; display: block; height: 4px; margin: 0 -18px 0; background: var(--ng-line-2); }
.ng-gpanel.g-basic::before { background: linear-gradient(90deg, var(--ng-basic), #22A6C2); }
.ng-gpanel.g-clinical::before { background: linear-gradient(90deg, var(--ng-clinical), #E0608F); }
.ng-gpanel.is-current { box-shadow: 0 0 0 2px var(--accent), var(--ng-e2); }
.ng-gpanel-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 0 14px; border-bottom: 1px solid var(--ng-line); }
.ng-gpanel-head .ttl { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; }
.ng-gpanel-head h3 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.ng-gpanel-head .num { display: flex; align-items: baseline; gap: 6px; }
.ng-gpanel-head .num b { font-size: 28px; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; }
.ng-gpanel-head .num span { font-size: 12px; color: var(--ng-muted); }

.ng-axes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; margin-top: 14px; border: 1px solid var(--ng-line); border-radius: 12px; overflow: hidden; }
.ng-axes .ax { padding: 11px 13px; background: var(--ng-surface-2); }
.ng-axes .ax + .ax { border-left: 1px solid var(--ng-line); background: #fff; }

.ng-title-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.ng-tt {
    display: flex; flex-direction: column; gap: 8px;
    padding: 12px 13px; border-radius: 13px; border: 1px solid var(--ng-line); background: #fff;
    transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease;
}
.ng-tt:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--ng-line)); box-shadow: var(--ng-e1); transform: translateY(-1px); }
.ng-tt.is-current { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.ng-tt .tt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ng-tt .tt-name { font-weight: 750; font-size: 14.5px; color: var(--ng-ink) !important; text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
.ng-tt .tt-name:hover { color: var(--accent) !important; text-decoration: underline; }
.ng-tt .tt-count {
    flex: none; min-width: 42px; text-align: center; padding: 4px 9px; border-radius: 10px;
    font-size: 17px; font-weight: 850; font-variant-numeric: tabular-nums; text-decoration: none;
    color: #fff !important; background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.ng-tt .tt-count:hover { filter: brightness(1.08); }
.ng-tt .tt-row { display: flex; gap: 8px; align-items: flex-start; }
.ng-tt .tt-row .ng-dchip { padding: 2px 7px; font-size: 11.5px; }
.ng-tt .tt-row .ng-schips .ng-pill { padding: 2px 8px; font-size: 11px; }

.ng-structure-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
.ng-structure-head h2 { margin: 0; font-size: 18px; }
.ng-structure-head p { margin: 0; font-size: 13px; color: var(--ng-muted); }
.ng-structure-toggle summary { cursor: pointer; list-style: none; }
.ng-structure-toggle summary::-webkit-details-marker { display: none; }

/* Dashboard: Basic / Clinical inside each type card */
.ng-qgroups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ng-qgroup { border: 1px solid var(--ng-line); border-radius: 14px; padding: 12px 13px; background: var(--ng-surface-2); min-width: 0; position: relative; z-index: 3; }
.ng-qgroup .hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.ng-qgroup .hd b { font-size: 24px; font-weight: 850; line-height: 1; font-variant-numeric: tabular-nums; }
.ng-qgroup .hd small { display: block; font-size: 11.5px; color: var(--ng-muted); margin-top: 2px; }
.ng-qgroup .sec + .sec { margin-top: 10px; }
.ng-qgroup .go { display: inline-flex; align-items: center; gap: 4px; margin-top: 11px; font-size: 12.5px; font-weight: 750; text-decoration: none; }
.ng-qgroup .go:hover { text-decoration: underline; }
.ng-qgroup .ng-dchip { padding: 2px 7px; font-size: 11.5px; }
.ng-qgroup .ng-schips .ng-pill { padding: 2px 8px; font-size: 11px; }

@media (max-width: 1100px) {
    .ng-structure { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
    .ng-axes { grid-template-columns: minmax(0, 1fr); }
    .ng-axes .ax + .ax { border-left: 0; border-top: 1px solid var(--ng-line); }
    .ng-gpanel { padding: 0 14px 14px; }
    .ng-gpanel::before { margin: 0 -14px; }
    .ng-gpanel-head .ng-btn { width: 100%; }
    .ng-title-grid { grid-template-columns: minmax(0, 1fr); }
    .ng-tt .tt-row { flex-direction: column; gap: 4px; }
    .ng-axis.sm { padding-top: 0; }
}
@media (max-width: 520px) {
    .ng-qgroups { grid-template-columns: minmax(0, 1fr); }
}

.ng-structure-toggle[open] .when-closed,
.ng-structure-toggle:not([open]) .when-open { display: none; }
.ng-qgroups.single { grid-template-columns: minmax(0, 1fr); }
