/* =========================================================
   PromptForge Dark Design Tokens
   ========================================================= */

:root {
    /* Backgrounds */
    --pf-bg:              #080B16;
    --pf-bg-soft:         #0D1222;
    --pf-surface:         #111827;
    --pf-surface-soft:    #172033;
    --pf-surface-subtle:  #1A2336;
    --pf-surface-muted:   #202A3E;
    --pf-surface-elevated:#0D1424;

    /* Navigation */
    --pf-sidebar-bg:      #0B1020;
    --pf-topbar-bg:       #111426;

    /* Primary */
    --pf-primary:         #6366F1;
    --pf-primary-hover:   #4F46E5;
    --pf-primary-soft:    rgba(99, 102, 241, 0.16);

    /* Text */
    --pf-text:            #F9FAFB;
    --pf-text-muted:      #A1A1AA;
    --pf-text-soft:       #D1D5DB;
    --pf-text-subtle:     #D1D5DB;

    /* Borders */
    --pf-border:          rgba(255, 255, 255, 0.08);
    --pf-border-strong:   rgba(255, 255, 255, 0.14);
    --pf-border-subtle:   rgba(255, 255, 255, 0.08);

    /* Semantic */
    --pf-danger:          #EF4444;
    --pf-danger-hover:    #DC2626;
    --pf-success:         #22C55E;

    /* Sidebar */
    --pf-sidebar-text:     #E5E7EB;
    --pf-sidebar-muted:    #9CA3AF;
    --pf-sidebar-active:   #6366F1;
    --pf-sidebar-hover-bg: #1E2235;

    /* Badges */
    --pf-badge-indigo-bg:   rgba(99, 102, 241, 0.16);
    --pf-badge-indigo-text: #C7D2FE;
    --pf-badge-green-bg:    rgba(34, 197, 94, 0.12);
    --pf-badge-green-text:  #86EFAC;

    /* Focus / Glow */
    --pf-focus-ring:    rgba(99, 102, 241, 0.16);
    --pf-primary-glow:  rgba(99, 102, 241, 0.16);

    /* Shadows */
    --pf-shadow-sm:    0 18px 54px rgba(0, 0, 0, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.025);
    --pf-shadow-md:    0 28px 82px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(99, 102, 241, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    --pf-shadow-hover: 0 26px 72px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(99, 102, 241, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.05);

    /* Radii */
    --pf-radius-xs: 4px;
    --pf-radius-sm: 8px;
    --pf-radius-md: 12px;
    --pf-radius-lg: 16px;

    /* Layout */
    --pf-sidebar-width: 256px;
    --pf-topbar-height: 60px;
    --pf-transition:    150ms ease;

    /* Typography */
    --pf-font-ui:     'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --pf-font-accent: 'Orbitron', 'Inter', system-ui, sans-serif;
    --pf-font-mono:   'JetBrains Mono', 'Cascadia Code', 'Consolas', monospace;
}

/* =========================================================
   Reset / Base
   ========================================================= */

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

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: var(--pf-font-ui);
    font-size: 14px;
    line-height: 1.6;
    color: var(--pf-text);
    background: var(--pf-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 .5rem 0;
    font-weight: 700;
    line-height: 1.3;
    color: var(--pf-text);
    font-family: var(--pf-font-accent);
    letter-spacing: 0;
}

h1 {
    font-size: 1.45rem;
    font-weight: 700;
}

h2, h3, h4, h5, h6 {
    font-weight: 700;
}

h2 { font-size: 1.15rem; }
h3 { font-size: 0.95rem; }

p { margin: 0 0 .75rem 0; line-height: 1.6; }

a { color: var(--pf-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1:focus { outline: none; }

/* =========================================================
   App Shell Layout
   ========================================================= */

.app-shell {
    display: flex;
    min-height: 100vh;
}

/* =========================================================
   Sidebar
   ========================================================= */

.sidebar {
    width: var(--pf-sidebar-width);
    isolation: isolate;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(18, 24, 43, 0.98) 0%, rgba(7, 11, 23, 0.99) 43%, rgba(8, 12, 26, 1) 74%, rgba(13, 14, 34, 1) 100%),
        var(--pf-sidebar-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    padding: 0;
    border-right: 1px solid rgba(148, 163, 184, 0.10);
    box-shadow:
        18px 0 44px rgba(0, 0, 0, 0.34),
        inset -1px 0 0 rgba(129, 140, 248, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 12% 0%, rgba(148, 163, 184, 0.08), transparent 30%),
        radial-gradient(circle at 90% 100%, rgba(99, 102, 241, 0.10), transparent 38%),
        linear-gradient(90deg, rgba(255, 255, 255, 0.018), transparent 46%);
}

.sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(125, 211, 252, 0.18) 20%, rgba(129, 140, 248, 0.20) 52%, transparent 92%);
    box-shadow: -1px 0 18px rgba(99, 102, 241, 0.12);
}

.sidebar-brand {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.82rem;
    margin: 12px 12px 8px;
    padding: 0.76rem 0.72rem 0.8rem 0.78rem;
    width: auto;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-bottom-color: rgba(0, 240, 200, 0.22);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.070), rgba(255, 255, 255, 0.016) 42%, rgba(6, 182, 212, 0.060) 70%, rgba(0, 240, 200, 0.035)),
        linear-gradient(180deg, rgba(13, 18, 34, 0.74), rgba(5, 9, 21, 0.82));
    box-shadow:
        0 14px 32px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.070),
        inset 0 -1px 0 rgba(0, 240, 200, 0.10);
    flex-shrink: 0;
    text-decoration: none;
    transition: border-color var(--pf-transition), background var(--pf-transition), box-shadow var(--pf-transition);
}

.sidebar-brand-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 10px 22px rgba(0,0,0,0.28)) drop-shadow(0 0 12px rgba(0,240,200,0.08));
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    flex: 1;
}

.sidebar-brand-name {
    font-family: var(--pf-font-accent);
    font-size: 1.22rem;
    font-weight: 850;
    color: rgba(255, 255, 255, 0.97);
    line-height: 1.05;
    letter-spacing: 0;
    white-space: nowrap;
    text-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.sidebar-brand-sig-row {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    margin-top: 5px;
}

.sidebar-brand-sig-row::before,
.sidebar-brand-sig-row::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(0, 240, 200, 0.38));
}

.sidebar-brand-sig-row::after {
    background: linear-gradient(to left, transparent, rgba(0, 240, 200, 0.38));
}

.sidebar-brand-sig {
    font-family: var(--pf-font-mono);
    font-size: 1.0rem;
    font-weight: 600;
    color: #00F0C8;
    letter-spacing: 0.18em;
    white-space: nowrap;
    text-shadow: 0 0 14px rgba(0, 240, 200, 0.45);
    flex-shrink: 0;
}

.sidebar-brand-sig-row--mobile .sidebar-brand-sig {
    font-size: 0.78rem;
}

.sidebar-brand:hover {
    border-color: rgba(148, 163, 184, 0.18);
    border-bottom-color: rgba(0, 240, 200, 0.36);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.082), rgba(255, 255, 255, 0.020) 42%, rgba(6, 182, 212, 0.080) 70%, rgba(0, 240, 200, 0.048)),
        linear-gradient(180deg, rgba(14, 20, 38, 0.80), rgba(6, 10, 23, 0.88));
    box-shadow:
        0 16px 38px rgba(0, 0, 0, 0.26),
        inset 0 1px 0 rgba(255, 255, 255, 0.082),
        inset 0 -1px 0 rgba(0, 240, 200, 0.14);
    text-decoration: none;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin: 0 12px 10px;
    padding: 10px 10px 11px;
    border-top: 1px solid rgba(148, 163, 184, 0.075);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.012), rgba(255, 255, 255, 0.002)),
        rgba(2, 6, 18, 0.12);
    border-radius: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.014);
    flex-shrink: 0;
    text-align: center;
}

.ai-layout-status {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 9px;
    border-radius: 8px;
    color: rgba(229, 231, 235, 0.88);
    text-decoration: none;
    background: rgba(15, 23, 42, 0.52);
    border: 1px solid rgba(148, 163, 184, 0.13);
}

.ai-layout-status:hover {
    color: #fff;
    background: rgba(30, 41, 59, 0.72);
}

.ai-layout-status-check {
    width: 100%;
    min-height: 31px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.46);
    color: rgba(229, 231, 235, 0.86);
    font-size: .68rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--pf-transition), border-color var(--pf-transition), color var(--pf-transition);
}

.ai-layout-status-check:hover:not(:disabled) {
    background: rgba(30, 41, 59, 0.70);
    border-color: rgba(148, 163, 184, 0.22);
    color: #fff;
}

.ai-layout-status-check:disabled {
    cursor: wait;
    opacity: .64;
}

.ai-layout-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    flex: 0 0 auto;
    background: var(--pf-danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.ai-layout-status-dot--online {
    background: var(--pf-success);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
}

.ai-layout-status-dot--checking {
    background: var(--pf-warning);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.14);
}

.ai-layout-status-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    text-align: left;
}

.ai-layout-status-copy span {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.15;
}

.ai-layout-status-copy small {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(148, 163, 184, 0.78);
    font-size: .62rem;
    line-height: 1.15;
}

.sidebar-footer-brand {
    font-family: var(--pf-font-accent);
    font-size: .71rem;
    font-weight: 700;
    color: rgba(229, 231, 235, 0.66);
    letter-spacing: 0;
    line-height: 1.18;
}

.sidebar-footer-year {
    font-family: var(--pf-font-mono);
    font-size: .61rem;
    font-weight: 500;
    color: rgba(148, 163, 184, 0.46);
    letter-spacing: .04em;
    line-height: 1.15;
}

.sidebar-footer-sub {
    font-family: var(--pf-font-ui);
    font-size: .61rem;
    color: rgba(148, 163, 184, 0.50);
    letter-spacing: 0;
    line-height: 1.28;
}

.sidebar-nav {
    flex: 1;
    padding: 7px 10px 9px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.18) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 8px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.14);
    border: 2px solid transparent;
    border-radius: 999px;
    background-clip: content-box;
}

.sidebar-section-label {
    font-family: var(--pf-font-mono);
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(168, 181, 205, 0.75);
    padding: 14px 13px 5px;
    margin: 4px 0 0;
    display: block;
    border-top: 1px solid rgba(148, 163, 184, 0.08);
    line-height: 1.2;
}

.sidebar-section-label:first-child {
    border-top: none;
    padding-top: 5px;
    margin-top: 0;
}

.sidebar-nav a,
.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 9px;
    position: relative;
    min-height: 34px;
    padding: 7px 11px 7px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: rgba(238, 242, 255, 0.86);
    font-family: var(--pf-font-ui);
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    transition: background var(--pf-transition), border-color var(--pf-transition), color var(--pf-transition), box-shadow var(--pf-transition), transform var(--pf-transition);
    margin-bottom: 2px;
    line-height: 1.15;
    outline: none;
}

.sidebar-nav a::before,
.sidebar-nav .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    bottom: 7px;
    width: 2px;
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
    transition: background var(--pf-transition), box-shadow var(--pf-transition), opacity var(--pf-transition);
    opacity: 0;
}

.sidebar-nav a:hover,
.sidebar-nav .nav-link:hover {
    background:
        linear-gradient(90deg, rgba(148, 163, 184, 0.09), rgba(148, 163, 184, 0.03)),
        rgba(15, 23, 42, 0.45);
    border-color: rgba(148, 163, 184, 0.12);
    color: rgba(255, 255, 255, 0.98);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
    transform: translateX(2px);
    text-decoration: none;
}

.sidebar-nav a.active,
.sidebar-nav .nav-link.active {
    background:
        linear-gradient(90deg, rgba(99,102,241,0.22), rgba(56,189,248,0.085) 52%, rgba(255,255,255,0.022)),
        rgba(15, 23, 42, 0.58);
    color: rgba(255, 255, 255, 0.99);
    font-weight: 800;
    border-color: rgba(129, 140, 248, 0.22);
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.18),
        0 0 0 1px rgba(99, 102, 241, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.sidebar-nav a.active::before,
.sidebar-nav .nav-link.active::before {
    background: linear-gradient(180deg, rgba(125, 211, 252, 0.95), rgba(99, 102, 241, 0.96));
    box-shadow: 0 0 18px rgba(99, 102, 241, 0.55);
    opacity: 1;
}

.sidebar-nav a.active .nav-icon,
.sidebar-nav .nav-link.active .nav-icon {
    color: rgba(125, 211, 252, 0.92);
}

.sidebar-nav a:hover .nav-icon,
.sidebar-nav .nav-link:hover .nav-icon {
    transform: translateX(1px);
}

.nav-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: inherit;
    transition: color var(--pf-transition), transform var(--pf-transition);
}

.nav-item-codebase .nav-icon {
    color: rgba(52, 211, 153, 0.78);
}

.nav-item-codebase:hover .nav-icon,
.nav-item-codebase.active .nav-icon {
    color: rgba(52, 211, 153, 1);
}

.nav-item-codebase.active {
    background:
        linear-gradient(90deg, rgba(52,211,153,0.16), rgba(56,189,248,0.065) 52%, rgba(255,255,255,0.018)),
        rgba(15, 23, 42, 0.58);
    border-color: rgba(52, 211, 153, 0.22);
}

.nav-item-codebase.active::before {
    background: linear-gradient(180deg, rgba(52, 211, 153, 0.95), rgba(16, 185, 129, 0.90));
    box-shadow: 0 0 18px rgba(52, 211, 153, 0.45);
}

.sidebar-nav-group {
    margin-bottom: 2px;
}

.sidebar-nav-group > summary {
    list-style: none;
}

.sidebar-nav-group > summary::-webkit-details-marker {
    display: none;
}

.sidebar-nav-group-toggle {
    display: flex;
    align-items: center;
    gap: 9px;
    position: relative;
    min-height: 34px;
    padding: 7px 11px 7px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: rgba(238, 242, 255, 0.86);
    font-family: var(--pf-font-ui);
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.15;
    cursor: pointer;
    transition: background var(--pf-transition), border-color var(--pf-transition), color var(--pf-transition), box-shadow var(--pf-transition), transform var(--pf-transition);
}

.sidebar-nav-group-toggle:hover,
.sidebar-nav-group[open] > .sidebar-nav-group-toggle {
    background:
        linear-gradient(90deg, rgba(148, 163, 184, 0.09), rgba(148, 163, 184, 0.03)),
        rgba(15, 23, 42, 0.45);
    border-color: rgba(148, 163, 184, 0.12);
    color: rgba(255, 255, 255, 0.98);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
    transform: translateX(2px);
}

.sidebar-nav-group-toggle:hover .nav-icon,
.sidebar-nav-group[open] > .sidebar-nav-group-toggle .nav-icon {
    color: rgba(125, 211, 252, 0.92);
}

.sidebar-nav-group-chevron {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    margin-left: auto;
    border-right: 2px solid rgba(226, 232, 240, .70);
    border-bottom: 2px solid rgba(226, 232, 240, .70);
    transform: rotate(45deg) translateY(-2px);
    transition: transform var(--pf-transition), border-color var(--pf-transition);
}

.sidebar-nav-group[open] .sidebar-nav-group-chevron {
    transform: rotate(-135deg) translateY(-1px);
    border-color: rgba(255, 255, 255, .95);
}

.sidebar-nav-submenu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 3px 0 5px 18px;
    padding-left: 10px;
    border-left: 1px solid rgba(148, 163, 184, 0.12);
}

.sidebar-nav-submenu a,
.sidebar-nav-submenu .nav-link {
    min-height: 30px;
    padding: 6px 10px;
    font-size: 0.80rem;
    font-weight: 700;
}

.sidebar-nav-submenu .nav-icon {
    width: 16px;
    height: 16px;
}

.mobile-shell-header,
.mobile-menu-backdrop,
.mobile-menu-toggle {
    display: none;
}

/* =========================================================
   Main Area
   ========================================================= */

.main-area {
    margin-left: var(--pf-sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* =========================================================
   Page Content
   ========================================================= */

.page-content {
    flex: 1;
    padding: 28px;
    max-width: 1200px;
    width: 100%;
}

.page-content:has(.workspace-module-grid) {
    max-width: min(2600px, calc(100vw - var(--pf-sidebar-width)));
    padding: clamp(22px, 2vw, 36px);
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    margin: 0;
}

/* =========================================================
   Cards
   ========================================================= */

.card {
    background: var(--pf-surface);
    border-radius: var(--pf-radius-lg);
    border: 1px solid var(--pf-border);
    box-shadow: var(--pf-shadow-sm);
    padding: 20px 24px;
}

.card-sm {
    padding: 16px 20px;
}

.card-hover {
    transition: box-shadow var(--pf-transition), transform var(--pf-transition), border-color var(--pf-transition);
}

.card-hover:hover {
    box-shadow: var(--pf-shadow-md);
    transform: translateY(-2px);
    border-color: var(--pf-border-strong);
}

/* =========================================================
   Workspace Modules (Dashboard)
   ========================================================= */

.workspace-module-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 32px;
}

.workspace-module-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.workspace-module {
    --module-accent: var(--pf-primary);
    --module-accent-soft: rgba(99, 102, 241, 0.12);
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 128px;
    padding: 18px 20px;
    color: var(--pf-text);
    text-decoration: none;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.052), transparent 42%),
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.045), transparent 42%),
        linear-gradient(180deg, rgba(13, 19, 33, 0.99), rgba(7, 12, 23, 0.99));
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: var(--pf-radius-lg);
    box-shadow: 0 22px 68px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.035);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.workspace-module::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 68% at 14% 28%, color-mix(in srgb, var(--module-accent) 18%, transparent), transparent),
        radial-gradient(ellipse 60% 42% at 55% 0%, color-mix(in srgb, var(--module-accent) 10%, transparent), transparent),
        radial-gradient(ellipse 44% 36% at 18% 92%, color-mix(in srgb, var(--module-accent) 16%, transparent), transparent);
    opacity: 0.92;
    box-shadow: inset 3px 0 0 color-mix(in srgb, var(--module-accent) 62%, transparent);
    pointer-events: none;
    z-index: 0;
}

.workspace-module > * {
    position: relative;
    z-index: 1;
}

.workspace-module:hover {
    transform: translateY(-3px);
    text-decoration: none;
    border-color: color-mix(in srgb, var(--module-accent) 40%, rgba(255, 255, 255, 0.12));
    box-shadow:
        0 26px 72px rgba(0, 0, 0, 0.40),
        0 0 42px color-mix(in srgb, var(--module-accent) 12%, transparent),
        0 0 0 1px color-mix(in srgb, var(--module-accent) 22%, transparent);
}

.workspace-module-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 14px;
}

.workspace-module-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: color-mix(in srgb, var(--module-accent) 82%, white);
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.02)),
        color-mix(in srgb, var(--module-accent) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--module-accent) 38%, rgba(255,255,255,0.08));
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.10),
        0 0 20px color-mix(in srgb, var(--module-accent) 22%, transparent);
    flex-shrink: 0;
}

.workspace-module-title {
    margin: 0;
    font-family: var(--pf-font-accent);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: .01em;
    text-transform: uppercase;
    color: rgba(249, 250, 251, .94);
    text-shadow: 0 2px 12px rgba(0,0,0,.28);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-module-body {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: end;
    gap: 14px;
    min-width: 0;
}

.workspace-module-value {
    font-family: var(--pf-font-accent);
    font-size: clamp(2rem, 3vw, 2.6rem);
    font-weight: 800;
    color: #fff;
    line-height: .92;
    letter-spacing: 0;
    text-shadow: 0 8px 24px rgba(0,0,0,.32);
}

.workspace-module-copy {
    min-width: 0;
    padding-bottom: 6px;
}

.workspace-module-copy strong {
    display: block;
    color: color-mix(in srgb, var(--module-accent) 48%, var(--pf-text-muted));
    font-family: var(--pf-font-ui);
    font-size: .88rem;
    font-weight: 500;
    letter-spacing: .02em;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Prompts: Amber-Gold ── */
.workspace-module--prompts {
    --module-accent: #F59E0B;
    --module-accent-soft: rgba(245, 158, 11, 0.13);
}

/* ── Kontexte: Steel-Blue ── */
.workspace-module--contexts {
    --module-accent: #60A5FA;
    --module-accent-soft: rgba(96, 165, 250, 0.12);
}

/* ── Projekte: Cyan ── */
.workspace-module--projects {
    --module-accent: #22D3EE;
    --module-accent-soft: rgba(34, 211, 238, 0.10);
}

/* ── CodeBase: Tech-Cyan ── */
.workspace-module--codebase {
    --module-accent: #06B6D4;
    --module-accent-soft: rgba(6, 182, 212, 0.13);
}

.workspace-module--codebase::before {
    background:
        radial-gradient(ellipse 92% 72% at 14% 26%, rgba(6, 182, 212, 0.20), transparent),
        radial-gradient(ellipse 64% 44% at 60% 0%, rgba(14, 116, 144, 0.14), transparent),
        radial-gradient(ellipse 44% 36% at 18% 92%, rgba(6, 182, 212, 0.17), transparent);
    opacity: 0.95;
}

/* ── Skills: Violett ── */
.workspace-module--skills {
    --module-accent: #A78BFA;
    --module-accent-soft: rgba(167, 139, 250, 0.12);
}

/* ── KI Studio: AI-Türkis ── */
.workspace-module--ki-studio {
    --module-accent: #2DD4BF;
    --module-accent-soft: rgba(45, 212, 191, 0.12);
}

@media (max-width: 1024px) {
    .workspace-module-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .workspace-module-row {
        grid-template-columns: 1fr;
    }

    .workspace-module {
        min-height: 112px;
        padding: 16px 18px;
    }
}

/* =========================================================
   Prompt Card
   ========================================================= */

.prompt-card {
    background: var(--pf-surface);
    border-radius: var(--pf-radius-lg);
    border: 1px solid var(--pf-border);
    box-shadow: var(--pf-shadow-sm);
    padding: 18px 22px;
    margin-bottom: 12px;
    transition: box-shadow var(--pf-transition), transform var(--pf-transition);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.prompt-card:hover {
    box-shadow: var(--pf-shadow-md);
    transform: translateY(-2px);
    border-color: var(--pf-border-strong);
}

.prompt-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.prompt-card-title {
    font-family: var(--pf-font-ui);
    font-size: 1.0rem;
    font-weight: 700;
    color: var(--pf-text);
    text-decoration: none;
    line-height: 1.35;
    letter-spacing: 0;
    transition: color var(--pf-transition);
}

.prompt-card-title:hover {
    color: var(--pf-primary);
    text-decoration: none;
}

.prompt-card-description {
    font-size: .825rem;
    color: var(--pf-text-muted);
    line-height: 1.55;
    margin: 0;
    opacity: 0.85;
}

.prompt-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 0;
}

.prompt-card-meta .badge {
    opacity: .85;
}

.prompt-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 2px;
    flex-wrap: wrap;
}

.prompt-card-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--pf-font-mono);
    font-size: 0.68rem;
    color: var(--pf-text-muted);
    opacity: 0.55;
    transition: opacity var(--pf-transition);
    flex-shrink: 0;
    user-select: none;
}

.prompt-card:hover .prompt-card-time {
    opacity: 0.85;
}

.prompt-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* =========================================================
   Skill Card
   ========================================================= */

.skill-card {
    background: var(--pf-surface);
    border-radius: var(--pf-radius-lg);
    border: 1px solid var(--pf-border);
    box-shadow: var(--pf-shadow-sm);
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: box-shadow var(--pf-transition), transform var(--pf-transition);
}

.skill-card:hover {
    box-shadow: var(--pf-shadow-md);
    transform: translateY(-2px);
    border-color: var(--pf-border-strong);
}

.skill-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.skill-card-title {
    font-family: var(--pf-font-ui);
    font-size: 1rem;
    font-weight: 600;
    color: var(--pf-text);
    text-decoration: none;
    letter-spacing: 0;
}

.skill-card-title:hover {
    color: var(--pf-primary);
    text-decoration: none;
}

.skill-card-description {
    font-size: .875rem;
    color: var(--pf-text-muted);
    margin: 0;
}

.skill-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.skill-card-images {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

/* =========================================================
   Skill Grid
   ========================================================= */

.skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

/* =========================================================
   Buttons
   ========================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: var(--pf-radius-sm);
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background var(--pf-transition), box-shadow var(--pf-transition), transform var(--pf-transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--pf-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
    background: var(--pf-primary-hover);
    box-shadow: 0 6px 20px var(--pf-primary-glow);
}

.btn-secondary {
    background: var(--pf-surface-soft);
    color: var(--pf-text-soft);
    border: 1px solid var(--pf-border-strong);
}

.btn-secondary:hover {
    background: var(--pf-surface-soft);
    border-color: var(--pf-primary);
    color: var(--pf-text);
}

.btn-danger {
    background: var(--pf-danger);
    color: #fff;
}

.btn-danger:hover {
    background: var(--pf-danger-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--pf-text-muted);
    border: 1px solid var(--pf-border);
}

.btn-ghost:hover {
    background: var(--pf-surface-muted);
    color: var(--pf-text);
}

.btn-sm {
    padding: 5px 11px;
    font-size: .8rem;
}

.btn-xs {
    padding: 3px 8px;
    font-size: .75rem;
    font-weight: 400;
    opacity: .65;
}

.btn-xs:hover {
    opacity: 1;
}

.btn-icon-only {
    padding: 5px 8px;
    font-size: .9rem;
    line-height: 1;
}

.btn-link {
    background: none;
    border: none;
    color: var(--pf-primary);
    padding: 0;
    font-size: inherit;
    cursor: pointer;
    font-weight: 500;
}

.btn-link:hover {
    text-decoration: underline;
}

.btn-copy {
    background: var(--pf-primary);
    color: #fff;
    font-weight: 600;
    letter-spacing: .01em;
}

.btn-copy:hover {
    background: var(--pf-primary-hover);
    box-shadow: 0 4px 12px var(--pf-primary-glow);
    color: #fff;
    text-decoration: none;
}

.btn-copy-success {
    background: var(--pf-success);
    color: #fff !important;
    border-color: transparent;
}

.btn-copy-success:hover {
    background: #059669;
    color: #fff;
    text-decoration: none;
}

/* =========================================================
   Badges
   ========================================================= */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .02em;
}

.badge-category {
    background: var(--pf-badge-indigo-bg);
    color: var(--pf-badge-indigo-text);
}

.badge-tag {
    background: rgba(255, 255, 255, 0.05);
    color: var(--pf-text-muted);
    border: 1px solid var(--pf-border);
    font-family: var(--pf-font-mono);
    font-size: 0.67rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 2px 8px;
}

.badge-target {
    background: rgba(34, 197, 94, 0.07);
    color: #6EE7B7;
    border: 1px solid rgba(34, 197, 94, 0.18);
    font-family: var(--pf-font-mono);
    font-size: 0.67rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    padding: 2px 8px;
}

.badge-level {
    font-size: .72rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
}

.badge-level--einsteiger    { background: rgba(255, 255, 255, 0.06); color: var(--pf-text-soft); border: 1px solid var(--pf-border); }
.badge-level--grundlagen    { background: rgba(59, 130, 246, 0.12); color: #93C5FD; }
.badge-level--fortgeschritten { background: rgba(245, 158, 11, 0.12); color: #FCD34D; }
.badge-level--experte       { background: var(--pf-badge-green-bg); color: var(--pf-badge-green-text); }

/* =========================================================
   Forms
   ========================================================= */

.form-card {
    background: var(--pf-surface);
    border-radius: var(--pf-radius-lg);
    border: 1px solid var(--pf-border);
    box-shadow: var(--pf-shadow-sm);
    padding: 28px 32px;
    max-width: 680px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 18px;
}

.form-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--pf-text);
    letter-spacing: .01em;
}

.form-label-required::after {
    content: ' *';
    color: var(--pf-danger);
}

.form-control {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid var(--pf-border);
    border-radius: var(--pf-radius-sm);
    font-size: .875rem;
    color: var(--pf-text);
    background: var(--pf-surface);
    transition: border-color var(--pf-transition), box-shadow var(--pf-transition);
    outline: none;
    font-family: inherit;
}

.form-control:focus {
    border-color: var(--pf-primary);
    box-shadow: 0 0 0 3px var(--pf-focus-ring);
}

.form-control--narrow {
    max-width: 240px;
}

textarea.form-control {
    resize: vertical;
    min-height: 140px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a1a1aa' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-hint {
    font-size: .78rem;
    color: var(--pf-text-subtle);
}

.form-error {
    font-size: .8rem;
    color: var(--pf-danger);
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding-top: 20px;
    border-top: 1px solid var(--pf-border);
}

.form-check-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.form-check-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--pf-border);
    border-radius: var(--pf-radius-xs);
    cursor: pointer;
    transition: background var(--pf-transition), border-color var(--pf-transition);
    font-size: .875rem;
}

.form-check-item:hover {
    background: var(--pf-surface-muted);
    border-color: var(--pf-primary);
}

.form-check-item input[type="checkbox"] {
    accent-color: var(--pf-primary);
    width: 15px;
    height: 15px;
}

.form-check-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .875rem;
    cursor: pointer;
}

.form-check-inline input[type="checkbox"] {
    accent-color: var(--pf-primary);
    width: 16px;
    height: 16px;
}

/* =========================================================
   Filter Bar
   ========================================================= */

.filter-bar {
    background: var(--pf-surface);
    border-radius: var(--pf-radius-lg);
    border: 1px solid var(--pf-border);
    box-shadow: var(--pf-shadow-sm);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-search {
    min-width: 200px;
    flex: 1;
    max-width: 320px;
}

.filter-select {
    max-width: 200px;
}

.filter-sort {
    max-width: 150px;
}

.filter-count {
    margin-left: auto;
    font-size: .8rem;
    white-space: nowrap;
}

/* =========================================================
   Data Table
   ========================================================= */

.data-table-card {
    background: var(--pf-surface);
    border-radius: var(--pf-radius-lg);
    border: 1px solid var(--pf-border);
    box-shadow: var(--pf-shadow-sm);
    overflow: hidden;
    margin-bottom: 24px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--pf-surface-subtle);
    border-bottom: 1px solid var(--pf-border);
}

.data-table th {
    padding: 11px 18px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--pf-text-muted);
    text-align: left;
}

.data-table td {
    padding: 13px 18px;
    font-size: .875rem;
    color: var(--pf-text);
    border-bottom: 1px solid var(--pf-surface-muted);
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: var(--pf-surface-subtle);
}

.data-table .td-actions {
    text-align: right;
    white-space: nowrap;
}

.data-table .td-count {
    color: var(--pf-text-muted);
    font-weight: 500;
}

.data-table .table-edit-input {
    width: 200px;
    padding: 6px 10px;
    border: 1px solid var(--pf-primary);
    border-radius: var(--pf-radius-xs);
    font-size: .875rem;
    outline: none;
    box-shadow: 0 0 0 3px var(--pf-focus-ring);
    font-family: inherit;
}

/* =========================================================
   Add Form (below table)
   ========================================================= */

.add-form-card {
    background: var(--pf-surface);
    border-radius: var(--pf-radius-lg);
    border: 1px solid var(--pf-border);
    box-shadow: var(--pf-shadow-sm);
    padding: 22px 24px;
}

.add-form-card h3 {
    margin-bottom: 14px;
    color: var(--pf-text);
}

.add-form-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.add-form-row .form-control {
    max-width: 300px;
}

/* =========================================================
   Detail View
   ========================================================= */

.detail-meta-card {
    background: var(--pf-surface);
    border-radius: var(--pf-radius-lg);
    border: 1px solid var(--pf-border);
    box-shadow: var(--pf-shadow-sm);
    padding: 22px 24px;
    margin-bottom: 20px;
}

.detail-meta-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 24px;
    align-items: center;
}

.detail-meta-key {
    font-size: .78rem;
    font-weight: 700;
    color: var(--pf-text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
}

.detail-meta-value {
    font-size: .875rem;
    color: var(--pf-text);
}

.detail-content-card {
    background: var(--pf-surface);
    border-radius: var(--pf-radius-lg);
    border: 1px solid var(--pf-border);
    box-shadow: var(--pf-shadow-sm);
    padding: 22px 24px;
}

.detail-content-card h3 {
    margin-bottom: 14px;
    font-size: .85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--pf-text-muted);
}

.prompt-content-block {
    background: var(--pf-surface-subtle);
    border: 1px solid var(--pf-border);
    border-radius: var(--pf-radius-sm);
    padding: 18px 20px;
    font-family: var(--pf-font-mono);
    font-size: .825rem;
    line-height: 1.65;
    color: var(--pf-text);
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}

/* =========================================================
   Empty State
   ========================================================= */

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--pf-text-muted);
}

.empty-state-icon {
    margin-bottom: 12px;
    opacity: .5;
    display: flex;
    justify-content: center;
}

.empty-state p {
    margin-bottom: 16px;
}

/* =========================================================
   Loading
   ========================================================= */

.loading-text {
    color: var(--pf-text-subtle);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 32px 0;
    font-size: .9rem;
}

/* =========================================================
   Confirm Delete Inline
   ========================================================= */

.confirm-delete-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    color: var(--pf-text-muted);
}

/* =========================================================
   Images
   ========================================================= */

.form-control-file {
    display: block;
    width: 100%;
    padding: 8px 0;
    font-size: .875rem;
    color: var(--pf-text);
    cursor: pointer;
}

.image-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.image-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: var(--pf-radius-sm);
    overflow: hidden;
    border: 1px solid var(--pf-border);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,.55);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: .75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background var(--pf-transition);
}

.image-remove-btn:hover {
    background: var(--pf-danger);
}

.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.image-gallery-item {
    display: block;
    border-radius: var(--pf-radius-sm);
    overflow: hidden;
    border: 1px solid var(--pf-border);
    transition: box-shadow var(--pf-transition);
}

.image-gallery-item:hover {
    box-shadow: var(--pf-shadow-hover);
}

.image-gallery-item img {
    display: block;
    max-width: 240px;
    max-height: 180px;
    object-fit: cover;
}

.card-thumbnail {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--pf-radius-xs);
    border: 1px solid var(--pf-border);
}

/* =========================================================
   Backup & Restore
   ========================================================= */

.backup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 24px;
    align-items: start;
}

.backup-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.backup-section h2 {
    margin: 0;
}

.backup-section-icon {
    font-size: 2rem;
    margin-bottom: 4px;
}

.backup-includes {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: .875rem;
    color: var(--pf-text-muted);
}

.selected-file-info {
    margin-top: 10px;
    font-size: .875rem;
    color: var(--pf-text);
    background: var(--pf-surface-subtle);
    border: 1px solid var(--pf-border);
    border-radius: var(--pf-radius-xs);
    padding: 8px 12px;
}

.import-confirm-box {
    margin-top: 16px;
    background: rgba(245, 158, 11, 0.10);
    border: 1px solid rgba(245, 158, 11, 0.30);
    border-radius: var(--pf-radius-sm);
    padding: 16px 18px;
    font-size: .875rem;
}

.import-result {
    border-radius: var(--pf-radius-sm);
    padding: 14px 16px;
    margin-bottom: 4px;
    font-size: .875rem;
}

.import-result--success {
    background: var(--pf-badge-green-bg);
    border: 1px solid rgba(34, 197, 94, 0.30);
}

.import-result--error {
    background: rgba(239, 68, 68, 0.10);
    border: 1px solid rgba(239, 68, 68, 0.30);
}

.import-result-title {
    font-family: var(--pf-font-accent);
    font-weight: 700;
    font-size: .95rem;
    margin-bottom: 8px;
    letter-spacing: 0;
}

.import-stats {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    color: var(--pf-text-muted);
}

/* =========================================================
   AI Workspace (Dashboard)
   ========================================================= */

.ai-workspace {
    position: relative;
    overflow: hidden;
    padding: 22px 24px 24px;
    background:
        radial-gradient(circle at 76% 0%, rgba(56, 189, 248, 0.08), transparent 34%),
        radial-gradient(circle at 8% 88%, rgba(99, 102, 241, 0.07), transparent 38%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.032), transparent 38%),
        linear-gradient(180deg, rgba(13, 18, 34, 0.99), rgba(7, 11, 22, 0.99));
    border: 1px solid rgba(99, 102, 241, 0.10);
    border-radius: var(--pf-radius-lg);
    box-shadow:
        0 0 0 1px rgba(99, 102, 241, 0.05),
        0 32px 96px rgba(0, 0, 0, 0.52),
        0 0 80px rgba(99, 102, 241, 0.05) inset,
        inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.ai-workspace::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(90deg, transparent 0 48px, rgba(99, 102, 241, 0.018) 48px 49px),
        repeating-linear-gradient(0deg, transparent 0 48px, rgba(99, 102, 241, 0.012) 48px 49px);
    opacity: 0.6;
    pointer-events: none;
}

.ai-workspace > * {
    position: relative;
    z-index: 1;
}

/* Console header */
.ai-workspace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.ai-console-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.ai-workspace-header h2 {
    margin: 0;
    font-family: var(--pf-font-accent);
    font-size: 1.0rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
    color: var(--pf-text);
}

.ai-console-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ai-console-dot--live {
    background: rgba(34, 197, 94, 0.85);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.50);
    animation: consoleDotLive 2.8s ease-in-out infinite;
}

.ai-console-dot--offline {
    background: rgba(239, 68, 68, 0.70);
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.35);
}

.ai-console-dot--loading {
    background: rgba(99, 102, 241, 0.70);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.40);
    animation: consoleDotLive 0.9s ease-in-out infinite;
}

@keyframes consoleDotLive {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(34, 197, 94, 0.50); }
    50% { opacity: 0.45; box-shadow: 0 0 4px rgba(34, 197, 94, 0.20); }
}

.ai-console-status-hint {
    font-family: var(--pf-font-mono);
    font-size: .65rem;
    color: rgba(239, 68, 68, 0.65);
    letter-spacing: 0.03em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 280px;
}

.ai-console-refresh-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    background: transparent;
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: 8px;
    color: rgba(148, 163, 184, 0.35);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.ai-console-refresh-btn:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.22);
    color: rgba(148, 163, 184, 0.80);
}

.ai-console-refresh-btn:disabled {
    opacity: 0.30;
    cursor: default;
}

.ai-console-refresh-btn svg {
    width: 13px;
    height: 13px;
}

@keyframes aiSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.ai-spin {
    animation: aiSpin 0.8s linear infinite;
}

/* Chat area — full width, no sidebar */
.ai-workspace-chat {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(99, 102, 241, 0.04), transparent 40%),
        rgba(8, 12, 24, 0.72);
    border: 1px solid rgba(99, 102, 241, 0.08);
    border-radius: var(--pf-radius-md);
    box-shadow:
        0 2px 32px rgba(0, 0, 0, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.025),
        inset 0 0 0 1px rgba(99, 102, 241, 0.04);
    min-width: 0;
}

.ai-chat-stream {
    min-height: 380px;
    max-height: 560px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px 28px 16px;
    scroll-behavior: smooth;
}

.ai-chat-stream::-webkit-scrollbar {
    width: 3px;
}

.ai-chat-stream::-webkit-scrollbar-track {
    background: transparent;
}

.ai-chat-stream::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.25);
    border-radius: 2px;
}

/* Empty state */
.ai-chat-empty {
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.ai-chat-empty-glow {
    position: absolute;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.07) 0%, rgba(56, 189, 248, 0.04) 40%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: emptyGlowPulse 4s ease-in-out infinite;
}

@keyframes emptyGlowPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.08); }
}

.ai-chat-empty-status {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 4px;
    position: relative;
}

.ai-chat-empty-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.85);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.50);
    flex-shrink: 0;
    animation: emptyDotPulse 2.8s ease-in-out infinite;
}

.ai-chat-empty-dot--offline {
    background: rgba(239, 68, 68, 0.70);
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.35);
    animation: none;
}

@keyframes emptyDotPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.ai-chat-empty-model-name {
    font-family: var(--pf-font-mono);
    font-size: .72rem;
    color: rgba(56, 189, 248, 0.72);
    letter-spacing: 0.04em;
    position: relative;
}

.ai-chat-empty-title {
    margin: 0;
    color: var(--pf-text-soft);
    font-weight: 600;
    font-size: .92rem;
    position: relative;
}

.ai-chat-empty small {
    margin-top: 2px;
    font-family: var(--pf-font-mono);
    font-size: .66rem;
    position: relative;
    color: rgba(99, 102, 241, 0.38);
    letter-spacing: 0.05em;
}

.ai-chat-message {
    max-width: 80%;
    padding: 14px 18px;
    border-radius: 16px;
    border: 1px solid transparent;
    color: var(--pf-text-soft);
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.ai-chat-message-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ai-chat-message span {
    display: block;
    font-family: var(--pf-font-mono);
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.45;
}

.ai-chat-message-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 7px;
    border: 1px solid rgba(56, 189, 248, 0.10);
    background: rgba(2, 6, 18, 0.24);
    color: rgba(125, 211, 252, 0.46);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.16s, background 0.16s, border-color 0.16s, color 0.16s;
}

.ai-chat-message-copy svg {
    width: 12px;
    height: 12px;
}

.ai-chat-message--assistant:hover .ai-chat-message-copy,
.ai-chat-message-copy:focus-visible {
    opacity: 1;
}

.ai-chat-message-copy:hover {
    background: rgba(56, 189, 248, 0.09);
    border-color: rgba(56, 189, 248, 0.22);
    color: rgba(125, 211, 252, 0.82);
}

.ai-chat-message p {
    margin: 0;
    white-space: pre-wrap;
    line-height: 1.72;
    font-size: .925rem;
}

.ai-chat-message--user {
    align-self: flex-end;
    background: rgba(79, 70, 229, 0.14);
    border-color: rgba(129, 140, 248, 0.18);
    box-shadow:
        0 0 0 1px rgba(129, 140, 248, 0.06) inset,
        0 4px 24px rgba(79, 70, 229, 0.14);
}

.ai-chat-message--user span {
    color: rgba(165, 180, 252, 0.60);
}

.ai-chat-message--assistant {
    align-self: flex-start;
    max-width: 88%;
    background: rgba(4, 18, 36, 0.60);
    border-color: rgba(56, 189, 248, 0.10);
    box-shadow:
        0 0 0 1px rgba(56, 189, 248, 0.035) inset,
        0 6px 28px rgba(0, 0, 0, 0.30),
        0 0 40px rgba(56, 189, 248, 0.03);
}

.ai-chat-message--assistant span {
    color: rgba(125, 211, 252, 0.52);
}

.ai-chat-message--assistant p {
    font-size: .96rem;
    line-height: 1.76;
}

.ai-chat-message--error {
    align-self: stretch;
    max-width: none;
    background: rgba(127, 29, 29, 0.15);
    border-color: rgba(248, 113, 113, 0.18);
}

.ai-chat-message--typing {
    padding-bottom: 14px;
}

.ai-typing {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding-top: 2px;
}

.ai-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(125, 211, 252, 0.85);
    animation: aiTypingPulse 1.2s infinite ease-in-out;
}

.ai-typing-dot:nth-child(2) {
    animation-delay: 0.15s;
}

.ai-typing-dot:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes aiTypingPulse {
    0%, 80%, 100% {
        opacity: 0.35;
        transform: translateY(0);
    }
    40% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

/* Composer */
.ai-workspace-composer {
    display: flex;
    flex-direction: column;
    padding: 0 20px 18px;
    border-top: 1px solid rgba(99, 102, 241, 0.06);
}

.ai-composer-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    padding: 10px 0 9px;
}

.ai-composer-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px 5px 9px;
    border-radius: 11px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008)),
        rgba(20, 28, 48, 0.82);
    border: 1px solid rgba(125, 137, 190, 0.22);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.035) inset,
        0 0 0 1px rgba(15, 23, 42, 0.34),
        0 8px 20px rgba(0, 0, 0, 0.12);
    transition: background 0.16s, border-color 0.16s, box-shadow 0.16s, transform 0.16s;
}

.ai-composer-chip:not(.ai-composer-chip--model):not(.ai-composer-chip--profile):hover {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.014)),
        rgba(25, 35, 60, 0.92);
    border-color: rgba(129, 140, 248, 0.34);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.055) inset,
        0 0 0 1px rgba(99, 102, 241, 0.12),
        0 0 18px rgba(99, 102, 241, 0.10),
        0 10px 24px rgba(0, 0, 0, 0.16);
}

.ai-composer-chip svg {
    width: 12px;
    height: 12px;
    color: rgba(129, 140, 248, 0.78);
    flex-shrink: 0;
    filter: drop-shadow(0 0 5px rgba(99, 102, 241, 0.18));
}

.ai-composer-chip--profile {
    background: rgba(52, 211, 153, 0.05);
    border-color: rgba(52, 211, 153, 0.12);
}

.ai-composer-chip--profile:hover {
    background: rgba(52, 211, 153, 0.09);
    border-color: rgba(52, 211, 153, 0.20);
}

.ai-composer-chip--profile svg {
    color: rgba(52, 211, 153, 0.45);
}

.ai-composer-chip--model {
    background:
        linear-gradient(180deg, rgba(56, 189, 248, 0.12), rgba(56, 189, 248, 0.025)),
        rgba(17, 35, 54, 0.90);
    border-color: rgba(56, 189, 248, 0.34);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.06) inset,
        0 0 0 1px rgba(14, 116, 144, 0.16),
        0 0 22px rgba(56, 189, 248, 0.10),
        0 8px 22px rgba(0, 0, 0, 0.14);
}

.ai-composer-chip--model:hover {
    background:
        linear-gradient(180deg, rgba(56, 189, 248, 0.16), rgba(56, 189, 248, 0.04)),
        rgba(19, 42, 64, 0.96);
    border-color: rgba(56, 189, 248, 0.46);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.07) inset,
        0 0 0 1px rgba(14, 116, 144, 0.22),
        0 0 26px rgba(56, 189, 248, 0.15),
        0 10px 26px rgba(0, 0, 0, 0.18);
}

.ai-composer-chip--model svg {
    color: rgba(56, 189, 248, 0.88);
    filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.26));
}

.ai-chip-select {
    font-family: var(--pf-font-mono);
    font-size: .69rem;
    font-weight: 600;
    color: rgba(203, 213, 225, 0.88);
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 0;
    letter-spacing: 0;
    max-width: 150px;
    -webkit-appearance: none;
    appearance: none;
    text-shadow: 0 0 12px rgba(148, 163, 184, 0.10);
}

.ai-chip-select--model {
    color: rgba(125, 211, 252, 0.94);
    max-width: 180px;
    text-shadow: 0 0 14px rgba(56, 189, 248, 0.22);
}

.ai-chip-select option {
    background: #0a0e1e;
    color: var(--pf-text-soft);
    font-size: .8rem;
}

.ai-chip-select:disabled {
    opacity: 0.58;
    cursor: default;
}

/* Chatbar */
.ai-chatbar {
    background: rgba(2, 4, 14, 0.78);
    border: 1px solid rgba(99, 102, 241, 0.11);
    border-radius: 16px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ai-chatbar:focus-within {
    border-color: rgba(99, 102, 241, 0.32);
    box-shadow:
        0 0 0 3px rgba(99, 102, 241, 0.06),
        0 0 32px rgba(99, 102, 241, 0.08) inset,
        0 8px 32px rgba(0, 0, 0, 0.24);
}

.ai-chatbar-input {
    display: block;
    width: 100%;
    min-height: 44px;
    max-height: 260px;
    height: auto;
    padding: 12px 20px 8px;
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    font-family: var(--pf-font-ui);
    font-size: .975rem;
    color: var(--pf-text-soft);
    line-height: 1.55;
    overflow-y: auto;
    box-sizing: border-box;
    caret-color: rgba(99, 102, 241, 0.95);
    letter-spacing: 0.01em;
}

.ai-chatbar-input::placeholder {
    color: rgba(148, 163, 184, 0.25);
    font-style: italic;
}

.ai-chatbar-input:disabled {
    opacity: 0.40;
}

.ai-chatbar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 10px 10px;
    gap: 8px;
}

.ai-chatbar-meta {
    min-width: 0;
    min-height: 24px;
}

.ai-chatbar-feedback {
    font-family: var(--pf-font-mono);
    font-size: .65rem;
    color: rgba(56, 189, 248, 0.60);
    letter-spacing: 0.06em;
}

.ai-chatbar-hint {
    font-family: var(--pf-font-mono);
    font-size: .60rem;
    color: rgba(99, 102, 241, 0.28);
    letter-spacing: 0.04em;
    user-select: none;
}

.ai-chatbar-btns {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ai-chatbar-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: rgba(148, 163, 184, 0.35);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.ai-chatbar-icon-btn:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.15);
    color: rgba(148, 163, 184, 0.75);
}

.ai-chatbar-icon-btn:disabled {
    opacity: 0.20;
    cursor: default;
}

.ai-chatbar-icon-btn svg {
    width: 14px;
    height: 14px;
}

.ai-chatbar-send {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    background: rgba(99, 102, 241, 0.72);
    border: 1px solid rgba(129, 140, 248, 0.28);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.90);
    cursor: pointer;
    transition: background 0.18s, box-shadow 0.18s, transform 0.12s;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.26);
}

.ai-chatbar-send:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.90);
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.40);
    transform: translateY(-1px);
}

.ai-chatbar-send:active:not(:disabled) {
    transform: translateY(0);
}

.ai-chatbar-send:disabled {
    opacity: 0.28;
    cursor: default;
    box-shadow: none;
}

.ai-chatbar-send svg {
    width: 15px;
    height: 15px;
}

.ai-chatbar-send-pulse {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.80);
    animation: sendPulse 0.9s ease-in-out infinite;
}

@keyframes sendPulse {
    0%, 100% { opacity: 0.35; transform: scale(0.80); }
    50% { opacity: 1; transform: scale(1.15); }
}

@media (max-width: 640px) {
    .ai-workspace {
        padding: 14px 14px 18px;
    }

    .ai-workspace-header {
        margin-bottom: 12px;
    }

    .ai-workspace-composer {
        padding: 0 14px 16px;
    }

    .ai-chat-stream {
        min-height: 280px;
        max-height: 420px;
        padding: 16px 16px 12px;
    }

    .ai-chat-message {
        max-width: 100%;
    }

    .ai-chat-message--assistant {
        max-width: 100%;
    }

    .ai-composer-chips {
        gap: 5px;
    }

    .ai-chip-select {
        max-width: 100px;
    }

    .ai-chip-select--model {
        max-width: 130px;
    }
}

/* =========================================================
   AI System
   ========================================================= */

.ai-system-page-header {
    align-items: flex-end;
}

.ai-system-eyebrow,
.ai-system-kicker,
.ai-system-panel-label {
    display: inline-flex;
    font-family: var(--pf-font-mono);
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(125, 211, 252, .68);
}

.ai-system-refresh-btn {
    width: 36px;
    height: 36px;
    border-color: rgba(99, 102, 241, .18);
    color: rgba(209, 213, 219, .70);
}

.ai-system-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr);
    gap: 18px;
    margin-bottom: 18px;
    padding: 24px;
    background:
        radial-gradient(circle at 84% 8%, rgba(56, 189, 248, .11), transparent 34%),
        linear-gradient(135deg, rgba(99, 102, 241, .09), transparent 40%),
        linear-gradient(180deg, rgba(13, 18, 34, .99), rgba(7, 11, 22, .99));
    border: 1px solid rgba(99, 102, 241, .14);
    border-radius: var(--pf-radius-lg);
    box-shadow: 0 28px 82px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .035);
}

.ai-system-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(90deg, transparent 0 52px, rgba(99, 102, 241, .018) 52px 53px),
        repeating-linear-gradient(0deg, transparent 0 52px, rgba(56, 189, 248, .012) 52px 53px);
    pointer-events: none;
}

.ai-system-hero > * {
    position: relative;
    z-index: 1;
}

.ai-system-hero-main {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.ai-system-hero-main .ai-console-dot {
    width: 10px;
    height: 10px;
}

.ai-system-hero h2 {
    margin: 4px 0 2px;
    font-size: clamp(1.25rem, 2.4vw, 2rem);
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.ai-system-hero p {
    margin: 0;
    color: var(--pf-text-muted);
}

.ai-system-hero-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.ai-system-metric {
    min-width: 0;
    padding: 12px 14px;
    background: rgba(2, 6, 18, .46);
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: var(--pf-radius-sm);
}

.ai-system-metric span,
.ai-system-connection-line span,
.ai-system-parameter-grid span {
    display: block;
    margin-bottom: 4px;
    font-family: var(--pf-font-mono);
    font-size: .62rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, .58);
}

.ai-system-metric strong,
.ai-system-connection-line strong,
.ai-system-parameter-grid strong {
    display: block;
    font-size: .88rem;
    color: var(--pf-text-soft);
    overflow-wrap: anywhere;
}

.ai-system-notice {
    margin-bottom: 18px;
    padding: 10px 14px;
    border-radius: var(--pf-radius-sm);
    font-family: var(--pf-font-mono);
    font-size: .72rem;
}

.ai-system-notice--ok {
    color: rgba(110, 231, 183, .82);
    background: rgba(34, 197, 94, .055);
    border: 1px solid rgba(34, 197, 94, .14);
}

.ai-system-notice--warn {
    color: rgba(252, 165, 165, .84);
    background: rgba(239, 68, 68, .065);
    border: 1px solid rgba(239, 68, 68, .15);
}

.ai-system-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.ai-system-panel {
    min-width: 0;
    padding: 18px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .035), transparent 42%),
        rgba(13, 18, 34, .95);
    border: 1px solid rgba(148, 163, 184, .13);
    border-radius: var(--pf-radius-lg);
    box-shadow: 0 18px 54px rgba(0, 0, 0, .30), inset 0 1px 0 rgba(255, 255, 255, .025);
}

.ai-system-panel--wide {
    grid-column: span 2;
}

.ai-system-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.ai-system-panel-head h3 {
    margin: 3px 0 0;
    font-size: .98rem;
}

.ai-system-control-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.ai-system-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.ai-system-field > span {
    font-size: .75rem;
    font-weight: 700;
    color: var(--pf-text-soft);
}

.ai-system-profile-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.ai-system-profile-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
    padding: 13px 14px;
    text-align: left;
    background: rgba(2, 6, 18, .38);
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: var(--pf-radius-sm);
    color: var(--pf-text-soft);
    cursor: pointer;
    transition: border-color .16s, background .16s, transform .16s;
}

.ai-system-profile-card:hover,
.ai-system-profile-card--active {
    background: rgba(99, 102, 241, .08);
    border-color: rgba(99, 102, 241, .28);
}

.ai-system-profile-card:hover {
    transform: translateY(-1px);
}

.ai-system-profile-card span,
.ai-system-prompt-card span {
    font-family: var(--pf-font-mono);
    font-size: .62rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(125, 211, 252, .62);
}

.ai-system-profile-card strong {
    overflow-wrap: anywhere;
}

.ai-system-profile-card small {
    color: rgba(148, 163, 184, .70);
}

.ai-system-status-pill {
    padding: 3px 9px;
    border-radius: 999px;
    font-family: var(--pf-font-mono);
    font-size: .64rem;
    text-transform: uppercase;
}

.ai-system-status-pill--online {
    color: #6EE7B7;
    background: rgba(34, 197, 94, .07);
    border: 1px solid rgba(34, 197, 94, .18);
}

.ai-system-status-pill--offline {
    color: rgba(252, 165, 165, .88);
    background: rgba(239, 68, 68, .08);
    border: 1px solid rgba(239, 68, 68, .18);
}

.ai-system-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.ai-system-connection-line {
    min-width: 0;
    padding: 11px 12px;
    background: rgba(2, 6, 18, .34);
    border: 1px solid rgba(148, 163, 184, .10);
    border-radius: var(--pf-radius-sm);
}

.ai-system-key-box {
    display: grid;
    gap: 10px;
    margin: 14px 0;
    padding: 12px;
    background: rgba(56, 189, 248, .045);
    border: 1px solid rgba(56, 189, 248, .11);
    border-radius: var(--pf-radius-sm);
}

.ai-system-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* ── Mode-Toggle Segmented Control ── */
.ai-system-mode-toggle {
    display: inline-flex;
    gap: 0;
    background: rgba(2, 6, 18, 0.45);
    border: 1px solid var(--pf-border-strong);
    border-radius: var(--pf-radius-sm);
    padding: 3px;
    margin-bottom: 1.1rem;
}

.ai-system-mode-btn {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--pf-text-muted);
    font-size: 0.825rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    line-height: 1.4;
}

.ai-system-mode-btn:hover {
    color: var(--pf-text-soft);
    background: rgba(255, 255, 255, 0.05);
}

.ai-system-mode-btn--active {
    background: var(--pf-surface-muted);
    color: var(--pf-text);
    border: 1px solid var(--pf-border-strong);
}

.ai-system-mode-btn--active:hover {
    background: var(--pf-surface-muted);
    color: var(--pf-text);
}

.ai-system-parameter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.ai-system-parameter-grid > div {
    min-width: 0;
    padding: 11px 12px;
    background: rgba(2, 6, 18, .34);
    border: 1px solid rgba(148, 163, 184, .10);
    border-radius: var(--pf-radius-sm);
}

.ai-system-prompt-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.ai-system-prompt-card {
    min-width: 0;
    min-height: 138px;
    padding: 14px;
    background: rgba(2, 6, 18, .38);
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: var(--pf-radius-sm);
}

.ai-system-prompt-card--stored {
    background: rgba(99, 102, 241, .055);
    border-color: rgba(99, 102, 241, .14);
}

.ai-system-prompt-card h4 {
    margin: 8px 0 7px;
    font-size: .86rem;
    overflow-wrap: anywhere;
}

.ai-system-prompt-card p {
    margin: 0;
    color: rgba(209, 213, 219, .70);
    font-size: .8rem;
    line-height: 1.55;
}

.ai-system-status-list,
.ai-system-model-list {
    display: grid;
    gap: 8px;
}

.ai-system-status-row,
.ai-system-model-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 10px 11px;
    background: rgba(2, 6, 18, .34);
    border: 1px solid rgba(148, 163, 184, .10);
    border-radius: var(--pf-radius-sm);
}

.ai-system-model-row {
    grid-template-columns: minmax(0, 1fr) auto;
}

.ai-system-status-row strong,
.ai-system-model-row strong {
    display: block;
    overflow-wrap: anywhere;
    color: var(--pf-text-soft);
}

.ai-system-status-row small,
.ai-system-model-row small {
    display: block;
    color: rgba(148, 163, 184, .70);
}

.ai-system-status-row > span:last-child,
.ai-system-model-row > span {
    font-family: var(--pf-font-mono);
    font-size: .68rem;
    color: rgba(125, 211, 252, .72);
    white-space: nowrap;
}

.ai-system-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
}

.ai-system-status-dot--online {
    background: rgba(34, 197, 94, .85);
    box-shadow: 0 0 8px rgba(34, 197, 94, .38);
}

.ai-system-status-dot--offline {
    background: rgba(239, 68, 68, .75);
    box-shadow: 0 0 8px rgba(239, 68, 68, .28);
}

.pf-ai-workspace {
    gap: 20px;
}

.pf-ai-section {
    display: grid;
    gap: 16px;
}

.pf-ai-section-head {
    margin-bottom: 0;
}

.pf-ai-section-head p {
    max-width: 880px;
    margin: 7px 0 0;
    color: rgba(209, 213, 219, .72);
    font-size: .86rem;
}

.pf-ai-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.pf-ai-control-band {
    display: grid;
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
    gap: 14px;
    align-items: end;
    padding: 14px;
    background:
        linear-gradient(135deg, rgba(56, 189, 248, .065), transparent 48%),
        rgba(2, 6, 18, .34);
    border: 1px solid rgba(125, 211, 252, .13);
    border-radius: var(--pf-radius-sm);
}

.pf-ai-active-picker {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.pf-ai-active-picker > span,
.pf-ai-active-summary > span {
    color: rgba(148, 163, 184, .74);
    font-family: var(--pf-font-mono);
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.pf-ai-active-summary {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding-bottom: 4px;
}

.pf-ai-active-summary strong {
    color: rgba(226, 232, 240, .92);
    font-size: .9rem;
    overflow-wrap: anywhere;
}

.pf-ai-role-grid,
.pf-ai-context-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.pf-ai-role-card,
.pf-ai-context-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    background: rgba(2, 6, 18, .38);
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: var(--pf-radius-sm);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
}

.pf-ai-role-card--selected {
    background: rgba(99, 102, 241, .085);
    border-color: rgba(125, 211, 252, .30);
    box-shadow:
        0 0 0 1px rgba(99, 102, 241, .10),
        inset 0 1px 0 rgba(255, 255, 255, .035);
}

.pf-ai-card--disabled {
    opacity: .62;
}

.pf-ai-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pf-ai-card-top > span,
.pf-ai-tags span {
    font-family: var(--pf-font-mono);
    font-size: .62rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(125, 211, 252, .68);
}

.pf-ai-role-card h4,
.pf-ai-context-card h4 {
    margin: 0;
    color: rgba(249, 250, 251, .96);
    font-size: .92rem;
    overflow-wrap: anywhere;
}

.pf-ai-role-card p,
.pf-ai-context-card p {
    margin: 0;
    color: rgba(209, 213, 219, .72);
    font-size: .82rem;
    line-height: 1.58;
}

.pf-ai-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(226, 232, 240, .82);
    font-size: .76rem;
    font-weight: 800;
    white-space: nowrap;
}

.pf-ai-switch input {
    width: 15px;
    height: 15px;
    accent-color: var(--pf-primary);
}

.pf-ai-switch--standalone {
    margin-bottom: 14px;
}

.pf-ai-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 2px;
}

.pf-ai-editor {
    padding: 16px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .035), transparent 46%),
        rgba(2, 6, 18, .32);
    border: 1px solid rgba(148, 163, 184, .13);
    border-radius: var(--pf-radius-sm);
}

.pf-ai-editor-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.pf-ai-editor-head h3 {
    margin: 4px 0 0;
}

.pf-ai-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.pf-ai-textarea {
    font-family: var(--pf-font-mono);
    font-size: .8rem;
    line-height: 1.55;
}

.pf-ai-mini-list {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 8px 10px;
    background: rgba(15, 23, 42, .46);
    border: 1px solid rgba(148, 163, 184, .08);
    border-radius: 8px;
}

.pf-ai-mini-list strong {
    color: rgba(226, 232, 240, .86);
    font-size: .72rem;
}

.pf-ai-mini-list span {
    color: rgba(148, 163, 184, .78);
    font-size: .76rem;
    overflow-wrap: anywhere;
}

.pf-ai-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pf-ai-tags span {
    padding: 3px 7px;
    background: rgba(99, 102, 241, .10);
    border: 1px solid rgba(99, 102, 241, .15);
    border-radius: 999px;
    color: rgba(199, 210, 254, .86);
    letter-spacing: 0;
    text-transform: none;
}

@media (max-width: 1100px) {
    .ai-system-hero,
    .ai-system-grid {
        grid-template-columns: 1fr;
    }

    .ai-system-panel--wide {
        grid-column: auto;
    }

    .ai-system-prompt-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pf-ai-role-grid,
    .pf-ai-context-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .ai-system-hero {
        padding: 18px;
    }

    .ai-system-hero-grid,
    .ai-system-control-row,
    .ai-system-profile-strip,
    .ai-system-parameter-grid,
    .ai-system-prompt-grid {
        grid-template-columns: 1fr;
    }

    .ai-system-panel {
        padding: 15px;
    }

    .pf-ai-section-head,
    .pf-ai-editor-head {
        flex-direction: column;
    }

    .pf-ai-control-band,
    .pf-ai-form-grid {
        grid-template-columns: 1fr;
    }

    .pf-ai-head-actions {
        justify-content: flex-start;
    }
}

/* =========================================================
   Utility
   ========================================================= */

.text-muted    { color: var(--pf-text-subtle); }
.text-secondary { color: var(--pf-text-muted); }
.text-danger   { color: var(--pf-danger); }
.text-success  { color: var(--pf-success); }

.fw-normal { font-weight: 400; }

.mt-0  { margin-top: 0; }
.mt-8  { margin-top: 8px; }
.mt-28 { margin-top: 28px; }
.mb-0  { margin-bottom: 0; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.gap-8 { gap: 8px; }
.flex  { display: flex; }
.flex-center  { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

/* =========================================================
   Validation
   ========================================================= */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--pf-success);
}

.invalid {
    outline: 1px solid var(--pf-danger);
}

.validation-message {
    color: var(--pf-danger);
    font-size: .8rem;
}

/* =========================================================
   Blazor System
   ========================================================= */

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbmQ9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: var(--pf-radius-sm);
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

#blazor-error-ui {
    background: rgba(245, 158, 11, 0.15);
    border-top: 1px solid #F59E0B;
    bottom: 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,.08);
    display: none;
    left: 0;
    padding: 12px 20px;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-size: .875rem;
    color: #FCD34D;
}

#blazor-error-ui .reload {
    font-weight: 600;
    color: #FCD34D;
    margin-left: 8px;
}

#blazor-error-ui .dismiss {
    margin-left: auto;
    cursor: pointer;
    font-size: 1rem;
    float: right;
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* Project files */
.project-file-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.project-file-item {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: .85rem;
}

/* =========================================================
   App-wide AI Workspace Harmonization
   ========================================================= */

body {
    background:
        radial-gradient(circle at calc(var(--pf-sidebar-width) + 10%) 0%, rgba(99, 102, 241, 0.15), transparent 30%),
        radial-gradient(circle at 92% 10%, rgba(56, 189, 248, 0.10), transparent 28%),
        linear-gradient(180deg, #070A14 0%, #0A0E1B 48%, #070A14 100%);
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        repeating-linear-gradient(90deg, transparent 0 54px, rgba(148, 163, 184, 0.012) 54px 55px),
        repeating-linear-gradient(0deg, transparent 0 54px, rgba(56, 189, 248, 0.009) 54px 55px),
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.028), transparent 36%);
}

.main-area {
    position: relative;
    isolation: isolate;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.26), rgba(2, 6, 18, 0.06)),
        transparent;
}

.main-area::before {
    content: '';
    position: fixed;
    inset: 0 0 0 var(--pf-sidebar-width);
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 12% 5%, rgba(99, 102, 241, 0.10), transparent 28%),
        radial-gradient(circle at 88% 4%, rgba(56, 189, 248, 0.08), transparent 26%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.018), transparent 35%);
}

.page-content {
    position: relative;
    max-width: min(1480px, calc(100vw - var(--pf-sidebar-width)));
    padding: clamp(24px, 2.1vw, 36px);
}

.page-header {
    position: relative;
    overflow: hidden;
    margin-bottom: 18px;
    padding: 18px 20px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: var(--pf-radius-lg);
    background:
        radial-gradient(circle at 100% 0%, rgba(56, 189, 248, 0.085), transparent 30%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.045), transparent 42%),
        linear-gradient(180deg, rgba(13, 18, 34, 0.92), rgba(7, 11, 22, 0.90));
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(99, 102, 241, 0.20), transparent 18%),
        repeating-linear-gradient(90deg, transparent 0 52px, rgba(99, 102, 241, 0.014) 52px 53px);
    box-shadow: inset 3px 0 0 rgba(99, 102, 241, 0.76);
}

.page-header > * {
    position: relative;
    z-index: 1;
}

.page-header h1 {
    font-size: clamp(1.28rem, 1.8vw, 1.75rem);
    font-weight: 850;
    text-transform: uppercase;
    color: rgba(249, 250, 251, 0.94);
    text-shadow: 0 10px 26px rgba(0, 0, 0, 0.30);
}

.page-header p {
    color: rgba(148, 163, 184, 0.80);
}

.card,
.form-card,
.data-table-card,
.add-form-card,
.detail-meta-card,
.detail-content-card,
.prompt-card,
.skill-card {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.040), transparent 42%),
        radial-gradient(circle at 90% 0%, rgba(99, 102, 241, 0.055), transparent 34%),
        linear-gradient(180deg, rgba(13, 18, 34, 0.96), rgba(7, 11, 22, 0.96));
    border: 1px solid rgba(148, 163, 184, 0.13);
    box-shadow: var(--pf-shadow-sm);
}

.card::before,
.form-card::before,
.data-table-card::before,
.add-form-card::before,
.detail-meta-card::before,
.detail-content-card::before,
.prompt-card::before,
.skill-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.030), transparent 18%),
        radial-gradient(circle at 0% 100%, rgba(56, 189, 248, 0.040), transparent 32%);
}

.card > *,
.form-card > *,
.data-table-card > *,
.add-form-card > *,
.detail-meta-card > *,
.detail-content-card > *,
.prompt-card > *,
.skill-card > * {
    position: relative;
    z-index: 1;
}

.prompt-card,
.skill-card {
    padding: 18px 20px;
    border-radius: var(--pf-radius-lg);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.prompt-card:hover,
.skill-card:hover,
.card-hover:hover {
    transform: translateY(-3px);
    border-color: rgba(129, 140, 248, 0.24);
    box-shadow: var(--pf-shadow-hover);
}

.prompt-card-title,
.skill-card-title {
    font-family: var(--pf-font-accent);
    font-size: .98rem;
    font-weight: 800;
    text-transform: uppercase;
    color: rgba(249, 250, 251, 0.93);
}

.prompt-card-title:hover,
.skill-card-title:hover {
    color: rgba(125, 211, 252, 0.94);
    text-shadow: 0 0 18px rgba(56, 189, 248, 0.18);
}

.prompt-card-description,
.skill-card-description {
    color: rgba(203, 213, 225, 0.72);
    line-height: 1.58;
}

.prompt-card-meta,
.skill-card-meta {
    gap: 7px;
}

.prompt-card-footer {
    border-top: 1px solid rgba(148, 163, 184, 0.075);
    padding-top: 10px;
}

.skill-grid,
.prompt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}

.filter-bar {
    position: relative;
    overflow: hidden;
    padding: 13px;
    border-color: rgba(99, 102, 241, 0.13);
    background:
        radial-gradient(circle at 96% 0%, rgba(56, 189, 248, 0.075), transparent 34%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent 42%),
        rgba(5, 10, 24, 0.76);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.028);
}

.filter-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.12), transparent 20%);
}

.filter-bar > * {
    position: relative;
    z-index: 1;
}

.form-control,
.data-table .table-edit-input {
    min-height: 38px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.006)),
        rgba(2, 6, 18, 0.56);
    border: 1px solid rgba(148, 163, 184, 0.13);
    border-radius: var(--pf-radius-sm);
    color: rgba(229, 231, 235, 0.94);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.form-control::placeholder {
    color: rgba(148, 163, 184, 0.44);
}

.form-control:hover,
.data-table .table-edit-input:hover {
    border-color: rgba(148, 163, 184, 0.22);
}

.form-control:focus,
.data-table .table-edit-input:focus {
    border-color: rgba(99, 102, 241, 0.46);
    box-shadow:
        0 0 0 3px rgba(99, 102, 241, 0.08),
        0 0 28px rgba(99, 102, 241, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.040);
    background: rgba(3, 7, 18, 0.78);
}

select.form-control option {
    background: #090E1D;
    color: var(--pf-text-soft);
}

.form-card,
.add-form-card,
.detail-meta-card,
.detail-content-card {
    max-width: none;
    padding: 22px;
}

.form-label,
.ai-system-field > span {
    font-family: var(--pf-font-mono);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(125, 211, 252, 0.66);
}

.form-actions {
    border-top-color: rgba(148, 163, 184, 0.085);
}

.btn {
    min-height: 38px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-weight: 750;
    transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease, color 160ms ease;
}

.btn-sm {
    min-height: 30px;
}

.btn-xs {
    min-height: 26px;
}

.btn-primary,
.btn-copy {
    background:
        linear-gradient(180deg, rgba(129, 140, 248, 0.98), rgba(79, 70, 229, 0.94));
    border-color: rgba(165, 180, 252, 0.24);
    box-shadow: 0 2px 14px rgba(99, 102, 241, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.btn-primary:hover,
.btn-copy:hover {
    background:
        linear-gradient(180deg, rgba(139, 152, 255, 1), rgba(79, 70, 229, 1));
    border-color: rgba(191, 219, 254, 0.30);
    box-shadow: 0 8px 26px rgba(99, 102, 241, 0.34), 0 0 24px rgba(99, 102, 241, 0.16);
}

.btn-secondary {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.050), rgba(255, 255, 255, 0.012)),
        rgba(15, 23, 42, 0.78);
    color: rgba(226, 232, 240, 0.90);
    border-color: rgba(148, 163, 184, 0.16);
}

.btn-secondary:hover {
    background:
        linear-gradient(180deg, rgba(99, 102, 241, 0.10), rgba(99, 102, 241, 0.025)),
        rgba(15, 23, 42, 0.92);
    border-color: rgba(129, 140, 248, 0.32);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18), 0 0 18px rgba(99, 102, 241, 0.09);
}

.btn-ghost {
    background: rgba(2, 6, 18, 0.24);
    border-color: rgba(148, 163, 184, 0.10);
}

.btn-ghost:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(129, 140, 248, 0.22);
}

.badge {
    border: 1px solid rgba(148, 163, 184, 0.10);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.badge-category {
    background: rgba(99, 102, 241, 0.11);
    color: rgba(199, 210, 254, 0.92);
    border-color: rgba(129, 140, 248, 0.20);
}

.badge-tag {
    background: rgba(2, 6, 18, 0.40);
    color: rgba(203, 213, 225, 0.76);
    border-color: rgba(148, 163, 184, 0.12);
}

.badge-target {
    background: rgba(20, 184, 166, 0.075);
    color: rgba(94, 234, 212, 0.88);
    border-color: rgba(45, 212, 191, 0.18);
}

.data-table-card {
    border-color: rgba(148, 163, 184, 0.12);
}

.data-table thead {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.036), rgba(255, 255, 255, 0.010)),
        rgba(2, 6, 18, 0.36);
}

.data-table th {
    font-family: var(--pf-font-mono);
    font-size: .66rem;
    color: rgba(148, 163, 184, 0.72);
}

.data-table td {
    border-bottom-color: rgba(148, 163, 184, 0.075);
    color: rgba(226, 232, 240, 0.88);
}

.data-table tbody tr {
    transition: background 150ms ease, box-shadow 150ms ease;
}

.data-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.055);
    box-shadow: inset 3px 0 0 rgba(99, 102, 241, 0.45);
}

.add-form-card h3,
.detail-content-card h3,
.backup-section h2 {
    font-family: var(--pf-font-accent);
    text-transform: uppercase;
    letter-spacing: 0;
    color: rgba(249, 250, 251, 0.90);
}

.prompt-content-block,
.selected-file-info,
.import-confirm-box,
.ai-system-connection-line,
.ai-system-parameter-grid > div,
.ai-system-prompt-card,
.ai-system-status-row,
.ai-system-model-row,
.ai-system-metric {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.030), rgba(255, 255, 255, 0.006)),
        rgba(2, 6, 18, 0.44);
    border-color: rgba(148, 163, 184, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.empty-state.card,
.empty-state {
    border-radius: var(--pf-radius-lg);
}

.empty-state.card {
    background:
        radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.09), transparent 36%),
        linear-gradient(180deg, rgba(13, 18, 34, 0.92), rgba(7, 11, 22, 0.92));
}

.empty-state-icon {
    color: rgba(125, 211, 252, 0.76);
    opacity: .78;
    filter: drop-shadow(0 0 16px rgba(56, 189, 248, 0.16));
}

.loading-text {
    font-family: var(--pf-font-mono);
    color: rgba(125, 211, 252, 0.70);
}

.backup-grid {
    gap: 18px;
}

.backup-section-icon {
    display: inline-flex;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: rgba(125, 211, 252, 0.88);
    background: rgba(56, 189, 248, 0.075);
    border: 1px solid rgba(56, 189, 248, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.backup-includes li {
    position: relative;
    padding-left: 16px;
}

.backup-includes li::before {
    content: '';
    position: absolute;
    left: 0;
    top: .72em;
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: rgba(125, 211, 252, 0.75);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.28);
}

.project-name-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: rgba(249, 250, 251, 0.90);
}

.project-color-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    box-shadow: 0 0 12px currentColor;
}

.form-control-file {
    padding: 10px 0;
    color: rgba(203, 213, 225, 0.82);
}

/* =========================================================
   Auth / User Administration
   ========================================================= */

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at 18% 0%, rgba(99, 102, 241, 0.16), transparent 32%),
        radial-gradient(circle at 86% 14%, rgba(56, 189, 248, 0.10), transparent 30%),
        linear-gradient(180deg, #070A14 0%, #090D1A 100%);
}

.auth-card {
    width: min(550px, 100%);
    padding: 44px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: var(--pf-radius-lg);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.052), transparent 42%),
        radial-gradient(circle at 90% 0%, rgba(99, 102, 241, 0.08), transparent 36%),
        linear-gradient(180deg, rgba(13, 18, 34, 0.96), rgba(7, 11, 22, 0.96));
    box-shadow: var(--pf-shadow-md);
}

.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 32px;
    text-align: center;
}

.auth-brand img {
    width: 128px;
    height: 128px;
    object-fit: contain;
}

.auth-brand span,
.auth-brand strong {
    display: block;
    letter-spacing: 0;
}

.auth-brand span {
    color: rgba(249, 250, 251, .94);
    font-family: var(--pf-font-accent);
    font-size: 2.1rem;
    font-weight: 850;
}

.auth-brand strong {
    color: rgba(148, 163, 184, 0.48);
    font-family: var(--pf-font-mono);
    font-size: 0.62rem;
    font-weight: 400;
    letter-spacing: 0.34em;
    margin-top: 6px;
}

/* ── AppBrand shared component ─────────────────────────────────── */
.app-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.app-brand--auth {
    gap: 10px;
    margin-bottom: 28px;
}

.app-brand--hero {
    gap: 14px;
    margin-bottom: 0;
}

.app-brand-logo {
    object-fit: contain;
    flex-shrink: 0;
}

.app-brand--auth .app-brand-logo {
    width: 96px;
    height: 96px;
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.28)) drop-shadow(0 0 12px rgba(0, 240, 200, 0.08));
}

.app-brand--hero .app-brand-logo {
    width: 148px;
    height: 148px;
    filter: drop-shadow(0 16px 26px rgba(0, 0, 0, 0.34)) drop-shadow(0 0 16px rgba(0, 240, 200, 0.10));
}

.app-brand-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    min-width: 0;
}

.app-brand-name {
    font-family: var(--pf-font-accent);
    font-weight: 850;
    color: rgba(255, 255, 255, 0.97);
    line-height: 1.05;
    letter-spacing: 0;
    white-space: nowrap;
    text-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.app-brand--auth .app-brand-name {
    font-size: 1.7rem;
}

.app-brand--hero .app-brand-name {
    font-size: 2.2rem;
}

.app-brand-sig-row {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    margin-top: 5px;
}

.app-brand-sig-row::before,
.app-brand-sig-row::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(0, 240, 200, 0.38));
}

.app-brand-sig-row::after {
    background: linear-gradient(to left, transparent, rgba(0, 240, 200, 0.38));
}

.app-brand-sig {
    font-family: var(--pf-font-mono);
    font-weight: 600;
    color: #00F0C8;
    letter-spacing: 0.18em;
    white-space: nowrap;
    text-shadow: 0 0 14px rgba(0, 240, 200, 0.45);
    flex-shrink: 0;
}

.app-brand--auth .app-brand-sig {
    font-size: 0.82rem;
}

.app-brand--hero .app-brand-sig {
    font-size: 1.0rem;
}

@media (max-width: 600px) {
    .app-brand--hero .app-brand-logo {
        width: 110px;
        height: 110px;
    }

    .app-brand--hero .app-brand-name {
        font-size: 1.7rem;
    }

    .app-brand--hero .app-brand-sig {
        font-size: 0.82rem;
    }
}
/* ─────────────────────────────────────────────────────────────── */

.auth-card h1 {
    font-size: 2rem;
    line-height: 1.12;
    text-align: center;
}

.auth-card .text-secondary {
    font-size: 1.05rem;
    text-align: center;
}

.auth-form {
    display: grid;
    gap: 22px;
    margin-top: 26px;
}

.auth-form .form-label {
    font-size: .84rem;
}

.auth-form .form-control {
    min-height: 52px;
    font-size: 1rem;
}

.auth-submit {
    width: 100%;
    min-height: 52px;
    justify-content: center;
    font-size: 1rem;
}

.auth-note {
    padding: 12px 14px;
    border: 1px solid rgba(56, 189, 248, .16);
    border-radius: var(--pf-radius-sm);
    color: rgba(203, 213, 225, .84);
    background: rgba(56, 189, 248, .06);
}

@media (max-width: 640px) {
    .auth-page {
        min-height: 100dvh;
        padding: 20px 14px;
        place-items: center;
    }

    .auth-card {
        width: 100%;
        max-width: 430px;
        padding: 30px 24px;
    }

    .auth-brand {
        gap: 12px;
        margin-bottom: 26px;
    }

    .auth-brand img {
        width: 96px;
        height: 96px;
    }

    .auth-brand span {
        font-size: clamp(1.65rem, 7vw, 2rem);
        line-height: 1.08;
    }

    .auth-brand strong {
        font-size: .58rem;
        letter-spacing: .30em;
    }

    .auth-card h1 {
        font-size: clamp(1.7rem, 7vw, 2rem);
    }

    .auth-card .text-secondary {
        font-size: 1rem;
    }

    .auth-form {
        gap: 18px;
        margin-top: 22px;
    }

    .auth-form .form-control,
    .auth-submit {
        min-height: 48px;
    }
}

@media (max-width: 380px) {
    .auth-page {
        padding: 12px;
    }

    .auth-card {
        padding: 24px 18px;
    }

    .auth-brand img {
        width: 84px;
        height: 84px;
    }
}

.form-error {
    padding: 10px 12px;
    border: 1px solid rgba(239, 68, 68, .24);
    border-radius: var(--pf-radius-sm);
    color: #fecaca;
    background: rgba(239, 68, 68, .10);
}

.sidebar-user-shell {
    position: relative;
    width: 100%;
    margin-bottom: 0;
}

.sidebar-user-shell > summary {
    list-style: none;
}

.sidebar-user-shell > summary::-webkit-details-marker {
    display: none;
}

.sidebar-user {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 10px;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 8px;
    cursor: pointer;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.060), rgba(255, 255, 255, 0.018) 46%, rgba(99, 102, 241, 0.080)),
        rgba(7, 11, 22, 0.72);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 12px 28px rgba(0, 0, 0, 0.20);
    text-align: left;
    transition: border-color var(--pf-transition), background var(--pf-transition), transform var(--pf-transition);
}

.sidebar-user:hover,
.sidebar-user-shell[open] .sidebar-user {
    border-color: rgba(129, 140, 248, 0.24);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.022) 46%, rgba(99, 102, 241, 0.110)),
        rgba(9, 14, 28, 0.86);
    transform: translateY(-1px);
}

.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    overflow: hidden;
    border-radius: 999px;
    border: 1px solid rgba(125, 211, 252, 0.32);
    background: rgba(99, 102, 241, 0.16);
    color: rgba(249, 250, 251, 0.96);
    font-family: var(--pf-font-accent);
    font-size: .72rem;
    font-weight: 800;
}

.user-avatar img,
.profile-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    max-width: 142px;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.96);
    font-size: .88rem;
    font-weight: 800;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-role {
    color: rgba(125, 211, 252, 0.78);
    font-size: .72rem;
    line-height: 1.2;
}

.user-menu-chevron {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    margin-left: auto;
    border-right: 2px solid rgba(226, 232, 240, .76);
    border-bottom: 2px solid rgba(226, 232, 240, .76);
    transform: rotate(45deg) translateY(-2px);
    transition: transform var(--pf-transition), border-color var(--pf-transition);
}

.sidebar-user-shell[open] .user-menu-chevron {
    transform: rotate(-135deg) translateY(-1px);
    border-color: rgba(255, 255, 255, .95);
}

.user-menu-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 10px);
    z-index: 160;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.13);
    border-radius: 8px;
    background:
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.16), transparent 34%),
        linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(8, 12, 26, 0.98));
    box-shadow:
        0 20px 42px rgba(0, 0, 0, 0.36),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    animation: user-menu-enter-up 160ms ease-out both;
}

.user-menu-section {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.user-menu-profile {
    padding: 10px 8px 8px;
}

.user-menu-name {
    color: rgba(255, 255, 255, 0.96);
    font-size: .94rem;
    font-weight: 800;
    line-height: 1.2;
}

.user-menu-role {
    display: block;
    margin-top: 3px;
    color: rgba(125, 211, 252, 0.72);
    font-size: .75rem;
}

.user-menu-divider {
    height: 1px;
    margin: 8px 2px;
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.16), transparent);
}

.user-menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 38px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    color: rgba(226, 232, 240, .92);
    background: transparent;
    font: inherit;
    font-size: .88rem;
    font-weight: 700;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--pf-transition), color var(--pf-transition), transform var(--pf-transition);
}

.user-menu-link:hover {
    background: rgba(148, 163, 184, 0.075);
    color: rgba(255, 255, 255, 0.98);
    text-decoration: none;
    transform: translateX(1px);
}

.user-menu-icon {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: rgba(125, 211, 252, .78);
    box-shadow: 0 0 0 2px rgba(125, 211, 252, .10);
}

.user-menu-logout {
    margin: 0;
}

.user-menu-link-danger {
    color: #fecaca;
}

.user-menu-link-danger .user-menu-icon,
.user-menu-icon-danger {
    background: rgba(248, 113, 113, .88);
    box-shadow: 0 0 0 2px rgba(248, 113, 113, .13);
}

.user-menu-link-danger:hover {
    background: rgba(239, 68, 68, .10);
    color: #fee2e2;
}

@keyframes user-menu-enter-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-grid,
.info-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
}

.profile-panel,
.info-panel {
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: 8px;
    padding: 20px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .046), transparent 44%),
        linear-gradient(180deg, rgba(13, 18, 34, .92), rgba(7, 11, 22, .94));
    box-shadow: var(--pf-shadow-sm);
}

.profile-panel-main,
.profile-panel-full {
    min-width: 0;
}

.profile-panel-full {
    grid-column: 1 / -1;
}

.profile-panel-header {
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(148, 163, 184, .10);
}

.profile-panel-header h2,
.info-panel h2 {
    margin: 0;
}

.profile-avatar-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 132px;
    height: 132px;
    margin: 4px auto 16px;
    overflow: hidden;
    border: 1px solid rgba(125, 211, 252, .26);
    border-radius: 8px;
    background: rgba(99, 102, 241, .16);
    color: rgba(249, 250, 251, .96);
    font-family: var(--pf-font-accent);
    font-size: 2rem;
    font-weight: 800;
}

.profile-upload-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(100%, 220px);
    margin-inline: auto;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid rgba(129, 140, 248, .26);
    border-radius: 8px;
    background: rgba(99, 102, 241, .16);
    color: rgba(238, 242, 255, .94);
    cursor: pointer;
    font-weight: 800;
}

.profile-action-button {
    justify-self: start;
    min-width: 150px;
    padding-inline: 18px;
}

.profile-file-name {
    display: block;
    margin-top: 10px;
    color: rgba(203, 213, 225, .78);
    font-size: .82rem;
    overflow-wrap: anywhere;
    text-align: center;
}

.profile-image-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.profile-password-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.info-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.info-kicker {
    display: block;
    margin-bottom: 8px;
    color: rgba(125, 211, 252, .78);
    font-family: var(--pf-font-mono);
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.page-content:has(.pf-info-page) {
    max-width: min(1900px, calc(100vw - var(--pf-sidebar-width)));
}

.pf-info-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pf-info-hero {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 12px;
    padding: 48px 32px 40px;
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: 8px;
    background:
        radial-gradient(circle at 50% 0%, rgba(99, 102, 241, .13), transparent 34%),
        linear-gradient(135deg, rgba(255, 255, 255, .045), transparent 42%),
        linear-gradient(180deg, rgba(17, 24, 39, .92), rgba(8, 12, 26, .96));
    box-shadow: var(--pf-shadow-sm);
    text-align: center;
}

.pf-info-logo {
    width: 178px;
    max-width: 42vw;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 16px 26px rgba(0, 0, 0, .34));
}

.pf-info-product-label,
.pf-info-dev-label,
.pf-info-tech-section-label,
.pf-info-legal-title,
.pf-info-func-title {
    color: rgba(125, 211, 252, .84);
    font-family: var(--pf-font-mono);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.pf-info-product-label {
    margin-top: -4px;
    color: rgba(125, 211, 252, .90);
    letter-spacing: .22em;
}

.pf-info-subtitle {
    max-width: 760px;
    color: rgba(226, 232, 240, .86);
    font-size: .96rem;
    line-height: 1.65;
}

.pf-info-version-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding: 5px 14px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 999px;
    background: rgba(255, 255, 255, .045);
    color: rgba(226, 232, 240, .88);
    font-size: .78rem;
    font-weight: 800;
}

.pf-info-grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
}

.pf-info-card {
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .040), transparent 46%),
        linear-gradient(180deg, rgba(17, 24, 39, .92), rgba(8, 12, 26, .96));
    box-shadow: var(--pf-shadow-sm);
}

.pf-info-card-full {
    width: 100%;
}

.pf-info-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(148, 163, 184, .10);
    color: rgba(255, 255, 255, .94);
    font-size: .98rem;
    font-weight: 800;
}

.pf-info-card-header svg {
    flex-shrink: 0;
    color: rgba(203, 213, 225, .78);
}

.pf-info-card-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
}

.pf-info-dev-desc,
.pf-info-legal-text,
.pf-info-func-desc {
    color: rgba(203, 213, 225, .86);
    line-height: 1.65;
}

.pf-info-dev-desc {
    font-size: .94rem;
}

.pf-info-feature-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.pf-info-feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: rgba(226, 232, 240, .86);
    font-size: .92rem;
    line-height: 1.5;
}

.pf-info-feature-list li::before {
    content: '';
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    margin-top: 2px;
    border-radius: 999px;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 10px 10px no-repeat,
        linear-gradient(180deg, rgba(125, 211, 252, .98), rgba(99, 102, 241, .94));
    box-shadow: 0 0 0 2px rgba(125, 211, 252, .10);
}

.pf-info-legal-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 18px;
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: 8px;
    background: rgba(255, 255, 255, .030);
}

.pf-info-legal-title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
}

.pf-info-legal-text {
    margin: 0;
    font-size: .84rem;
}

.pf-info-legal-text strong {
    color: rgba(255, 255, 255, .96);
}

.pf-info-website-btn {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 8px;
    padding: 9px 18px;
    border: 1px solid rgba(129, 140, 248, .32);
    border-radius: 8px;
    background: linear-gradient(180deg, var(--pf-primary), var(--pf-primary-hover));
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 12px 28px rgba(79, 70, 229, .22);
}

.pf-info-website-btn:hover {
    color: #fff;
    text-decoration: none;
    background: linear-gradient(180deg, #7c83ff, var(--pf-primary-hover));
}

.pf-info-tech-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pf-info-tech-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 800;
}

.pf-info-tech-neutral {
    border: 1px solid rgba(148, 163, 184, .12);
    background: rgba(255, 255, 255, .045);
    color: rgba(203, 213, 225, .82);
}

.pf-info-tech-accent {
    border: 1px solid rgba(125, 211, 252, .18);
    background: rgba(56, 189, 248, .08);
    color: rgba(125, 211, 252, .92);
}

.pf-info-func-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px 32px;
}

.pf-info-func-title {
    margin-bottom: 6px;
}

.pf-info-func-desc {
    margin: 0;
    font-size: .92rem;
}

.pf-info-license-table-wrap {
    overflow-x: auto;
}

.pf-info-license-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
}

.pf-info-license-table thead tr {
    border-bottom: 1px solid rgba(148, 163, 184, .10);
}

.pf-info-license-table th {
    padding: 10px 24px;
    color: rgba(148, 163, 184, .70);
    font-family: var(--pf-font-mono);
    font-size: .70rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-align: left;
    text-transform: uppercase;
}

.pf-info-license-table td {
    padding: 14px 24px;
    border-bottom: 1px solid rgba(148, 163, 184, .075);
    color: rgba(226, 232, 240, .86);
}

.pf-info-license-table tbody tr:last-child td {
    border-bottom: 0;
}

.pf-info-license-table tbody tr:hover td {
    background: rgba(255, 255, 255, .030);
}

.pf-info-license-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border: 1px solid rgba(34, 197, 94, .20);
    border-radius: 4px;
    background: rgba(34, 197, 94, .15);
    color: #4ade80;
    font-size: .74rem;
    font-weight: 800;
}

.page-content:has(.pf-help-page) {
    max-width: min(1900px, calc(100vw - var(--pf-sidebar-width)));
}

.page-content:has(.developer-library-page),
.page-content:has(.codebase-page) {
    width: 100%;
    max-width: none;
    padding: clamp(18px, 1.35vw, 24px) clamp(12px, 1.1vw, 20px) clamp(18px, 1.35vw, 24px) clamp(18px, 1.35vw, 24px);
}

.pf-help-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.pf-help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
    border: 1px solid rgba(125, 211, 252, .18);
    border-radius: 8px;
    background:
        radial-gradient(circle at 70% 20%, rgba(125, 211, 252, .16), transparent 42%),
        linear-gradient(180deg, rgba(99, 102, 241, .18), rgba(8, 12, 26, .92));
    color: rgba(125, 211, 252, .95);
    box-shadow:
        0 16px 34px rgba(0, 0, 0, .24),
        inset 0 1px 0 rgba(255, 255, 255, .05);
}

.pf-help-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pf-help-card {
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .035), transparent 46%),
        linear-gradient(180deg, rgba(17, 24, 39, .92), rgba(8, 12, 26, .96));
    box-shadow: var(--pf-shadow-sm);
}

.pf-help-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 14px 24px;
    border-bottom: 1px solid rgba(148, 163, 184, .10);
    color: rgba(255, 255, 255, .94);
    font-size: .94rem;
    font-weight: 800;
}

.pf-faq-item {
    border-bottom: 1px solid rgba(148, 163, 184, .075);
    transition: background var(--pf-transition);
}

.pf-faq-item:last-child {
    border-bottom: 0;
}

.pf-faq-item:hover {
    background: rgba(255, 255, 255, .018);
}

.pf-faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    min-height: 54px;
    padding: 16px 24px;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.pf-faq-question:focus-visible {
    outline: none;
    box-shadow:
        inset 0 0 0 2px rgba(125, 211, 252, .20),
        inset 0 0 0 4px rgba(99, 102, 241, .16);
}

.pf-faq-question-text {
    color: rgba(226, 232, 240, .92);
    font-size: .92rem;
    font-weight: 800;
    line-height: 1.5;
    transition: color var(--pf-transition);
}

.pf-faq-question-text-open {
    color: rgba(125, 211, 252, .95);
}

.pf-faq-chevron {
    flex: 0 0 auto;
    color: rgba(148, 163, 184, .64);
    transition: transform 180ms ease, color var(--pf-transition);
}

.pf-faq-chevron-up {
    color: rgba(125, 211, 252, .92);
    transform: rotate(180deg);
}

.pf-faq-answer {
    padding: 0 24px 20px;
    color: rgba(203, 213, 225, .88);
    font-size: .92rem;
    line-height: 1.7;
}

.pf-faq-answer strong {
    color: rgba(255, 255, 255, .96);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(2, 6, 18, .72);
}

.modal-panel {
    width: min(560px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    padding: 22px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: var(--pf-radius-lg);
    background: linear-gradient(180deg, rgba(13, 18, 34, .98), rgba(7, 11, 22, .98));
    box-shadow: var(--pf-shadow-md);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 860px) {
    .page-content {
        max-width: 100%;
        padding: 18px;
    }

    .page-header {
        padding: 16px;
    }

    .filter-search,
    .filter-select,
    .filter-sort {
        max-width: none;
        width: 100%;
        flex: 1 1 100%;
    }

    .filter-count {
        margin-left: 0;
    }

    .skill-grid,
    .prompt-grid,
    .backup-grid,
    .profile-grid,
    .info-grid,
    .profile-password-grid,
    .pf-info-grid-2,
    .pf-info-func-grid {
        grid-template-columns: 1fr;
    }

    .profile-panel-full {
        grid-column: auto;
    }

    .pf-info-hero {
        padding: 32px 20px;
    }

    .pf-info-card-header,
    .pf-info-card-body {
        padding-inline: 16px;
    }

    .pf-info-license-table {
        min-width: 560px;
    }

    .pf-help-header {
        align-items: flex-start;
    }

    .pf-help-card-header,
    .pf-faq-question,
    .pf-faq-answer {
        padding-inline: 16px;
    }
}

@media (max-width: 1024px) {
    :root {
        --pf-mobile-header-height: 76px;
    }

    .app-shell {
        display: block;
        min-height: 100vh;
    }

    .mobile-shell-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 220;
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: var(--pf-mobile-header-height);
        padding: 0 28px;
        border-bottom: 1px solid rgba(148, 163, 184, 0.14);
        background:
            linear-gradient(135deg, rgba(255, 255, 255, 0.055), transparent 44%),
            linear-gradient(180deg, rgba(17, 24, 39, 0.96), rgba(8, 12, 26, 0.98));
        box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
    }

    .mobile-shell-brand {
        display: inline-flex;
        align-items: center;
        gap: 12px;
        color: #fff;
        text-decoration: none;
    }

    .mobile-shell-brand:hover {
        text-decoration: none;
    }

    .mobile-shell-brand-logo {
        width: 54px;
        height: 54px;
        object-fit: contain;
        filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.32));
    }

    .mobile-shell-brand-text {
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-width: 0;
    }

    .mobile-shell-brand-name {
        color: rgba(255, 255, 255, 0.96);
        font-family: var(--pf-font-ui);
        font-size: 1.34rem;
        font-weight: 900;
        line-height: 1.05;
        letter-spacing: 0;
    }

    .mobile-shell-brand-sig {
        margin-top: 5px;
        color: rgba(148, 163, 184, 0.50);
        font-family: var(--pf-font-mono);
        font-size: .60rem;
        font-weight: 400;
        letter-spacing: .32em;
        line-height: 1;
    }

    .mobile-shell-menu-btn {
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: rgba(243, 244, 246, 0.92);
        cursor: pointer;
    }

    .mobile-shell-menu-btn span {
        display: block;
        width: 25px;
        height: 2px;
        background: currentColor;
        transition: transform 180ms ease, opacity 180ms ease, width 180ms ease;
    }

    .mobile-shell-menu-btn span + span {
        margin-top: 7px;
    }

    .mobile-shell-menu-btn:focus-visible {
        outline: 2px solid rgba(125, 211, 252, 0.72);
        outline-offset: 3px;
    }

    .mobile-menu-toggle:checked ~ .mobile-shell-header .mobile-shell-menu-btn span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .mobile-menu-toggle:checked ~ .mobile-shell-header .mobile-shell-menu-btn span:nth-child(2) {
        opacity: 0;
        width: 0;
    }

    .mobile-menu-toggle:checked ~ .mobile-shell-header .mobile-shell-menu-btn span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    .mobile-menu-backdrop {
        position: fixed;
        top: var(--pf-mobile-header-height);
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 180;
        display: block;
        padding: 0;
        border: 0;
        background: rgba(0, 0, 0, 0.58);
        opacity: 0;
        pointer-events: none;
        transition: opacity 180ms ease;
    }

    .mobile-menu-toggle:checked ~ .mobile-menu-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar {
        top: var(--pf-mobile-header-height);
        width: min(400px, 82vw);
        height: calc(100vh - var(--pf-mobile-header-height));
        z-index: 210;
        border-right: 1px solid rgba(148, 163, 184, 0.14);
        background:
            linear-gradient(180deg, rgba(18, 24, 43, 0.98) 0%, rgba(7, 11, 23, 0.99) 74%, rgba(13, 14, 34, 1) 100%),
            var(--pf-sidebar-bg);
        box-shadow: 22px 0 46px rgba(0, 0, 0, 0.34);
        transform: translateX(-100%);
        transition: transform 220ms ease;
    }

    .mobile-menu-toggle:checked ~ .sidebar {
        transform: translateX(0);
    }

    .sidebar::before,
    .sidebar::after {
        display: none;
    }

    .sidebar > .sidebar-brand {
        display: none;
    }

    .sidebar-nav {
        padding: 16px 12px 14px;
    }

    .sidebar-section-label {
        display: none;
    }

    .sidebar-nav a,
    .sidebar-nav .nav-link {
        min-height: 46px;
        margin-bottom: 8px;
        padding: 0 16px;
        border-radius: 12px;
        color: rgba(243, 244, 246, 0.88);
        font-size: 1rem;
        font-weight: 800;
    }

    .sidebar-nav a::before,
    .sidebar-nav .nav-link::before {
        top: 0;
        bottom: 0;
        width: 4px;
        border-radius: 12px 0 0 12px;
    }

    .sidebar-nav a.active,
    .sidebar-nav .nav-link.active {
        background:
            linear-gradient(90deg, rgba(99,102,241,0.22), rgba(56,189,248,0.085) 52%, rgba(255,255,255,0.022)),
            rgba(15, 23, 42, 0.58);
        border-color: rgba(129, 140, 248, 0.22);
        color: rgba(255, 255, 255, 0.99);
        box-shadow:
            0 8px 20px rgba(0, 0, 0, 0.18),
            0 0 0 1px rgba(99, 102, 241, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.055);
    }

    .sidebar-nav a.active::before,
    .sidebar-nav .nav-link.active::before {
        background: linear-gradient(180deg, rgba(125, 211, 252, 0.95), rgba(99, 102, 241, 0.96));
        box-shadow: 0 0 18px rgba(99, 102, 241, 0.55);
        opacity: 1;
    }

    .sidebar-nav a.active .nav-icon,
    .sidebar-nav .nav-link.active .nav-icon {
        color: rgba(125, 211, 252, 0.92);
    }

    .sidebar-footer {
        margin: 0 12px 12px;
        background: rgba(15, 15, 17, 0.42);
    }

    .main-area {
        min-height: 100vh;
        margin-left: 0;
        padding-top: var(--pf-mobile-header-height);
    }

    .main-area::before {
        inset: var(--pf-mobile-header-height) 0 0 0;
    }

    .page-content,
    .page-content:has(.workspace-module-grid),
    .page-content:has(.pf-info-page),
    .page-content:has(.pf-help-page),
    .page-content:has(.developer-library-page),
    .page-content:has(.codebase-page) {
        max-width: 100%;
    }
}

@media (max-width: 520px) {
    :root {
        --pf-mobile-header-height: 70px;
    }

    .mobile-shell-header {
        padding-inline: 18px;
    }

    .mobile-shell-brand-logo {
        width: 48px;
        height: 48px;
    }

    .mobile-shell-brand-name {
        font-size: 1.15rem;
    }

    .mobile-shell-brand-sig {
        font-size: .58rem;
        letter-spacing: .30em;
    }

    .sidebar {
        width: min(390px, 88vw);
    }
}

/* ── Arbeitsmodelle Dual-Panel ── */
.ai-workmodel-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 768px) {
    .ai-workmodel-layout {
        grid-template-columns: 1fr;
    }
}

.ai-workmodel-panel {
    border: 1px solid var(--border-color, rgba(255,255,255,0.08));
    border-radius: 10px;
    padding: 1rem;
    background: var(--surface-raised, rgba(255,255,255,0.02));
    min-height: 200px;
}

.ai-workmodel-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.ai-workmodel-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 320px;
    overflow-y: auto;
}

.ai-workmodel-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    border-radius: 7px;
    background: var(--surface-card, rgba(255,255,255,0.03));
    border: 1px solid transparent;
    transition: border-color 0.15s;
}

.ai-workmodel-item:hover {
    border-color: var(--border-color, rgba(255,255,255,0.1));
}

.ai-workmodel-item--added {
    opacity: 0.5;
}

.ai-workmodel-item--default {
    border-color: var(--accent-primary, #6c8cf4);
    background: rgba(108, 140, 244, 0.06);
}

.ai-workmodel-name {
    flex: 1;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-workmodel-size {
    font-size: 0.75rem;
    color: var(--text-secondary, rgba(255,255,255,0.45));
    white-space: nowrap;
}

.ai-workmodel-info {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex: 1;
    min-width: 0;
}

.ai-workmodel-profile {
    font-size: 0.7rem;
    color: var(--text-secondary, rgba(255,255,255,0.4));
    white-space: nowrap;
}

.ai-workmodel-badge--default {
    color: #f5c518;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.ai-workmodel-add-btn {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 5px;
    background: var(--accent-primary, #6c8cf4);
    color: #fff;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s;
}

.ai-workmodel-add-btn:disabled {
    background: var(--border-color, rgba(255,255,255,0.15));
    color: var(--text-secondary, rgba(255,255,255,0.4));
    cursor: default;
}

.ai-workmodel-actions {
    display: flex;
    gap: 0.2rem;
    flex-shrink: 0;
}

.ai-workmodel-action-btn {
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 4px;
    background: var(--surface-raised, rgba(255,255,255,0.06));
    color: var(--text-secondary, rgba(255,255,255,0.6));
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.ai-workmodel-action-btn:hover {
    background: var(--border-color, rgba(255,255,255,0.12));
    color: var(--text-primary, #fff);
}

.ai-workmodel-action-btn--remove:hover {
    background: rgba(220, 53, 69, 0.2);
    color: #ff6b6b;
}

.ai-workmodel-loading {
    padding: 1rem 0;
    color: var(--text-secondary, rgba(255,255,255,0.45));
    font-size: 0.85rem;
}

/* ── Erweiterte Einstellungen (einklappbar) ── */
.ai-advanced-section {
    padding: 0;
}

.ai-advanced-section[open] > .ai-advanced-summary {
    border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.08));
    margin-bottom: 0;
}

.ai-advanced-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 1.1rem 1.25rem;
    user-select: none;
    list-style: none;
    font-weight: 600;
    font-size: 0.9rem;
    gap: 0.5rem;
}

.ai-advanced-summary::-webkit-details-marker {
    display: none;
}

.ai-advanced-summary svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.ai-advanced-section[open] .ai-advanced-summary svg {
    transform: rotate(180deg);
}

.ai-advanced-content {
    padding: 0 1.25rem 1.25rem;
}

/* ── Nav Sub-Link ── */
.nav-sublink {
    padding-left: 2.75rem !important;
    font-size: 0.82rem !important;
    opacity: 0.85;
}

/* ── KI Debug / Diagnose ── */
.ai-debug-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}

.ai-debug-stat {
    padding: 0.6rem 0.75rem;
    background: rgba(2, 6, 18, 0.34);
    border: 1px solid rgba(148, 163, 184, 0.10);
    border-radius: var(--pf-radius-sm);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.ai-debug-stat span {
    font-size: 0.72rem;
    color: var(--pf-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ai-debug-stat strong {
    font-size: 0.825rem;
    color: var(--pf-text);
    word-break: break-all;
}

.ai-debug-stat--error {
    border-color: rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.05);
}

.ai-debug-url {
    font-family: monospace;
    font-size: 0.78rem !important;
}

/* Live-Log */
.ai-debug-log {
    max-height: 360px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--pf-border);
    border-radius: var(--pf-radius-sm);
    background: rgba(2, 6, 18, 0.5);
}

.ai-debug-log-empty {
    padding: 1.25rem 1rem;
    color: var(--pf-text-muted);
    font-size: 0.85rem;
}

.ai-debug-log-row {
    display: grid;
    grid-template-columns: 68px 46px 110px 1fr;
    gap: 0.5rem;
    align-items: baseline;
    padding: 0.35rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.8rem;
    line-height: 1.4;
}

.ai-debug-log-row:last-child {
    border-bottom: none;
}

.ai-debug-log-row--info { color: var(--pf-text-soft); }
.ai-debug-log-row--warn { color: #fbbf24; background: rgba(251,191,36,0.04); }
.ai-debug-log-row--error { color: #f87171; background: rgba(248,113,113,0.05); }

.ai-debug-log-time {
    color: var(--pf-text-muted);
    font-family: monospace;
    font-size: 0.75rem;
}

.ai-debug-log-level {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    opacity: 0.7;
}

.ai-debug-log-source {
    color: var(--pf-text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-debug-log-msg {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ai-debug-log-dur {
    font-size: 0.72rem;
    color: var(--pf-text-muted);
    background: rgba(255,255,255,0.06);
    padding: 0 4px;
    border-radius: 3px;
}

.ai-debug-log-detail {
    grid-column: 2 / -1;
    font-size: 0.75rem;
    color: var(--pf-text-muted);
    font-family: monospace;
    padding-left: 0.25rem;
}

/* Modell-Diagnose */
.ai-debug-model-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 900px) {
    .ai-debug-model-cols {
        grid-template-columns: 1fr;
    }
}

.ai-debug-col-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--pf-text-muted);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.ai-debug-model-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.3rem 0.5rem;
    border-radius: 5px;
    font-size: 0.8rem;
    gap: 0.5rem;
}

.ai-debug-model-row:nth-child(even) {
    background: rgba(255,255,255,0.02);
}

.ai-debug-model-row--default {
    color: #fbbf24;
}

.ai-debug-model-row--missing {
    color: #f87171;
    opacity: 0.85;
}

.ai-debug-model-row small {
    color: var(--pf-text-muted);
    font-size: 0.72rem;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .ai-debug-log-row {
        grid-template-columns: 60px 40px 1fr;
    }
    .ai-debug-log-source {
        display: none;
    }
    .ai-debug-log-detail {
        grid-column: 2 / -1;
    }
    .ai-debug-status-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =========================================================
   KI-Aktionen Verwaltungsseite
   ========================================================= */

.form-row-two {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 16px;
    align-items: start;
}

.ai-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    transition: color var(--pf-transition);
    padding: 2px 6px;
}

.ai-toggle-btn--on {
    color: var(--pf-success, #22C55E);
}

.ai-toggle-btn--off {
    color: var(--pf-text-muted, #A1A1AA);
}

.ai-toggle-btn--on:hover {
    color: #16A34A;
}

.ai-toggle-btn--off:hover {
    color: var(--pf-text, #F9FAFB);
}

.ai-order-buttons {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.ai-action-row--system td:first-child::after {
    content: '';
}

.ai-action-row--system {
    opacity: 0.85;
}

.mb-24 {
    margin-bottom: 24px;
}
