/* ============================================================================
   ClashWise Cinematic Design System — shared primitives
   See Client/DESIGN_SYSTEM.md for the full design language.

   This file holds the parts of the .cw3 system that are identical across every
   cinematic page (HomeV3, DashboardV2, MyClashTitleUpdates, …): tokens,
   container, mono helper, eyebrow primitives, pulse dots, Windows-style window
   chrome, and discipline pills.

   Page-specific layout (heroes, pillars, grids, drawers, page-only buttons)
   stays in each .razor file's <style> block.

   All rules are scoped to .cw3 so the dark theme cannot leak into the
   MudBlazor / Bootstrap shell used by the rest of the app.
============================================================================ */

/* ──────────────────────────── tokens ──────────────────────────── */
.cw3 {
    --cw3-bg: #0E1014;
    --cw3-panel: #16181D;
    --cw3-panel-2: #1B1E25;
    --cw3-line: #23262E;
    --cw3-line-2: #2C3038;
    --cw3-text: #EDEFF3;
    --cw3-text-2: #A8AEB7;
    --cw3-text-3: #6A707B;
    --cw3-mech: #22D3EE;
    --cw3-struct: #FF8A4C;
    --cw3-elec: #FACC15;
    --cw3-plumb: #A78BFA;
    --cw3-clash: #F43F5E;
    --cw3-success: #4ADE80;

    --cw3-display: 'Geist', ui-sans-serif, system-ui, sans-serif;
    --cw3-mono: 'Geist Mono', ui-monospace, 'JetBrains Mono', 'SFMono-Regular', Menlo, monospace;

    background: var(--cw3-bg);
    color: var(--cw3-text);
    font-family: var(--cw3-display);
    font-feature-settings: "ss01", "ss02", "cv11";
    -webkit-font-smoothing: antialiased;
    margin: 0;
    min-height: 100vh;
    position: relative;
}

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

.cw3 h1,
.cw3 h2,
.cw3 h3,
.cw3 h4,
.cw3 p {
    color: var(--cw3-text);
}

/* ──────────────────────────── helpers ──────────────────────────── */
.cw3 .cw3-mono {
    font-family: var(--cw3-mono);
    font-feature-settings: "tnum";
    letter-spacing: 0.02em;
}

.cw3 .cw3-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 32px;
}

/* ──────────────────────────── eyebrow primitives ──────────────────────────── */
.cw3 .cw3-disc-dots {
    display: inline-flex;
    gap: 4px;
}

.cw3 .cw3-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px currentColor;
}

.cw3 .cw3-dot--mech   { background: var(--cw3-mech);   color: var(--cw3-mech); }
.cw3 .cw3-dot--struct { background: var(--cw3-struct); color: var(--cw3-struct); }
.cw3 .cw3-dot--elec   { background: var(--cw3-elec);   color: var(--cw3-elec); }
.cw3 .cw3-dot--plumb  { background: var(--cw3-plumb);  color: var(--cw3-plumb); }

.cw3 .cw3-eyebrow-text {
    font-family: var(--cw3-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    color: var(--cw3-text-2);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ──────────────────────────── pulse dots ──────────────────────────── */
.cw3 .cw3-pulse-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cw3-clash);
    animation: cw3-pulse-red 1.6s ease-out infinite;
    vertical-align: middle;
}

.cw3 .cw3-pulse-dot--green {
    background: var(--cw3-success);
    animation: cw3-pulse-green 1.6s ease-out infinite;
}

@keyframes cw3-pulse-red {
    0%   { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.55); }
    70%  { box-shadow: 0 0 0 9px rgba(244, 63, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
}

@keyframes cw3-pulse-green {
    0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); }
    70%  { box-shadow: 0 0 0 9px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

/* ──────────────────────────── Windows-style window chrome ──────────────────────────── */
.cw3 .cw3-rename-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    min-height: 38px;
    background: linear-gradient(180deg, #1B1E25, #16181D);
    border-bottom: 1px solid var(--cw3-line);
}

.cw3 .cw3-rename-bar .cw3-win-mark      { margin-left: 14px; }
.cw3 .cw3-rename-bar .cw3-rename-status { margin-left: auto; flex-shrink: 0; padding-right: 4px; }
.cw3 .cw3-rename-bar .cw3-win-controls  { margin-left: 0; align-self: stretch; }

.cw3 .cw3-rename-path {
    font-family: var(--cw3-mono);
    font-size: 12px;
    color: var(--cw3-text-3);
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cw3 .cw3-rename-status {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--cw3-text-2);
    flex-shrink: 0;
}

.cw3 .cw3-win-mark {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: linear-gradient(135deg, var(--cw3-mech), var(--cw3-success));
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 0 6px rgba(34, 211, 238, 0.35);
}

.cw3 .cw3-win-mark::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 1px;
    background: #0E1014;
}

.cw3 .cw3-win-controls {
    display: inline-flex;
    align-items: stretch;
    flex-shrink: 0;
    margin-left: auto;
}

/* Decorative chrome by default — pages that wire a real handler (e.g. a drawer
   close) override .cw3-win-btn / .cw3-win-btn--close locally to flip cursor. */
.cw3 .cw3-win-btn {
    width: 38px;
    border: none;
    background: transparent;
    color: var(--cw3-text-3);
    cursor: default;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.cw3 .cw3-win-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--cw3-text);
}

.cw3 .cw3-win-btn--close:hover {
    background: #E81123;
    color: #fff;
}

.cw3 .cw3-win-btn:focus-visible {
    outline: 1px solid var(--cw3-mech);
    outline-offset: -2px;
}

/* ──────────────────────────── discipline pill ──────────────────────────── */
.cw3 .cw3-rename-disc {
    display: inline-block;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0;
    border-radius: 3px;
    border: 1px solid currentColor;
    background: rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
    line-height: 1.4;
    font-family: var(--cw3-display);
}

.cw3 .cw3-rename-disc--mech   { color: var(--cw3-mech); }
.cw3 .cw3-rename-disc--elec   { color: var(--cw3-elec); }
.cw3 .cw3-rename-disc--fire   { color: var(--cw3-clash); }
.cw3 .cw3-rename-disc--plumb  { color: var(--cw3-plumb); }
.cw3 .cw3-rename-disc--struct { color: var(--cw3-struct); }

/* ──────────────────────────── buttons ──────────────────────────── */
.cw3 .cw3-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 22px;
    border-radius: 100px;
    font-family: var(--cw3-display);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.005em;
    text-decoration: none;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
    cursor: pointer;
    border: 1px solid transparent;
    white-space: nowrap;
    color: var(--cw3-text);
}

.cw3 .cw3-btn:focus-visible {
    outline: 1px solid var(--cw3-mech);
    outline-offset: 2px;
}

.cw3 .cw3-btn--primary {
    background: var(--cw3-text);
    color: #0E1014;
    box-shadow: 0 0 0 1px var(--cw3-text), 0 8px 30px rgba(34, 211, 238, 0.18);
}

.cw3 .cw3-btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 0 1px var(--cw3-text), 0 12px 40px rgba(34, 211, 238, 0.32);
    color: #0E1014;
}

.cw3 .cw3-btn--ghost {
    background: rgba(255, 255, 255, 0.03);
    color: var(--cw3-text);
    border-color: var(--cw3-line);
}

.cw3 .cw3-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--cw3-line-2);
    color: var(--cw3-text);
}

.cw3 .cw3-btn--text {
    background: transparent;
    color: #aab2c0;
    border: none;
    padding: 12px 8px;
    font-size: 13px;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.cw3 .cw3-btn--text:hover {
    color: var(--cw3-text);
    background: transparent;
}

.cw3 .cw3-btn--danger {
    background: rgba(244, 63, 94, 0.10);
    color: var(--cw3-clash);
    border-color: rgba(244, 63, 94, 0.35);
}

.cw3 .cw3-btn--danger:hover {
    background: rgba(244, 63, 94, 0.16);
    border-color: rgba(244, 63, 94, 0.55);
    color: #ff6b81;
}

.cw3 .cw3-btn--lg { padding: 16px 26px; font-size: 15px; }
.cw3 .cw3-btn--full { width: 100%; justify-content: center; }
.cw3 .cw3-btn[disabled],
.cw3 .cw3-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
}

/* ──────────────────────────── title accents ──────────────────────────── */
.cw3 .cw3-title-accent {
    background: linear-gradient(120deg, var(--cw3-struct) 0%, var(--cw3-clash) 50%, var(--cw3-mech) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 100%;
    animation: cw3-shimmer 12s ease-in-out infinite alternate;
}

.cw3 .cw3-title-accent--cyan {
    background: linear-gradient(120deg, var(--cw3-mech) 0%, var(--cw3-success) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes cw3-shimmer {
    0%   { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

@keyframes cw3-rise {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes cw3-drift {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(60px, -40px) scale(1.15); }
}

/* ──────────────────────────── hero background primitives ──────────────────────────── */
.cw3 .cw3-hero-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.cw3 .cw3-grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 0%, transparent 100%);
}

.cw3 .cw3-aurora {
    position: absolute;
    width: 720px;
    height: 720px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.28;
    animation: cw3-drift 24s ease-in-out infinite alternate;
}

.cw3 .cw3-aurora--mech {
    top: -10%;
    left: 20%;
    background: radial-gradient(circle, var(--cw3-mech) 0%, transparent 60%);
}

.cw3 .cw3-aurora--struct {
    top: 30%;
    right: -15%;
    background: radial-gradient(circle, var(--cw3-struct) 0%, transparent 60%);
    animation-delay: -8s;
}

.cw3 .cw3-aurora--elec {
    bottom: -20%;
    left: -10%;
    background: radial-gradient(circle, var(--cw3-plumb) 0%, transparent 60%);
    animation-delay: -16s;
    opacity: 0.18;
}

.cw3 .cw3-noise {
    position: absolute;
    inset: 0;
    opacity: 0.04;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ──────────────────────────── eyebrow chip ──────────────────────────── */
.cw3 .cw3-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 8px 14px 8px 10px;
    border: 1px solid var(--cw3-line);
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(8px);
}

/* ──────────────────────────── section head ──────────────────────────── */
.cw3 .cw3-section-head {
    max-width: 760px;
    margin-bottom: 56px;
}

.cw3 .cw3-section-head--center {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.cw3 .cw3-section-head--center .cw3-section-tag,
.cw3 .cw3-section-head--center .cw3-section-title,
.cw3 .cw3-section-head--center .cw3-section-lede {
    text-align: center;
}

.cw3 .cw3-section-head--center .cw3-section-lede {
    margin: 0 auto;
    max-width: 580px;
}

.cw3 .cw3-section-tag {
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--cw3-text-3);
    margin: 0 0 20px;
}

.cw3 .cw3-section-title {
    font-size: clamp(28px, 5vw, 64px);
    line-height: 0.95;
    letter-spacing: -0.035em;
    font-weight: 600;
    margin: 0 0 18px;
    color: var(--cw3-text);
}

.cw3 .cw3-section-lede {
    font-size: 17px;
    line-height: 1.55;
    color: var(--cw3-text-2);
    max-width: 560px;
    margin: 0 0 28px;
}

/* ──────────────────────────── card / panel ──────────────────────────── */
.cw3 .cw3-card {
    background: var(--cw3-panel);
    border: 1px solid var(--cw3-line);
    border-radius: 12px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 30px 80px -20px rgba(0, 0, 0, 0.6);
}

.cw3 .cw3-card--featured {
    border-color: rgba(34, 211, 238, 0.35);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 0 0 1px rgba(34, 211, 238, 0.08),
        0 30px 80px -30px rgba(34, 211, 238, 0.30);
    position: relative;
}

.cw3 .cw3-card--featured::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cw3-mech), transparent);
    opacity: 0.6;
    z-index: 1;
}

/* ──────────────────────────── form primitives ──────────────────────────── */
.cw3 .cw3-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.cw3 .cw3-label {
    font-family: var(--cw3-mono);
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--cw3-text-3);
}

.cw3 .cw3-input,
.cw3 .cw3-textarea,
.cw3 .cw3-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--cw3-line);
    border-radius: 8px;
    padding: 14px 16px;
    font-family: var(--cw3-display);
    font-size: 15px;
    line-height: 1.4;
    color: var(--cw3-text);
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.cw3 .cw3-input::placeholder,
.cw3 .cw3-textarea::placeholder {
    color: var(--cw3-text-3);
}

.cw3 .cw3-input:hover,
.cw3 .cw3-textarea:hover,
.cw3 .cw3-select:hover {
    border-color: var(--cw3-line-2);
}

.cw3 .cw3-input:focus,
.cw3 .cw3-textarea:focus,
.cw3 .cw3-select:focus {
    outline: none;
    border-color: rgba(34, 211, 238, 0.55);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.cw3 .cw3-input.cw3-input--invalid,
.cw3 .cw3-textarea.cw3-input--invalid {
    border-color: rgba(244, 63, 94, 0.55);
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.10);
}

.cw3 .cw3-input.invalid,
.cw3 .cw3-textarea.invalid,
.cw3 .cw3-select.invalid {
    border-color: rgba(244, 63, 94, 0.55);
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.10);
}

.cw3 .cw3-textarea { min-height: 110px; resize: vertical; }

.cw3 .cw3-validation,
.cw3 .validation-message {
    display: block;
    font-family: var(--cw3-mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--cw3-clash);
    margin-top: 2px;
}

.cw3 .cw3-helper {
    font-family: var(--cw3-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--cw3-text-3);
}

.cw3 .cw3-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--cw3-line);
    background: rgba(255, 255, 255, 0.02);
    font-size: 13px;
    line-height: 1.45;
    color: var(--cw3-text-2);
    margin-bottom: 18px;
}

.cw3 .cw3-alert--error {
    background: rgba(244, 63, 94, 0.08);
    border-color: rgba(244, 63, 94, 0.35);
    color: #ffb3c1;
}

.cw3 .cw3-alert--success {
    background: rgba(74, 222, 128, 0.08);
    border-color: rgba(74, 222, 128, 0.30);
    color: #b6f1c8;
}

.cw3 .cw3-alert--info {
    background: rgba(34, 211, 238, 0.08);
    border-color: rgba(34, 211, 238, 0.30);
    color: #b9eef5;
}

/* ──────────────────────────── auth shell ──────────────────────────── */
.cw3.cw3-auth {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 60px;
    overflow: hidden;
    isolation: isolate;
}

.cw3-auth .cw3-auth-shell {
    position: relative;
    width: 100%;
    max-width: 460px;
    z-index: 1;
}

.cw3-auth .cw3-auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
    text-decoration: none;
}

.cw3-auth .cw3-auth-brand-mark {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.25));
}

.cw3-auth .cw3-auth-brand-name {
    font-family: var(--cw3-mono);
    font-size: 12px;
    letter-spacing: 0.16em;
    color: var(--cw3-text-2);
}

.cw3-auth .cw3-auth-panel {
    background: var(--cw3-panel);
    border: 1px solid var(--cw3-line);
    border-radius: 12px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 30px 80px -20px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.cw3-auth .cw3-auth-panel-body {
    padding: 32px 32px 28px;
}

.cw3-auth .cw3-auth-eyebrow {
    font-family: var(--cw3-mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    color: var(--cw3-text-3);
    margin: 0 0 8px;
}

.cw3-auth .cw3-auth-title {
    font-size: 28px;
    line-height: 1.1;
    letter-spacing: -0.025em;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--cw3-text);
}

.cw3-auth .cw3-auth-sub {
    font-size: 14px;
    line-height: 1.55;
    color: var(--cw3-text-2);
    margin: 0 0 24px;
}

.cw3-auth .cw3-auth-foot {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--cw3-text-2);
}

.cw3-auth .cw3-auth-foot a,
.cw3-auth .cw3-auth-link {
    color: var(--cw3-mech);
    text-decoration: none;
    font-weight: 500;
}

.cw3-auth .cw3-auth-foot a:hover,
.cw3-auth .cw3-auth-link:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.cw3-auth .cw3-auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 18px;
    color: var(--cw3-text-3);
    font-family: var(--cw3-mono);
    font-size: 10px;
    letter-spacing: 0.16em;
}

.cw3-auth .cw3-auth-divider::before,
.cw3-auth .cw3-auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--cw3-line);
}

.cw3-auth .cw3-auth-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
    font-family: var(--cw3-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    color: var(--cw3-text-3);
    text-decoration: none;
}

.cw3-auth .cw3-auth-back:hover { color: var(--cw3-text-2); }

/* ──────────────────────────── final CTA ──────────────────────────── */
.cw3 .cw3-cta-final {
    position: relative;
    padding: 144px 0 160px;
    overflow: hidden;
    isolation: isolate;
    background: var(--cw3-bg);
}

.cw3 .cw3-cta-aurora {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.22;
    z-index: -1;
    animation: cw3-drift 28s ease-in-out infinite alternate;
}

.cw3 .cw3-cta-aurora--a {
    top: -20%;
    left: 8%;
    background: radial-gradient(circle, var(--cw3-mech) 0%, transparent 60%);
}

.cw3 .cw3-cta-aurora--b {
    bottom: -20%;
    right: 8%;
    background: radial-gradient(circle, var(--cw3-struct) 0%, transparent 60%);
    animation-delay: -10s;
}

.cw3 .cw3-cta-grid-overlay {
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, #000 0%, transparent 100%);
}

.cw3 .cw3-cta-inner {
    text-align: center;
}

.cw3 .cw3-cta-eyebrow {
    font-family: var(--cw3-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--cw3-text-3);
    display: block;
    margin: 0 0 16px;
}

.cw3 .cw3-cta-title {
    font-size: clamp(36px, 7vw, 80px);
    line-height: 0.98;
    letter-spacing: -0.035em;
    font-weight: 600;
    margin: 0 0 22px;
    color: var(--cw3-text);
}

.cw3 .cw3-cta-sub {
    font-size: 16px;
    line-height: 1.55;
    color: var(--cw3-text-2);
    margin: 0 auto 32px;
    max-width: 560px;
}

.cw3 .cw3-cta-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0 auto 28px;
}

.cw3 .cw3-cta-trust {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 22px;
}

.cw3 .cw3-cta-trust li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    letter-spacing: 0.14em;
    color: var(--cw3-text-3);
}

/* ──────────────────────────── footer ──────────────────────────── */
.cw3 .cw3-foot {
    background: var(--cw3-panel);
    border-top: 1px solid var(--cw3-line);
    padding: 64px 0 40px;
}

.cw3 .cw3-foot-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 40px;
    align-items: start;
}

.cw3 .cw3-foot-brand-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cw3 .cw3-foot-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.cw3 .cw3-foot-brand-mark {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.25));
}

.cw3 .cw3-foot-brand-name {
    font-family: var(--cw3-mono);
    font-size: 12px;
    letter-spacing: 0.18em;
    color: var(--cw3-text);
}

.cw3 .cw3-foot-tag {
    font-size: 13px;
    line-height: 1.5;
    color: var(--cw3-text-2);
    margin: 0;
    max-width: 320px;
}

.cw3 .cw3-foot-ad-badge {
    height: 32px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
    align-self: flex-start;
    filter: brightness(0) invert(1);
    opacity: 0.85;
}

.cw3 .cw3-foot-build {
    font-size: 10px;
    letter-spacing: 0.14em;
    color: var(--cw3-text-3);
    margin: 4px 0 0;
}

.cw3 .cw3-foot-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cw3 .cw3-foot-h {
    font-size: 10px;
    letter-spacing: 0.18em;
    color: var(--cw3-text-3);
    margin-bottom: 4px;
}

.cw3 .cw3-foot-nav a {
    font-size: 13px;
    color: var(--cw3-text-2);
    text-decoration: none;
    transition: color 0.15s ease;
}

.cw3 .cw3-foot-nav a:hover { color: var(--cw3-text); }

.cw3 .cw3-foot-end {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
    font-size: 10px;
    letter-spacing: 0.16em;
    color: var(--cw3-text-3);
}

@media (max-width: 760px) {
    .cw3 .cw3-foot-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .cw3 .cw3-foot-end { align-items: flex-start; }
}

/* ──────────────────────────── splash / status pages ──────────────────────────── */
.cw3.cw3-splash {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    overflow: hidden;
    position: relative;
    isolation: isolate;
}

.cw3-splash .cw3-splash-inner {
    position: relative;
    z-index: 1;
    max-width: 520px;
}

.cw3-splash .cw3-splash-mark {
    width: 56px;
    height: 56px;
    margin: 0 auto 22px;
    filter: drop-shadow(0 0 16px rgba(34, 211, 238, 0.35));
    animation: cw3-pulse-mark 2s ease-in-out infinite alternate;
}

@keyframes cw3-pulse-mark {
    from { transform: scale(1); opacity: 0.95; }
    to   { transform: scale(1.04); opacity: 1; }
}

.cw3-splash .cw3-splash-tag {
    font-family: var(--cw3-mono);
    font-size: 11px;
    letter-spacing: 0.2em;
    color: var(--cw3-text-3);
    margin: 0 0 14px;
}

.cw3-splash .cw3-splash-title {
    font-size: clamp(32px, 5vw, 52px);
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-weight: 600;
    margin: 0 0 14px;
    color: var(--cw3-text);
}

.cw3-splash .cw3-splash-sub {
    font-size: 15px;
    line-height: 1.55;
    color: var(--cw3-text-2);
    margin: 0 0 28px;
}

.cw3-splash .cw3-splash-cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ──────────────────────────── trust row ──────────────────────────── */
.cw3 .cw3-trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8c95a3;
}

.cw3 .cw3-trust-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cw3 .cw3-trust-item::before {
    content: "✓";
    color: var(--cw3-success);
    font-weight: 600;
}

.cw3 .cw3-trust-sep { opacity: 0.4; }

/* ============================================================================
   Cinematic dialog host
   --------------------------------------------------------------------------
   Pattern for any MudDialog launched from a cw3 page:
     <MudDialog Class="cw3-dialog-host">
         <TitleContent>
             <div class="cw3 cw3-dlg-wrap">
                 <div class="cw3-dlg-chrome cw3-rename-bar">…path… ✕</div>
             </div>
         </TitleContent>
         <DialogContent>
             <div class="cw3 cw3-dlg-wrap cw3-dlg-body">…sections…</div>
         </DialogContent>
         <DialogActions>
             <button class="cw3-dlg-btn">…</button>
             <button class="cw3-dlg-btn cw3-dlg-btn--primary">…</button>
         </DialogActions>
     </MudDialog>

   Covers paper background, chrome bar, body scroll surface, sections,
   field grids, pills, and footer buttons. Per-dialog files only need to
   add page-specific layout (lists, forms, etc.).
============================================================================ */

/* ── paper override: turn MudBlazor's light surface into the cw3 canvas ── */
.mud-dialog-container .mud-dialog.cw3-dialog-host {
    background: var(--cw3-bg, #0E1014) !important;
    color: var(--cw3-text, #EDEFF3) !important;
    border: 1px solid var(--cw3-line, #23262E) !important;
    border-radius: 12px !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 30px 80px -20px rgba(0, 0, 0, 0.6) !important;
    overflow: hidden !important;
    font-family: 'Geist', ui-sans-serif, system-ui, sans-serif;
}

.cw3-dialog-host .mud-dialog-title {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

.cw3-dialog-host .mud-dialog-content {
    padding: 0 !important;
    background: transparent !important;
    color: #EDEFF3 !important;
}

.cw3-dialog-host .mud-dialog-actions {
    background: var(--cw3-bg, #0E1014) !important;
    border-top: 1px solid var(--cw3-line, #23262E) !important;
    padding: 14px 22px !important;
    gap: 8px;
}

/* The MudBlazor close icon button (CloseButton="true") — we render our own
   in the chrome bar, so suppress the auto one. */
.cw3-dialog-host > .mud-dialog-title > .mud-icon-button {
    display: none !important;
}

/* ── inner cw3 wrapper: kill the .cw3 body 100vh, let the dialog size to fit ── */
.cw3.cw3-dlg-wrap {
    min-height: 0;
    background: transparent;
}

/* ── chrome bar inside TitleContent ── */
.cw3 .cw3-dlg-chrome {
    min-height: 40px;
}

/* Pin the close button to the right edge of the dialog chrome.
   .cw3-rename-bar otherwise zeros the win-controls margin (so a status pill
   sandwiched in the middle can act as the right-pusher); dialogs don't have
   that pill, so we re-enable the auto push here for chrome bars only. */
.cw3 .cw3-dlg-chrome .cw3-win-controls {
    margin-left: auto;
}

.cw3 .cw3-dlg-chrome .cw3-win-btn--close {
    cursor: pointer;
}

.cw3 .cw3-dlg-chrome-title {
    margin-left: 6px;
    font-size: 12.5px;
    color: var(--cw3-text-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

/* ── scrollable body surface ── */
.cw3 .cw3-dlg-body {
    max-height: 76vh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--cw3-line-2) var(--cw3-bg);
}

.cw3 .cw3-dlg-body::-webkit-scrollbar { width: 10px; }
.cw3 .cw3-dlg-body::-webkit-scrollbar-track { background: var(--cw3-bg); }
.cw3 .cw3-dlg-body::-webkit-scrollbar-thumb { background: var(--cw3-line-2); border-radius: 100px; }

/* ── section ── */
.cw3 .cw3-dlg-section {
    padding: 26px 28px 24px;
    border-bottom: 1px solid var(--cw3-line);
}

.cw3 .cw3-dlg-section:last-of-type {
    border-bottom: none;
}

.cw3 .cw3-dlg-tag {
    color: var(--cw3-text-3);
    font-size: 10.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin: 0 0 12px;
}

.cw3 .cw3-dlg-title {
    font-size: clamp(20px, 2.4vw, 26px);
    font-weight: 600;
    line-height: 1.2;
    color: var(--cw3-text);
    margin: 0 0 8px;
    letter-spacing: -0.01em;
}

.cw3 .cw3-dlg-lede {
    color: var(--cw3-text-2);
    font-size: 14px;
    line-height: 1.55;
    margin: 0 0 18px;
    max-width: 760px;
}

/* ── 2-col field grid ── */
.cw3 .cw3-dlg-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 28px;
}

.cw3 .cw3-dlg-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.cw3 .cw3-dlg-field--span-2 {
    grid-column: 1 / -1;
}

.cw3 .cw3-dlg-field__label {
    color: var(--cw3-text-3);
    font-size: 11px;
    letter-spacing: 0.04em;
}

.cw3 .cw3-dlg-field__value {
    color: var(--cw3-text);
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.cw3 .cw3-dlg-field__value--muted {
    color: var(--cw3-text-3);
}

/* ── inline pills (status / priority / metadata pairs) ── */
.cw3 .cw3-dlg-pillrow {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cw3 .cw3-dlg-pill {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    padding: 7px 14px;
    background: var(--cw3-panel);
    border: 1px solid var(--cw3-line);
    border-radius: 100px;
    font-size: 13px;
    line-height: 1.2;
}

.cw3 .cw3-dlg-pill__label {
    color: var(--cw3-text-3);
    font-size: 10.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.cw3 .cw3-dlg-pill__value {
    color: var(--cw3-text);
    font-weight: 500;
}

.cw3 .cw3-dlg-pill--clash   { border-color: rgba(244, 63, 94, 0.4);  background: rgba(244, 63, 94, 0.08); }
.cw3 .cw3-dlg-pill--clash   .cw3-dlg-pill__value { color: var(--cw3-clash); }
.cw3 .cw3-dlg-pill--struct  { border-color: rgba(255, 138, 76, 0.4); background: rgba(255, 138, 76, 0.08); }
.cw3 .cw3-dlg-pill--struct  .cw3-dlg-pill__value { color: var(--cw3-struct); }
.cw3 .cw3-dlg-pill--elec    { border-color: rgba(250, 204, 21, 0.4); background: rgba(250, 204, 21, 0.08); }
.cw3 .cw3-dlg-pill--elec    .cw3-dlg-pill__value { color: var(--cw3-elec); }
.cw3 .cw3-dlg-pill--mech    { border-color: rgba(34, 211, 238, 0.4); background: rgba(34, 211, 238, 0.08); }
.cw3 .cw3-dlg-pill--mech    .cw3-dlg-pill__value { color: var(--cw3-mech); }
.cw3 .cw3-dlg-pill--success { border-color: rgba(74, 222, 128, 0.4); background: rgba(74, 222, 128, 0.08); }
.cw3 .cw3-dlg-pill--success .cw3-dlg-pill__value { color: var(--cw3-success); }

/* ── color swatch (for status / priority option lists) ── */
.cw3 .cw3-dlg-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

/* ── footer buttons (use this instead of MudButton inside DialogActions) ── */
.cw3-dlg-btn {
    appearance: none;
    background: transparent;
    border: 1px solid var(--cw3-line-2, #2C3038);
    color: var(--cw3-text, #EDEFF3);
    padding: 9px 22px;
    border-radius: 100px;
    font-family: 'Geist', ui-sans-serif, system-ui, sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.cw3-dlg-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--cw3-text-3, #6A707B);
}

.cw3-dlg-btn:focus-visible {
    outline: 1px solid var(--cw3-mech, #22D3EE);
    outline-offset: 2px;
}

.cw3-dlg-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.cw3-dlg-btn--primary {
    background: var(--cw3-text, #EDEFF3);
    border-color: var(--cw3-text, #EDEFF3);
    color: #0E1014;
}

.cw3-dlg-btn--primary:hover:not(:disabled) {
    background: var(--cw3-text, #EDEFF3);
    border-color: var(--cw3-text, #EDEFF3);
    box-shadow: 0 0 0 1px var(--cw3-text, #EDEFF3), 0 8px 24px rgba(34, 211, 238, 0.22);
    color: #0E1014;
}

.cw3-dlg-btn--danger {
    background: var(--cw3-clash, #F43F5E);
    border-color: var(--cw3-clash, #F43F5E);
    color: #0E1014;
}

.cw3-dlg-btn--danger:hover:not(:disabled) {
    background: #FF5470;
    border-color: #FF5470;
    box-shadow: 0 0 0 1px #FF5470, 0 8px 24px rgba(244, 63, 94, 0.32);
    color: #0E1014;
}

.cw3-dlg-btn--warn {
    background: var(--cw3-elec, #FACC15);
    border-color: var(--cw3-elec, #FACC15);
    color: #0E1014;
}

.cw3-dlg-btn--warn:hover:not(:disabled) {
    background: #FFD93D;
    border-color: #FFD93D;
    box-shadow: 0 0 0 1px #FFD93D, 0 8px 24px rgba(250, 204, 21, 0.32);
    color: #0E1014;
}

/* ── alerts inside dialogs (replace MudAlert when possible) ── */
.cw3 .cw3-dlg-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 8px;
    border: 1px solid;
    font-size: 13px;
    line-height: 1.5;
    color: var(--cw3-text);
}

.cw3 .cw3-dlg-alert--info {
    border-color: rgba(34, 211, 238, 0.3);
    background: rgba(34, 211, 238, 0.07);
}

.cw3 .cw3-dlg-alert--warn {
    border-color: rgba(250, 204, 21, 0.32);
    background: rgba(250, 204, 21, 0.08);
}

.cw3 .cw3-dlg-alert--danger {
    border-color: rgba(244, 63, 94, 0.32);
    background: rgba(244, 63, 94, 0.08);
}

.cw3 .cw3-dlg-alert__icon {
    flex-shrink: 0;
    color: var(--cw3-mech);
    margin-top: 1px;
}

.cw3 .cw3-dlg-alert--warn   .cw3-dlg-alert__icon { color: var(--cw3-elec); }
.cw3 .cw3-dlg-alert--danger .cw3-dlg-alert__icon { color: var(--cw3-clash); }

/* ── form inputs (cw3 dark text/textarea) ── */
.cw3 .cw3-dlg-input,
.cw3 .cw3-dlg-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--cw3-line-2);
    border-radius: 6px;
    padding: 11px 14px;
    color: var(--cw3-text);
    font-family: 'Geist', ui-sans-serif, system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    transition: border-color 0.15s ease, background 0.15s ease;
    outline: none;
}

.cw3 .cw3-dlg-textarea {
    resize: vertical;
    min-height: 84px;
}

.cw3 .cw3-dlg-input::placeholder,
.cw3 .cw3-dlg-textarea::placeholder {
    color: var(--cw3-text-3);
}

.cw3 .cw3-dlg-input:hover,
.cw3 .cw3-dlg-textarea:hover {
    border-color: var(--cw3-text-3);
}

.cw3 .cw3-dlg-input:focus,
.cw3 .cw3-dlg-textarea:focus {
    border-color: var(--cw3-mech);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.cw3 .cw3-dlg-input--error {
    border-color: var(--cw3-clash);
}

.cw3 .cw3-dlg-input--error:focus {
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.18);
}

.cw3 .cw3-dlg-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cw3 .cw3-dlg-input-label {
    color: var(--cw3-text-2);
    font-size: 12px;
    letter-spacing: 0.02em;
}

.cw3 .cw3-dlg-input-help {
    color: var(--cw3-text-3);
    font-size: 11.5px;
    margin-top: 2px;
}

.cw3 .cw3-dlg-input-error {
    color: var(--cw3-clash);
    font-size: 11.5px;
    margin-top: 2px;
}

/* ── radio rows (for status / priority pickers) ── */
.cw3 .cw3-dlg-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cw3 .cw3-dlg-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--cw3-panel);
    border: 1px solid var(--cw3-line);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.cw3 .cw3-dlg-option:hover {
    background: var(--cw3-panel-2);
    border-color: var(--cw3-line-2);
}

.cw3 .cw3-dlg-option--selected {
    border-color: var(--cw3-mech);
    background: rgba(34, 211, 238, 0.06);
    box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.2);
}

.cw3 .cw3-dlg-option__radio {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid var(--cw3-line-2);
    flex-shrink: 0;
    position: relative;
    transition: border-color 0.15s ease;
}

.cw3 .cw3-dlg-option--selected .cw3-dlg-option__radio {
    border-color: var(--cw3-mech);
}

.cw3 .cw3-dlg-option--selected .cw3-dlg-option__radio::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--cw3-mech);
}

.cw3 .cw3-dlg-option__body {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.cw3 .cw3-dlg-option__name {
    color: var(--cw3-text);
    font-size: 14px;
    font-weight: 500;
}

.cw3 .cw3-dlg-option__badge {
    font-family: var(--cw3-mono);
    font-size: 9px;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--cw3-text-3);
    border: 1px solid var(--cw3-line-2);
    padding: 2px 7px;
    border-radius: 3px;
}

/* ── select dropdown ── */
.cw3 .cw3-dlg-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--cw3-line-2);
    border-radius: 6px;
    padding: 11px 36px 11px 14px;
    color: var(--cw3-text);
    font-family: 'Geist', ui-sans-serif, system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'><path d='M1 1L5 5L9 1' stroke='%236A707B' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.cw3 .cw3-dlg-select:hover {
    border-color: var(--cw3-text-3);
}

.cw3 .cw3-dlg-select:focus {
    outline: none;
    border-color: var(--cw3-mech);
    background-color: rgba(255, 255, 255, 0.03);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.cw3 .cw3-dlg-select option {
    background: var(--cw3-panel);
    color: var(--cw3-text);
}

/* ── checkbox ── */
.cw3 .cw3-dlg-check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    color: var(--cw3-text);
    font-size: 14px;
    line-height: 1.4;
}

.cw3 .cw3-dlg-check input[type="checkbox"] {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--cw3-line-2);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: border-color 0.15s ease, background 0.15s ease;
    margin: 0;
}

.cw3 .cw3-dlg-check:hover input[type="checkbox"] {
    border-color: var(--cw3-text-3);
}

.cw3 .cw3-dlg-check input[type="checkbox"]:checked {
    background: var(--cw3-mech);
    border-color: var(--cw3-mech);
}

.cw3 .cw3-dlg-check input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    inset: 2px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10' fill='none'><path d='M2 5L4.5 7.5L8 3' stroke='%230E1014' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/contain no-repeat;
}

.cw3 .cw3-dlg-check--warn input[type="checkbox"]:checked {
    background: var(--cw3-elec);
    border-color: var(--cw3-elec);
}

/* ── switch (toggle) ── */
.cw3 .cw3-dlg-switch {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    color: var(--cw3-text);
    font-size: 14px;
    line-height: 1.4;
}

.cw3 .cw3-dlg-switch input[type="checkbox"] {
    appearance: none;
    width: 36px;
    height: 20px;
    border-radius: 100px;
    background: var(--cw3-panel-2);
    border: 1px solid var(--cw3-line-2);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: background 0.15s ease, border-color 0.15s ease;
    margin: 0;
}

.cw3 .cw3-dlg-switch input[type="checkbox"]::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--cw3-text-2);
    transition: transform 0.18s ease, background 0.15s ease;
}

.cw3 .cw3-dlg-switch input[type="checkbox"]:checked {
    background: rgba(34, 211, 238, 0.2);
    border-color: var(--cw3-mech);
}

.cw3 .cw3-dlg-switch input[type="checkbox"]:checked::after {
    transform: translateX(16px);
    background: var(--cw3-mech);
}

/* ── color picker (predefined swatches grid) ── */
.cw3 .cw3-dlg-color-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 6px;
}

.cw3 .cw3-dlg-color-pick {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    position: relative;
}

.cw3 .cw3-dlg-color-pick:hover {
    transform: scale(1.08);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.cw3 .cw3-dlg-color-pick--selected {
    border-color: var(--cw3-text);
    box-shadow: 0 0 0 1px var(--cw3-bg), 0 0 0 3px var(--cw3-text);
}

.cw3 .cw3-dlg-color-pick--selected::after {
    content: "";
    width: 12px;
    height: 12px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'><path d='M2 6L5 9L10 3' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/contain no-repeat;
    filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.5));
}

/* Preview chip — shows status/priority pill rendered with selected color */
.cw3 .cw3-dlg-preview-tile {
    background: var(--cw3-panel);
    border: 1px solid var(--cw3-line);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cw3 .cw3-dlg-preview-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 100px;
    font-size: 12.5px;
    font-weight: 500;
    color: #fff;
    line-height: 1.3;
}

/* ── loading / empty states ── */
.cw3 .cw3-dlg-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--cw3-text-2);
    font-size: 13px;
    padding: 36px 20px;
}

.cw3 .cw3-dlg-spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--cw3-line-2);
    border-top-color: var(--cw3-mech);
    animation: cw3-dlg-spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes cw3-dlg-spin {
    to { transform: rotate(360deg); }
}

.cw3 .cw3-dlg-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 36px 20px;
    text-align: center;
    color: var(--cw3-text-2);
    border: 1px dashed var(--cw3-line-2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.01);
}

.cw3 .cw3-dlg-empty__title {
    color: var(--cw3-text);
    font-size: 14px;
    font-weight: 500;
}

.cw3 .cw3-dlg-empty__hint {
    color: var(--cw3-text-3);
    font-size: 12.5px;
    line-height: 1.5;
    max-width: 340px;
}

/* ── stat pills (small mono count chips for management dialogs) ── */
.cw3 .cw3-dlg-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cw3 .cw3-dlg-stat {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 4px 10px;
    background: var(--cw3-panel);
    border: 1px solid var(--cw3-line);
    border-radius: 100px;
    font-size: 11.5px;
    color: var(--cw3-text-2);
    font-family: var(--cw3-mono);
    letter-spacing: 0.02em;
}

.cw3 .cw3-dlg-stat__num {
    color: var(--cw3-text);
    font-weight: 600;
    font-size: 12px;
}

.cw3 .cw3-dlg-stat--mech .cw3-dlg-stat__num { color: var(--cw3-mech); }
.cw3 .cw3-dlg-stat--struct .cw3-dlg-stat__num { color: var(--cw3-struct); }
.cw3 .cw3-dlg-stat--success .cw3-dlg-stat__num { color: var(--cw3-success); }

/* ── icon button (used in list rows: edit, delete, open, etc.) ── */
.cw3 .cw3-dlg-icon-btn {
    appearance: none;
    background: transparent;
    border: 1px solid transparent;
    color: var(--cw3-text-2);
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    padding: 0;
}

.cw3 .cw3-dlg-icon-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--cw3-line-2);
    color: var(--cw3-text);
}

.cw3 .cw3-dlg-icon-btn--mech:hover {
    color: var(--cw3-mech);
    border-color: rgba(34, 211, 238, 0.4);
    background: rgba(34, 211, 238, 0.08);
}

.cw3 .cw3-dlg-icon-btn--warn:hover {
    color: var(--cw3-elec);
    border-color: rgba(250, 204, 21, 0.4);
    background: rgba(250, 204, 21, 0.08);
}

.cw3 .cw3-dlg-icon-btn--danger:hover {
    color: var(--cw3-clash);
    border-color: rgba(244, 63, 94, 0.4);
    background: rgba(244, 63, 94, 0.08);
}

/* ── tabs (used in ManageClashSetsDialog) ── */
.cw3 .cw3-dlg-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--cw3-line);
    overflow-x: auto;
    scrollbar-width: none;
}

.cw3 .cw3-dlg-tabs::-webkit-scrollbar { display: none; }

.cw3 .cw3-dlg-tab {
    appearance: none;
    background: transparent;
    border: none;
    color: var(--cw3-text-3);
    padding: 10px 14px;
    font-family: 'Geist', ui-sans-serif, system-ui, sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s ease, border-color 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.cw3 .cw3-dlg-tab:hover {
    color: var(--cw3-text-2);
}

.cw3 .cw3-dlg-tab--active {
    color: var(--cw3-text);
    border-bottom-color: var(--cw3-mech);
}

.cw3 .cw3-dlg-tab__count {
    font-family: var(--cw3-mono);
    font-size: 11px;
    color: var(--cw3-text-3);
    background: var(--cw3-panel);
    border: 1px solid var(--cw3-line);
    padding: 1px 6px;
    border-radius: 100px;
}

.cw3 .cw3-dlg-tab--active .cw3-dlg-tab__count {
    color: var(--cw3-mech);
    border-color: rgba(34, 211, 238, 0.4);
    background: rgba(34, 211, 238, 0.08);
}

/* ── inline progress bar ── */
.cw3 .cw3-dlg-progress {
    height: 3px;
    width: 100%;
    background: var(--cw3-line);
    border-radius: 100px;
    overflow: hidden;
    position: relative;
}

.cw3 .cw3-dlg-progress::before {
    content: "";
    position: absolute;
    inset: 0;
    width: 30%;
    background: linear-gradient(90deg, transparent, var(--cw3-mech), transparent);
    animation: cw3-dlg-indeterminate 1.5s ease-in-out infinite;
}

@keyframes cw3-dlg-indeterminate {
    0% { left: -30%; }
    100% { left: 100%; }
}

/* ── responsive ── */
@media (max-width: 720px) {
    .cw3 .cw3-dlg-section { padding: 22px 18px; }
    .cw3 .cw3-dlg-grid { grid-template-columns: 1fr; gap: 14px; }
    .cw3 .cw3-dlg-body { max-height: 82vh; }
    .cw3 .cw3-dlg-color-grid { grid-template-columns: repeat(8, 1fr); }
}

/* ──────────────────────────── responsive scale-down ──────────────────────────── */
@media (max-width: 720px) {
    .cw3 .cw3-container { padding: 0 20px; }
    .cw3 .cw3-section-head { margin-bottom: 36px; }
    .cw3 .cw3-cta-final { padding: 96px 0 80px; }
    .cw3-auth .cw3-auth-panel-body { padding: 24px 22px 22px; }
}

@media (max-width: 480px) {
    .cw3 .cw3-container { padding: 0 16px; }
    .cw3-auth .cw3-auth-title { font-size: 24px; }
}

/* ──────────────────────────── reduced motion ──────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .cw3 .cw3-pulse-dot,
    .cw3 .cw3-pulse-dot--green,
    .cw3 .cw3-aurora,
    .cw3 .cw3-cta-aurora,
    .cw3 .cw3-title-accent,
    .cw3-splash .cw3-splash-mark {
        animation: none !important;
    }
}
