/**
 * Satisfactory Production Chain - Stylesheet
 * Industrial FICSIT dark theme with high legibility and clear tree hierarchy
 */

:root {
    --bg-main: #0d1117;
    --bg-surface: #161e27;
    --bg-surface-elevated: #1e2836;
    --bg-surface-hover: #263445;
    --border-color: #2b394a;
    --border-highlight: #3b4d63;

    /* FICSIT Palette */
    --ficsit-orange: #fa9549;
    --ficsit-orange-hover: #fbab6d;
    --ficsit-orange-glow: rgba(250, 149, 73, 0.2);
    --ficsit-cyan: #38bdf8;
    --ficsit-cyan-glow: rgba(56, 189, 248, 0.15);
    --ficsit-green: #4ade80;
    --ficsit-green-glow: rgba(74, 222, 128, 0.15);
    --ficsit-purple: #c084fc;
    --ficsit-amber: #fbbf24;

    /* Text */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Machine Colors */
    --machine-smelter: #f97316;
    --machine-foundry: #ea580c;
    --machine-constructor: #0284c7;
    --machine-assembler: #0d9488;
    --machine-manufacturer: #e11d48;
    --machine-refinery: #7c3aed;
    --machine-blender: #9333ea;
    --machine-packager: #ca8a04;
    --machine-advanced: #d946ef;
    --machine-raw: #22c55e;

    /* Spacing & Radii */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   Header
   ========================================================================== */
.app-header {
    background: linear-gradient(180deg, #18222e 0%, var(--bg-surface) 100%);
    border-bottom: 2px solid var(--border-color);
    padding: 1.25rem 2rem;
    box-shadow: var(--shadow-md);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.brand-badge {
    display: inline-block;
    background-color: var(--ficsit-orange);
    color: #000;
    font-weight: 900;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
}

.brand h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
}

.brand .tagline {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 2px;
}

.header-stats {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.stat-pill {
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.stat-pill strong {
    color: var(--ficsit-orange);
}

/* ==========================================================================
   Main Layout
   ========================================================================== */
.app-main {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

/* Search Section */
.search-section {
    margin-bottom: 2rem;
}

.search-container {
    max-width: 800px;
    margin: 0 auto;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1rem;
    font-size: 1.1rem;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    background-color: var(--bg-surface);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem 4.8rem 0.85rem 2.8rem;
    font-size: 1.05rem;
    color: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    border-color: var(--ficsit-orange);
    box-shadow: 0 0 0 4px var(--ficsit-orange-glow);
}

.search-input-actions {
    position: absolute;
    right: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.clear-btn,
.dropdown-toggle-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background-color 0.15s, transform 0.2s;
}

.clear-btn {
    font-size: 1.05rem;
    padding: 6px 8px;
}

.dropdown-toggle-btn {
    font-size: 0.75rem;
    padding: 8px 10px;
}

.clear-btn:hover,
.dropdown-toggle-btn:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.08);
}

.dropdown-toggle-btn.open {
    transform: rotate(180deg);
    color: var(--ficsit-orange);
}

/* Search Autocomplete & Filter Dropdown */
.search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background-color: #1a2234;
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-md);
    max-height: 420px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(12px);
}

.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(15, 23, 42, 0.75);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.dropdown-header-count {
    font-weight: 600;
    color: var(--text-secondary);
}

.dropdown-header-hint {
    font-size: 0.7rem;
    opacity: 0.8;
}

.dropdown-list {
    overflow-y: auto;
    flex: 1;
    max-height: 370px;
}

.dropdown-item {
    padding: 0.65rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    border-left: 3px solid transparent;
    transition: background-color 0.15s, border-left-color 0.15s;
}

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

.dropdown-item:hover,
.dropdown-item.active {
    background-color: var(--bg-surface-hover);
    border-left-color: var(--ficsit-orange);
}

.dropdown-item.selected {
    background-color: rgba(250, 149, 39, 0.09);
}

.dropdown-item-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.dropdown-item-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 2px;
    flex-shrink: 0;
}

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

.dropdown-item-name {
    font-weight: 600;
    color: #fff;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-item-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.dropdown-item-right {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.dropdown-item-badge {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 9999px;
    background-color: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.dropdown-item-badge.badge-component {
    background-color: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.3);
}

.dropdown-item-badge.badge-raw-resource {
    background-color: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.3);
}

.dropdown-item-badge.badge-ingot {
    background-color: rgba(245, 158, 11, 0.12);
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.3);
}

.dropdown-item-badge.badge-project-assembly {
    background-color: rgba(168, 85, 247, 0.12);
    color: #d8b4fe;
    border-color: rgba(168, 85, 247, 0.3);
}

.dropdown-item-badge.badge-nuclear {
    background-color: rgba(234, 179, 8, 0.12);
    color: #fde047;
    border-color: rgba(234, 179, 8, 0.3);
}

.dropdown-item-badge.badge-equipment,
.dropdown-item-badge.badge-vehicle,
.dropdown-item-badge.badge-ammunition {
    background-color: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.3);
}

.dropdown-item-check {
    color: var(--ficsit-orange);
    font-weight: bold;
    font-size: 1rem;
    margin-left: 2px;
}

.search-match {
    color: var(--ficsit-orange);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.dropdown-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--text-muted);
}

.dropdown-empty-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.6;
}

.dropdown-empty-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.dropdown-empty-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Quick Chips */
.quick-chips {
    margin-top: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.chips-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.chip {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.chip:hover {
    border-color: var(--ficsit-orange);
    color: #fff;
    background-color: var(--bg-surface-hover);
}

.chip.active {
    background-color: rgba(250, 149, 39, 0.15);
    border-color: var(--ficsit-orange);
    color: var(--ficsit-orange);
    font-weight: 600;
}

.chip-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Loading & Welcome States */
.loading-state,
.welcome-state {
    text-align: center;
    padding: 3rem 1rem;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--ficsit-orange);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

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

.welcome-card {
    max-width: 720px;
    margin: 0 auto;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
}

.welcome-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.welcome-card h2 {
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.welcome-card p {
    color: var(--text-secondary);
}

.welcome-features {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    text-align: left;
}

.feature-item {
    display: flex;
    gap: 0.75rem;
}

.feature-icon {
    font-size: 1.5rem;
}

.feature-item strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.feature-item p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Active Item Workspace
   ========================================================================== */
.active-item-banner {
    background: linear-gradient(90deg, var(--bg-surface-elevated) 0%, var(--bg-surface) 100%);
    border: 1px solid var(--border-color);
    border-left: 6px solid var(--ficsit-orange);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.active-item-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.active-item-meta .badge {
    font-size: 0.85rem;
    padding: 0.45rem 1rem;
    border-radius: 9999px;
    letter-spacing: 0.04em;
    font-weight: 700;
}

.active-item-info {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.active-item-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    background-color: rgba(255, 255, 255, 0.04);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    transition: transform 0.2s, border-color 0.2s;
}

.active-item-icon:hover {
    transform: scale(1.05);
    border-color: var(--ficsit-orange);
}

.active-item-text {
    display: flex;
    flex-direction: column;
}

.active-item-subtitle {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--ficsit-orange);
    font-weight: 700;
    text-transform: uppercase;
}

.active-item-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    margin: 2px 0;
}

.active-item-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 800px;
}

/* ==========================================================================
   Automation Narrative Card (Plain-text Blueprint Interpretation)
   ========================================================================== */
.automation-narrative-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.75) 0%, rgba(15, 23, 42, 0.9) 100%);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--ficsit-orange);
    border-radius: var(--radius-md);
    padding: 1rem 1.35rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.narrative-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 0.5rem;
}

.narrative-title-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.narrative-icon {
    font-size: 1.1rem;
}

.narrative-title-group h4 {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: var(--ficsit-orange);
    margin: 0;
}

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

.narrative-body {
    font-size: 0.95rem;
    line-height: 1.65;
    color: #cbd5e1;
}

.narrative-body strong {
    color: #fff;
}

.narrative-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 600;
    vertical-align: middle;
    margin: 2px 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.narrative-chip img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.narrative-chip.raw {
    background-color: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #86efac;
}

.narrative-chip.comp {
    background-color: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #7dd3fc;
}

.narrative-chip.machine {
    background-color: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.4);
    color: #d8b4fe;
}

.narrative-recipe-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    vertical-align: middle;
    margin-left: 0.35rem;
    margin-right: 0.1rem;
}

.narrative-recipe-tag.standard {
    background-color: rgba(148, 163, 184, 0.15);
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #cbd5e1;
}

.narrative-recipe-tag.alternate {
    background-color: rgba(245, 158, 11, 0.18);
    border: 1px solid rgba(245, 158, 11, 0.45);
    color: #fcd34d;
}

.tree-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.flow-toggle-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 3px 6px;
    border-radius: var(--radius-sm);
}

.flow-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-left: 4px;
}

.button-group {
    display: flex;
    gap: 2px;
}

.btn-toggle {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-toggle:hover {
    color: #fff;
    background-color: var(--bg-surface-hover);
}

.btn-toggle.active {
    background-color: var(--ficsit-orange);
    color: #000;
    font-weight: 800;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.expand-toggle-group {
    display: flex;
    gap: 0.5rem;
}

.btn {
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background-color 0.15s;
}

.btn-secondary {
    background-color: var(--bg-surface-hover);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--border-highlight);
}

/* Workspace 2-Column Grid */
.workspace-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
    align-items: start;
}

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

/* ==========================================================================
   Tree View Section
   ========================================================================== */
.tree-section {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    overflow-x: auto;
}

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

.section-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.badge {
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-info {
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-highlight);
    color: var(--ficsit-cyan);
}

/* Tree Container and Node Components */
.tree-container {
    padding-left: 0.5rem;
}

.tree-node-wrapper {
    position: relative;
    margin: 0.5rem 0;
}

.tree-node-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.9rem;
    width: fit-content;
    min-width: 280px;
    box-shadow: var(--shadow-sm);
    transition: all 0.15s;
}

.tree-node-card:hover {
    border-color: var(--ficsit-orange);
    background-color: var(--bg-surface-hover);
}

/* Node States */
.tree-node-card.root-node {
    border-left: 4px solid var(--ficsit-orange);
    background: linear-gradient(90deg, rgba(250, 149, 73, 0.1) 0%, var(--bg-surface-elevated) 100%);
}

.tree-node-card.raw-node {
    border-left: 4px solid var(--ficsit-green);
    background: linear-gradient(90deg, rgba(74, 222, 128, 0.08) 0%, var(--bg-surface-elevated) 100%);
}

.tree-node-card.target-node {
    border: 2px solid var(--ficsit-orange);
    background: linear-gradient(90deg, rgba(250, 149, 73, 0.15) 0%, var(--bg-surface-elevated) 100%);
    box-shadow: 0 0 12px var(--ficsit-orange-glow);
}

.tree-node-card.wrapper-node {
    border-left: 4px solid var(--ficsit-cyan);
    background: linear-gradient(90deg, var(--ficsit-cyan-glow) 0%, var(--bg-surface-elevated) 100%);
}

.target-badge {
    font-size: 0.7rem;
    font-weight: 800;
    background-color: var(--ficsit-orange);
    color: #000;
    padding: 1px 6px;
    border-radius: 3px;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
}

.tree-node-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 20px;
    height: 20px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: pointer;
    flex-shrink: 0;
}

.tree-node-toggle:hover {
    color: #fff;
    border-color: var(--border-highlight);
}

.tree-node-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.tree-node-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tree-node-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    background-color: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    padding: 2px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.tree-node-name {
    font-weight: 700;
    color: #fff;
    font-size: 0.95rem;
}

.tree-node-amount {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    background-color: rgba(255, 255, 255, 0.05);
    padding: 1px 6px;
    border-radius: 3px;
}

.tree-node-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3px;
    flex-wrap: wrap;
}

/* Machine Badges */
.machine-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.machine-badge-icon {
    width: 15px;
    height: 15px;
    object-fit: contain;
    flex-shrink: 0;
}

.machine-badge.smelter { background-color: rgba(249, 115, 22, 0.2); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.3); }
.machine-badge.foundry { background-color: rgba(234, 88, 12, 0.2); color: #fdba74; border: 1px solid rgba(234, 88, 12, 0.3); }
.machine-badge.constructor { background-color: rgba(2, 132, 199, 0.2); color: #38bdf8; border: 1px solid rgba(2, 132, 199, 0.3); }
.machine-badge.assembler { background-color: rgba(13, 148, 136, 0.2); color: #2dd4bf; border: 1px solid rgba(13, 148, 136, 0.3); }
.machine-badge.manufacturer { background-color: rgba(225, 29, 72, 0.2); color: #fb7185; border: 1px solid rgba(225, 29, 72, 0.3); }
.machine-badge.refinery { background-color: rgba(124, 58, 237, 0.2); color: #c084fc; border: 1px solid rgba(124, 58, 237, 0.3); }
.machine-badge.blender { background-color: rgba(147, 51, 234, 0.2); color: #d8b4fe; border: 1px solid rgba(147, 51, 234, 0.3); }
.machine-badge.packager { background-color: rgba(202, 138, 4, 0.2); color: #fde047; border: 1px solid rgba(202, 138, 4, 0.3); }
.machine-badge.advanced { background-color: rgba(217, 70, 239, 0.2); color: #f0abfc; border: 1px solid rgba(217, 70, 239, 0.3); }
.machine-badge.raw { background-color: rgba(34, 197, 94, 0.2); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.3); font-weight: 800; }

/* Alternate Recipe Badge */
.alt-badge {
    font-size: 0.7rem;
    color: var(--ficsit-amber);
    background-color: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.25);
    padding: 1px 6px;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* Tree Hierarchy Lines */
.tree-children {
    padding-left: 2rem;
    position: relative;
    border-left: 2px dashed var(--border-color);
    margin-left: 1.25rem;
}

.tree-children::before {
    content: "↓";
    position: absolute;
    top: -8px;
    left: -5px;
    font-size: 11px;
    color: var(--text-muted);
}

.tree-container.flow-bottom-up .tree-children::before {
    content: "↑";
    color: var(--ficsit-orange);
}

.tree-children.collapsed {
    display: none;
}

/* ==========================================================================
   Sidebar Summaries
   ========================================================================== */
.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.summary-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.card-icon {
    font-size: 1.1rem;
}

.card-header h4 {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #fff;
}

.card-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.85rem;
}

.summary-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.summary-list-item {
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.8rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
}

.summary-item-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.summary-item-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    background-color: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    padding: 2px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.raw-list .summary-list-item {
    border-left: 3px solid var(--ficsit-green);
}

.buildings-list .summary-list-item {
    border-left: 3px solid var(--ficsit-orange);
}

/* Alternate Recipes Card */
.alt-recipe-item {
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.alt-recipe-item strong {
    display: block;
    color: var(--ficsit-amber);
    font-size: 0.85rem;
}

.alt-recipe-item span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.app-footer {
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    padding: 1.5rem 2rem;
    margin-top: auto;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

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

.footer-note {
    font-size: 0.8rem;
    margin-top: 0.3rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Visualization Card & Unified Header
   ========================================================================== */
.visualization-card {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.visualization-header {
    background: linear-gradient(90deg, #1e293b 0%, #151d2f 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.65rem 1.15rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.view-mode-tabs {
    display: inline-flex;
    background-color: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 4px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1.15rem;
    font-size: 0.88rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.15s ease;
}

.tab-btn:hover {
    color: #fff;
    background-color: var(--bg-surface-hover);
}

.tab-btn.active {
    background-color: var(--ficsit-orange);
    color: #000;
    box-shadow: 0 2px 6px rgba(250, 149, 39, 0.35);
}

/* ==========================================================================
   Factory Graph Section (DAG Flowchart)
   ========================================================================== */
.graph-section {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.graph-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.graph-rate-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.rate-input-wrapper {
    display: inline-flex;
    align-items: center;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.rate-input-wrapper input {
    width: 75px;
    padding: 0.35rem 0.6rem;
    background: transparent;
    border: none;
    color: var(--ficsit-orange);
    font-weight: 800;
    font-size: 0.95rem;
    text-align: right;
    outline: none;
}

.rate-unit {
    padding: 0 0.6rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    user-select: none;
}

.graph-stats-summary {
    display: flex;
    gap: 0.5rem;
}

.graph-zoom-controls {
    display: flex;
    gap: 0.4rem;
}

.btn-icon {
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
}

.graph-canvas-container {
    width: 100%;
    height: 650px;
    background-color: #0b0f14;
    background-image: 
        radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 24px 24px;
    position: relative;
    overflow: hidden;
    cursor: grab;
    user-select: none;
}

.graph-canvas-container:active {
    cursor: grabbing;
}

.factory-graph-svg {
    display: block;
    width: 100%;
    height: 100%;
}

.graph-hint {
    padding: 0.6rem 1.25rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-surface-elevated);
}

/* SVG Graph Elements */
.edge-glow {
    fill: none;
    stroke: rgba(0, 0, 0, 0.6);
    stroke-width: 6;
}

.edge-path {
    fill: none;
    stroke: #64748b;
    stroke-width: 2.5;
    transition: stroke 0.2s;
}

.edge-path.fluid-edge {
    stroke: #8b5cf6;
    stroke-dasharray: 6 3;
}

.edge-group:hover .edge-path {
    stroke: var(--ficsit-orange);
    stroke-width: 3.5;
}

.edge-label-bg {
    fill: #161e27;
    stroke: #334155;
    stroke-width: 1;
}

.edge-label-text {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 10px;
    font-weight: 600;
    fill: #cbd5e1;
    user-select: none;
    pointer-events: none;
}

.node-glow-ring {
    fill: none;
    stroke-width: 2;
    opacity: 0.3;
    transition: opacity 0.2s, stroke-width 0.2s;
}

.node-bg-circle {
    fill: #161e27;
    stroke-width: 2.5;
    transition: transform 0.2s;
}

.graph-node {
    cursor: pointer;
}

.graph-node:hover .node-glow-ring {
    opacity: 0.9;
    stroke-width: 5;
}

.graph-node:hover .node-bg-circle {
    stroke-width: 3.5;
}

.node-image {
    pointer-events: none;
}

.node-label-title {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 12px;
    font-weight: 800;
    fill: #ffffff;
    pointer-events: none;
}

.node-label-sub {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 11px;
    font-weight: 600;
    fill: var(--text-muted);
    pointer-events: none;
}

.target-node .node-label-title {
    fill: var(--ficsit-orange);
    font-size: 13px;
}

.byproduct-node .node-label-title {
    fill: var(--ficsit-purple);
}

/* Tree View Recipe Badges */
.tree-recipe-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    background-color: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.tree-recipe-badge.alt-recipe {
    background-color: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.4);
}

.tree-recipe-badge .alt-tag {
    background-color: #f59e0b;
    color: #0b0f14;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 2px;
}

/* Interactive Alternate Recipes Card */
.alt-recipes-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.alt-status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.alt-status-badge.has-custom {
    color: #fbbf24;
}

.btn-reset-alts {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-reset-alts:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #fff;
}

.alt-recipes-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.alt-item-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: border-color 0.2s, background-color 0.2s;
}

.alt-item-card.is-custom {
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.05);
}

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

.alt-card-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alt-card-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.alt-card-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
}

.alt-active-pill {
    font-size: 0.65rem;
    font-weight: 800;
    background-color: #f59e0b;
    color: #0b0f14;
    padding: 1px 5px;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

.alt-select-wrapper {
    width: 100%;
}

.alt-recipe-select {
    width: 100%;
    background-color: #0b0f14;
    color: #e2e8f0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 0.78rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
}

.alt-recipe-select:focus,
.alt-recipe-select:hover {
    border-color: var(--ficsit-orange);
}

.alt-recipe-preview {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: monospace;
    line-height: 1.2;
}

.alt-empty-notice {
    color: #64748b;
    font-size: 0.85rem;
    margin: 0;
}

/* Graph Mode Slide-in Drawer */
.graph-section {
    position: relative;
}

.graph-alts-drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 360px;
    max-width: 90vw;
    background-color: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border-left: 1px solid var(--border-color);
    z-index: 50;
    display: flex;
    flex-direction: column;
    box-shadow: -6px 0 24px rgba(0, 0, 0, 0.5);
    animation: slideInRight 0.2s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.2);
}

.drawer-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.drawer-title h4 {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin: 0;
}

.drawer-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.drawer-close:hover {
    color: #fff;
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.85rem;
}

.alts-badge {
    display: inline-block;
    background-color: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 999px;
    margin-left: 4px;
}

.alts-badge.has-active {
    background-color: #f59e0b;
    color: #0b0f14;
}

/* Graph Alternate Node Indicators */
.alt-glow-ring {
    stroke: #f59e0b !important;
    stroke-width: 3.5 !important;
    opacity: 0.75 !important;
}

.alt-label-sub {
    fill: #fbbf24 !important;
    font-weight: 700;
}

.locked-label-sub {
    fill: #f87171 !important;
    font-weight: 700;
}

/* ==========================================================================
   Save Game Integration & Drag-and-Drop
   ========================================================================== */
.header-save-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-upload-save {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
    color: #e2e8f0;
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-upload-save:hover {
    border-color: var(--ficsit-orange);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.btn-upload-save .btn-icon {
    font-size: 0.95rem;
}

.save-loaded-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: linear-gradient(135deg, rgba(22, 101, 52, 0.3) 0%, rgba(15, 23, 42, 0.8) 100%);
    border: 1px solid #22c55e;
    padding: 4px 8px 4px 10px;
    border-radius: var(--radius-sm);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.2);
    animation: fadeIn 0.25s ease-out;
}

.save-badge-icon {
    font-size: 1.1rem;
}

.save-badge-info {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.save-badge-session {
    font-size: 0.8rem;
    font-weight: 800;
    color: #4ade80;
    letter-spacing: 0.2px;
}

.save-badge-meta {
    font-size: 0.68rem;
    color: var(--text-secondary);
}

.btn-unload-save {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.15rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s;
}

.btn-unload-save:hover {
    color: #f87171;
}

/* Drag-and-Drop Overlay */
.drag-drop-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(11, 15, 20, 0.88);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.drag-drop-modal {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border: 2px dashed var(--ficsit-orange);
    border-radius: var(--radius-lg);
    padding: 3rem 4rem;
    text-align: center;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), 0 0 32px rgba(245, 158, 11, 0.25);
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

.drag-drop-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-8px); }
}

.drag-drop-modal h3 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.5rem;
}

.drag-drop-modal p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.drag-drop-hint {
    display: inline-block;
    background-color: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Locked Recipe Indicators */
.alt-locked-pill {
    font-size: 0.65rem;
    font-weight: 800;
    background-color: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    color: #f87171;
    padding: 1px 5px;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

.tree-recipe-badge.locked-recipe {
    border-color: #ef4444 !important;
    background-color: rgba(239, 68, 68, 0.15) !important;
    color: #fca5a5 !important;
}

.alt-save-filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    padding: 5px 10px;
    border-radius: 4px;
    margin-bottom: 0.6rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.alt-save-filter-row label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}

.alt-save-filter-row input[type="checkbox"] {
    accent-color: var(--ficsit-orange);
    cursor: pointer;
}

/* Save Game Help Button in Header */
.btn-save-help {
    background-color: rgba(30, 41, 59, 0.85);
    border: 1px solid var(--border-color);
    color: #94a3b8;
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.65rem;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-save-help:hover {
    background-color: var(--ficsit-orange);
    color: #000;
    border-color: var(--ficsit-orange);
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(250, 149, 0, 0.3);
}

/* Footer Creator Badge */
.footer-creator-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    background: linear-gradient(90deg, rgba(250, 149, 0, 0.08) 0%, rgba(245, 158, 11, 0.16) 50%, rgba(250, 149, 0, 0.08) 100%);
    border: 1px solid rgba(250, 149, 0, 0.35);
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    margin-bottom: 0.85rem;
    font-size: 0.92rem;
    color: #f1f5f9;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), 0 0 12px rgba(250, 149, 0, 0.12);
}

.creator-name {
    color: var(--ficsit-orange);
    font-weight: 800;
    letter-spacing: 0.5px;
}

.creator-divider {
    color: rgba(255, 255, 255, 0.3);
    margin: 0 0.1rem;
}

.creator-credits-highlight {
    color: #fbbf24;
    font-weight: 600;
}

.creator-sparkle {
    font-size: 0.85rem;
}

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

/* Save Game & Recipes Guide Modal */
.save-help-modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    animation: fadeIn 0.2s ease-out;
}

.save-help-modal {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(250, 149, 0, 0.2);
    width: 100%;
    max-width: 660px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.save-help-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.15rem 1.4rem;
    background-color: rgba(15, 23, 42, 0.8);
    border-bottom: 1px solid var(--border-color);
}

.save-help-title-group {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.save-help-icon {
    font-size: 1.35rem;
}

.save-help-header h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.save-help-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.save-help-close:hover {
    color: #fff;
    background-color: var(--bg-surface-hover);
}

.save-help-body {
    padding: 1.4rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.guide-card {
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.guide-card-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.guide-badge {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    background-color: rgba(59, 130, 246, 0.2);
    border: 1px solid #3b82f6;
    color: #60a5fa;
    padding: 2px 7px;
    border-radius: 4px;
}

.guide-badge.highlight {
    background-color: rgba(250, 149, 0, 0.2);
    border-color: var(--ficsit-orange);
    color: var(--ficsit-orange);
}

.guide-card-header h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0;
}

.guide-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin: 0;
}

.shortcut-box {
    background-color: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.shortcut-step {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: var(--ficsit-orange);
    color: #000;
    font-weight: 800;
    font-size: 0.75rem;
    border-radius: 50%;
    flex-shrink: 0;
}

kbd {
    background-color: #334155;
    border: 1px solid #475569;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    color: #f8fafc;
    font-family: monospace;
    font-size: 0.8rem;
    padding: 1px 5px;
}

.copy-path-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.save-path-input {
    flex: 1;
    background-color: #0b1120;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.75rem;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.82rem;
    color: #38bdf8;
    outline: none;
}

.btn-copy-path {
    background-color: #334155;
    border: 1px solid var(--border-color);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.btn-copy-path:hover {
    background-color: var(--ficsit-orange);
    color: #000;
    border-color: var(--ficsit-orange);
}

.btn-copy-path.copied {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
    color: #fff !important;
}

.platform-paths {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.platform-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.82rem;
}

.platform-tag {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 0.5px;
    width: 80px;
    text-align: center;
}

.platform-tag.steam {
    background-color: rgba(2, 132, 199, 0.2);
    border: 1px solid #0284c7;
    color: #38bdf8;
}

.platform-tag.epic {
    background-color: rgba(168, 85, 247, 0.2);
    border: 1px solid #a855f7;
    color: #c084fc;
}

.platform-item code {
    background-color: rgba(0, 0, 0, 0.35);
    padding: 2px 6px;
    border-radius: 3px;
    color: #cbd5e1;
    font-size: 0.78rem;
    font-family: monospace;
    overflow-x: auto;
}

.guide-note {
    font-size: 0.8rem !important;
    color: #94a3b8 !important;
}

.guide-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0;
    margin: 0;
}

.guide-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 0.86rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.list-bullet {
    font-size: 1rem;
    flex-shrink: 0;
    line-height: 1.2;
}

.guide-list strong {
    color: #f1f5f9;
}

.guide-list code {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 1px 4px;
    border-radius: 3px;
    color: #e2e8f0;
    font-size: 0.8rem;
}

.save-help-footer {
    padding: 0.85rem 1.4rem;
    background-color: rgba(15, 23, 42, 0.8);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

.btn-dismiss-help {
    background-color: var(--ficsit-orange);
    color: #000;
    font-size: 0.88rem;
    font-weight: 700;
    border: none;
    padding: 0.55rem 1.4rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-dismiss-help:hover {
    background-color: #ffaa1a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(250, 149, 0, 0.3);
}

/* ==========================================================================
   Primary Mode Navigation (Automate Product vs Next Step Explorer)
   ========================================================================== */
.main-mode-nav {
    display: flex;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
    background-color: rgba(15, 23, 42, 0.6);
    padding: 0.4rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.mode-nav-btn {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1.25rem;
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
}

.mode-nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
}

.mode-nav-btn.active {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(20, 27, 40, 0.95) 100%);
    border-color: rgba(250, 149, 0, 0.5);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), inset 0 0 12px rgba(250, 149, 0, 0.08);
}

.mode-nav-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
}

.mode-nav-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.mode-nav-title {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #f1f5f9;
}

.mode-nav-btn.active .mode-nav-title {
    color: var(--ficsit-orange);
}

.mode-nav-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Next Step Explorer Workspace
   ========================================================================== */
.next-step-workspace {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.next-step-header-banner {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.95) 100%);
    border: 1px solid var(--border-color);
    border-left: 4px solid #38bdf8;
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.next-step-badge {
    display: inline-block;
    background-color: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #7dd3fc;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 0.4rem;
}

.next-step-heading {
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 0.4rem 0;
}

.next-step-subheading {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

.next-step-controls-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.next-step-inputs-row {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.next-step-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.next-step-field.item-field {
    flex: 2;
    min-width: 280px;
}

.next-step-field.rate-field {
    flex: 1;
    min-width: 200px;
}

.next-step-field-label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--text-muted);
}

.rate-input-box {
    display: flex;
    align-items: center;
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0 0.75rem;
    height: 48px;
    transition: border-color 0.2s;
}

.rate-input-box:focus-within {
    border-color: var(--ficsit-orange);
    box-shadow: 0 0 0 2px rgba(250, 149, 0, 0.2);
}

.next-step-rate-input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    width: 100%;
}

.rate-unit-badge {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    padding-left: 0.5rem;
}

.next-step-quick-chips {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-top: 0.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.next-step-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.filter-pills {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-pill {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-pill:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.filter-pill.active {
    background-color: rgba(250, 149, 0, 0.2);
    border-color: var(--ficsit-orange);
    color: var(--ficsit-orange);
    font-weight: 700;
}

.save-filter-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
}

.save-filter-toggle input {
    cursor: pointer;
    accent-color: var(--ficsit-orange);
}

/* Results Section */
.next-step-summary-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.25rem;
    margin-bottom: 1.25rem;
    font-size: 0.92rem;
    color: #cbd5e1;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.next-step-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 1.25rem;
}

.next-step-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.85) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.next-step-card:hover {
    transform: translateY(-2px);
    border-color: rgba(250, 149, 0, 0.4);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.next-step-card.is-alt {
    border-top: 3px solid #f59e0b;
}

.next-step-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.next-step-product-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.next-step-product-icon {
    width: 44px;
    height: 44px;
    object-fit: contain;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 4px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.next-step-product-titles {
    display: flex;
    flex-direction: column;
}

.next-step-product-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.next-step-recipe-name {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.next-step-header-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
}

.ns-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.02em;
}

.ns-badge.alt {
    background-color: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.5);
    color: #fcd34d;
}

.ns-badge.std {
    background-color: rgba(100, 116, 139, 0.2);
    border: 1px solid rgba(100, 116, 139, 0.4);
    color: #cbd5e1;
}

.ns-badge.locked {
    background-color: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
}

/* IO Section */
.next-step-io-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    background-color: rgba(0, 0, 0, 0.25);
    padding: 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.io-box {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.io-box.full-width {
    grid-column: span 2;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

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

.io-box-val {
    font-size: 0.95rem;
    color: #e2e8f0;
}

.io-box.output .io-box-val {
    color: #86efac;
    font-weight: 700;
}

.io-box.consumption .io-box-val {
    color: #7dd3fc;
    font-weight: 600;
}

.co-ingredients-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.25rem;
}

.co-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #cbd5e1;
}

.co-pill img {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

.co-pill.none {
    background-color: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.3);
    color: #86efac;
}

/* Overclock Module inside card */
.overclock-box {
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.overclock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.oc-machine-stat {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
}

.oc-machine-stat .machine-badge {
    margin: 0;
}

.oc-speed-badge {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.82rem;
    background-color: rgba(250, 149, 0, 0.15);
    color: var(--ficsit-orange);
    padding: 1px 6px;
    border-radius: 3px;
    border: 1px solid rgba(250, 149, 0, 0.3);
}

.oc-shards-badge {
    font-size: 0.76rem;
    font-weight: 600;
    background-color: rgba(168, 85, 247, 0.2);
    border: 1px solid rgba(168, 85, 247, 0.4);
    color: #d8b4fe;
    padding: 2px 7px;
    border-radius: 4px;
}

.oc-shards-badge.zero {
    background-color: rgba(100, 116, 139, 0.15);
    border-color: rgba(100, 116, 139, 0.3);
    color: #94a3b8;
}

.oc-slider-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.oc-slider-tag {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    min-width: 32px;
}

.oc-range-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #334155;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.oc-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--ficsit-orange);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(250, 149, 0, 0.6);
    transition: transform 0.1s;
}

.oc-range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.oc-presets-container {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.oc-preset-btn {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.oc-preset-btn:hover {
    background-color: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(250, 149, 0, 0.4);
}

.oc-preset-btn.active {
    background-color: rgba(250, 149, 0, 0.25);
    border-color: var(--ficsit-orange);
    color: var(--ficsit-orange);
    font-weight: 700;
}

/* ==========================================================================
   BY-PRODUCTS TRACKING & VISUALIZATION
   ========================================================================== */
.byproducts-summary-card {
    border-left: 3px solid #8b5cf6;
}

.machine-badge.byproduct {
    background-color: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    border-color: rgba(139, 92, 246, 0.4);
}

.narrative-chip.byproduct {
    background-color: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.45);
    color: #c4b5fd;
}

.narrative-recycle-pill, .recycle-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.72rem;
    padding: 1px 6px;
    background: rgba(34, 197, 94, 0.18);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #4ade80;
    border-radius: 9999px;
    margin-left: 0.35rem;
    font-weight: 700;
}

.tree-byproduct-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    background-color: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.4);
}

.tree-byproduct-badge .byproduct-pill {
    background-color: #8b5cf6;
    color: #0b0f14;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 2px;
}

/* Closed-Loop Recycling Controls */
.recycle-toggle-wrapper {
    display: inline-flex;
    align-items: center;
    margin-left: 0.5rem;
}

.btn-recycle-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.btn-recycle-toggle.active {
    background: rgba(16, 185, 129, 0.18);
    border: 1px solid #10b981;
    color: #34d399;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
}

.btn-recycle-toggle.active:hover {
    background: rgba(16, 185, 129, 0.28);
    border-color: #34d399;
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.4);
}

.btn-recycle-toggle.inactive {
    background: rgba(100, 116, 139, 0.15);
    border: 1px solid rgba(100, 116, 139, 0.35);
    color: #94a3b8;
}

.btn-recycle-toggle.inactive:hover {
    background: rgba(100, 116, 139, 0.25);
    color: #cbd5e1;
    border-color: rgba(100, 116, 139, 0.5);
}

.recycle-btn-icon {
    font-size: 0.95rem;
}

/* Recycled Graph Edges & Labels */
.edge-path.recycled-edge {
    stroke: #10b981 !important;
    stroke-dasharray: 6 4;
    stroke-width: 2.5px;
    animation: dashFlow 1.2s linear infinite;
}

@keyframes dashFlow {
    from {
        stroke-dashoffset: 20;
    }
    to {
        stroke-dashoffset: 0;
    }
}

.edge-glow.recycled-edge {
    stroke: rgba(16, 185, 129, 0.45) !important;
    stroke-width: 6px;
}

.edge-label-bg.recycled-label-bg {
    fill: #064e3b !important;
    stroke: #10b981 !important;
    stroke-width: 1px;
}

.edge-label-text.recycled-text {
    fill: #a7f3d0 !important;
    font-weight: 700;
}

/* Narrative Callouts & Tips */
.narrative-tip {
    margin-top: 0.65rem;
    padding: 0.6rem 0.85rem;
    background: rgba(16, 185, 129, 0.08);
    border-left: 3px solid #10b981;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #a7f3d0;
    line-height: 1.4;
}

.narrative-tip strong {
    color: #34d399;
}

.savings-chip {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid #10b981;
    color: #34d399;
    padding: 2px 8px;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.75rem;
    margin: 0 3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sink-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    margin-top: 3px;
}

.sink-indicator.fluid {
    background: rgba(56, 189, 248, 0.12);
    color: #7dd3fc;
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.sink-indicator.solid {
    background: rgba(245, 158, 11, 0.12);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.sink-indicator.recycled {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}



