/*
 * cq-next — the design system behind the v3 and v4 dashboards.
 *
 * Built on the panel theme's own tokens (--primary, --background, --input,
 * --mono, --secondary-foreground …) rather than hardcoded colours, so these
 * pages inherit the theme's light and dark palettes automatically and stay in
 * step if the theme moves. What this file adds on top is the depth the raw
 * theme components do not have on their own: layered shadows, blue-tinted
 * gradients, real focus states, and motion.
 *
 * The accent is the brand blue (#1379F0) throughout. No purple.
 */

:root {
    --cqn-accent: #1379F0;
    --cqn-accent-deep: #0B5FCC;
    --cqn-accent-soft: rgba(19, 121, 240, .08);
    --cqn-accent-line: rgba(19, 121, 240, .22);

    --cqn-danger: #dc2626;
    --cqn-warn: #d97706;
    --cqn-ok: #16a34a;
    /* AI detection is a different question from copying, so it gets its own
       hue rather than a place on the red-amber-green copying scale. */
    --cqn-ai: #7c3aed;
    --cqn-ai-soft: rgba(124, 58, 237, .12);

    --cqn-r-lg: 14px;
    --cqn-r-md: 10px;
    --cqn-r-sm: 8px;

    --cqn-shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
    --cqn-shadow-md: 0 2px 4px rgba(16, 24, 40, .04), 0 8px 20px -6px rgba(16, 24, 40, .10);
    --cqn-shadow-lg: 0 4px 8px rgba(16, 24, 40, .04), 0 18px 40px -12px rgba(16, 24, 40, .16);

    --cqn-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

.dark {
    --cqn-accent-soft: rgba(19, 121, 240, .14);
    --cqn-accent-line: rgba(19, 121, 240, .32);

    --cqn-shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --cqn-shadow-md: 0 2px 6px rgba(0, 0, 0, .35), 0 10px 24px -8px rgba(0, 0, 0, .5);
    --cqn-shadow-lg: 0 6px 12px rgba(0, 0, 0, .4), 0 24px 48px -16px rgba(0, 0, 0, .6);
}

/* ============================================================ foundations */

.cqn { color: var(--foreground, #27272a); }

.cqn-mono { font-family: var(--cqn-mono); font-variant-numeric: tabular-nums; }
/* Figures that should line up but are not code. The monospace face was doing
   both jobs, which put a typewriter "59%" next to a sans "peer". */
.cqn-num { font-variant-numeric: tabular-nums; }

.cqn-h1 {
    font-size: 1.6rem;
    font-weight: 680;
    letter-spacing: -.021em;
    line-height: 1.2;
    color: var(--mono, #18181b);
}

.cqn-sub {
    font-size: .875rem;
    color: var(--secondary-foreground, #71717a);
    margin-top: .3rem;
}

.cqn-h2 {
    font-size: .95rem;
    font-weight: 640;
    letter-spacing: -.011em;
    color: var(--mono, #18181b);
}

.cqn-eyebrow {
    font-size: .6875rem;
    font-weight: 640;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--secondary-foreground, #71717a);
}

/* ================================================================ surfaces */

.cqn-panel {
    background: var(--background, #fff);
    border: 1px solid var(--input, #e4e4e7);
    border-radius: var(--cqn-r-lg);
    box-shadow: var(--cqn-shadow-sm);
}

.cqn-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .95rem 1.15rem;
    border-bottom: 1px solid var(--input, #e4e4e7);
}

.cqn-panel-body { padding: 1.15rem; }
.cqn-panel-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .9rem 1.15rem;
    border-top: 1px solid var(--input, #e4e4e7);
    background: var(--muted, #f4f4f5);
    border-radius: 0 0 var(--cqn-r-lg) var(--cqn-r-lg);
}

/* The hero panel on v3 gets a faint blue wash so the primary action reads as
   the centre of the page without shouting. */
.cqn-hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(120% 140% at 50% -20%, var(--cqn-accent-soft) 0%, transparent 62%),
        var(--background, #fff);
}

/* ================================================================== buttons */

.cqn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    height: 2.4rem;
    padding: 0 .95rem;
    border-radius: var(--cqn-r-md);
    border: 1px solid transparent;
    font-size: .8125rem;
    font-weight: 560;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}

.cqn-btn:active { transform: translateY(.5px); }
.cqn-btn:focus-visible { outline: 2px solid var(--cqn-accent); outline-offset: 2px; }
.cqn-btn[disabled] { opacity: .5; cursor: not-allowed; }

.cqn-btn-primary {
    color: #fff;
    background: linear-gradient(180deg, var(--cqn-accent) 0%, var(--cqn-accent-deep) 100%);
    box-shadow: 0 1px 2px rgba(11, 95, 204, .28), inset 0 1px 0 rgba(255, 255, 255, .16);
}
.cqn-btn-primary:hover:not([disabled]) {
    box-shadow: 0 3px 10px rgba(11, 95, 204, .32), inset 0 1px 0 rgba(255, 255, 255, .2);
}

.cqn-btn-ghost {
    color: var(--secondary-foreground, #71717a);
    background: transparent;
    border-color: var(--input, #e4e4e7);
}
.cqn-btn-ghost:hover:not([disabled]) {
    background: var(--muted, #f4f4f5);
    color: var(--mono, #18181b);
}

.cqn-btn-sm { height: 2rem; padding: 0 .7rem; font-size: .75rem; }
.cqn-btn-icon { width: 2rem; padding: 0; }

/* ================================================================ drop zone */

.cqn-drop {
    position: relative;
    border: 1.5px dashed var(--input, #e4e4e7);
    border-radius: var(--cqn-r-lg);
    background: var(--background, #fff);
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
    cursor: pointer;
}

.cqn-drop:hover { border-color: var(--cqn-accent-line); background: var(--cqn-accent-soft); }

.cqn-drop.is-over {
    border-color: var(--cqn-accent);
    border-style: solid;
    background: var(--cqn-accent-soft);
    box-shadow: 0 0 0 4px var(--cqn-accent-soft), var(--cqn-shadow-md);
}

/* The scanning motif: a soft blue sweep across the drop surface while a file
   is over it, so the target visibly "reads" what you are about to give it. */
.cqn-drop.is-over::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(100deg, transparent 20%, rgba(19, 121, 240, .16) 50%, transparent 80%);
    background-size: 220% 100%;
    animation: cqn-sweep 1.1s linear infinite;
}

@keyframes cqn-sweep {
    from { background-position: 120% 0; }
    to   { background-position: -120% 0; }
}

/* A mark, not a badge. This was a 4.25rem gradient disc with a drop shadow,
   which made the loudest object on the page out of an empty box: the dashed
   outline is what says something goes here, and it does not need help. */
.cqn-drop-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    color: var(--cqn-accent);
    font-size: 2rem;
    line-height: 1;
}

.cqn-drop-icon-sm { font-size: 1.75rem; }

/* ==================================================================== chips */

/* Detection-source toggles. A chip is a real control, so it carries a checked
   state rather than only a colour change. */
.cqn-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .7rem;
    border: 1px solid var(--input, #e4e4e7);
    border-radius: 999px;
    background: var(--background, #fff);
    color: var(--secondary-foreground, #71717a);
    font-size: .78125rem;
    font-weight: 520;
    cursor: pointer;
    user-select: none;
    transition: all .15s ease;
}

.cqn-chip:hover { border-color: var(--cqn-accent-line); color: var(--mono, #18181b); }

.cqn-chip.is-on {
    border-color: var(--cqn-accent-line);
    background: var(--cqn-accent-soft);
    color: var(--cqn-accent);
}

.cqn-chip.is-locked { opacity: .55; cursor: not-allowed; }
.cqn-chip.is-locked:hover { border-color: var(--input, #e4e4e7); }

.cqn-chip-dot {
    width: .45rem;
    height: .45rem;
    border-radius: 50%;
    background: currentColor;
    opacity: .35;
}
.cqn-chip.is-on .cqn-chip-dot { opacity: 1; }

/* The mark for a detection source, drawn by v2/partials/source-mark.blade.php.
   In currentColor, so an off chip's logo is as grey as its label and only the
   on state brings it up: a row of full-colour brand logos next to a row of
   grey ones reads as six different states, not two. */
.cqn-src-logo {
    width: .95rem;
    height: .95rem;
    flex: none;
    opacity: .55;
    transition: opacity .15s ease;
}

.cqn-chip.is-on .cqn-src-logo,
.cqn-src.is-on .cqn-src-logo { opacity: 1; }
.cqn-chip:hover .cqn-src-logo { opacity: .85; }
.cqn-chip.is-locked .cqn-src-logo { opacity: .4; }

/* ======================================================= detection sources */

/* The chips above are fine in a toolbar. On the launch pad the sources ARE the
   product - what this scanner searches that a diff does not - so each one is a
   labelled control that says what it is, not a pill you have to already know
   the meaning of. */
.cqn-srcs {
    display: grid;
    gap: .5rem;
    grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
}

.cqn-src {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    width: 100%;
    padding: .7rem .8rem;
    border: 1px solid var(--input, #e4e4e7);
    border-radius: var(--cqn-r-md);
    background: var(--background, #fff);
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}

.cqn-src:hover { border-color: var(--cqn-accent-line); }
.cqn-src:focus-visible { outline: 2px solid var(--cqn-accent); outline-offset: 2px; }

.cqn-src.is-on { border-color: var(--cqn-accent-line); background: var(--cqn-accent-soft); }

/* Always on and not negotiable: reads as settled, not as disabled. */
.cqn-src.is-fixed { cursor: default; }
.cqn-src.is-fixed:hover { border-color: var(--cqn-accent-line); }

.cqn-src.is-locked { cursor: not-allowed; background: var(--muted, #f4f4f5); }
.cqn-src.is-locked:hover { border-color: var(--input, #e4e4e7); }
.cqn-src.is-locked .cqn-src-name { color: var(--secondary-foreground, #71717a); }

.cqn-src-mark {
    flex: 0 0 auto;
    width: 1.05rem;
    height: 1.05rem;
    margin-top: .05rem;
    border: 1.5px solid var(--input, #e4e4e7);
    border-radius: 5px;
    background: var(--background, #fff);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .6rem;
    color: transparent;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.cqn-src.is-on .cqn-src-mark {
    background: var(--cqn-accent);
    border-color: var(--cqn-accent);
    color: #fff;
}

.cqn-src-body { min-width: 0; }

.cqn-src-name {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .8125rem;
    font-weight: 580;
    color: var(--mono, #18181b);
    line-height: 1.3;
}

.cqn-src.is-on .cqn-src-name { color: var(--cqn-accent); }

.cqn-src-note {
    font-size: .7rem;
    line-height: 1.4;
    color: var(--secondary-foreground, #71717a);
    margin-top: .12rem;
}

.cqn-src-tag {
    font-size: .6rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--secondary-foreground, #71717a);
    border: 1px solid var(--input, #e4e4e7);
    border-radius: 999px;
    padding: .04rem .32rem;
    white-space: nowrap;
}

/* ============================================================ check price */

/* What this run costs, before it is spent. Peer comparison is free; credits
   are drawn only once the scan leaves the account. */
.cqn-cost { font-size: .8125rem; color: var(--secondary-foreground, #71717a); }
.cqn-cost strong { color: var(--mono, #18181b); font-weight: 600; }
.cqn-cost.is-short { color: var(--cqn-danger); }
.cqn-cost.is-short strong { color: var(--cqn-danger); }

/* ============================================================= file rows */

.cqn-list {
    border: 1px solid var(--input, #e4e4e7);
    border-radius: var(--cqn-r-md);
    overflow: hidden;
}

.cqn-row {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .6rem .8rem;
    background: var(--background, #fff);
    transition: background-color .12s ease;
}

.cqn-row + .cqn-row { border-top: 1px solid var(--input, #e4e4e7); }
.cqn-row:hover { background: var(--muted, #f4f4f5); }

.cqn-row-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    flex: none;
    border-radius: var(--cqn-r-sm);
    background: var(--cqn-accent-soft);
    color: var(--cqn-accent);
    font-size: .8rem;
}

.cqn-row-name {
    flex: 1;
    min-width: 0;
    font-size: .8125rem;
    font-weight: 500;
    color: var(--mono, #18181b);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cqn-row-meta { font-size: .75rem; color: var(--secondary-foreground, #71717a); font-variant-numeric: tabular-nums; }

/* ============================================================ code editor */

.cqn-editor {
    border: 1px solid var(--input, #e4e4e7);
    border-radius: var(--cqn-r-md);
    overflow: hidden;
    background: var(--background, #fff);
}

.cqn-editor-tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: .35rem .35rem 0;
    background: var(--muted, #f4f4f5);
    border-bottom: 1px solid var(--input, #e4e4e7);
    overflow-x: auto;
}

.cqn-tab {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .7rem;
    border: 0;
    border-radius: var(--cqn-r-sm) var(--cqn-r-sm) 0 0;
    background: transparent;
    color: var(--secondary-foreground, #71717a);
    font-size: .78125rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .12s ease, color .12s ease;
}

.cqn-tab:hover { color: var(--mono, #18181b); }
.cqn-tab.is-active { background: var(--background, #fff); color: var(--cqn-accent); font-weight: 560; }

.cqn-tab-x {
    display: inline-flex;
    opacity: .5;
    font-size: .7rem;
    border-radius: 3px;
}
.cqn-tab-x:hover { opacity: 1; color: var(--cqn-danger); }

.cqn-code {
    width: 100%;
    min-height: 15rem;
    padding: .85rem 1rem;
    border: 0;
    outline: none;
    resize: vertical;
    background: var(--background, #fff);
    color: var(--foreground, #27272a);
    font-family: var(--cqn-mono);
    font-size: .8125rem;
    line-height: 1.65;
    tab-size: 4;
}

.cqn-code::placeholder { color: var(--muted-foreground, #9ca3af); }

.cqn-editor-foot {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .7rem;
    border-top: 1px solid var(--input, #e4e4e7);
    background: var(--muted, #f4f4f5);
}

/* ================================================================== inputs */

.cqn-input, .cqn-select {
    width: 100%;
    height: 2.4rem;
    padding: 0 .75rem;
    border: 1px solid var(--input, #e4e4e7);
    border-radius: var(--cqn-r-md);
    background: var(--background, #fff);
    color: var(--foreground, #27272a);
    font-size: .8125rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.cqn-input:focus, .cqn-select:focus {
    outline: none;
    border-color: var(--cqn-accent);
    box-shadow: 0 0 0 3px var(--cqn-accent-soft);
}

.cqn-input-sm, .cqn-select-sm { height: 2.1rem; font-size: .78125rem; }

.cqn-label {
    display: block;
    margin-bottom: .35rem;
    font-size: .78125rem;
    font-weight: 550;
    color: var(--mono, #18181b);
}

.cqn-field-hint { font-size: .75rem; color: var(--secondary-foreground, #71717a); margin-top: .3rem; }

/* ================================================================ stepper */

.cqn-steps { display: flex; align-items: center; gap: .5rem; }

.cqn-step {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .78125rem;
    color: var(--secondary-foreground, #71717a);
}

.cqn-step-dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    border: 1.5px solid var(--input, #e4e4e7);
    font-size: .65rem;
    font-weight: 640;
}

.cqn-step.is-active { color: var(--cqn-accent); font-weight: 570; }
.cqn-step.is-active .cqn-step-dot { border-color: var(--cqn-accent); background: var(--cqn-accent-soft); }

.cqn-step.is-done { color: var(--cqn-ok); }
.cqn-step.is-done .cqn-step-dot { border-color: var(--cqn-ok); background: var(--cqn-ok); color: #fff; }

.cqn-step-line { flex: 1; height: 1.5px; background: var(--input, #e4e4e7); min-width: 1rem; }

/* =============================================================== progress */

.cqn-bar {
    height: 6px;
    border-radius: 999px;
    background: var(--cqn-accent-soft);
    overflow: hidden;
}

.cqn-bar > span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--cqn-accent), var(--cqn-accent-deep));
    transition: width .25s ease;
}

/* Indeterminate stripe for the phase where the server is working and there is
   no byte count to report. */
.cqn-bar.is-waiting > span {
    width: 100% !important;
    background-image: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .45) 50%, transparent 80%),
                      linear-gradient(90deg, var(--cqn-accent), var(--cqn-accent-deep));
    background-size: 220% 100%, 100% 100%;
    animation: cqn-sweep 1.2s linear infinite;
}

/* ============================================================ score visuals */

.cqn-meter {
    width: 4.5rem;
    height: 5px;
    flex: none;
    border-radius: 999px;
    background: var(--input, #e4e4e7);
    overflow: hidden;
}
.cqn-meter > span { display: block; height: 100%; border-radius: 999px; }

.cqn-score { font-variant-numeric: tabular-nums; font-weight: 600; font-size: .8125rem; }
.cqn-score-src { font-size: .6875rem; font-weight: 500; color: var(--secondary-foreground, #71717a); }

.cqn-high { color: var(--cqn-danger); }
.cqn-mid  { color: var(--cqn-warn); }
.cqn-low  { color: var(--cqn-ok); }

.cqn-meter.cqn-high > span { background: var(--cqn-danger); }
.cqn-meter.cqn-mid  > span { background: var(--cqn-warn); }
.cqn-meter.cqn-low  > span { background: var(--cqn-ok); }

/* AI detection's own meter. Same furniture as the copying meter beside it,
   deliberately off that scale: a 90% AI reading is not a 90% match. */
.cqn-ai { color: var(--cqn-ai); }
.cqn-meter.cqn-ai > span { background: var(--cqn-ai); }

/* A score the plan does not include. Not an error and not an empty cell: the
   check ran, the number exists, and this is the one control that says so and
   opens the way to it. */
.cqn-lock {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .18rem .5rem;
    border: 1px solid var(--input, #e4e4e7);
    border-radius: 999px;
    background: var(--muted, #f4f4f5);
    color: var(--secondary-foreground, #71717a);
    font-size: .6875rem;
    font-weight: 560;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .15s ease, color .15s ease;
}
.cqn-lock:hover { border-color: var(--cqn-accent-line); color: var(--cqn-accent); }
.cqn-lock i { font-size: .7rem; }

/* Ring used on the v3 recent cards. --pct is set inline per card. */
.cqn-ring {
    position: relative;
    width: 2.6rem;
    height: 2.6rem;
    flex: none;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient(var(--cqn-ring-color, var(--cqn-accent)) calc(var(--cqn-pct, 0) * 1%), var(--input, #e4e4e7) 0);
}

.cqn-ring::before {
    content: '';
    position: absolute;
    inset: 3.5px;
    border-radius: 50%;
    background: var(--background, #fff);
}

.cqn-ring > span {
    position: relative;
    font-variant-numeric: tabular-nums;
    font-size: .68rem;
    font-weight: 660;
}

/* ================================================================= badges */

.cqn-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .2rem .55rem;
    border-radius: 999px;
    border: 1px solid var(--input, #e4e4e7);
    background: var(--muted, #f4f4f5);
    color: var(--secondary-foreground, #71717a);
    font-size: .7rem;
    font-weight: 560;
    white-space: nowrap;
}

.cqn-badge-dot { width: .4rem; height: .4rem; border-radius: 50%; background: currentColor; }

.cqn-badge.is-running { color: var(--cqn-accent); border-color: var(--cqn-accent-line); background: var(--cqn-accent-soft); }
.cqn-badge.is-done    { color: var(--cqn-ok); border-color: rgba(22, 163, 74, .28); background: rgba(22, 163, 74, .09); }
.cqn-badge.is-idle    { color: var(--secondary-foreground, #71717a); }
.cqn-badge.is-failed  { color: var(--cqn-danger); border-color: rgba(220, 38, 38, .28); background: rgba(220, 38, 38, .08); }

.cqn-badge.is-running .cqn-badge-dot { animation: cqn-pulse 1.4s ease-in-out infinite; }

@keyframes cqn-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .35; transform: scale(.8); }
}

/* ================================================================== stats */

.cqn-stat {
    position: relative;
    overflow: hidden;
    padding: .95rem 1.05rem;
    background: var(--background, #fff);
    border: 1px solid var(--input, #e4e4e7);
    border-radius: var(--cqn-r-lg);
    box-shadow: var(--cqn-shadow-sm);
    transition: box-shadow .18s ease, transform .18s ease;
}

.cqn-stat:hover { box-shadow: var(--cqn-shadow-md); transform: translateY(-1px); }

.cqn-stat::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: linear-gradient(90deg, var(--cqn-accent), transparent 70%);
    opacity: .7;
}

.cqn-stat-label {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .72rem;
    font-weight: 540;
    color: var(--secondary-foreground, #71717a);
}

.cqn-stat-value {
    margin-top: .35rem;
    font-variant-numeric: tabular-nums;
    font-size: 1.55rem;
    font-weight: 660;
    letter-spacing: -.02em;
    color: var(--mono, #18181b);
    line-height: 1.1;
}

/* ============================================================ recent cards */

.cqn-card {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .8rem .95rem;
    background: var(--background, #fff);
    border: 1px solid var(--input, #e4e4e7);
    border-radius: var(--cqn-r-md);
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.cqn-card:hover {
    border-color: var(--cqn-accent-line);
    box-shadow: var(--cqn-shadow-md);
    transform: translateY(-1px);
    text-decoration: none;
}

.cqn-card-title {
    font-size: .84rem;
    font-weight: 580;
    color: var(--mono, #18181b);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cqn-card-meta {
    margin-top: .18rem;
    font-size: .74rem;
    color: var(--secondary-foreground, #71717a);
}

/* ================================================================== table */

.cqn-table { width: 100%; border-collapse: separate; border-spacing: 0; }

.cqn-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: .6rem .9rem;
    background: var(--muted, #f4f4f5);
    border-bottom: 1px solid var(--input, #e4e4e7);
    text-align: left;
    font-size: .68rem;
    font-weight: 640;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--secondary-foreground, #71717a);
    white-space: nowrap;
    user-select: none;
}

.cqn-table th.is-sortable { cursor: pointer; }
.cqn-table th.is-sortable:hover { color: var(--mono, #18181b); }
.cqn-table th .cqn-sort { opacity: .35; font-size: .6rem; margin-left: .2rem; }
.cqn-table th.is-sorted .cqn-sort { opacity: 1; color: var(--cqn-accent); }

.cqn-table td {
    padding: .7rem .9rem;
    border-bottom: 1px solid var(--input, #e4e4e7);
    font-size: .8125rem;
    color: var(--foreground, #27272a);
    vertical-align: middle;
}

.cqn-table tbody tr { transition: background-color .12s ease; cursor: pointer; }
.cqn-table tbody tr:hover { background: var(--cqn-accent-soft); }
.cqn-table tbody tr:focus-visible {
    outline: 2px solid var(--cqn-accent);
    outline-offset: -2px;
    background: var(--cqn-accent-soft);
}
.cqn-table tbody tr:last-child td { border-bottom: 0; }

.cqn-table-name { font-weight: 560; color: var(--mono, #18181b); }

/* ============================================================== empty state */

.cqn-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .55rem;
    padding: 3rem 1.5rem;
    text-align: center;
}

.cqn-empty-icon {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--cqn-accent-soft);
    color: var(--cqn-accent);
    font-size: 1.15rem;
}

.cqn-empty-title { font-size: .875rem; font-weight: 580; color: var(--mono, #18181b); }
.cqn-empty-text { font-size: .8125rem; color: var(--secondary-foreground, #71717a); max-width: 24rem; }

/* ================================================================== alerts */

.cqn-alert {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    padding: .7rem .85rem;
    border-radius: var(--cqn-r-md);
    border: 1px solid rgba(220, 38, 38, .3);
    background: rgba(220, 38, 38, .07);
    color: var(--cqn-danger);
    font-size: .8125rem;
}

.cqn-alert-ok {
    border-color: rgba(22, 163, 74, .3);
    background: rgba(22, 163, 74, .08);
    color: var(--cqn-ok);
}

/* =================================================================== queue */

.cqn-queue-item {
    padding: .7rem .8rem;
    border: 1px solid var(--input, #e4e4e7);
    border-radius: var(--cqn-r-md);
    background: var(--background, #fff);
}

.cqn-queue-item + .cqn-queue-item { margin-top: .5rem; }

/* ================================================================== layout */

.cqn-console {
    display: grid;
    gap: 1.1rem;
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 1100px) {
    .cqn-console { grid-template-columns: 384px minmax(0, 1fr); align-items: start; }
    .cqn-console-rail { position: sticky; top: 1rem; }
}

.cqn-scroll { overflow: auto; }
.cqn-scroll::-webkit-scrollbar { width: 9px; height: 9px; }
.cqn-scroll::-webkit-scrollbar-thumb { background: var(--input, #e4e4e7); border-radius: 999px; }
.cqn-scroll::-webkit-scrollbar-thumb:hover { background: var(--ring, #d4d4d8); }

/* Respect a reduced-motion preference: the sweeps and pulses are decoration. */
@media (prefers-reduced-motion: reduce) {
    .cqn-drop.is-over::after,
    .cqn-bar.is-waiting > span,
    .cqn-badge.is-running .cqn-badge-dot { animation: none; }
    .cqn-card:hover, .cqn-stat:hover { transform: none; }
}
