/* ============================================
   PROGRESS INTEL — Premium Styles
   War-Ready Upgrade Command Center
   ============================================ */

/* ===== CSS Variables (Phase 3.1 — SaaS refinement) ===== */
:root {
    --pi-gold: var(--gold-primary);
    --pi-gold-dim: var(--gold-dim);
    --pi-gold-glow: var(--gold-glow);
    --pi-green: var(--green-accent);
    --pi-yellow: var(--gold-light);
    --pi-red: var(--red-slacker);
    --pi-blue: var(--blue-accent);
    --pi-purple: var(--purple-accent);
    --pi-glass: var(--panel-bg);
    --pi-glass-light: var(--panel-bg-light);
    --pi-border: var(--panel-border);
    --pi-text: var(--text-primary);
    --pi-text-dim: var(--text-secondary);
    --pi-text-secondary: var(--text-muted);
    --pi-radius: var(--radius-lg);
}

/* ===== Page Container + Background Overlay ===== */
#progress-view {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 12px 120px 12px;
    position: relative;
}

/* Dark gradient overlay to tame forest background */
#progress-view::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg,
            rgba(0, 0, 0, 0.72) 0%,
            rgba(0, 0, 0, 0.50) 40%,
            rgba(0, 0, 0, 0.60) 70%,
            rgba(0, 0, 0, 0.82) 100%);
    pointer-events: none;
    z-index: 0;
}

#progress-view>* {
    position: relative;
    z-index: 1;
}

/* ===== SEARCH HERO SECTION ===== */
.pi-search-hero {
    text-align: center;
    padding: 32px 16px 24px;
    position: relative;
}

.pi-search-hero h2 {
    font-family: 'ClashBold', 'Impact', sans-serif;
    font-size: 1.6rem;
    color: var(--pi-gold);
    margin-bottom: 4px;
    text-shadow: 0 0 12px rgba(212, 175, 55, 0.15);
}

.pi-search-hero .pi-tagline {
    font-size: 0.8rem;
    color: var(--pi-text-dim);
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.pi-search-bar {
    display: flex;
    gap: 8px;
    max-width: 400px;
    margin: 0 auto 12px;
}

.pi-search-bar input {
    flex: 1;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--pi-border);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--pi-text);
    font-family: 'Inter', sans-serif; font-weight: 500;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.pi-search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-family: inherit;
}

.pi-search-bar input:focus {
    border-color: var(--pi-gold);
    box-shadow: 0 0 12px var(--pi-gold-glow);
}

.pi-scan-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    height: 44px;
    padding: 0 var(--space-lg);
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, var(--gold-light), var(--gold-primary));
    color: #1A1A1A;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.4);
    transition: all var(--duration-fast) var(--ease-out);
    cursor: pointer;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pi-scan-btn:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 12px rgba(234, 179, 8, 0.3), inset 0 1px 0 rgba(255,255,255,0.4);
    transform: translateY(-1px);
}

.pi-scan-btn:active {
    transform: translateY(1px);
    box-shadow: 0 0 0 rgba(0,0,0,0);
}

.pi-scan-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pi-api-notice {
    font-size: 0.7rem;
    color: var(--pi-text-dim);
    margin-top: 8px;
    opacity: 0.7;
}

/* ===== LOADING STATE ===== */
.pi-loading {
    text-align: center;
    padding: 60px 20px;
    display: none;
}

.pi-loading.active {
    display: block;
}

.pi-loading .loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
}

.pi-loading-text {
    font-family: 'Inter', sans-serif; font-weight: 500;
    color: var(--pi-gold);
    font-size: 0.9rem;
}

/* ===== DASHBOARD CONTAINER ===== */
.pi-dashboard {
    display: none;
    animation: piFadeIn 0.5s ease-out;
}

.pi-dashboard.active {
    display: block;
}

@keyframes piFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

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

/* ===== A) PROGRESS SNAPSHOT CARD ===== */
.pi-snapshot {
    background: var(--pi-glass);
    border: 1px solid var(--pi-border);
    border-radius: var(--pi-radius);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-ambient);
}

/* Subtle gold top glow */
.pi-snapshot::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--pi-gold), transparent);
    opacity: 0.35;
}

.pi-snapshot-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.pi-th-badge {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid var(--pi-gold-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.pi-th-badge img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.pi-th-badge .pi-th-level {
    position: absolute;
    bottom: -6px;
    right: -6px;
    background: var(--pi-gold);
    color: #000;
    font-family: 'Inter', sans-serif; font-weight: 500;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: bold;
}

.pi-player-info h3 {
    font-family: 'Inter', sans-serif; font-weight: 500;
    color: var(--pi-text);
    font-size: 1.1rem;
    margin-bottom: 2px;
}

.pi-player-info span {
    font-size: 0.75rem;
    color: var(--pi-text-dim);
}

/* Big progress percentage */
.pi-progress-big {
    text-align: center;
    margin: 16px 0;
}

.pi-progress-big .pi-percent {
    font-family: 'Inter', sans-serif; font-weight: 500;
    font-size: 3.5rem;
    color: var(--pi-gold);
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
    line-height: 1;
}

.pi-progress-big .pi-percent-label {
    font-size: 0.75rem;
    color: var(--pi-text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* War readiness meter */
.pi-readiness {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--pi-glass-light);
    border-radius: 10px;
    margin-top: 16px;
}

.pi-readiness-label {
    font-size: 0.75rem;
    color: var(--pi-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.pi-readiness-bar {
    flex: 1;
    height: 8px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.pi-readiness-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease-out;
    background: linear-gradient(90deg, var(--pi-red), var(--pi-yellow), var(--pi-green));
}

.pi-readiness-score {
    font-family: 'Inter', sans-serif; font-weight: 500;
    font-size: 0.9rem;
    min-width: 36px;
    text-align: right;
}

/* ETA Row */
.pi-eta-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.pi-eta-card {
    flex: 1;
    background: var(--pi-glass-light);
    border-radius: 10px;
    padding: 10px 8px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.pi-eta-card .pi-eta-value {
    font-family: 'Inter', sans-serif; font-weight: 500;
    font-size: 0.85rem;
    color: var(--pi-text);
    margin-bottom: 2px;
}

.pi-eta-card .pi-eta-label {
    font-size: 0.6rem;
    color: var(--pi-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mode indicator badges */
.pi-mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-family: 'Inter', sans-serif; font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pi-mode-badge.auto {
    background: rgba(74, 222, 128, 0.15);
    color: var(--pi-green);
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.pi-mode-badge.manual {
    background: rgba(250, 204, 21, 0.15);
    color: var(--pi-yellow);
    border: 1px solid rgba(250, 204, 21, 0.2);
}

.pi-mode-badge.json {
    background: rgba(96, 165, 250, 0.15);
    color: #60A5FA;
    border: 1px solid rgba(96, 165, 250, 0.25);
}

.pi-mode-hint {
    margin: 5px 0 0;
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    letter-spacing: 0.3px;
}

/* ===== B) TIMER CARDS ===== */
.pi-timers-section {
    margin-bottom: 16px;
}

.pi-section-title {
    font-family: 'Inter', sans-serif; font-weight: 500;
    font-size: 0.85rem;
    color: var(--pi-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-left: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pi-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--pi-border), transparent);
}

.pi-timer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.pi-timer-card {
    background: var(--pi-glass);
    border: 1px solid var(--pi-border);
    border-radius: var(--pi-radius);
    padding: 16px 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
    transition: transform 0.2s, box-shadow 0.2s;
}

.pi-timer-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.pi-timer-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.pi-timer-ring {
    width: 48px;
    height: 48px;
    margin: 0 auto 8px;
    position: relative;
}

.pi-timer-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.pi-timer-ring .ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 4;
}

.pi-timer-ring .ring-fill {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.5s ease-out;
}

.pi-timer-ring .ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Inter', sans-serif; font-weight: 500;
    font-size: 0.6rem;
    color: var(--pi-text);
}

.pi-timer-days {
    font-family: 'Inter', sans-serif; font-weight: 500;
    font-size: 1.1rem;
    color: var(--pi-text);
    margin-bottom: 2px;
}

.pi-timer-label {
    font-size: 0.6rem;
    color: var(--pi-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Extra 2-col for last 2 cards */
.pi-timer-grid .pi-timer-card:nth-child(4),
.pi-timer-grid .pi-timer-card:nth-child(5) {
    grid-column: span 1;
}

/* Bottom row: span 2 cards across 3 cols */
@media (min-width: 360px) {
    .pi-timer-overflow {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-top: 8px;
    }
}

/* ===== C) UPGRADE SUGGESTIONS ===== */
.pi-suggestions-section {
    margin-bottom: 16px;
}

.pi-suggestion-card {
    background: var(--pi-glass);
    border: 1px solid var(--pi-border);
    border-radius: var(--pi-radius);
    padding: 14px 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 14px;
    backdrop-filter: blur(8px);
    transition: all 0.2s;
}

.pi-suggestion-card:hover {
    border-color: var(--pi-gold-glow);
    transform: translateX(4px);
}

.pi-sug-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--pi-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

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

.pi-sug-category {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.pi-sug-category.war {
    color: var(--pi-red);
}

.pi-sug-category.farm {
    color: var(--pi-green);
}

.pi-sug-category.defense {
    color: var(--pi-blue);
}

.pi-sug-category.value {
    color: var(--pi-purple);
}

.pi-sug-name {
    font-family: 'Inter', sans-serif; font-weight: 500;
    font-size: 0.85rem;
    color: var(--pi-text);
    margin-bottom: 4px;
}

.pi-sug-meta {
    display: flex;
    gap: 12px;
    font-size: 0.65rem;
    color: var(--pi-text-dim);
}

.pi-sug-stars {
    display: flex;
    align-items: center;
    gap: 2px;
    color: var(--pi-gold);
    font-size: 0.7rem;
}

.pi-sug-stars .star-filled {
    opacity: 1;
}

.pi-sug-stars .star-empty {
    opacity: 0.25;
}

.pi-sug-arrow {
    color: var(--pi-text-dim);
    font-size: 0.7rem;
    flex-shrink: 0;
    opacity: 0.4;
}

/* ===== D) WAR POWER RATING ===== */
.pi-warpower-section {
    margin-bottom: 16px;
}

.pi-warpower-card {
    background: var(--pi-glass);
    border: 1px solid var(--pi-border);
    border-radius: var(--pi-radius);
    padding: 24px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
}

/* Top gold glow line */
.pi-warpower-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--pi-gold), transparent);
    opacity: 0.5;
}

.pi-warpower-title {
    font-size: 0.7rem;
    color: var(--pi-text-dim);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.pi-warpower-score {
    font-family: 'Inter', sans-serif; font-weight: 500;
    font-size: 3rem;
    color: var(--pi-gold);
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    line-height: 1;
    margin-bottom: 4px;
}

.pi-warpower-max {
    font-size: 0.8rem;
    color: var(--pi-text-dim);
    margin-bottom: 16px;
}

.pi-warpower-breakdown {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.pi-wp-stat {
    background: var(--pi-glass-light);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.pi-wp-stat-label {
    font-size: 0.6rem;
    color: var(--pi-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.pi-wp-stat-value {
    font-family: 'Inter', sans-serif; font-weight: 500;
    font-size: 1.1rem;
}

.pi-wp-offense {
    color: var(--pi-red);
}

.pi-wp-defense {
    color: var(--pi-blue);
}

.pi-wp-heroes {
    color: var(--pi-purple);
}

.pi-wp-utility {
    color: var(--pi-green);
}

/* ===== E) PLANNER (LOCKED V1) ===== */
.pi-planner-section {
    margin-bottom: 16px;
}

.pi-planner-locked {
    background: var(--pi-glass);
    border: 1px solid var(--pi-border);
    border-radius: var(--pi-radius);
    padding: 32px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.pi-planner-locked::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(45deg,
            transparent,
            transparent 10px,
            rgba(255, 255, 255, 0.01) 10px,
            rgba(255, 255, 255, 0.01) 20px);
    pointer-events: none;
}

.pi-lock-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.6;
}

.pi-lock-title {
    font-family: 'Inter', sans-serif; font-weight: 500;
    font-size: 1.1rem;
    color: var(--pi-text);
    margin-bottom: 6px;
}

.pi-lock-subtitle {
    font-size: 0.75rem;
    color: var(--pi-text-dim);
    max-width: 280px;
    margin: 0 auto;
    line-height: 1.4;
}

.pi-lock-teaser {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 20px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.pi-lock-slot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.08);
    opacity: 0.5;
}

.pi-lock-slot-icon {
    font-size: 0.9rem;
}

.pi-lock-slot-text {
    font-size: 0.7rem;
    color: var(--pi-text-dim);
    font-style: italic;
}

/* ===== EXPORT BAR ===== */
.pi-export-bar {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.pi-export-btn {
    background: var(--pi-glass);
    border: 1px solid var(--pi-border);
    border-radius: 10px;
    padding: 8px 14px;
    color: var(--pi-text-dim);
    font-family: 'Inter', sans-serif; font-weight: 500;
    font-size: 0.65rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pi-export-btn:hover {
    color: var(--pi-gold);
    border-color: var(--pi-gold-glow);
    transform: translateY(-1px);
}

/* ===== CATEGORY BREAKDOWN SECTION ===== */
.pi-breakdown-section {
    margin-bottom: 16px;
}

.pi-breakdown-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
}

.pi-breakdown-tabs::-webkit-scrollbar {
    display: none;
}

.pi-breakdown-tab {
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid var(--pi-border);
    background: transparent;
    color: var(--pi-text-dim);
    font-family: 'Inter', sans-serif; font-weight: 500;
    font-size: 0.65rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    text-transform: uppercase;
}

.pi-breakdown-tab.active {
    background: var(--pi-gold);
    color: #000;
    border-color: var(--pi-gold);
}

.pi-breakdown-tab:hover:not(.active) {
    border-color: rgba(255, 215, 0, 0.3);
    color: var(--pi-text);
}

.pi-breakdown-content {
    display: none;
}

.pi-breakdown-content.active {
    display: block;
    animation: piFadeIn 0.3s ease-out;
}

/* Unit grid inside breakdown */
.pi-unit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 8px;
}

.pi-unit-card {
    background: var(--pi-glass);
    border: 1px solid var(--pi-border);
    border-radius: 10px;
    padding: 10px 6px;
    text-align: center;
    transition: all 0.2s;
    position: relative;
}

.pi-unit-card.maxed {
    border-color: rgba(74, 222, 128, 0.3);
}

.pi-unit-card.maxed::after {
    content: '✓';
    position: absolute;
    top: 3px;
    right: 5px;
    font-size: 0.55rem;
    color: var(--pi-green);
    font-weight: bold;
}

.pi-unit-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0 auto 4px;
}

.pi-unit-card .pi-unit-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
    border-radius: 6px;
}

.pi-unit-emoji {
    font-size: 1.4rem;
    line-height: 1;
}

.pi-sug-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
    border-radius: 6px;
}

.pi-unit-card .pi-unit-level {
    font-family: 'Inter', sans-serif; font-weight: 500;
    font-size: 0.75rem;
}

.pi-unit-card .pi-unit-level .pi-current {
    color: var(--pi-text);
}

.pi-unit-card .pi-unit-level .pi-max {
    color: var(--pi-text-dim);
    font-size: 0.6rem;
}

.pi-unit-card .pi-unit-name {
    font-size: 0.55rem;
    color: var(--pi-text-dim);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Level bar under each unit card */
.pi-unit-bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.pi-unit-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.8s ease-out;
}

.pi-unit-bar-fill.green {
    background: var(--pi-green);
}

.pi-unit-bar-fill.yellow {
    background: var(--pi-yellow);
}

.pi-unit-bar-fill.red {
    background: var(--pi-red);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .pi-timer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pi-snapshot-header {
        flex-direction: column;
        text-align: center;
    }

    .pi-warpower-breakdown {
        grid-template-columns: repeat(2, 1fr);
    }

    .pi-search-bar {
        flex-direction: column;
    }

    .pi-scan-btn {
        width: 100%;
    }

    .pi-eta-row {
        flex-direction: column;
    }
}

@media (max-width: 360px) {
    .pi-progress-big .pi-percent {
        font-size: 2.8rem;
    }

    .pi-warpower-score {
        font-size: 2.5rem;
    }

    .pi-unit-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
}

/* ===== ERROR STATE ===== */
.pi-error {
    display: none;
    text-align: center;
    padding: 40px 20px;
}

.pi-error.active {
    display: block;
}

.pi-error-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.6;
}

.pi-error-text {
    font-family: 'Inter', sans-serif; font-weight: 500;
    color: var(--pi-red);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.pi-error-hint {
    font-size: 0.75rem;
    color: var(--pi-text-dim);
}

/* ===== TIMER CARDS (SVG Rings) ===== */
.pi-timer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.pi-timer-card {
    background: var(--pi-glass);
    border: 1px solid var(--pi-border);
    border-radius: var(--pi-radius);
    padding: 16px 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pi-timer-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.1);
}

.pi-timer-ring {
    position: relative;
    width: 72px;
    height: 72px;
}

.pi-timer-ring svg {
    width: 100%;
    height: 100%;
}

.pi-ring-progress {
    transition: stroke-dashoffset 0s;
}

.pi-ring-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif; font-weight: 500;
    font-size: 0.85rem;
    color: var(--pi-text);
}

.pi-timer-info {
    text-align: center;
}

.pi-timer-label {
    font-size: 0.75rem;
    color: var(--pi-text-dim);
    margin-bottom: 4px;
}

.pi-timer-eta {
    font-family: 'Inter', sans-serif; font-weight: 500;
    font-size: 1rem;
    color: var(--pi-gold);
}

.pi-timer-detail {
    font-size: 0.65rem;
    color: var(--pi-text-dim);
    margin-top: 2px;
}

/* ===== UNIT CARDS (Breakdown Grid) ===== */
.pi-unit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    padding: 12px 0;
}

.pi-unit-card {
    background: var(--pi-glass);
    border: 1px solid var(--pi-border);
    border-radius: 12px;
    padding: 10px 8px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pi-unit-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.15);
    border-color: rgba(255, 215, 0, 0.3);
}

.pi-unit-card.pi-unit-maxed {
    border-color: rgba(74, 222, 128, 0.3);
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.08), var(--pi-glass));
}

.pi-unit-img-wrap {
    position: relative;
    width: 52px;
    height: 52px;
    margin: 0 auto 6px;
}

.pi-unit-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.pi-unit-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    font-family: 'Inter', sans-serif; font-weight: 500;
    font-size: 1.2rem;
    color: var(--pi-gold);
}

.pi-maxed-badge {
    position: absolute;
    bottom: -3px;
    right: -3px;
    background: linear-gradient(135deg, #4ADE80, #22C55E);
    color: #000;
    font-size: 0.5rem;
    font-weight: bold;
    padding: 1px 5px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.pi-unit-name {
    font-size: 0.65rem;
    color: var(--pi-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.pi-unit-level {
    font-family: 'Inter', sans-serif; font-weight: 500;
    font-size: 0.7rem;
    color: var(--pi-gold);
    margin-bottom: 4px;
}

.pi-unit-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.pi-unit-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.pi-empty-cat {
    text-align: center;
    padding: 30px;
    color: var(--pi-text-dim);
    font-size: 0.85rem;
    grid-column: 1 / -1;
}

/* ===== SUGGESTION CARDS ===== */
.pi-suggestion-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--pi-glass);
    border: 1px solid var(--pi-border);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: fadeInUp 0.4s ease-out both;
}

.pi-suggestion-card:hover {
    transform: translateX(4px);
    box-shadow: -4px 0 20px rgba(255, 215, 0, 0.1);
}

.pi-urgency-critical {
    border-left: 3px solid var(--pi-red);
}

.pi-urgency-high {
    border-left: 3px solid var(--pi-yellow);
}

.pi-urgency-medium {
    border-left: 3px solid var(--pi-blue);
}

.pi-sugg-rank {
    font-family: 'Inter', sans-serif; font-weight: 500;
    font-size: 1.1rem;
    color: var(--pi-gold);
    min-width: 28px;
}

.pi-sugg-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.pi-sugg-icon span {
    font-size: 1.6rem;
}

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

.pi-sugg-name {
    font-family: 'Inter', sans-serif; font-weight: 500;
    font-size: 0.85rem;
    color: var(--pi-text);
}

.pi-sugg-levels {
    font-size: 0.7rem;
    color: var(--pi-gold);
    margin: 2px 0;
}

.pi-sugg-reason {
    font-size: 0.65rem;
    color: var(--pi-text-dim);
    line-height: 1.3;
}

.pi-sugg-meta {
    text-align: right;
    flex-shrink: 0;
}

.pi-sugg-stars {
    font-size: 0.6rem;
    line-height: 1;
}

.pi-sugg-weight {
    font-size: 0.65rem;
    color: var(--pi-text-dim);
    margin-top: 4px;
}

/* ===== IMPORT BUTTON ===== */
.pi-import-btn {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.2), rgba(96, 165, 250, 0.05)) !important;
    border-color: rgba(96, 165, 250, 0.3) !important;
    color: var(--pi-blue) !important;
}

.pi-import-btn:hover {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.3), rgba(96, 165, 250, 0.1)) !important;
}

/* ===== JSON IMPORT MODAL ===== */
.pi-json-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.pi-json-modal-content {
    background: linear-gradient(135deg, rgba(20, 16, 10, 0.98), rgba(10, 8, 5, 0.98));
    border: 1px solid var(--pi-gold-dim);
    border-radius: 20px;
    padding: 28px 24px;
    max-width: 520px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(255, 215, 0, 0.05);
}

.pi-json-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--pi-text-dim);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
    padding: 4px 8px;
}

.pi-json-modal-close:hover {
    color: var(--pi-red);
}

.pi-json-modal-title {
    font-family: 'Inter', sans-serif; font-weight: 500;
    color: var(--pi-gold);
    font-size: 1.2rem;
    margin-bottom: 6px;
}

.pi-json-modal-hint {
    font-size: 0.75rem;
    color: var(--pi-text-dim);
    margin-bottom: 16px;
}

.pi-json-textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--pi-border);
    border-radius: 12px;
    color: var(--pi-text);
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    padding: 14px;
    resize: vertical;
    min-height: 180px;
    outline: none;
    transition: border-color 0.2s;
}

.pi-json-textarea:focus {
    border-color: var(--pi-gold);
}

.pi-json-error {
    color: var(--pi-red);
    font-size: 0.75rem;
    margin-top: 8px;
    padding: 6px 10px;
    background: rgba(248, 113, 113, 0.1);
    border-radius: 8px;
}

.pi-json-parse-btn {
    margin-top: 14px;
    width: 100%;
}

/* ===== PROGRESS GLOW ===== */
.pi-glow {
    text-shadow: 0 0 30px rgba(74, 222, 128, 0.6), 0 0 60px rgba(74, 222, 128, 0.3) !important;
    color: #4ADE80 !important;
}

/* ===== CONFETTI ===== */
.pi-confetti {
    position: absolute;
    top: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    animation: piConfettiFall 1.8s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
    z-index: 100;
}

@keyframes piConfettiFall {
    0% {
        transform: translateY(-20px) scale(0) rotate(0deg);
        opacity: 1;
    }

    20% {
        transform: translateY(-30px) scale(1) rotate(90deg);
        opacity: 1;
    }

    100% {
        transform: translateY(200px) scale(0.3) rotate(720deg);
        opacity: 0;
    }
}

/* ===== TOAST ===== */
.pi-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(20, 16, 10, 0.95);
    border: 1px solid var(--pi-gold-dim);
    color: var(--pi-gold);
    padding: 10px 20px;
    border-radius: 12px;
    font-family: 'Inter', sans-serif; font-weight: 500;
    font-size: 0.85rem;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

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

/* ===== SCROLL REVEAL ===== */
.pi-reveal-target {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.pi-revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ===== SHAKE ANIMATION ===== */
.pi-shake {
    animation: piShake 0.5s ease-in-out;
}

@keyframes piShake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-8px);
    }

    40% {
        transform: translateX(8px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 480px) {
    .pi-timer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .pi-suggestion-card {
        padding: 10px 8px;
        gap: 8px;
    }

    .pi-sugg-icon img {
        width: 32px;
        height: 32px;
    }

    .pi-json-modal-content {
        padding: 20px 16px;
        max-height: 90vh;
    }
}

/* ============================================================
   PHASE 1 — Upgrade Tracker Styles
   ============================================================ */

/* ===== Section Header with Sort ===== */
.pi-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

/* ===== Sort Dropdown ===== */
.pi-sort-dropdown {
    background: var(--pi-glass);
    color: var(--pi-text);
    border: 1px solid var(--pi-border);
    border-radius: 10px;
    padding: 6px 12px;
    font-size: 0.7rem;
    font-family: 'Inter', sans-serif; font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.pi-sort-dropdown:focus {
    border-color: var(--pi-gold);
    box-shadow: 0 0 8px var(--pi-gold-dim);
}

.pi-sort-dropdown option {
    background: #1a1510;
    color: var(--pi-text);
}

/* ===== Remaining Tabs ===== */
.pi-remaining-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.pi-remaining-tabs::-webkit-scrollbar {
    display: none;
}

.pi-rem-tab {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--pi-border);
    background: var(--pi-glass);
    color: var(--pi-text-dim);
    font-size: 0.65rem;
    font-family: 'Inter', sans-serif; font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.pi-rem-tab:hover {
    border-color: var(--pi-gold);
    color: var(--pi-text);
}

.pi-rem-tab.active {
    background: var(--pi-gold-dim);
    color: var(--pi-gold);
    border-color: var(--pi-gold);
}

.pi-rem-tab-json {
    border-style: dashed;
    opacity: 0.5;
}

.pi-rem-tab-json.active,
.pi-rem-tab-json.available {
    opacity: 1;
    border-style: solid;
}

/* ===== Remaining Upgrade Cards ===== */
.pi-remaining-section {
    margin-bottom: 20px;
}

.pi-remaining-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--pi-gold-dim) transparent;
}

.pi-rem-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--pi-glass);
    border: 1px solid var(--pi-border);
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    cursor: default;
}

.pi-rem-card:hover {
    transform: translateY(-1px);
    border-color: var(--pi-gold);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.08), inset 0 0 30px rgba(255, 215, 0, 0.02);
}

.pi-rem-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.03);
}

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

.pi-rem-name {
    font-size: 0.75rem;
    font-family: 'Inter', sans-serif; font-weight: 500;
    color: var(--pi-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pi-rem-levels {
    font-size: 0.65rem;
    color: var(--pi-text-dim);
    margin-top: 2px;
}

.pi-rem-levels span {
    color: var(--pi-gold);
    font-family: 'Inter', sans-serif; font-weight: 500;
}

.pi-rem-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    flex-shrink: 0;
}

.pi-rem-time {
    font-size: 0.65rem;
    color: var(--pi-blue);
    font-family: 'Inter', sans-serif; font-weight: 500;
}

.pi-rem-war {
    font-size: 0.55rem;
    padding: 2px 6px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif; font-weight: 500;
}

.pi-rem-war.high {
    background: rgba(74, 222, 128, 0.15);
    color: var(--pi-green);
}

.pi-rem-war.medium {
    background: rgba(250, 204, 21, 0.15);
    color: var(--pi-yellow);
}

.pi-rem-war.low {
    background: rgba(248, 113, 113, 0.15);
    color: var(--pi-red);
}

.pi-remaining-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--pi-gold);
    font-family: 'Inter', sans-serif; font-weight: 500;
    font-size: 0.85rem;
}

/* ===== Timeline Sections ===== */
.pi-timeline-section {
    margin-bottom: 20px;
}

.pi-timeline-subtitle {
    font-size: 0.6rem;
    color: var(--pi-text-dim);
    margin: -4px 0 12px 0;
    font-style: italic;
}

/* Builder Lanes */
.pi-builder-lanes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pi-builder-lane {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--pi-glass);
    border: 1px solid var(--pi-border);
    border-radius: 12px;
    overflow-x: auto;
    scrollbar-width: none;
}

.pi-builder-lane::-webkit-scrollbar {
    display: none;
}

.pi-lane-label {
    flex-shrink: 0;
    font-size: 0.6rem;
    color: var(--pi-text-dim);
    font-family: 'Inter', sans-serif; font-weight: 500;
    min-width: 50px;
}

.pi-lane-slots {
    display: flex;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.pi-lane-slot {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: rgba(255, 215, 0, 0.06);
    border: 1px solid rgba(255, 215, 0, 0.1);
    border-radius: 8px;
    flex-shrink: 0;
    transition: background 0.2s;
}

.pi-lane-slot:hover {
    background: rgba(255, 215, 0, 0.12);
}

.pi-lane-slot-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    object-fit: contain;
}

.pi-lane-slot-name {
    font-size: 0.6rem;
    color: var(--pi-text);
    font-family: 'Inter', sans-serif; font-weight: 500;
    white-space: nowrap;
}

.pi-lane-slot-time {
    font-size: 0.55rem;
    color: var(--pi-blue);
    white-space: nowrap;
}

.pi-lane-empty {
    font-size: 0.6rem;
    color: var(--pi-text-dim);
    font-style: italic;
    padding: 4px 0;
}

/* Lab Lane */
.pi-lab-lane {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--pi-gold-dim) transparent;
}

.pi-lab-slot {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 12px;
    background: var(--pi-glass);
    border: 1px solid var(--pi-border);
    border-radius: 12px;
    min-width: 80px;
    transition: transform 0.2s, border-color 0.2s;
}

.pi-lab-slot:hover {
    transform: translateY(-2px);
    border-color: var(--pi-blue);
}

.pi-lab-slot-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: contain;
}

.pi-lab-slot-name {
    font-size: 0.6rem;
    color: var(--pi-text);
    font-family: 'Inter', sans-serif; font-weight: 500;
    text-align: center;
    white-space: nowrap;
}

.pi-lab-slot-time {
    font-size: 0.55rem;
    color: var(--pi-blue);
}

.pi-lab-slot-war {
    font-size: 0.5rem;
    padding: 1px 5px;
    border-radius: 6px;
    background: rgba(74, 222, 128, 0.1);
    color: var(--pi-green);
}

/* ===== ETA Bar ===== */
.pi-eta-bar {
    margin-top: 20px;
    background: linear-gradient(135deg, rgba(15, 12, 8, 0.97), rgba(30, 25, 15, 0.97));
    border: 1px solid var(--pi-gold);
    border-radius: var(--pi-radius);
    padding: 16px;
    box-shadow: 0 4px 30px rgba(255, 215, 0, 0.08);
}

.pi-eta-bar-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 12px;
}

.pi-eta-bar-item {
    text-align: center;
    flex: 1;
}

.pi-eta-bar-value {
    font-size: 1.1rem;
    font-family: 'Inter', sans-serif; font-weight: 500;
    color: var(--pi-gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.pi-eta-bar-label {
    font-size: 0.65rem;
    color: var(--pi-text);
    margin-top: 4px;
    font-family: 'Inter', sans-serif; font-weight: 500;
}

.pi-eta-bar-sub {
    font-size: 0.55rem;
    color: var(--pi-text-dim);
    margin-top: 2px;
}

.pi-eta-bar-divider {
    width: 1px;
    height: 50px;
    background: var(--pi-border);
    flex-shrink: 0;
}

.pi-eta-confidence {
    text-align: center;
    font-size: 0.6rem;
    color: var(--pi-text-dim);
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--pi-border);
    font-style: italic;
}

.pi-eta-confidence.high {
    color: var(--pi-green);
}

/* ===== Mode Banner ===== */
.pi-mode-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(96, 165, 250, 0.08);
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 12px;
    margin-bottom: 16px;
}

.pi-mode-banner.json {
    background: rgba(74, 222, 128, 0.08);
    border-color: rgba(74, 222, 128, 0.2);
}

.pi-mode-banner-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.pi-mode-banner-text {
    font-size: 0.65rem;
    color: var(--pi-text-dim);
    line-height: 1.4;
}

/* ===== Reveal Animation (IntersectionObserver) ===== */
.pi-reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.pi-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Mobile Responsive for Phase 1 ===== */
@media (max-width: 600px) {
    .pi-section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .pi-sort-dropdown {
        width: 100%;
    }

    .pi-remaining-grid {
        max-height: 350px;
    }

    .pi-rem-card {
        padding: 8px 10px;
        gap: 8px;
    }

    .pi-rem-icon {
        width: 30px;
        height: 30px;
    }

    .pi-rem-name {
        font-size: 0.7rem;
    }

    .pi-eta-bar-inner {
        flex-direction: column;
        gap: 16px;
    }

    .pi-eta-bar-divider {
        width: 60%;
        height: 1px;
    }

    .pi-eta-bar-value {
        font-size: 1rem;
    }

    .pi-lane-slot-name {
        font-size: 0.55rem;
    }

    .pi-lane-slot-icon {
        width: 20px;
        height: 20px;
    }

    .pi-lab-slot {
        min-width: 70px;
        padding: 8px;
    }

    .pi-lab-slot-icon {
        width: 28px;
        height: 28px;
    }

    .pi-section-nav {
        flex-direction: column;
        gap: 8px;
    }

    .pi-section-nav-pills {
        padding-bottom: 6px;
    }

    .pi-mode-toggle {
        align-self: flex-end;
    }

    .pi-remaining-search {
        font-size: 0.7rem;
    }
}

/* ═══════════════════════════════════════════ */
/* Phase 1 Expansion — Section Nav + Mode     */
/* ═══════════════════════════════════════════ */

/* --- Pro-Only Visibility --- */
.pi-pro-only {
    display: none !important;
}

.pi-pro-only.pi-show {
    display: block !important;
}

.pi-section-nav-pills.pi-pro-only.pi-show {
    display: flex !important;
}

.pi-pro-pill {
    display: none;
}

.pi-pro-pill.pi-show {
    display: inline-flex;
}

/* --- Section Nav --- */
.pi-section-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    border-bottom: 1px solid var(--pi-border);
    margin-bottom: 16px;
}

.pi-section-nav-pills {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1;
    min-width: 0;
}

.pi-section-nav-pills::-webkit-scrollbar {
    display: none;
}

.pi-nav-pill {
    flex-shrink: 0;
    background: rgba(255, 215, 0, 0.06);
    border: 1px solid rgba(255, 215, 0, 0.15);
    color: var(--pi-text-dim);
    font-size: 0.6rem;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
}

.pi-nav-pill:hover {
    background: rgba(255, 215, 0, 0.12);
    color: var(--pi-gold);
}

.pi-nav-pill.active {
    background: rgba(255, 215, 0, 0.18);
    border-color: var(--pi-gold);
    color: var(--pi-gold);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.15);
}

/* --- Mode Toggle --- */
.pi-mode-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--pi-border);
    border-radius: 20px;
    overflow: hidden;
    flex-shrink: 0;
}

.pi-mode-btn {
    background: none;
    border: none;
    color: var(--pi-text-dim);
    font-size: 0.6rem;
    font-weight: 600;
    padding: 5px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.pi-mode-btn:hover {
    color: #fff;
}

.pi-mode-btn.active {
    background: var(--pi-gold);
    color: #000;
    border-radius: 20px;
}

/* --- Mode Hint --- */
.pi-mode-hint {
    width: 100%;
    text-align: center;
    font-size: 0.55rem;
    color: var(--pi-text-dim);
    margin-top: 4px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.pi-mode-hint strong {
    color: var(--pi-gold);
}

.pi-mode-hint.pi-hidden {
    display: none;
}

/* --- Search Input --- */
.pi-remaining-search-wrap {
    margin-bottom: 10px;
}

.pi-remaining-search {
    width: 100%;
    padding: 8px 14px;
    border: 1px solid var(--pi-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--pi-text);
    font-size: 0.75rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.pi-remaining-search:focus {
    border-color: var(--pi-gold);
    background: rgba(255, 215, 0, 0.04);
}

.pi-remaining-search::placeholder {
    color: var(--pi-text-dim);
}

/* --- Load More Button --- */
.pi-load-more {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 10px;
    color: var(--pi-gold);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.pi-load-more:hover {
    background: rgba(255, 215, 0, 0.15);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.1);
}

/* =============================================
   PHASE 1 — CORE FEATURE STYLES
   ============================================= */

/* --- TH Completion Meter --- */
.pi-th-completion {
    margin-top: 16px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(15, 12, 8, 0.95), rgba(30, 25, 15, 0.95));
    border: 1px solid var(--pi-border);
    border-radius: var(--pi-radius);
}

.pi-completion-body {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-top: 12px;
}

.pi-completion-ring-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.pi-completion-ring {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(var(--pi-gold) 0%,
            var(--pi-gold) var(--pct, 0%),
            rgba(255, 255, 255, 0.06) var(--pct, 0%),
            rgba(255, 255, 255, 0.06) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.pi-completion-ring::after {
    content: '';
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: rgba(15, 12, 8, 0.98);
    position: absolute;
}

.pi-completion-pct {
    position: relative;
    z-index: 1;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--pi-gold);
    font-family: 'Supercell-Magic', 'Bungee', sans-serif;
}

.pi-completion-sub {
    font-size: 0.65rem;
    color: var(--pi-text-dim);
    text-align: center;
}

.pi-completion-stats {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pi-completion-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.pi-cs-label {
    font-size: 0.65rem;
    color: var(--pi-text-dim);
}

.pi-cs-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--pi-text);
}

.pi-completion-badge {
    font-size: 0.6rem;
    padding: 4px 10px;
    border-radius: 20px;
    text-align: center;
    font-weight: 600;
}

.pi-completion-badge.accurate {
    background: rgba(76, 175, 80, 0.12);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #4CAF50;
}

.pi-completion-badge.partial {
    background: rgba(255, 193, 7, 0.12);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: #FFC107;
}

/* --- Progress Timeline Bar --- */
.pi-progress-timeline {
    margin-top: 16px;
    padding: 20px 28px 28px 20px;
    background: linear-gradient(135deg, rgba(15, 12, 8, 0.95), rgba(30, 25, 15, 0.95));
    border: 1px solid var(--pi-border);
    border-radius: var(--pi-radius);
    overflow: visible;
}

.pi-timeline-track {
    position: relative;
    height: 18px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    margin: 16px 0 8px;
    overflow: visible;
}

.pi-timeline-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, #665500, var(--pi-gold));
    transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.25);
}

.pi-timeline-marker {
    position: absolute;
    top: -4px;
    width: 2px;
    height: 26px;
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-1px);
}

.pi-timeline-marker::after {
    content: attr(data-label);
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.5rem;
    color: var(--pi-text-dim);
    white-space: nowrap;
}

.pi-timeline-current {
    position: absolute;
    top: -10px;
    transform: translateX(-50%);
    z-index: 2;
    transition: left 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.pi-timeline-current-label {
    display: block;
    background: var(--pi-gold);
    color: #000;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    animation: pi-pulse-badge 2s ease-in-out infinite;
}

@keyframes pi-pulse-badge {

    0%,
    100% {
        box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    }

    50% {
        box-shadow: 0 2px 16px rgba(255, 215, 0, 0.6);
    }
}

.pi-timeline-endpoints {
    display: flex;
    justify-content: space-between;
    font-size: 0.55rem;
    color: var(--pi-text-dim);
    margin-top: 12px;
}

/* --- Filter Chips --- */
.pi-remaining-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.pi-filter-chip {
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--pi-text-dim);
    font-size: 0.6rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.pi-filter-chip:hover {
    background: rgba(255, 215, 0, 0.08);
    border-color: rgba(255, 215, 0, 0.2);
}

.pi-filter-chip.active {
    background: rgba(255, 215, 0, 0.15);
    border-color: var(--pi-gold);
    color: var(--pi-gold);
}

/* --- Upgrade Card Cost & Priority --- */
.pi-rem-cost {
    font-size: 0.55rem;
    color: var(--pi-text-dim);
    opacity: 0.7;
    margin-top: 1px;
}

.pi-rem-priority {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 0.5rem;
    font-weight: 700;
    margin-top: 3px;
}

.pi-rem-priority.high {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.pi-rem-priority.medium {
    background: rgba(255, 193, 7, 0.2);
    color: #FFC107;
}

.pi-rem-priority.low {
    background: rgba(255, 255, 255, 0.08);
    color: var(--pi-text-dim);
}

/* --- ETA Accuracy Tooltip --- */
.pi-eta-tooltip-trigger {
    position: relative;
    cursor: help;
    color: var(--pi-text-dim);
    font-size: 0.7rem;
    margin-left: 4px;
}

.pi-eta-tooltip {
    display: none;
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    width: 240px;
    padding: 10px 12px;
    background: rgba(30, 25, 15, 0.98);
    border: 1px solid var(--pi-gold);
    border-radius: 10px;
    font-size: 0.58rem;
    color: var(--pi-text);
    line-height: 1.5;
    z-index: 60;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    text-align: left;
}

.pi-eta-tooltip-trigger:hover .pi-eta-tooltip,
.pi-eta-tooltip-trigger:focus .pi-eta-tooltip {
    display: block;
}

/* --- Minimal Mode --- */
.pi-minimal-hide {
    display: none !important;
}

/* --- Mobile Responsive (new features) --- */
@media (max-width: 600px) {
    .pi-completion-body {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .pi-completion-ring {
        width: 100px;
        height: 100px;
    }

    .pi-completion-ring::after {
        width: 74px;
        height: 74px;
    }

    .pi-completion-pct {
        font-size: 1.3rem;
    }

    .pi-timeline-marker::after {
        font-size: 0.45rem;
    }

    .pi-remaining-filters {
        gap: 6px;
    }

    .pi-eta-tooltip {
        width: 200px;
        left: auto;
        right: -20px;
        transform: none;
    }
}


/* ═══════════════════════════════════════════════════
   PHASE 3.1 — PREMIUM TAB SYSTEM
   ═══════════════════════════════════════════════════ */

/* ── Tab Bar ── */
.pi-tab-bar {
    display: flex;
    gap: 0;
    padding: 0;
    margin: 0 0 20px;
    background: rgba(12, 10, 8, 0.75);
    border: 1px solid var(--pi-border);
    border-radius: 12px;
    backdrop-filter: blur(12px);
    position: sticky;
    top: 60px;
    z-index: 50;
    overflow: hidden;
}

.pi-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 14px;
    border: none;
    background: transparent;
    color: var(--pi-text-dim);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    letter-spacing: 0.3px;
    position: relative;
}

.pi-tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--pi-gold);
    border-radius: 2px 2px 0 0;
    opacity: 0;
    transform: scaleX(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pi-tab-btn:hover {
    color: var(--pi-text);
    background: rgba(255, 255, 255, 0.03);
}

.pi-tab-btn.active {
    color: var(--pi-gold);
    font-weight: 600;
    background: rgba(212, 175, 55, 0.06);
}

.pi-tab-btn.active::after {
    opacity: 1;
    transform: scaleX(1);
}

.pi-tab-icon {
    font-size: 0.95rem;
}

.pi-tab-label {
    font-size: 0.82rem;
}

/* ── Tab Content Panels ── */
.pi-tab-content {
    display: none;
    animation: piTabFadeIn 0.28s ease-out;
}

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

@keyframes piTabFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

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


/* ═══════════════════════════════════════════════════
   TODAY'S BEST UPGRADE CARD
   ═══════════════════════════════════════════════════ */

.pi-best-upgrade {
    margin-bottom: 16px;
}

.pi-best-upgrade-card {
    position: relative;
    background: var(--pi-glass);
    border: 1px solid var(--pi-border);
    border-radius: var(--pi-radius);
    padding: 20px;
    overflow: hidden;
}

.pi-best-upgrade-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #FF6B35, #FFD700, #4ADE80);
    border-radius: var(--pi-radius) var(--pi-radius) 0 0;
}

.pi-best-upgrade-empty {
    text-align: center;
    color: var(--pi-text-dim);
    padding: 12px;
    font-size: 0.85rem;
}

.pi-best-upgrade-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pi-best-upgrade-img {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px;
    flex-shrink: 0;
}

.pi-best-upgrade-info {
    flex: 1;
    min-width: 0;
}

.pi-best-upgrade-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--pi-text);
    margin-bottom: 2px;
}

.pi-best-upgrade-meta {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--pi-text-dim);
    margin-bottom: 6px;
}

.pi-best-upgrade-reason {
    font-size: 0.78rem;
    color: var(--pi-green);
    font-weight: 500;
}

.pi-best-upgrade-add-btn {
    flex-shrink: 0;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--pi-gold), #FFA500);
    color: #1a1a1a;
    border: none;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.pi-best-upgrade-add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(255, 215, 0, 0.3);
}


/* ═══════════════════════════════════════════════════
   REMAINING PREVIEW (OVERVIEW TAB)
   ═══════════════════════════════════════════════════ */

.pi-remaining-preview {
    margin-bottom: 16px;
}

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

.pi-view-all-btn {
    background: none;
    border: 1px solid rgba(255, 215, 0, 0.2);
    color: var(--pi-gold);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pi-view-all-btn:hover {
    background: rgba(255, 215, 0, 0.08);
    border-color: rgba(255, 215, 0, 0.35);
}

.pi-remaining-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}


/* ═══════════════════════════════════════════════════
   PLANNER V2 — GUEST LOCK + CONTROLS + LANES
   ═══════════════════════════════════════════════════ */

/* Guest Lock Overlay */
.pi-planner-lock {
    display: none;
    position: relative;
    margin-bottom: 20px;
}

.pi-planner-lock.visible {
    display: block;
}

.pi-planner-lock-inner {
    text-align: center;
    padding: 48px 24px;
    background: rgba(15, 12, 8, 0.9);
    border: 1px solid rgba(255, 215, 0, 0.12);
    border-radius: var(--pi-radius);
    backdrop-filter: blur(16px);
}

.pi-planner-lock-icon {
    font-size: 2.4rem;
    margin-bottom: 12px;
}

.pi-planner-lock-inner h3 {
    font-size: 1.1rem;
    color: var(--pi-text);
    margin-bottom: 8px;
    font-weight: 700;
}

.pi-planner-lock-inner p {
    font-size: 0.85rem;
    color: var(--pi-text-dim);
    margin-bottom: 20px;
    line-height: 1.5;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.pi-planner-lock-btn {
    padding: 10px 28px;
    background: linear-gradient(135deg, var(--pi-gold), #FFA500);
    color: #1a1a1a;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pi-planner-lock-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 18px rgba(255, 215, 0, 0.3);
}

/* Planner V3 — Split Builder/Lab Layout */
.pi-planner-v3 {
    margin-top: 20px;
}

.pi-planner-split {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.pi-planner-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pi-planner-col-builders {
    flex: 3;
    /* 60% */
}

.pi-planner-col-lab {
    flex: 2;
    /* 40% */
}

.pi-planner-col-header {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--pi-text);
    padding: 8px 12px;
    background: var(--pi-glass);
    border: 1px solid var(--pi-border);
    border-radius: var(--pi-radius);
    display: flex;
    align-items: center;
    gap: 6px;
}

.pi-planner-col-builders .pi-planner-col-header {
    border-left: 3px solid var(--pi-gold);
}

.pi-planner-col-lab .pi-planner-col-header {
    border-left: 3px solid var(--pi-cyan, #22d3ee);
}

/* Resource Badges */
.pi-resource-badge {
    display: inline-block;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 1px 5px;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 4px;
}

.pi-resource-badge.builder {
    background: rgba(255, 215, 0, 0.12);
    color: var(--pi-gold);
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.pi-resource-badge.lab {
    background: rgba(34, 211, 238, 0.12);
    color: var(--pi-cyan, #22d3ee);
    border: 1px solid rgba(34, 211, 238, 0.2);
}

/* Planner Summary Grid */
.pi-planner-summary-grid {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* ══════════ Power Optimizer ══════════ */
.pi-power-optimizer {
    margin-top: 20px;
    background: var(--pi-glass);
    border: 1px solid var(--pi-border);
    border-radius: var(--pi-radius);
    padding: 16px;
    position: relative;
    overflow: hidden;
}

.pi-power-optimizer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--pi-gold), rgba(255, 215, 0, 0.2), var(--pi-gold));
}

.pi-power-optimizer-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.pi-power-optimizer-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--pi-gold);
}

.pi-power-optimizer-subtitle {
    font-size: 0.72rem;
    color: var(--pi-text-dim);
}

.pi-power-score-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 14px;
}

.pi-power-score {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--pi-text);
    background: linear-gradient(135deg, var(--pi-gold), #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pi-power-score-label {
    font-size: 0.72rem;
    color: var(--pi-text-dim);
}

.pi-equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.pi-equipment-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.pi-equipment-card:hover {
    border-color: rgba(255, 215, 0, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.pi-equipment-card-img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: contain;
}

.pi-equipment-card-info {
    flex: 1;
    min-width: 0;
}

.pi-equipment-card-name {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--pi-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pi-equipment-card-level {
    font-size: 0.64rem;
    color: var(--pi-text-dim);
}

.pi-equipment-card.maxed {
    opacity: 0.5;
}

.pi-power-delta {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 4px;
}

.pi-power-delta.up {
    background: rgba(74, 222, 128, 0.15);
    color: var(--pi-green);
}

.pi-power-delta.down {
    background: rgba(248, 113, 113, 0.15);
    color: var(--pi-red);
}

/* ══════════ Responsive: Stack on mobile ══════════ */
@media (max-width: 768px) {
    .pi-planner-split {
        flex-direction: column;
    }

    .pi-planner-col-builders,
    .pi-planner-col-lab {
        flex: 1;
    }

    .pi-equipment-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

.pi-planner-subtitle {
    font-size: 0.82rem;
    color: var(--pi-text-dim);
    margin: 4px 0 16px;
}

.pi-planner-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.pi-planner-autofill-btn,
.pi-planner-clear-btn {
    padding: 8px 18px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.pi-planner-autofill-btn {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.2), rgba(74, 222, 128, 0.08));
    color: var(--pi-green);
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.pi-planner-autofill-btn:hover {
    background: rgba(74, 222, 128, 0.18);
}

.pi-planner-clear-btn {
    background: rgba(248, 113, 113, 0.1);
    color: var(--pi-red);
    border: 1px solid rgba(248, 113, 113, 0.15);
}

.pi-planner-clear-btn:hover {
    background: rgba(248, 113, 113, 0.18);
}

/* Planner Lanes Container */
.pi-planner-lanes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.pi-planner-lane {
    background: var(--pi-glass);
    border: 1px solid var(--pi-border);
    border-radius: 12px;
    padding: 12px;
    min-height: 64px;
    transition: border-color 0.2s ease;
}

.pi-planner-lane.drag-over {
    border-color: var(--pi-gold);
    background: rgba(255, 215, 0, 0.04);
}

.pi-planner-lane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.pi-planner-lane-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--pi-text-dim);
}

.pi-planner-lane-status {
    font-size: 0.72rem;
    color: var(--pi-text-dim);
    opacity: 0.7;
}

.pi-planner-lane-slots {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pi-planner-slot {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    font-size: 0.78rem;
    color: var(--pi-text);
    cursor: grab;
    transition: all 0.2s ease;
}

.pi-planner-slot:hover {
    border-color: rgba(255, 215, 0, 0.2);
    background: rgba(255, 255, 255, 0.06);
}

.pi-planner-slot.dragging {
    opacity: 0.4;
}

.pi-planner-slot-img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: contain;
}

.pi-planner-slot-info {
    flex: 1;
    min-width: 0;
}

.pi-planner-slot-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pi-planner-slot-dates {
    font-size: 0.68rem;
    color: var(--pi-text-dim);
}

.pi-planner-slot-idle {
    font-size: 0.65rem;
    color: var(--pi-yellow);
    font-weight: 500;
}

.pi-planner-slot-remove {
    background: none;
    border: none;
    color: var(--pi-red);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 2px 4px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.pi-planner-slot-remove:hover {
    opacity: 1;
}

/* Planner Summary */
.pi-planner-summary {
    background: var(--pi-glass);
    border: 1px solid var(--pi-border);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.pi-planner-summary-item {
    flex: 1;
    min-width: 100px;
    text-align: center;
}

.pi-planner-summary-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--pi-gold);
}

.pi-planner-summary-label {
    font-size: 0.72rem;
    color: var(--pi-text-dim);
    margin-top: 2px;
}

/* Planner Lanes Container */
.pi-planner-lane {
    background: var(--pi-glass);
    border: 1px solid var(--pi-border);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.pi-planner-lane.drag-over {
    border-color: var(--pi-gold);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.15);
}

.pi-planner-lane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.pi-planner-lane-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--pi-text);
}

.pi-planner-lane-status {
    font-size: 0.7rem;
    color: var(--pi-text-dim);
}

.pi-planner-lane-slots {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pi-planner-slot-img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: contain;
    flex-shrink: 0;
}

.pi-planner-slot.dragging {
    opacity: 0.4;
}

.pi-planner-slot[draggable="true"] {
    cursor: grab;
}

.pi-planner-slot[draggable="true"]:active {
    cursor: grabbing;
}

/* ═══════════════════════════════════════════════════
   PHASE 3.1 — ACCORDION SYSTEM
   ═══════════════════════════════════════════════════ */
.pi-accordion {
    margin-bottom: 12px;
    border: 1px solid var(--pi-border);
    border-radius: var(--pi-radius);
    overflow: hidden;
    background: var(--pi-glass);
}

.pi-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    transition: background 0.2s;
    user-select: none;
}

.pi-accordion-header:hover {
    background: rgba(255, 255, 255, 0.04);
}

.pi-accordion-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--pi-text);
}

.pi-accordion-meta {
    font-size: 0.72rem;
    color: var(--pi-text-dim);
    margin-left: 8px;
}

.pi-accordion-chevron {
    font-size: 0.7rem;
    color: var(--pi-text-dim);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pi-accordion.open .pi-accordion-chevron {
    transform: rotate(180deg);
}

.pi-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        padding 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 18px;
}

.pi-accordion.open .pi-accordion-body {
    max-height: 2000px;
    padding: 0 18px 16px;
}

/* ═══════════════════════════════════════════════════
   PHASE 3.1 — PLANNER STICKY ACTIONS BAR
   ═══════════════════════════════════════════════════ */
.pi-planner-sticky-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(12, 10, 8, 0.9);
    border: 1px solid var(--pi-border);
    border-radius: 12px;
    backdrop-filter: blur(12px);
    position: sticky;
    top: 110px;
    z-index: 40;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.pi-planner-action-btn {
    padding: 7px 14px;
    border: 1px solid var(--pi-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--pi-text);
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.pi-planner-action-btn:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.25);
}

.pi-planner-action-btn.danger {
    color: var(--pi-red);
    border-color: rgba(248, 113, 113, 0.15);
}

.pi-planner-action-btn.danger:hover {
    background: rgba(248, 113, 113, 0.1);
}

.pi-planner-save-status {
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--pi-text-dim);
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
}

.pi-planner-save-status.saved {
    color: var(--pi-green);
}

.pi-planner-save-status.saving {
    color: var(--pi-yellow);
}

.pi-planner-save-status.unsaved {
    color: var(--pi-text-dim);
}

.pi-planner-tracker-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 7px 14px;
    border: 1px dashed var(--pi-border);
    border-radius: 8px;
    background: transparent;
    color: var(--pi-text-dim);
    font-size: 0.76rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pi-planner-tracker-link:hover {
    color: var(--pi-gold);
    border-color: rgba(212, 175, 55, 0.25);
}

/* ═══════════════════════════════════════════════════
   PHASE 3.1 — PLAN FINISH DATE CARD
   ═══════════════════════════════════════════════════ */
.pi-plan-finish-card {
    background: var(--pi-glass);
    border: 1px solid var(--pi-border);
    border-radius: var(--pi-radius);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.pi-plan-finish-date {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--pi-gold);
}

.pi-plan-finish-label {
    font-size: 0.74rem;
    color: var(--pi-text-dim);
    margin-top: 2px;
}

.pi-plan-confidence {
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    white-space: nowrap;
}

.pi-plan-confidence.accurate {
    background: rgba(74, 222, 128, 0.1);
    color: var(--pi-green);
    border: 1px solid rgba(74, 222, 128, 0.15);
}

.pi-plan-confidence.partial {
    background: rgba(250, 204, 21, 0.1);
    color: var(--pi-yellow);
    border: 1px solid rgba(250, 204, 21, 0.15);
}

/* ═══════════════════════════════════════════════════
   PHASE 3.1 — AUTH GATED PLANNER (Guest Blur)
   ═══════════════════════════════════════════════════ */
.pi-planner-gated {
    filter: blur(3px);
    pointer-events: none;
    opacity: 0.5;
    user-select: none;
}

/* ═══════════════════════════════════════════════════
   PHASE 3.2 — DRAG STATES
   ═══════════════════════════════════════════════════ */
.pi-planner-slot.dragging {
    opacity: 0.4;
    transform: scale(0.97);
    border: 1px dashed var(--pi-gold);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.15);
}

.pi-planner-lane.drag-over {
    border-color: rgba(212, 175, 55, 0.4);
    background: rgba(212, 175, 55, 0.04);
    box-shadow: inset 0 0 20px rgba(212, 175, 55, 0.06);
}

.pi-rem-card[draggable="true"] {
    cursor: grab;
}

.pi-rem-card[draggable="true"]:active {
    cursor: grabbing;
}

/* ═══════════════════════════════════════════════════
   PHASE 3.2 — MOBILE ACTION MENU
   ═══════════════════════════════════════════════════ */
.pi-mobile-action-wrap {
    display: none;
    margin-top: 4px;
}

@media (max-width: 768px) {
    .pi-mobile-action-wrap {
        display: block;
    }
}

.pi-mobile-action-toggle {
    padding: 4px 10px;
    font-size: 0.7rem;
    border: 1px solid var(--pi-border);
    border-radius: 6px;
    background: rgba(212, 175, 55, 0.06);
    color: var(--pi-gold);
    cursor: pointer;
    transition: all 0.2s;
}

.pi-mobile-action-toggle:hover {
    background: rgba(212, 175, 55, 0.12);
}

.pi-mobile-action-menu {
    display: none;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 0;
}

.pi-mobile-action-menu.open {
    display: flex;
}

.pi-mobile-action-item {
    padding: 5px 10px;
    font-size: 0.7rem;
    border: 1px solid var(--pi-border);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--pi-text-dim);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.pi-mobile-action-item:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.25);
    color: var(--pi-gold);
}

/* ═══════════════════════════════════════════════════
   PHASE 3.2 — TOAST NOTIFICATION
   ═══════════════════════════════════════════════════ */
.pi-planner-toast {
    position: fixed;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 22px;
    border-radius: 10px;
    background: rgba(22, 22, 26, 0.95);
    border: 1px solid var(--pi-gold);
    color: var(--pi-gold);
    font-size: 0.8rem;
    font-weight: 600;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    opacity: 0;
    transition: bottom 0.35s ease, opacity 0.35s ease;
    pointer-events: none;
}

.pi-planner-toast.show {
    bottom: 24px;
    opacity: 1;
}

/* ═══════════════════════════════════════════════════
   PHASE 3.2 — IDLE WARNING
   ═══════════════════════════════════════════════════ */
.pi-idle-warning {
    flex-basis: 100%;
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(250, 204, 21, 0.06);
    border: 1px solid rgba(250, 204, 21, 0.12);
    color: var(--pi-yellow);
    font-size: 0.74rem;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════
   PHASE 3.2 — SAVE STATUS FAILED + RETRY
   ═══════════════════════════════════════════════════ */
.pi-planner-save-status.failed {
    color: var(--pi-red, #f87171);
}

.pi-save-retry {
    cursor: pointer;
    text-decoration: underline;
    font-weight: 600;
    margin-left: 4px;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.pi-save-retry:hover {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════
   PHASE 3.1 — RESPONSIVE (small screens)
   ═══════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .pi-tab-btn {
        padding: 8px 6px;
        font-size: 0.75rem;
    }

    .pi-tab-label {
        font-size: 0.72rem;
    }

    .pi-best-upgrade-content {
        flex-direction: column;
        text-align: center;
    }

    .pi-best-upgrade-meta {
        justify-content: center;
    }

    .pi-remaining-preview-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pi-planner-controls {
        flex-direction: column;
    }

    .pi-planner-slot {
        font-size: 0.72rem;
    }
}


/* ═══════════════════════════════════════════════════
   PHASE 4 — RETENTION PANEL
   ═══════════════════════════════════════════════════ */
.pi-retention-section {
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(212, 175, 55, 0.08);
    border-radius: 14px;
    padding: 20px;
    margin-top: 20px;
}

/* ── Streak Badge ── */
.pi-streak-badge-wrap {
    text-align: center;
    margin-bottom: 20px;
}

.pi-streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #888;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.4s ease;
}

.pi-streak-badge.active {
    background: rgba(212, 175, 55, 0.08);
    border-color: rgba(212, 175, 55, 0.2);
    color: var(--pi-gold);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.1);
}

.pi-streak-flame {
    font-size: 1.4rem;
    display: inline-block;
}

.pi-streak-badge.active .pi-streak-flame {
    animation: pi-flame-pulse 1.5s ease-in-out infinite;
}

.pi-streak-count {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
}

.pi-streak-label {
    font-size: 0.8rem;
    opacity: 0.8;
}

@keyframes pi-flame-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15) rotate(-5deg);
    }
}

/* ── Toggle Switch ── */
.pi-retention-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.pi-retention-row-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--pi-text, #e0e0e0);
}

.pi-retention-icon {
    font-size: 1.1rem;
}

.pi-toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.pi-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.pi-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    transition: all 0.3s ease;
}

.pi-toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #888;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.pi-toggle-switch input:checked+.pi-toggle-slider {
    background: rgba(212, 175, 55, 0.25);
}

.pi-toggle-switch input:checked+.pi-toggle-slider::before {
    transform: translateX(20px);
    background: var(--pi-gold);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

/* ── Simplified Email Toggle Row ── */
.pi-email-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.pi-email-toggle-row:hover {
    border-color: rgba(212, 175, 55, 0.15);
    background: rgba(255, 255, 255, 0.03);
}

.pi-email-toggle-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.pi-email-toggle-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.pi-email-toggle-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.pi-email-toggle-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--pi-text, #e0e0e0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pi-email-toggle-sub {
    font-size: 0.72rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Lock Overlay ── */
.pi-retention-lock {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 13, 18, 0.88);
    backdrop-filter: blur(6px);
    border-radius: 14px;
    z-index: 10;
}

.pi-retention-lock-inner {
    text-align: center;
    color: #888;
}

.pi-retention-lock-inner p {
    margin: 10px 0 16px;
    font-size: 0.85rem;
}

.pi-retention-lock-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, #d4af37, #c5a028);
    color: #0d0d12;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.pi-retention-lock-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .pi-retention-info-grid {
        grid-template-columns: 1fr;
    }

    .pi-retention-time-row {
        flex-direction: column;
        gap: 10px;
    }

    .pi-retention-actions {
        flex-direction: column;
    }
}

/* ═══════════════════════════════════════════════════
   VILLAGE HEALTH (RUSH SCORE) — embedded inside TH Completion
   ═══════════════════════════════════════════════════ */
.pi-rush-inside {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--pi-border);
}

.pi-rush-header-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.pi-rush-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--pi-text);
    letter-spacing: 0.03em;
}

.pi-rush-percent-inline {
    font-family: 'Inter', sans-serif; font-weight: 500;
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
}

.pi-rush-status-inline {
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: auto;
}

.pi-rush-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.pi-rush-bar-label {
    font-size: 0.75rem;
    color: var(--pi-text-dim);
    min-width: 80px;
    white-space: nowrap;
}

.pi-rush-bar-track {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

.pi-rush-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease-out;
}

.pi-rush-bar-value {
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 32px;
    text-align: right;
    color: var(--pi-text);
}

/* ═══════════════════════════════════════════════════
   UPGRADE IMPACT SIMULATOR
   ═══════════════════════════════════════════════════ */
.pi-impact-sim {
    margin-top: 16px;
}

.pi-impact-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pi-impact-card {
    background: var(--pi-glass);
    border: 1px solid var(--pi-border);
    border-radius: var(--pi-radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    animation: piFadeIn 0.4s ease-out both;
}

.pi-impact-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.pi-impact-rank {
    font-family: 'Inter', sans-serif; font-weight: 500;
    font-size: 1.1rem;
    color: var(--pi-gold);
    min-width: 28px;
    text-align: center;
}

.pi-impact-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.pi-impact-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.pi-impact-icon span {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

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

.pi-impact-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--pi-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pi-impact-levels {
    font-size: 0.7rem;
    color: var(--pi-text-dim);
    margin-top: 2px;
}

.pi-impact-delta {
    text-align: center;
    min-width: 60px;
}

.pi-impact-delta-value {
    font-family: 'Inter', sans-serif; font-weight: 500;
    font-size: 1rem;
    color: #4CAF50;
    font-weight: 700;
}

.pi-impact-delta-sub {
    font-size: 0.6rem;
    color: var(--pi-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pi-impact-priority {
    text-align: center;
    min-width: 50px;
    padding: 6px 8px;
    background: rgba(212, 175, 55, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.12);
}

.pi-impact-priority-value {
    font-family: 'Inter', sans-serif; font-weight: 500;
    font-size: 0.9rem;
    color: var(--pi-gold);
    font-weight: 700;
}

.pi-impact-priority-sub {
    font-size: 0.55rem;
    color: var(--pi-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════
   ETA MODE TOGGLE
   ═══════════════════════════════════════════════════ */
.pi-eta-mode-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 4px;
    border: 1px solid var(--pi-border);
}

.pi-eta-mode-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--pi-text-dim);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.pi-eta-mode-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--pi-text);
}

.pi-eta-mode-btn.active {
    background: rgba(212, 175, 55, 0.12);
    color: var(--pi-gold);
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.08);
}

/* ═══════════════════════════════════════════════════
   MOBILE RESPONSIVE FOR NEW CARDS
   ═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .pi-rush-percent-inline {
        font-size: 1.1rem !important;
    }

    .pi-rush-bar-label {
        min-width: 65px !important;
        font-size: 0.65rem !important;
    }

    .pi-impact-card {
        padding: 10px 12px !important;
        gap: 8px !important;
    }

    .pi-impact-icon {
        width: 32px !important;
        height: 32px !important;
    }

    .pi-impact-name {
        font-size: 0.75rem !important;
    }

    .pi-impact-delta-value {
        font-size: 0.85rem !important;
    }

    .pi-impact-priority {
        min-width: 40px !important;
        padding: 4px 6px !important;
    }

    .pi-eta-mode-btn {
        font-size: 0.65rem !important;
        padding: 6px 8px !important;
    }
}

/* ═══════════════════════════════════════════════════
   MAXED STATES & CELEBRATION
   ═══════════════════════════════════════════════════ */
.pi-timer-maxed-card {
    opacity: 0.85;
    border: 1px solid rgba(76, 175, 80, 0.3) !important;
}

.pi-timer-maxed {
    font-size: 0.6rem;
    color: #4CAF50;
    font-weight: 600;
    margin-top: 2px;
}

.pi-maxed-glow {
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.6), 0 0 24px rgba(255, 215, 0, 0.3);
    color: #FFD700 !important;
}

.pi-rush-maxed {
    text-align: center;
    padding: 10px 0 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #FFD700;
    letter-spacing: 0.02em;
}

/* ============================================
   PROGRESS INTEL — COMPREHENSIVE MOBILE OVERHAUL
   Mobile-first for Android/iOS best experience
   ============================================ */

@media (max-width: 768px) {

    /* ── Performance: disable hover on touch ── */
    .pi-timer-card:hover,
    .pi-suggestion-card:hover,
    .pi-unit-card:hover,
    .pi-rem-card:hover,
    .pi-lab-slot:hover,
    .pi-export-btn:hover {
        transform: none !important;
        box-shadow: none !important;
    }

    /* ── Snapshot Card ── */
    .pi-snapshot {
        padding: 18px 14px !important;
    }

    .pi-snapshot-header {
        gap: 12px !important;
    }

    .pi-th-badge {
        width: 52px !important;
        height: 52px !important;
    }

    .pi-th-badge img {
        width: 44px !important;
        height: 44px !important;
    }

    .pi-player-info h3 {
        font-size: 1rem !important;
    }

    .pi-progress-big .pi-percent {
        font-size: 3rem !important;
    }

    .pi-readiness {
        padding: 10px 12px !important;
        gap: 8px !important;
    }

    /* ── ETA Row: wrap on narrow ── */
    .pi-eta-row {
        flex-wrap: wrap !important;
    }

    .pi-eta-card {
        min-width: calc(50% - 6px) !important;
    }

    /* ── Timer Grid: 2-col on phones ── */
    .pi-timer-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    .pi-timer-card {
        padding: 12px 8px !important;
    }

    .pi-timer-ring {
        width: 60px !important;
        height: 60px !important;
    }

    /* ── Unit Grid: compact 4-col ── */
    .pi-unit-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 6px !important;
    }

    .pi-unit-img-wrap {
        width: 40px !important;
        height: 40px !important;
    }

    .pi-unit-name {
        font-size: 0.55rem !important;
    }

    .pi-unit-level {
        font-size: 0.6rem !important;
    }

    /* ── Suggestions: tighter ── */
    .pi-suggestion-card {
        padding: 10px !important;
        gap: 8px !important;
    }

    .pi-sugg-icon img {
        width: 34px !important;
        height: 34px !important;
    }

    .pi-sugg-name {
        font-size: 0.75rem !important;
    }

    .pi-sugg-reason {
        font-size: 0.6rem !important;
    }

    .pi-sugg-rank {
        font-size: 0.95rem !important;
        min-width: 22px !important;
    }

    /* ── War Power card ── */
    .pi-warpower-card {
        padding: 18px 14px !important;
    }

    .pi-warpower-score {
        font-size: 2.5rem !important;
    }

    .pi-warpower-breakdown {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
    }

    .pi-wp-stat {
        padding: 8px !important;
    }

    .pi-wp-stat-value {
        font-size: 0.95rem !important;
    }

    /* ── ETA Bar: stack columns on mobile ── */
    .pi-eta-bar {
        padding: 14px 12px !important;
    }

    .pi-eta-bar-inner {
        flex-direction: column !important;
        gap: 14px !important;
    }

    .pi-eta-bar-divider {
        width: 50% !important;
        height: 1px !important;
        margin: 0 auto !important;
    }

    .pi-eta-bar-value {
        font-size: 1rem !important;
    }

    /* ── Export Bar ── */
    .pi-export-bar {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 6px !important;
    }

    .pi-export-btn {
        padding: 10px 12px !important;
        min-height: 44px !important;
        font-size: 0.6rem !important;
    }

    /* ── Section Nav Pills: scrollable + touch-friendly ── */
    .pi-section-nav {
        gap: 6px !important;
        padding: 10px 0 !important;
    }

    .pi-section-nav-pills {
        width: 100% !important;
        padding-bottom: 4px !important;
    }

    .pi-nav-pill {
        padding: 8px 14px !important;
        font-size: 0.6rem !important;
        min-height: 40px !important;
        display: flex !important;
        align-items: center !important;
    }

    /* ── Mode Toggle: full width on mobile ── */
    .pi-mode-toggle {
        width: 100% !important;
    }

    .pi-mode-btn {
        flex: 1 !important;
        padding: 8px 10px !important;
        min-height: 40px !important;
        font-size: 0.6rem !important;
        text-align: center !important;
    }

    /* ── Breakdown Tabs: scrollable ── */
    .pi-breakdown-tabs {
        padding-bottom: 6px !important;
    }

    .pi-breakdown-tab {
        padding: 8px 12px !important;
        min-height: 40px !important;
        display: flex !important;
        align-items: center !important;
    }

    /* ── Remaining Tabs: scrollable ── */
    .pi-remaining-tabs {
        padding-bottom: 6px !important;
    }

    .pi-rem-tab {
        padding: 8px 12px !important;
        min-height: 40px !important;
    }

    /* ── Remaining Cards: tighter ── */
    .pi-remaining-grid {
        max-height: 350px !important;
    }

    .pi-rem-card {
        padding: 8px 10px !important;
        gap: 8px !important;
    }

    .pi-rem-icon {
        width: 30px !important;
        height: 30px !important;
    }

    .pi-rem-name {
        font-size: 0.7rem !important;
    }

    /* ── Builder Lanes: scrollable ── */
    .pi-builder-lane {
        padding: 6px 8px !important;
    }

    .pi-lane-label {
        font-size: 0.55rem !important;
        min-width: 44px !important;
    }

    .pi-lane-slot {
        padding: 4px 8px !important;
    }

    .pi-lane-slot-icon {
        width: 20px !important;
        height: 20px !important;
    }

    .pi-lane-slot-name {
        font-size: 0.55rem !important;
    }

    /* ── Lab Lane: compact ── */
    .pi-lab-slot {
        min-width: 70px !important;
        padding: 8px !important;
    }

    .pi-lab-slot-icon {
        width: 28px !important;
        height: 28px !important;
    }

    /* ── Planner: tighter padding ── */
    .pi-planner-locked {
        padding: 24px 16px !important;
    }

    .pi-lock-title {
        font-size: 1rem !important;
    }

    .pi-lock-subtitle {
        font-size: 0.7rem !important;
    }

    /* ── JSON Modal: full-screen on mobile ── */
    .pi-json-modal {
        padding: 12px !important;
    }

    .pi-json-modal-content {
        padding: 20px 14px !important;
        max-height: 90vh !important;
        border-radius: 16px !important;
    }

    .pi-json-textarea {
        min-height: 140px !important;
        font-size: 0.65rem !important;
    }

    .pi-json-parse-btn {
        min-height: 48px !important;
    }

    /* ── Mode Banner: compact ── */
    .pi-mode-banner {
        padding: 10px 12px !important;
        gap: 8px !important;
    }

    .pi-mode-banner-text {
        font-size: 0.6rem !important;
    }

    /* ── Section Titles ── */
    .pi-section-title {
        font-size: 0.75rem !important;
    }

    /* ── Search Hero ── */
    .pi-search-hero {
        padding: 20px 12px 16px !important;
    }

    .pi-search-hero h2 {
        font-size: 1.3rem !important;
    }

    .pi-search-bar {
        flex-direction: column !important;
    }

    .pi-scan-btn {
        width: 100% !important;
        min-height: 48px !important;
    }

    /* ── Sort Dropdown: full width ── */
    .pi-sort-dropdown {
        width: 100% !important;
        min-height: 44px !important;
    }

    .pi-section-header {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    /* ── Remaining Search: full width ── */
    .pi-remaining-search {
        width: 100% !important;
        font-size: 0.7rem !important;
    }

    /* ── Toast: above bottom nav ── */
    .pi-toast {
        bottom: 110px !important;
    }

    /* ── Retention Info Grid ── */
    .pi-retention-info-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Extra small (phones < 400px) */
@media (max-width: 400px) {
    .pi-unit-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .pi-timer-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    .pi-progress-big .pi-percent {
        font-size: 2.5rem !important;
    }

    .pi-warpower-score {
        font-size: 2rem !important;
    }

    .pi-eta-card {
        min-width: 100% !important;
    }

    .pi-snapshot-header {
        flex-direction: column !important;
        text-align: center !important;
    }
}
.pi-accordion-meta { font-size: 0.85rem !important; color: var(--text-secondary); white-space: nowrap; }
.pi-status, .cwl-status { white-space: nowrap; }
