/* =============================================================================
   KORDU - Shared Components (~10KB)
   Full JL ComponentCSS + FrameCSS
   Cached after first menu - reused by all subsequent menus
============================================================================= */

/* === Buttons === */
.jl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    contain: layout style
}

.jl-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-hover)
}

.jl-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed
}

.jl-btn:disabled:hover {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-color: var(--border)
}

.jl-btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: white
}

.jl-btn.primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover)
}

.jl-btn.success {
    background: var(--success);
    border-color: var(--success);
    color: white
}

.jl-btn.success:hover {
    background: #2dd468;
    border-color: #2dd468
}

.jl-btn.error {
    background: var(--error);
    border-color: var(--error);
    color: white
}

.jl-btn.error:hover {
    background: #f55a5a;
    border-color: #f55a5a
}

.jl-btn.warning {
    background: var(--warning);
    border-color: var(--warning);
    color: #000
}

.jl-btn.warning:hover {
    background: #f5c211;
    border-color: #f5c211
}

.jl-btn.ghost {
    background: transparent;
    border-color: transparent
}

.jl-btn.ghost:hover {
    background: var(--bg-hover);
    border-color: var(--border)
}

.jl-btn.sm {
    padding: 6px 10px;
    font-size: 10px
}

.jl-btn.lg {
    padding: 12px 18px;
    font-size: 12px
}

/* === Close Button === */
.jl-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
    flex-shrink: 0;
    margin-left: 8px;
    contain: layout style
}

.jl-close:hover {
    background: rgba(232, 93, 117, 0.1);
    border-color: rgba(232, 93, 117, 0.2);
    color: #e85d75
}

/* === Cards === */
.jl-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    transition: background-color 0.2s, border-color 0.2s;
    contain: layout style
}

.jl-card.hoverable {
    cursor: pointer;
    transform: translateZ(0);
    will-change: transform
}

.jl-card.hoverable:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    transform: translateY(-1px) translateZ(0)
}

/* === Inputs === */
.jl-input {
    width: 100%;
    padding: 7px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 11px;
    color: var(--text-primary);
    transition: background-color 0.15s, border-color 0.15s;
    contain: layout style
}

.jl-input:focus {
    border-color: var(--accent);
    background: var(--bg-secondary)
}

.jl-input::placeholder {
    color: var(--text-muted)
}

/* === Badges === */
.jl-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-tertiary);
    color: var(--text-secondary)
}

.jl-badge.accent {
    background: var(--accent-glow);
    color: var(--accent)
}

.jl-badge.success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success)
}

.jl-badge.error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error)
}

.jl-badge.warning {
    background: rgba(234, 179, 8, 0.15);
    color: var(--warning)
}

/* === Panels === */
.jl-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden
}

.jl-divider {
    height: 1px;
    background: var(--border);
    margin: 10px 0
}

/* === Text Utilities === */
.text-primary {
    color: var(--text-primary)
}

.text-secondary {
    color: var(--text-secondary)
}

.text-muted {
    color: var(--text-muted)
}

.text-accent {
    color: var(--accent)
}

.text-success {
    color: var(--success)
}

.text-error {
    color: var(--error)
}

.text-warning {
    color: var(--warning)
}

/* === Spacing Utilities === */
.mt-1 {
    margin-top: 4px
}

.mt-2 {
    margin-top: 8px
}

.mt-3 {
    margin-top: 12px
}

.mt-4 {
    margin-top: 16px
}

.mb-1 {
    margin-bottom: 4px
}

.mb-2 {
    margin-bottom: 8px
}

.mb-3 {
    margin-bottom: 12px
}

.mb-4 {
    margin-bottom: 16px
}

.p-1 {
    padding: 4px
}

.p-2 {
    padding: 8px
}

.p-3 {
    padding: 12px
}

.p-4 {
    padding: 16px
}

/* === Flex Utilities === */
.flex {
    display: flex
}

.flex-col {
    flex-direction: column
}

.items-center {
    align-items: center
}

.justify-center {
    justify-content: center
}

.justify-between {
    justify-content: space-between
}

.gap-1 {
    gap: 4px
}

.gap-2 {
    gap: 8px
}

.gap-3 {
    gap: 12px
}

.gap-4 {
    gap: 16px
}

.flex-1 {
    flex: 1
}

/* === Grid Utilities === */
.grid {
    display: grid
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr)
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr)
}

.grid-auto {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr))
}

/* === Toast === */
.jl-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(16px) translateZ(0);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 1000;
    font-size: 11px;
    will-change: transform, opacity
}

.jl-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0) translateZ(0)
}

.jl-toast.success {
    border-color: rgba(34, 197, 94, 0.4)
}

.jl-toast.error {
    border-color: rgba(239, 68, 68, 0.4)
}

/* === Progress === */
.jl-progress {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden
}

.jl-progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s
}

.jl-progress-wrap {
    display: flex;
    align-items: center;
    gap: 8px
}

.jl-progress-pips {
    display: flex;
    gap: 2px
}

.jl-progress-pip {
    width: 12px;
    height: 3px;
    background: var(--bg-tertiary);
    border-radius: 1px;
    transition: background-color 0.15s
}

.jl-progress-pip.filled {
    background: var(--accent)
}

.jl-progress-track {
    flex: 1;
    max-width: 100px;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden
}

.jl-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s
}

.jl-progress-text {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted)
}

/* === Tabs === */
.jl-tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-tertiary);
    padding: 2px;
    border-radius: var(--radius-md);
    contain: layout style
}

.jl-tab {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
    contain: layout style
}

.jl-tab:hover {
    color: var(--text-primary)
}

.jl-tab.active {
    background: var(--bg-secondary);
    color: var(--text-primary)
}

/* === Select/Dropdown === */
.jl-select {
    position: relative;
    min-width: 120px;
    contain: layout style
}

.jl-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 12px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
    user-select: none;
    contain: layout style
}

.jl-select-trigger:hover {
    border-color: var(--border-hover);
    background: var(--bg-hover)
}

.jl-select.open .jl-select-trigger {
    border-color: var(--accent);
    background: var(--bg-secondary)
}

.jl-select-arrow {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--text-muted);
    transition: transform 0.2s
}

.jl-select.open .jl-select-arrow {
    transform: rotate(180deg)
}

.jl-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-md);
    padding: 4px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) translateZ(0);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    will-change: transform, opacity
}

.jl-select.open .jl-select-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) translateZ(0)
}

.jl-select-option {
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color 0.1s, color 0.1s;
    display: flex;
    align-items: center;
    gap: 8px;
    contain: layout style
}

.jl-select-option:hover {
    background: var(--bg-hover);
    color: var(--text-primary)
}

.jl-select-option.selected {
    background: var(--accent-glow);
    color: var(--accent)
}

.jl-select-option .opt-icon {
    font-size: 14px
}

.jl-select-option .opt-desc {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px
}

.jl-select-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: block
}

/* === Modal === */
.jl-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s
}

.jl-modal-overlay.open {
    opacity: 1;
    visibility: visible
}

.jl-modal {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    transform: scale(0.95) translateY(10px);
    transition: transform 0.2s
}

.jl-modal-overlay.open .jl-modal {
    transform: scale(1) translateY(0)
}

.jl-modal-header {
    padding: 14px 18px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0
}

.jl-modal-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px
}

.jl-modal-header-icon {
    width: 28px;
    height: 28px;
    background: var(--accent-glow);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent)
}

.jl-modal-body {
    padding: 18px;
    flex: 1;
    overflow-y: auto
}

.jl-modal-footer {
    padding: 14px 18px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg)
}

/* === Stat Row === */
.jl-stat {
    display: flex;
    flex-direction: column;
    gap: 2px
}

.jl-stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px
}

.jl-stat-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary)
}

.jl-stat-row {
    display: flex;
    gap: 16px
}

.jl-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px
}

.jl-stat-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border)
}

.jl-stat-inline:last-child {
    border-bottom: none
}

.jl-stat-inline .jl-stat-label {
    text-transform: none;
    font-size: 12px
}

.jl-stat-inline .jl-stat-value {
    font-size: 12px
}

.jl-stat-total {
    background: var(--bg-tertiary);
    margin: 8px -18px -18px;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center
}

.jl-stat-total .jl-stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary)
}

.jl-stat-total .jl-stat-value {
    font-size: 15px
}

/* === Empty State === */
.jl-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center
}

.jl-empty-icon {
    width: 56px;
    height: 56px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--text-muted)
}

.jl-empty-icon svg {
    width: 28px;
    height: 28px;
    stroke: currentColor;
    fill: none
}

.jl-empty-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px
}

.jl-empty-desc {
    font-size: 12px;
    color: var(--text-muted);
    max-width: 240px;
    line-height: 1.5
}

/* === Price Display === */
.jl-price {
    font-weight: 600
}

.jl-price.cash {
    color: var(--cash)
}

.jl-price.bits {
    color: var(--bits)
}

.jl-price.sm {
    font-size: 11px
}

.jl-price.lg {
    font-size: 15px
}

.jl-price-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600
}

.jl-price-tag.cash {
    background: rgba(102, 187, 106, 0.12);
    color: var(--cash)
}

.jl-price-tag.bits {
    background: rgba(171, 71, 188, 0.12);
    color: var(--bits)
}

/* === List Row === */
.jl-list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color 0.12s, border-color 0.12s;
    position: relative;
    overflow: hidden;
    contain: layout style
}

.jl-list-row:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    transform: translateX(2px)
}

.jl-list-row.selected {
    background: var(--bg-hover);
    border-color: var(--accent)
}

.jl-list-row.selected::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent)
}

.jl-list-row-icon {
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-muted)
}

.jl-list-row-content {
    flex: 1;
    min-width: 0
}

.jl-list-row-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.jl-list-row-sub {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px
}

.jl-list-row-end {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0
}

.jl-list-row-rarity {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px
}

.jl-list-row-rarity.basic {
    background: #9ca3af
}

.jl-list-row-rarity.advanced {
    background: #2dd4bf
}

.jl-list-row-rarity.superior {
    background: #60a5fa
}

.jl-list-row-rarity.arcane {
    background: #c084fc
}

.jl-list-row-rarity.apex {
    background: #f87171
}

.jl-list-row.has-rarity {
    padding-left: 15px
}

/* === Nav Item === */
.jl-nav {
    display: flex;
    flex-direction: column;
    gap: 2px
}

.jl-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color 0.12s, color 0.12s;
    color: var(--text-secondary);
    position: relative;
    contain: layout style
}

.jl-nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary)
}

.jl-nav-item.active {
    background: var(--bg-tertiary);
    color: var(--text-primary)
}

.jl-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: var(--accent);
    border-radius: 0 2px 2px 0
}

.jl-nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0
}

.jl-nav-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2
}

.jl-nav-label {
    flex: 1;
    font-size: 12px;
    font-weight: 500
}

.jl-nav-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--bg-hover);
    border-radius: 9px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center
}

.jl-nav-item.active .jl-nav-badge {
    background: var(--accent-glow);
    color: var(--accent)
}

/* === Search Input === */
.jl-search {
    --search-bg: var(--bg-tertiary);
    --search-border: var(--border);
    --search-focus-border: var(--accent);
    --search-focus-bg: var(--bg-elevated);
    --search-radius: var(--radius-md);
    --search-height: 36px;
    --search-font: 12px;
    --search-icon-size: 14px;
    position: relative;
    display: flex;
    align-items: center
}

.jl-search-icon {
    position: absolute;
    left: 12px;
    width: var(--search-icon-size);
    height: var(--search-icon-size);
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.15s
}

.jl-search-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
    stroke-width: 2
}

.jl-search input {
    width: 100%;
    height: var(--search-height);
    padding: 0 36px 0 38px;
    background: var(--search-bg);
    border: 1px solid var(--search-border);
    border-radius: var(--search-radius);
    font-family: inherit;
    font-size: var(--search-font);
    color: var(--text-primary);
    transition: background-color 0.15s, border-color 0.15s;
    contain: layout style
}

.jl-search input:focus {
    border-color: var(--search-focus-border);
    background: var(--search-focus-bg)
}

.jl-search input:focus+.jl-search-icon {
    color: var(--accent)
}

.jl-search input::placeholder {
    color: var(--text-muted)
}

.jl-search-clear {
    position: absolute;
    right: 10px;
    width: 18px;
    height: 18px;
    background: var(--bg-elevated);
    border: none;
    border-radius: var(--radius-sm);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 10px;
    transition: background-color 0.1s, color 0.1s
}

.jl-search-clear:hover {
    background: var(--error);
    color: white
}

.jl-search.has-value .jl-search-clear {
    display: flex
}

.jl-search.sm {
    --search-height: 28px;
    --search-font: 11px;
    --search-icon-size: 12px
}

.jl-search.lg {
    --search-height: 42px;
    --search-font: 13px;
    --search-icon-size: 16px
}

.jl-search.ghost {
    --search-bg: transparent;
    --search-border: transparent;
    --search-focus-bg: var(--bg-tertiary);
    --search-focus-border: var(--border)
}

/* === Rarity System === */
.jl-rarity {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px
}

.jl-rarity.basic {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af
}

.jl-rarity.advanced {
    background: rgba(45, 212, 191, 0.15);
    color: #2dd4bf
}

.jl-rarity.superior {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa
}

.jl-rarity.arcane {
    background: rgba(192, 132, 252, 0.15);
    color: #c084fc
}

.jl-rarity.apex {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171
}

.jl-rarity-bar {
    width: 100%;
    height: 3px;
    border-radius: 2px
}

.jl-rarity-bar.basic {
    background: #9ca3af
}

.jl-rarity-bar.advanced {
    background: #2dd4bf
}

.jl-rarity-bar.superior {
    background: #60a5fa
}

.jl-rarity-bar.arcane {
    background: #c084fc
}

.jl-rarity-bar.apex {
    background: #f87171
}

/* === Form Elements === */
.jl-form-group {
    margin-bottom: 14px
}

.jl-form-group:last-child {
    margin-bottom: 0
}

.jl-form-label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px
}

.jl-form-hint {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px
}

.jl-form-hint svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0
}

/* === Chips === */
.jl-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap
}

.jl-chip {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    contain: layout style
}

.jl-chip:hover {
    border-color: var(--border-hover);
    color: var(--text-primary)
}

.jl-chip.active {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent)
}

.jl-chip .chip-count {
    font-size: 10px;
    opacity: 0.7
}

.jl-chip.sm {
    padding: 4px 8px;
    font-size: 10px
}

.jl-chip.pill {
    border-radius: 9999px
}

/* === Toggle Switch === */
.jl-toggle {
    width: 38px;
    height: 22px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 11px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
    contain: layout style;
    will-change: background-color, border-color
}

.jl-toggle:hover {
    border-color: var(--border-hover)
}

.jl-toggle.active {
    background: var(--accent-glow);
    border-color: var(--accent)
}

.jl-toggle::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--text-muted);
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.15s, background-color 0.15s;
    will-change: transform
}

.jl-toggle.active::after {
    transform: translateX(16px) translateZ(0);
    background: var(--accent)
}

.jl-toggle.sm {
    width: 32px;
    height: 18px;
    border-radius: 9px
}

.jl-toggle.sm::after {
    width: 12px;
    height: 12px;
    top: 2px;
    left: 2px
}

.jl-toggle.sm.active::after {
    transform: translateX(14px) translateZ(0)
}

/* === Tooltip === */
.jl-tooltip {
    position: absolute;
    z-index: 1000;
    padding: 6px 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-md);
    font-size: 11px;
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px) translateZ(0);
    transition: opacity 0.1s, transform 0.1s;
    white-space: nowrap;
    will-change: transform, opacity
}

.jl-tooltip.show {
    opacity: 1;
    transform: translateY(0) translateZ(0)
}

.jl-tooltip.top {
    transform: translateY(-4px) translateZ(0)
}

.jl-tooltip.show.top {
    transform: translateY(0) translateZ(0)
}

/* === Skeleton Loading === */
.jl-skeleton {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm)
}

.jl-skeleton.animate {
    animation: jl-shimmer 1.5s infinite
}

@keyframes jl-shimmer {

    0%,
    100% {
        opacity: 0.5
    }

    50% {
        opacity: 1
    }
}

.jl-skeleton-text {
    height: 12px;
    margin-bottom: 8px
}

.jl-skeleton-text:last-child {
    width: 60%;
    margin-bottom: 0
}

.jl-skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%
}

.jl-skeleton-card {
    height: 120px;
    border-radius: var(--radius-lg)
}

/* === Pagination === */
.jl-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 12px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border)
}

.jl-page-btn {
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 0 10px;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
    contain: layout style
}

.jl-page-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-hover)
}

.jl-page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white
}

.jl-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed
}

.jl-page-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2
}

.jl-page-info {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0 8px
}

/* === Context Menu === */
.jl-context-menu {
    position: fixed;
    z-index: 9999;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    padding: 4px;
    display: none;
    animation: jl-menu-fade 0.12s
}

@keyframes jl-menu-fade {
    from {
        opacity: 0;
        transform: scale(0.95)
    }

    to {
        opacity: 1;
        transform: scale(1)
    }
}

.jl-context-menu.show {
    display: block
}

.jl-context-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color 0.1s
}

.jl-context-item:hover {
    background: var(--bg-hover)
}

.jl-context-item.disabled {
    opacity: 0.4;
    cursor: not-allowed
}

.jl-context-item.danger {
    color: var(--error)
}

.jl-context-item.danger:hover {
    background: rgba(239, 68, 68, 0.1)
}

.jl-context-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0
}

.jl-context-label {
    padding: 6px 12px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px
}

/* === Icon Utility === */
.jl-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0
}

.jl-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
    stroke-width: 2
}

.jl-icon.filled svg {
    fill: currentColor;
    stroke: none
}

.jl-icon.xs {
    width: 12px;
    height: 12px
}

.jl-icon.sm {
    width: 16px;
    height: 16px
}

.jl-icon.md {
    width: 20px;
    height: 20px
}

.jl-icon.lg {
    width: 24px;
    height: 24px
}

.jl-icon.xl {
    width: 32px;
    height: 32px
}

/* =============================================================================
   FRAME COMPONENT (from cl_05_frame.lua)
============================================================================= */

/* === Frame Container === */
.jl-frame {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-base);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    position: relative;
    box-shadow: 0 32px 100px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.02) inset
}

/* === Drag/Resize States === */
body.jl-dragging,
body.jl-dragging * {
    cursor: move !important;
    user-select: none !important
}

body.jl-resizing,
body.jl-resizing * {
    cursor: se-resize !important;
    user-select: none !important
}

/* === Frame Header === */
.jl-frame-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0
}

.jl-frame-header.draggable {
    cursor: move
}

.jl-frame-brand {
    display: flex;
    align-items: center;
    gap: 12px
}

.jl-frame-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    flex-shrink: 0
}

.jl-frame-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2
}

.jl-frame-title {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary)
}

.jl-frame-title span {
    color: var(--accent);
    font-weight: 700
}

.jl-frame-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 4px
}

.jl-frame-search {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 320px;
    margin: 0 auto
}

.jl-frame-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto
}

.jl-frame-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end
}

.jl-frame-stat-value {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary)
}

.jl-frame-stat-value.cash {
    color: var(--cash)
}

.jl-frame-stat-value.bits {
    color: var(--bits)
}

.jl-frame-stat-value.level {
    color: var(--warning)
}

.jl-frame-stat-value.accent {
    color: var(--accent)
}

.jl-frame-stat-label {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500
}

.jl-frame-header>.jl-close {
    margin-left: auto
}

.jl-frame-stats+.jl-close {
    margin-left: 12px
}

/* === Frame Layout === */
.jl-frame-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative
}

/* === Frame Sidebar === */
.jl-frame-sidebar {
    width: 180px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex-shrink: 0;
    overflow-y: auto
}

.jl-frame-sidebar.collapsed {
    width: 52px;
    padding: 16px 6px
}

.jl-frame-sidebar.collapsed .jl-frame-nav-label {
    display: none
}

.jl-frame-sidebar.collapsed .jl-frame-nav-text {
    display: none
}

.jl-frame-sidebar.collapsed .jl-frame-nav-badge {
    display: none
}

.jl-frame-sidebar.collapsed .jl-frame-nav-btn {
    justify-content: center;
    padding: 10px
}

.jl-frame-sidebar-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border)
}

/* Sidebar Navigation */
.jl-frame-nav-group {
    display: flex;
    flex-direction: column;
    gap: 2px
}

.jl-frame-nav-label {
    padding: 0 10px 8px;
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em
}

.jl-frame-nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
    position: relative;
    background: transparent;
    border: none;
    text-align: left;
    width: 100%
}

.jl-frame-nav-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary)
}

.jl-frame-nav-btn.active {
    background: rgba(255, 61, 74, 0.08);
    color: var(--accent)
}

.jl-frame-nav-btn.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: var(--accent);
    border-radius: 0 2px 2px 0
}

.jl-frame-nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0
}

.jl-frame-nav-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2
}

.jl-frame-nav-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.jl-frame-nav-badge {
    margin-left: auto;
    padding: 2px 7px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0
}

.jl-frame-nav-btn.active .jl-frame-nav-badge {
    background: var(--accent-glow);
    color: var(--accent)
}

/* === Frame Content === */
.jl-frame-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-base)
}

.jl-frame-panel {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden
}

.jl-frame-panel.active {
    display: flex
}

.jl-frame-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0
}

.jl-frame-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px
}

.jl-frame-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px
}

/* === Resize Grip === */
.jl-resize-grip {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 24px;
    height: 24px;
    cursor: se-resize;
    opacity: 0.3;
    transition: opacity 0.15s;
    z-index: 100
}

.jl-resize-grip:hover {
    opacity: 0.6
}

.jl-resize-grip::before {
    content: '';
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted)
}

/* === Frame Footer === */
.jl-frame-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    flex-shrink: 0
}