/* ==========================================================================
   Darkstar Build Planner - Design System
   ========================================================================== */

/* --------------------------------------------------------------------------
   Custom Properties
   -------------------------------------------------------------------------- */
:root {
    /* Background colors */
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-tertiary: #1a2035;
    --bg-card: rgba(17, 24, 39, 0.8);
    --bg-card-hover: rgba(26, 32, 53, 0.9);
    --bg-overlay: rgba(10, 14, 26, 0.85);

    /* Text colors */
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --text-accent: #60a5fa;

    /* Border colors */
    --border-primary: rgba(75, 85, 99, 0.4);
    --border-hover: rgba(96, 165, 250, 0.5);
    --border-accent: #3b82f6;

    /* Accent colors */
    --accent-primary: #3b82f6;
    --accent-primary-hover: #2563eb;
    --accent-secondary: #6366f1;
    --accent-glow: rgba(59, 130, 246, 0.15);

    /* Rarity colors */
    --rarity-normal: #9ca3af;
    --rarity-uncommon: #4ade80;
    --rarity-rare: #60a5fa;
    --rarity-epic: #2dd4bf;
    --rarity-legendary: #fb923c;
    --rarity-mythic: #a855f7;
    --rarity-transcendent: #ef4444;

    /* Ship tier colors */
    --tier-a: #fb923c;
    --tier-s: #3b82f6;
    --tier-ss: #fbbf24;

    /* Typography */
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'Orbitron', monospace;

    /* Spacing */
    --header-height: 56px;
    --content-max-width: 1200px;
    --content-padding: 1.5rem;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;

    /* Shadows */
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.2);
}

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* --------------------------------------------------------------------------
   Base / Body
   -------------------------------------------------------------------------- */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--text-accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-primary-hover);
}

img {
    max-width: 100%;
    height: auto;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    background: rgba(10, 14, 26, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-primary);
}

.header-inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 var(--content-padding);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.logo:hover {
    color: var(--text-accent);
}

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

/* --------------------------------------------------------------------------
   Main Content
   -------------------------------------------------------------------------- */
.main-content {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 2rem var(--content-padding);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

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

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

.btn-sm {
    padding: 0.4rem 0.875rem;
    font-size: 0.8rem;
}

.btn-primary {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
}

.btn-primary:hover {
    background: var(--accent-primary-hover);
    border-color: var(--accent-primary-hover);
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-primary);
}

.btn-secondary:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: rgba(59, 130, 246, 0.05);
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    overflow: hidden;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-card);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-card-hover);
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-primary);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.card-body {
    padding: 1.25rem;
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.hero {
    text-align: center;
    padding: 4rem 1rem 3rem;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 50%, #f472b6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.75rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Action Cards (Landing Page)
   -------------------------------------------------------------------------- */
.action-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 640px;
    margin: 0 auto;
}

.action-card {
    text-align: center;
    cursor: pointer;
    color: var(--text-primary);
}

.action-card:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.action-card .card-body {
    padding: 2rem 1.5rem;
}

.action-icon {
    font-size: 2rem;
    color: var(--text-accent);
    margin-bottom: 1rem;
    line-height: 1;
}

.action-card h2 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.action-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Page Section
   -------------------------------------------------------------------------- */
.page-section {
    padding: 1rem 0;
}

.page-section h1 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.page-section p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* --------------------------------------------------------------------------
   Build Overview Grid
   -------------------------------------------------------------------------- */
.build-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

/* --------------------------------------------------------------------------
   Section Cards (Build View)
   -------------------------------------------------------------------------- */
.section-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    overflow: hidden;
    transition: all var(--transition-base);
}

.section-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
}

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

.section-card .card-body {
    padding: 1rem 1.25rem;
}

.section-card .stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    font-size: 0.85rem;
}

.section-card .stat-row + .stat-row {
    border-top: 1px solid rgba(75, 85, 99, 0.2);
}

.section-card .stat-label {
    color: var(--text-secondary);
}

.section-card .stat-value {
    color: var(--text-primary);
    font-weight: 600;
    font-family: var(--font-display);
    font-size: 0.8rem;
}

/* --------------------------------------------------------------------------
   Tier Badges
   -------------------------------------------------------------------------- */
.tier-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.5rem;
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 4px;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.tier-badge-a {
    background: rgba(251, 146, 60, 0.15);
    color: var(--tier-a);
    border: 1px solid rgba(251, 146, 60, 0.3);
}

.tier-badge-s {
    background: rgba(59, 130, 246, 0.15);
    color: var(--tier-s);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.tier-badge-ss {
    background: rgba(251, 191, 36, 0.15);
    color: var(--tier-ss);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

/* --------------------------------------------------------------------------
   Rarity Borders
   -------------------------------------------------------------------------- */
.rarity-normal {
    border-color: var(--rarity-normal);
}

.rarity-uncommon {
    border-color: var(--rarity-uncommon);
}

.rarity-rare {
    border-color: var(--rarity-rare);
}

.rarity-epic {
    border-color: var(--rarity-epic);
}

.rarity-legendary {
    border-color: var(--rarity-legendary);
}

.rarity-mythic {
    border-color: var(--rarity-mythic);
}

.rarity-transcendent {
    border-color: var(--rarity-transcendent);
}


/* --------------------------------------------------------------------------
   Sprite Images
   -------------------------------------------------------------------------- */
.sprite {
    display: inline-block;
    width: 48px;
    height: 48px;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
}

.sprite-sm {
    width: 32px;
    height: 32px;
}

.sprite-lg {
    width: 64px;
    height: 64px;
}

.sprite-xl {
    width: 96px;
    height: 96px;
}

/* --------------------------------------------------------------------------
   Import Page
   -------------------------------------------------------------------------- */
.dropzone,
.import-dropzone {
    border: 2px dashed var(--border-primary);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    background: var(--bg-secondary);
}

.dropzone:hover,
.dropzone.dragover,
.import-dropzone:hover,
.import-dropzone.dragover {
    border-color: var(--accent-primary);
    background: var(--accent-glow);
}

.dropzone-label,
.import-dropzone-text {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.dropzone-hint,
.import-dropzone-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.import-dropzone-icon {
    font-size: 2rem;
    color: var(--text-accent);
    margin-bottom: 1rem;
    line-height: 1;
}

.import-container {
    max-width: 560px;
    margin: 0 auto;
}

.string-input,
.import-string-input {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    resize: vertical;
    transition: border-color var(--transition-fast);
}

.string-input:focus,
.import-string-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.string-input::placeholder,
.import-string-input::placeholder {
    color: var(--text-muted);
}

.import-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.import-divider::before,
.import-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-primary);
}

/* --------------------------------------------------------------------------
   Build Header & Share UI
   -------------------------------------------------------------------------- */
.build-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.build-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
}

.build-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.build-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.share-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.share-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem 0;
}

.share-url {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.share-url input {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-family: var(--font-body);
    width: 100%;
    outline: none;
}

/* --------------------------------------------------------------------------
   Flash Messages
   -------------------------------------------------------------------------- */
.flash-container {
    margin-bottom: 1.5rem;
}

.flash {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
}

.flash-error {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}

.flash-success {
    background: rgba(74, 222, 128, 0.1);
    color: #86efac;
    border-color: rgba(74, 222, 128, 0.3);
}

.flash-info {
    background: rgba(96, 165, 250, 0.1);
    color: #93c5fd;
    border-color: rgba(96, 165, 250, 0.3);
}

/* --------------------------------------------------------------------------
   Section Detail Header
   -------------------------------------------------------------------------- */
.section-detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.section-detail-header .build-title {
    flex: 1;
    min-width: 0;
}

.section-detail-header .build-actions {
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Section Content
   -------------------------------------------------------------------------- */
.section-content {
    min-height: 200px;
}

.section-subtitle {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-primary);
}

.section-subtitle:first-child {
    margin-top: 0;
}

/* --------------------------------------------------------------------------
   Active Hero Display
   -------------------------------------------------------------------------- */
.active-hero {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.active-hero .hero-sprite {
    flex-shrink: 0;
}

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

.active-hero .hero-name {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.active-hero .hero-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Paired Admiral (inline display within hero)
   -------------------------------------------------------------------------- */
.paired-admiral {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.paired-admiral img {
    border-radius: 50%;
}

/* --------------------------------------------------------------------------
   Item Grid (ships, drones, skills, gems, etc.)
   -------------------------------------------------------------------------- */
.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.item-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    transition: border-color var(--transition-fast);
}

.item-card:hover {
    border-color: var(--border-hover);
}

.item-card .item-sprite {
    margin-bottom: 0.5rem;
}

.item-card .item-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-card .item-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.item-empty {
    border-style: dashed;
    opacity: 0.4;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Sprite Placeholder
   -------------------------------------------------------------------------- */
.sprite-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 2px solid;
    border-radius: 8px;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.3);
}

.sprite-placeholder.sprite-lg {
    width: 64px;
    height: 64px;
    font-size: 1.4rem;
}

.sprite-placeholder.sprite-xl {
    width: 96px;
    height: 96px;
    font-size: 2rem;
}

.sprite-placeholder.sprite-sm {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
}

/* --------------------------------------------------------------------------
   Awakening Stars
   -------------------------------------------------------------------------- */
.awakening-stars {
    display: inline-flex;
    gap: 1px;
    font-size: 0.7rem;
    line-height: 1;
}

.star-filled {
    color: var(--rarity-transcendent);
}

.star-empty {
    color: var(--text-muted);
    opacity: 0.3;
}

/* --------------------------------------------------------------------------
   Rarity Badge (inline pill)
   -------------------------------------------------------------------------- */
.rarity-badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 700;
    font-family: var(--font-display);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 4px;
    line-height: 1.4;
}

.rarity-badge-common { background: rgba(156,163,175,0.15); color: var(--rarity-normal); }
.rarity-badge-uncommon { background: rgba(74,222,128,0.15); color: var(--rarity-uncommon); }
.rarity-badge-rare { background: rgba(96,165,250,0.15); color: var(--rarity-rare); }
.rarity-badge-epic { background: rgba(45,212,191,0.15); color: var(--rarity-epic); }
.rarity-badge-legendary { background: rgba(251,146,60,0.15); color: var(--rarity-legendary); }
.rarity-badge-mythic { background: rgba(168,85,247,0.15); color: var(--rarity-mythic); }
.rarity-badge-transcendent { background: rgba(239,68,68,0.15); color: var(--rarity-transcendent); }

/* --------------------------------------------------------------------------
   Slot Grid (skills, drones, gems)
   -------------------------------------------------------------------------- */
.slot-grid {
    display: grid;
    gap: 0.75rem;
}

.slot-grid-6 { grid-template-columns: repeat(6, 1fr); }
.slot-grid-10 { grid-template-columns: repeat(5, 1fr); }
.slot-grid-20 { grid-template-columns: repeat(5, 1fr); }

/* --------------------------------------------------------------------------
   Preset Tabs
   -------------------------------------------------------------------------- */
.preset-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.preset-tab {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-body);
}

.preset-tab:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.preset-tab.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

/* --------------------------------------------------------------------------
   Equipped Slots (2x2 grid for equipment)
   -------------------------------------------------------------------------- */
.equipped-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 500px;
}

.equip-slot {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.equip-slot .equip-label {
    font-size: 0.7rem;
    font-weight: 700;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
}

.equip-slot .equip-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.equip-slot .equip-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   Stat Table (progress, stats)
   -------------------------------------------------------------------------- */
.stat-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    overflow: hidden;
}

.stat-table tr + tr {
    border-top: 1px solid rgba(75, 85, 99, 0.2);
}

.stat-table td {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
}

.stat-table td:first-child {
    color: var(--text-secondary);
    font-weight: 500;
    width: 50%;
}

.stat-table td:last-child {
    color: var(--text-primary);
    font-weight: 600;
    font-family: var(--font-display);
    font-size: 0.85rem;
    text-align: right;
}

/* --------------------------------------------------------------------------
   Software lock icon + selected drive
   -------------------------------------------------------------------------- */
.sw-lock-icon {
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0 0.25rem;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.sw-lock-icon:hover {
    opacity: 1;
}

.sw-drive.selected {
    border-color: var(--accent-primary);
    box-shadow: 0 0 8px var(--accent-glow);
}

/* --------------------------------------------------------------------------
   Firmware chip slot selected
   -------------------------------------------------------------------------- */
.chip-slot.selected {
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 8px var(--accent-glow);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
    :root {
        --content-padding: 1rem;
    }

    .hero {
        padding: 2.5rem 0.5rem 2rem;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .action-cards {
        grid-template-columns: 1fr;
    }

    .build-grid {
        grid-template-columns: 1fr;
    }

    .build-header {
        flex-direction: column;
    }

    .share-actions {
        width: 100%;
    }

    .share-url {
        max-width: none;
        flex: 1;
    }

    .header-nav .btn-sm {
        padding: 0.35rem 0.65rem;
        font-size: 0.75rem;
    }

    .section-detail-header {
        gap: 0.75rem;
    }

    .section-detail-header .build-title {
        font-size: 1.25rem;
    }

    .active-hero {
        flex-direction: column;
        text-align: center;
    }

    .active-hero .hero-meta {
        justify-content: center;
    }

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

    .slot-grid-6 { grid-template-columns: repeat(3, 1fr); }
    .slot-grid-10 { grid-template-columns: repeat(5, 1fr); }
    .slot-grid-20 { grid-template-columns: repeat(4, 1fr); }

    .equipped-slots {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Build Form (Phase 3 — Manual Build Creation)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Form Container
   -------------------------------------------------------------------------- */
.build-form {
    max-width: 800px;
    margin: 0 auto;
}

.build-form-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* --------------------------------------------------------------------------
   Build Label Input
   -------------------------------------------------------------------------- */
.form-label-row {
    margin-bottom: 1.5rem;
}

/* --------------------------------------------------------------------------
   Form Tabs
   -------------------------------------------------------------------------- */
.form-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-bottom: 1px solid var(--border-primary);
    padding-bottom: 0;
}

.form-tabs::-webkit-scrollbar {
    display: none;
}

.form-tab {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-body);
    white-space: nowrap;
}

.form-tab:hover {
    color: var(--text-primary);
    border-bottom-color: var(--border-hover);
}

.form-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

/* --------------------------------------------------------------------------
   Form Sections (tab panels)
   -------------------------------------------------------------------------- */
.form-section {
    display: none;
}

.form-section.active {
    display: block;
}

/* --------------------------------------------------------------------------
   Form Row
   -------------------------------------------------------------------------- */
.form-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 100px;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Form Inputs
   -------------------------------------------------------------------------- */
.form-select,
.form-input {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    transition: border-color var(--transition-fast);
    outline: none;
}

.form-select:focus,
.form-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.form-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%239ca3af'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
    cursor: pointer;
    min-width: 0;
    flex: 1;
}

.form-input {
    width: 80px;
}

.form-input-wide {
    flex: 1;
    width: auto;
}

/* --------------------------------------------------------------------------
   Slot Editor
   -------------------------------------------------------------------------- */
.slot-editor {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    transition: border-color var(--transition-fast);
}

.slot-editor:hover {
    border-color: var(--border-hover);
}

.slot-editor-header {
    font-size: 0.7rem;
    font-weight: 700;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.slot-editor-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.slot-editor-row .form-select {
    flex: 1;
    min-width: 0;
}

.slot-editor-row .form-input {
    width: 64px;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Slot Preview (sprite area next to dropdown)
   -------------------------------------------------------------------------- */
.slot-preview {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-primary);
}

.slot-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* --------------------------------------------------------------------------
   Awakening Selector (clickable stars)
   -------------------------------------------------------------------------- */
.awk-selector {
    display: inline-flex;
    gap: 2px;
    flex-shrink: 0;
}

.awk-selector .awk-star {
    width: 20px;
    height: 20px;
    font-size: 0.85rem;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    color: var(--text-muted);
    opacity: 0.3;
    transition: all var(--transition-fast);
    user-select: none;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
}

.awk-selector .awk-star.filled {
    color: var(--rarity-transcendent);
    opacity: 1;
}

.awk-selector .awk-star:hover {
    opacity: 0.8;
    transform: scale(1.2);
}

/* --------------------------------------------------------------------------
   Form Actions (sticky save bar)
   -------------------------------------------------------------------------- */
.form-actions {
    position: sticky;
    bottom: 0;
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-primary);
    padding: 1rem 0;
    margin-top: 2rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    z-index: 50;
}

/* --------------------------------------------------------------------------
   Form Hint
   -------------------------------------------------------------------------- */
.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* --------------------------------------------------------------------------
   Slot Grid (for multiple slot editors)
   -------------------------------------------------------------------------- */
.slot-editors-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

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

.form-grid .form-row {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Visual Picker Grid (ship/skill/drone/artifact selection)
   -------------------------------------------------------------------------- */
.picker-tier-label {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 1rem 0 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid rgba(75, 85, 99, 0.2);
}

.picker-tier-label:first-child {
    margin-top: 0;
}

.picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.picker-item {
    background: var(--bg-card);
    border: 2px solid var(--border-primary);
    border-radius: 10px;
    padding: 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.picker-item:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.picker-item.selected {
    border-color: var(--accent-primary);
    box-shadow: 0 0 16px var(--accent-glow), inset 0 0 12px rgba(59, 130, 246, 0.08);
}

.picker-item .picker-sprite {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.picker-item .picker-sprite img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.picker-item .picker-name {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.picker-item.selected .picker-name {
    color: var(--text-primary);
}

/* Ownership states */
.picker-item.dimmed {
    opacity: 0.4;
    filter: grayscale(0.6);
}

.picker-item.dimmed:hover {
    opacity: 0.7;
    filter: grayscale(0.3);
}

.picker-item.owned {
    opacity: 1;
    filter: none;
    border-color: var(--border-hover);
}

.picker-item.owned.tier-a { border-left: 3px solid var(--tier-a); }
.picker-item.owned.tier-s { border-left: 3px solid var(--tier-s); }
.picker-item.owned.tier-ss { border-left: 3px solid var(--tier-ss); }

.picker-item.equipped {
    opacity: 1;
    filter: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 16px var(--accent-glow), inset 0 0 12px rgba(59, 130, 246, 0.08);
}

/* Ownership badge overlay */
.picker-badge {
    position: absolute;
    bottom: 2px;
    left: 2px;
    right: 2px;
    font-size: 0.55rem;
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.75);
    border-radius: 0 0 8px 8px;
    padding: 1px 4px;
    line-height: 1.3;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Collection checkbox */
.picker-checkbox {
    position: absolute;
    top: 4px;
    left: 4px;
    z-index: 2;
    accent-color: var(--accent-primary);
    width: 14px;
    height: 14px;
    cursor: pointer;
}

/* Rarity background tint */
.picker-item.rarity-tint-common { background: rgba(156,163,175,0.08); }
.picker-item.rarity-tint-uncommon { background: rgba(74,222,128,0.08); }
.picker-item.rarity-tint-rare { background: rgba(96,165,250,0.08); }
.picker-item.rarity-tint-epic { background: rgba(45,212,191,0.10); }
.picker-item.rarity-tint-legendary { background: rgba(251,146,60,0.10); }
.picker-item.rarity-tint-mythic { background: rgba(168,85,247,0.12); }
.picker-item.rarity-tint-transcendent { background: rgba(239,68,68,0.12); }

/* Tooltip */
.picker-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.72rem;
    color: var(--text-primary);
    white-space: nowrap;
    z-index: 10;
    box-shadow: var(--shadow-card);
    pointer-events: none;
    margin-bottom: 4px;
}

.picker-item:hover .picker-tooltip {
    display: block;
}

.picker-tooltip-grade {
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* --------------------------------------------------------------------------
   Slot Assignment Area (top of each tab)
   -------------------------------------------------------------------------- */
.slot-assignment {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.slot-assignment-title {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.slot-dropdowns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.slot-dropdowns .form-select {
    flex: 1 1 auto;
    min-width: 140px;
    max-width: 200px;
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
}

.slot-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.6rem 0.3rem 0.3rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.slot-chip img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 3px;
}

.slot-chip .slot-chip-remove {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1;
    margin-left: 0.25rem;
    transition: color var(--transition-fast);
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
}

.slot-chip .slot-chip-remove:hover {
    color: var(--rarity-transcendent);
}

/* Collection header between zones */
.collection-header {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.collection-header .collection-count {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: normal;
}

/* Selection detail panel (appears below grid when item selected) */
.picker-detail {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-top: 1rem;
    display: none;
}

.picker-detail.visible {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.picker-detail-sprite {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.picker-detail-sprite img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

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

.picker-detail-name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.picker-detail-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Form error message
   -------------------------------------------------------------------------- */
.form-error {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: none;
}

.form-error.visible {
    display: block;
}

/* --------------------------------------------------------------------------
   Form Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
    .form-tabs {
        gap: 0;
    }

    .form-tab {
        padding: 0.5rem 0.65rem;
        font-size: 0.75rem;
    }

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

    .picker-detail {
        flex-direction: column;
        text-align: center;
    }

    .picker-detail-controls {
        justify-content: center;
    }

    .slot-dropdowns .form-select {
        min-width: 100%;
        max-width: none;
    }

    .slot-editors-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .slot-editor-row {
        flex-wrap: wrap;
    }

    .slot-editor-row .form-select {
        flex: 1 1 100%;
    }

    .form-row {
        flex-wrap: wrap;
    }

    .form-label {
        min-width: auto;
        flex-basis: 100%;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }
}

/* ================================================================
   Build Overview — Hero Banner + Block Grid
   ================================================================ */

/* Build tabs */
.build-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.build-tab {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s;
}

.build-tab:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.build-tab.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #000;
    font-weight: 600;
}

/* Hero banner */
.hero-banner {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    margin-bottom: 1rem;
    align-items: flex-start;
}

.hero-ship-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.hero-admiral-sprite {
    margin-top: -0.5rem;
}

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

.hero-ship-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.hero-ship-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.hero-admiral-name {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.hero-stats span {
    background: var(--bg-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-primary);
}

/* Overview blocks grid */
.overview-blocks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

@media (min-width: 1024px) {
    .overview-blocks {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    .overview-blocks {
        grid-template-columns: 1fr;
    }

    .hero-banner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .hero-stats {
        justify-content: center;
    }
}

.overview-block {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 1rem;
}

.block-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

/* Sprite grids inside blocks */
.block-sprite-grid {
    display: grid;
    gap: 4px;
}

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

.block-grid-5x2 {
    grid-template-columns: repeat(5, 1fr);
}

.block-sprite-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    background: var(--bg-primary);
    border-radius: 4px;
    border: 1px solid var(--border-primary);
}

.block-sprite-cell.block-empty {
    opacity: 0.3;
}

/* Equipment row */
.block-equip-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.block-equip-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-primary);
    border-radius: 4px;
    border: 1px solid var(--border-primary);
}

.block-equip-slot.block-empty {
    opacity: 0.3;
}

.block-artifact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.block-artifact-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.block-stat {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

/* Memory card row */
.block-card-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.block-card-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--bg-primary);
    border-radius: 3px;
    border: 1px solid var(--border-primary);
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* Gem mini grid */
.gem-mini-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
}

.gem-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

.gem-empty {
    border: 1px solid var(--border-primary);
    background: transparent;
}

/* Passive footer */
.passive-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
}

.footer-badge {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-primary);
}

/* ==========================================================================
   Phase C+D — Section Detail Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   Software Section
   -------------------------------------------------------------------------- */
.sw-info-banner {
    background: rgba(96, 165, 250, 0.08);
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.sw-drive-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1.5rem;
}

.sw-drive {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    font-size: 0.85rem;
}

.sw-drive.locked {
    opacity: 0.3;
}

.sw-drive-letter {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    flex-shrink: 0;
}

.sw-drive-grade {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.sw-drive-stat {
    flex: 1;
    color: var(--text-secondary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sw-drive-value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sw-summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
}

.sw-summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    font-size: 0.8rem;
}

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

.sw-summary-value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.8rem;
}

/* --------------------------------------------------------------------------
   Firmware / Chips Section
   -------------------------------------------------------------------------- */
.chip-columns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 700px) {
    .chip-columns {
        grid-template-columns: repeat(2, 1fr);
    }
}

.chip-column-title {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-align: center;
}

.chip-slot {
    border: 1px dashed var(--border-primary);
    border-radius: 8px;
    padding: 0.5rem;
    margin-bottom: 0.4rem;
    min-height: 60px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: border-color var(--transition-fast);
}

.chip-slot.filled {
    border-style: solid;
}

.chip-slot.empty-slot {
    justify-content: center;
    color: var(--text-muted);
    opacity: 0.4;
    font-size: 1.2rem;
}

.chip-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 4px;
}

.chip-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.chip-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chip-desc {
    font-size: 0.65rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chip-grade-label {
    font-family: var(--font-display);
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    flex-shrink: 0;
}

.chip-constraint {
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: rgba(251, 191, 36, 0.8);
    margin-bottom: 1rem;
}

.chip-inv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
}

.chip-inv-item {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
}

.chip-filter-tabs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.chip-filter-tab {
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-body);
}

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

.chip-filter-tab.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

/* --------------------------------------------------------------------------
   Emblems Section
   -------------------------------------------------------------------------- */
.emblem-filter-tabs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.emblem-filter-tab {
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-body);
}

.emblem-filter-tab:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.emblem-filter-tab.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

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

.emblem-card {
    background: var(--bg-card);
    border: 2px solid var(--border-primary);
    border-radius: 10px;
    padding: 0.75rem;
    text-align: center;
    transition: border-color var(--transition-fast);
}

.emblem-card.owned {
    border-color: var(--rarity-uncommon);
    background: rgba(74, 222, 128, 0.05);
}

.emblem-card.unlocked {
    border-color: var(--rarity-transcendent);
    background: rgba(251, 191, 36, 0.05);
    opacity: 0.7;
}

.emblem-card.locked {
    opacity: 0.35;
}

.emblem-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin: 0 auto 0.35rem;
    display: block;
}

.emblem-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.emblem-badge {
    font-size: 0.6rem;
    font-weight: 700;
    font-family: var(--font-display);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 0.25rem;
}

.emblem-effect {
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.emblem-pity {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* --------------------------------------------------------------------------
   Mastery Section — Hex Grid
   -------------------------------------------------------------------------- */
.mastery-container {
    position: relative;
}

.hex-viewport {
    position: relative;
    width: 100%;
    height: 520px;
    overflow: hidden;
    background: #0a0e1a;
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    cursor: grab;
    margin-bottom: 0.75rem;
}

.hex-viewport:active {
    cursor: grabbing;
}

.hex-canvas {
    position: absolute;
    width: 100%;
    height: 100%;
    will-change: transform;
}

.hex-node {
    position: absolute;
    width: 30px;
    height: 34px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: filter 0.15s;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.hex-node:hover {
    filter: brightness(1.4);
    z-index: 10;
}

.hex-node .node-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    pointer-events: none;
    margin-top: -1px;
}

.hex-node .node-level {
    font-size: 0.38rem;
    font-weight: 700;
    pointer-events: none;
    line-height: 1;
    margin-top: -2px;
}

.hex-node.maxed .node-level { color: var(--rarity-transcendent); }
.hex-node.partial .node-level { color: #ccc; }
.hex-node.unallocated { opacity: 0.3; }
.hex-node.unallocated .node-level { display: none; }

/* Quadrant colors */
.hex-node.q-equip { background: #1a3a3a; }
.hex-node.q-equip.allocated { background: #1a5a5a; }
.hex-node.q-skill { background: #1a2a4a; }
.hex-node.q-skill.allocated { background: #1a3a6a; }
.hex-node.q-drone { background: #1a3a22; }
.hex-node.q-drone.allocated { background: #1a5a30; }
.hex-node.q-memory { background: #2a1a3a; }
.hex-node.q-memory.allocated { background: #3a1a5a; }
.hex-node.q-atk { background: #3a1a22; }
.hex-node.q-atk.allocated { background: #5a1a2a; }
.hex-node.gold { background: #3a3010; }
.hex-node.gold.allocated { background: #5a4a10; }

.mastery-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.mastery-stats span {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.zoom-controls {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.zoom-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    transition: all var(--transition-fast);
}

.zoom-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.zoom-level {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0 0.5rem;
    display: flex;
    align-items: center;
}

.mastery-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.mastery-legend > span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.legend-hex {
    width: 12px;
    height: 14px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: inline-block;
}

.legend-hex.l-equip { background: #1a5a5a; }
.legend-hex.l-skill { background: #1a3a6a; }
.legend-hex.l-drone { background: #1a5a30; }
.legend-hex.l-memory { background: #3a1a5a; }
.legend-hex.l-atk { background: #5a1a2a; }
.legend-hex.l-gold { background: #5a4a10; border: 1px solid rgba(251, 191, 36, 0.6); }

.hex-tooltip {
    position: fixed;
    background: rgba(15, 25, 35, 0.95);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    font-size: 0.75rem;
    max-width: 220px;
    pointer-events: none;
    z-index: 1000;
    display: none;
}

.hex-tooltip .tt-name {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.hex-tooltip .tt-type {
    font-size: 0.65rem;
    margin-bottom: 0.25rem;
}

.hex-tooltip .tt-type.main-type { color: var(--rarity-transcendent); }
.hex-tooltip .tt-type.sub-type { color: var(--text-muted); }

.hex-tooltip .tt-desc {
    color: var(--text-secondary);
    font-size: 0.7rem;
    margin-bottom: 0.2rem;
}

.hex-tooltip .tt-level {
    font-size: 0.65rem;
    color: var(--text-accent);
}

/* --------------------------------------------------------------------------
   Drones Section — Enhanced
   -------------------------------------------------------------------------- */
.drone-type-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.drone-type-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.65rem;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    color: var(--text-secondary);
}

.drone-type-badge span {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-primary);
}

.drone-detail-layout {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.drone-slots-area {
    flex: 1;
}

.drone-slot-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.drone-slot {
    width: 62px;
    height: 62px;
    background: var(--bg-card);
    border: 2px solid var(--border-primary);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0.25rem;
}

.drone-slot:hover {
    border-color: var(--border-hover);
}

.drone-slot.selected {
    border-color: var(--accent-primary);
    box-shadow: 0 0 12px var(--accent-glow);
}

.drone-slot.locked-slot {
    border-style: dashed;
    opacity: 0.3;
    cursor: default;
}

.drone-slot .drone-slot-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.drone-slot .drone-slot-name {
    font-size: 0.5rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center;
}

.drone-detail-panel {
    width: 260px;
    flex-shrink: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    padding: 1rem;
    min-height: 200px;
}

.drone-detail-panel .drone-detail-empty {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    padding-top: 2rem;
}

@media (max-width: 640px) {
    .drone-detail-layout {
        flex-direction: column;
    }
    .drone-detail-panel {
        width: 100%;
    }
    .drone-slot-row {
        grid-template-columns: repeat(5, 1fr);
    }
    .drone-slot {
        width: auto;
        height: auto;
        aspect-ratio: 1;
    }
}

/* ==========================================================================
   Planner Layout (E2)
   ========================================================================== */

.planner {
    max-width: 1400px;
    margin: 0 auto;
}

.planner-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-primary);
}

.planner-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.planner-source {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.planner-source code {
    background: var(--bg-tertiary);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.7rem;
}

.planner-body {
    display: grid;
    grid-template-columns: 140px 1fr 280px;
    gap: 1.5rem;
    min-height: 600px;
}

/* --- Sidebar Nav --- */
.planner-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.planner-nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-body);
    text-align: left;
    white-space: nowrap;
}

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

.planner-nav-item.active {
    color: var(--accent-primary);
    background: var(--accent-glow);
    border-color: var(--accent-primary);
}

.planner-nav-item .nav-icon {
    width: 16px;
    text-align: center;
    font-size: 0.75rem;
}

.planner-nav-divider {
    height: 1px;
    background: var(--border-primary);
    margin: 0.5rem 0;
}

/* --- Section Editor (main area) --- */
.planner-editor {
    min-width: 0;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
}

.editor-placeholder {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 1rem;
    font-size: 0.9rem;
}

/* --- Detail Panel (right sidebar) --- */
.planner-detail {
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    position: sticky;
    top: calc(var(--header-height) + 1rem);
    max-height: calc(100vh - var(--header-height) - 3rem);
    overflow-y: auto;
}

.detail-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem 0.5rem;
    font-size: 0.85rem;
}

.detail-sprite {
    text-align: center;
    margin-bottom: 0.75rem;
}

.detail-name {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.detail-grade {
    margin-bottom: 0.75rem;
}

.detail-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-primary);
}

.detail-control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.detail-control-row label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.detail-control-row input[type="range"] {
    flex: 1;
    max-width: 120px;
    accent-color: var(--accent-primary);
}

.detail-control-row .value-display {
    font-size: 0.8rem;
    color: var(--text-primary);
    font-weight: 600;
    min-width: 30px;
    text-align: right;
}

.detail-actions {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-primary);
}

.detail-actions .btn {
    width: 100%;
}

/* --- Planner sub-tab bar (equipment sub-tabs, etc.) --- */
.planner-subtabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-primary);
}

.planner-subtab {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-body);
}

.planner-subtab:hover {
    color: var(--text-primary);
    border-bottom-color: var(--border-hover);
}

.planner-subtab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

/* --- Equip slot (clickable slot in the planner) --- */
.planner-slot {
    background: var(--bg-secondary);
    border: 2px dashed var(--border-primary);
    border-radius: 10px;
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.planner-slot:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.planner-slot.filled {
    border-style: solid;
}

.planner-slot.selected {
    border-color: var(--accent-primary);
    box-shadow: 0 0 12px var(--accent-glow);
}

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

.planner-slot .slot-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.planner-slot .slot-empty {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* --- Slot grids --- */
.slot-grid {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.slot-grid-6 {
    grid-template-columns: repeat(6, 1fr);
}

.slot-grid-10 {
    grid-template-columns: repeat(5, 1fr);
}

.slot-grid-20 {
    grid-template-columns: repeat(5, 1fr);
}

/* --- Picker grid --- */
.picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
}

.picker-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.picker-item:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.picker-item.selected {
    border-color: var(--accent-primary);
    background: var(--accent-glow);
}

.picker-sprite {
    margin-bottom: 0.25rem;
}

.picker-name {
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Section subtitles --- */
.section-subtitle {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 0.75rem 0;
}

/* --- Tier group headers --- */
.tier-group-header {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 1rem 0 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border-primary);
}

/* --- Active ship display --- */
.active-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.active-display-empty {
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 1.5rem;
    text-align: center;
    background: var(--bg-secondary);
    border: 2px dashed var(--border-primary);
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.active-display-info {
    flex: 1;
}

.active-display-info .name {
    font-weight: 700;
    font-size: 0.95rem;
}

/* --------------------------------------------------------------------------
   Banner Configurator
   -------------------------------------------------------------------------- */
.banner-config {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: var(--content-padding);
}

.banner-config-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.banner-config-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0;
}

.banner-config-body {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.banner-config-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.banner-config-section {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 1rem;
}

.banner-config-section-title {
    font-family: var(--font-display);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin: 0 0 0.75rem;
}

/* Radio buttons for type selector */
.banner-type-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: color var(--transition-fast);
}

.banner-type-option:hover {
    color: var(--text-primary);
}

.banner-type-option input[type="radio"] {
    accent-color: var(--accent-primary);
}

.banner-type-option.active {
    color: var(--text-accent);
}

.banner-type-dims {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: auto;
}

/* Widget checkboxes */
.banner-widget-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: color var(--transition-fast);
}

.banner-widget-option:hover {
    color: var(--text-primary);
}

.banner-widget-option input[type="checkbox"] {
    accent-color: var(--accent-primary);
}

/* Custom fields */
.banner-field-group {
    margin-bottom: 0.75rem;
}

.banner-field-group:last-child {
    margin-bottom: 0;
}

.banner-field-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.banner-field-input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    font-family: var(--font-body);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    color: var(--text-primary);
    transition: border-color var(--transition-fast);
    box-sizing: border-box;
}

.banner-field-input:focus {
    outline: none;
    border-color: var(--border-accent);
}

/* Action buttons */
.banner-config-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Preview panel */
.banner-config-preview {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 1.5rem;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-preview-container {
    position: relative;
    width: 100%;
    text-align: center;
}

.banner-preview-img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: var(--shadow-card);
}

.banner-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-family: var(--font-display);
}

.banner-feedback {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--accent-primary);
    min-height: 1.2em;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .planner-body {
        grid-template-columns: 1fr;
    }

    .planner-nav {
        flex-direction: row;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .planner-nav::-webkit-scrollbar {
        display: none;
    }

    .planner-detail {
        position: static;
        max-height: none;
    }

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

    .banner-config-body {
        grid-template-columns: 1fr;
    }

    .banner-config-preview {
        order: -1;
    }
}

/* --------------------------------------------------------------------------
   My Builds / Browse Builds Pages
   -------------------------------------------------------------------------- */
.my-builds-page {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: var(--content-padding);
}

.my-builds-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.my-builds-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0;
}

.build-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: border-color var(--transition-fast);
}

.build-row:hover {
    border-color: var(--border-hover);
}

.build-row-label {
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.build-row-label:hover {
    color: var(--text-accent);
}

.build-row-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.build-visibility-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(59, 130, 246, 0.15);
    color: var(--text-accent);
}

.build-row-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.browse-pagination {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}
