/* mud_spacetime/web/static/spacetime.css */
/* Weathered Iron, Quarried Stone, Deep Loam & Antique Bronze Earthen Theme */

:root {
    /* EARTHEN & TERRAIN BACKGROUNDS */
    --bg-void: #090807;          /* Deepest earthen bedrock */
    --bg-main: #110f0d;          /* Dark peat / basalt floor */
    --bg-panel: #181512;         /* Weathered stone panel */
    --bg-card: #201c18;          /* Quarried granite / dark loam */
    --bg-card-hover: #29241f;    /* Warm rich soil hover */
    --bg-input: #13110e;         /* Chiseled stone depression */
    
    /* WEATHERED METALS & STONE BORDERS */
    --border-color: #383229;     /* Iron seam */
    --border-crimson: #4a1f22;   /* Dried oxblood iron */
    --border-glow: rgba(138, 111, 76, 0.2); /* Subtle warm bronze glow */
    --iron-dark: #24211d;        /* Forged cast iron */
    --iron-border: #3b352d;      /* Weathered iron plate seam */
    --iron-highlight: #524a3f;   /* Steel edge highlight */
    --steel: #70675a;            /* Cold tool steel */
    --bronze: #8a6f4c;           /* Antique cast bronze */
    --bronze-bright: #c4a57a;    /* Burnished bronze trim */
    --bronze-border: #5e4a32;    /* Dark bronze bezel */
    --copper: #945738;           /* Hammered copper rivet */
    
    /* NEUTRALIZED NOBLE TONES (Antique bronze instead of garish yellow) */
    --gold: #8a6f4c;             /* Antique bronze */
    --gold-bright: #c4a57a;      /* Burnished bronze highlight */
    --amber: #946b3f;            /* Warm earthen resin */
    
    /* PARCHMENT & WEATHERED BONE TYPOGRAPHY */
    --text-main: #e6e0d6;        /* Bleached parchment / aged bone */
    --text-muted: #a69c8e;       /* Dry river silt / flax */
    --text-dark: #706759;        /* Ash / weathered slate */
    
    /* ========================================================================= */
    /* THE 4 REVERED VITAL POPS (RESERVED EXCLUSIVELY FOR VITAL GAUGES & STATUS) */
    /* ========================================================================= */
    --stat-hp: #dc2626;          /* Crimson / Blood Vitality */
    --stat-hp-glow: rgba(220, 38, 38, 0.55);
    --stat-mp: #2563eb;          /* Arcane Cerulean / Deep Indigo */
    --stat-mp-glow: rgba(37, 99, 235, 0.55);
    --stat-stamina: #10b981;     /* Vigor Viridian / Mountain Green */
    --stat-stamina-glow: rgba(16, 185, 129, 0.55);
    --stat-spirit: #7c3aed;      /* Sacred Astral Violet / Spirit Radiance */
    --stat-spirit-glow: rgba(124, 58, 237, 0.55);
    
    /* VITAL FILL GRADIENTS */
    --hp-gradient: linear-gradient(90deg, #7f1d1d 0%, #dc2626 65%, #ef4444 100%);
    --mp-gradient: linear-gradient(90deg, #1e3a8a 0%, #2563eb 65%, #38bdf8 100%);
    --st-gradient: linear-gradient(90deg, #064e3b 0%, #059669 65%, #34d399 100%);
    --sp-gradient: linear-gradient(90deg, #581c87 0%, #7c3aed 65%, #c084fc 100%);
    
    --font-heading: 'Cinzel', serif;
    --font-body: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* APP CONTAINER */
#app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
}

/* TOP STATUS BAR */
#top-bar {
    height: 54px;
    background: linear-gradient(180deg, #1b191d 0%, #121114 100%);
    border-bottom: 2px solid #422024;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.75rem;
    gap: 0.75rem;
    z-index: 40;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.realm-title {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.15rem;
    letter-spacing: 0.12em;
    color: var(--gold-bright);
    text-shadow: 0 0 12px rgba(194, 155, 56, 0.25);
}

.engine-badge {
    font-size: 0.7rem;
    font-weight: 600;
    background: #1f1d22;
    color: var(--text-muted);
    border: 1px solid #38333a;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--text-muted);
    background: #111013;
    border: 1px solid #2e2a30;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.status-label-compact {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d97706;
    box-shadow: 0 0 6px #d97706;
    transition: all 0.3s;
    flex-shrink: 0;
}

.status-indicator.connected .status-dot {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.player-summary {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

.character-plaque {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: #121114;
    border: 1px solid #352f36;
    padding: 4px 10px;
    border-radius: 4px;
}

.summary-item {
    font-size: 0.78rem;
    display: flex;
    align-items: baseline;
    gap: 4px;
    white-space: nowrap;
}

.summary-label {
    color: var(--text-dark);
}

.summary-val {
    font-weight: 700;
    color: var(--text-main);
    font-family: var(--font-heading);
}

.summary-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.character-name-plate {
    cursor: pointer;
    transition: all 0.16s ease;
    padding: 2px 6px;
    border-radius: 4px;
}

.character-name-plate:hover {
    background: rgba(212, 163, 89, 0.14);
}

.character-name-plate:hover .summary-val {
    color: var(--gold-bright);
    text-shadow: 0 0 6px rgba(212, 163, 89, 0.5);
}

.character-name-plate:hover .summary-sub {
    color: var(--text-main);
}

.purse-badge {
    padding-left: 8px;
    padding-right: 6px;
    border-left: 1px solid #2e2a30;
    cursor: pointer;
    transition: all 0.16s ease;
    border-radius: 4px;
}

.purse-badge:hover {
    background: rgba(212, 163, 89, 0.16);
}

.purse-badge:hover .summary-val.gold {
    color: #ffe066;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.65);
}

.summary-val.gold {
    color: var(--gold-bright);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

/* MAIN DUAL-PANEL LAYOUT */
#main-view {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* LEFT SIDEBAR (WIDGETS) */
#left-sidebar {
    width: 300px;
    background: #100f12;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 0.35rem 0.4rem;
    gap: 0.35rem;
}

#left-sidebar::-webkit-scrollbar {
    width: 4px;
}
#left-sidebar::-webkit-scrollbar-thumb {
    background: #3a343b;
    border-radius: 2px;
}

.widget {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-top: 1px solid rgba(212, 175, 55, 0.45);
    border-radius: 4px;
    padding: 0.35rem 0.5rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: all 0.15s ease;
}

.widget-title {
    font-size: 0.68rem;
    font-weight: 700;
    font-family: var(--font-heading);
    color: #d6cec2;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge {
    font-size: 0.63rem;
    font-weight: 700;
    font-family: var(--font-mono);
    padding: 1px 6px;
    border-radius: 3px;
    background: #232126;
    color: var(--text-muted);
    border: 1px solid #38333b;
}

.badge.ok {
    background: rgba(16, 185, 129, 0.14);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.35);
}

.badge.warning {
    background: rgba(217, 119, 6, 0.18);
    color: #fbbf24;
    border-color: rgba(217, 119, 6, 0.4);
}

.badge.danger {
    background: rgba(185, 28, 28, 0.25);
    color: #fca5a5;
    border-color: #991b1b;
}

/* MINIMAP & CARTOGRAPHY RADAR */
.map-container {
    background: radial-gradient(circle at center, #141722 0%, #07080c 100%);
    border: 1px solid #2c3344;
    border-radius: 6px;
    padding: 4px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: relative;
    box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.75);
}

#map-svg {
    width: 100%;
    height: 185px;
    display: block;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8));
    user-select: none;
}

/* Room Nodes & Interactions */
.map-room-node {
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease;
    outline: none;
}

.map-room-node:hover {
    filter: brightness(1.3) drop-shadow(0 0 8px rgba(245, 158, 11, 0.65));
}

.map-room-node:hover .node-rect {
    stroke-width: 2.2px;
}

.map-room-node.current {
    cursor: default;
}

.map-room-node.current:hover {
    filter: none;
}

.map-room-node.fading {
    opacity: 0.58;
}

.map-room-node.fading .node-rect {
    stroke-dasharray: 4, 3;
}

.map-room-node.unknown {
    opacity: 0.35;
}

.map-room-node.unknown .node-rect {
    stroke-dasharray: 2, 2;
}

/* Current Room Animated Pulse */
@keyframes mapPulseRing {
    0% { stroke-opacity: 0.9; stroke-width: 2px; }
    50% { stroke-opacity: 0.2; stroke-width: 4.5px; }
    100% { stroke-opacity: 0.9; stroke-width: 2px; }
}

.current-room-pulse {
    animation: mapPulseRing 2.6s ease-in-out infinite;
    pointer-events: none;
}

/* Path Connectors */
.map-path-line {
    stroke-linecap: round;
    transition: stroke 0.2s ease, opacity 0.2s ease;
    pointer-events: none;
}

/* Direction Badges */
.map-dir-badge {
    font-family: var(--font-mono);
    font-size: 8px;
    font-weight: 700;
    pointer-events: none;
    text-shadow: 0 1px 2px #000;
}

/* Inspection Action Bar */
.map-inspect-bar {
    background: rgba(14, 18, 27, 0.96);
    border: 1px solid #334155;
    border-top: 2px solid var(--gold);
    border-radius: 4px;
    padding: 5px 6px;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.15s ease;
}

.map-inspect-bar.hidden {
    display: none !important;
}

.map-inspect-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.68rem;
    gap: 4px;
}

.map-inspect-dir {
    color: var(--gold-bright);
    font-weight: 700;
    font-family: var(--font-mono);
    flex-shrink: 0;
}

.map-inspect-title {
    color: #f1f5f9;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.map-inspect-status {
    font-size: 0.62rem;
    color: #94a3b8;
    font-style: italic;
    flex-shrink: 0;
}

.map-inspect-actions {
    display: flex;
    gap: 3px;
    width: 100%;
}

.map-btn {
    flex: 1;
    padding: 3px 2px;
    font-size: 0.64rem;
    font-family: var(--font-mono);
    border-radius: 3px;
    border: 1px solid #3b4252;
    background: #19202f;
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.map-btn:hover {
    background: #253147;
    border-color: var(--gold);
    color: #fff;
    transform: translateY(-1px);
}

.map-btn.map-btn-move {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    font-weight: 600;
}

.map-btn.map-btn-move:hover {
    background: rgba(59, 130, 246, 0.45);
    border-color: #60a5fa;
    color: #fff;
}

.map-btn.map-btn-dir {
    border-color: #d97706;
    background: rgba(217, 119, 6, 0.22);
    color: #fde047;
    font-weight: 700;
}

.map-btn.map-btn-dir:hover {
    background: rgba(217, 119, 6, 0.48);
    border-color: #facc15;
    color: #fff;
}

.map-btn.map-btn-see {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
}

.map-btn.map-btn-see:hover {
    background: rgba(139, 92, 246, 0.35);
    color: #fff;
}

.map-btn.map-btn-listen {
    border-color: #06b6d4;
    background: rgba(6, 182, 212, 0.15);
    color: #67e8f9;
}

.map-btn.map-btn-listen:hover {
    background: rgba(6, 182, 212, 0.35);
    color: #fff;
}

.map-btn.map-btn-smell {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

.map-btn.map-btn-smell:hover {
    background: rgba(16, 185, 129, 0.35);
    color: #fff;
}

/* Minimap Footer & Memory Tags */
#map-footer {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.7rem;
    margin-top: 4px;
    padding-top: 3px;
    border-top: 1px solid #1e2433;
}

.map-footer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.map-footer-sub {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.62rem;
    font-family: var(--font-mono);
}

.map-terrain-tag {
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.04);
    padding: 1px 4px;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.map-memory-status {
    color: var(--amber);
}

#map-room-name {
    color: var(--text-main);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Map Header Legend Toggle Button */
.map-legend-btn {
    background: rgba(217, 119, 6, 0.18);
    border: 1px solid #d97706;
    color: #fde047;
    cursor: pointer;
    font-size: 0.65rem;
    font-family: var(--font-mono);
    padding: 1px 6px;
    border-radius: 3px;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.map-legend-btn:hover {
    background: rgba(217, 119, 6, 0.45);
    border-color: #facc15;
    color: #fff;
    transform: translateY(-1px);
}

/* Vertical Exits Bar (Different Z-Levels) */
.map-vertical-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 3px 6px;
    background: rgba(15, 23, 42, 0.88);
    border-bottom: 1px solid #28334a;
    border-radius: 4px 4px 0 0;
    align-items: center;
    font-size: 0.65rem;
    font-family: var(--font-mono);
    margin-bottom: 2px;
}

.map-vertical-bar.hidden {
    display: none !important;
}

.map-vertical-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid #475569;
    color: #cbd5e1;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.map-vertical-chip:hover {
    border-color: var(--gold);
    background: rgba(51, 65, 85, 0.95);
    color: #fff;
}

.map-vertical-chip .chip-dir-btn {
    background: rgba(217, 119, 6, 0.3);
    border: 1px solid #d97706;
    color: #fde047;
    border-radius: 2px;
    padding: 0 4px;
    font-size: 0.6rem;
    cursor: pointer;
    font-weight: 700;
}

.map-vertical-chip .chip-dir-btn:hover {
    background: #d97706;
    color: #fff;
}

/* Building Symbols Legend & DIR Directory Panel */
.map-legend-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 13, 20, 0.96);
    backdrop-filter: blur(8px);
    border-radius: 6px;
    z-index: 40;
    display: flex;
    flex-direction: column;
    padding: 7px 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.85);
    border: 1px solid var(--gold);
}

.map-legend-panel.hidden {
    display: none !important;
}

.map-legend-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid #28334a;
    padding-bottom: 4px;
    margin-bottom: 5px;
    gap: 6px;
}

.map-legend-title span:first-child {
    display: block;
    font-family: var(--font-heading);
    color: var(--gold-bright);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.map-legend-sub {
    font-size: 0.58rem;
    color: #94a3b8;
    font-style: italic;
    display: block;
    margin-top: 1px;
}

.map-legend-search-row {
    margin-bottom: 5px;
}

.map-legend-search-row input {
    width: 100%;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 3px;
    padding: 3px 6px;
    font-size: 0.66rem;
    color: #f1f5f9;
    font-family: var(--font-body);
    outline: none;
    box-sizing: border-box;
}

.map-legend-search-row input:focus {
    border-color: var(--gold);
}

.map-legend-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-right: 2px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    background: rgba(22, 32, 53, 0.6);
    border: 1px solid #1e293b;
    border-radius: 4px;
    transition: all 0.15s ease;
    cursor: pointer;
}

.legend-item:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: #475569;
}

.legend-item.is-current {
    border-color: var(--gold);
    background: rgba(245, 158, 11, 0.15);
}

.legend-icon-box {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.5);
}

.legend-info {
    flex: 1;
    min-width: 0;
}

.legend-title-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.legend-name {
    font-size: 0.68rem;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.legend-badge {
    font-size: 0.54rem;
    font-family: var(--font-mono);
    padding: 0 3px;
    border-radius: 2px;
    flex-shrink: 0;
    font-weight: 700;
}

.legend-desc {
    font-size: 0.58rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.legend-dir-btn {
    flex-shrink: 0;
    background: rgba(217, 119, 6, 0.25);
    border: 1px solid #d97706;
    color: #fde047;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.legend-dir-btn:hover {
    background: #d97706;
    color: #fff;
    transform: scale(1.04);
}

/* BODY INJURY CHART */
.injury-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

#injury-svg {
    width: 82px;
    height: 92px;
    fill: none;
    stroke: #474149;
    stroke-width: 1;
}

#body-outline {
    fill: #211e24;
    stroke: #6e656f;
    stroke-width: 0.5;
}

.body-icon {
    fill: var(--text-dark);
}

.injury-actions {
    display: flex;
    gap: 4px;
    width: 100%;
}

.tiny-btn {
    flex: 1;
    background: #211e24;
    border: 1px solid #3c363e;
    color: var(--text-main);
    font-size: 0.68rem;
    padding: 4px 6px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s;
}

.tiny-btn:hover {
    background: #361c20;
    border-color: #991b1b;
    color: #fff;
}

/* VITALS HUD (POP OF COLOR RESERVED FOR VITALS) */
.vital-group {
    margin-bottom: 0.5rem;
}

.vital-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    margin-bottom: 3px;
}

.vital-group:nth-child(1) .vital-label-row span:first-child { color: #f87171; font-weight: 700; text-shadow: 0 0 8px rgba(239, 68, 68, 0.4); }
.vital-group:nth-child(2) .vital-label-row span:first-child { color: #60a5fa; font-weight: 700; text-shadow: 0 0 8px rgba(59, 130, 246, 0.4); }
.vital-group:nth-child(3) .vital-label-row span:first-child { color: #34d399; font-weight: 700; text-shadow: 0 0 8px rgba(16, 185, 129, 0.4); }
.vital-group:nth-child(4) .vital-label-row span:first-child { color: #c084fc; font-weight: 700; text-shadow: 0 0 8px rgba(168, 85, 247, 0.4); }

#hp-val { color: #fecaca; font-weight: 700; font-family: var(--font-mono); }
#mp-val { color: #bfdbfe; font-weight: 700; font-family: var(--font-mono); }
#st-val { color: #a7f3d0; font-weight: 700; font-family: var(--font-mono); }
#sp-val { color: #e9d5ff; font-weight: 700; font-family: var(--font-mono); }

.meter-bar {
    height: 7px;
    background: #151310;
    border: 1px solid #363028;
    border-radius: 3px;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.hp-fill { background: var(--hp-gradient); box-shadow: 0 0 8px rgba(220, 38, 38, 0.55); }
.mp-fill { background: var(--mp-gradient); box-shadow: 0 0 8px rgba(37, 99, 235, 0.55); }
.st-fill { background: var(--st-gradient); box-shadow: 0 0 8px rgba(16, 185, 129, 0.55); }
.sp-fill { background: var(--sp-gradient); box-shadow: 0 0 8px rgba(124, 58, 237, 0.55); }

/* EXP & MIND POOL WIDGET */
.exp-fill {
    background: linear-gradient(90deg, #d97706, #fbbf24, #f59e0b);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.55);
}
.mind-fill {
    background: linear-gradient(90deg, #6366f1, #818cf8, #a855f7);
    box-shadow: 0 0 8px rgba(129, 140, 248, 0.55);
}

.exp-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.exp-metric-card {
    background: rgba(10, 15, 26, 0.55);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 4px;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.exp-metric-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.exp-metric-val {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
}

#exp-total-val { color: var(--gold-bright); }
#exp-needed-val { color: var(--cyan); }
#exp-pulse-rate-val { color: #10b981; }
#exp-tick-rate-val { color: var(--amber); }
#exp-progress-pct { color: #fde68a; font-family: var(--font-mono); font-weight: 700; }
#exp-field-val { color: #c4b5fd; font-family: var(--font-mono); font-weight: 700; }

/* COMPASS */
.compass-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.compass-grid {
    display: grid;
    grid-template-columns: repeat(3, 38px);
    grid-template-rows: repeat(3, 30px);
    gap: 4px;
}

.compass-btn {
    background: #211f24;
    border: 1px solid #3b363e;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.compass-btn:hover {
    background: #3b1c20;
    color: var(--gold-bright);
    border-color: #991b1b;
}

.compass-btn.center-btn {
    background: #2b1d20;
    border-color: #6b262b;
    color: var(--gold);
    font-size: 0.85rem;
}

.elevation-btns {
    display: flex;
    gap: 4px;
    width: 100%;
}

.compass-btn.alt-btn {
    flex: 1;
    font-size: 0.64rem;
    height: 24px;
}

.exits-tagline {
    font-size: 0.7rem;
    color: var(--text-dark);
    display: flex;
    gap: 4px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.highlight-exits {
    color: var(--gold);
    font-weight: 600;
}

/* TACTICS */
.tactic-row {
    margin-bottom: 0.45rem;
    font-size: 0.7rem;
}

.tactic-row label {
    display: block;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.st-select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 4px 6px;
    border-radius: 3px;
    font-size: 0.73rem;
}

.posture-buttons {
    display: flex;
    gap: 4px;
}

.posture-btn {
    flex: 1;
    background: #211f24;
    border: 1px solid #3b363e;
    color: var(--text-muted);
    font-size: 0.66rem;
    padding: 4px 0;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s;
}

.posture-btn:hover {
    border-color: #7f1d1d;
    color: var(--text-main);
}

.posture-btn.active {
    background: linear-gradient(180deg, #7f1d1d, #581316);
    color: #f5f5f4;
    font-weight: 700;
    border-color: #b91c1c;
}

.combat-ratings {
    display: flex;
    gap: 6px;
    margin-top: 5px;
}

.rating-box {
    flex: 1;
    background: #100f12;
    border: 1px solid #2e2a31;
    padding: 4px 6px;
    border-radius: 3px;
    font-size: 0.68rem;
    display: flex;
    justify-content: space-between;
}

.rate-val {
    font-weight: 700;
    color: var(--gold-bright);
    font-family: var(--font-mono);
}

/* SURROUNDINGS (SELF-TRUNCATING & INTERNALLY SCROLLABLE) */
.vicinity-scroll-body {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.surroundings-section {
    margin-bottom: 0;
}

.surround-header {
    font-size: 0.66rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.surround-count {
    font-family: var(--font-mono);
    color: var(--text-dark);
    font-size: 0.62rem;
}

.surround-list {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.surround-scroll-box {
    background: #0e0d10;
    border: 1px solid #29252b;
    border-radius: 4px;
    padding: 3px 6px;
    overflow-y: auto;
    overflow-x: hidden;
}

.surround-scroll-box.creatures-scroll {
    max-height: 86px;
}

.surround-scroll-box.items-scroll {
    max-height: 132px;
}

.surround-scroll-box::-webkit-scrollbar {
    width: 4px;
}
.surround-scroll-box::-webkit-scrollbar-thumb {
    background: #47383b;
    border-radius: 2px;
}

.muted-notice {
    font-style: italic;
    color: #5c5752;
    font-size: 0.68rem;
}

/* CENTER TERMINAL */
#terminal-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #0b0b0d;
}

.room-image-banner {
    height: 60px;
    background: linear-gradient(135deg, #21191b 0%, #151417 60%, #0f0e11 100%);
    border-bottom: 1px solid #422225;
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 1.15rem;
}

.room-image-overlay {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.room-banner-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.room-badge-zone {
    font-size: 0.62rem;
    color: #d97706;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.celestial-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--gold-bright, #fef08a);
    background: rgba(22, 17, 26, 0.85);
    border: 1px solid rgba(217, 119, 6, 0.4);
    box-shadow: 0 0 8px rgba(217, 119, 6, 0.15);
    padding: 2px 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.celestial-badge-pill:hover {
    background: rgba(45, 26, 20, 0.95);
    border-color: var(--amber, #f59e0b);
    transform: translateY(-1px);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
}

.celestial-divider {
    color: #78716c;
}

.room-banner-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: #ebe6de;
}

#terminal-screen {
    flex: 1;
    overflow-y: auto;
    padding: 0.9rem 1.1rem;
    font-family: var(--font-mono);
    font-size: 0.84rem;
    line-height: 1.55;
    outline: none;
}

#terminal-screen::-webkit-scrollbar {
    width: 6px;
}
#terminal-screen::-webkit-scrollbar-thumb {
    background: #383238;
    border-radius: 3px;
}

.terminal-welcome {
    margin-bottom: 0.85rem;
    color: var(--text-dark);
}

.ascii-art {
    font-size: 0.65rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.welcome-text {
    font-size: 0.76rem;
}

.cmd-chip {
    background: #241f24;
    border: 1px solid #3d3339;
    color: var(--gold-bright);
    padding: 1px 6px;
    border-radius: 3px;
}

.log-entry {
    margin-bottom: 0.5rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.log-title {
    color: var(--gold);
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.msg-input {
    color: var(--gold-bright, #fcd34d);
    font-weight: 600;
}
.msg-system { color: #f5f5f4; }
.msg-combat { color: #f5f5f4; }
.msg-look { color: #f5f5f4; }
.msg-say { color: #e9d5ff; }
.msg-celestial_say, .msg-celestial {
    color: #e0f2fe;
    text-shadow: 0 0 8px rgba(56, 189, 248, 0.5), 0 0 16px rgba(168, 85, 247, 0.35);
    border-left: 2px solid #38bdf8;
    padding-left: 0.35rem;
    margin: 0.2rem 0;
}
.msg-whisper { color: #a5f3fc; }
.msg-shout { color: #fde68a; }
.msg-stats { color: #f5f5f4; }
.msg-error { color: #f87171; }
.msg-warning { color: #fbbf24; }
.msg-info { color: #f5f5f4; }
.msg-movement { color: #f5f5f4; }
.msg-training { color: #a7f3d0; }
.msg-tour {
    color: #fef08a;
    background: rgba(254, 240, 138, 0.05);
    border-left: 2px solid rgba(254, 240, 138, 0.4);
    padding: 0.35rem 0.5rem;
    margin: 0.35rem 0;
    border-radius: 2px;
}
.msg-environment { 
    color: #93c5fd; 
    font-style: italic; 
    opacity: 0.92;
    padding-left: 0.25rem;
    border-left: 2px solid rgba(147, 197, 253, 0.4);
    margin: 0.35rem 0;
}
.msg-ambient {
    color: #a5b4fc;
    font-style: italic;
    opacity: 0.88;
}

/* CINEMATIC ARRIVAL NARRATIVE */
.msg-cinematic {
    color: #f5eedc;
    font-size: 1.05rem;
    line-height: 1.65;
    padding: 0.65rem 0.95rem;
    margin: 0.6rem 0;
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.09) 0%, rgba(17, 23, 38, 0.45) 100%);
    border-left: 3px solid rgba(212, 175, 55, 0.75);
    border-radius: 0 4px 4px 0;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
    animation: cinematicFadeIn 1.6s ease-out;
}

.cinematic-header {
    color: #ffd700;
    font-family: var(--font-heading, 'Cinzel', serif);
    font-weight: 700;
    letter-spacing: 0.06em;
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.16) 0%, rgba(17, 23, 38, 0.75) 50%, rgba(212, 175, 55, 0.16) 100%);
    border-top: 1px solid rgba(212, 175, 55, 0.4);
    border-bottom: 1px solid rgba(212, 175, 55, 0.4);
    border-left: none;
    text-align: center;
    padding: 0.75rem 1rem;
    margin: 0.85rem 0;
}

@keyframes cinematicFadeIn {
    0% {
        opacity: 0;
        transform: translateY(8px);
        filter: blur(2px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* ENTITY HIGHLIGHTING & INTERACTIVE HOVER PILLS */
.entity-player {
    color: #f8fafc;
    font-weight: 700;
    background: rgba(248, 250, 252, 0.12);
    border-bottom: 2px solid #94a3b8;
    padding: 1px 5px;
    border-radius: 4px;
    cursor: pointer;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 4px rgba(248, 250, 252, 0.1);
    transition: all 0.14s ease;
    display: inline-block;
    line-height: 1.25;
}
.entity-player:hover {
    background: rgba(248, 250, 252, 0.28);
    color: #ffffff;
    border-bottom-color: #f1f5f9;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

.entity-npc {
    color: #fde047 !important;
    font-weight: 700;
    background: rgba(250, 204, 21, 0.16);
    border-bottom: 2px solid #facc15;
    padding: 1px 5px;
    border-radius: 4px;
    cursor: pointer;
    text-shadow: 0 0 8px rgba(250, 204, 21, 0.45);
    box-shadow: 0 0 4px rgba(250, 204, 21, 0.15);
    transition: all 0.14s ease;
    display: inline-block;
    line-height: 1.25;
}
.entity-npc:hover {
    background: rgba(250, 204, 21, 0.32);
    color: #ffffff !important;
    border-bottom-color: #fef08a;
    text-shadow: 0 0 12px rgba(253, 224, 71, 0.7);
    box-shadow: 0 0 8px rgba(250, 204, 21, 0.4);
}

.entity-mob {
    color: #f87171 !important;
    font-weight: 700;
    background: rgba(239, 68, 68, 0.16);
    border-bottom: 2px solid #ef4444;
    padding: 1px 5px;
    border-radius: 4px;
    cursor: pointer;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.45);
    box-shadow: 0 0 4px rgba(239, 68, 68, 0.15);
    transition: all 0.14s ease;
    display: inline-block;
    line-height: 1.25;
}
.entity-mob:hover {
    background: rgba(239, 68, 68, 0.32);
    color: #ffffff !important;
    border-bottom-color: #fca5a5;
    text-shadow: 0 0 12px rgba(239, 68, 68, 0.7);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.entity-item {
    color: #38bdf8 !important;
    font-weight: 600;
    background: rgba(56, 189, 248, 0.12);
    border-bottom: 1.5px solid #38bdf8;
    padding: 1px 4px;
    border-radius: 4px;
    cursor: pointer;
    text-shadow: 0 0 6px rgba(56, 189, 248, 0.35);
    box-shadow: 0 0 4px rgba(56, 189, 248, 0.1);
    transition: all 0.14s ease;
    display: inline-block;
    line-height: 1.25;
}
.entity-item:hover {
    background: rgba(56, 189, 248, 0.25);
    color: #e0f2fe !important;
    border-bottom-color: #7dd3fc;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

.entity-prop {
    color: #c084fc !important;
    font-weight: 600;
    background: rgba(192, 132, 252, 0.12);
    border-bottom: 1.5px solid #c084fc;
    padding: 1px 4px;
    border-radius: 4px;
    cursor: pointer;
    text-shadow: 0 0 6px rgba(192, 132, 252, 0.35);
    box-shadow: 0 0 4px rgba(192, 132, 252, 0.1);
    transition: all 0.14s ease;
    display: inline-block;
    line-height: 1.25;
}
.entity-prop:hover {
    background: rgba(192, 132, 252, 0.25);
    color: #f3e8ff !important;
    border-bottom-color: #e9d5ff;
}

.entity-node {
    color: #4ade80 !important;
    font-weight: 600;
    background: rgba(74, 222, 128, 0.12);
    border-bottom: 1.5px solid #4ade80;
    padding: 1px 4px;
    border-radius: 4px;
    cursor: pointer;
    text-shadow: 0 0 6px rgba(74, 222, 128, 0.35);
    box-shadow: 0 0 4px rgba(74, 222, 128, 0.1);
    transition: all 0.14s ease;
    display: inline-block;
    line-height: 1.25;
}
.entity-node:hover {
    background: rgba(74, 222, 128, 0.25);
    color: #bbf7d0 !important;
    border-bottom-color: #86efac;
}

.entity-residue {
    color: #fb923c !important;
    font-weight: 600;
    background: rgba(251, 146, 60, 0.12);
    border-bottom: 1.5px solid #fb923c;
    padding: 1px 4px;
    border-radius: 4px;
    cursor: pointer;
    text-shadow: 0 0 6px rgba(251, 146, 60, 0.35);
    box-shadow: 0 0 4px rgba(251, 146, 60, 0.1);
    transition: all 0.14s ease;
    display: inline-block;
    line-height: 1.25;
}
.entity-residue:hover {
    background: rgba(251, 146, 60, 0.25);
    color: #fed7aa !important;
    border-bottom-color: #fdba74;
}

.stat-calc-pill {
    color: #fde68a;
    font-weight: 700;
    background: rgba(234, 179, 8, 0.12);
    border-bottom: 1px dashed rgba(253, 230, 138, 0.75);
    padding: 0 4px;
    border-radius: 3px;
    cursor: help;
    transition: background 0.14s ease;
}
.stat-calc-pill:hover {
    background: rgba(234, 179, 8, 0.28);
    color: #ffffff;
}

.exit-link {
    color: var(--cyan, #38bdf8);
    font-weight: 700;
    background: rgba(56, 189, 248, 0.08);
    border-bottom: 1px dotted rgba(56, 189, 248, 0.6);
    padding: 0 4px;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.15s ease;
}
.exit-link:hover {
    color: var(--gold-bright, #fef08a);
    background: rgba(56, 189, 248, 0.25);
    border-bottom-color: var(--gold-bright, #fef08a);
    text-shadow: 0 0 8px rgba(254, 240, 138, 0.4);
    transform: translateY(-1px);
}

.cmd-pill {
    display: inline-block;
    color: #fde047 !important;
    background: rgba(250, 204, 21, 0.18);
    border: 1.5px solid #facc15;
    border-radius: 4px;
    padding: 1px 7px;
    font-weight: 800;
    font-size: 0.88em;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(250, 204, 21, 0.3);
    text-shadow: 0 0 6px rgba(250, 204, 21, 0.5);
    transition: all 0.15s ease;
    user-select: none;
    letter-spacing: 0.6px;
    vertical-align: baseline;
    margin: 0 2px;
    pointer-events: auto !important;
    position: relative;
    z-index: 2;
}
.cmd-pill:hover {
    color: #ffffff !important;
    background: rgba(250, 204, 21, 0.4);
    border-color: #fef08a;
    box-shadow: 0 0 12px rgba(250, 204, 21, 0.7);
    transform: translateY(-1px);
}
.cmd-pill:active {
    transform: translateY(0);
    box-shadow: 0 0 4px rgba(250, 204, 21, 0.4);
}
.exit-link:active {
    transform: translateY(1px);
}

#entity-hover-card {
    position: fixed;
    z-index: 9999;
    min-width: 280px;
    max-width: 440px;
    max-height: min(85vh, 640px);
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #1b181f 0%, #110f14 100%);
    border: 1px solid #8a6d2f;
    border-radius: 6px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.85);
    padding: 0.65rem 0.8rem;
    color: #f5f5f4;
    font-family: var(--font-body);
    font-size: 0.78rem;
    line-height: 1.45;
    pointer-events: auto;
    box-sizing: border-box;
}
#entity-hover-card.hidden {
    display: none;
}
.hover-card-hdr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(138, 109, 47, 0.4);
    padding-bottom: 4px;
    margin-bottom: 6px;
    flex-shrink: 0;
}
.hover-card-title {
    font-family: var(--font-heading);
    font-weight: 700;
    color: #fdf8f0;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hover-card-badge {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 3px;
    background: rgba(234, 179, 8, 0.18);
    color: #fde68a;
    border: 1px solid rgba(234, 179, 8, 0.4);
    flex-shrink: 0;
}
.hover-card-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted, #94a3b8);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    margin-left: 6px;
    border-radius: 3px;
    transition: color 0.15s ease, background 0.15s ease;
}
.hover-card-close-btn:hover {
    color: var(--gold-bright, #facc15);
    background: rgba(255, 255, 255, 0.08);
}
.hover-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px 10px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    margin-bottom: 6px;
    flex-shrink: 0;
}
.hover-card-desc {
    font-size: 0.72rem;
    color: #cbd5e1;
    line-height: 1.45;
    margin: 4px 0 6px 0;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
    flex: 1 1 auto;
}
.hover-card-divider {
    border: none;
    border-top: 1px solid rgba(212, 175, 55, 0.35);
    margin: 6px 0;
}
.hover-card-p-gap {
    height: 6px;
}
.hover-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}
.hover-act-btn {
    background: #232029;
    border: 1px solid #4a3f4d;
    color: #f5f5f4;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: 3px;
    cursor: pointer;
}
.hover-act-btn:hover {
    border-color: #eab308;
    color: #fde68a;
}

.console-mode-toggle {
    background: #1f1c24;
    border: 1px solid #453c4a;
    color: #fde68a;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.82rem;
    padding: 0 10px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 6px;
    user-select: none;
}
.console-mode-toggle.chat-mode {
    background: rgba(168, 85, 247, 0.2);
    border-color: #a855f7;
    color: #e9d5ff;
}

/* LOWER ACTION BAR (VERTICAL ICON ABOVE BUTTON NAME) */
#macro-bar {
    height: 48px;
    background: linear-gradient(180deg, #19181b 0%, #121114 100%);
    border-top: 1px solid #3a292c;
    display: flex;
    align-items: center;
    padding: 0 0.65rem;
    gap: 5px;
    position: relative;
    z-index: 25;
}

.macro-chip.macro-stack-btn {
    background: #1f1d22;
    border: 1px solid #363238;
    color: var(--text-main);
    min-width: 54px;
    height: 38px;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.14s ease;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    user-select: none;
}

.macro-chip.macro-stack-btn .macro-icon {
    font-size: 0.92rem;
    line-height: 1.05;
}

.macro-chip.macro-stack-btn .macro-label {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #c7c2ba;
    line-height: 1;
    white-space: nowrap;
}

.macro-chip.macro-stack-btn:hover {
    background: #2f1d21;
    border-color: #991b1b;
    transform: translateY(-1px);
}

.macro-chip.macro-stack-btn:hover .macro-label {
    color: var(--gold-bright);
}

.macro-chip.macro-stack-btn.crimson-accent {
    background: linear-gradient(180deg, #471519 0%, #291013 100%);
    border-color: #881b20;
}

.macro-chip.macro-stack-btn.crimson-accent .macro-label {
    color: #fca5a5;
}

.macro-chip.macro-stack-btn.crimson-accent:hover {
    background: linear-gradient(180deg, #631c21 0%, #3b1317 100%);
    border-color: #dc2626;
}

.macro-chip.macro-stack-btn.active-rest {
    background: linear-gradient(180deg, #1e3a2f 0%, #11221c 100%);
    border-color: #10b981;
}

.macro-chip.macro-stack-btn.active-rest .macro-label {
    color: #6ee7b7;
}

.macro-spacer {
    flex: 1;
}

/* LOWER BAR SETTINGS POPOVER */
.macro-settings-wrapper {
    position: relative;
}

.macro-settings-popover {
    position: absolute;
    bottom: 44px;
    right: 0;
    width: 185px;
    background: #18161a;
    border: 1px solid #572529;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.9);
    border-radius: 5px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 80;
}

.macro-settings-popover.hidden {
    display: none !important;
}

.popover-title {
    font-family: var(--font-heading);
    font-size: 0.64rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 4px 4px;
    border-bottom: 1px solid #2e2930;
    margin-bottom: 2px;
}

.popover-action-btn {
    background: #221f26;
    border: 1px solid #36313a;
    color: var(--text-main);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 5px 8px;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    transition: all 0.14s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.popover-action-btn:hover {
    background: #381d21;
    border-color: #991b1b;
    color: var(--gold-bright);
}

.popover-action-btn.toggle-active {
    border-color: var(--gold);
    color: var(--gold-bright);
}

/* CONSOLE BAR */
#console-bar {
    height: 44px;
    background: #100f12;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    gap: 8px;
}

.console-prompt {
    font-family: var(--font-mono);
    color: #b91c1c;
    font-size: 1.1rem;
    font-weight: 700;
}

#command-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid #353038;
    color: var(--text-main);
    padding: 6px 10px;
    font-family: var(--font-mono);
    font-size: 0.84rem;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.2s;
}

#command-input:focus {
    border-color: #991b1b;
    box-shadow: 0 0 0 1px rgba(185, 28, 28, 0.25);
}

.send-button {
    background: linear-gradient(180deg, #881b20 0%, #5e1316 100%);
    color: #f5f5f4;
    border: 1px solid #b91c1c;
    font-size: 0.76rem;
    font-weight: 700;
    font-family: var(--font-heading);
    letter-spacing: 0.05em;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.send-button:hover {
    background: linear-gradient(180deg, #a32026 0%, #75171b 100%);
}

/* ================================================================= */
/* CHARACTER CREATION MODAL & 12-STAT BUILDER STYLING                */
/* ================================================================= */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 7, 14, 0.85);
    backdrop-filter: blur(6px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-backdrop.hidden {
    display: none;
}

.hidden {
    display: none !important;
}

.modal-panel {
    background: #161411;
    border: 1px solid #3d352b;
    border-radius: 6px;
    width: 780px;
    max-width: 95vw;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 1.25rem 1.5rem 0.75rem;
    border-bottom: 1px solid #362f25;
    background: linear-gradient(180deg, #1f1b16, #161411);
    position: relative;
}

.modal-header > :first-child {
    flex: 1;
    min-width: 0;
}

.modal-header .close-btn,
.modal-header .close-modal-btn,
.modal-header .grimoire-close-btn,
.modal-header .drawer-close-btn,
.modal-header .traditions-codex-close-btn,
.modal-header-actions {
    flex-shrink: 0;
    margin-left: auto;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--gold-bright);
    letter-spacing: 0.08em;
}

.modal-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}
.modal-body::-webkit-scrollbar-thumb {
    background: #3d352b;
    border-radius: 3px;
}

.chargen-section {
    background: #181512;
    border: 1px solid #362f25;
    border-radius: 6px;
    padding: 1rem;
}

.section-heading {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--gold-bright);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.chargen-btn-group {
    display: flex;
    gap: 6px;
}

.primary-btn {
    background: linear-gradient(180deg, #3d352b 0%, #28221b 100%);
    color: #ede7dc;
    border: 1px solid #6b573d;
    border-top: 1px solid #8c714e;
    font-family: var(--font-heading);
    letter-spacing: 0.05em;
    font-size: 0.88rem;
    font-weight: 700;
    padding: 10px 24px;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.primary-btn:hover {
    background: linear-gradient(180deg, #4d4337 0%, #352c22 100%);
    border-color: #8c714e;
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.secondary-btn {
    background: #1c1915;
    border: 1px solid #4a4034;
    color: #c9bea9;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.secondary-btn:hover {
    background: #29241d;
    border-color: #6e5e4c;
    color: #ede7dc;
}

.alt-action-btn {
    background: #161411;
    border: 1px solid #363028;
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.alt-action-btn:hover {
    background: #25211b;
    border-color: #574b3d;
    color: var(--text-main);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.form-field label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 4px;
}

.form-field input, .form-field select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 8px;
    border-radius: 5px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-field input:focus, .form-field select:focus {
    border-color: var(--gold);
}

/* POOL CHIPS & ROLLER */
.pool-box {
    background: var(--bg-card);
    border: 1px dashed var(--iron-border);
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.pool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.72rem;
}

.pool-title {
    font-weight: 700;
    color: var(--bronze-bright);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pool-hint {
    color: var(--text-dark);
    font-style: italic;
    font-size: 0.68rem;
}

.pool-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 34px;
    align-items: center;
}

.pool-chip {
    background: var(--bg-card);
    border: 1px solid var(--iron-border);
    color: var(--text-main);
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 0.72rem;
    padding: 1px 2px;
    min-width: 22px;
    width: 23px;
    height: 22px;
    line-height: 18px;
    text-align: center;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pool-chip:hover {
    border-color: var(--bronze-bright);
    transform: translateY(-1px);
    background: var(--bg-card-hover);
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}

.pool-chip.selected {
    background: var(--bronze);
    color: var(--bg-void);
    border-color: var(--bronze-bright);
    box-shadow: 0 0 10px rgba(138, 111, 76, 0.6);
    transform: scale(1.08);
}

.pool-chip.used {
    opacity: 0.25;
    cursor: not-allowed;
    text-decoration: line-through;
    background: var(--bg-void);
    border-color: var(--iron-dark);
    color: var(--text-dark);
}

/* PRESETS ROW */
.presets-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.75rem;
    background: var(--bg-card);
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.preset-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.preset-chip {
    background: var(--bg-input);
    border: 1px solid var(--iron-border);
    color: var(--text-main);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.preset-chip:hover {
    background: var(--bg-card-hover);
    border-color: var(--bronze);
    color: #fff;
    transform: translateY(-1px);
}

/* 12-STAT 2X2 PILLAR GRID */
.stat-quad-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 14px;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
}

.stat-group-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
    min-height: auto;
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.86rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--iron-border);
    flex-shrink: 0;
}

.physical-group .group-header { color: #b84a4f; }
.intellectual-group .group-header { color: #6b8ea9; }
.social-group .group-header { color: #c49a62; }
.spiritual-group .group-header { color: #9e7bb8; }

.pillar-opt-btn {
    background: rgba(138, 111, 76, 0.15);
    border: 1px solid var(--iron-border);
    color: var(--bronze-bright);
    font-size: 0.65rem;
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.2;
}

.pillar-opt-btn:hover {
    background: rgba(138, 111, 76, 0.35);
    border-color: var(--bronze-bright);
    color: #fff;
    box-shadow: 0 0 6px rgba(196, 154, 98, 0.4);
}

.stat-slot {
    background: var(--bg-input);
    border: 1px solid var(--iron-border);
    border-radius: 4px;
    padding: 7px 12px;
    min-height: 46px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.stat-slot:hover {
    border-color: var(--bronze);
    background: var(--bg-card-hover);
    transform: translateY(-1px);
}

.stat-slot.active-target {
    border-color: var(--bronze-bright);
    box-shadow: 0 0 10px rgba(196, 165, 122, 0.35);
}

.stat-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.stat-meta-header {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.stat-tag {
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 0.90rem;
    color: var(--text-main);
    letter-spacing: 0.03em;
}

.stat-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}

.stat-desc {
    font-size: 0.70rem;
    color: var(--text-dark);
    font-style: italic;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-slot-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
    flex-shrink: 0;
}

.stat-bonus-badge {
    font-size: 0.78rem;
    font-family: var(--font-mono);
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 3px;
    background: rgba(138, 111, 76, 0.15);
    border: 1px solid var(--bronze-border);
    color: var(--bronze-bright);
    min-width: 24px;
    text-align: center;
}

.stat-val {
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 1.22rem;
    color: var(--bronze-bright);
    min-width: 28px;
    text-align: right;
}

.stat-val.empty {
    color: var(--text-dark);
}

.pool-summary {
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-top: 0.6rem;
    text-align: right;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.pool-summary strong {
    color: var(--gold-bright);
    font-family: var(--font-mono);
}

.summary-sep {
    color: #334155;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #1e293b;
    background: #0d121e;
    display: flex;
    justify-content: flex-end;
}

/* --- ADMIN & BUILDER STUDIO STYLING --- */

.admin-studio-badge {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(245, 158, 11, 0.3));
    border: 1px solid var(--gold);
    color: var(--gold-bright);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.76rem;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.25);
    margin-right: 12px;
}

.admin-studio-badge:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.4), rgba(245, 158, 11, 0.5));
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.5);
    transform: translateY(-1px);
}

.admin-panel {
    max-width: 1220px !important;
    width: 94vw;
    height: 86vh;
    max-height: 880px;
    background: #0f1626 !important;
    border: 1px solid #d4af37 !important;
    box-shadow: 0 0 35px rgba(212, 175, 55, 0.25), 0 20px 50px rgba(0, 0, 0, 0.85) !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0 !important;
}

.admin-header {
    border-bottom: 1px solid #273754;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #080c14;
    flex-shrink: 0;
}

.admin-title {
    color: var(--gold-bright) !important;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

.close-btn {
    background: transparent;
    border: 1px solid #334155;
    color: #94a3b8;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #f87171;
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Two-column Studio layout with left sidebar */
.admin-studio-container {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.admin-sidebar {
    width: 230px;
    min-width: 230px;
    background: #080c14;
    border-right: 1px solid #1a2333;
    display: flex;
    flex-direction: column;
    padding: 14px 10px;
    gap: 16px;
    overflow-y: auto;
    user-select: none;
    flex-shrink: 0;
}

.admin-nav-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.admin-nav-header {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold);
    padding: 4px 10px;
    margin-bottom: 2px;
    opacity: 0.85;
}

.admin-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 5px;
    border: 1px solid transparent;
    color: #94a3b8;
    font-family: var(--font-body);
    font-size: 0.84rem;
    font-weight: 500;
    text-align: left;
    width: 100%;
    cursor: pointer;
    transition: all 0.15s ease;
    background: transparent;
    text-decoration: none;
    box-sizing: border-box;
}

.admin-tab:hover {
    background: rgba(30, 41, 59, 0.65);
    color: #f8fafc;
    border-color: rgba(51, 65, 85, 0.5);
}

.admin-tab.active {
    background: rgba(212, 175, 55, 0.12);
    color: var(--gold-bright);
    border-color: rgba(212, 175, 55, 0.4);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--gold);
}

.admin-tab .tab-icon {
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    flex-shrink: 0;
}

.admin-tab .tab-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-tab.external-link .ext-arrow {
    margin-left: auto;
    font-size: 0.75rem;
    opacity: 0.6;
    color: var(--text-muted);
}

.admin-tab .fb-sidebar-badge {
    margin-left: auto;
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid var(--amber);
    color: var(--amber);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    font-family: var(--font-mono);
}

.admin-modal-body {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    min-height: 0;
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.readonly-input {
    background: #080d18 !important;
    color: var(--cyan) !important;
    font-family: var(--font-mono) !important;
    border-color: #1e293b !important;
    cursor: not-allowed;
}

.admin-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.4;
}

.checkbox-field label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-main);
    margin: 0;
}

.checkbox-field input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--gold);
    cursor: pointer;
}

.admin-action-row {
    margin-top: 1.2rem;
    display: flex;
    align-items: center;
    gap: 14px;
}

.admin-status-text {
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--cyan);
}

.admin-divider {
    border: 0;
    border-top: 1px solid #1e293b;
    margin: 16px 0;
}

#adm-export-output {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    background: #060910;
    color: #a7f3d0;
    border: 1px solid #1e293b;
    border-radius: 4px;
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
}

/* --- ADMIN STUDIO QUICK BAR & TELEMETRY PILLS --- */
.admin-quick-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-quick-pill {
    background: rgba(22, 32, 53, 0.85);
    border: 1px solid var(--border-color);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.admin-quick-pill:hover {
    border-color: var(--gold);
    color: var(--gold-bright);
    background: rgba(30, 41, 59, 0.85);
}

.admin-quick-pill.active {
    border-color: var(--gold);
    color: var(--gold-bright);
    background: rgba(212, 175, 55, 0.15);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.25);
}

.admin-quick-pill .pill-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #64748b;
    transition: all 0.2s ease;
}

.admin-quick-pill.active .pill-dot {
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
}

.admin-quick-pill.action-pill:hover {
    border-color: var(--cyan);
    color: var(--cyan);
    background: rgba(6, 182, 212, 0.12);
}

/* --- ADMIN SECTION BOXES & RADAR TABLES --- */
.admin-section-box {
    background: rgba(17, 23, 38, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 14px 16px;
    box-sizing: border-box;
}

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

.admin-section-title {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    color: var(--gold-bright);
    display: flex;
    align-items: center;
    gap: 6px;
}

.admin-table-container {
    background: rgba(10, 13, 20, 0.75);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    text-align: left;
}

.admin-table th {
    background: rgba(17, 23, 38, 0.95);
    color: var(--text-muted);
    font-weight: 600;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1;
    white-space: nowrap;
}

.admin-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(30, 41, 59, 0.5);
    color: var(--text-main);
    vertical-align: middle;
}

.admin-table tr:hover td {
    background: rgba(212, 175, 55, 0.04);
}

.adm-action-cell {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.adm-table-btn {
    padding: 2px 6px;
    font-size: 10px;
    border-radius: 3px;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 600;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    user-select: none;
    text-decoration: none;
}

.adm-btn-goto {
    background: rgba(6, 182, 212, 0.15);
    border-color: var(--cyan);
    color: var(--cyan);
}
.adm-btn-goto:hover { background: var(--cyan); color: #0a0d14; }

.adm-btn-summon {
    background: rgba(245, 158, 11, 0.15);
    border-color: var(--amber);
    color: var(--amber);
}
.adm-btn-summon:hover { background: var(--amber); color: #0a0d14; }

.adm-btn-spectate {
    background: rgba(168, 85, 247, 0.15);
    border-color: var(--purple);
    color: var(--purple);
}
.adm-btn-spectate:hover { background: var(--purple); color: #0a0d14; }

.adm-btn-inspect {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--blue);
    color: var(--blue);
}
.adm-btn-inspect:hover { background: var(--blue); color: #0a0d14; }

.adm-btn-rescue {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
    color: #10b981;
}
.adm-btn-rescue:hover { background: #10b981; color: #0a0d14; }

.adm-btn-mute {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--red);
    color: var(--red);
}
.adm-btn-mute:hover { background: var(--red); color: #0a0d14; }

.adm-btn-jail {
    background: rgba(185, 28, 28, 0.25);
    border-color: #b91c1c;
    color: #fca5a5;
}
.adm-btn-jail:hover { background: #b91c1c; color: #fff; }

/* Role & Status Badges */
.adm-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-family: var(--font-mono);
    font-weight: 600;
}

.adm-badge-player {
    background: rgba(100, 116, 139, 0.2);
    border: 1px solid #475569;
    color: #cbd5e1;
}

.adm-badge-builder {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid var(--amber);
    color: var(--amber);
}

.adm-badge-gm {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid var(--purple);
    color: var(--purple);
}

.adm-badge-admin {
    background: rgba(212, 175, 55, 0.2);
    border: 1px solid var(--gold);
    color: var(--gold-bright);
}

.adm-badge-muted {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--red);
    color: var(--red);
}

.adm-badge-jailed {
    background: rgba(185, 28, 28, 0.3);
    border: 1px solid #dc2626;
    color: #f87171;
}

.adm-badge-online {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid #10b981;
    color: #10b981;
}

.adm-badge-offline {
    background: rgba(100, 116, 139, 0.15);
    border: 1px solid #334155;
    color: #64748b;
}

/* --- USER LOGIN & REALM GATEWAY STYLES --- */
.login-panel {
    max-width: 480px;
    border: 1px solid #3b2d18;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(212, 175, 55, 0.15);
}

.login-header {
    text-align: center;
    border-bottom: 1px solid #231c12;
    padding-bottom: 1.2rem;
}

.login-emblem {
    font-size: 2.2rem;
    margin-bottom: 6px;
    filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.5));
}

.login-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--gold-bright);
    letter-spacing: 0.08em;
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.login-body {
    padding: 1.25rem 0.5rem;
}

.lan-badge {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.field-hint {
    display: block;
    font-size: 0.7rem;
    color: var(--text-dark);
    margin-top: 4px;
    line-height: 1.3;
}

.btn-block {
    width: 100%;
    padding: 11px;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

/* --- CHARACTER SELECT & ROSTER STYLES --- */
.charselect-panel {
    max-width: 780px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 35px var(--border-glow);
}

.charselect-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.charselect-account-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.charselect-account-info strong {
    color: var(--gold-bright);
    font-size: 0.95rem;
}

.charselect-body {
    padding: 1.2rem 0;
    max-height: 60vh;
    overflow-y: auto;
}

.charselect-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

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

.character-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.8rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.character-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--bronze-bright));
    opacity: 0.5;
    transition: opacity 0.2s;
}

.character-card:hover {
    border-color: var(--bronze-bright);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 16px rgba(196, 165, 122, 0.25);
}

.character-card:hover::before {
    opacity: 1;
}

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

.char-title-name {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gold-bright);
}

.char-title-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.char-level-badge {
    background: var(--bg-void);
    border: 1px solid var(--iron-border);
    color: var(--bronze-bright);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 4px;
}

.char-stats-mini {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    background: var(--bg-input);
    padding: 6px 8px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
}

.mini-stat-item {
    font-size: 0.68rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.mini-stat-item strong {
    color: var(--text-main);
}

.char-location-tag {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.card-btn-embark {
    flex: 1;
    background: linear-gradient(180deg, #3d352b 0%, #28221b 100%);
    color: #ede7dc;
    border: 1px solid #6b573d;
    border-top: 1px solid #8c714e;
    padding: 7px 12px;
    border-radius: 5px;
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: 0.04em;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.card-btn-embark:hover {
    background: linear-gradient(180deg, #4d4337 0%, #352c22 100%);
    border-color: #8c714e;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.75);
    transform: translateY(-1px);
}

.card-btn-delete {
    background: var(--bg-input);
    border: 1px solid var(--border-crimson);
    color: #c97a7e;
    padding: 7px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
}

.card-btn-delete:hover {
    background: #3b1820;
    color: #f87171;
    border-color: #ef4444;
}

/* Empty State */
.roster-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2.5rem 1rem;
    background: #080c16;
    border: 1px dashed #202d45;
    border-radius: 8px;
}

.empty-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
    opacity: 0.8;
}

.empty-title {
    font-family: var(--font-heading);
    color: var(--gold);
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.empty-desc {
    font-size: 0.78rem;
    color: var(--text-dark);
    max-width: 400px;
    margin: 0 auto;
}

/* --- TOPBAR ACTION BUTTONS --- */
.topbar-action-btn {
    background: #162035;
    border: 1px solid #2b3d5c;
    color: #e2e8f0;
    font-family: var(--font-body);
    font-size: 0.74rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.topbar-action-btn:hover {
    background: #233454;
    border-color: var(--gold);
    color: var(--gold-bright);
}

.secondary-btn-sm {
    background: #162035;
    border: 1px solid #2b3d5c;
    color: #cbd5e1;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.secondary-btn-sm:hover {
    background: #202d45;
    color: #fff;
    border-color: var(--blue);
}

/* ============================================================
   EQUIPMENT, INVENTORY & CONTAINER SYSTEM (PHASE 1)
   ============================================================ */
.inv-tab-row {
    display: flex;
    gap: 4px;
    margin-bottom: 0.5rem;
    background: #090d16;
    padding: 3px;
    border-radius: 6px;
    border: 1px solid #1a2436;
}

.inv-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 2px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.inv-tab-btn:hover {
    color: var(--text-main);
    background: #141c2c;
}

.inv-tab-btn.active {
    background: #1d2b45;
    color: var(--gold-bright);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.inv-tab-content {
    display: none;
}

.inv-tab-content.active {
    display: block;
}

.inv-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
    padding-bottom: 3px;
    border-bottom: 1px solid #162035;
}

.inv-subheading {
    font-size: 0.68rem;
    color: var(--text-dark);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.inv-text-btn {
    background: none;
    border: none;
    color: var(--gold);
    font-size: 0.65rem;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
}

.inv-text-btn:hover {
    color: var(--gold-bright);
    text-decoration: underline;
}

/* Equipment Slots List */
.equip-slots-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 2px;
}

.equip-slots-list::-webkit-scrollbar {
    width: 4px;
}
.equip-slots-list::-webkit-scrollbar-thumb {
    background: #273754;
    border-radius: 2px;
}

.slot-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #0e1422;
    border: 1px solid #1c273c;
    border-radius: 4px;
    padding: 4px 6px;
    gap: 6px;
    font-size: 0.72rem;
    transition: border-color 0.15s;
}

.slot-card.equipped {
    border-left: 2px solid var(--gold);
    background: #101829;
}

.slot-card.empty {
    opacity: 0.55;
    border-style: dashed;
}

.slot-meta {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.slot-name-badge {
    font-size: 0.62rem;
    color: var(--gold);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.1;
}

.slot-item-desc {
    color: var(--text-main);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slot-item-desc.empty-slot {
    font-style: italic;
    color: var(--text-dark);
}

.slot-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* Carried Items */
.carried-item-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #0e1422;
    border: 1px solid #1c273c;
    border-radius: 4px;
    padding: 4px 6px;
    margin-bottom: 4px;
    gap: 6px;
    font-size: 0.72rem;
}

.carried-item-card:hover {
    border-color: #2b3d5c;
}

.carried-item-info {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}

.carried-item-name {
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-type-badge {
    font-size: 0.6rem;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
    background: #1b263b;
    color: var(--cyan);
    border: 1px solid #273852;
    flex-shrink: 0;
}

.item-type-badge.container {
    color: var(--gold-bright);
    background: #2b2210;
    border-color: #5c4516;
}

.item-type-badge.weapon {
    color: #f87171;
    background: #2b1418;
    border-color: #54222a;
}

.item-type-badge.armor {
    color: #60a5fa;
    background: #132238;
    border-color: #213c63;
}

/* Container Tree */
.containers-tree-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 2px;
}

.containers-tree-list::-webkit-scrollbar {
    width: 4px;
}
.containers-tree-list::-webkit-scrollbar-thumb {
    background: #273754;
    border-radius: 2px;
}

.container-card {
    background: #0e1422;
    border: 1px solid #223049;
    border-radius: 5px;
    padding: 6px;
}

.container-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
}

.container-name-box {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.container-name {
    color: var(--gold-bright);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.container-status-badge {
    font-size: 0.6rem;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 700;
}

.container-status-badge.open {
    background: #064e3b;
    color: #34d399;
}

.container-status-badge.closed {
    background: #3f1d24;
    color: #f87171;
}

.container-capacity {
    font-size: 0.63rem;
    color: var(--text-dark);
}

.container-actions {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
}

.container-contents-box {
    margin-top: 6px;
    padding-left: 8px;
    border-left: 2px solid #233452;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nested-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #090e18;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.68rem;
}

.nested-item-name {
    color: #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Action Chips */
.action-chip {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    background: #232026;
    border: 1px solid #3d3742;
    color: #d6cec2;
    cursor: pointer;
    transition: all 0.12s ease;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    user-select: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.action-chip:hover {
    background: #3b1f23;
    color: var(--gold-bright);
    border-color: var(--gold);
}

.action-chip.primary {
    background: #2b2429;
    border-color: #6b5326;
    color: var(--gold-bright);
}

.action-chip.primary:hover {
    background: #42341b;
    color: #fff;
    border-color: var(--gold-bright);
}

.action-chip.danger {
    background: #361519;
    border-color: #7f1d1d;
    color: #fca5a5;
}

.action-chip.danger:hover {
    background: #991b1b;
    color: #fff;
    border-color: #ef4444;
}

/* Interactive Surroundings List (Self-Truncating) */
.surround-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 0;
    border-bottom: 1px solid #1e1b20;
    gap: 6px;
    min-width: 0;
}

.surround-item-row:last-child {
    border-bottom: none;
}

.surround-item-name {
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

.surround-creature-name {
    color: #fca5a5;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

/* ==========================================================================
   SKILLS LAB & MECHANICS TUNING STUDIO STYLES
   ========================================================================== */

.skills-lab-header {
    border-bottom: 1px solid #1e2c45;
    padding-bottom: 12px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skills-lab-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--gold-bright);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.35);
    margin: 0;
}

.skills-lab-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 2px 0 0 0;
}

.skills-lab-subnav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.lab-nav-btn {
    background: #0f1728;
    border: 1px solid #233552;
    color: #94a3b8;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.lab-nav-btn:hover {
    color: #f1f5f9;
    border-color: var(--gold);
    background: #17243c;
}

.lab-nav-btn.active {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.25), rgba(245, 158, 11, 0.25));
    border-color: var(--gold-bright);
    color: var(--gold-bright);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.25);
    font-weight: 700;
}

.lab-subtab-content {
    display: none;
}

.lab-subtab-content.active {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

/* Section Cards & Stat Grids */
.lab-section-card {
    background: #0a101c;
    border: 1px solid #1a273e;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 16px;
}

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

.lab-card-title {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.lab-card-badge {
    font-size: 0.68rem;
    font-family: var(--font-mono);
    font-weight: 700;
    background: #16243b;
    color: var(--cyan);
    border: 1px solid #284167;
    padding: 2px 8px;
    border-radius: 4px;
}

.lab-preset-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.lab-chip-btn {
    background: #121c2e;
    border: 1px solid #243550;
    color: #94a3b8;
    font-size: 0.72rem;
    font-family: var(--font-mono);
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.lab-chip-btn:hover {
    border-color: var(--cyan);
    color: #ffffff;
    background: #1b2a45;
}

.lab-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 6px;
}

.lab-stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #070c16;
    border: 1px solid #18253b;
    border-radius: 6px;
    padding: 6px 4px;
    gap: 2px;
}

.lab-stat-box .stat-lbl {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.7rem;
    color: #94a3b8;
}

.lab-stat-box input {
    width: 52px;
    text-align: center;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.88rem;
    color: #fff;
    background: #0e1728;
    border: 1px solid #233550;
    border-radius: 4px;
    padding: 2px;
}

.lab-stat-box input:focus {
    border-color: var(--gold);
    outline: none;
    box-shadow: 0 0 6px rgba(212, 175, 55, 0.4);
}

.lab-stat-box .stat-bns {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--gold-bright);
}

/* Calculation Bench Cards Grid */
.lab-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 14px;
    margin-top: 12px;
}

.lab-calc-card {
    background: #0d1525;
    border: 1px solid #1e2c45;
    border-radius: 8px;
    padding: 14px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: border-color 0.2s;
}

.lab-calc-card:hover {
    border-color: #3b5078;
}

.calc-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
    background: #152238;
    border: 1px solid #2a416a;
    color: var(--gold-bright);
}

.calc-card-title {
    font-family: var(--font-heading);
    font-size: 0.96rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 12px;
}

.calc-card-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calc-results-panel {
    background: #070c16;
    border: 1px solid #18253b;
    border-radius: 6px;
    padding: 10px;
    margin: 10px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.res-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #94a3b8;
}

.res-row strong {
    font-family: var(--font-mono);
    font-weight: 700;
    color: #f1f5f9;
    font-size: 0.85rem;
}

.gold-text {
    color: var(--gold-bright) !important;
}

.cyan-text {
    color: var(--cyan) !important;
}

.mono-subtext {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: #64748b;
}

.btn-block {
    width: 100%;
}

/* Universal Contests Quick-Checks */
.lab-quick-checks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 8px;
}

.lab-check-btn {
    background: #111a2d;
    border: 1px solid #20314f;
    color: #cbd5e1;
    font-size: 0.75rem;
    font-family: var(--font-body);
    font-weight: 600;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.lab-check-btn:hover {
    background: #192a48;
    border-color: var(--gold);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Roll Extremes Benchmark Matrix Table */
.table-responsive {
    overflow-x: auto;
}

.lab-benchmark-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    margin-top: 6px;
}

.lab-benchmark-table th {
    background: #090e18;
    color: #94a3b8;
    font-weight: 700;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 2px solid #20304a;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.lab-benchmark-table th small {
    display: block;
    font-weight: normal;
    font-size: 0.68rem;
    color: #64748b;
    margin-top: 2px;
    text-transform: none;
}

.lab-benchmark-table td {
    padding: 9px 12px;
    border-bottom: 1px solid #141f32;
    color: #e2e8f0;
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

.lab-benchmark-table tr:hover td {
    background: rgba(30, 48, 78, 0.3);
}

.col-worst {
    color: #f87171 !important;
}

.col-base {
    color: #94a3b8 !important;
}

.col-best {
    color: #34d399 !important;
}

.col-peak {
    color: var(--gold-bright) !important;
}

/* Tuning Grid & Dials */
.tuning-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 12px;
}

.tuning-box {
    background: #080d17;
    border: 1px solid #1a273e;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tuning-box-title {
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--cyan);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
}

.mono-formula {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: #e2e8f0;
    background: #050810;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px dashed #20314f;
    text-align: center;
}

.lab-preset-dropdown {
    background: #0d1525;
    border: 1px solid var(--gold);
    color: var(--gold-bright);
    font-weight: 600;
    font-size: 0.76rem;
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    outline: none;
}

/* 20 Core Skills Directory */
.skills-filter-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-chip {
    background: #0e1728;
    border: 1px solid #20314f;
    color: #94a3b8;
    font-size: 0.74rem;
    font-family: var(--font-mono);
    padding: 3px 10px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-chip:hover {
    color: #fff;
    border-color: #3b5078;
}

.filter-chip.active {
    background: #173258;
    border-color: var(--blue);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

.skills-directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 12px;
}

.skill-dir-card {
    background: #0c1322;
    border: 1px solid #1a273e;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    transition: all 0.15s ease;
}

.skill-dir-card:hover {
    border-color: var(--gold);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.skill-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.skill-card-name {
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 700;
    color: #f1f5f9;
}

.skill-pillar-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
}

.pillar-Physical {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid #7f1d1d;
}

.pillar-Mental {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid #1e3a8a;
}

.pillar-Social {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
    border: 1px solid #78350f;
}

.pillar-Spiritual {
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    border: 1px solid #4c1d95;
}

.skill-card-desc {
    font-size: 0.74rem;
    color: #94a3b8;
    line-height: 1.35;
}

.skill-stats-tag {
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: #64748b;
}

.skill-cost-breakdown {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #070c16;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-family: var(--font-mono);
    border: 1px solid #141f32;
}

.skill-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    gap: 8px;
}

.rank-stepper {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.stepper-btn {
    background: #141f33;
    border: 1px solid #253754;
    color: #fff;
    width: 22px;
    height: 22px;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transition: all 0.15s ease;
}

.stepper-btn:hover {
    background: #203354;
    border-color: var(--gold);
}

.test-skill-btn {
    background: #132442;
    border: 1px solid #2563eb;
    color: #93c5fd;
    font-size: 0.72rem;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.15s ease;
}

.test-skill-btn:hover {
    background: #2563eb;
    color: #fff;
}

/* Laboratory Mathematical Derivations & Telemetry Log Screen */
.lab-console-screen {
    background: #05080e;
    border: 1px solid #162438;
    border-radius: 6px;
    padding: 10px;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.4;
}

.console-entry {
    padding: 2px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}

.console-entry.info {
    color: #38bdf8;
}

.console-entry.success {
    color: #4ade80;
}

.console-entry.warning {
    color: #fbbf24;
}

.console-entry.danger {
    color: #f87171;
}

.console-entry.math {
    color: var(--gold-bright);
    background: rgba(212, 175, 55, 0.06);
    padding: 3px 6px;
    border-radius: 3px;
    border-left: 2px solid var(--gold);
}

/* ==========================================================================
   TOP-LEFT UNIFIED 3-MODE QUICK INVENTORY BAR (COMPACT ICONS LEFT | LARGE LONG PANELS RIGHT)
   ========================================================================== */
.topbar-inv-system {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    position: relative;
}

.topbar-mode-switcher {
    display: inline-flex;
    align-items: center;
    background: #100f12;
    border: 1px solid #3c343b;
    border-radius: 6px;
    padding: 2px;
    gap: 3px;
    flex-shrink: 0;
}

.topbar-mode-btn {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1;
    padding: 0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.14s ease;
}

.topbar-mode-btn .mode-icon-only {
    font-size: 0.95rem;
    line-height: 1;
    pointer-events: none;
}

.topbar-mode-btn:hover {
    color: var(--text-main);
    background: #231e25;
    border-color: #4b3d44;
}

.topbar-mode-btn.active {
    background: linear-gradient(180deg, #7f1d1d 0%, #451014 100%);
    border-color: #dc2626;
    color: #ffffff;
    box-shadow: 0 0 8px rgba(185, 28, 28, 0.45);
}

.topbar-inv-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0;
}

.topbar-inv-strip::-webkit-scrollbar {
    height: 3px;
}
.topbar-inv-strip::-webkit-scrollbar-thumb {
    background: #47363a;
    border-radius: 2px;
}

.hand-slot,
.hand-slot-pill,
.topbar-inv-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(180deg, #1b1a22 0%, #131218 100%);
    border: 1px solid #3c3642;
    border-radius: 7px;
    padding: 5px 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 195px;
    max-width: 320px;
    flex: 1 1 210px;
    position: relative;
}

.hand-slot:hover,
.hand-slot-pill:hover,
.topbar-inv-pill:hover,
.topbar-inv-pill.active-pill {
    border-color: #991b1b;
    background: linear-gradient(180deg, #271a20 0%, #1a1216 100%);
    box-shadow: 0 0 10px rgba(185, 28, 28, 0.28);
}

.topbar-inv-pill.empty-pill {
    opacity: 0.6;
    border-style: dashed;
    min-width: 155px;
}

.hand-slot-icon {
    font-size: 1.18rem;
    line-height: 1;
    flex-shrink: 0;
}

.hand-slot-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    flex: 1;
}

.hand-slot-label {
    font-size: 0.58rem;
    font-weight: 800;
    color: var(--gold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.15;
}

.hand-slot-name,
.hand-slot-item {
    font-size: 0.8rem;
    font-weight: 700;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.25;
}

.hand-slot.spell-slot,
.hand-slot-pill.spell-prep-pill {
    border-color: rgba(139, 92, 246, 0.42);
}

.hand-slot.spell-slot:hover,
.hand-slot-pill.spell-prep-pill:hover {
    border-color: var(--purple);
    background: linear-gradient(180deg, #231b2e 0%, #16111e 100%);
}

.hand-slot.spell-slot .hand-slot-label,
.hand-slot-pill.spell-prep-pill .hand-slot-label {
    color: #a78bfa;
}

/* ==========================================================================
   LIVE ARENA SCOREBOARD & ON-THE-FLY COMBAT TUNER BAR (#arena-live-tuner-bar)
   ========================================================================== */
.arena-live-tuner-bar {
    background: linear-gradient(180deg, #1d1417 0%, #120f12 100%);
    border-bottom: 2px solid #7f1d1d;
    padding: 6px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 15;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.65);
}

.arena-live-tuner-bar.hidden {
    display: none !important;
}

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

.arena-bout-headline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.74rem;
}

.arena-badge-live {
    background: #7f1d1d;
    border: 1px solid #ef4444;
    color: #fef2f2;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.66rem;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.05em;
}

.arena-fighter-chip {
    background: #18161b;
    border: 1px solid #3f3842;
    padding: 2px 9px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.72rem;
    color: var(--text-main);
}

.arena-fighter-chip.red {
    border-color: rgba(239, 68, 68, 0.5);
    color: #fca5a5;
}

.arena-fighter-chip.blue {
    border-color: rgba(59, 130, 246, 0.5);
    color: #93c5fd;
}

.arena-vs-label {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 900;
    color: var(--gold-bright);
}

.arena-tuner-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.arena-ctrl-btn {
    background: #1f1b20;
    border: 1px solid #4a3a3f;
    color: var(--text-main);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.14s ease;
    white-space: nowrap;
}

.arena-ctrl-btn:hover {
    background: #3b1c21;
    border-color: #dc2626;
    color: var(--gold-bright);
}

.arena-ctrl-btn.primary {
    background: linear-gradient(180deg, #7f1d1d 0%, #4c1115 100%);
    border-color: #dc2626;
    color: #fff;
}

.arena-ctrl-btn.apply-btn {
    background: linear-gradient(180deg, #166534 0%, #14532d 100%);
    border-color: #22c55e;
    color: #f0fdf4;
}

.arena-tuner-controls-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding-top: 3px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tuner-field {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #111014;
    border: 1px solid #2e2932;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.64rem;
    color: var(--text-muted);
    font-weight: 600;
}

.tuner-field input,
.tuner-field select {
    background: #19171d;
    border: 1px solid #3d3642;
    color: var(--gold-bright);
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    width: 48px;
}

.tuner-field select {
    width: auto;
    font-family: var(--font-body);
}

.topbar-util-chip {
    background: #17151a;
    border: 1px dashed #473f47;
    color: var(--text-muted);
    font-size: 0.64rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.14s ease;
}

.topbar-util-chip:hover,
.topbar-util-chip.active {
    border-style: solid;
    border-color: var(--gold);
    color: var(--gold-bright);
    background: #26211c;
}

/* FLOATING INSPECTION & BAG CONTENTS POPOVER */
.topbar-inv-popover {
    position: fixed;
    top: 52px;
    left: 14px;
    width: 335px;
    max-width: 92vw;
    max-height: 520px;
    overflow-y: auto;
    background: #171519;
    border: 1px solid #6b262b;
    border-top: 2px solid #b91c1c;
    border-radius: 5px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.92);
    padding: 8px 10px;
    z-index: 150;
    color: var(--text-main);
}

.inv-popover-weapons-section {
    margin-top: 8px;
    border-top: 1px solid #3c3642;
    padding-top: 8px;
}

.inv-popover-weapons-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.68rem;
    font-family: var(--font-mono);
    color: var(--gold);
    letter-spacing: 0.04em;
}

.inv-popover-weapons-header .ipw-sub {
    color: var(--text-muted);
    font-size: 0.62rem;
}

.inv-popover-weapons-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 270px;
    overflow-y: auto;
    padding-right: 2px;
}

.weapon-swap-pill {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    flex: none !important;
    justify-content: flex-start;
    padding: 5px 10px !important;
    border: 1px solid #3c3642;
    background: linear-gradient(180deg, #1b1a22 0%, #131218 100%);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.weapon-swap-pill:hover {
    border-color: var(--gold) !important;
    background: linear-gradient(180deg, #2b2219 0%, #1c1511 100%) !important;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3) !important;
}

.weapon-swap-tag {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--gold);
    border: 1px solid rgba(212, 175, 55, 0.4);
    background: rgba(212, 175, 55, 0.1);
    padding: 1px 6px;
    border-radius: 3px;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.weapon-swap-pill:hover .weapon-swap-tag {
    background: var(--gold);
    color: #100e0b;
    border-color: var(--gold-bright);
}

.weapon-swap-empty {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 4px 2px;
}

.topbar-inv-popover.hidden {
    display: none !important;
}

.inv-pop-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    border-bottom: 1px solid #2e2930;
    padding-bottom: 5px;
    margin-bottom: 6px;
}

.inv-pop-title {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gold-bright);
    line-height: 1.2;
}

.inv-pop-sub {
    font-size: 0.64rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.inv-pop-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 7px;
    font-size: 0.68rem;
    font-family: var(--font-mono);
}

.inv-stat-pill {
    background: #100f12;
    border: 1px solid #2e2a31;
    padding: 2px 6px;
    border-radius: 3px;
    color: #d6cec2;
}

.inv-stat-pill strong {
    color: var(--gold-bright);
}

.inv-pop-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 4px;
}

.inv-bag-contents-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 210px;
    overflow-y: auto;
    margin: 6px 0;
    padding-right: 2px;
}

.inv-bag-contents-list::-webkit-scrollbar {
    width: 4px;
}
.inv-bag-contents-list::-webkit-scrollbar-thumb {
    background: #47363a;
    border-radius: 2px;
}

.inv-bag-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    background: #100f12;
    border: 1px solid #262329;
    border-radius: 3px;
    padding: 4px 6px;
    font-size: 0.7rem;
}

.inv-bag-item-name {
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

/* ==========================================================================
   TOP-RIGHT SANDWICH MENU
   ========================================================================== */
.sandwich-menu-wrapper {
    position: relative;
}

.sandwich-btn {
    width: 36px;
    height: 34px;
    background: #211d22;
    border: 1px solid #4a3539;
    border-radius: 4px;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.sandwich-btn:hover,
.sandwich-btn.active {
    background: #47171b;
    border-color: #b91c1c;
    color: var(--gold-bright);
}

.sandwich-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.sandwich-dropdown {
    position: absolute;
    top: 42px;
    right: 0;
    width: 224px;
    max-height: calc(100vh - 54px);
    overflow-y: auto;
    background: #171519;
    border: 1px solid #5c2328;
    border-top: 2px solid #b91c1c;
    border-radius: 5px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.92);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    z-index: 160;
}

.sandwich-dropdown::-webkit-scrollbar {
    width: 4px;
}
.sandwich-dropdown::-webkit-scrollbar-thumb {
    background: #47171b;
    border-radius: 2px;
}

.sandwich-dropdown.hidden {
    display: none !important;
}

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

.sandwich-section.hidden {
    display: none !important;
}

.sandwich-section-header {
    font-size: 0.58rem;
    font-family: var(--font-heading);
    letter-spacing: 0.08em;
    color: var(--text-dark);
    padding: 5px 8px 1px;
    text-transform: uppercase;
    font-weight: 700;
}

.sandwich-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px 6px;
    border-bottom: 1px solid #2e2930;
    margin-bottom: 2px;
}

.sandwich-acct-label {
    font-size: 0.6rem;
    color: var(--text-dark);
    font-weight: 700;
    letter-spacing: 0.06em;
}

.sandwich-acct-val {
    font-size: 0.74rem;
    color: var(--gold-bright);
    font-family: var(--font-heading);
}

.sandwich-item {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.14s ease;
    text-align: left;
}

.sandwich-item.hidden {
    display: none !important;
}

.sandwich-item:hover {
    background: #2b1d21;
    border-color: #6b262b;
    color: var(--gold-bright);
}

.sandwich-item.danger:hover {
    background: #451519;
    border-color: #b91c1c;
    color: #fca5a5;
}

.si-icon {
    font-size: 0.9rem;
    width: 18px;
    text-align: center;
}

.si-text {
    flex: 1;
}

.si-key {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-dark);
    background: #100f12;
    border: 1px solid #2e2930;
    padding: 1px 4px;
    border-radius: 3px;
}

.sandwich-divider {
    height: 1px;
    background: #2e2930;
    margin: 3px 0;
}

/* ==========================================================================
   SIDEBAR WINDOW CONTROLS (SHOW, HIDE, MIN, MAX, CLOSE)
   ========================================================================== */
.widget-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 2px;
    margin-bottom: 0.3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.widget-title-left {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

.win-controls {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.win-btn {
    width: 18px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1c1a1f;
    border: 1px solid #353038;
    color: var(--text-muted);
    font-size: 0.6rem;
    font-family: var(--font-mono);
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.12s ease;
    padding: 0;
}

.win-btn:hover {
    background: #361d21;
    color: #fff;
    border-color: #991b1b;
}

.win-btn-close:hover {
    background: #991b1b;
    color: #fff;
    border-color: #ef4444;
}

.win-btn-log {
    font-size: 0.65rem;
}

.win-btn-log:hover {
    background: #2b2418;
    color: var(--gold-bright);
    border-color: var(--gold);
}

.widget.minimized {
    padding: 0.3rem 0.5rem;
    background: rgba(17, 23, 38, 0.88);
}

.widget.minimized:hover {
    background: rgba(22, 32, 53, 0.95);
    border-color: rgba(212, 175, 55, 0.35);
}

.widget.minimized .widget-title {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    row-gap: 2px;
}

.widget.minimized .widget-title-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.widget.minimized .widget-title-left > span:first-child,
.widget.minimized .widget-title-left > .widget-label {
    font-size: 0.67rem;
    font-weight: 700;
    color: #e2d9cc;
    letter-spacing: 0.06em;
}

.widget.minimized .win-controls {
    align-self: flex-start;
}

.widget.minimized .widget-title-left .badge {
    flex-basis: 100%;
    margin-top: 2px;
    font-size: 0.67rem;
    font-weight: 500;
    font-family: var(--font-body);
    text-transform: none;
    letter-spacing: normal;
    background: transparent;
    border: none;
    padding: 0;
    color: #9ba3b4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1.2;
}

.widget.minimized .widget-title-left .badge::before {
    content: "↳";
    opacity: 0.5;
    font-size: 0.72rem;
    color: var(--gold, #d4a359);
}

.widget.minimized .widget-title-left .badge.ok {
    color: #6ee7b7;
}

.widget.minimized .widget-title-left .badge.warning {
    color: #fcd34d;
}

.widget.minimized .widget-title-left .badge.danger {
    color: #fca5a5;
}

.widget.minimized .map-legend-btn {
    display: none !important;
}

.widget.minimized .widget-body {
    display: none !important;
}

.widget.maximized {
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(194, 155, 56, 0.2);
}

.widget.hidden {
    display: none !important;
}

/* ==========================================================================
   WINDOWS & LOGGING MANAGER
   ========================================================================== */
.windows-manager-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.win-mgr-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #111013;
    border: 1px solid #2b272e;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.72rem;
    transition: background 0.15s;
}

.win-mgr-row:hover {
    background: #1f1c22;
}

.win-mgr-row.hidden-state {
    opacity: 0.5;
}

.win-mgr-name {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-main);
    font-weight: 500;
}

.win-mgr-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.win-mgr-btn {
    background: #1f1c22;
    border: 1px solid #38323b;
    color: var(--text-muted);
    font-size: 0.68rem;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s;
}

.win-mgr-btn:hover {
    background: #361d21;
    color: var(--gold-bright);
    border-color: #991b1b;
}

/* ==========================================================================
   INLINE MESSAGE TAGS & SOURCE TOGGLE
   ========================================================================== */
.log-entry {
    margin-bottom: 0.45rem;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
}

.msg-tag {
    display: inline-block;
    font-size: 0.66rem;
    font-weight: 700;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 6px;
    padding: 1px 5px;
    border-radius: 3px;
    vertical-align: baseline;
    user-select: none;
}

.msg-tag-realm,
.msg-tag-system {
    color: #d6cec2;
    background: rgba(168, 162, 158, 0.12);
    border: 1px solid rgba(168, 162, 158, 0.28);
}

.msg-tag-combat {
    color: #fca5a5;
    background: rgba(185, 28, 28, 0.22);
    border: 1px solid rgba(220, 38, 38, 0.4);
}

.msg-tag-room,
.msg-tag-look,
.msg-tag-movement {
    color: #e7e5e4;
    background: rgba(231, 229, 228, 0.09);
    border: 1px solid rgba(231, 229, 228, 0.22);
}

.msg-tag-input {
    color: var(--gold-bright);
    background: rgba(194, 155, 56, 0.14);
    border: 1px solid rgba(194, 155, 56, 0.3);
}

.msg-tag-guide,
.msg-tag-help,
.msg-tag-info {
    color: #a3e635;
    background: rgba(163, 230, 53, 0.10);
    border: 1px solid rgba(163, 230, 53, 0.25);
}

.msg-tag-say,
.msg-tag-echo {
    color: #d8b4fe;
    background: rgba(192, 132, 252, 0.12);
    border: 1px solid rgba(192, 132, 252, 0.25);
}

.msg-tag-error {
    color: #fda4af;
    background: rgba(190, 18, 60, 0.2);
    border: 1px solid rgba(225, 29, 72, 0.4);
}

.msg-tag-inventory,
.msg-tag-tactics,
.msg-tag-posture,
.msg-tag-training,
.msg-tag-sensory {
    color: var(--gold);
    background: rgba(194, 155, 56, 0.10);
    border: 1px solid rgba(194, 155, 56, 0.25);
}

#terminal-screen.hide-tags .msg-tag {
    display: none !important;
}

/* ==========================================================================
   DOCKED BOTTOM VITALS & STATUS BAR (POP OF COLOR RESERVED FOR VITALS)
   ========================================================================== */
.bottom-vitals-dock {
    background: #12100d;
    border-top: 1px solid #332d24;
    padding: 5px 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 5;
}

.dock-vitals-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.dock-vital-meter {
    background: #171512;
    border: 1px solid #362f25;
    border-radius: 4px;
    padding: 3px 8px;
    transition: all 0.2s ease;
}

.dock-vital-meter.hp-dock {
    border-color: rgba(220, 38, 38, 0.45);
    background: linear-gradient(180deg, rgba(220, 38, 38, 0.08) 0%, #171512 100%);
}
.dock-vital-meter.hp-dock .dock-vital-label span {
    color: #f87171;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.45);
}
.dock-vital-meter.hp-dock strong {
    color: #fecaca;
}

.dock-vital-meter.mp-dock {
    border-color: rgba(37, 99, 235, 0.45);
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.08) 0%, #171512 100%);
}
.dock-vital-meter.mp-dock .dock-vital-label span {
    color: #60a5fa;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.45);
}
.dock-vital-meter.mp-dock strong {
    color: #bfdbfe;
}

.dock-vital-meter.st-dock {
    border-color: rgba(16, 185, 129, 0.45);
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, #171512 100%);
}
.dock-vital-meter.st-dock .dock-vital-label span {
    color: #34d399;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.45);
}
.dock-vital-meter.st-dock strong {
    color: #a7f3d0;
}

.dock-vital-meter.sp-dock {
    border-color: rgba(124, 58, 237, 0.45);
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.08) 0%, #171512 100%);
}
.dock-vital-meter.sp-dock .dock-vital-label span {
    color: #c084fc;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(168, 85, 247, 0.45);
}
.dock-vital-meter.sp-dock strong {
    color: #e9d5ff;
}

.dock-vital-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.66rem;
    margin-bottom: 2px;
}

.dock-vital-label strong {
    font-size: 0.7rem;
    font-family: var(--font-mono);
}

.dock-bar-track {
    height: 6px;
    background: #12100d;
    border: 1px solid #29241d;
    border-radius: 3px;
    overflow: hidden;
}

.dock-bar-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.dock-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.68rem;
    flex-wrap: wrap;
}

.dock-posture-badge {
    background: #1e1c21;
    border: 1px solid #3a343d;
    color: var(--gold-bright);
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.65rem;
    letter-spacing: 0.04em;
    cursor: pointer;
}

.dock-stance-badge {
    background: #2b181b;
    border: 1px solid #6b2228;
    color: #fca5a5;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.65rem;
    letter-spacing: 0.04em;
    cursor: pointer;
}

.dock-status-chips {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
}

.status-chip {
    font-size: 0.63rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}

.status-chip.resting {
    background: #1f2e27;
    color: #6ee7b7;
    border: 1px solid #059669;
}

.status-chip.bleeding {
    background: #7f1d1d;
    color: #fca5a5;
    border: 1px solid #dc2626;
    animation: pulseGlow 1s infinite;
}

.status-chip.poisoned {
    background: #14532d;
    color: #86efac;
    border: 1px solid #15803d;
}

.status-chip.stunned {
    background: #78350f;
    color: #fde68a;
    border: 1px solid #b45309;
    animation: pulseGlow 0.8s infinite;
}

.status-chip.covered {
    background: #27272a;
    color: #d4d4d8;
    border: 1px solid #52525b;
}

.status-chip.hidden {
    background: #18181b;
    color: #a1a1aa;
    border: 1px solid #3f3f46;
}

.status-chip.outlaw {
    background: #881337;
    color: #fda4af;
    border: 1px solid #e11d48;
    font-weight: 900;
}

.status-chip.normal {
    color: var(--text-dark);
    background: transparent;
}

/* ==========================================================================
   COMPACT AETHEL TACTICAL WHEEL GUI (EXACT MOCKUP LAYOUT & SCALE)
   ========================================================================== */
.aethel-frame {
    position: relative;
    background: linear-gradient(180deg, #161519 0%, #0d0c10 100%);
    border: 2px solid #8a6d2f;
    box-shadow: 
        inset 0 0 0 1px rgba(194, 155, 56, 0.22),
        0 14px 36px rgba(0, 0, 0, 0.92);
    border-radius: 8px;
}

.combat-gui-popup {
    position: fixed;
    bottom: 122px;
    right: 265px;
    top: auto;
    left: auto;
    width: 346px;
    max-width: calc(100vw - 24px);
    z-index: 120;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    user-select: none;
}

@media (max-width: 1150px) {
    .combat-gui-popup {
        right: 18px;
    }
}

.combat-gui-popup.hidden {
    display: none !important;
}

.combat-gui-popup.minimized .combat-gui-body {
    display: none !important;
}

/* Header & Drag Bar */
.combat-gui-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, #211d24 0%, #141217 100%);
    border-bottom: 1px solid #6b5322;
    padding: 4px 8px;
    cursor: grab;
}

.combat-gui-header:active {
    cursor: grabbing;
}

.combat-gui-title-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    overflow: hidden;
}

.combat-gui-title {
    font-family: var(--font-heading);
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--gold-bright);
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.combat-target-dropdown {
    background: #0d0c10;
    border: 1px solid #574523;
    color: var(--text-main);
    font-size: 0.62rem;
    padding: 1px 4px;
    border-radius: 4px;
    max-width: 112px;
}

.combat-pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #b91c1c;
    box-shadow: 0 0 6px #dc2626;
    flex-shrink: 0;
}

/* Compact Body */
.combat-gui-body {
    padding: 5px 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #0e0d12;
}

/* Single-Line Offensive / Defensive Maneuver Bars */
.combat-inline-maneuver-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    background: #141318;
    border: 1px solid #3d3322;
    border-radius: 6px;
    padding: 3px 6px;
}

.combat-inline-maneuver-row.defensive {
    border-color: #1f4239;
}

.inline-row-icon {
    font-size: 0.85rem;
    flex-shrink: 0;
    opacity: 0.9;
}

/* 5 Circular Medallions Inline */
.action-medallion-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex: 1;
}

.aethel-medallion-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #a17c32;
    background: radial-gradient(circle at 50% 35%, #2b2933 0%, #141318 80%);
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.8), 0 2px 5px rgba(0, 0, 0, 0.6);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1px;
    transition: all 0.14s ease;
    flex-shrink: 0;
}

.aethel-medallion-btn:hover {
    border-color: var(--gold-bright);
    background: radial-gradient(circle at 50% 35%, #422024 0%, #1c1316 85%);
    transform: translateY(-1px) scale(1.04);
}

.aethel-medallion-btn .medallion-icon {
    font-size: 0.78rem;
    line-height: 1;
    pointer-events: none;
}

.aethel-medallion-btn .medallion-name {
    font-family: var(--font-heading);
    font-size: 0.42rem;
    font-weight: 700;
    color: var(--gold-bright);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 32px;
    text-align: center;
    margin-top: 1px;
    pointer-events: none;
    text-transform: uppercase;
}

.aethel-def-medallion {
    border-color: #2f855a;
    background: radial-gradient(circle at 50% 35%, #1d352e 0%, #101917 80%);
}

.aethel-def-medallion .medallion-name {
    color: #6ee7b7;
}

.aethel-def-medallion:hover {
    border-color: #34d399;
    background: radial-gradient(circle at 50% 35%, #23473c 0%, #13221f 85%);
}

.aethel-edit-pulse {
    border-color: #f59e0b !important;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.65);
}

.grimoire-edit-btn {
    font-size: 0.56rem;
    font-weight: 700;
    line-height: 1.15;
    padding: 3px 6px;
    border-radius: 4px;
    border: 1px solid #85581a;
    background: rgba(45, 29, 14, 0.75);
    color: #fbbf24;
    cursor: pointer;
    text-align: center;
    max-width: 62px;
    flex-shrink: 0;
}

.grimoire-edit-btn:hover {
    border-color: var(--gold-bright);
    color: #fff;
}

.grimoire-edit-btn.defensive {
    border-color: #1f6f54;
    background: rgba(16, 48, 38, 0.75);
    color: #6ee7b7;
}

.grimoire-edit-btn.defensive:hover {
    border-color: #34d399;
    color: #fff;
}

/* Center Arena: Slip Wings + 150px 360° Dial + Step Back */
.combat-arena-compact {
    background: #111015;
    border: 1px solid #332b1e;
    border-radius: 6px;
    padding: 5px 8px 4px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.arena-center-flex {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.aethel-slip-wing {
    width: 44px;
    height: 122px;
    border-radius: 8px;
    background: linear-gradient(180deg, #1b1e28 0%, #11131a 100%);
    border: 1.5px solid #8a6d2f;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 5px 2px;
    color: var(--gold-bright);
    transition: all 0.14s ease;
    flex-shrink: 0;
}

.aethel-slip-wing:hover {
    border-color: var(--gold-bright);
    background: linear-gradient(180deg, #282432 0%, #17151f 100%);
    transform: translateY(-1px);
}

.slip-evade-hdr {
    font-family: var(--font-heading);
    font-size: 0.48rem;
    font-weight: 700;
    color: #a89060;
    letter-spacing: 0.04em;
}

.slip-curve-svg {
    width: 24px;
    height: 30px;
    color: #d4af37;
}

.slip-title {
    font-family: var(--font-heading);
    font-size: 0.62rem;
    font-weight: 800;
    color: #facc15;
    line-height: 1;
}

.slip-dir-sub {
    font-size: 0.52rem;
    font-weight: 700;
    color: #93c5fd;
    line-height: 1;
}

.hotkey-badge {
    font-size: 0.52rem;
    font-family: var(--font-mono);
    background: #171311;
    border: 1px solid #785520;
    padding: 0 4px;
    border-radius: 3px;
    color: #fbbf24;
}

.rosette-wrapper {
    position: relative;
    width: 148px;
    height: 148px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.combat-dial-svg {
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.rosette-blade {
    cursor: pointer;
    transition: opacity 0.12s ease;
}

.rosette-blade:hover path,
.rosette-blade:hover circle {
    stroke: var(--gold-bright);
    fill: #5c191e;
}

.rosette-blade:hover polygon {
    fill: #ef4444;
}

.rosette-status-pill {
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    background: #141110;
    border: 1px solid #b4862d;
    border-radius: 4px;
    padding: 1px 8px;
    font-family: var(--font-heading);
    font-size: 0.54rem;
    font-weight: 800;
    color: #fef08a;
    letter-spacing: 0.05em;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
}

/* Single-Line Tactical Step Back Bar */
.aethel-stepback-plate {
    width: 68%;
    margin-top: 6px;
    background: linear-gradient(180deg, #1c1917 0%, #110f0e 100%);
    border: 1px solid #785c28;
    border-radius: 3px;
    padding: 2px 10px;
    text-align: center;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #e4c56f;
    transition: all 0.14s ease;
}

.aethel-stepback-plate:hover {
    border-color: var(--gold-bright);
    background: #2b2118;
    color: #fff;
}

/* Ranged Weapon Ammo & Quiver Strip in Rosette */
.rosette-ranged-strip {
    width: 95%;
    margin-top: 5px;
    padding: 3px 6px;
    background: #141824;
    border: 1px solid #2563eb;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ranged-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.58rem;
    gap: 4px;
}

.ranged-mode-badge {
    font-family: var(--font-heading);
    font-weight: 800;
    color: #60a5fa;
    letter-spacing: 0.04em;
}

.ranged-ammo-info {
    color: #fef08a;
    font-family: var(--font-mono);
    font-size: 0.56rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}

.ranged-quiver-info {
    color: #94a3b8;
    font-size: 0.54rem;
    font-family: var(--font-mono);
}

.ranged-quick-actions {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.ranged-quick-actions .action-chip {
    font-size: 0.56rem;
    padding: 1px 6px;
}

/* Single-Line Bottom Stance Slider & AS/DS Footer Bar */
.combat-footer-stance-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    background: #141318;
    border: 1px solid #3d3322;
    border-radius: 5px;
    padding: 4px 7px;
}

.stance-readout-inline {
    font-family: var(--font-mono);
    font-size: 0.56rem;
    font-weight: 800;
    color: #34d399;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 138px;
}

.combat-stance-slider-inline {
    width: 64px;
    accent-color: #eab308;
    height: 4px;
    cursor: pointer;
    flex-shrink: 0;
}

.combat-as-ds-inline {
    font-size: 0.58rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.combat-as-ds-inline strong {
    color: var(--gold-bright);
}

/* Grimoire Modal */
.custom-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.custom-modal-backdrop.hidden {
    display: none !important;
}

.grimoire-modal-panel {
    max-width: 380px;
    width: 100%;
    padding: 12px;
    border: 2px solid #7f1d1d;
}

.grimoire-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #3f2327;
    padding-bottom: 6px;
    margin-bottom: 8px;
}

.grimoire-modal-title {
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--gold-bright);
    display: flex;
    align-items: center;
    gap: 6px;
}

.grimoire-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0 4px;
}

.grimoire-close-btn:hover {
    color: #fff;
}

.grimoire-modal-subtitle {
    font-size: 0.66rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.grimoire-maneuver-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    max-height: 240px;
    overflow-y: auto;
}

.grimoire-option-btn {
    padding: 5px 7px;
    border-radius: 4px;
    background: #141316;
    border: 1px solid #382c30;
    display: flex;
    align-items: center;
    gap: 6px;
    text-align: left;
    cursor: pointer;
    transition: all 0.14s ease;
}

.grimoire-option-btn:hover {
    background: #2f1b1f;
    border-color: #991b1b;
}

.grimoire-option-btn .opt-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.grimoire-option-btn .opt-name {
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--gold-bright);
}

.grimoire-option-btn .opt-desc {
    font-size: 0.55rem;
    color: var(--text-muted);
    line-height: 1.2;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

/* ==========================================================================
   CHARACTER GOALS & 4-PILLAR SKILL TRAINING MANAGER (GEMSTONE IV FANTASY STYLE)
   ========================================================================== */

.skills-manager-panel {
    max-width: 1750px;
    width: 98vw;
    height: 96vh;
    max-height: 98vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-main);
    border: 1.5px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.95), 0 0 20px var(--border-glow);
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
}

.skills-manager-header {
    background: linear-gradient(180deg, #1f1b16 0%, #161411 100%);
    border-bottom: 2px solid var(--border-color);
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
    min-height: 52px;
}

.skills-header-titles {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex-shrink: 0;
}

.skills-badge-title {
    display: flex;
    align-items: center;
    gap: 6px;
}

.skills-badge-title .modal-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--gold-bright);
    margin: 0;
    text-shadow: 0 0 12px rgba(138, 111, 76, 0.35);
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.skills-gold-icon {
    font-size: 1.15rem;
}

.skills-manager-header .modal-subtitle {
    margin: 0;
    font-size: 0.66rem;
    color: var(--text-muted);
    max-width: 380px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 4-PILLAR TRAINING POINT LEDGER IN HEADER BAR */
.header-ledger-pools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.header-ledger-pools .ledger-pool-card {
    background: var(--bg-card);
    border-radius: 5px;
    padding: 3px 10px;
    min-width: 82px;
    display: flex;
    flex-direction: column;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.6);
    position: relative;
    overflow: hidden;
}

.header-ledger-pools .pool-card-ptp { border: 1px solid rgba(184, 74, 79, 0.45); border-top: 2.5px solid #b84a4f; }
.header-ledger-pools .pool-card-mtp { border: 1px solid rgba(93, 126, 166, 0.45); border-top: 2.5px solid #5d7ea6; }
.header-ledger-pools .pool-card-stp { border: 1px solid rgba(196, 154, 98, 0.45); border-top: 2.5px solid #c49a62; }
.header-ledger-pools .pool-card-ftp { border: 1px solid rgba(158, 123, 184, 0.45); border-top: 2.5px solid #9e7bb8; }

.header-ledger-pools .ledger-pool-card .pool-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    margin-bottom: 0px;
}

.header-ledger-pools .ledger-pool-card .pool-tag {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 800;
    padding: 0 4px;
    border-radius: 2px;
}

.header-ledger-pools .pool-card-ptp .pool-tag { background: rgba(184, 74, 79, 0.2); color: #e8a0a4; }
.header-ledger-pools .pool-card-mtp .pool-tag { background: rgba(93, 126, 166, 0.2); color: #a9c4df; }
.header-ledger-pools .pool-card-stp .pool-tag { background: rgba(196, 154, 98, 0.2); color: #e4caa4; }
.header-ledger-pools .pool-card-ftp .pool-tag { background: rgba(158, 123, 184, 0.2); color: #d8c0eb; }

.header-ledger-pools .ledger-pool-card .pool-label {
    font-size: 0.58rem;
    color: var(--text-muted);
}

.header-ledger-pools .ledger-pool-card .pool-val {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 900;
    color: #fff;
    line-height: 1.1;
    margin: 1px 0;
}

.pool-val.pool-modified {
    color: var(--gold-bright);
    text-shadow: 0 0 8px rgba(196, 165, 122, 0.4);
}

.pool-val.pool-depleted {
    color: #ef4444 !important;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.header-ledger-pools .ledger-pool-card .pool-sub {
    font-size: 0.55rem;
    color: var(--text-dark);
    font-family: var(--font-mono);
}

.skills-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.skills-auto-convert-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 4px 9px;
    font-size: 0.74rem;
    color: var(--text-main);
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
}

.skills-auto-convert-label:hover {
    border-color: var(--bronze-bright);
    background: var(--bg-card-hover);
    box-shadow: 0 0 10px rgba(138, 111, 76, 0.25);
}

.skills-auto-convert-label input[type="checkbox"] {
    accent-color: var(--bronze-bright);
    cursor: pointer;
    width: 14px;
    height: 14px;
    margin: 0;
}

.skills-auto-convert-label .auto-convert-text {
    font-family: var(--font-body);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    transition: color 0.15s ease;
}

.skills-auto-convert-label input:checked + .auto-convert-text {
    color: var(--bronze-bright);
    text-shadow: 0 0 8px rgba(196, 165, 122, 0.4);
}

.skills-char-plaque {
    background: var(--bg-void);
    border: 1px solid var(--iron-border);
    border-radius: 5px;
    padding: 4px 10px;
    text-align: right;
}

.skills-char-plaque .plaque-name {
    font-family: var(--font-heading);
    color: var(--gold-bright);
    font-weight: 700;
    font-size: 0.80rem;
    letter-spacing: 0.05em;
}

.skills-char-plaque .plaque-sub {
    font-size: 0.60rem;
    color: var(--text-muted);
}

#skills-apply-btn {
    background: linear-gradient(180deg, #3d352b 0%, #28221b 100%);
    border: 1px solid #6b573d;
    border-top: 1px solid #8c714e;
    color: #ede7dc;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.76rem;
    padding: 5px 12px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

#skills-apply-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #4d4337 0%, #352c22 100%);
    border-color: #8c714e;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
    transform: translateY(-1px);
}

#skills-apply-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: var(--iron-border);
    background: var(--bg-input);
    box-shadow: none;
}

.apply-count {
    color: var(--gold-bright);
    font-weight: 800;
}

/* CONVERTER EXPANDABLE DRAWER */
.skills-converter-panel {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 20px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.converter-form-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.conv-field {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--text-main);
}

.conv-exchange-arrow {
    color: var(--gold-bright);
    font-weight: 700;
    font-size: 0.8rem;
}

.form-select-sm, .form-input-sm {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
}

.primary-btn-sm {
    background: linear-gradient(180deg, #3d352b 0%, #28221b 100%);
    border: 1px solid #6b573d;
    border-top: 1px solid #8c714e;
    color: #ede7dc;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: var(--font-heading);
    cursor: pointer;
    transition: all 0.15s ease;
}

.primary-btn-sm:hover {
    background: linear-gradient(180deg, #4d4337 0%, #352c22 100%);
    border-color: #8c714e;
    color: #fff;
}

/* NAVIGATION TABS & SEARCH */
.skills-nav-bar {
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.skills-pillar-tabs {
    display: flex;
    gap: 6px;
}

.skills-pillar-tab {
    background: var(--bg-input);
    border: 1px solid var(--iron-border);
    color: var(--text-muted);
    padding: 5px 11px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.skills-pillar-tab:hover {
    background: var(--bg-card-hover);
    color: var(--text-main);
}

.skills-pillar-tab.active {
    background: var(--bg-card);
    border-color: var(--bronze);
    color: var(--bronze-bright);
    box-shadow: 0 0 8px rgba(138, 111, 76, 0.2);
}

.tab-phys.active { border-color: #b84a4f; color: #e8a0a4; box-shadow: 0 0 8px rgba(184, 74, 79, 0.25); }
.tab-ment.active { border-color: #5d7ea6; color: #a9c4df; box-shadow: 0 0 8px rgba(93, 126, 166, 0.25); }
.tab-soc.active  { border-color: #c49a62; color: #e4caa4; box-shadow: 0 0 8px rgba(196, 154, 98, 0.25); }
.tab-spir.active { border-color: #9e7bb8; color: #d8c0eb; box-shadow: 0 0 8px rgba(158, 123, 184, 0.25); }

.skills-nav-center {
    display: flex;
    align-items: center;
    gap: 8px;
}

.skills-view-modes {
    display: flex;
    background: var(--bg-void);
    border: 1px solid var(--iron-border);
    border-radius: 4px;
    padding: 2px;
    gap: 2px;
}

.skills-view-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 3px 9px;
    border-radius: 3px;
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.12s ease;
    white-space: nowrap;
}

.skills-view-btn:hover {
    color: var(--text-main);
}

.skills-view-btn.active {
    background: var(--bg-card);
    color: var(--bronze-bright);
    box-shadow: 0 0 6px rgba(138, 111, 76, 0.25);
}

.skills-search-wrapper {
    flex: 1;
    max-width: 280px;
}

#skills-search-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 5px 10px;
    color: var(--text-main);
    font-size: 0.72rem;
}

#skills-search-input:focus {
    outline: none;
    border-color: var(--bronze);
    box-shadow: 0 0 6px rgba(138, 111, 76, 0.3);
}

/* SCROLLABLE CATALOG BODY */
.skills-catalog-body {
    flex: 1;
    overflow-y: hidden;
    padding: 6px 10px 8px 10px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.skills-catalog-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.skills-group-section {
    margin-bottom: 20px;
}

.skills-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0 6px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 6px;
}

.group-title-accent {
    font-size: 0.75rem;
}

.group-title-text {
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--gold-bright);
    letter-spacing: 0.03em;
}

.group-count {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* SKILLS TABLE & ROWS */
.skills-table {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-card);
    overflow: hidden;
}

.skills-table-header {
    display: grid;
    grid-template-columns: 1fr 140px 140px 110px 80px;
    padding: 6px 10px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.skills-rows {
    display: flex;
    flex-direction: column;
}

.skill-row {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.12s ease;
}

.skill-row:last-child {
    border-bottom: none;
}

.skill-row:hover {
    background: var(--bg-card-hover);
}

.skill-row.row-pending {
    background: rgba(138, 111, 76, 0.15);
    border-left: 3px solid var(--bronze-bright);
}

.skill-main-bar {
    display: grid;
    grid-template-columns: 1fr 140px 140px 110px 80px;
    align-items: center;
    padding: 6px 10px;
    gap: 8px;
    min-height: 38px;
}

.th-expand,
.btn-toggle-expand,
.quad-expand-btn {
    display: none !important;
}

.skill-info-block {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.skill-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skill-row:hover .skill-title {
    color: #fff;
}

.skill-meta-tag {
    font-size: 0.60rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.skill-stats-block {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.skill-stat-chip {
    font-size: 0.60rem;
    font-family: var(--font-mono);
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--bg-void);
    border: 1px solid var(--iron-border);
    color: var(--text-muted);
}

.skill-stat-chip.best {
    background: rgba(138, 111, 76, 0.2);
    border-color: var(--bronze);
    color: var(--bronze-bright);
    font-weight: 700;
}

.skill-cost-block {
    font-size: 0.72rem;
    font-family: var(--font-mono);
}

.cost-prim {
    color: #e8a0a4;
    font-weight: 700;
}

.cost-sec {
    color: #a9c4df;
    font-weight: 700;
}

.cost-discount {
    color: var(--bronze-bright);
    font-size: 0.62rem;
}

.cost-capped {
    color: var(--text-dark);
    font-size: 0.60rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    background: var(--bg-void);
    border: 1px solid var(--iron-dark);
    padding: 2px 5px;
    border-radius: 3px;
}

.skill-ranks-block {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
}

.rank-count {
    font-family: var(--font-mono);
    font-weight: 800;
    color: #fff;
    min-width: 18px;
}

.rank-pending-tag {
    font-family: var(--font-mono);
    color: var(--gold-bright);
    font-weight: 800;
    font-size: 0.72rem;
}

.rank-cap-indicator {
    font-size: 0.58rem;
    color: var(--text-muted);
}

.skill-actions-block {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stepper-btn {
    background: var(--iron-dark);
    border: 1px solid var(--iron-border);
    color: var(--text-main);
    font-size: 0.70rem;
    width: 24px;
    height: 24px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.12s ease;
    padding: 0;
}

.stepper-btn:hover:not(:disabled) {
    background: var(--iron-highlight);
    border-color: var(--bronze);
    color: #fff;
}

.stepper-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: var(--iron-dark);
    color: var(--text-dark);
}

/* EXPANDABLE DETAIL DRAWER */
.skill-detail-drawer {
    background: var(--bg-void);
    border-top: 1px solid var(--iron-border);
    padding: 12px 16px;
    animation: fadeInDrawer 0.15s ease-out;
}

@keyframes fadeInDrawer {
    from { opacity: 0; transform: translateY(-3px); }
    to { opacity: 1; transform: translateY(0); }
}

.drawer-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 15px;
}

.drawer-impact-card, .drawer-milestones-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 10px 12px;
}

.card-heading {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--gold-bright);
    margin-bottom: 8px;
    border-bottom: 1px solid var(--iron-border);
    padding-bottom: 4px;
}

.impact-metric {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.72rem;
}

.metric-title {
    color: var(--text-muted);
}

.metric-value {
    color: var(--bronze-bright);
    font-family: var(--font-mono);
    font-size: 0.80rem;
}

.impact-trigger {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.impact-trigger code {
    background: var(--bg-void);
    border: 1px solid var(--iron-border);
    padding: 2px 6px;
    border-radius: 3px;
    color: var(--bronze-bright);
    font-family: var(--font-mono);
}

.field-progress-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 6px 8px;
}

.field-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.62rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.field-progress-track {
    width: 100%;
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.field-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--bronze) 0%, var(--bronze-bright) 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.field-progress-hint {
    font-size: 0.58rem;
    color: var(--text-dark);
    line-height: 1.25;
}

.milestones-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.milestone-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    padding: 3px 6px;
    border-radius: 3px;
    background: var(--bg-input);
    border: 1px solid var(--iron-border);
}

.milestone-item.unlocked {
    border-color: rgba(196, 165, 122, 0.35);
    background: rgba(138, 111, 76, 0.12);
}

.milestone-item.unlocked .milestone-badge {
    color: var(--bronze-bright);
    font-weight: 700;
    font-family: var(--font-mono);
}

.milestone-item.unlocked .milestone-text {
    color: var(--text-main);
}

.milestone-item.locked {
    opacity: 0.5;
}

.milestone-item.locked .milestone-badge {
    color: var(--text-dark);
    font-family: var(--font-mono);
}

.milestone-item.locked .milestone-text {
    color: var(--text-muted);
}

.skills-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.empty-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--gold-bright);
    margin-bottom: 4px;
}

.empty-sub {
    font-size: 0.72rem;
}

/* ==========================================================================
   4-PILLAR SIMULTANEOUS QUAD GRID (ALL 112 SKILLS TOGETHER ON 1 PAGE)
   ========================================================================== */

.skills-quad-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    height: 100%;
    min-height: 0;
    align-items: stretch;
}

@media (max-width: 1100px) {
    .skills-quad-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 680px) {
    .skills-quad-grid {
        grid-template-columns: 1fr;
    }
}

.quad-pillar-column {
    background: var(--bg-card);
    border: 1px solid var(--pillar-border, var(--border-color));
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    min-width: 0;
}

.quad-column-header {
    background: linear-gradient(180deg, var(--pillar-bg, rgba(255, 255, 255, 0.03)) 0%, var(--bg-card) 100%);
    border-bottom: 2px solid var(--pillar-accent, var(--bronze));
    padding: 4px 8px;
    flex-shrink: 0;
}

.quad-header-top {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 1px;
}

.quad-pillar-icon {
    font-size: 0.85rem;
}

.quad-pillar-name {
    font-family: var(--font-heading);
    font-size: 0.80rem;
    font-weight: 700;
    color: var(--gold-bright);
    letter-spacing: 0.03em;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quad-pillar-badge {
    font-family: var(--font-mono);
    font-size: 0.54rem;
    font-weight: 800;
    padding: 0 4px;
    border-radius: 3px;
    background: var(--bg-void);
    border: 1px solid var(--pillar-accent, var(--bronze));
    color: var(--pillar-accent, var(--bronze));
}

.quad-header-sub {
    font-size: 0.54rem;
    color: var(--text-muted);
    line-height: 1.15;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quad-pillar-stats {
    font-size: 0.56rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

.quad-column-scroll {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 3px 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    scrollbar-width: thin;
    scrollbar-color: var(--pillar-accent, var(--steel)) var(--bg-void);
}

.quad-column-scroll::-webkit-scrollbar {
    width: 5px;
}

.quad-column-scroll::-webkit-scrollbar-track {
    background: var(--bg-void);
    border-radius: 3px;
}

.quad-column-scroll::-webkit-scrollbar-thumb {
    background: var(--pillar-accent, var(--iron-highlight));
    border-radius: 3px;
}

.quad-column-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--bronze-bright);
}

/* QUAD CATEGORY BREAKOUTS */
.quad-category-breakout {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(44, 49, 63, 0.5);
}

.quad-category-breakout:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.quad-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 6px;
    background: rgba(17, 23, 38, 0.7);
    border-radius: 3px;
    border-left: 2px solid var(--pillar-accent, var(--bronze));
    margin-bottom: 2px;
}

.quad-cat-badge {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--pillar-accent, var(--bronze-bright));
    font-family: var(--font-heading);
}

.quad-cat-count {
    font-size: 0.58rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* COMPACT QUAD SKILL CARD - HIGH CONTRAST FANTASY CARD AESTHETIC */
.quad-skill-card {
    background: var(--bg-input);
    border: 1px solid var(--iron-border);
    border-radius: 4px;
    transition: background 0.12s ease, border-color 0.12s ease;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    min-height: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.quad-skill-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--pillar-accent, var(--bronze));
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.quad-skill-card.quad-pending {
    background: #241c14;
    border: 1px solid var(--bronze-bright);
    border-left: 3px solid var(--bronze-bright);
    box-shadow: 0 0 8px rgba(138, 111, 76, 0.35);
}

.quad-skill-card.quad-card-expanded {
    border-color: var(--pillar-accent, var(--bronze));
    background: var(--bg-card);
}

.quad-card-main {
    display: flex;
    align-items: center;
    padding: 2px 5px;
    gap: 4px;
    min-height: 22px;
    width: 100%;
    box-sizing: border-box;
}

.quad-card-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 3px 6px 1px 6px;
    width: 100%;
    box-sizing: border-box;
}

.quad-card-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 1px 6px 3px 6px;
    width: 100%;
    box-sizing: border-box;
}

.quad-skill-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.quad-expand-btn {
    font-size: 0.52rem;
    padding: 0;
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pillar-accent, var(--bronze));
    background: transparent;
    border: none;
    cursor: pointer;
    opacity: 0.85;
    transition: transform 0.12s, opacity 0.12s;
}

.quad-expand-btn:hover {
    opacity: 1;
    transform: scale(1.15);
}

.quad-skill-meta {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 4px;
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
}

.quad-skill-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: normal;
    overflow: hidden;
    letter-spacing: 0.01em;
    line-height: 1.2;
    flex: 1 1 auto;
}

.quad-skill-card:hover .quad-skill-name {
    color: var(--gold-bright);
}

.quad-stat-tag {
    font-size: 0.52rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: var(--bg-void);
    border: 1px solid var(--iron-dark);
    padding: 0 3px;
    border-radius: 2px;
    white-space: nowrap;
    line-height: 1.2;
    flex-shrink: 0;
}

.quad-skill-cost {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    white-space: nowrap;
    background: var(--bg-void);
    border: 1px solid var(--iron-dark);
    padding: 1px 4px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    line-height: 1.1;
}

.quad-cost-prim {
    color: #e8a0a4;
    font-weight: 800;
}

.quad-cost-sec {
    color: #a9c4df;
    font-weight: 800;
}

.quad-cost-sep {
    color: var(--text-dark);
    font-size: 0.56rem;
}

.quad-cost-capped {
    font-size: 0.54rem;
    color: var(--text-muted);
    background: var(--bg-void);
    border: 1px solid var(--iron-dark);
    padding: 0 3px;
    border-radius: 2px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.quad-skill-rank {
    display: flex;
    align-items: baseline;
    gap: 2px;
    font-size: 0.68rem;
    white-space: nowrap;
    background: var(--bg-void);
    border: 1px solid var(--iron-dark);
    padding: 1px 4px;
    border-radius: 3px;
    flex-shrink: 0;
    line-height: 1.1;
}

.quad-rank-val {
    font-family: var(--font-mono);
    font-weight: 900;
    color: #ffffff;
    font-size: 0.74rem;
}

.quad-rank-staged {
    font-family: var(--font-mono);
    color: var(--gold-bright);
    font-weight: 900;
    font-size: 0.65rem;
}

.quad-cap-tag {
    font-size: 0.50rem;
    color: var(--text-dark);
    font-family: var(--font-mono);
}

.quad-skill-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.quad-skill-actions .stepper-btn {
    width: 17px;
    height: 17px;
    font-size: 0.72rem;
    background: var(--iron-dark);
    border: 1px solid var(--iron-border);
    color: var(--text-main);
    border-radius: 3px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    line-height: 1;
}

.quad-skill-actions .stepper-btn:hover:not(:disabled) {
    background: var(--iron-highlight);
    border-color: var(--pillar-accent, var(--bronze));
    color: var(--bronze-bright);
}

.quad-skill-actions .stepper-btn:disabled {
    opacity: 0.25;
    border-color: var(--iron-dark);
    cursor: not-allowed;
    background: var(--bg-void);
    color: var(--text-dark);
}

/* ============================================================================
   SPECTRAL GHOST STATE OVERLAY & AURA
   ============================================================================ */
.spectral-ghost-mode {
    filter: grayscale(0.55) hue-rotate(185deg) contrast(1.15) !important;
    transition: filter 0.5s ease;
}

#spectral-ghost-banner {
    position: fixed;
    top: 52px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    width: min(720px, 94vw);
    background: linear-gradient(180deg, rgba(8, 28, 36, 0.96) 0%, rgba(4, 15, 20, 0.94) 100%);
    border: 2px solid #38bdf8;
    box-shadow: 0 0 24px rgba(56, 189, 248, 0.6), inset 0 0 16px rgba(56, 189, 248, 0.2);
    border-radius: 8px;
    padding: 8px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    backdrop-filter: blur(6px);
    animation: ghostPulse 3s infinite alternate ease-in-out;
}

@keyframes ghostPulse {
    0% { box-shadow: 0 0 16px rgba(56, 189, 248, 0.4), inset 0 0 10px rgba(56, 189, 248, 0.15); }
    100% { box-shadow: 0 0 28px rgba(56, 189, 248, 0.75), inset 0 0 20px rgba(56, 189, 248, 0.3); }
}

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

.spectral-title {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 800;
    color: #e0f2fe;
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.spectral-decay-timer {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: #7dd3fc;
    background: rgba(14, 116, 144, 0.35);
    border: 1px solid #0891b2;
    padding: 2px 8px;
    border-radius: 4px;
}

.spectral-desc {
    font-size: 0.68rem;
    color: #bae6fd;
    line-height: 1.35;
}

.spectral-actions-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 2px;
}

.spectral-btn {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 3px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.spectral-btn.depart {
    background: #451215;
    border: 1px solid #dc2626;
    color: #fca5a5;
}

.spectral-btn.depart:hover {
    background: #7f1d1d;
    border-color: #f87171;
    color: #fff;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.spectral-btn.call {
    background: #0e3b43;
    border: 1px solid #06b6d4;
    color: #67e8f9;
}

.spectral-btn.call:hover {
    background: #155e75;
    border-color: #22d3ee;
    color: #fff;
    box-shadow: 0 0 8px rgba(34, 211, 238, 0.5);
}

/* ============================================================================
   BANK OF AETHEL VAULT & BALANCE SHEET STYLES
   ============================================================================ */
.bank-vault-modal-panel {
    width: min(720px, 95vw);
    max-height: 88vh;
    background: var(--bg-panel);
    border: 2px solid var(--gold);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bank-vault-tabs {
    display: flex;
    background: #0d0c11;
    border-bottom: 1px solid #332b1e;
    padding: 4px 8px 0 8px;
    gap: 4px;
}

.bank-tab-btn {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 6px 14px;
    background: #18151f;
    border: 1px solid #3a3225;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    color: #a8a29e;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bank-tab-btn:hover {
    color: #fef08a;
    background: #231e2c;
}

.bank-tab-btn.active {
    background: var(--bg-panel);
    color: var(--gold-bright);
    border-color: var(--gold);
    border-bottom: 1px solid var(--bg-panel);
}

.bank-vault-body {
    padding: 12px 16px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bank-balance-summary-card {
    background: #0e0d13;
    border: 1px solid #574523;
    border-radius: 6px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bank-balance-summary-card.fellowship {
    border-color: #1e3a8a;
    background: #0b1120;
}

.bank-balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bank-bal-label {
    font-size: 0.75rem;
    color: #d6d3d1;
}

.bank-bal-val {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--gold-bright);
}

.bank-bal-sub {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: #94a3b8;
}

.bank-action-form {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #292524;
}

.bank-action-form input {
    background: #17151f;
    border: 1px solid #44403c;
    color: #fff;
    padding: 3px 8px;
    font-size: 0.72rem;
    border-radius: 4px;
    width: 140px;
}

.vault-items-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.vault-items-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 700;
    color: #e7e5e4;
    border-bottom: 1px solid #292524;
    padding-bottom: 4px;
}

.vault-items-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}

.vault-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #14121a;
    border: 1px solid #292524;
    padding: 4px 8px;
    border-radius: 4px;
}

.vault-item-name {
    font-size: 0.72rem;
    color: #f5f5f4;
}

.vault-item-depositor {
    font-size: 0.62rem;
    color: #78716c;
    font-style: italic;
    margin-left: 6px;
}

.bank-vault-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #0d0c11;
    border-top: 1px solid #332b1e;
    padding: 8px 14px;
}

.bank-footer-hint {
    font-size: 0.62rem;
    color: #78716c;
    font-family: var(--font-mono);
}

/* ==========================================================================
   FULLSCREEN REALM PORTAL & GATEWAY (EARTHEN & WEATHERED METAL WEBPAGE)
   ========================================================================== */

.modal-backdrop.portal-backdrop {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: #0d0c0a;
    background-image: 
        radial-gradient(ellipse at 50% 0%, rgba(138, 111, 76, 0.12) 0%, transparent 65%),
        radial-gradient(circle at 10% 90%, rgba(59, 53, 45, 0.25) 0%, transparent 45%),
        linear-gradient(180deg, #14120f 0%, #0d0c0a 100%);
    backdrop-filter: none;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    margin: 0;
}

.portal-panel {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    display: flex;
    flex-direction: column;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
}

.portal-header {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    background: #14120f;
    border-bottom: 1px solid #3d352b;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
    flex-shrink: 0;
    gap: 16px;
    z-index: 10;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-brand-emblem {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-emblem-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--gold);
    box-shadow: 0 0 10px rgba(212, 160, 23, 0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.brand-emblem-img:hover {
    transform: scale(1.08) rotate(5deg);
    box-shadow: 0 0 16px rgba(212, 160, 23, 0.7);
}

.portal-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--bronze-bright);
    letter-spacing: 0.12em;
    margin: 0;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

.portal-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    display: block;
}

.portal-nav {
    display: flex;
    gap: 6px;
    background: #0f0d0b;
    padding: 4px;
    border-radius: 6px;
    border: 1px solid #332d24;
}

.portal-nav-tab {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 7px 16px;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.portal-nav-tab:hover {
    color: #ede7dc;
    background: #1c1915;
    border-color: #42382c;
}

.portal-nav-tab.active {
    background: #241f19;
    color: #ede7dc;
    border-color: #6e583c;
    box-shadow: inset 0 0 10px rgba(138, 111, 76, 0.2);
}

.portal-nav-tab.gold-pill {
    color: var(--bronze-bright);
}
.portal-nav-tab.gold-pill.active {
    background: #29221a;
    border-color: #8c714e;
    color: #f5ebe0;
    box-shadow: inset 0 0 12px rgba(140, 113, 78, 0.25);
}

.portal-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-return-btn {
    background: linear-gradient(180deg, #3d3429 0%, #26211a 100%);
    border: 1px solid #6b573d;
    color: #ede7dc;
    font-family: var(--font-heading);
    font-size: 0.76rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.portal-return-btn:hover {
    background: linear-gradient(180deg, #4d4234 0%, #302a21 100%);
    border-color: #8c714e;
    color: #ffffff;
    transform: translateY(-1px);
}

.portal-account-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #161411;
    border: 1px solid #383127;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.pab-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #8a6f4c;
    box-shadow: 0 0 6px rgba(138, 111, 76, 0.6);
}

.portal-tab-content {
    padding: 2.5rem 2rem 4rem 2rem;
    overflow-y: auto;
    flex-grow: 1;
    display: none;
    width: 100%;
}

.portal-tab-content.active {
    display: block;
    animation: portalTabFade 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

#tab-gateway.portal-tab-content {
    padding: 0;
    overflow: hidden;
    height: calc(100vh - 64px);
    max-height: calc(100vh - 64px);
    box-sizing: border-box;
}

#tab-gateway.portal-tab-content.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

@media (max-height: 560px) {
    #tab-gateway.portal-tab-content {
        overflow-y: auto;
    }
}

.portal-tab-content > * {
    max-width: 1140px;
    margin-left: auto;
    margin-right: auto;
}

@keyframes portalTabFade {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- GATEWAY & AUTH TAB --- */
.gateway-hero {
    text-align: center;
    margin-bottom: 28px;
}

.gateway-hero-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--text-main);
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.gateway-hero-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ============================================================== */
/* LUXURY SINGLE-COLUMN GATEWAY CARD & AUTHENTICATION STYLING    */
/* ============================================================== */

.gateway-card-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 8px 16px;
    box-sizing: border-box;
}

.gateway-card {
    max-width: 420px;
    width: 100%;
    background: linear-gradient(180deg, #131926 0%, #0c101a 100%);
    border: 1px solid rgba(212, 160, 23, 0.28);
    border-radius: 10px;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.04);
    padding: 16px 24px 12px 24px;
    position: relative;
    box-sizing: border-box;
}

@media (max-width: 500px) {
    .gateway-card {
        padding: 14px 14px 10px 14px;
        border-radius: 8px;
    }
}

.gateway-card-header {
    text-align: center;
    margin-bottom: 10px;
}

.gateway-emblem {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}

.gateway-emblem-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gold);
    box-shadow: 0 0 16px rgba(212, 160, 23, 0.45), 0 4px 14px rgba(0, 0, 0, 0.6);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gateway-emblem-img:hover {
    transform: scale(1.06);
    box-shadow: 0 0 24px rgba(212, 160, 23, 0.7), 0 6px 20px rgba(0, 0, 0, 0.75);
}

.gateway-card-title {
    font-family: var(--font-heading);
    font-size: 1.12rem;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: 0.05em;
    margin: 0 0 3px 0;
    text-transform: uppercase;
}

.gateway-card-subtitle {
    font-size: 0.72rem;
    color: #94a3b8;
    margin: 0;
    line-height: 1.35;
}

/* Segmented Control (Sign In / Create Account) */
.auth-segmented-control {
    display: flex;
    background: rgba(8, 11, 18, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 2px;
    margin-bottom: 10px;
    gap: 3px;
}

.auth-segment-btn {
    flex: 1;
    padding: 5px 10px;
    background: transparent;
    border: 1px solid transparent;
    color: #94a3b8;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.78rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.16s ease;
}

.auth-segment-btn:hover {
    color: #e2e8f0;
}

.auth-segment-btn.active {
    background: linear-gradient(135deg, rgba(212, 160, 23, 0.22), rgba(160, 115, 12, 0.12));
    color: var(--gold-bright);
    border-color: var(--gold);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Connected OAuth Identity Chip */
.oauth-connected-box {
    background: rgba(18, 25, 40, 0.85);
    border: 1px solid var(--gold);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 10px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.ocb-user-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ocb-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: #1e283d;
    border: 1px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.ocb-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ocb-meta {
    flex: 1;
    min-width: 0;
}

.ocb-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ocb-name-row strong {
    color: #f8fafc;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ocb-badge {
    font-size: 0.60rem;
    text-transform: uppercase;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid #3b82f6;
    color: #93c5fd;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.ocb-email {
    font-size: 0.70rem;
    color: #94a3b8;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ocb-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Gateway Form Fields */
.gateway-form .form-field {
    margin-top: 6px;
}

.gateway-form .form-field:first-child {
    margin-top: 0;
}

.gateway-form .form-field label {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 3px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.field-optional {
    font-weight: 400;
    color: #64748b;
    font-size: 0.65rem;
    text-transform: none;
}

.gateway-form input[type="text"],
.gateway-form input[type="email"],
.gateway-form input[type="password"] {
    width: 100%;
    padding: 6px 10px;
    height: 33px;
    background: #090c14;
    border: 1px solid #243044;
    border-radius: 5px;
    color: #f8fafc;
    font-family: var(--font-body);
    font-size: 0.84rem;
    box-sizing: border-box;
    transition: all 0.16s ease;
}

.gateway-form input[type="text"]:focus,
.gateway-form input[type="email"]:focus,
.gateway-form input[type="password"]:focus {
    border-color: var(--gold);
    outline: none;
    box-shadow: 0 0 0 2px rgba(212, 160, 23, 0.22);
    background: #0d121c;
}

.form-row-remember {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.70rem;
    color: #94a3b8;
    margin-top: 6px;
}

.remember-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.remember-label input[type="checkbox"] {
    accent-color: var(--gold);
    cursor: pointer;
}

/* Primary Submit Button */
.gateway-submit-btn {
    width: 100%;
    padding: 8px 16px;
    height: 36px;
    font-size: 0.80rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: 5px;
    background: linear-gradient(180deg, #d4a017 0%, #a6790d 100%);
    border: 1px solid #ffd466;
    color: #0a0d14;
    cursor: pointer;
    transition: all 0.16s ease;
    box-shadow: 0 3px 12px rgba(212, 160, 23, 0.35);
    margin-top: 8px;
}

.gateway-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 18px rgba(212, 160, 23, 0.5);
    filter: brightness(1.08);
}

/* Horizontal Divider */
.auth-divider-h {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 8px 0 6px 0;
}

.auth-divider-h::before,
.auth-divider-h::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-divider-h span {
    padding: 0 8px;
    font-size: 0.58rem;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: var(--font-mono);
}

/* Social Stack (Dual Column compact row) */
.auth-social-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
}

.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 5px 10px;
    height: 33px;
    border-radius: 5px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.16s ease;
    border: 1px solid transparent;
    box-sizing: border-box;
    user-select: none;
    white-space: nowrap;
}

.oauth-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.oauth-google {
    background: #ffffff;
    color: #1e293b;
    border-color: #cbd5e1;
}

.oauth-google:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.oauth-facebook {
    background: #1877f2;
    color: #ffffff;
}

.oauth-facebook:hover {
    background: #166fe5;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(24, 119, 242, 0.4);
}

/* Guest Access Link */
.auth-guest-row {
    text-align: center;
    margin-top: 6px;
}

.auth-guest-link {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s ease;
    padding: 2px 6px;
    font-family: var(--font-body);
}

.auth-guest-link:hover {
    color: var(--gold-bright);
    text-decoration: underline;
}

/* Discreet Server Settings & Hidden Admin Gear */
.gateway-card-footer {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.68rem;
    color: #64748b;
}

.adv-server-mini {
    position: relative;
}

.adv-server-trigger {
    background: none;
    border: 1px solid #1e283d;
    border-radius: 4px;
    padding: 2px 6px;
    color: #64748b;
    font-size: 0.65rem;
    font-family: var(--font-mono);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
}

.adv-server-trigger:hover {
    color: #cbd5e1;
    border-color: #334460;
}

.lan-badge-mini {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    padding: 1px 4px;
    border-radius: 2px;
    font-size: 0.62rem;
    font-weight: 700;
}

.adv-server-popover {
    margin-top: 6px;
}

.adv-server-popover input {
    width: 190px;
    padding: 4px 8px;
    font-size: 0.72rem;
    font-family: var(--font-mono);
    background: #080b12;
    border: 1px solid #28354b;
    color: #cbd5e1;
    border-radius: 4px;
    box-sizing: border-box;
}

.dev-oauth-icon-btn {
    background: none;
    border: none;
    color: #334155;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.15s ease;
}

.dev-oauth-icon-btn:hover {
    color: var(--gold);
}

/* --- LORE & STORY TAB --- */
.lore-header-banner, .store-header-banner {
    text-align: center;
    margin-bottom: 28px;
}

.lore-title, .store-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--bronze-bright);
    margin: 0 0 8px 0;
    letter-spacing: 0.04em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.lore-subtitle, .store-subtitle {
    font-size: 0.86rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.5;
}

.lore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 20px;
}

.lore-card {
    background: #171411;
    border: 1px solid #362f25;
    border-radius: 6px;
    padding: 22px;
    position: relative;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.lore-card:hover {
    border-color: #695438;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.lore-card-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bronze-bright);
    background: #241f19;
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid #574530;
}

.lore-card-title {
    font-family: var(--font-heading);
    font-size: 1.08rem;
    color: #ede7dc;
    margin: 0 0 12px 0;
}

.lore-card-text {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 14px;
}

.lore-card-highlight {
    background: #110f0d;
    border-left: 3px solid var(--bronze);
    padding: 10px 14px;
    font-size: 0.78rem;
    color: #d6caa8;
    border-radius: 0 4px 4px 0;
    line-height: 1.45;
}

/* --- STORE TAB --- */
.store-price-flag {
    display: inline-block;
    background: #241f19;
    border: 1px solid #5e4b33;
    color: var(--bronze-bright);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.store-card {
    background: #171411;
    border: 1px solid #362f25;
    border-radius: 6px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.2s ease;
}

.store-card:hover {
    border-color: #6b5539;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.65);
}

.store-card-featured {
    border-color: #634f36;
    background: linear-gradient(180deg, #221c16 0%, #171411 100%);
}

.store-card-founders {
    border-color: #6e442d;
    background: linear-gradient(180deg, #241914 0%, #171411 100%);
}

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

.store-sku-tag {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--text-dark);
    background: #110f0d;
    padding: 2px 8px;
    border-radius: 3px;
    border: 1px solid #2e2820;
    letter-spacing: 0.04em;
}

.featured-tag {
    color: var(--bronze-bright);
    background: #2b231a;
    border-color: #5c4731;
}

.gold-tag {
    color: #e09f7a;
    background: #2b1d16;
    border-color: #693e28;
}

.store-card-price {
    font-family: var(--font-heading);
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--bronze-bright);
}
.store-card-price span {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-body);
}

.store-card-icon {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.store-card-title {
    font-family: var(--font-heading);
    font-size: 0.98rem;
    color: #ede7dc;
    margin: 0 0 8px 0;
}

.store-card-desc {
    font-size: 0.76rem;
    color: var(--text-muted);
    line-height: 1.45;
    margin-bottom: 14px;
    flex-grow: 1;
}

.store-card-features {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
    border-top: 1px solid #2e2820;
    padding-top: 10px;
}

.store-card-features li {
    font-size: 0.72rem;
    color: #c4b9a9;
    margin-bottom: 5px;
}

.store-buy-btn {
    font-size: 0.78rem;
    padding: 9px;
}

.gold-glow-btn {
    background: linear-gradient(180deg, #47392a 0%, #2b2116 100%);
    border: 1px solid #73593b;
    color: #ede7dc;
}
.gold-glow-btn:hover {
    background: linear-gradient(180deg, #574634 0%, #362a1c 100%);
    border-color: #8c704c;
    box-shadow: 0 0 16px rgba(140, 112, 76, 0.35);
}

/* --- SYSTEMS TAB --- */
.systems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.system-card {
    background: #171411;
    border: 1px solid #362f25;
    border-radius: 6px;
    padding: 18px;
}

.system-icon {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.system-card h3 {
    font-family: var(--font-heading);
    font-size: 0.98rem;
    color: #ede7dc;
    margin: 0 0 8px 0;
}

.system-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

/* --- SYSTEMS & LORE EXTENSIONS --- */
#tab-combat > * {
    max-width: 1240px;
}

.combat-stream-layout {
    display: flex;
    flex-direction: column;
    gap: 22px;
    width: 100%;
}

.combat-widget {
    background: #171411;
    border: 1px solid #362f25;
    border-radius: 8px;
    padding: 24px 28px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.55);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.combat-widget:hover {
    border-color: #5c4731;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.7);
}

.combat-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
    border-bottom: 1px solid #2e2820;
    padding-bottom: 12px;
}

.combat-widget-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: #ede7dc;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.combat-widget-tag {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bronze-bright);
    background: #241f19;
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid #574530;
}

.combat-widget-desc {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0 0 16px 0;
}

.combat-subgrid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.combat-subgrid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.combat-formula-banner {
    background: linear-gradient(135deg, #1c1712 0%, #0d0c0a 100%);
    border: 1px solid #73593b;
    border-radius: 8px;
    padding: 22px 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.65);
    width: 100%;
    box-sizing: border-box;
}

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

.combat-formula-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--bronze-bright);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.combat-formula-tag {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: #e0caa8;
    background: #2b2116;
    border: 1px solid #574530;
    padding: 3px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.combat-formula-box {
    background: #090a0d;
    border: 1px solid #3d3325;
    border-radius: 6px;
    padding: 16px 20px;
    font-family: var(--font-mono);
    font-size: 1.05rem;
    color: #f7e6c4;
    text-align: center;
    letter-spacing: 0.04em;
    overflow-x: auto;
    margin-bottom: 14px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.85);
}

.combat-formula-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

/* 3-Stage Resolution Pipeline */
.combat-stages-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin: 16px 0 8px 0;
}

.combat-stage-card {
    background: #12100d;
    border: 1px solid #2e2820;
    border-radius: 6px;
    padding: 18px;
    position: relative;
    border-top: 3px solid #574530;
}

.combat-stage-card.stage-evasion { border-top-color: #4a88b5; }
.combat-stage-card.stage-deflection { border-top-color: #cf9b44; }
.combat-stage-card.stage-mitigation { border-top-color: #b54a4a; }

.combat-stage-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: 3px;
    display: inline-block;
    margin-bottom: 10px;
}

.stage-evasion .combat-stage-badge { background: #162635; color: #7cb8eb; }
.stage-deflection .combat-stage-badge { background: #2f2312; color: #e6b763; }
.stage-mitigation .combat-stage-badge { background: #2f1313; color: #eb7c7c; }

.combat-stage-title {
    font-family: var(--font-heading);
    font-size: 0.98rem;
    color: #ede7dc;
    margin: 0 0 8px 0;
}

.combat-stage-text {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin: 0;
}

/* Full-Width Combat Data Tables */
.combat-table-wrap {
    overflow-x: auto;
    margin: 16px 0 8px 0;
    border: 1px solid #362f25;
    border-radius: 6px;
    background: #110f0d;
    -webkit-overflow-scrolling: touch;
}

.combat-data-table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
    font-size: 0.82rem;
    text-align: left;
}

.combat-data-table th {
    background: #1c1712;
    color: var(--bronze-bright);
    font-family: var(--font-heading);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 14px;
    border-bottom: 2px solid #574530;
    white-space: nowrap;
}

.combat-data-table td {
    padding: 11px 14px;
    border-bottom: 1px solid #241f19;
    color: #c9bea9;
    vertical-align: middle;
}

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

.combat-data-table tr:hover td {
    background: rgba(140, 112, 76, 0.08);
    color: #f7e6c4;
}

.combat-data-table .col-rank {
    width: 80px;
    white-space: nowrap;
}

.combat-data-table .col-class {
    width: 140px;
    white-space: nowrap;
    font-weight: 600;
    color: #ede7dc;
}

.combat-data-table .col-margin {
    width: 120px;
    white-space: nowrap;
    font-family: var(--font-mono);
}

.combat-data-table .col-bleed {
    width: 100px;
    white-space: nowrap;
}

.combat-data-table .col-rt {
    width: 110px;
    white-space: nowrap;
}

.combat-data-table .col-desc {
    min-width: 320px;
    line-height: 1.5;
}

.table-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    white-space: nowrap;
}

.badge-green { background: #132417; color: #62c474; border: 1px solid #254a2c; }
.badge-blue { background: #12212f; color: #6bb0eb; border: 1px solid #1f3d59; }
.badge-gold { background: #291e12; color: #e6b45a; border: 1px solid #543f25; }
.badge-red { background: #2c1212; color: #e86464; border: 1px solid #572525; }
.badge-purple { background: #22142e; color: #bb72f0; border: 1px solid #4a2869; }

.combat-calc-card {
    background: #12100d;
    border: 1px solid #2e2820;
    border-radius: 6px;
    padding: 16px 20px;
    margin-top: 12px;
}

.combat-calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    padding: 8px 0;
    border-bottom: 1px dashed #262019;
    flex-wrap: wrap;
    gap: 8px;
}

.combat-calc-row:last-child {
    border-bottom: none;
}

.combat-calc-row strong {
    color: #ede7dc;
}

.combat-calc-row code {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    background: #0a0907;
    padding: 3px 8px;
    border-radius: 3px;
    border: 1px solid #2e2820;
    color: #e6b45a;
}

.lore-card-subtitle-tag {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--bronze-bright);
    margin: -6px 0 10px 0;
    display: block;
}

/* --- CHECKOUT MODAL --- */
.checkout-panel {
    max-width: 480px;
    width: 90vw;
}

.checkout-summary-box {
    background: #110f0d;
    border: 1px solid #3d352b;
    border-radius: 6px;
    padding: 14px 18px;
}

.cs-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.84rem;
    color: #c9bea9;
    margin-bottom: 6px;
}
.cs-row:last-child {
    margin-bottom: 0;
}

.gold-text {
    color: var(--bronze-bright);
    font-size: 1.08rem;
    font-weight: 700;
}

.checkout-status {
    margin-top: 14px;
    padding: 10px;
    border-radius: 4px;
    font-size: 0.78rem;
    text-align: center;
}
.checkout-status.success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid #059669;
    color: #a7f3d0;
}
.checkout-status.error {
    background: rgba(220, 38, 38, 0.12);
    border: 1px solid #dc2626;
    color: #fca5a5;
}

/* ============================================================== */
/* OAUTH INTEGRATION, CONNECTED CARD & DOMAINS SETUP STYLES */
/* ============================================================== */

.oauth-connected-box {
    margin-top: 10px;
    padding: 10px 12px;
    background: #171d2b;
    border: 1px solid var(--gold);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ocb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
}

.ocb-badge {
    padding: 2px 6px;
    background: rgba(212, 160, 23, 0.2);
    border: 1px solid var(--gold);
    color: var(--gold-bright);
    border-radius: 3px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ocb-status {
    color: #34d399;
    font-weight: 600;
}

.ocb-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ocb-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #253147;
    border: 1px solid #3b4252;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    overflow: hidden;
}

.ocb-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.ocb-info strong {
    font-size: 0.85rem;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ocb-info span {
    font-size: 0.72rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ocb-actions {
    display: flex;
    gap: 8px;
    margin-top: 2px;
}

.oauth-config-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding: 6px 10px;
    background: rgba(22, 32, 53, 0.6);
    border: 1px solid #2a374d;
    border-radius: 4px;
}

.oauth-config-btn {
    background: none;
    border: none;
    color: #cbd5e1;
    font-size: 0.74rem;
    font-family: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 4px;
    transition: color 0.15s ease;
}

.oauth-config-btn:hover {
    color: var(--gold-bright);
}

.oauth-status-indicator {
    font-size: 0.68rem;
    font-family: var(--font-mono);
    color: #94a3b8;
}

.oauth-status-indicator.ready {
    color: #34d399;
}

.oauth-status-indicator.partial {
    color: #fbbf24;
}

/* OAuth Config Modal */
.oauth-config-panel {
    max-width: 620px;
    width: 95%;
}

.oauth-domains-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

@media (max-width: 600px) {
    .oauth-domains-grid {
        grid-template-columns: 1fr;
    }
}

.oauth-domain-card {
    background: #0f141f;
    border: 1px solid #232d3f;
    border-radius: 4px;
    padding: 10px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.odc-icon {
    font-size: 1.3rem;
    line-height: 1;
}

.odc-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.odc-title {
    font-size: 0.7rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.odc-code {
    font-family: var(--font-mono);
    font-size: 0.86rem;
    color: var(--gold-bright);
    font-weight: 700;
}

.odc-desc {
    font-size: 0.68rem;
    color: #64748b;
    line-height: 1.25;
}

.oauth-provider-section {
    background: #111726;
    border: 1px solid #27354d;
    border-radius: 4px;
    padding: 12px 14px;
}

.ops-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: #f1f5f9;
}

.ops-header strong {
    flex: 1;
}

.oauth-help-link {
    font-size: 0.72rem;
    color: #60a5fa;
    text-decoration: none;
    transition: color 0.15s ease;
}

.oauth-help-link:hover {
    color: #93c5fd;
    text-decoration: underline;
}

.oauth-input {
    width: 100%;
    padding: 8px 10px;
    background: #0a0d14;
    border: 1px solid #3b4b66;
    border-radius: 4px;
    color: #f8fafc;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    box-sizing: border-box;
}

.oauth-input:focus {
    border-color: var(--gold);
    outline: none;
    box-shadow: 0 0 0 1px var(--gold);
}

.oauth-help-text {
    margin-top: 8px;
    font-size: 0.7rem;
    color: #8fa0b5;
    line-height: 1.4;
    background: rgba(10, 13, 20, 0.4);
    padding: 8px;
    border-radius: 3px;
    border-left: 2px solid var(--gold);
}

.oauth-help-text code {
    font-family: var(--font-mono);
    color: #fcd34d;
    background: rgba(0, 0, 0, 0.3);
    padding: 1px 4px;
    border-radius: 2px;
}

.oauth-status-alert {
    margin-top: 14px;
    padding: 10px;
    border-radius: 4px;
    font-size: 0.78rem;
    line-height: 1.4;
}

.oauth-status-alert.success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid #10b981;
    color: #6ee7b7;
}

.oauth-status-alert.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid #ef4444;
    color: #fca5a5;
}

.oauth-config-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Official horologe.store Banner */
.store-external-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 16px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(212, 160, 23, 0.12), rgba(22, 32, 53, 0.85));
    border: 1px solid var(--gold);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

@media (max-width: 640px) {
    .store-external-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
}

.store-external-content {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.store-external-badge {
    padding: 4px 8px;
    background: var(--gold);
    color: #000;
    font-weight: 800;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    border-radius: 4px;
    flex-shrink: 0;
    letter-spacing: 0.04em;
}

.store-external-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.78rem;
}

.store-external-details strong {
    color: #f8fafc;
}

.store-external-details span {
    color: #c9bea9;
}

.store-external-link-btn {
    padding: 7px 14px;
    background: #1e293b;
    border: 1px solid var(--gold-bright);
    color: var(--gold-bright);
    font-weight: 700;
    font-size: 0.78rem;
    border-radius: 4px;
    text-decoration: none;
    white-space: nowrap;
    text-align: center;
    transition: all 0.15s ease;
}

.store-external-link-btn:hover {
    background: var(--gold);
    color: #0a0d14;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 160, 23, 0.3);
}

/* ==========================================================================
   CHARACTER GENESIS (4-STEP PROGRESSIVE WIZARD) & CK3 NESTED TOOLTIPS
   ========================================================================== */

/* Fullscreen Character Genesis Layout */
.fullscreen-chargen {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    background: rgba(9, 8, 7, 0.96);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    margin: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.chargen-modal-panel {
    width: 96vw;
    max-width: 1400px;
    height: 96vh;
    max-height: 920px;
    border-radius: 8px;
    border: 1.5px solid var(--border-color);
    box-shadow: 0 0 45px rgba(0, 0, 0, 0.95), 0 0 25px var(--border-glow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 0%, #1f1b16 0%, #110f0d 85%);
    box-sizing: border-box;
    transition: max-width 0.2s ease, width 0.2s ease;
}

.chargen-modal-panel.chargen-step-wide {
    width: 98vw;
    max-width: 1750px;
    height: 96vh;
    max-height: 98vh;
}

/* Header & 2-Step Stepper */
.chargen-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding: 8px 18px;
    min-height: 48px;
    flex-shrink: 0;
    background: rgba(19, 17, 14, 0.95);
    box-sizing: border-box;
}

.chargen-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chargen-crown-icon {
    font-size: 1.35rem;
    filter: drop-shadow(0 0 8px rgba(138, 111, 76, 0.5));
}

.chargen-modal-header .modal-title {
    color: var(--gold-bright);
    font-family: var(--font-heading);
    font-size: 1.05rem;
    margin: 0;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.chargen-classless-pill {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(138, 111, 76, 0.15);
    border: 1px solid rgba(196, 165, 122, 0.35);
    color: var(--bronze-bright);
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    display: inline-block;
    margin-top: 1px;
}

.chargen-stepper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-void);
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid var(--iron-border);
}

.chargen-step-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    font-size: 0.80rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.chargen-step-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.chargen-step-btn.active {
    color: var(--gold-bright);
    background: rgba(138, 111, 76, 0.2);
    border-color: var(--bronze);
}

.chargen-step-btn.completed {
    color: var(--bronze-bright);
}

.chargen-step-btn .step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--iron-dark);
    color: var(--text-muted);
    font-size: 0.74rem;
    font-family: var(--font-mono);
    font-weight: 700;
}

.chargen-step-btn.active .step-num {
    background: var(--bronze);
    color: var(--bg-void);
}

.chargen-step-btn.completed .step-num {
    background: var(--iron-highlight);
    color: var(--text-main);
}

.chargen-stepper .step-arrow {
    color: var(--text-dark);
    font-size: 0.78rem;
}

/* STEP PANES */
.chargen-step-pane {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: clamp(10px, 1.6vh, 18px) clamp(12px, 1.8vw, 22px);
    box-sizing: border-box;
}

.chargen-step-pane.hidden {
    display: none !important;
}

.chargen-step-pane::-webkit-scrollbar {
    width: 6px;
}
.chargen-step-pane::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.chargen-grid-2col {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    grid-template-rows: 1fr;
    gap: clamp(12px, 1.8vw, 22px);
    height: 100%;
    flex: 1;
    min-height: 0;
}

.chargen-col-form {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
    padding-right: 4px;
}

.chargen-col-form .section-heading {
    font-size: 0.94rem;
    font-weight: 800;
    color: var(--gold-bright);
    margin: 0 0 4px 0;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.chargen-col-form .chargen-sub-heading {
    margin-top: 6px;
    font-size: 0.88rem;
    font-weight: 700;
    border-top: 1px dashed rgba(212, 175, 55, 0.25);
    padding-top: 8px;
    letter-spacing: 0.05em;
}

.chargen-identity-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
}

.chargen-identity-row .form-field:first-child {
    grid-column: 1 / -1;
}

.chargen-appearance-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px 14px;
}

.chargen-field-span-all {
    grid-column: 1 / -1;
}

.chargen-col-form .form-field {
    margin: 0;
}

.chargen-col-form .form-field label {
    display: block;
    font-size: 0.80rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: 0.04em;
}

.chargen-col-form .form-field input,
.chargen-col-form .form-field select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 5px;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 500;
    height: 38px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.chargen-col-form .form-field input:focus,
.chargen-col-form .form-field select:focus {
    border-color: var(--gold-bright);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
}

.chargen-col-form .field-hint {
    font-size: 0.74rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 3px;
    display: block;
    line-height: 1.35;
}

/* DOSSIER CARD */
.chargen-col-preview {
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;
    min-height: 0;
}

.chargen-dossier-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-height: 0;
    box-sizing: border-box;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.chargen-dossier-card .dossier-header,
.dossier-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 4px;
    flex-shrink: 0;
}

#cg-race-dossier .dossier-header {
    min-height: 60px;
}

.chargen-dossier-card .dossier-icon,
.dossier-icon {
    font-size: 2.2rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}

#cg-race-dossier .dossier-icon {
    font-size: 3.0rem;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.8));
}

.chargen-dossier-card .dossier-title,
.dossier-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--gold-bright);
    margin: 0;
    line-height: 1.18;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 0 12px rgba(212, 175, 55, 0.3);
}

#cg-race-dossier .dossier-title {
    font-size: 1.65rem;
    font-weight: 900;
    line-height: 1.12;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    flex: 1;
}

.dossier-subtitle {
    font-family: var(--font-body);
    font-size: 0.86rem;
    color: var(--bronze-bright);
    font-style: italic;
    margin-top: 3px;
    display: block;
    letter-spacing: 0.02em;
}

.dossier-body {
    font-size: 0.98rem;
    color: #ede7dc;
    line-height: 1.65;
    flex: 1;
    overflow-y: auto;
    font-family: var(--font-body);
    letter-spacing: 0.01em;
}

.dossier-traits {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 6px;
    flex-shrink: 0;
}

.trait-pill {
    background: rgba(138, 111, 76, 0.18);
    border: 1px solid var(--bronze-border);
    color: var(--bronze-bright);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    letter-spacing: 0.02em;
}

/* VISAGE PREVIEW */
.visage-preview-box {
    background: rgba(10, 13, 20, 0.65);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--bronze-bright);
    border-radius: 6px;
    padding: 14px 18px;
    font-style: italic;
    color: #f7fafc;
    font-size: 0.98rem;
    line-height: 1.7;
    flex: 1;
    overflow-y: auto;
    font-family: var(--font-body);
}

/* RACIAL HALLMARK FEATURES (3-TRAIT TRIAD) */
.chargen-hallmarks-section {
    margin-top: 8px;
    padding: 10px 14px;
    background: rgba(10, 13, 20, 0.45);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 6px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
}

.chargen-hallmarks-title {
    color: var(--gold-bright);
    font-size: 0.86rem;
    font-family: var(--font-heading);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
}

.chargen-hallmarks-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px 12px;
}

@media (max-width: 800px) {
    .fullscreen-chargen {
        padding: 0;
    }

    .chargen-modal-panel {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
        border: none;
    }

    .chargen-grid-2col {
        grid-template-columns: 1fr;
        height: auto;
    }

    .chargen-appearance-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .chargen-hallmarks-grid {
        grid-template-columns: 1fr;
    }

    .stat-quad-grid {
        grid-template-columns: 1fr;
        height: auto;
    }

    .calib-casino-toolbar {
        flex-direction: column;
        gap: 6px;
    }

    .casino-left-controls,
    .casino-center-feed,
    .casino-right-stats {
        width: 100%;
        justify-content: center;
    }
}

.chargen-hallmarks-grid .form-field {
    margin: 0;
}

.chargen-hallmarks-grid .form-field label {
    font-size: 0.76rem;
    color: var(--gold);
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.chargen-hallmarks-grid .form-field select {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.86rem;
    padding: 5px 10px;
    height: 38px;
    box-sizing: border-box;
    border-radius: 5px;
}

.chargen-hallmarks-grid .form-field select:focus {
    border-color: var(--gold-bright);
    box-shadow: 0 0 6px rgba(138, 111, 76, 0.4);
}

/* ARCHETYPE CARDS */
.archetype-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.archetype-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.archetype-card:hover {
    border-color: var(--bronze-bright);
    background: var(--bg-card-hover);
    transform: translateY(-1px);
}

.archetype-card.active {
    border-color: var(--bronze-bright);
    background: rgba(138, 111, 76, 0.15);
    box-shadow: 0 0 12px rgba(138, 111, 76, 0.3);
}

.arch-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.arch-card-icon {
    font-size: 1.2rem;
}

.arch-card-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gold-bright);
}

.arch-card-desc {
    font-size: 0.72rem;
    color: #94a3b8;
    line-height: 1.35;
    margin: 0;
    flex: 1;
}

.arch-card-pills {
    display: flex;
    gap: 5px;
    margin-top: 4px;
}

.arch-card-pills span {
    background: var(--bg-void);
    border: 1px solid var(--iron-border);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
}

.starter-gear-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: var(--bg-input);
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.gear-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-main);
}

.gear-row .tag {
    font-size: 0.65rem;
    background: var(--bg-void);
    border: 1px solid var(--iron-dark);
    color: var(--bronze-bright);
    padding: 1px 6px;
    border-radius: 3px;
    font-family: var(--font-mono);
}

.vitals-dossier-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 6px;
}

.vital-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 8px;
    text-align: center;
}

.vital-card .vcard-label {
    font-size: 0.62rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    display: block;
}

.vital-card .vcard-val {
    font-size: 0.9rem;
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--bronze-bright);
    margin-top: 2px;
    display: block;
}

/* FOOTER */
.chargen-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 18px;
    min-height: 52px;
    border-top: 1px solid var(--border-color);
    background: rgba(19, 17, 14, 0.95);
    flex-shrink: 0;
    box-sizing: border-box;
}

.chargen-footer-summary .badge {
    background: var(--bg-void);
    border: 1px solid var(--iron-border);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 4px;
}

.chargen-footer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chargen-modal-footer .primary-btn,
.chargen-modal-footer .secondary-btn {
    padding: 6px 14px;
    font-size: 0.82rem;
}

.gold-btn {
    background: linear-gradient(180deg, #3d352b 0%, #28221b 100%);
    color: #ede7dc !important;
    font-weight: 700;
    font-family: var(--font-heading);
    letter-spacing: 0.05em;
    font-size: 0.84rem;
    border: 1px solid #6b573d;
    border-top: 1px solid #8c714e;
    border-radius: 5px;
    padding: 7px 18px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.gold-btn:hover {
    background: linear-gradient(180deg, #4d4337 0%, #352c22 100%);
    border-color: #8c714e;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

/* Chargen Step 3: Disciplines & Skills Manager */
.cg-skills-ledger-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 12px;
    margin-bottom: 8px;
    flex-shrink: 0;
    gap: 12px;
}

.cg-ledger-pools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cg-pool-card {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 3px 8px;
    min-width: 90px;
}

.cg-pool-card.pool-card-ptp { border-color: rgba(229, 62, 62, 0.4); }
.cg-pool-card.pool-card-mtp { border-color: rgba(49, 130, 206, 0.4); }
.cg-pool-card.pool-card-stp { border-color: rgba(214, 158, 46, 0.4); }
.cg-pool-card.pool-card-ftp { border-color: rgba(128, 90, 213, 0.4); }

.cg-pool-meta {
    display: flex;
    flex-direction: column;
}

.cg-pool-tag {
    font-size: 0.65rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.pool-card-ptp .cg-pool-tag { color: #fc8181; }
.pool-card-mtp .cg-pool-tag { color: #63b3ed; }
.pool-card-stp .cg-pool-tag { color: #f6e05e; }
.pool-card-ftp .cg-pool-tag { color: #b794f4; }

.cg-pool-label {
    font-size: 0.55rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.cg-pool-val {
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--gold-bright);
    margin-left: auto;
}

.cg-ledger-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cg-skills-hint {
    font-size: 0.68rem;
    color: var(--text-dim);
    font-style: italic;
    max-width: 400px;
}

.cg-skills-nav {
    margin-bottom: 8px;
    flex-shrink: 0;
}

.cg-skills-catalog-body {
    flex: 1;
    min-height: 0;
    overflow-y: hidden;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-main);
}

.cg-skills-catalog-body .skills-catalog-container {
    height: 100%;
}

#cg-pane-step-3 {
    overflow: hidden;
    padding-bottom: 8px;
}

/* Step 4 Review Skills Summary */
.review-skills-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    min-height: 38px;
    max-height: 110px;
    overflow-y: auto;
    align-items: flex-start;
}

.review-skill-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(138, 111, 76, 0.2);
    border: 1px solid var(--bronze);
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 0.68rem;
    color: var(--text-main);
}

.review-skill-pill .skill-name {
    font-weight: 600;
    color: var(--gold-bright);
}

.review-skill-pill .skill-ranks {
    background: var(--bg-void);
    color: #68d391;
    padding: 1px 4px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.62rem;
}

/* In-Game Skills Manager 12 Core Attributes Bar with CK3 Tooltips */
.skills-attributes-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.skills-attr-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--bg-input);
    border: 1px solid var(--iron-border);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 0.72rem;
    cursor: help;
    transition: all 0.15s ease;
}

.skills-attr-chip:hover {
    background: var(--bg-card-hover);
    border-color: var(--bronze);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(138, 111, 76, 0.25);
}

.skills-attr-chip .attr-chip-tag {
    font-weight: 700;
    color: var(--gold-bright);
    font-family: var(--font-mono);
}

.skills-attr-chip .attr-chip-val {
    font-family: var(--font-mono);
    color: var(--text-main);
    font-weight: 600;
}

.skills-attr-chip .attr-chip-bns {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--bronze-bright);
}

.quad-stat-subtag {
    cursor: help;
    transition: color 0.15s ease;
}

.quad-stat-subtag:hover {
    color: var(--bronze-bright);
    text-decoration: underline;
}

/* CASINO DICE ROLLING TOOLBAR */
.calib-casino-toolbar {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: radial-gradient(ellipse at 50% 0%, #201b16 0%, #110f0d 100%);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 12px;
    flex-shrink: 0;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), inset 0 0 16px rgba(138, 111, 76, 0.05);
}

.casino-left-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.casino-roll-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #4d3f31 0%, #352b21 60%, #251e17 100%);
    color: var(--text-main);
    border: 1px solid var(--bronze-bright);
    border-radius: 4px;
    padding: 5px 12px;
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(138, 111, 76, 0.35);
    transition: all 0.15s ease;
    white-space: nowrap;
}

.casino-left-controls .secondary-btn {
    padding: 5px 10px;
    font-size: 0.78rem;
    white-space: nowrap;
}

.casino-roll-btn:hover {
    background: linear-gradient(135deg, #5e4d3c 0%, #43362a 60%, #2d241c 100%);
    border-color: #d6be99;
    transform: translateY(-1px);
    box-shadow: 0 0 14px rgba(196, 165, 122, 0.45);
}

.casino-center-feed {
    flex: 1;
    min-width: 0;
    overflow: hidden !important;
    display: flex;
    justify-content: center;
    align-items: center;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

.casino-center-feed::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.die-tray-container,
#pool-chips {
    display: flex;
    gap: clamp(4px, 0.8vw, 10px);
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
    min-height: 34px;
    flex-wrap: nowrap;
    overflow: hidden !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.die-tray-container::-webkit-scrollbar,
#pool-chips::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.die-tray-container .pool-chip,
#pool-chips .pool-chip {
    background: var(--bg-card);
    border: 1px solid var(--iron-border);
    color: var(--text-main);
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: clamp(0.84rem, 1.6vh, 1.05rem);
    padding: 2px 4px;
    min-width: 0;
    height: clamp(28px, 3.8vh, 36px);
    line-height: 1;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    max-width: none;
}

.die-tray-container .pool-chip:hover,
#pool-chips .pool-chip:hover {
    border-color: var(--bronze-bright);
    transform: translateY(-1px);
    background: var(--bg-card-hover);
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}

.die-tray-container .pool-chip.selected,
#pool-chips .pool-chip.selected {
    background: var(--bronze);
    color: var(--bg-void);
    border-color: var(--bronze-bright);
    box-shadow: 0 0 10px rgba(138, 111, 76, 0.6);
    transform: scale(1.08);
}

.die-tray-container .pool-chip.used,
#pool-chips .pool-chip.used {
    opacity: 0.25;
    cursor: not-allowed;
    text-decoration: line-through;
    background: var(--bg-void);
    border-color: var(--iron-dark);
    color: var(--text-dark);
}

.casino-right-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.casino-badge {
    background: var(--bg-void);
    border: 1px solid var(--iron-border);
    border-radius: 4px;
    padding: 3px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 34px;
    min-width: 58px;
    box-sizing: border-box;
    font-family: var(--font-mono);
}

.cbadge-label {
    font-size: 0.64rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1;
}

.cbadge-val {
    font-size: 0.90rem;
    color: var(--bronze-bright);
    font-weight: 800;
    line-height: 1.1;
}

.pool-quality-badge {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
    width: 90px;
    min-width: 90px;
    max-width: 90px;
    height: 34px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
    line-height: 1.08;
    flex-shrink: 0;
    letter-spacing: 0.03em;
}

.pool-quality-badge.quality-legendary,
.pool-quality-badge.quality-great {
    background: rgba(72, 187, 120, 0.15);
    border: 1px solid rgba(72, 187, 120, 0.4);
    color: #68d391;
}

.pool-quality-badge.quality-good {
    background: rgba(66, 153, 225, 0.15);
    border: 1px solid rgba(66, 153, 225, 0.4);
    color: #63b3ed;
}

.pool-quality-badge.quality-average {
    background: rgba(196, 154, 98, 0.15);
    border: 1px solid rgba(196, 154, 98, 0.4);
    color: #c49a62;
}

.pool-quality-badge.quality-below-average {
    background: rgba(237, 137, 54, 0.15);
    border: 1px solid rgba(237, 137, 54, 0.4);
    color: #f6ad55;
}

.pool-quality-badge.quality-poor {
    background: rgba(229, 62, 62, 0.15);
    border: 1px solid rgba(229, 62, 62, 0.4);
    color: #fc8181;
}

/* INLINE NAME STATUS BADGE */
.name-status-badge {
    font-size: 0.68rem;
    font-weight: 600;
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 16px;
    transition: all 0.2s ease;
}
.name-status-badge.available {
    color: #48bb78;
}
.name-status-badge.invalid,
.name-status-badge.taken,
.name-status-badge.banned {
    color: #f56565;
}

/* RACIAL STAT MODIFIER BADGE */
.stat-race-mod {
    font-size: 0.68rem;
    font-family: var(--font-mono);
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 3px;
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
    white-space: nowrap;
    flex-shrink: 0;
}
.stat-race-mod.positive {
    background: rgba(72, 187, 120, 0.18);
    border: 1px solid rgba(72, 187, 120, 0.5);
    color: #68d391;
}
.stat-race-mod.negative {
    background: rgba(245, 101, 101, 0.18);
    border: 1px solid rgba(245, 101, 101, 0.5);
    color: #fc8181;
}
.stat-race-mod.neutral {
    background: rgba(160, 174, 192, 0.1);
    border: 1px solid rgba(160, 174, 192, 0.25);
    color: var(--text-muted);
}

/* STAT SWAP SOURCE HIGHLIGHT */
.stat-slot.swap-source {
    border-color: var(--gold-bright) !important;
    background: rgba(212, 175, 55, 0.2) !important;
    box-shadow: 0 0 14px rgba(212, 175, 55, 0.55), inset 0 0 10px rgba(212, 175, 55, 0.25) !important;
    animation: swapPulse 1.2s ease-in-out infinite alternate;
}

@keyframes swapPulse {
    from { transform: scale(1.0); box-shadow: 0 0 10px rgba(212, 175, 55, 0.4); }
    to { transform: scale(1.02); box-shadow: 0 0 18px rgba(212, 175, 55, 0.7); }
}

/* LIVE MECHANICAL PROJECTIONS & TRAINING RATES PANEL */
.chargen-projections-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: radial-gradient(ellipse at 50% 0%, #1c1813 0%, #0e0d0b 100%);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: clamp(4px, 0.8vh, 8px) clamp(8px, 1.2vw, 14px);
    margin-top: clamp(6px, 1vh, 10px);
    flex-shrink: 0;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.proj-group {
    display: flex;
    align-items: center;
    gap: clamp(5px, 0.8vw, 10px);
    flex-wrap: wrap;
}

.proj-group-title {
    font-size: 0.64rem;
    font-family: var(--font-heading);
    font-weight: 800;
    letter-spacing: 0.05em;
    color: var(--gold);
    text-transform: uppercase;
    white-space: nowrap;
}

.proj-pill {
    background: var(--bg-void);
    border: 1px solid var(--iron-border);
    border-radius: 4px;
    padding: 2px 5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    font-family: var(--font-mono);
}

.proj-label {
    color: var(--text-muted);
    font-size: 0.58rem;
    text-transform: uppercase;
}

.proj-val {
    color: var(--bronze-bright);
    font-weight: 700;
}

/* STEP 3: VESSEL REVIEW & EMBARKATION STYLES */
.chargen-review-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: clamp(10px, 1.4vw, 16px);
    height: 100%;
    min-height: 0;
}

.review-dossier-card,
.review-path-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: clamp(10px, 1.5vh, 16px);
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 1vh, 10px);
    min-height: 0;
    overflow-y: auto;
    box-sizing: border-box;
}

.review-stats-mini-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 4px;
}

.review-stat-chip {
    background: var(--bg-void);
    border: 1px solid var(--iron-border);
    border-radius: 4px;
    padding: 3px 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.70rem;
}

.review-stat-tag {
    color: var(--gold);
    font-weight: 700;
}

.review-stat-val {
    color: var(--text-main);
    font-weight: 800;
}

.review-projections-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.review-discipline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 6px;
    margin-top: 4px;
}

.discipline-option {
    background: var(--bg-void);
    border: 1px solid var(--iron-border);
    border-radius: 4px;
    padding: 6px 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.discipline-option:hover {
    border-color: var(--bronze-bright);
    background: var(--bg-card-hover);
}

.discipline-option.selected {
    border-color: var(--gold-bright);
    background: rgba(212, 175, 55, 0.15);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
}

.discipline-name {
    font-weight: 700;
    font-size: 0.72rem;
    color: var(--gold-bright);
    display: flex;
    align-items: center;
    gap: 4px;
}

.discipline-items {
    font-size: 0.60rem;
    color: var(--text-muted);
    line-height: 1.25;
}

.embark-choice-box {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: all 0.15s ease;
    background: var(--bg-void);
}

.embark-choice-box:hover {
    border-color: var(--bronze-bright);
}

.embark-choice-box.recommended {
    border-color: var(--gold);
    background: radial-gradient(ellipse at 50% 0%, rgba(212, 175, 55, 0.12) 0%, rgba(17, 23, 38, 0.6) 100%);
}

.embark-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.embark-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.82rem;
    color: var(--gold-bright);
}

.embark-reward-badge {
    background: rgba(72, 187, 120, 0.18);
    border: 1px solid rgba(72, 187, 120, 0.5);
    color: #68d391;
    font-size: 0.60rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
}

.embark-desc {
    font-size: 0.68rem;
    color: var(--text-main);
    line-height: 1.35;
    margin: 0;
}

/* ==========================================================================
   CK3 MULTI-TIERED NESTED TOOLTIP SYSTEM (LEVELS 1, 2, 3)
   ========================================================================== */
#ck3-nested-tooltip-root {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 100000;
}

.ck3-tooltip-card {
    position: absolute;
    pointer-events: auto;
    background: linear-gradient(180deg, #1c1814 0%, #12100d 100%);
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.95), 0 0 1px 1px rgba(255, 255, 255, 0.03);
    padding: 12px 14px;
    font-family: var(--font-body);
    color: var(--text-main);
    font-size: 0.8rem;
    line-height: 1.4;
    width: 320px;
    box-sizing: border-box;
    transition: opacity 0.15s ease, transform 0.15s ease;
    animation: ck3FadeIn 0.18s ease-out;
}

@keyframes ck3FadeIn {
    from { opacity: 0; transform: scale(0.97) translateY(4px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Level 1: Stat Overview */
.ck3-tooltip-card.level-1 {
    border-color: var(--bronze);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.95), 0 0 16px rgba(138, 111, 76, 0.2);
}

.ck3-tooltip-card.level-1.skill-card {
    width: 380px;
    max-width: 90vw;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--bronze, #8a6f4c) rgba(18, 16, 13, 0.8);
}

.ck3-tooltip-card.level-1.skill-card::-webkit-scrollbar {
    width: 5px;
}
.ck3-tooltip-card.level-1.skill-card::-webkit-scrollbar-track {
    background: rgba(18, 16, 13, 0.8);
    border-radius: 4px;
}
.ck3-tooltip-card.level-1.skill-card::-webkit-scrollbar-thumb {
    background: var(--bronze, #8a6f4c);
    border-radius: 4px;
}

/* Level 2: Derived Combat & Systems Formula */
.ck3-tooltip-card.level-2 {
    border-color: var(--iron-highlight);
    width: 350px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.95), 0 0 20px rgba(138, 111, 76, 0.25);
}

/* Level 3: Deep Simulation & Dice Mechanics */
.ck3-tooltip-card.level-3 {
    border-color: #6a4f3a;
    width: 360px;
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.95), 0 0 24px rgba(138, 111, 76, 0.3);
}

/* Card Header */
.ck3-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}

.ck3-card-title {
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ck3-card-subtitle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--iron-border);
    border-radius: 4px;
    padding: 3px 8px;
    margin: 4px 0 8px 0;
    font-size: 0.72rem;
    box-sizing: border-box;
}

.ck3-sub-label {
    color: var(--bronze-bright);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.62rem;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.ck3-sub-val {
    color: var(--text-main);
    font-family: var(--font-body);
    font-weight: 600;
}

.ck3-card-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
}

.badge-physical { background: rgba(184, 74, 79, 0.2); color: #e8a0a4; border: 1px solid rgba(184, 74, 79, 0.4); }
.badge-intellectual { background: rgba(93, 126, 166, 0.2); color: #a9c4df; border: 1px solid rgba(93, 126, 166, 0.4); }
.badge-social { background: rgba(196, 154, 98, 0.2); color: #e4caa4; border: 1px solid rgba(196, 154, 98, 0.4); }
.badge-spiritual { background: rgba(158, 123, 184, 0.2); color: #d8c0eb; border: 1px solid rgba(158, 123, 184, 0.4); }
.badge-derived { background: rgba(138, 111, 76, 0.2); color: var(--bronze-bright); border: 1px solid var(--bronze-border); }
.badge-simulation { background: rgba(196, 165, 122, 0.2); color: var(--gold-bright); border: 1px solid var(--bronze); }

.ck3-stat-score-bonus {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--gold-bright);
    display: flex;
    align-items: center;
    gap: 6px;
}

.ck3-card-desc {
    font-size: 0.77rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    line-height: 1.45;
}

/* Mathematical Formula Box */
.ck3-formula-box {
    background: rgba(9, 8, 7, 0.7);
    border: 1px solid var(--iron-border);
    border-left: 3px solid var(--bronze);
    border-radius: 4px;
    padding: 6px 10px;
    margin: 8px 0;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--bronze-bright);
    line-height: 1.35;
}

.ck3-formula-box strong {
    color: #fff;
}

.ck3-formula-box.formula-purple {
    border-color: rgba(158, 123, 184, 0.35);
    border-left-color: #9e7bb8;
    color: #d8c0eb;
}

.ck3-formula-box.formula-green {
    border-color: rgba(138, 111, 76, 0.35);
    border-left-color: var(--bronze);
    color: var(--bronze-bright);
}

.ck3-formula-box.formula-gold {
    border-color: rgba(196, 165, 122, 0.35);
    border-left-color: var(--bronze-bright);
    color: var(--gold-bright);
}

.ck3-formula-box.formula-amber {
    border-color: rgba(148, 107, 63, 0.35);
    border-left-color: var(--amber);
    color: var(--gold-bright);
}

/* Tier Milestone Progression Box */
.ck3-milestone-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--bronze);
    border-radius: 4px;
    padding: 6px 10px;
    margin: 6px 0;
    font-size: 0.71rem;
    line-height: 1.4;
    box-sizing: border-box;
}

.ck3-milestone-title {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--gold-bright);
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.ck3-milestone-unlocked {
    color: var(--bronze-bright);
    font-weight: 500;
    font-size: 0.70rem;
}

.ck3-milestone-unlocked span {
    color: var(--text-main);
}

.ck3-milestone-next {
    color: var(--text-muted);
    margin-top: 2px;
    font-size: 0.70rem;
}

.ck3-milestone-next span {
    color: var(--gold-bright);
    font-weight: 500;
}

.ck3-tier-milestones-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 5px 0 8px 0;
}

.ck3-milestone-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.68rem;
    line-height: 1.3;
}

.ck3-milestone-row.unlocked {
    background: rgba(72, 187, 120, 0.08);
    border-left: 2px solid #48bb78;
}

.ck3-milestone-row.unlocked .ck3-m-badge {
    color: #68d391;
    font-weight: 700;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    flex-shrink: 0;
}

.ck3-milestone-row.unlocked .ck3-m-label {
    color: var(--text-main);
}

.ck3-milestone-row.locked {
    background: rgba(22, 32, 53, 0.4);
    border-left: 2px solid var(--iron-border);
    opacity: 0.75;
}

.ck3-milestone-row.locked .ck3-m-badge {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    flex-shrink: 0;
}

.ck3-milestone-row.locked .ck3-m-label {
    color: var(--text-muted);
}

.ck3-field-xp-box {
    margin-top: 6px;
    padding: 6px 8px;
    background: rgba(10, 13, 20, 0.6);
    border: 1px solid var(--iron-border);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ck3-field-xp-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.64rem;
    color: var(--text-muted);
}

.ck3-field-xp-header strong {
    color: var(--gold-bright);
}

.ck3-field-progress-track {
    width: 100%;
    height: 5px;
    background: rgba(22, 32, 53, 0.8);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(44, 49, 63, 0.6);
}

.ck3-field-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #b8860b, #ffd700);
    border-radius: 2px;
    transition: width 0.2s ease;
}

.ck3-field-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.60rem;
    color: var(--text-muted);
}

.ck3-field-meta-row strong {
    color: var(--text-main);
}

.ck3-field-meta-row code {
    background: rgba(22, 32, 53, 0.8);
    padding: 1px 4px;
    border-radius: 2px;
    color: var(--cyan);
    font-family: var(--font-mono);
}

/* Step-Down Mechanics Links Section */
.ck3-step-down-section {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed var(--iron-border);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ck3-step-down-title {
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ck3-links-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.ck3-link-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(138, 111, 76, 0.15);
    border: 1px solid var(--bronze-border);
    color: var(--bronze-bright);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: all 0.15s ease;
}

.ck3-link-pill:hover {
    background: rgba(138, 111, 76, 0.3);
    border-color: var(--bronze-bright);
    color: #fff;
    transform: translateY(-1px);
}

.ck3-link-pill.pill-purple {
    background: rgba(158, 123, 184, 0.15);
    border-color: rgba(158, 123, 184, 0.35);
    color: #d8c0eb;
}

.ck3-link-pill.pill-purple:hover {
    background: rgba(158, 123, 184, 0.3);
    border-color: #d8c0eb;
    color: #fff;
}

.ck3-pin-hint {
    font-size: 0.62rem;
    color: var(--text-dark);
    text-align: right;
    margin-top: 6px;
    font-style: italic;
}

/* Narrative Dossier Text Block */
.ck3-skill-card-desc {
    font-size: 0.76rem;
    line-height: 1.48;
    color: #e2e8f0;
    margin-bottom: 10px;
}

.ck3-skill-primary-metric {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gold-bright, #fbbf24);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ck3-metric-bullet {
    color: var(--gold, #d97706);
    font-size: 0.7rem;
}

.ck3-skill-narrative-text {
    color: #cbd5e1;
    font-size: 0.74rem;
    line-height: 1.5;
    margin-bottom: 8px;
    text-align: justify;
    text-justify: inter-word;
}

.ck3-skill-meta-tags {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(138, 111, 76, 0.2);
    font-size: 0.7rem;
    color: #94a3b8;
}

/* Inline Interactive Links (CK3-style) */
.ck3-inline-link {
    display: inline;
    color: var(--gold-bright, #fef08a);
    text-decoration: underline dotted;
    text-decoration-color: rgba(251, 191, 36, 0.7);
    text-underline-offset: 3px;
    cursor: pointer;
    font-weight: 600;
    border-radius: 2px;
    padding: 0 1px;
    transition: all 0.15s ease;
}

.ck3-inline-link:hover {
    color: #ffffff;
    background: rgba(251, 191, 36, 0.22);
    text-decoration: underline solid #fbbf24;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

.ck3-inline-link.link-purple {
    color: #e9d5ff;
    text-decoration-color: rgba(192, 132, 252, 0.7);
}

.ck3-inline-link.link-purple:hover {
    color: #ffffff;
    background: rgba(192, 132, 252, 0.25);
    text-decoration: underline solid #c084fc;
    text-shadow: 0 0 8px rgba(192, 132, 252, 0.6);
}

.ck3-inline-link.link-gold {
    color: #fde68a;
    text-decoration-color: rgba(245, 158, 11, 0.7);
}

.ck3-inline-link.link-gold:hover {
    color: #ffffff;
    background: rgba(245, 158, 11, 0.25);
    text-decoration: underline solid #f59e0b;
    text-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

/* Formula Math Chip */
.ck3-math-chip {
    display: inline-block;
    font-family: var(--font-mono, monospace);
    font-size: 0.7rem;
    font-weight: 600;
    color: #fbcfe8;
    background: rgba(138, 111, 76, 0.18);
    border: 1px solid rgba(138, 111, 76, 0.35);
    border-radius: 3px;
    padding: 0 4px;
    margin: 0 1px;
    line-height: 1.3;
}

/* Code Inline Chip */
.ck3-code-inline {
    display: inline-block;
    font-family: var(--font-mono, monospace);
    font-size: 0.68rem;
    color: #67e8f9;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(103, 232, 249, 0.25);
    border-radius: 3px;
    padding: 0 4px;
    margin: 0 1px;
    line-height: 1.3;
}

/* ==========================================================================
   GAME-ICONS.NET (CC-BY 3.0) VECTOR ICON ENGINE & DARK-FANTASY STYLING
   ========================================================================== */
iconify-icon.game-icon,
.game-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: -0.18em;
    width: 1.15em;
    height: 1.15em;
    line-height: 1;
    color: currentColor;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7));
    transition: transform 0.15s ease, filter 0.15s ease, color 0.15s ease;
}

iconify-icon.game-icon:hover {
    transform: scale(1.08);
    filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.45));
}

.game-icon.icon-gold {
    color: var(--gold-bright, #fbbf24);
}

.game-icon.icon-amber {
    color: var(--amber, #f59e0b);
}

.game-icon.icon-bronze {
    color: var(--bronze-bright, #c89e6c);
}

.game-icon.icon-red {
    color: var(--red, #ef4444);
}

.game-icon.icon-cyan {
    color: var(--cyan, #38bdf8);
}

.game-icon.icon-purple {
    color: var(--purple, #c084fc);
}

.game-icon.icon-green {
    color: #4ade80;
}

.game-icon.icon-lg {
    width: 1.5em;
    height: 1.5em;
    font-size: 1.5em;
}

.game-icon.icon-xl {
    width: 2.2em;
    height: 2.2em;
    font-size: 2.2em;
}

.game-icon.icon-badge {
    padding: 3px;
    background: rgba(18, 16, 13, 0.7);
    border: 1px solid var(--bronze-border, rgba(138, 111, 76, 0.35));
    border-radius: 4px;
}

/* ==========================================================================
   3D VELVET / FELT DICE ROLLING TABLETOP (DICE SO NICE PHYSICS SIMULATION)
   ========================================================================== */
.casino-felt-table {
    display: flex;
    flex-direction: column;
    height: 72px;
    background: radial-gradient(ellipse at 50% 30%, #1f1b16 0%, #161310 55%, #0c0a08 100%);
    border: 2px solid var(--iron-dark);
    outline: 1px solid rgba(138, 111, 76, 0.4);
    border-radius: 6px;
    padding: 3px 10px 4px 10px;
    flex-shrink: 0;
    position: relative;
    box-shadow: inset 0 0 35px rgba(0, 0, 0, 0.95), inset 0 1px 3px rgba(255, 255, 255, 0.08), 0 4px 16px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    user-select: none;
}

.felt-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(138, 111, 76, 0.25);
    padding-bottom: 2px;
    margin-bottom: 2px;
    height: 18px;
    flex-shrink: 0;
}

.felt-header-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.felt-title-icon {
    font-size: 0.85rem;
    filter: drop-shadow(0 0 5px rgba(196, 165, 122, 0.6));
}

.felt-title-text {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--bronze-bright);
    letter-spacing: 0.08em;
}

.felt-title-sub {
    font-family: var(--font-mono);
    font-size: 0.64rem;
    color: var(--bronze);
    opacity: 0.9;
}

.felt-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.felt-hint {
    font-size: 0.68rem;
    color: var(--text-dark);
    font-style: italic;
}

.felt-total-badge {
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid var(--iron-border);
    border-radius: 4px;
    padding: 1px 8px;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.felt-total-badge strong {
    color: var(--bronze-bright);
}

.felt-tray-container .pool-quality-badge {
    display: inline-block;
    font-size: 0.64rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 6px;
    font-family: var(--font-body);
}

.pool-quality-badge.quality-common {
    background: rgba(138, 111, 76, 0.1);
    border: 1px solid var(--iron-border);
    color: var(--text-muted);
}

.pool-quality-badge.quality-solid {
    background: rgba(93, 126, 166, 0.15);
    border: 1px solid rgba(93, 126, 166, 0.4);
    color: #a9c4df;
}

.pool-quality-badge.quality-exceptional {
    background: rgba(196, 154, 98, 0.18);
    border: 1px solid rgba(196, 154, 98, 0.5);
    color: var(--bronze-bright);
}

.pool-quality-badge.quality-heroic {
    background: rgba(158, 123, 184, 0.2);
    border: 1px solid rgba(158, 123, 184, 0.5);
    color: #d8c0eb;
    box-shadow: 0 0 8px rgba(158, 123, 184, 0.3);
}

.pool-quality-badge.quality-godtier {
    background: linear-gradient(135deg, rgba(196, 165, 122, 0.25) 0%, rgba(138, 111, 76, 0.35) 100%);
    border: 1px solid var(--bronze-bright);
    color: var(--parchment);
    box-shadow: 0 0 10px rgba(196, 165, 122, 0.4);
    animation: goldTierPulse 1.8s ease-in-out infinite;
}

@keyframes goldTierPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(196, 165, 122, 0.3); }
    50% { box-shadow: 0 0 16px rgba(196, 165, 122, 0.6); }
}

.felt-dice-arena {
    position: relative;
    width: 100%;
    height: 48px;
    perspective: 1000px;
    transform-style: preserve-3d;
    overflow: hidden;
}

/* 3D DICE & DYNAMIC SHADOWS */
.die-3d-wrapper {
    position: absolute;
    width: 40px;
    height: 40px;
    transform-origin: center center;
    cursor: pointer;
    user-select: none;
    will-change: transform;
    z-index: 2;
    transition: filter 0.15s ease;
}

.die-shadow {
    position: absolute;
    width: 36px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 75%);
    transform-origin: center center;
    pointer-events: none;
    will-change: transform, opacity;
    z-index: 1;
}

.die-cube {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    background: radial-gradient(circle at 35% 30%, #2a241d 0%, #1c1813 60%, #0f0d0a 100%);
    border: 1.5px solid var(--bronze);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 1px 1px 2px rgba(255,255,255,0.15), inset -1px -1px 3px rgba(0,0,0,0.9), 0 4px 10px rgba(0,0,0,0.7);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.die-cube .die-face {
    font-size: 0.48rem;
    text-transform: uppercase;
    color: var(--text-dark);
    font-family: var(--font-mono);
    font-weight: 700;
    line-height: 1;
    margin-bottom: 1px;
}

.die-cube .die-num {
    font-size: 1rem;
    font-weight: 900;
    color: var(--bronze-bright);
    font-family: var(--font-mono);
    line-height: 1;
    text-shadow: 0 0 6px rgba(196, 165, 122, 0.4);
}

.die-3d-wrapper:hover:not(.used) .die-cube {
    border-color: var(--bronze-bright);
    box-shadow: inset 1px 1px 3px rgba(255,255,255,0.25), 0 0 14px rgba(196, 165, 122, 0.5);
    transform: translateY(-3px) scale(1.08);
}

.die-3d-wrapper.selected .die-cube {
    background: radial-gradient(circle at 35% 30%, #4a3a28 0%, #34281a 50%, #1e170e 100%);
    border-color: var(--bronze-bright);
    box-shadow: inset 1px 1px 3px rgba(255,255,255,0.3), 0 0 16px rgba(196, 165, 122, 0.7);
    transform: translateY(-4px) scale(1.1);
}

.die-3d-wrapper.selected .die-cube .die-face {
    color: var(--parchment-dim);
}

.die-3d-wrapper.selected .die-cube .die-num {
    color: var(--parchment);
    text-shadow: 0 0 8px rgba(196, 165, 122, 0.8);
}

.die-3d-wrapper.used {
    opacity: 0.35;
    filter: grayscale(0.85);
    pointer-events: none;
}

.die-3d-wrapper.used .die-cube {
    background: #0f0d0b;
    border-color: var(--iron-dark);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.8);
}

.die-3d-wrapper.just-locked .die-cube {
    animation: dieLockPop 0.35s ease-out;
}

@keyframes dieLockPop {
    0% { transform: scale(1.35); border-color: var(--bronze-bright); box-shadow: 0 0 20px var(--bronze-bright); }
    100% { transform: scale(1.0); }
}

/* Visually Animated Descending Order Alignment & Flash */
.die-3d-wrapper.aligning {
    transition: left 0.55s cubic-bezier(0.25, 1, 0.5, 1), top 0.55s cubic-bezier(0.25, 1, 0.5, 1), transform 0.55s ease;
}

.die-shadow.aligning {
    transition: left 0.55s cubic-bezier(0.25, 1, 0.5, 1), top 0.55s cubic-bezier(0.25, 1, 0.5, 1), transform 0.55s ease;
}

.die-cube.flashing {
    animation: dicePoolFlash 0.5s ease-out;
}

@keyframes dicePoolFlash {
    0% {
        box-shadow: 0 0 0 rgba(196, 165, 122, 0);
        filter: brightness(1);
    }
    45% {
        box-shadow: 0 0 25px rgba(196, 165, 122, 0.85), inset 0 0 15px rgba(196, 165, 122, 0.6);
        filter: brightness(1.5);
        border-color: var(--bronze-bright);
    }
    100% {
        box-shadow: inset 1px 1px 2px rgba(255,255,255,0.15), inset -1px -1px 3px rgba(0,0,0,0.9), 0 4px 10px rgba(0,0,0,0.7);
        filter: brightness(1);
    }
}

/* STEP 1 MAIN SPLIT VIEW */
.calib-step1-main {
    display: flex;
    gap: 12px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* LEFT: ALL 12 STATS STACKED IN A SINGLE SLEEK COLUMN (ZERO SCROLLBAR) */
.calib-stats-stack-col {
    flex: 0 0 215px;
    max-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    height: 100%;
    min-height: 0;
    overflow: hidden; /* NEVER SCROLLS: ALL 12 STATS FIT COMFORTABLY ABOVE THE FOLD */
}

.calib-stack-group {
    background: var(--bg-card);
    border: 1px solid var(--iron-border);
    border-radius: 4px;
    padding: 2px 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-height: 0;
    justify-content: space-between;
}

.calib-stack-group .stack-group-head {
    font-family: var(--font-heading);
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--parchment);
    border-bottom: 1px solid var(--iron-border);
    padding-bottom: 1px;
    letter-spacing: 0.03em;
    margin-bottom: 1px;
    line-height: 1.1;
    white-space: nowrap;
}

.calib-stack-group.phys-group .stack-group-head { color: #c2575b; border-color: rgba(194, 87, 91, 0.25); }
.calib-stack-group.intel-group .stack-group-head { color: #6b8ea9; border-color: rgba(107, 142, 169, 0.25); }
.calib-stack-group.soc-group .stack-group-head { color: #c49a62; border-color: rgba(196, 154, 98, 0.25); }
.calib-stack-group.spir-group .stack-group-head { color: #9e7bb8; border-color: rgba(158, 123, 184, 0.25); }

.calib-stack-group .calib-slot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-input);
    border: 1px solid var(--iron-dark);
    border-radius: 3px;
    padding: 1px 5px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    flex: 1;
    min-height: 0;
}

.calib-stack-group .calib-slot:hover,
.calib-stack-group .calib-slot:focus,
.calib-stack-group .calib-slot.active-stat {
    border-color: var(--bronze);
    background: rgba(138, 111, 76, 0.15);
    transform: translateX(2px);
    box-shadow: 0 0 6px rgba(138, 111, 76, 0.3);
    outline: none;
}

.calib-stack-group .calib-slot.active-target {
    border-color: var(--bronze-bright);
    background: rgba(196, 165, 122, 0.15);
    box-shadow: 0 0 6px rgba(196, 165, 122, 0.35);
}

/* Archetype Recommended Target Slots Highlighting */
.calib-stack-group .calib-slot.archetype-target {
    border-color: rgba(138, 111, 76, 0.55);
    background: rgba(138, 111, 76, 0.08);
}

.calib-stack-group .calib-slot.archetype-target.priority-1 {
    border-color: var(--bronze-bright);
    background: rgba(196, 165, 122, 0.16);
    box-shadow: inset 0 0 6px rgba(196, 165, 122, 0.2), 0 0 6px rgba(196, 165, 122, 0.25);
}

.calib-stack-group .calib-slot.archetype-target.priority-2 {
    border-color: #6b8ea9;
    background: rgba(107, 142, 169, 0.12);
    box-shadow: inset 0 0 6px rgba(107, 142, 169, 0.15);
}

.calib-stack-group .calib-slot.archetype-target.priority-3 {
    border-color: #c49a62;
    background: rgba(196, 154, 98, 0.12);
}

.calib-stack-group .calib-slot.archetype-target.priority-4 {
    border-color: #9e7bb8;
    background: rgba(158, 123, 184, 0.12);
}

.stat-target-badge {
    font-size: 0.58rem;
    font-family: var(--font-mono);
    font-weight: 700;
    padding: 1px 3px;
    border-radius: 2px;
    margin-right: 3px;
    line-height: 1;
    text-transform: uppercase;
    flex-shrink: 0;
}

.stat-target-badge.priority-1 { background: var(--bronze); color: var(--parchment); }
.stat-target-badge.priority-2 { background: #44596d; color: #f0f9ff; }
.stat-target-badge.priority-3 { background: #6e5535; color: #fffbeb; }
.stat-target-badge.priority-4 { background: #533e63; color: #faf5ff; }

.calib-stack-group .calib-slot .stat-tag {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 2px;
    background: var(--bg-card);
    color: var(--text-dark);
    border: 1px solid var(--iron-dark);
    flex-shrink: 0;
}

.calib-stack-group .calib-slot .stat-label {
    font-size: 0.74rem;
    color: var(--parchment);
    font-weight: 600;
    margin-left: 5px;
    margin-right: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calib-stack-group .calib-slot .stat-val {
    font-family: var(--font-mono);
    font-size: 0.86rem;
    font-weight: 800;
    color: var(--bronze-bright);
    flex-shrink: 0;
}

.calib-stack-group .calib-slot .stat-val.empty {
    color: var(--text-dark);
}

/* Eye-Guiding Kinetic Animations */
.calib-stack-group .calib-slot.just-assigned {
    animation: slotAssignedBeacon 0.45s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes slotAssignedBeacon {
    0% {
        box-shadow: 0 0 0 0 rgba(196, 165, 122, 0.9), inset 0 0 10px rgba(196, 165, 122, 0.8);
        border-color: var(--bronze-bright);
        background: rgba(196, 165, 122, 0.25);
    }
    50% {
        box-shadow: 0 0 16px 3px rgba(196, 165, 122, 0.5), inset 0 0 6px rgba(196, 165, 122, 0.4);
    }
    100% {
        box-shadow: 0 0 6px rgba(138, 111, 76, 0.2);
        background: var(--bg-input);
    }
}

.calib-stack-group .calib-slot.sweep-pulse {
    animation: prioritySweep 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes prioritySweep {
    0% { transform: translateX(0); box-shadow: none; }
    30% { transform: translateX(6px); border-color: var(--bronze-bright); box-shadow: 0 0 14px var(--bronze-bright); }
    100% { transform: translateX(0); }
}

/* RIGHT STAGE: SINGLE UNIFIED DYNAMIC CONTEXT CARD (ZERO VERTICAL SCROLLBAR) */
.calib-right-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.calib-context-card {
    background: var(--bg-card);
    border: 1px solid var(--iron-border);
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.7);
}

/* TOP TAB SWITCHER */
.context-card-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--iron-border);
    padding-bottom: 5px;
    flex-shrink: 0;
}

.context-tab {
    background: var(--bg-input);
    border: 1px solid var(--iron-border);
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.73rem;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.context-tab:hover {
    color: var(--parchment);
    border-color: var(--bronze);
}

.context-tab.active {
    background: rgba(138, 111, 76, 0.2);
    border-color: var(--bronze-bright);
    color: var(--bronze-bright);
    font-weight: 700;
    box-shadow: 0 0 8px rgba(138, 111, 76, 0.3);
}

.context-tab .tab-icon {
    font-size: 0.85rem;
    line-height: 1;
}

.context-view {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-height: 0;
    overflow: hidden; /* Fits cleanly above the fold */
}

.context-view:not(.hidden) {
    animation: contextCardSwap 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes contextCardSwap {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.context-view.hidden {
    display: none !important;
}

/* CK3 / BALDUR'S GATE 3 STYLE CONTEXTUAL NESTED TOOLTIPS */
.glossary-term {
    color: var(--bronze-bright);
    font-weight: 600;
    border-bottom: 1.5px dotted rgba(196, 165, 122, 0.75);
    cursor: help;
    transition: all 0.15s ease;
    display: inline;
}

.glossary-term:hover {
    color: var(--parchment);
    border-bottom-color: var(--bronze-bright);
    text-shadow: 0 0 8px rgba(196, 165, 122, 0.6);
}

.nested-tooltip-box {
    position: fixed;
    z-index: 10000;
    width: 310px;
    max-width: calc(100vw - 32px);
    background: radial-gradient(circle at 50% 0%, #1e1914 0%, #100e0b 90%);
    border: 1px solid var(--bronze);
    border-radius: 6px;
    padding: 10px 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85), 0 0 16px rgba(138, 111, 76, 0.25);
    font-family: var(--font-body);
    color: var(--parchment);
    pointer-events: auto;
    animation: tooltipFadeIn 0.15s ease-out;
    box-sizing: border-box;
}

@keyframes tooltipFadeIn {
    from { opacity: 0; transform: translateY(4px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1.0); }
}

.ntt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--iron-border);
    padding-bottom: 4px;
    margin-bottom: 6px;
}

.ntt-title {
    font-family: var(--font-heading);
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--bronze-bright);
    letter-spacing: 0.04em;
}

.ntt-badge {
    font-family: var(--font-mono);
    font-size: 0.64rem;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--bg-card);
    color: var(--bronze-bright);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid var(--iron-border);
}

.ntt-desc {
    font-size: 0.74rem;
    line-height: 1.4;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.ntt-formula-box {
    background: var(--bg-input);
    border: 1px solid var(--iron-dark);
    border-left: 3px solid var(--bronze);
    border-radius: 0 4px 4px 0;
    padding: 4px 8px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--parchment);
    line-height: 1.35;
    margin-bottom: 4px;
}

.ntt-formula-box strong {
    color: #ffffff;
}

.ntt-related-row {
    font-size: 0.68rem;
    color: var(--text-dark);
    border-top: 1px solid var(--iron-dark);
    padding-top: 4px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.ntt-level-2 {
    border-color: var(--bronze-bright);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.9), 0 0 20px rgba(138, 111, 76, 0.3);
}

/* VIEW 1: ARCHETYPE SYNERGIES VIEW */
.synergy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--iron-border);
    padding-bottom: 4px;
    flex-shrink: 0;
}

.synergy-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.synergy-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.synergy-name {
    font-family: var(--font-heading);
    font-size: 0.92rem;
    color: var(--bronze-bright);
    margin: 0;
    letter-spacing: 0.04em;
}

.synergy-tagline {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
}

.synergy-priority-badge {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--bronze-bright);
    background: var(--bg-input);
    border: 1px solid var(--iron-border);
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 700;
    white-space: nowrap;
}

.synergy-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-height: 0;
    justify-content: space-around;
}

.syn-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--bronze-bright);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.synergy-bullet-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.synergy-bullet-item {
    font-size: 0.74rem;
    color: var(--parchment);
    line-height: 1.35;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.synergy-bullet-item::before {
    content: "✦";
    color: var(--bronze);
    font-size: 0.7rem;
    line-height: 1.35;
    flex-shrink: 0;
}

.synergy-bullet-item strong {
    color: var(--bronze-bright);
    font-weight: 700;
}

.synergy-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.syn-meta-card {
    background: var(--bg-input);
    border: 1px solid var(--iron-dark);
    border-radius: 4px;
    padding: 4px 8px;
}

.sm-label {
    display: block;
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--text-dark);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.sm-value {
    font-size: 0.72rem;
    color: var(--parchment);
    line-height: 1.25;
}

/* VIEW 2: STAT MECHANICS BRIEF VIEW */
.stat-mechanics-dossier .dossier-header,
.brief-dossier-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--iron-border);
    padding-bottom: 4px;
    flex-shrink: 0;
}

.dh-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dh-tag {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 800;
    background: var(--bronze);
    color: var(--parchment);
    padding: 2px 7px;
    border-radius: 3px;
    letter-spacing: 0.04em;
}

.dh-name {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: var(--bronze-bright);
    margin: 0;
    letter-spacing: 0.04em;
}

.dh-pillar-badge {
    font-size: 0.68rem;
    color: var(--text-muted);
    background: var(--bg-input);
    border: 1px solid var(--iron-dark);
    padding: 2px 7px;
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: 600;
}

.dh-val-badge {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.dh-val-badge strong {
    color: var(--bronze-bright);
    font-size: 1.05rem;
}

.dossier-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-height: 0;
    justify-content: space-around;
}

/* Progressive Disclosure: Plain-English Stat Summary */
.dossier-plain-summary {
    font-size: 0.78rem;
    color: var(--parchment);
    line-height: 1.4;
    background: var(--bg-input);
    border-left: 3px solid var(--bronze);
    border-radius: 0 4px 4px 0;
    padding: 5px 10px;
    font-family: var(--font-body);
}

.dossier-block {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.db-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--iron-border);
    padding-bottom: 2px;
    margin-bottom: 2px;
}

.db-title {
    font-family: var(--font-body);
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--bronze-bright);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.formula-toggle-btn {
    background: var(--bg-card);
    border: 1px solid var(--iron-border);
    color: var(--text-muted);
    font-size: 0.66rem;
    font-family: var(--font-body);
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.formula-toggle-btn:hover {
    color: var(--bronze-bright);
    border-color: var(--bronze);
    background: rgba(138, 111, 76, 0.15);
}

.dossier-equations-wrap {
    transition: all 0.2s ease;
    overflow: hidden;
}

.dossier-equations-wrap.hidden {
    display: none !important;
}

.db-equation-list {
    margin: 0;
    padding-left: 18px;
    list-style: disc;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.db-equation-list strong {
    color: var(--bronze-bright);
}

.db-comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.db-comp-card {
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 0.72rem;
    line-height: 1.3;
}

.db-comp-card.low {
    background: rgba(194, 87, 91, 0.1);
    border: 1px solid rgba(194, 87, 91, 0.3);
    color: #e8a0a4;
}

.db-comp-card.low .comp-head {
    font-weight: 700;
    color: #c2575b;
    margin-bottom: 2px;
    font-family: var(--font-mono);
}

.db-comp-card.high {
    background: rgba(138, 111, 76, 0.15);
    border: 1px solid rgba(138, 111, 76, 0.4);
    color: var(--parchment);
}

.db-comp-card.high .comp-head {
    font-weight: 700;
    color: var(--bronze-bright);
    margin-bottom: 2px;
    font-family: var(--font-mono);
}

.dossier-skills-text {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.3;
    background: var(--bg-input);
    border: 1px solid var(--iron-dark);
    border-radius: 4px;
    padding: 4px 8px;
}

.dossier-skills-text strong {
    color: var(--bronze-bright);
}

.dossier-classless-callout {
    font-size: 0.7rem;
    color: var(--parchment);
    background: rgba(138, 111, 76, 0.12);
    border-left: 3px solid var(--bronze);
    padding: 3px 8px;
    border-radius: 0 4px 4px 0;
    line-height: 1.25;
}

/* Step 1 Footer */
.fullscreen-calibration .calib-step-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--iron-border);
    padding-top: 6px;
    margin-top: auto;
    flex-shrink: 0;
    height: 36px;
}

.footer-tip-hint {
    font-size: 0.72rem;
    color: var(--text-dark);
    font-style: italic;
    font-family: var(--font-body);
}

.calib-stat-summary {
    display: flex;
    gap: 16px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-muted);
}

.calib-stat-summary strong {
    color: var(--bronze-bright);
}

/* STEP 2: REVERSIBILITY BANNER & DOSSIERS */
.calibration-rule-banner {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: linear-gradient(135deg, rgba(138, 111, 76, 0.2) 0%, rgba(77, 63, 49, 0.1) 100%);
    border: 1px solid var(--bronze);
    border-radius: 6px;
    padding: 10px 14px;
    box-shadow: 0 0 16px rgba(138, 111, 76, 0.2);
    flex-shrink: 0;
}

.rule-banner-icon {
    font-size: 1.6rem;
    line-height: 1;
    flex-shrink: 0;
    color: var(--bronze-bright);
}

.rule-banner-title {
    font-family: var(--font-heading);
    color: var(--bronze-bright);
    font-size: 0.92rem;
    font-weight: 800;
    margin: 0 0 4px 0;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rule-banner-desc {
    font-size: 0.78rem;
    color: var(--parchment);
    line-height: 1.4;
    margin: 0;
}

.rule-banner-desc strong {
    color: var(--bronze-bright);
}

.calibration-pillars-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    flex: 1;
    min-height: 0;
}

.calib-pillar-card {
    background: var(--bg-card);
    border: 1px solid var(--iron-border);
    border-radius: 6px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.pillar-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--iron-border);
    padding-bottom: 5px;
    flex-shrink: 0;
}

.pillar-card-header h4 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--bronze-bright);
}

.pillar-feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.76rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.pillar-feature-list strong {
    color: var(--parchment);
}

/* STEP 3: ALLOCATION & APPROVAL */
.calib-tp-strip {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 10px;
    background: var(--bg-input);
    border: 1px solid var(--iron-border);
    border-radius: 4px;
    padding: 6px 12px;
    flex-shrink: 0;
}

.calib-tp-card {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--parchment);
}

.calib-tp-card .tag {
    font-weight: 700;
    color: var(--text-dark);
}

.calib-tp-card strong {
    font-size: 1rem;
    color: var(--bronze-bright);
}

.calib-starter-kits {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid var(--iron-dark);
}

.calib-starter-kits .kit-label {
    font-size: 0.72rem;
    color: var(--text-dark);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* CODEX NAVIGATION & TABS */
.calib-codex-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--iron-border);
    border-radius: 4px;
    padding: 4px 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.calib-codex-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.calib-tab-btn {
    background: var(--bg-card);
    border: 1px solid var(--iron-border);
    color: var(--text-muted);
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--font-heading);
    letter-spacing: 0.03em;
}

.calib-tab-btn:hover {
    color: var(--parchment);
    border-color: var(--bronze);
    background: var(--bg-input);
}

.calib-tab-btn.active {
    background: rgba(138, 111, 76, 0.2);
    border-color: var(--bronze-bright);
    color: var(--bronze-bright);
    box-shadow: 0 0 8px rgba(138, 111, 76, 0.3);
}

.calib-open-manager-btn {
    padding: 4px 10px !important;
    font-size: 0.74rem !important;
    border-color: var(--bronze) !important;
    color: var(--bronze-bright) !important;
    background: rgba(138, 111, 76, 0.15) !important;
}

.calib-open-manager-btn:hover {
    background: rgba(138, 111, 76, 0.3) !important;
    color: var(--parchment) !important;
    border-color: var(--bronze-bright) !important;
}

/* SEARCH & FILTER BAR */
.calib-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--iron-border);
    border-radius: 4px;
    padding: 4px 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.calib-search-box {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-input);
    border: 1px solid var(--iron-dark);
    border-radius: 3px;
    padding: 2px 8px;
    flex: 1;
    min-width: 200px;
    max-width: 380px;
}

.calib-search-icon {
    font-size: 0.75rem;
    opacity: 0.65;
}

.calib-search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--parchment);
    font-size: 0.74rem;
    font-family: var(--font-body);
    width: 100%;
}

.calib-search-box input::placeholder {
    color: var(--text-dark);
}

.calib-clear-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.72rem;
    padding: 0 2px;
}

.calib-clear-btn:hover {
    color: #c2575b;
}

.calib-filter-pills {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
    flex: 2;
}

.calib-pill {
    background: var(--bg-input);
    border: 1px solid var(--iron-dark);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.calib-pill:hover {
    color: var(--parchment);
    border-color: var(--bronze);
}

.calib-pill.active {
    background: rgba(138, 111, 76, 0.2);
    border-color: var(--bronze-bright);
    color: var(--bronze-bright);
}

.calib-count-badge {
    font-size: 0.7rem;
    color: var(--text-dark);
    font-family: var(--font-mono);
    white-space: nowrap;
    margin-left: auto;
}

/* CODEX ITEM CARD (MANEUVERS & SPELLS) */
.calib-codex-card {
    background: var(--bg-card);
    border: 1px solid var(--iron-border);
    border-radius: 4px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.calib-codex-card:hover {
    border-color: var(--bronze);
    background: #1a1714;
}

.calib-codex-hdr {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 6px;
}

.calib-codex-title {
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--bronze-bright);
    display: flex;
    align-items: center;
    gap: 6px;
}

.calib-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-family: var(--font-mono);
}

.calib-badge-offensive {
    background: rgba(194, 87, 91, 0.15);
    border: 1px solid #c2575b;
    color: #e8a0a4;
}

.calib-badge-defensive {
    background: rgba(93, 126, 166, 0.15);
    border: 1px solid #5d7ea6;
    color: #a9c4df;
}

.calib-badge-elemental {
    background: rgba(196, 154, 98, 0.15);
    border: 1px solid #c49a62;
    color: #e4caa4;
}

.calib-badge-spiritual {
    background: rgba(158, 123, 184, 0.15);
    border: 1px solid #9e7bb8;
    color: #d8c0eb;
}

.calib-badge-mental {
    background: rgba(107, 142, 169, 0.15);
    border: 1px solid #6b8ea9;
    color: #b8d4ea;
}

.calib-badge-psychic {
    background: rgba(184, 115, 150, 0.15);
    border: 1px solid #b87396;
    color: #ecc4d7;
}

.calib-codex-reqs {
    font-size: 0.68rem;
    color: var(--bronze);
    font-family: var(--font-mono);
}

.calib-codex-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.25;
}

.calib-codex-cmd {
    font-size: 0.67rem;
    font-family: var(--font-mono);
    color: var(--bronze-bright);
    background: var(--bg-input);
    border: 1px solid var(--iron-dark);
    padding: 2px 4px;
    border-radius: 2px;
    align-self: flex-start;
}

.calib-skills-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 8px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 4px;
}

.calib-skill-card {
    background: var(--bg-card);
    border: 1px solid var(--iron-border);
    border-radius: 4px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.calib-skill-card.trained {
    border-color: var(--bronze-bright);
    background: #1c1814;
}

.calib-skill-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calib-skill-name {
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--bronze-bright);
}

.calib-skill-pts {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.calib-skill-desc {
    font-size: 0.7rem;
    color: var(--text-dark);
    line-height: 1.25;
}

.calib-skill-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.calib-skill-rank-badge {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--bronze-bright);
}

.calib-skill-btns {
    display: flex;
    gap: 6px;
}

.calib-skill-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border: 1px solid var(--iron-border);
    color: var(--parchment);
    border-radius: 3px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.1s ease;
}

.calib-skill-btn:hover:not(:disabled) {
    background: var(--bronze);
    color: #ffffff;
    border-color: var(--bronze-bright);
}

.calib-skill-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.calib-approval-box {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: radial-gradient(circle at 50% 50%, #201b16 0%, #110f0d 100%);
    border: 1px solid var(--bronze);
    border-radius: 6px;
    padding: 12px 16px;
    margin-top: 6px;
}

.approval-summary {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.82rem;
    color: var(--parchment);
}

.approval-summary .summary-line strong {
    color: var(--bronze-bright);
}

.approval-summary .summary-line span {
    color: var(--parchment);
}

.calib-big-approve-btn {
    padding: 10px 22px;
    font-size: 0.95rem;
    font-weight: 700;
    background: linear-gradient(180deg, #3d352b 0%, #28221b 100%);
    border: 1px solid var(--bronze);
    color: var(--bronze-bright);
    box-shadow: 0 0 15px rgba(138, 111, 76, 0.4);
    letter-spacing: 0.03em;
}

.calib-big-approve-btn:hover {
    background: linear-gradient(180deg, #4d4337 0%, #352d24 100%);
    color: var(--parchment);
    border-color: var(--bronze-bright);
}

/* ==========================================================================
   HUD EXPERIENCE FLOATING GAIN & PULSE ANIMATIONS (HUD ONLY, ZERO CHAT SPAM)
   ========================================================================== */

#exp-widget {
    position: relative;
    overflow: visible;
    isolation: isolate;
}

.hud-exp-float {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.96), rgba(217, 119, 6, 0.92));
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 3px 10px;
    border-radius: 9999px;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.65), 0 2px 8px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(251, 191, 36, 0.85);
    pointer-events: none;
    z-index: 50;
    animation: hudExpRiseFade 1.45s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

.hud-exp-float.field-xp {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.96), rgba(14, 116, 144, 0.92));
    box-shadow: 0 0 16px rgba(6, 182, 212, 0.65), 0 2px 8px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(103, 232, 249, 0.85);
}

@keyframes hudExpRiseFade {
    0% {
        opacity: 0;
        transform: translate(-50%, 6px) scale(0.85);
    }
    15% {
        opacity: 1;
        transform: translate(-50%, -2px) scale(1.08);
    }
    30% {
        transform: translate(-50%, -6px) scale(1);
    }
    70% {
        opacity: 1;
        transform: translate(-50%, -22px) scale(0.98);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -38px) scale(0.9);
    }
}

.exp-bar-flash {
    animation: expBarGlow 1.2s ease-out;
}

@keyframes expBarGlow {
    0% {
        filter: brightness(1);
        box-shadow: none;
    }
    25% {
        filter: brightness(1.75);
        box-shadow: 0 0 16px rgba(245, 158, 11, 0.95);
    }
    100% {
        filter: brightness(1);
        box-shadow: none;
    }
}

.exp-widget-focus {
    animation: expWidgetPulse 1.4s ease-out;
}

@keyframes expWidgetPulse {
    0% {
        box-shadow: 0 0 0 rgba(212, 160, 23, 0);
        border-color: var(--border-color);
    }
    30% {
        box-shadow: 0 0 24px rgba(245, 158, 11, 0.8), inset 0 0 14px rgba(245, 158, 11, 0.3);
        border-color: rgba(245, 158, 11, 0.95);
    }
    100% {
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
        border-color: var(--border-color);
    }
}

/* ==========================================================================
   WHAT NOW & QUESTS GUIDANCE WIDGET
   ========================================================================== */

#guidance-widget .widget-body {
    padding: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.guidance-primary-card {
    background: linear-gradient(135deg, rgba(26, 22, 28, 0.95), rgba(18, 16, 20, 0.95));
    border: 1px solid rgba(245, 158, 11, 0.45);
    border-radius: 6px;
    padding: 0.65rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 0 12px rgba(245, 158, 11, 0.08);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.guidance-primary-card:hover {
    border-color: rgba(245, 158, 11, 0.85);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), inset 0 0 16px rgba(245, 158, 11, 0.15);
}

.guidance-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.guidance-label {
    font-family: var(--font-heading);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--gold-bright);
    text-shadow: 0 0 6px rgba(245, 158, 11, 0.35);
}

.guidance-step-count {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.4);
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.guidance-instruction {
    font-family: var(--font-body);
    font-size: 0.82rem;
    line-height: 1.35;
    color: #f3f0e6;
    margin: 0 0 0.5rem 0;
}

.guidance-action-row {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.guidance-action-btn {
    background: linear-gradient(180deg, #3d2f1f 0%, #291e13 100%);
    color: var(--gold-bright);
    border: 1px solid rgba(245, 158, 11, 0.6);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.guidance-action-btn:hover {
    background: linear-gradient(180deg, #574229 0%, #3d2f1f 100%);
    border-color: var(--gold-bright);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
    color: #fff;
    transform: translateY(-1px);
}

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

.guidance-quests-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.guidance-quest-item {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    background: rgba(18, 16, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    padding: 0.4rem 0.5rem;
    font-size: 0.72rem;
}

.gq-icon {
    font-size: 0.85rem;
    line-height: 1;
}

.gq-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.gq-title {
    font-weight: 600;
    color: #e5e0d3;
}

.gq-status {
    color: var(--text-muted);
    font-size: 0.66rem;
}

/* ==========================================================================
   UPGRADED EXPERIENCE & MIND HUD (LEVEL CREST, EXACT RATIOS, SKILL ROTATION)
   ========================================================================== */

.exp-level-header-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: linear-gradient(135deg, rgba(26, 22, 28, 0.95), rgba(18, 16, 20, 0.95));
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 6px;
    padding: 0.45rem 0.6rem;
    margin-bottom: 0.35rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.exp-level-crest {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #382c1b 0%, #1e1710 100%);
    border: 1px solid rgba(245, 158, 11, 0.75);
    border-radius: 5px;
    padding: 2px 8px;
    min-width: 52px;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}

.exp-lvl-label {
    font-family: var(--font-heading);
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: rgba(245, 158, 11, 0.8);
    line-height: 1;
}

.exp-lvl-val {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--gold-bright);
    line-height: 1;
    text-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

.exp-level-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.exp-char-title {
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 700;
    color: #f3f0e6;
    letter-spacing: 0.04em;
}

.exp-circle-tag {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--cyan);
}

.exp-label-bold {
    font-weight: 600;
    color: #d8d3c5;
    font-size: 0.75rem;
}

.exp-exact-progress {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--gold-bright);
    font-weight: 700;
}

.exp-field-exact {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--cyan);
    font-weight: 700;
}

.field-exp-sub-hint {
    font-size: 0.63rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 3px;
    padding-left: 2px;
}

/* LIVE FIELD SKILL MASTERY ROTATION STRIP */
/* INTEGRATED LEVEL & FIELD EXPERIENCE BARS (TEXT INSIDE BAR) */
.exp-bar-container {
    position: relative;
    width: 100%;
}

.exp-integrated-bar {
    position: relative;
    height: 22px;
    background: rgba(8, 11, 18, 0.9);
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.7);
}

.exp-integrated-bar .meter-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    height: 100%;
    transition: width 0.4s ease;
}

.exp-integrated-bar .meter-fill.exp-fill {
    background: linear-gradient(90deg, #92400e 0%, #d97706 45%, #f59e0b 80%, #fbbf24 100%);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.45);
}

.exp-integrated-bar .meter-fill.mind-fill {
    background: linear-gradient(90deg, #0e7490 0%, #0891b2 45%, #06b6d4 80%, #38bdf8 100%);
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.45);
}

.exp-integrated-bar .meter-fill.skill-fill {
    background: linear-gradient(90deg, #78350f 0%, #b45309 40%, #d97706 75%, #f59e0b 100%);
    box-shadow: 0 0 8px rgba(217, 119, 6, 0.4);
}

.exp-integrated-bar .meter-text-inside {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    z-index: 2;
    pointer-events: none;
    font-family: var(--font-mono);
    font-size: 0.63rem;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95), 0 0 6px rgba(0, 0, 0, 0.85);
}

.exp-integrated-bar .meter-label {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #f1f5f9;
    font-size: 0.62rem;
}

.exp-integrated-bar .meter-val {
    color: #ffffff;
    font-weight: 700;
}

/* STATIC LIST OF RECENT FIELD SKILLS (LAST 5 TRAINED) */
.exp-recent-skills-box {
    background: linear-gradient(180deg, rgba(22, 20, 26, 0.95), rgba(13, 14, 19, 0.95));
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-top: 2px solid rgba(212, 175, 55, 0.6);
    border-radius: 6px;
    padding: 6px 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.recent-skills-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.18);
}

.recent-skills-title {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--gold-bright, #facc15);
    text-shadow: 0 0 6px rgba(250, 204, 21, 0.3);
    display: flex;
    align-items: center;
}

.recent-skills-subtitle {
    font-family: var(--font-mono);
    font-size: 0.58rem;
    color: var(--text-muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.recent-skills-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.recent-skill-bar-container {
    position: relative;
    width: 100%;
}

.recent-skill-integrated-bar {
    height: 22px;
    background: rgba(10, 13, 20, 0.85);
    border-color: rgba(212, 175, 55, 0.22);
    cursor: pointer;
    transition: all 0.18s ease;
}

.recent-skill-integrated-bar:hover {
    border-color: var(--gold-bright, #facc15);
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.7), 0 0 8px rgba(212, 175, 55, 0.35);
}

.recent-skill-integrated-bar.flash-learned {
    animation: recentSkillBarFlash 1.1s ease-out;
}

@keyframes recentSkillBarFlash {
    0% {
        border-color: var(--gold-bright, #facc15);
        box-shadow: 0 0 12px rgba(245, 158, 11, 0.8);
        filter: brightness(1.3);
    }
    100% {
        border-color: rgba(212, 175, 55, 0.22);
        box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.7);
        filter: none;
    }
}

.recent-skill-meter-label {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.recent-skill-icon {
    font-size: 0.82rem;
    line-height: 1;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.recent-skill-name {
    font-family: var(--font-heading);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.recent-skill-rank-badge {
    font-family: var(--font-mono);
    font-size: 0.58rem;
    font-weight: 700;
    color: var(--gold-bright, #facc15);
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 0.5px 4px;
    border-radius: 3px;
    flex-shrink: 0;
    line-height: 1.2;
    margin-left: 2px;
}

.recent-skill-val {
    flex-shrink: 0;
    margin-left: 6px;
    font-family: var(--font-mono);
    font-size: 0.60rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
}

/* ==========================================================================
   CHARGEN: NOVITIATE ASSURANCE BANNER & BUILD ADVISORY PANEL
   ========================================================================== */
.novice-grace-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(90deg, rgba(30, 24, 16, 0.95) 0%, rgba(18, 16, 13, 0.95) 100%);
    border: 1px solid rgba(217, 119, 6, 0.45);
    border-left: 4px solid var(--amber);
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 12px;
}

.novice-grace-banner .ngb-shield {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.novice-grace-banner .ngb-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.novice-grace-banner .ngb-title {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    color: #fbbf24;
    text-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
    letter-spacing: 0.5px;
}

.novice-grace-banner .ngb-desc {
    font-family: var(--font-body);
    font-size: 0.78rem;
    color: #d1d5db;
    line-height: 1.35;
}

.cg-advisory-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.cg-advisory-panel.hidden {
    display: none !important;
}

.advisory-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.78rem;
    line-height: 1.35;
}

.advisory-card .advisory-icon {
    font-size: 1.1rem;
    line-height: 1;
    margin-top: 1px;
    flex-shrink: 0;
}

.advisory-card .advisory-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.advisory-card .advisory-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.8rem;
}

.advisory-card .advisory-detail {
    font-family: var(--font-body);
}

.advisory-conflict {
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-left: 3px solid #ef4444;
}

.advisory-conflict .advisory-title {
    color: #fca5a5;
}

.advisory-conflict .advisory-detail {
    color: #fecaca;
}

.advisory-synergy {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-left: 3px solid #10b981;
}

.advisory-synergy .advisory-title {
    color: #6ee7b7;
}

.advisory-synergy .advisory-detail {
    color: #d1fae5;
}

.advisory-notice {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-left: 3px solid #3b82f6;
}

.advisory-notice .advisory-title {
    color: #93c5fd;
}

.advisory-notice .advisory-detail {
    color: #bfdbfe;
}



/* ============================================================================
   FACTIONS & TRADITIONS ARCHIVE CODEX & MENTOR DOSSIER STYLES
   ============================================================================ */

.traditions-codex-panel {
    max-width: 980px;
    width: 90vw;
    height: 82vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
    border-radius: 8px;
    overflow: hidden;
}

.traditions-codex-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.6rem;
    background: linear-gradient(180deg, #1f1b16 0%, #14110e 100%);
    border-bottom: 1px solid var(--border-color, #362f25);
    flex-shrink: 0;
    gap: 16px;
}

.traditions-codex-title-group {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.traditions-codex-icon {
    font-size: clamp(1.75rem, 2.5vw, 2.25rem);
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7));
    flex-shrink: 0;
}

.traditions-codex-panel .traditions-codex-title,
.traditions-codex-panel .modal-title {
    font-family: var(--font-heading);
    font-size: clamp(1.4rem, 2.2vw, 1.85rem);
    font-weight: 900;
    color: var(--gold-bright);
    letter-spacing: 0.08em;
    margin: 0;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.traditions-codex-panel .modal-header-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.traditions-codex-close-btn,
.modal-close-btn {
    background: rgba(10, 13, 20, 0.6);
    border: 1px solid #334155;
    color: var(--text-muted, #94a3b8);
    width: 36px;
    height: 36px;
    border-radius: 6px;
    font-size: 1.15rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}

.traditions-codex-close-btn:hover,
.modal-close-btn:hover {
    color: #f87171;
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
    transform: scale(1.05);
}

.traditions-codex-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.traditions-sidebar {
    width: 300px;
    background: rgba(10, 13, 20, 0.7);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tradition-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid rgba(138, 111, 76, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tradition-nav-item:hover {
    border-color: var(--gold);
    background: rgba(196, 154, 98, 0.1);
    transform: translateX(2px);
}

.tradition-nav-item.active {
    border-color: var(--gold-bright);
    background: rgba(196, 154, 98, 0.18);
    box-shadow: 0 0 10px rgba(196, 154, 98, 0.2);
}

.tni-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.tni-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tni-title {
    font-family: var(--font-heading);
    font-size: 0.82rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tni-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.traditions-main-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    background: rgba(17, 23, 38, 0.9);
}

.codex-tree-header {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.cth-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.cth-emblem {
    font-size: 2rem;
}

.cth-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--gold-bright);
    margin: 0;
}

.cth-sphere {
    font-size: 0.75rem;
    color: var(--cyan);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cth-desc {
    font-size: 0.82rem;
    color: var(--text-main);
    line-height: 1.4;
    margin-bottom: 12px;
}

.cth-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tradition-tier-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 14px;
    margin-bottom: 14px;
    transition: border-color 0.2s;
}

.tradition-tier-card.tier-eligible {
    border-color: var(--gold);
    box-shadow: 0 0 12px rgba(196, 154, 98, 0.15);
}

.ttc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.ttc-tier-badge {
    background: rgba(138, 111, 76, 0.25);
    border: 1px solid var(--bronze);
    color: var(--gold);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.ttc-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--text-main);
    margin: 0;
    flex: 1;
}

.ttc-ready-pill {
    background: rgba(52, 211, 153, 0.15);
    border: 1px solid rgba(52, 211, 153, 0.4);
    color: #34d399;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.ttc-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.35;
}

.ttc-section-title {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--bronze);
    margin: 8px 0 4px 0;
}

.ttc-checklist {
    list-style: none;
    padding: 0;
    margin: 0 0 8px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ttc-checklist li {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ttc-checklist li.pass {
    color: #a7f3d0;
}

.ttc-checklist li.fail {
    color: #fca5a5;
}

.ttc-rewards-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.reward-pill {
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: rgba(10, 13, 20, 0.5);
}

.reward-pill.xp {
    border-color: #60a5fa;
    color: #93c5fd;
}

.reward-pill.gold {
    border-color: var(--gold);
    color: var(--gold-bright);
}

.reward-pill.spell {
    border-color: #a78bfa;
    color: #c4b5fd;
}

.reward-pill.cman {
    border-color: #f87171;
    color: #fca5a5;
}

.reward-pill.recipe {
    border-color: #fbbf24;
    color: #fde68a;
}

.reward-pill.item {
    border-color: #34d399;
    color: #6ee7b7;
}

.reward-pill.title {
    border-color: #e879f9;
    color: #f0abfc;
}

.ttc-rival-warning {
    font-size: 0.73rem;
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 4px;
    padding: 6px 10px;
    margin-top: 8px;
    line-height: 1.35;
}

.ttc-rival-warning strong {
    color: #f87171;
}

.ttc-rival-warning em {
    color: #fed7d7;
    font-style: normal;
    font-weight: 600;
}

.ttc-visit-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ============================================================================
   SLIDE-OVER MENTOR DOSSIER DRAWER
   ============================================================================ */

.mentor-drawer-backdrop {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    justify-content: flex-end;
}

.mentor-drawer-backdrop.hidden {
    display: none !important;
}

.mentor-drawer-panel {
    width: 440px;
    max-width: 95vw;
    height: 100vh;
    background: var(--bg-panel);
    border-left: 1px solid var(--border-color);
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.25s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.mentor-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: rgba(10, 13, 20, 0.85);
    border-bottom: 1px solid var(--border-color);
}

.mdh-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mdh-icon {
    font-size: 1.4rem;
}

.mdh-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--gold-bright);
    margin: 0;
}

.mdh-subtitle {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.drawer-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.drawer-close-btn:hover {
    color: var(--gold);
    background: rgba(255, 255, 255, 0.05);
}

.mentor-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.dossier-mentor-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 12px;
}

.dmh-emblem {
    font-size: 2.2rem;
}

.dmh-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dmh-mentor {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: var(--gold);
    margin: 0;
}

.dmh-faction {
    font-size: 0.75rem;
    color: var(--text-main);
    font-weight: 600;
}

.dmh-room {
    font-size: 0.68rem;
    color: var(--cyan);
}

.dossier-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 14px;
}

.dossier-stats-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.dsb-item {
    flex: 1;
    background: rgba(10, 13, 20, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 6px 8px;
    text-align: center;
}

.dsb-label {
    display: block;
    font-size: 0.62rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.dsb-val {
    font-size: 0.85rem;
    color: var(--text-main);
}

.gold-glow-btn {
    background: linear-gradient(180deg, #d4af37 0%, #aa820a 100%) !important;
    color: #111 !important;
    font-weight: 700 !important;
    border: 1px solid #ffd700 !important;
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.4) !important;
    cursor: pointer;
}

.gold-glow-btn:hover {
    box-shadow: 0 0 18px rgba(212, 175, 55, 0.7) !important;
    filter: brightness(1.1);
}

/* ==========================================================================
   CHARGEN: STAT GROWTH AFFINITY BADGES & LEVEL 100 TRAJECTORY CARD
   ========================================================================== */
.stat-growth-mod {
    font-size: 0.68rem;
    font-family: var(--font-mono);
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 3px;
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
    cursor: help;
    white-space: nowrap;
    flex-shrink: 0;
}

.stat-growth-mod.fast {
    background: rgba(49, 130, 206, 0.2);
    border: 1px solid rgba(66, 153, 225, 0.45);
    color: #63b3ed;
}

.stat-growth-mod.above {
    background: rgba(72, 187, 120, 0.16);
    border: 1px solid rgba(72, 187, 120, 0.4);
    color: #68d391;
}

.stat-growth-mod.steady {
    background: rgba(160, 174, 192, 0.12);
    border: 1px solid rgba(160, 174, 192, 0.3);
    color: #cbd5e0;
}

.stat-growth-mod.dampened {
    background: rgba(226, 232, 240, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.2);
    color: #a0aec0;
}

.stat-growth-trajectory-card {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.95) 0%, rgba(26, 32, 44, 0.95) 100%);
    border: 1px solid rgba(107, 142, 169, 0.35);
    border-left: 4px solid var(--cyan);
    border-radius: 6px;
    padding: 10px 14px;
    margin-top: 10px;
    flex-shrink: 0;
}

.growth-trajectory-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.growth-trajectory-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.growth-trajectory-title-wrap {
    display: flex;
    flex-direction: column;
}

.growth-trajectory-title {
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 700;
    color: #63b3ed;
    letter-spacing: 0.5px;
}

.growth-trajectory-sub {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--text-dim);
}

.growth-trajectory-desc {
    font-family: var(--font-body);
    font-size: 0.82rem;
    color: #e2e8f0;
    line-height: 1.45;
    margin: 0 0 6px 0;
}

.growth-trope-narrative {
    background: rgba(10, 15, 26, 0.7);
    border: 1px solid rgba(107, 142, 169, 0.25);
    border-left: 3px solid var(--amber, #f6ad55);
    border-radius: 5px;
    padding: 10px 14px;
    margin: 6px 0 8px 0;
    font-size: 0.82rem;
    line-height: 1.5;
    color: #cbd5e1;
}

.growth-trope-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    font-family: var(--font-heading);
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--gold-bright, #ecc94b);
}

.growth-trope-reasons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 4px;
}

@media (max-width: 900px) {
    .growth-trope-reasons {
        grid-template-columns: 1fr;
    }
}

.trope-box {
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.78rem;
    line-height: 1.45;
}

.trope-box.strengths {
    background: rgba(72, 187, 120, 0.08);
    border: 1px solid rgba(72, 187, 120, 0.25);
    color: #c6f6d5;
}

.trope-box.hinderances {
    background: rgba(237, 137, 54, 0.08);
    border: 1px solid rgba(237, 137, 54, 0.25);
    color: #feebc8;
}

.trope-box strong {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.80rem;
    margin-bottom: 2px;
    letter-spacing: 0.3px;
}

.trope-box.strengths strong {
    color: #68d391;
}

.trope-box.hinderances strong {
    color: #f6ad55;
}

.growth-highlights-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.growth-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(10, 15, 26, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 0.78rem;
    font-family: var(--font-mono);
    cursor: help;
}

.growth-chip.fast {
    border-color: rgba(72, 187, 120, 0.45);
    color: #68d391;
    background: rgba(72, 187, 120, 0.1);
}

.growth-chip.dampened {
    border-color: rgba(226, 232, 240, 0.2);
    color: #a0aec0;
}

.growth-chip.steady {
    border-color: rgba(99, 179, 237, 0.3);
    color: #90cdf4;
}

.ck3-growth-section {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 8px;
    padding: 6px 8px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(99, 179, 237, 0.25);
    border-radius: 4px;
}

.ck3-growth-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ck3-growth-label {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: #90cdf4;
    font-weight: 700;
}

.ck3-growth-badge {
    font-family: var(--font-mono);
    font-size: 0.70rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
}

.ck3-growth-badge.speed-fast {
    background: rgba(72, 187, 120, 0.2);
    border: 1px solid rgba(72, 187, 120, 0.5);
    color: #68d391;
}

.ck3-growth-badge.speed-above {
    background: rgba(56, 178, 172, 0.2);
    border: 1px solid rgba(56, 178, 172, 0.5);
    color: #4fd1c5;
}

.ck3-growth-badge.speed-steady {
    background: rgba(160, 174, 192, 0.15);
    border: 1px solid rgba(160, 174, 192, 0.35);
    color: #cbd5e0;
}

.ck3-growth-badge.speed-slow {
    background: rgba(226, 232, 240, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.25);
    color: #a0aec0;
}

.ck3-growth-hint {
    font-family: var(--font-body);
    font-size: 0.70rem;
    color: #a0aec0;
    line-height: 1.3;
}


/* ========================================================================= */
/* GOTHIC SVG CHARACTER PAPER DOLL & 24-SLOT EQUIPMENT MATRIX               */
/* ========================================================================= */

.horologe-paperdoll-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    user-select: none;
}

.paperdoll-stage {
    display: grid;
    grid-template-columns: 180px 220px 180px;
    grid-template-rows: auto auto;
    gap: 12px;
    align-items: center;
    background: radial-gradient(circle at 50% 40%, rgba(24, 21, 18, 0.95), rgba(10, 8, 7, 0.98));
    border: 1px solid var(--iron-border);
    border-radius: 8px;
    padding: 14px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8), 0 4px 15px rgba(0, 0, 0, 0.5);
}

.doll-slots-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.doll-slots-bottom {
    grid-column: 1 / span 3;
    display: flex;
    justify-content: center;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(138, 111, 76, 0.2);
}

.doll-center-viewport {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.doll-visage-badge {
    text-align: center;
    margin-bottom: 6px;
}

.pd-char-name {
    display: block;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold-bright);
    letter-spacing: 0.05em;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.pd-char-race {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.doll-mannequin-frame {
    position: relative;
    width: 200px;
    height: 320px;
    background: radial-gradient(circle at 50% 50%, rgba(32, 28, 24, 0.6) 0%, rgba(17, 15, 13, 0.9) 100%);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.doll-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.9));
}

.doll-part {
    transition: fill 0.3s ease, filter 0.3s ease;
    cursor: pointer;
}

.doll-part:hover {
    filter: brightness(1.25);
}

.pulsing-wound-overlay {
    animation: pulse-wound 1.8s infinite ease-in-out;
    pointer-events: none;
}

@keyframes pulse-wound {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 0.9; }
}

.doll-stance-pill {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(17, 15, 13, 0.85);
    border: 1px solid var(--bronze-border);
    border-radius: 12px;
    padding: 2px 10px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--gold-bright);
    letter-spacing: 0.06em;
    white-space: nowrap;
}

/* Paper Doll Slots */
.paperdoll-slot {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--iron-border);
    border-radius: 4px;
    padding: 4px 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.paperdoll-slot:hover {
    background: var(--bg-card-hover);
    border-color: var(--bronze-bright);
    transform: translateY(-1px);
}

.slot-frame {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    font-size: 1rem;
    flex-shrink: 0;
}

.slot-frame.equipped {
    border-color: var(--bronze);
    background: #1c1815;
}

.slot-frame.rarity-rare {
    border-color: #38bdf8;
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.3);
}

.slot-frame.rarity-epic {
    border-color: #c084fc;
    box-shadow: 0 0 8px rgba(192, 132, 252, 0.35);
}

.slot-frame.rarity-mythic {
    border-color: var(--gold-bright);
    box-shadow: 0 0 10px rgba(196, 165, 122, 0.45);
}

.slot-shard-pip {
    position: absolute;
    top: -3px;
    right: -3px;
    font-size: 0.65rem;
    color: #a855f7;
    text-shadow: 0 0 4px #a855f7;
}

.slot-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.slot-type-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.slot-item-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slot-item-name.empty {
    color: var(--text-dark);
    font-weight: 400;
    font-style: italic;
}

/* ========================================================================= */
/* CHRONICLE OF AETHEL — HALL OF FAME & SEASONS MODAL                        */
/* ========================================================================= */

.chronicle-modal-panel {
    max-width: 1080px;
    width: 95vw;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    border: 1px solid var(--border-crimson);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.85);
    overflow: hidden;
}

.chronicle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 18px;
    background: linear-gradient(180deg, #1f1b17 0%, #151210 100%);
}

.ch-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ch-emblem {
    font-size: 1.8rem;
}

.chronicle-horizon-bar {
    display: flex;
    background: var(--bg-main);
    border-bottom: 1px solid var(--iron-border);
    overflow-x: auto;
}

.horizon-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.horizon-tab:hover {
    color: var(--text-main);
    background: rgba(138, 111, 76, 0.08);
}

.horizon-tab.active {
    color: var(--gold-bright);
    border-bottom-color: var(--gold-bright);
    background: rgba(138, 111, 76, 0.12);
    font-weight: 700;
}

.chronicle-categories-bar {
    display: flex;
    gap: 6px;
    padding: 8px 14px;
    background: #14110e;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.cat-tab {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--bg-card);
    border: 1px solid var(--iron-border);
    border-radius: 14px;
    padding: 4px 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.cat-tab:hover {
    border-color: var(--bronze);
    color: var(--text-main);
}

.cat-tab.active {
    background: var(--bronze-border);
    border-color: var(--bronze-bright);
    color: var(--gold-bright);
    font-weight: 600;
}

.chronicle-stage-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

/* Podium Grid */
.podium-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 8px;
}

.podium-card {
    background: var(--bg-card);
    border: 1px solid var(--iron-border);
    border-radius: 6px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.podium-card.rank-gold {
    border-color: var(--gold-bright);
    background: linear-gradient(180deg, rgba(196, 165, 122, 0.08) 0%, rgba(32, 28, 24, 0.95) 100%);
    box-shadow: 0 0 14px rgba(196, 165, 122, 0.2);
}

.podium-card.rank-silver {
    border-color: #9ca3af;
}

.podium-card.rank-bronze {
    border-color: #b45309;
}

.podium-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.podium-badge {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.podium-score {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 700;
}

.podium-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.podium-name {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--text-main);
    margin-bottom: 2px;
}

.podium-season {
    font-size: 0.70rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* Leaderboard Table */
.chronicle-table-section {
    background: var(--bg-card);
    border: 1px solid var(--iron-border);
    border-radius: 6px;
    padding: 12px;
}

.table-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ch-search-field {
    background: var(--bg-input);
    border: 1px solid var(--iron-border);
    border-radius: 4px;
    color: var(--text-main);
    padding: 4px 8px;
    font-size: 0.78rem;
    width: 220px;
}

.ch-table-wrapper {
    overflow-x: auto;
}

.chronicle-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.chronicle-table th {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--iron-border);
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chronicle-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(59, 53, 45, 0.4);
}

.chronicle-table tr:hover {
    background: rgba(138, 111, 76, 0.08);
}

/* ========================================================================= */
/* CHARACTER BUILD INSPECTOR MODAL                                           */
/* ========================================================================= */

.inspector-modal-panel {
    max-width: 1100px;
    width: 95vw;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    border: 1px solid var(--bronze-bright);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
    overflow: hidden;
}

.inspector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 18px;
    background: linear-gradient(180deg, #1f1b17 0%, #151210 100%);
}

.insp-title-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.insp-icon {
    font-size: 1.8rem;
}

.inspector-stage-split {
    display: grid;
    grid-template-columns: 520px 1fr;
    gap: 16px;
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.insp-col-paperdoll {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.insp-paperdoll-wrapper {
    width: 100%;
}

.insp-col-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.insp-section-card {
    background: var(--bg-card);
    border: 1px solid var(--iron-border);
    border-radius: 6px;
    padding: 12px;
}

/* 12 Attributes Grid */
.insp-attributes-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.insp-stat-chip {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
}

.sc-abbr {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--gold-bright);
}

.sc-val {
    font-family: var(--font-mono);
    font-weight: 700;
}

.sc-bonus {
    font-family: var(--font-mono);
    font-size: 0.70rem;
    padding: 1px 4px;
    border-radius: 2px;
}

.sc-bonus.pos {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.sc-bonus.neg {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* Skills Chips */
.insp-skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.insp-skill-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-input);
    border: 1px solid var(--iron-border);
    border-radius: 3px;
    padding: 4px 8px;
    font-size: 0.75rem;
}

/* Telemetry Peaks Grid */
.insp-telemetry-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.insp-tel-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 6px 10px;
}

.it-icon {
    font-size: 1.2rem;
}

.it-body {
    display: flex;
    flex-direction: column;
}

.it-label {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.it-val {
    font-size: 0.85rem;
}

/* Comparison Grid */
.insp-comparison-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.cmp-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 0.75rem;
}

.cmp-delta.pos-delta {
    color: #4ade80;
}

.cmp-delta.neg-delta {
    color: #f87171;
}

.cmp-delta.even-delta {
    color: var(--text-muted);
}

/* ============================================================================
   HUD ADVANCED EXPANSION: LAYOUTS, DOCKING, COMPASS, TARGET HUD & CHAT DOCK
   ============================================================================ */

/* Topbar Layout Switcher */
.topbar-layout-switcher {
    display: flex;
    align-items: center;
    background: #141116;
    border: 1px solid #36282b;
    border-radius: 5px;
    padding: 2px;
    gap: 2px;
    margin-right: 8px;
}

.layout-toggle-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 7px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.2;
}

.layout-toggle-btn:hover {
    color: var(--gold-bright);
    background: rgba(185, 28, 28, 0.15);
}

.layout-toggle-btn.active {
    background: #381216;
    border-color: #7f1d1d;
    color: var(--gold-bright);
    box-shadow: 0 0 6px rgba(185, 28, 28, 0.3);
}

/* Right Sidebar (3-Column Layout) */
#right-sidebar {
    width: 320px;
    background: #100f12;
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
    gap: 8px;
    padding: 6px;
}

#right-sidebar.hidden {
    display: none !important;
}

#right-sidebar::-webkit-scrollbar {
    width: 5px;
}
#right-sidebar::-webkit-scrollbar-thumb {
    background: #3a343b;
    border-radius: 3px;
}

.right-sidebar-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    color: var(--text-dark);
    font-size: 0.75rem;
    gap: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    margin: 8px;
}

/* Chat Focus Mode */
#main-view.layout-chat-focus #left-sidebar,
#main-view.layout-chat-focus #right-sidebar {
    display: none !important;
}

#main-view.layout-chat-focus #room-header-dock {
    max-height: 140px;
}

/* Command Bar Input with Roundtime Badge */
.cmd-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
}

.cmd-input-wrapper input#command-input {
    width: 100%;
    padding-right: 12px;
}

.cmd-roundtime-badge {
    position: absolute;
    left: 8px;
    right: auto;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(20, 10, 14, 0.92);
    border: 1px solid #b91c1c;
    border-radius: 4px;
    padding: 2px 7px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: #fca5a5;
    box-shadow: 0 0 10px rgba(185, 28, 28, 0.45);
    z-index: 5;
    transition: opacity 0.15s ease;
}

.cmd-roundtime-badge.hidden {
    display: none !important;
}

.cmd-rt-sand {
    font-size: 0.8rem;
    line-height: 1;
}

.cmd-rt-label {
    font-family: var(--font-mono);
    font-weight: 700;
    color: #fca5a5;
    letter-spacing: 0.04em;
    min-width: 18px;
}

.cmd-rt-blocks {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 2px;
}

.cmd-rt-block {
    width: 14px;
    height: 15px;
    background: linear-gradient(180deg, #dc2626 0%, #7f1d1d 100%);
    border: 1px solid #ef4444;
    border-radius: 2px;
    box-shadow: 0 0 4px rgba(220, 38, 38, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.cmd-rt-block.active-tick {
    background: linear-gradient(180deg, #f87171 0%, #b91c1c 100%);
    border-color: #fca5a5;
    box-shadow: 0 0 8px rgba(248, 113, 113, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    animation: rtBlockPulse 0.8s infinite alternate ease-in-out;
}

@keyframes rtBlockPulse {
    from {
        border-color: #fca5a5;
        box-shadow: 0 0 8px rgba(248, 113, 113, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    }
    to {
        border-color: #ef4444;
        box-shadow: 0 0 3px rgba(239, 68, 68, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
}

.cmd-input-wrapper.in-roundtime input#command-input::placeholder {
    color: transparent !important;
}

.cmd-input-wrapper.in-roundtime input#command-input:not(:placeholder-shown) ~ .cmd-roundtime-badge {
    opacity: 0.35;
}

/* Minimap Compass Rose & Sensory Perception Stack */
.map-nav-perception-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(14, 16, 22, 0.95);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-top: 2px;
}

.map-compass-rose {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0;
    background: transparent;
    border: none;
    flex-shrink: 0;
}

.compass-grid {
    display: grid;
    grid-template-columns: repeat(3, 26px);
    grid-template-rows: repeat(3, 24px);
    gap: 2px;
}

.compass-node {
    background: #1b181e;
    border: 1px solid #332d36;
    color: var(--text-dark);
    font-family: var(--font-mono);
    font-size: 0.58rem;
    font-weight: 700;
    border-radius: 3px;
    cursor: default;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.compass-node.active-exit {
    background: #2b1d22;
    border-color: var(--gold);
    color: var(--gold-bright);
    cursor: pointer;
    box-shadow: 0 0 5px rgba(245, 158, 11, 0.25);
}

.compass-node.active-exit:hover {
    background: #45171d;
    border-color: #f59e0b;
    color: #fff;
    transform: scale(1.08);
}

.compass-node.compass-center {
    border-color: #4b3e34;
    color: var(--bronze);
    cursor: pointer;
}

.compass-node.compass-center:hover {
    background: #261f28;
    color: var(--gold-bright);
}

.compass-vertical-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.compass-v-btn {
    background: #1b181e;
    border: 1px solid #332d36;
    color: var(--text-dark);
    font-family: var(--font-mono);
    font-size: 0.58rem;
    font-weight: 700;
    border-radius: 3px;
    padding: 3px 6px;
    cursor: default;
    transition: all 0.15s ease;
}

.compass-v-btn.active-exit {
    background: #2b1d22;
    border-color: var(--cyan);
    color: #67e8f9;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(6, 182, 212, 0.25);
}

.compass-v-btn.active-exit:hover {
    background: #0f2e38;
    color: #fff;
    transform: scale(1.05);
}

/* Sensory Perception Stack (Look, Smell, Hear, Taste) */
.map-perception-stack {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.perception-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #141722;
    border: 1px solid #2a3348;
    color: var(--text-light);
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    height: 18px;
    user-select: none;
}

.perception-btn:hover {
    background: #222b3d;
    border-color: var(--gold);
    color: #fff;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.25);
    transform: translateX(1px);
}

.perception-btn iconify-icon {
    font-size: 0.95em;
    flex-shrink: 0;
}

.perception-btn .perception-label {
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.perception-btn .perception-dir-tag {
    font-family: var(--font-mono);
    font-size: 0.58rem;
    color: var(--gold-bright);
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 2px;
    padding: 0 3px;
    line-height: 1.2;
}

.perception-btn .perception-dir-tag:empty {
    display: none;
}

/* Target Lock HUD Widget */
.target-empty-state {
    padding: 12px 10px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.72rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.target-empty-state .target-hint {
    font-size: 0.64rem;
    color: var(--text-dark);
}

.target-active-card {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.target-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.target-name {
    font-family: var(--font-heading);
    font-size: 0.88rem;
    color: var(--gold-bright);
    letter-spacing: 0.04em;
}

.target-badge {
    font-size: 0.62rem;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 700;
    text-transform: uppercase;
}

.target-badge.hostile {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border: 1px solid #ef4444;
}

.target-badge.friendly {
    background: rgba(34, 197, 94, 0.18);
    color: #4ade80;
    border: 1px solid #22c55e;
}

.target-vital-bar-wrap {
    position: relative;
    height: 12px;
    background: #1c1920;
    border: 1px solid #3d2f34;
    border-radius: 3px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.target-hp-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, #991b1b, #ef4444);
    transition: width 0.3s ease;
}

.target-hp-text {
    position: relative;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px #000;
}

.target-meta-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.target-meta-chip {
    font-size: 0.6rem;
    background: #18151c;
    border: 1px solid #332d3a;
    padding: 2px 6px;
    border-radius: 3px;
    color: var(--text-muted);
}

.target-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-top: 2px;
}

.target-act-btn {
    background: #1c1822;
    border: 1px solid #4a363d;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.target-act-btn:hover {
    background: #381b22;
    border-color: #b91c1c;
    color: var(--gold-bright);
}

.target-act-btn.primary {
    background: rgba(185, 28, 28, 0.2);
    border-color: #b91c1c;
    color: #fca5a5;
}

.target-act-btn.primary:hover {
    background: #b91c1c;
    color: #fff;
}

/* Active Companion & Minion HUD Widget */
.companion-empty-state {
    padding: 12px 10px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.72rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.companion-empty-state .companion-hint {
    font-size: 0.64rem;
    color: var(--text-dark);
}

.companion-active-card {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.companion-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.companion-identity-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.companion-species-icon {
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
}

.companion-name {
    font-family: var(--font-heading);
    font-size: 0.88rem;
    color: var(--gold-bright);
    letter-spacing: 0.04em;
}

.companion-level-chip {
    font-size: 0.6rem;
    padding: 1px 4px;
    background: #252030;
    border: 1px solid #4a3e5c;
    border-radius: 3px;
    color: var(--gold);
    font-family: var(--font-mono);
}

.companion-loyalty-badge {
    font-size: 0.62rem;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 700;
    text-transform: uppercase;
}

.companion-loyalty-badge.revered {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid #10b981;
}

.companion-loyalty-badge.devoted {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    border: 1px solid #a855f7;
}

.companion-loyalty-badge.loyal {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid #3b82f6;
}

.companion-loyalty-badge.docile {
    background: rgba(234, 179, 8, 0.2);
    color: #fde047;
    border: 1px solid #eab308;
}

.companion-loyalty-badge.uneasy {
    background: rgba(249, 115, 22, 0.2);
    color: #fb923c;
    border: 1px solid #f97316;
}

.companion-loyalty-badge.rebellious {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid #ef4444;
}

.companion-vital-bar-wrap {
    position: relative;
    height: 12px;
    background: #1c1920;
    border: 1px solid #3d2f34;
    border-radius: 3px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.companion-hp-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, #15803d, #22c55e);
    transition: width 0.3s ease;
}

.companion-hp-text {
    position: relative;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px #000;
}

.companion-gauges-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.companion-gauge-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.companion-gauge-label {
    font-size: 0.58rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.05em;
}

.companion-gauge-track {
    position: relative;
    height: 6px;
    background: #18151c;
    border: 1px solid #332d3a;
    border-radius: 2px;
    overflow: hidden;
}

.companion-gauge-fill.loyalty-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, #2563eb, #38bdf8);
    transition: width 0.3s ease;
}

.companion-gauge-fill.hunger-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, #ca8a04, #ea580c);
    transition: width 0.3s ease;
}

.companion-gauge-val {
    font-size: 0.58rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.companion-meta-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.companion-meta-chip {
    font-size: 0.6rem;
    background: #18151c;
    border: 1px solid #332d3a;
    padding: 2px 6px;
    border-radius: 3px;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
}

.companion-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px;
    margin-top: 2px;
}

.companion-act-btn {
    background: #1c1822;
    border: 1px solid #4a363d;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.66rem;
    font-weight: 600;
    padding: 4px 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.companion-act-btn:hover {
    background: #381b22;
    border-color: var(--gold);
    color: var(--gold-bright);
}

.companion-act-btn.primary {
    background: rgba(185, 28, 28, 0.18);
    border-color: #991b1b;
    color: #fca5a5;
}

.companion-act-btn.primary:hover {
    background: #b91c1c;
    color: #fff;
}

.companion-act-btn.danger {
    background: rgba(100, 20, 20, 0.2);
    border-color: #552222;
    color: #e57373;
}

.companion-act-btn.danger:hover {
    background: #7f1d1d;
    color: #fff;
    border-color: #ef4444;
}

/* Active Auras & Buffs Tray */
.buffs-tray-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 8px;
    max-height: 160px;
    overflow-y: auto;
}

.buff-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    background: rgba(22, 19, 28, 0.8);
    border: 1px solid #382d38;
    border-radius: 4px;
    font-size: 0.7rem;
    transition: all 0.15s;
}

.buff-chip:hover {
    border-color: var(--gold);
    background: rgba(40, 30, 48, 0.9);
}

.buff-chip.buff {
    border-left: 3px solid var(--cyan);
}

.buff-chip.debuff {
    border-left: 3px solid #ef4444;
}

.buff-info-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.buff-name {
    font-weight: 600;
    color: var(--text-main);
}

.buff-val {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--text-muted);
}

/* Room Header Dual-Pane Dock */
.room-header-dock {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    background: #0d0c0f;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    min-height: 130px;
    max-height: 220px;
    overflow: hidden;
}

.room-header-dock:empty {
    display: none !important;
}

.room-view-widget,
.chat-log-widget {
    background: #121017;
    border: 1px solid #38272f;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.room-view-widget {
    flex: 1.25;
}

.chat-log-widget {
    flex: 1;
}

/* When docked in sidebars */
#left-sidebar .room-view-widget,
#left-sidebar .chat-log-widget,
#right-sidebar .room-view-widget,
#right-sidebar .chat-log-widget {
    width: 100%;
    margin-bottom: 8px;
    flex-shrink: 0;
    max-height: 320px;
}

.rv-header,
.cl-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: #1a1622;
    border-bottom: 1px solid #33252c;
    flex-shrink: 0;
    gap: 6px;
}

.rv-title-wrap,
.cl-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.cl-title-wrap {
    flex-direction: row;
    align-items: center;
    gap: 6px;
}

.cl-icon {
    font-size: 0.95rem;
}

.cl-title {
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--gold-bright);
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.rv-badges-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rv-header .room-banner-title {
    font-size: 0.92rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hud-win-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.hud-dock-select {
    background: #141118;
    border: 1px solid #4a363d;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.64rem;
    padding: 2px 4px;
    border-radius: 3px;
    cursor: pointer;
}

.hud-dock-select:hover {
    border-color: var(--gold);
    color: var(--gold-bright);
}

.rv-body,
.cl-body {
    padding: 8px 10px;
    overflow-y: auto;
    flex: 1;
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rv-desc {
    color: #cbd5e1;
    line-height: 1.35;
    font-size: 0.75rem;
}

.rv-section-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 0.7rem;
}

.rv-tag {
    color: var(--gold);
    font-weight: 700;
    font-family: var(--font-heading);
    font-size: 0.62rem;
    letter-spacing: 0.05em;
    flex-shrink: 0;
    margin-top: 1px;
}

.rv-tags-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* Chat Comms Filter Tabs */
.cl-filter-tabs {
    display: flex;
    gap: 2px;
    background: #100e14;
    border-radius: 4px;
    padding: 1px;
}

.cl-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.62rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.cl-tab-btn:hover {
    color: #fff;
}

.cl-tab-btn.active {
    background: #3b171c;
    color: var(--gold-bright);
}

.cl-empty-state {
    color: var(--text-dark);
    font-style: italic;
    font-size: 0.7rem;
    text-align: center;
    padding: 18px 0;
}

.cl-msg-row {
    display: flex;
    gap: 6px;
    font-size: 0.73rem;
    line-height: 1.3;
    padding: 2px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.cl-msg-time {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--text-dark);
    flex-shrink: 0;
}

.cl-msg-tag {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0 4px;
    border-radius: 2px;
    flex-shrink: 0;
}

.cl-msg-tag.tag-say { background: rgba(59, 130, 246, 0.18); color: #93c5fd; }
.cl-msg-tag.tag-whisper { background: rgba(168, 85, 247, 0.18); color: #d8b4fe; }
.cl-msg-tag.tag-esp { background: rgba(20, 184, 166, 0.18); color: #5eead4; }

.cl-msg-text {
    flex: 1;
    word-break: break-word;
}

/* Interactive Narrative Entities */
.interactive-narrative-entity {
    display: inline-block;
    cursor: pointer;
    padding: 0 3px;
    border-radius: 3px;
    font-weight: 600;
    transition: all 0.15s ease;
}

.interactive-narrative-entity.exit-entity {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.3);
}
.interactive-narrative-entity.exit-entity:hover {
    color: #fff;
    background: #0284c7;
    border-color: #38bdf8;
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.4);
}

.interactive-narrative-entity.mob-entity {
    color: #f87171;
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.3);
}
.interactive-narrative-entity.mob-entity:hover {
    color: #fff;
    background: #dc2626;
    border-color: #f87171;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

.interactive-narrative-entity.item-entity {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.3);
}
.interactive-narrative-entity.item-entity:hover {
    color: #fff;
    background: #d97706;
    border-color: #fbbf24;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

.interactive-narrative-entity.player-entity {
    color: #c084fc;
    background: rgba(192, 132, 252, 0.08);
    border: 1px solid rgba(192, 132, 252, 0.3);
}
.interactive-narrative-entity.player-entity:hover {
    color: #fff;
    background: #9333ea;
    border-color: #c084fc;
    box-shadow: 0 0 6px rgba(168, 85, 247, 0.4);
}

/* ============================================================== */
/* DEDICATED TACTICAL COMBAT VIEW HUD WIDGET                      */
/* ============================================================== */
.combat-view-widget {
    background: rgba(10, 13, 20, 0.94);
    border: 1px solid rgba(220, 38, 38, 0.35);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    min-height: 180px;
    max-height: 320px;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
}

.combat-tab-btn {
    padding: 3px 8px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.combat-tab-btn:hover {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.4);
}
.combat-tab-btn.active {
    color: #fff;
    background: rgba(220, 38, 38, 0.25);
    border-color: #ef4444;
}

.combat-msg-row {
    padding: 4px 8px;
    font-family: var(--font-mono, monospace);
    font-size: 0.8rem;
    line-height: 1.35;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.combat-msg-row.combat-crit {
    background: rgba(239, 68, 68, 0.12);
    border-left: 3px solid #ef4444;
    color: #fca5a5;
    font-weight: 600;
}
.combat-msg-row.combat-strike {
    border-left: 2px solid #eab308;
    color: #fef08a;
}
.combat-msg-row.combat-defend {
    border-left: 2px solid #38bdf8;
    color: #bae6fd;
}
.combat-msg-time {
    color: var(--text-dark, #555);
    font-size: 0.7rem;
    white-space: nowrap;
}

/* ============================================================== */
/* TERMINAL TOOLBAR (STREAM FILTERS & CUSTOMIZATION)              */
/* ============================================================== */
.terminal-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 10px;
    background: rgba(15, 20, 32, 0.95);
    border-bottom: 1px solid rgba(200, 160, 80, 0.15);
    font-size: 0.75rem;
    z-index: 4;
}
.terminal-toolbar-left, .terminal-toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
}
.tt-label {
    font-family: var(--font-heading, serif);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--gold, #c8a050);
}
.tt-filters {
    display: flex;
    gap: 4px;
}
.tt-filter-btn {
    padding: 2px 7px;
    font-size: 0.72rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}
.tt-filter-btn:hover {
    color: var(--gold-bright);
    border-color: rgba(200, 160, 80, 0.35);
}
.tt-filter-btn.active {
    color: #fff;
    background: rgba(200, 160, 80, 0.22);
    border-color: var(--gold, #c8a050);
}
.tt-action-btn {
    padding: 2px 8px;
    font-size: 0.72rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}
.tt-action-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(200, 160, 80, 0.4);
}

/* ============================================================== */
/* VISUAL TYPEAHEAD & ACTION QUEUE STRIP                          */
/* ============================================================== */
.cmd-typeahead-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    background: rgba(20, 24, 38, 0.95);
    border: 1px solid rgba(200, 160, 80, 0.25);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    overflow-x: auto;
    font-family: var(--font-mono, monospace);
    font-size: 0.74rem;
}
.typeahead-title {
    color: var(--amber, #f59e0b);
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.05em;
}
.typeahead-chips-list {
    display: flex;
    gap: 6px;
    align-items: center;
}
.typeahead-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 7px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 3px;
    color: #fde68a;
    white-space: nowrap;
    animation: fadeIn 0.15s ease-out;
}
.typeahead-chip-del {
    color: #ef4444;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.82rem;
    padding: 0 2px;
}
.typeahead-chip-del:hover {
    color: #f87171;
}

/* ============================================================== */
/* CUSTOMIZABLE HOTKEY QUICKBAR RIBBON                            */
/* ============================================================== */
.hotkey-quickbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 4px 8px;
    background: rgba(14, 18, 28, 0.96);
    border: 1px solid rgba(200, 160, 80, 0.18);
    border-radius: 4px;
    margin: 4px 0;
}
.hotkey-slots-strip {
    display: flex;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
}
.hotkey-slot {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    font-size: 0.72rem;
    color: var(--text-main, #d1d5db);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: all 0.15s ease;
}
.hotkey-slot:hover {
    background: rgba(200, 160, 80, 0.18);
    border-color: var(--gold, #c8a050);
    color: #fff;
}
.hotkey-slot:active {
    transform: translateY(1px);
}
.hotkey-num {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--gold, #c8a050);
    background: rgba(0, 0, 0, 0.4);
    padding: 1px 4px;
    border-radius: 2px;
}
.hotkey-icon {
    font-size: 0.8rem;
}
.hotkey-label {
    font-weight: 600;
}
.hotkey-edit-btn {
    padding: 3px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gold);
    background: rgba(200, 160, 80, 0.1);
    border: 1px solid rgba(200, 160, 80, 0.3);
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
}
.hotkey-edit-btn:hover {
    background: var(--gold);
    color: #000;
}

/* ============================================================== */
/* SILENT VISUAL ALERT PERIPHERAL VIGNETTE (NO AUDIO CUES)        */
/* ============================================================== */
.visual-alert-vignette {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.visual-alert-vignette.alert-hit {
    box-shadow: inset 0 0 70px 20px rgba(220, 38, 38, 0.65);
    opacity: 1;
    animation: flashAlert 0.45s ease-out;
}
.visual-alert-vignette.alert-bleed {
    box-shadow: inset 0 0 50px 15px rgba(185, 28, 28, 0.5);
    opacity: 1;
    animation: pulseBleed 1.2s infinite ease-in-out alternate;
}
.visual-alert-vignette.alert-whisper {
    box-shadow: inset 0 0 60px 15px rgba(245, 158, 11, 0.55);
    opacity: 1;
    animation: flashAlert 0.6s ease-out;
}
.visual-alert-vignette.alert-levelup {
    box-shadow: inset 0 0 90px 25px rgba(234, 179, 8, 0.75);
    opacity: 1;
    animation: flashAlert 0.9s ease-out;
}
.visual-alert-vignette.alert-skillup {
    box-shadow: inset 0 0 70px 20px rgba(56, 189, 248, 0.65);
    opacity: 1;
    animation: flashAlert 0.7s ease-out;
}

@keyframes flashAlert {
    0% { opacity: 1; }
    100% { opacity: 0; }
}
@keyframes pulseBleed {
    0% { opacity: 0.35; }
    100% { opacity: 0.85; }
}

/* ============================================================== */
/* EQUIPMENT BODY MAP & NESTED CONTAINER DRAWER                   */
/* ============================================================== */
.equipment-map-panel {
    max-width: 860px;
    width: 90%;
    background: var(--bg-panel, #111726);
    border: 1px solid var(--border-color, rgba(200, 160, 80, 0.3));
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
}
.equipment-map-layout {
    display: grid;
    grid-template-columns: 1fr 180px 1fr;
    gap: 16px;
    padding: 1rem;
    align-items: start;
}
.eq-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.eq-slot-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 4px;
    transition: all 0.15s ease;
    cursor: pointer;
}
.eq-slot-card:hover {
    border-color: var(--gold, #c8a050);
    background: rgba(200, 160, 80, 0.1);
}
.eq-slot-card.has-item {
    border-color: rgba(200, 160, 80, 0.3);
}
.eq-slot-card.is-container {
    border-left: 3px solid #38bdf8;
}
.eq-slot-info {
    display: flex;
    flex-direction: column;
}
.eq-slot-type {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--gold, #c8a050);
    letter-spacing: 0.06em;
}
.eq-slot-item-name {
    font-size: 0.8rem;
    color: #fff;
    font-weight: 500;
}
.eq-silhouette-frame {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 0;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}
.eq-silhouette-figure {
    font-size: 4rem;
    opacity: 0.7;
    margin-bottom: 12px;
}
.eq-weight-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.nested-container-drawer {
    border-top: 1px solid rgba(56, 189, 248, 0.3);
    background: rgba(8, 12, 20, 0.95);
    padding: 12px;
    margin-top: 10px;
    border-radius: 0 0 6px 6px;
}
.ncd-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.ncd-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ncd-items-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.ncd-item-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 0.78rem;
}
.ncd-item-chip:hover {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
}

/* ============================================================== */
/* PREP SPELL & GRIMOIRE OF ALL WEAVES SLIDEOUT                   */
/* ============================================================== */
.prep-spell-drawer.spellbook-drawer {
    position: fixed;
    top: 52px;
    left: 20px;
    width: 580px;
    height: 480px;
    min-width: 380px;
    min-height: 220px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 64px);
    background: linear-gradient(135deg, rgba(31, 20, 14, 0.95) 0%, rgba(40, 26, 19, 0.95) 35%, rgba(24, 14, 10, 0.97) 70%, rgba(15, 9, 7, 0.98) 100%);
    backdrop-filter: blur(8px);
    border: 2px solid #8e622b;
    outline: 1px solid rgba(212, 175, 55, 0.35);
    outline-offset: -5px;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.92), 0 0 30px rgba(212, 160, 23, 0.18), inset 0 0 25px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    z-index: 2500;
    overflow: hidden;
    resize: both;
    animation: spellbookSlideDown 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform-origin: top center;
    box-sizing: border-box;
    transition: opacity 0.2s ease, background 0.2s ease;
}

/* Translucent Glass Mode (allows reading combat explosions beneath) */
.prep-spell-drawer.spellbook-drawer.is-ghost {
    opacity: 0.52;
    background: linear-gradient(135deg, rgba(31, 20, 14, 0.55) 0%, rgba(40, 26, 19, 0.55) 35%, rgba(24, 14, 10, 0.6) 70%, rgba(15, 9, 7, 0.65) 100%);
    backdrop-filter: blur(2px);
}
.prep-spell-drawer.spellbook-drawer.is-ghost:hover {
    opacity: 0.96;
    backdrop-filter: blur(10px);
}

/* Minimized State */
.prep-spell-drawer.spellbook-drawer.is-minimized {
    height: 48px !important;
    min-height: 48px !important;
    resize: none !important;
    overflow: hidden !important;
}
.prep-spell-drawer.spellbook-drawer.is-minimized .psd-active-banner,
.prep-spell-drawer.spellbook-drawer.is-minimized .psd-ribbons-bar,
.prep-spell-drawer.spellbook-drawer.is-minimized .psd-search-row,
.prep-spell-drawer.spellbook-drawer.is-minimized .psd-body,
.prep-spell-drawer.spellbook-drawer.is-minimized .psd-footer-bar {
    display: none !important;
}

@keyframes spellbookSlideDown {
    from {
        opacity: 0;
        transform: translateY(-14px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Ornamental Brass Corner Brackets */
.psd-corner {
    position: absolute;
    width: 18px;
    height: 18px;
    pointer-events: none;
    z-index: 10;
}
.psd-corner.tl {
    top: 4px;
    left: 4px;
    border-top: 2px solid var(--gold-bright, #ffd700);
    border-left: 2px solid var(--gold-bright, #ffd700);
    border-top-left-radius: 4px;
}
.psd-corner.tr {
    top: 4px;
    right: 4px;
    border-top: 2px solid var(--gold-bright, #ffd700);
    border-right: 2px solid var(--gold-bright, #ffd700);
    border-top-right-radius: 4px;
}
.psd-corner.bl {
    bottom: 4px;
    left: 4px;
    border-bottom: 2px solid var(--gold-bright, #ffd700);
    border-left: 2px solid var(--gold-bright, #ffd700);
    border-bottom-left-radius: 4px;
}
.psd-corner.br {
    bottom: 4px;
    right: 4px;
    border-bottom: 2px solid var(--gold-bright, #ffd700);
    border-right: 2px solid var(--gold-bright, #ffd700);
    border-bottom-right-radius: 4px;
}

/* Spellbook Header (Draggable) */
.psd-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px 7px;
    background: linear-gradient(180deg, rgba(42, 28, 20, 0.95) 0%, rgba(22, 14, 10, 0.95) 100%);
    border-bottom: 1.5px solid rgba(200, 160, 80, 0.35);
    cursor: grab;
    user-select: none;
}
.psd-header:active {
    cursor: grabbing;
}

.psd-header-action-btn {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(212, 160, 23, 0.35);
    color: var(--gold-bright, #ffd700);
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 0.7rem;
    cursor: pointer;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    margin-right: 4px;
}
.psd-header-action-btn:hover {
    background: rgba(212, 160, 23, 0.3);
    border-color: #ffd700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
    transform: scale(1.06);
}
.psd-header-action-btn.active {
    background: rgba(212, 160, 23, 0.5);
    border-color: #ffd700;
    color: #fff;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.7);
}

.psd-resize-grip {
    position: absolute;
    bottom: 2px;
    right: 5px;
    font-size: 0.8rem;
    color: rgba(212, 160, 23, 0.45);
    pointer-events: none;
    line-height: 1;
    user-select: none;
}
    position: relative;
}
.psd-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}
.psd-icon {
    font-size: 1.4rem;
    filter: drop-shadow(0 0 6px rgba(255, 200, 80, 0.6));
}
.psd-title {
    font-family: var(--font-heading, Cinzel, serif);
    font-size: 0.96rem;
    letter-spacing: 0.08em;
    color: var(--gold-bright, #ffd700);
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9), 0 0 10px rgba(212, 160, 23, 0.35);
}
.psd-sub {
    font-size: 0.68rem;
    color: #d1b58a;
    font-style: italic;
    display: block;
    margin-top: 2px;
}
.psd-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.psd-omni-badge {
    padding: 3px 8px;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #ffe899;
    background: radial-gradient(circle, rgba(212, 160, 23, 0.25) 0%, rgba(80, 45, 15, 0.35) 100%);
    border: 1px solid rgba(255, 215, 0, 0.45);
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.25);
    text-transform: uppercase;
}
.psd-close-btn {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(200, 160, 80, 0.3);
    color: #e2d7c5;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.psd-close-btn:hover {
    background: rgba(220, 50, 50, 0.3);
    border-color: #ef4444;
    color: #fff;
    transform: scale(1.08);
}

/* Active Prepared Spell Banner */
.psd-active-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 18px;
    background: rgba(18, 12, 8, 0.88);
    border-bottom: 1px solid rgba(200, 160, 80, 0.2);
    gap: 12px;
}
.psd-active-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.psd-active-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--gold, #d4a017);
}
.psd-active-prep-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(212, 160, 23, 0.12);
    border: 1px solid rgba(212, 160, 23, 0.35);
    border-radius: 4px;
    padding: 2px 8px;
}
.psd-active-icon {
    font-size: 0.9rem;
}
.psd-active-name {
    font-size: 0.82rem;
    color: #fff;
    font-weight: 600;
}
.psd-active-meta {
    font-size: 0.68rem;
    color: #94a3b8;
    margin-left: 4px;
}
.psd-active-actions {
    display: flex;
    gap: 6px;
}
.psd-action-btn {
    padding: 3px 9px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    border-radius: 4px;
}

/* Silk Bookmark Ribbon Tabs */
.psd-ribbons-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    padding: 8px 12px 6px;
    background: rgba(12, 8, 6, 0.88);
    border-bottom: 1.5px solid rgba(200, 160, 80, 0.3);
}
.psd-ribbon-tab {
    background: linear-gradient(180deg, rgba(30, 20, 15, 0.9) 0%, rgba(18, 12, 9, 0.95) 100%);
    border: 1px solid rgba(200, 160, 80, 0.25);
    border-radius: 4px;
    color: #d1b58a;
    font-family: var(--font-heading, Cinzel, serif);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 4px 8px;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
    user-select: none;
}
.psd-ribbon-tab:hover {
    background: linear-gradient(180deg, rgba(45, 30, 22, 0.95) 0%, rgba(26, 17, 12, 0.98) 100%);
    color: #ffe899;
    border-color: rgba(255, 215, 0, 0.45);
    transform: translateY(-1px);
}
.psd-ribbon-tab.active {
    background: linear-gradient(180deg, rgba(60, 40, 28, 0.98) 0%, rgba(32, 22, 16, 1) 100%);
    color: #fff;
    border-color: var(--gold-bright, #ffd700);
    box-shadow: 0 0 10px rgba(212, 160, 23, 0.35);
    z-index: 2;
}

/* Search Bar & Type Filter Row */
.psd-search-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(14, 9, 7, 0.9);
    border-bottom: 1px solid rgba(200, 160, 80, 0.15);
}
.psd-search-box-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}
.psd-search-icon {
    position: absolute;
    left: 8px;
    font-size: 0.8rem;
    pointer-events: none;
    opacity: 0.7;
}
.psd-search-input {
    width: 100%;
    padding: 5px 26px 5px 28px;
    background: rgba(8, 5, 4, 0.85);
    border: 1px solid rgba(200, 160, 80, 0.25);
    border-radius: 4px;
    color: #f5eedc;
    font-family: var(--font-body, Outfit, sans-serif);
    font-size: 0.76rem;
    outline: none;
    transition: all 0.15s ease;
}
.psd-search-input:focus {
    border-color: var(--gold-bright, #ffd700);
    box-shadow: 0 0 8px rgba(212, 160, 23, 0.3);
}
.psd-search-clear {
    position: absolute;
    right: 6px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 2px 4px;
}
.psd-search-clear:hover {
    color: #fff;
}
.psd-type-filters {
    display: flex;
    gap: 3px;
}
.psd-type-btn {
    padding: 4px 7px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #c4b5a0;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(200, 160, 80, 0.2);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.12s ease;
}
.psd-type-btn:hover {
    color: #fff;
    border-color: rgba(255, 215, 0, 0.4);
}
.psd-type-btn.active {
    background: rgba(212, 160, 23, 0.2);
    border-color: var(--gold);
    color: var(--gold-bright);
}
.psd-count-badge {
    font-size: 0.65rem;
    font-family: var(--font-mono, monospace);
    color: #94a3b8;
    white-space: nowrap;
}

/* Spellbook Vellum Grid Body */
.psd-body.spellbook-vellum-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 8px 10px;
    background: radial-gradient(circle at 50% 20%, rgba(32, 22, 16, 0.98) 0%, rgba(16, 11, 8, 1) 100%);
    box-shadow: inset 0 0 45px rgba(0, 0, 0, 0.8);
    position: relative;
    min-height: 140px;
    max-height: none;
}
.psd-body::-webkit-scrollbar {
    width: 6px;
}
.psd-body::-webkit-scrollbar-track {
    background: rgba(10, 6, 4, 0.8);
}
.psd-body::-webkit-scrollbar-thumb {
    background: rgba(160, 120, 60, 0.5);
    border-radius: 3px;
}
.psd-body::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 160, 23, 0.7);
}

.spellbook-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
    gap: 8px;
}

/* Individual Spell Tile */
.psd-spell-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 6px 4px 5px;
    background: linear-gradient(180deg, rgba(38, 26, 19, 0.7) 0%, rgba(20, 14, 10, 0.85) 100%);
    border: 1px solid rgba(200, 160, 80, 0.22);
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
    text-align: center;
    user-select: none;
}
.psd-spell-tile:hover {
    transform: translateY(-3px);
    background: linear-gradient(180deg, rgba(55, 38, 28, 0.85) 0%, rgba(30, 20, 14, 0.95) 100%);
    border-color: var(--gold-bright, #ffd700);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7), 0 0 14px rgba(212, 160, 23, 0.35);
}
.psd-spell-tile.is-prepared {
    border-color: var(--gold-bright, #ffd700);
    background: linear-gradient(180deg, rgba(65, 45, 20, 0.85) 0%, rgba(38, 24, 10, 0.95) 100%);
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.45), inset 0 0 12px rgba(255, 215, 0, 0.15);
}

.psd-prepared-badge {
    position: absolute;
    top: -5px;
    right: -3px;
    background: linear-gradient(135deg, #d4a017 0%, #b8860b 100%);
    color: #000;
    font-size: 0.52rem;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 3px;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
    z-index: 2;
}

.psd-tile-incant-btn {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    border-radius: 4px;
    background: rgba(212, 160, 23, 0.15);
    border: 1px solid rgba(212, 160, 23, 0.4);
    color: var(--gold-bright, #ffd700);
    cursor: pointer;
    transition: all 0.14s ease;
    z-index: 3;
    padding: 0;
    line-height: 1;
}
.psd-tile-incant-btn:hover {
    background: rgba(255, 215, 0, 0.4);
    color: #ffffff;
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
    transform: scale(1.15);
}

/* Icon Medallion */
.psd-tile-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(42, 28, 20, 0.95) 0%, rgba(14, 9, 7, 0.98) 100%);
    border: 1.5px solid var(--tile-sphere-border, #c8a050);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.6), inset 0 0 8px rgba(0, 0, 0, 0.5);
    transition: all 0.15s ease;
    position: relative;
}
.psd-spell-tile:hover .psd-tile-icon-wrap {
    transform: scale(1.06);
    border-color: var(--gold-bright, #ffd700);
    box-shadow: 0 0 12px var(--tile-sphere-glow, rgba(255, 200, 80, 0.5));
}
.psd-tile-icon-wrap iconify-icon,
.psd-tile-icon-wrap .game-icon {
    font-size: 20px;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Sphere Specific Palette Classes */
.sphere-fire {
    --tile-sphere-border: #f97316;
    --tile-sphere-glow: rgba(249, 115, 22, 0.6);
    color: #fb923c;
}
.sphere-frost {
    --tile-sphere-border: #38bdf8;
    --tile-sphere-glow: rgba(56, 189, 248, 0.6);
    color: #7dd3fc;
}
.sphere-lightning {
    --tile-sphere-border: #a855f7;
    --tile-sphere-glow: rgba(168, 85, 247, 0.6);
    color: #c084fc;
}
.sphere-earth {
    --tile-sphere-border: #d97706;
    --tile-sphere-glow: rgba(217, 119, 6, 0.6);
    color: #fbbf24;
}
.sphere-wind {
    --tile-sphere-border: #2dd4bf;
    --tile-sphere-glow: rgba(45, 212, 191, 0.6);
    color: #5eead4;
}
.sphere-mental {
    --tile-sphere-border: #ec4899;
    --tile-sphere-glow: rgba(236, 72, 153, 0.6);
    color: #f472b6;
}
.sphere-psychic {
    --tile-sphere-border: #8b5cf6;
    --tile-sphere-glow: rgba(139, 92, 246, 0.6);
    color: #a78bfa;
}
.sphere-spiritual {
    --tile-sphere-border: #eab308;
    --tile-sphere-glow: rgba(234, 179, 8, 0.6);
    color: #fde047;
}
.sphere-nature {
    --tile-sphere-border: #22c55e;
    --tile-sphere-glow: rgba(34, 197, 94, 0.6);
    color: #4ade80;
}
.sphere-holy {
    --tile-sphere-border: #facc15;
    --tile-sphere-glow: rgba(250, 204, 21, 0.65);
    color: #fef08a;
}
.sphere-necrotic {
    --tile-sphere-border: #a855f7;
    --tile-sphere-glow: rgba(168, 85, 247, 0.65);
    color: #d8b4fe;
}

/* Under-icon Spell Name */
.psd-tile-name {
    margin-top: 6px;
    font-family: var(--font-heading, Cinzel, serif);
    font-size: 0.69rem;
    line-height: 1.15;
    color: #f5eedc;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 1.95em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
.psd-spell-tile:hover .psd-tile-name {
    color: #fff;
}

/* Mana Cost / Free Badge */
.psd-tile-cost {
    margin-top: 3px;
    font-size: 0.58rem;
    font-family: var(--font-mono, monospace);
    color: var(--gold, #d4a017);
    font-weight: 600;
}
.psd-tile-cost.free {
    color: #4ade80;
    text-shadow: 0 0 6px rgba(74, 222, 128, 0.4);
}

/* Footer / Quick Tips */
.psd-footer-bar {
    padding: 6px 16px;
    background: rgba(12, 8, 5, 0.95);
    border-top: 1px solid rgba(200, 160, 80, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.psd-footer-tip {
    font-size: 0.64rem;
    color: #a89f91;
    font-style: italic;
}

/* Empty State */
.psd-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    font-size: 0.8rem;
    font-style: italic;
}

/* Topbar Expansion Indicator on Spell Prep Pill */
.spell-prep-pill {
    cursor: pointer !important;
    position: relative;
    transition: all 0.15s ease;
}
.spell-prep-pill:hover {
    border-color: var(--gold-bright, #ffd700);
    box-shadow: 0 0 10px rgba(212, 160, 23, 0.35);
}
.spell-prep-expand-chevron {
    font-size: 0.68rem;
    color: var(--gold);
    margin-left: 4px;
    opacity: 0.85;
}
.spell-prep-pill:hover .spell-prep-expand-chevron {
    color: var(--gold-bright);
    opacity: 1;
}

/* ============================================================== */
/* ACTIVE BOUNTIES & WRITS LEDGER                                 */
/* ============================================================== */
.bounty-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(200, 160, 80, 0.2);
    border-radius: 4px;
}
.bounty-title-row {
    display: flex;
    align-items: center;
    gap: 5px;
}
.bounty-title {
    font-size: 0.78rem;
    color: var(--gold-bright, #fef08a);
}
.bounty-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin: 2px 0 4px;
}
.bounty-progress-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 3px;
    height: 12px;
    overflow: hidden;
}
.bounty-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, #d97706, #f59e0b);
}
.bounty-count-text {
    position: relative;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    padding: 0 4px;
    z-index: 2;
}

/* ============================================================== */
/* TERMINAL CUSTOMIZATION & PRE-DESIGNED THEMES                   */
/* ============================================================== */
.terminal-theme-panel {
    max-width: 680px;
    width: 90%;
    background: var(--bg-panel, #111726);
    border: 1px solid var(--border-color, rgba(200, 160, 80, 0.3));
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.95);
}
.theme-section-title {
    font-family: var(--font-heading, serif);
    font-size: 0.85rem;
    color: var(--gold);
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}
.theme-preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
}
.theme-preset-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}
.theme-preset-card:hover {
    border-color: var(--gold);
    background: rgba(200, 160, 80, 0.08);
}
.theme-preset-card.active {
    border-color: var(--gold-bright);
    background: rgba(200, 160, 80, 0.15);
    box-shadow: 0 0 10px rgba(200, 160, 80, 0.2);
}
.theme-preview-box {
    width: 100%;
    height: 24px;
    border-radius: 4px;
    margin-bottom: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.theme-preview-default {
    background: linear-gradient(90deg, #0a0d14 0%, #111726 60%, #c8a050 100%);
}
.theme-preview-amber {
    background: linear-gradient(90deg, #120e06 0%, #1a140a 60%, #ffb833 100%);
}
.theme-preview-emerald {
    background: linear-gradient(90deg, #061208 0%, #0a1a0d 60%, #33ff66 100%);
}
.theme-preview-slate {
    background: linear-gradient(90deg, #080d1a 0%, #101930 60%, #6ea8fe 100%);
}
.theme-preview-parchment {
    background: linear-gradient(90deg, #161311 0%, #241e1b 60%, #c89658 100%);
}
.theme-name {
    font-size: 0.8rem;
    color: #fff;
}
.theme-desc {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.type-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}
.type-setting-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.type-setting-item label {
    font-size: 0.72rem;
    color: var(--gold);
    font-weight: 600;
}
.theme-select {
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(200, 160, 80, 0.3);
    border-radius: 4px;
    color: #fff;
    font-size: 0.78rem;
}

/* THEME MODIFIERS ON #terminal-screen & MAIN */
.theme-amber-crt #terminal-screen {
    background: #120e06 !important;
    color: #ffb833 !important;
}
.theme-amber-crt .log-entry {
    color: #ffb833 !important;
}
.theme-amber-crt .msg-tag {
    border-color: #ffb833 !important;
    color: #ffb833 !important;
}

.theme-emerald-crt #terminal-screen {
    background: #061208 !important;
    color: #33ff66 !important;
}
.theme-emerald-crt .log-entry {
    color: #33ff66 !important;
}
.theme-emerald-crt .msg-tag {
    border-color: #33ff66 !important;
    color: #33ff66 !important;
}

.theme-moonlit-slate #terminal-screen {
    background: #080d1a !important;
    color: #d8e4f5 !important;
}
.theme-moonlit-slate .log-entry {
    color: #d8e4f5 !important;
}

.theme-ancient-parchment #terminal-screen {
    background: #161311 !important;
    color: #d6c5a8 !important;
}
.theme-ancient-parchment .log-entry {
    color: #d6c5a8 !important;
}

/* DENSITY MODIFIERS */
.density-compact #terminal-logs .log-entry {
    padding: 1px 0 !important;
    line-height: 1.25 !important;
}
.density-relaxed #terminal-logs .log-entry {
    padding: 5px 0 !important;
    line-height: 1.65 !important;
}

/* ========================================================================= */
#artisan-workshop-modal,
#recipe-codex-modal {
    z-index: 10000;
}

.workshop-panel {
    max-width: 760px;
    width: 95%;
    background: linear-gradient(180deg, #181512 0%, #110f0d 100%);
    border: 1.5px solid var(--border-color);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.95), 0 0 25px rgba(138, 111, 76, 0.2);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.workshop-header {
    background: linear-gradient(180deg, #1f1b16 0%, #161411 100%);
    border-bottom: 2px solid var(--border-color);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.workshop-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
}

.workshop-header .modal-title,
#workshop-title {
    font-size: clamp(0.95rem, 1.4vw, 1.15rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.04em;
    margin: 0;
    line-height: 1.2;
    color: var(--gold-bright);
    text-shadow: 0 0 12px rgba(138, 111, 76, 0.35);
}

.workshop-icon {
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-bright);
    flex-shrink: 0;
}

.workshop-archetype-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-family: var(--font-heading);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bronze-bright);
    background: rgba(196, 165, 122, 0.1);
    border: 1px solid rgba(196, 165, 122, 0.28);
    border-radius: 4px;
    padding: 2px 8px;
    margin-top: 2px;
}

.workshop-header-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.workshop-step-badge {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--gold-bright);
    background: #1c1813;
    border: 1px solid #3d352b;
    border-radius: 4px;
    padding: 4px 10px;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.2;
}

.btn-minimize-icon {
    background: transparent;
    border: 1px solid #3d352b;
    color: var(--parchment-dim);
    font-size: 0.95rem;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.btn-minimize-icon:hover {
    border-color: var(--bronze-bright);
    color: var(--bronze-bright);
    background: rgba(196, 165, 122, 0.12);
}

.btn-craft-minimize {
    background: linear-gradient(180deg, #2c251e 0%, #1a1612 100%);
    border: 1px solid #3d352b;
    color: var(--parchment-dim);
    border-radius: 4px;
    padding: 6px 14px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-craft-minimize:hover {
    background: linear-gradient(180deg, #3d3429 0%, #241e17 100%);
    border-color: var(--bronze-bright);
    color: var(--parchment);
}

.workshop-body {
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--bg-panel);
}

/* PROJECT CARD */
.workshop-project-card {
    background: #14110e;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--bronze);
    border-radius: 6px;
    padding: 12px 16px;
}

.wpc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.wpc-discipline {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--gold-bright);
    letter-spacing: 0.06em;
}

.wpc-project-name {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--parchment);
    margin: 2px 0 6px 0;
}

.wpc-status-msg {
    font-size: 0.82rem;
    color: var(--parchment-dim);
    line-height: 1.4;
    margin: 0;
}

/* COMPLICATION BANNER */
.workshop-complication-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(90deg, rgba(184, 74, 79, 0.18) 0%, rgba(74, 34, 36, 0.12) 100%);
    border: 1px solid #4a2224;
    border-radius: 6px;
    padding: 10px 14px;
    animation: comp-pulse 1.8s infinite ease-in-out;
}

@keyframes comp-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(184, 74, 79, 0.2); }
    50% { box-shadow: 0 0 18px rgba(184, 74, 79, 0.5); }
}

.wcb-icon {
    font-size: 1.5rem;
}

.wcb-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wcb-title {
    font-family: var(--font-heading);
    font-size: 0.82rem;
    color: #e8a0a4;
    letter-spacing: 0.04em;
}

.wcb-desc {
    font-size: 0.78rem;
    color: var(--parchment-dim);
}

/* 3 GAUGES GRID */
.workshop-gauges-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.workshop-gauge-card {
    background: #14110d;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gauge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gauge-label {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.gauge-value {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--parchment);
}

.gauge-track {
    position: relative;
    height: 12px;
    background: #0f0d0a;
    border: 1px solid #2a2219;
    border-radius: 6px;
    overflow: hidden;
}

.gauge-fill {
    height: 100%;
    transition: width 0.35s ease;
    border-radius: 5px;
}

.gauge-fill-progress {
    background: linear-gradient(90deg, #8a6f4c 0%, #c4a57a 100%);
    box-shadow: 0 0 10px rgba(196, 165, 122, 0.4);
}

.gauge-fill-quality {
    background: linear-gradient(90deg, #6b4c8a 0%, #b8860b 80%, #ffd700 100%);
    box-shadow: 0 0 10px rgba(184, 134, 11, 0.4);
}

.gauge-fill-stability {
    background: linear-gradient(90deg, #2d5a3f 0%, #4a8c5f 100%);
    box-shadow: 0 0 10px rgba(74, 140, 95, 0.4);
}

/* QUALITY MILESTONE TICKS */
.quality-track {
    position: relative;
    overflow: visible;
}

.gauge-milestone {
    position: absolute;
    top: -16px;
    font-size: 0.62rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    transform: translateX(-50%);
    pointer-events: none;
}

.milestone-fine { left: 40%; color: #6b8ea9; }
.milestone-flawless { left: 70%; color: #9e7bb8; }
.milestone-masterwork { left: 90%; color: var(--gold-bright); font-weight: 700; }

.gauge-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    color: var(--text-dark);
}

.quality-tier-badge {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 700;
}
.quality-tier-badge.standard { color: var(--text-muted); }
.quality-tier-badge.fine { color: #a9c4df; }
.quality-tier-badge.flawless { color: #d8c0eb; }
.quality-tier-badge.masterwork { color: var(--gold-bright); text-shadow: 0 0 6px rgba(196, 165, 122, 0.5); }

.stability-status-badge {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
}
.stability-status-badge.stable { color: #7cb88f; }
.stability-status-badge.fluctuating { color: #c49a62; }
.stability-status-badge.critical { color: #c2575b; animation: comp-pulse 1.2s infinite ease-in-out; }
.stability-status-badge.failing { color: #e8a0a4; }

/* TACTICAL ACTIONS ROW */
.workshop-actions-section {
    background: #13100d;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.actions-header {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.08em;
}

.workshop-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.btn-craft-action {
    background: linear-gradient(180deg, #241e18 0%, #181410 100%);
    border: 1px solid #3d3326;
    border-radius: 6px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    cursor: pointer;
    transition: all 0.18s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.btn-craft-action:hover:not(:disabled) {
    background: linear-gradient(180deg, #332a21 0%, #221c16 100%);
    border-color: var(--bronze-bright);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.7);
}

.btn-craft-action:active:not(:disabled) {
    transform: translateY(0);
}

.btn-craft-action.disabled, .btn-craft-action:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: var(--border-color);
}

.ca-key {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    background: #110f0d;
    border: 1px solid #2f271e;
    border-radius: 3px;
    padding: 1px 5px;
}

.ca-icon {
    font-size: 1.25rem;
    color: var(--gold-bright);
    margin: 2px 0;
}

.ca-title {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--parchment);
    letter-spacing: 0.04em;
    display: block;
}

.ca-desc {
    font-size: 0.68rem;
    color: var(--parchment-dim);
    line-height: 1.3;
}

.btn-craft-action.action-progress .ca-icon { color: var(--bronze-bright); }
.btn-craft-action.action-quality .ca-icon { color: #d8c0eb; }
.btn-craft-action.action-stabilize .ca-icon { color: #7cb88f; }
.btn-craft-action.action-finish .ca-icon { color: var(--gold-bright); }

.btn-craft-action.ready-pulse {
    border-color: var(--gold-bright);
    box-shadow: 0 0 14px rgba(196, 165, 122, 0.6);
    animation: comp-pulse 1.4s infinite ease-in-out;
}

.workshop-footer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.btn-craft-cancel {
    background: rgba(184, 74, 79, 0.08);
    border: 1px solid #4a2224;
    color: #e8a0a4;
    border-radius: 4px;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-craft-cancel:hover {
    background: rgba(184, 74, 79, 0.18);
    border-color: #c2575b;
    color: #fca5a5;
}

.workshop-hotkey-hint {
    font-size: 0.72rem;
    color: var(--text-dark);
    font-family: var(--font-mono);
}

/* ========================================================================= */
/* MASTER RECIPE CODEX MODAL (WoW 2-COLUMN PROFESSIONAL TRADESKILL WINDOW)   */
/* ========================================================================= */
.recipe-wow-window-wrapper {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    max-width: 1040px;
    width: 95vw;
    height: 84vh;
    max-height: 820px;
    position: relative;
}

.recipe-wow-frame {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #181512 0%, #110f0d 100%);
    border: 1.5px solid var(--border-color);
    border-radius: 8px 0 0 8px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.95), 0 0 35px rgba(138, 111, 76, 0.22);
    overflow: hidden;
    position: relative;
}

/* Right-Side Vertical Trade Navigation Tabs (WoW Style) */
.recipe-side-tabs {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 4px 14px 2px;
    background: rgba(18, 15, 12, 0.95);
    border: 1.5px solid var(--border-color);
    border-left: none;
    border-radius: 0 8px 8px 0;
    margin-top: 14px;
    align-self: flex-start;
    box-shadow: 4px 8px 20px rgba(0, 0, 0, 0.7);
}

.side-tab {
    position: relative;
    width: 44px;
    height: 44px;
    background: #15120f;
    border: 1px solid #3d352b;
    border-radius: 0 6px 6px 0;
    color: #8a7a68;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 1.35rem;
}

.side-tab:hover {
    background: #251e17;
    border-color: var(--bronze-bright);
    color: var(--gold-bright);
    transform: translateX(2px);
}

.side-tab.active {
    background: linear-gradient(90deg, #2d2318 0%, #433320 100%);
    border-color: var(--gold-bright);
    color: var(--gold-bright);
    box-shadow: 0 0 12px rgba(196, 165, 122, 0.4);
}

.side-tab-tooltip {
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: #1c1813;
    border: 1px solid var(--bronze-bright);
    color: var(--parchment);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: var(--font-heading);
    font-size: 0.72rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
    z-index: 100;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.85);
}

.side-tab:hover .side-tab-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Header with Crest Medallion and Trade Rank Bar */
.recipe-wow-header {
    background: linear-gradient(180deg, #211c16 0%, #161410 100%);
    border-bottom: 2px solid var(--border-color);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.rwh-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.rwh-icon-crest {
    width: 48px;
    height: 48px;
    background: radial-gradient(circle, #332719 0%, #16120e 100%);
    border: 2px solid var(--gold-bright);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 12px rgba(196, 165, 122, 0.35);
    font-size: 1.7rem;
    flex-shrink: 0;
}

.rwh-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rwh-title-group h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--gold-bright);
    margin: 0;
    line-height: 1.1;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.rwh-rank-bar-wrap {
    width: 280px;
    height: 16px;
    background: #0d0b09;
    border: 1px solid #3d352b;
    border-radius: 3px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
}

.rwh-rank-bar-track {
    width: 100%;
    height: 100%;
    position: relative;
}

.rwh-rank-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #7c5c36 0%, #c4a57a 100%);
    transition: width 0.3s ease;
}

.rwh-rank-bar-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-family: var(--font-mono);
    color: #f7eedf;
    text-shadow: 0 1px 3px #000000, 0 0 2px #000000;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Sub-Bar: Search & Filters */
.recipe-wow-subbar {
    padding: 8px 16px;
    background: #13110e;
    border-bottom: 1px solid #282118;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.recipe-wow-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 320px;
    background: #0d0b09;
    border: 1px solid #332a20;
    border-radius: 4px;
    padding: 4px 10px;
}

.rw-search-icon {
    font-size: 0.8rem;
    opacity: 0.7;
}

.recipe-wow-search input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--parchment);
    font-size: 0.82rem;
    font-family: var(--font-body);
    width: 100%;
}

.recipe-wow-filters {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.rw-filter-select {
    background: #1a1612;
    border: 1px solid #3d352b;
    color: var(--parchment);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.76rem;
    font-family: var(--font-heading);
    cursor: pointer;
    outline: none;
}

.rw-filter-select:focus {
    border-color: var(--bronze-bright);
}

.rw-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    color: var(--parchment-dim);
    cursor: pointer;
    user-select: none;
}

.rw-checkbox-label input[type="checkbox"] {
    accent-color: #8a6f4c;
    cursor: pointer;
}

/* 2-Column Split Workspace */
.recipe-wow-workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* Left Column: Recipe Tree / Accordion */
.recipe-tree-column {
    width: 340px;
    min-width: 290px;
    max-width: 380px;
    border-right: 1.5px solid var(--border-color);
    background: #110f0c;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.tree-category-group {
    border-bottom: 1px solid #1e1812;
}

.tree-category-header {
    padding: 8px 12px;
    background: #191511;
    border-bottom: 1px solid #241d15;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    color: var(--gold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    transition: background 0.12s ease;
}

.tree-category-header:hover {
    background: #241e17;
    color: var(--gold-bright);
}

.tch-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tch-chevron {
    font-size: 0.7rem;
    transition: transform 0.15s ease;
    display: inline-block;
    width: 12px;
}

.tch-count {
    font-size: 0.7rem;
    color: var(--text-dark);
    font-family: var(--font-mono);
}

.tree-recipe-list {
    display: flex;
    flex-direction: column;
}

.tree-recipe-list.collapsed {
    display: none;
}

.tree-recipe-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px 7px 20px;
    cursor: pointer;
    font-size: 0.8rem;
    border-left: 3px solid transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    transition: all 0.12s ease;
    color: var(--parchment-dim);
}

.tree-recipe-item:hover {
    background: rgba(196, 165, 122, 0.08);
    color: var(--parchment);
}

.tree-recipe-item.active {
    background: rgba(196, 165, 122, 0.18);
    border-left-color: var(--gold-bright);
    color: var(--gold-bright);
    font-weight: 600;
}

.tri-left {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tri-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tri-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.tri-indicators {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.skillup-orange {
    color: #f97316;
    font-weight: 800;
    font-size: 0.72rem;
    letter-spacing: -1px;
}

.skillup-yellow {
    color: #eab308;
    font-weight: 800;
    font-size: 0.72rem;
}

.skillup-green {
    color: #22c55e;
    font-weight: 800;
    font-size: 0.72rem;
}

.skillup-gray {
    color: #64748b;
    font-size: 0.72rem;
}

/* Right Column: Selected Blueprint Dossier */
.recipe-dossier-column {
    flex: 1;
    background: #14110e;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dossier-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    border-bottom: 1.5px solid #2d2419;
    padding-bottom: 14px;
}

.dossier-icon-box {
    width: 58px;
    height: 58px;
    background: radial-gradient(circle, #2a2016 0%, #110e0a 100%);
    border: 2px solid var(--bronze-bright);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
    flex-shrink: 0;
}

.dossier-title-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dtb-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dossier-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--parchment);
    margin: 0;
    letter-spacing: 0.4px;
}

.dossier-favorite-btn {
    background: transparent;
    border: none;
    color: #55483a;
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.15s ease;
}

.dossier-favorite-btn:hover,
.dossier-favorite-btn.active {
    color: var(--gold-bright);
}

.dtb-sub {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.72rem;
    flex-wrap: wrap;
}

.dossier-discipline {
    color: var(--bronze-bright);
    text-transform: uppercase;
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
}

.dossier-diff-badge {
    background: #110f0d;
    border: 1px solid #3d352b;
    padding: 1px 6px;
    border-radius: 3px;
    font-family: var(--font-mono);
    color: var(--gold-bright);
}

.recipe-discovery-badge {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.recipe-discovery-badge.discovery-rank {
    background: rgba(74, 140, 95, 0.15);
    border: 1px solid rgba(74, 140, 95, 0.4);
    color: #7cb88f;
}

.recipe-discovery-badge.discovery-trainer {
    background: rgba(107, 142, 169, 0.15);
    border: 1px solid rgba(107, 142, 169, 0.4);
    color: #a9c4df;
}

.recipe-discovery-badge.discovery-drop {
    background: rgba(158, 123, 184, 0.15);
    border: 1px solid rgba(158, 123, 184, 0.4);
    color: #d8c0eb;
}

.recipe-discovery-badge.discovery-research {
    background: rgba(196, 154, 98, 0.15);
    border: 1px solid rgba(196, 154, 98, 0.4);
    color: #e4caa4;
}

.recipe-discovery-badge.discovery-quest {
    background: rgba(184, 74, 79, 0.15);
    border: 1px solid rgba(184, 74, 79, 0.4);
    color: #e8a0a4;
}

.recipe-discovery-badge.discovery-faction {
    background: rgba(196, 165, 122, 0.15);
    border: 1px solid rgba(196, 165, 122, 0.4);
    color: var(--bronze-bright);
}

.dossier-tools-bar {
    background: rgba(107, 142, 169, 0.08);
    border: 1px solid rgba(107, 142, 169, 0.25);
    border-radius: 4px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.76rem;
    color: #a9c4df;
}

.dtb-tools-list {
    color: var(--parchment);
    font-weight: 600;
}

.dossier-desc-box {
    font-size: 0.8rem;
    color: var(--parchment-dim);
    line-height: 1.45;
    background: #110f0d;
    border: 1px solid #231c15;
    border-radius: 4px;
    padding: 10px 14px;
}

.dossier-reagents-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dossier-section-title {
    font-family: var(--font-heading);
    font-size: 0.82rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.reagents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 8px;
}

.reagent-tile {
    background: #100e0b;
    border: 1px solid #2a221a;
    border-radius: 4px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.reagent-tile.has-enough {
    border-color: rgba(74, 140, 95, 0.4);
}

.reagent-tile.missing {
    border-color: rgba(184, 74, 79, 0.4);
}

.rt-left {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.rt-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.rt-name {
    font-size: 0.78rem;
    color: var(--parchment);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rt-stock {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    flex-shrink: 0;
}

.rt-stock.stock-ok {
    background: rgba(74, 140, 95, 0.2);
    color: #7cb88f;
    border: 1px solid rgba(74, 140, 95, 0.5);
}

.rt-stock.stock-missing {
    background: rgba(184, 74, 79, 0.2);
    color: #e8a0a4;
    border: 1px solid rgba(184, 74, 79, 0.5);
}

.dossier-yield-box {
    background: #100e0b;
    border: 1px solid #241c15;
    border-radius: 4px;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
}

.dy-item {
    color: var(--gold-bright);
    font-weight: 600;
}

.dy-value {
    color: var(--parchment-dim);
    font-family: var(--font-mono);
}

.recipe-salvage-tip {
    font-size: 0.68rem;
    color: #a9c4df;
    background: rgba(107, 142, 169, 0.08);
    border-left: 2px solid #6b8ea9;
    padding: 6px 10px;
    border-radius: 0 4px 4px 0;
    line-height: 1.35;
}

.dossier-footer {
    margin-top: auto;
    border-top: 1.5px solid #2d2419;
    padding-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.df-stepper {
    display: flex;
    align-items: center;
    background: #110f0d;
    border: 1px solid #3d352b;
    border-radius: 4px;
    overflow: hidden;
}

.df-stepper button {
    background: #1a1612;
    border: none;
    color: var(--parchment);
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.df-stepper button:hover {
    background: #2d251d;
    color: var(--gold-bright);
}

.df-stepper input {
    width: 36px;
    background: transparent;
    border: none;
    color: var(--parchment);
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    outline: none;
}

.df-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: flex-end;
}

.btn-dossier-craft {
    background: linear-gradient(180deg, #c4a57a 0%, #8a6f4c 100%);
    border: 1px solid #d4b58a;
    color: #0f0d0a;
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    letter-spacing: 0.4px;
}

.btn-dossier-craft:hover {
    background: linear-gradient(180deg, #d4b58a 0%, #9a7d58 100%);
    box-shadow: 0 0 12px rgba(196, 165, 122, 0.45);
}

.btn-dossier-quick {
    background: linear-gradient(180deg, #28211a 0%, #1a1511 100%);
    border: 1px solid #3d3224;
    color: var(--parchment-dim);
    font-family: var(--font-heading);
    font-size: 0.78rem;
    padding: 8px 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-dossier-quick:hover {
    background: linear-gradient(180deg, #382e24 0%, #241d17 100%);
    color: var(--parchment);
    border-color: var(--bronze-bright);
}

.recipe-empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.recipe-empty-state .res-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 8px;
}

.recipe-empty-state h3 {
    color: var(--parchment-dim);
    font-family: var(--font-heading);
    margin-bottom: 4px;
}

/* ==========================================================================
   SANDWICH HUD LAYOUT BUTTONS
   ========================================================================== */
.sandwich-layout-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
}

.sandwich-layout-buttons .layout-toggle-btn {
    flex: 1;
    text-align: center;
    padding: 4px 6px;
    font-size: 0.72rem;
    background: #141217;
    border: 1px solid #3d252a;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.14s ease;
}

.sandwich-layout-buttons .layout-toggle-btn:hover {
    background: #2b181c;
    border-color: #7f1d1d;
    color: var(--gold-bright);
}

.sandwich-layout-buttons .layout-toggle-btn.active {
    background: #451216;
    border-color: #b91c1c;
    color: #ffffff;
    box-shadow: 0 0 6px rgba(185, 28, 28, 0.4);
}

/* ==========================================================================
   COIN PURSE, CURRENCY & BANK TREASURY LEDGER SLIDE-OUT FLYOUT
   ========================================================================== */
.currency-purse-slideout {
    position: fixed;
    top: 42px;
    right: 18px;
    width: 360px;
    max-width: calc(100vw - 24px);
    max-height: min(88vh, 640px);
    background: #11141e;
    border: 1px solid var(--border-gold, #534533);
    border-top: 2px solid var(--gold-bright, #ffd166);
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.92), 0 0 20px rgba(212, 163, 89, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 2600;
    overflow: hidden;
    animation: purseSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform-origin: top right;
    box-sizing: border-box;
}

.currency-purse-slideout.hidden {
    display: none !important;
}

@keyframes purseSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.currency-purse-panel,
.cpm-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.cpm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #151926;
    border-bottom: 1px solid var(--border-gold, #534533);
    flex-shrink: 0;
}

.cpm-header .close-btn {
    margin-left: auto;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    font-size: 0.9rem;
    line-height: 1;
}

.cpm-header-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cpm-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.cpm-title {
    font-size: 0.82rem;
    font-family: var(--font-heading);
    margin: 0;
    letter-spacing: 0.05em;
    color: var(--gold, #d4a359);
}

.cpm-subtitle {
    font-size: 0.66rem;
    color: var(--text-muted, #8d8495);
    letter-spacing: 0.02em;
}

.cpm-body {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: calc(88vh - 44px);
    overflow-y: auto;
}

.cpm-balances-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.cpm-balance-card {
    background: linear-gradient(180deg, #181c28 0%, #12141e 100%);
    border: 1px solid #2e3447;
    border-radius: 5px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cpm-balance-card.carried-card {
    border-color: #5a4931;
    background: linear-gradient(180deg, #221c17 0%, #151318 100%);
}

.cpm-card-label {
    font-size: 0.64rem;
    font-family: var(--font-heading);
    letter-spacing: 0.06em;
    color: var(--text-muted, #948c96);
    text-transform: uppercase;
}

.cpm-card-value {
    font-size: 1.15rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-main, #f0e6d2);
    line-height: 1.2;
}

.cpm-card-value.gold {
    color: var(--gold-bright, #ffd166);
    text-shadow: 0 0 8px rgba(255, 209, 102, 0.35);
}

.cpm-card-sub {
    font-size: 0.67rem;
    color: var(--text-muted, #8b8592);
}

.cpm-notes-list {
    margin-top: 4px;
    font-size: 0.72rem;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cpm-note-item {
    background: #1e191a;
    border: 1px dashed #7a5f36;
    padding: 3px 6px;
    border-radius: 4px;
    color: var(--amber, #f59e0b);
}

.cpm-location-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 0.72rem;
    line-height: 1.3;
}

.cpm-location-banner.in-bank {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
}

.cpm-location-banner.out-bank {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.28);
    color: #fcd34d;
}

.cpm-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cpm-section-title {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    color: var(--gold, #d4a359);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin: 0;
    border-bottom: 1px solid #2a2833;
    padding-bottom: 3px;
}

.cpm-ops-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cpm-op-box {
    background: #141620;
    border: 1px solid #282a38;
    border-radius: 5px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cpm-op-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px;
}

.cpm-op-header strong {
    font-size: 0.78rem;
    color: var(--text-main, #ede9f0);
}

.cpm-op-hint {
    font-size: 0.65rem;
    color: var(--text-muted, #7c7784);
}

.cpm-op-inputs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

.cpm-op-inputs .form-input-sm,
.cpm-op-inputs .form-select-sm {
    padding: 2px 6px;
    font-size: 0.75rem;
    height: 26px;
    background: #0d1017;
    border: 1px solid #2e3547;
    border-radius: 4px;
    color: var(--text-main);
}

.cpm-op-inputs .action-chip {
    padding: 2px 8px;
    font-size: 0.72rem;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#cpm-give-target-select {
    width: 100%;
    margin-bottom: 2px;
}

.cpm-bank-ops-section.locked {
    opacity: 0.55;
    position: relative;
    pointer-events: none;
}

.cpm-bank-ops-section.locked::after {
    content: "🔒 Bank transactions require visiting The Bank of the Horologe or a licensed teller.";
    display: block;
    margin-top: 4px;
    font-size: 0.7rem;
    color: var(--amber, #f59e0b);
    font-style: italic;
}

/* ============================================================================
   THE GILDED SCALE AUCTION HOUSE MODAL & COMPONENTS
   ============================================================================ */

.auction-modal-panel {
    background: #141210;
    border: 1px solid #3d3428;
    border-radius: 6px;
    width: 920px;
    max-width: 96vw;
    height: 700px;
    max-height: 94vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95);
    overflow: hidden;
    position: relative;
    color: #e0ded9;
    font-family: var(--font-body, 'Outfit', sans-serif);
}

.ah-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #1b1713;
    border-bottom: 1px solid #3a3226;
}

.ah-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ah-crest-icon {
    font-size: 24px;
    line-height: 1;
}

.ah-title {
    font-family: var(--font-heading, 'Cinzel', serif);
    font-size: 1.15rem;
    color: var(--gold-bright, #c4a57a);
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.ah-subtitle {
    font-size: 0.75rem;
    color: #8c857b;
    margin: 0;
}

.ah-close-btn {
    background: none;
    border: none;
    color: #8c857b;
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s ease;
}

.ah-close-btn:hover {
    color: #e0ded9;
}

/* Tab Panes */
.ah-tab-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* Browse Toolbar */
.ah-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #181512;
    border-bottom: 1px solid #2e281f;
}

.ah-filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ah-label {
    font-size: 0.78rem;
    color: #a39c90;
    font-weight: 600;
}

.ah-input, .ah-select {
    background: #0f0d0b;
    border: 1px solid #3d352b;
    border-radius: 4px;
    color: #fff;
    padding: 4px 8px;
    font-size: 0.8rem;
}

.ah-input:focus, .ah-select:focus {
    border-color: var(--gold-bright, #c4a57a);
    outline: none;
}

.ah-input.text-input {
    width: 140px;
}

.ah-input.num-input {
    width: 55px;
}

.ah-dash {
    color: #665f54;
    font-size: 0.8rem;
}

.ah-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: #c4beaf;
    cursor: pointer;
}

.ah-toolbar-actions {
    margin-left: auto;
    display: flex;
    gap: 6px;
}

.ah-btn {
    padding: 4px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}

.ah-btn.primary {
    background: #503d27;
    border-color: #8a6f4c;
    color: #f5eedb;
}

.ah-btn.primary:hover {
    background: #685034;
    border-color: #c4a57a;
    color: #fff;
}

.ah-btn.secondary {
    background: #201c18;
    border-color: #3d352b;
    color: #b0aa9e;
}

.ah-btn.secondary:hover {
    background: #2a2520;
    color: #fff;
}

/* Browse Content: Categories + Table */
.ah-browse-content {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0;
}

.ah-category-sidebar {
    width: 190px;
    background: #110f0d;
    border-right: 1px solid #2e281f;
    overflow-y: auto;
    padding: 8px 0;
    flex-shrink: 0;
}

.ah-category-tree {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ah-cat-item {
    padding: 6px 14px;
    font-size: 0.8rem;
    color: #a39c90;
    cursor: pointer;
    transition: all 0.12s ease;
}

.ah-cat-item:hover {
    background: #1a1713;
    color: #f0ebe1;
}

.ah-cat-item.active {
    background: #28211a;
    color: var(--gold-bright, #c4a57a);
    font-weight: 700;
    border-left: 3px solid var(--gold-bright, #c4a57a);
}

.ah-subcat-tree {
    list-style: none;
    margin: 4px 0 0 0;
    padding-left: 12px;
}

.ah-subcat-tree .ah-cat-item {
    padding: 4px 10px;
    font-size: 0.75rem;
}

/* Table Area */
.ah-table-wrap {
    flex: 1;
    overflow-y: auto;
    background: #0f0d0b;
}

.ah-table-wrap.full-width {
    width: 100%;
}

.ah-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    text-align: left;
}

.ah-table thead th {
    position: sticky;
    top: 0;
    background: #1c1814;
    color: #9c9486;
    padding: 7px 10px;
    border-bottom: 1px solid #3d352b;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    user-select: none;
    z-index: 2;
}

.ah-sortable-header {
    cursor: pointer;
}

.ah-sortable-header:hover {
    color: var(--gold-bright, #c4a57a);
}

.ah-table tbody tr.ah-row {
    border-bottom: 1px solid #1a1713;
    cursor: pointer;
    transition: background 0.12s ease;
}

.ah-table tbody tr.ah-row:hover {
    background: #1e1a15;
}

.ah-table tbody tr.ah-row.selected {
    background: #36291a !important;
    outline: 1px solid var(--gold, #8a6f4c);
}

.ah-table td {
    padding: 6px 10px;
    vertical-align: middle;
}

.ah-item-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ah-item-icon {
    width: 22px;
    height: 22px;
    background: #24201a;
    border: 1px solid #4a3e2e;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.ah-stack-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: #000;
    color: #fff;
    font-size: 9px;
    padding: 0 2px;
    border-radius: 2px;
    font-family: var(--font-mono, monospace);
    line-height: 1;
}

/* Quality Colors */
.quality-poor { color: #9d9d9d !important; }
.quality-common { color: #e6e6e6 !important; }
.quality-uncommon { color: #1eff00 !important; }
.quality-rare { color: #0070dd !important; }
.quality-epic { color: #a335ee !important; }
.quality-legendary { color: #ff8000 !important; }

/* Price Columns & Coin Blocks */
.ah-price-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ah-price-line {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
}

.ah-price-lbl {
    font-size: 0.7rem;
    color: #7a7367;
    width: 44px;
}

.ah-price-line.buyout .ah-price-lbl {
    color: #d1b474;
}

.coin-block {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono, monospace);
    font-weight: 600;
}

.coin-icon {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.coin-icon.silver-coin {
    background: radial-gradient(circle, #f0f0f0 25%, #a6a6a6 70%, #6b6b6b 100%);
    box-shadow: 0 0 3px rgba(220, 220, 220, 0.6);
    border: 1px solid #4a4a4a;
}

.coin-label {
    font-size: 0.75rem;
    color: #a8a29e;
    font-weight: 500;
}

/* AH Floating Item Details Tooltip */
.ah-item-tooltip {
    position: fixed;
    z-index: 100050;
    pointer-events: none;
    width: 320px;
    max-width: 90vw;
    background: #14110e;
    border: 1px solid #4a3e2e;
    border-radius: 6px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.95), 0 0 15px rgba(74, 62, 46, 0.3);
    padding: 12px 14px;
    color: #e0ded9;
    font-family: var(--font-body, 'Outfit', sans-serif);
    transition: opacity 0.08s ease;
}

.ah-tt-title {
    font-family: var(--font-heading, 'Cinzel', serif);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.ah-tt-subtitle {
    font-size: 0.72rem;
    color: #a39c90;
    margin-bottom: 8px;
    border-bottom: 1px solid #2a231b;
    padding-bottom: 5px;
    display: flex;
    justify-content: space-between;
}

.ah-tt-bonuses {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
    font-size: 0.8rem;
}

.ah-tt-bonus-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ah-tt-as {
    color: #f59e0b;
    font-weight: 700;
}

.ah-tt-ds {
    color: #38bdf8;
    font-weight: 700;
}

.ah-tt-desc {
    font-size: 0.73rem;
    color: #bfb8ab;
    font-style: italic;
    line-height: 1.35;
    background: #0e0c0a;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #241e17;
    margin-bottom: 8px;
}

.ah-tt-market-box {
    border-top: 1px solid #2a231b;
    padding-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.73rem;
    color: #8c857b;
}

.ah-tt-market-row {
    display: flex;
    justify-content: space-between;
}

/* Footer Control Bar */
.ah-footer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: #181512;
    border-top: 1px solid #2e281f;
}

.ah-purse-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ah-purse-label {
    font-size: 0.78rem;
    color: #8c857b;
}

.ah-player-purse {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ah-actions-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ah-bid-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ah-sublabel {
    font-size: 0.75rem;
    color: #8c857b;
}

.ah-action-btn {
    padding: 5px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}

.ah-action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ah-action-btn.primary {
    background: #503d27;
    border-color: #8a6f4c;
    color: #f5eedb;
}

.ah-action-btn.primary:not(:disabled):hover {
    background: #685034;
    border-color: #c4a57a;
    color: #fff;
}

.ah-action-btn.gold-btn {
    background: #80601f;
    border-color: #d1b474;
    color: #fff;
}

.ah-action-btn.gold-btn:not(:disabled):hover {
    background: #997324;
    box-shadow: 0 0 8px rgba(209, 180, 116, 0.5);
}

.ah-action-btn.secondary {
    background: #201c18;
    border-color: #3d352b;
    color: #b0aa9e;
}

/* 3 Bottom Tabs (Classic WoW Style) */
.ah-bottom-tabs {
    display: flex;
    background: #110f0d;
    border-top: 1px solid #3d352b;
    padding-left: 12px;
}

.ah-bottom-tab {
    padding: 8px 18px;
    background: #1b1713;
    border: 1px solid #3a3226;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    color: #9c9486;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    margin-right: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.ah-bottom-tab:hover {
    color: #f0ebe1;
    background: #241f19;
}

.ah-bottom-tab.active {
    background: #2a2219;
    color: var(--gold-bright, #c4a57a);
    border-color: var(--gold, #8a6f4c);
    border-top: 2px solid var(--gold-bright, #c4a57a);
}

/* Bids Status Badges */
.ah-bid-status.high {
    color: #1eff00;
    font-weight: 700;
}

.ah-bid-status.outbid {
    color: #ff4d4d;
    font-weight: 700;
}

/* Auctions / Selling Split View */
.ah-auctions-split {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0;
}

.ah-sell-creator {
    width: 340px;
    background: #141210;
    border-right: 1px solid #2e281f;
    padding: 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ah-pane-title {
    font-family: var(--font-heading, 'Cinzel', serif);
    font-size: 0.95rem;
    color: var(--gold-bright, #c4a57a);
    margin: 0 0 6px 0;
}

.ah-form-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ah-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.ah-hint {
    font-size: 0.68rem;
    color: #7a7367;
}

.ah-duration-radios {
    display: flex;
    gap: 12px;
    font-size: 0.78rem;
    color: #c4beaf;
}

.ah-deposit-box {
    background: #0f0d0b;
    border: 1px solid #2e281f;
    border-radius: 4px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.75rem;
}

.ah-deposit-line {
    display: flex;
    justify-content: space-between;
}

.ah-deposit-line.subtle {
    color: #7a7367;
}

/* Auctioneer / TSM Appraisal Widget */
.ah-appraise-card {
    background: #1a1713;
    border: 1px solid #4a3e2e;
    border-radius: 4px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ah-appraise-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gold-bright, #c4a57a);
}

.ah-appraise-stats {
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 3px;
    color: #a39c90;
}

.ah-appraise-actions {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.ah-sell-active {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 14px;
    overflow-y: auto;
}

/* Buyout Confirmation Modal (WoW Style Warning Emblem) */
.ah-confirm-panel {
    background: #1c1814;
    border: 2px solid #5a4730;
    border-radius: 6px;
    width: 320px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.95);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: auto;
}

.ah-confirm-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ah-warning-triangle {
    font-size: 32px;
    line-height: 1;
}

.ah-confirm-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.9rem;
    color: #e0ded9;
}

.ah-confirm-amount {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1rem;
    font-weight: 700;
}

.ah-confirm-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.ah-btn.danger-accept {
    background: #7a2214;
    border-color: #a8321d;
    color: #fff;
    font-weight: 700;
}

.ah-btn.danger-accept:hover {
    background: #992b1a;
    box-shadow: 0 0 8px rgba(168, 50, 29, 0.6);
}

.ah-empty-notice {
    text-align: center;
    padding: 30px !important;
    color: #6e675b;
    font-style: italic;
}



/* ============================================================================
   SESSION LOG REPLAY & PERSISTENCE (CHATTYNATOR QOL)
   ============================================================================ */

.session-replay-separator {
    text-align: center;
    margin: 12px 0 8px 0;
    padding: 6px 12px;
    border-top: 1px dashed rgba(212, 175, 55, 0.25);
    border-bottom: 1px dashed rgba(212, 175, 55, 0.25);
    background: rgba(10, 13, 20, 0.65);
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    user-select: none;
}

.session-replay-line {
    color: var(--gold, #d4af37);
    opacity: 0.85;
    font-weight: 600;
}

.restored-session-entry {
    opacity: 0.82;
    transition: opacity 0.2s ease;
}

.restored-session-entry:hover {
    opacity: 1;
}
