/* =========================================
   1. LAYOUT & UTILS
   ========================================= */
.tkr-app-wrapper { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

.tkr-box { 
    background: var(--bg-panel); 
    border: 1px solid var(--border-color); 
    border-radius: var(--radius); 
    padding: 25px; 
    display: flex; flex-direction: column; justify-content: center; 
    position: relative; overflow: visible; 
}

/* CONTROLS */
.tkr-top-controls { position: fixed; top: 20px; right: 20px; z-index: 10000; display: flex; gap: 10px; }
.control-btn { 
    background: var(--bg-panel); border: 1px solid var(--border-color); padding: 10px 15px; 
    border-radius: 50px; cursor: pointer; font-weight: 600; color: var(--text-main); 
    backdrop-filter: blur(10px); transition: all 0.2s; 
}
.control-btn:hover { background: var(--bg-panel-hover); border-color: var(--text-muted); }

/* =========================================
   2. DASHBOARD GRIDS
   ========================================= */
.tkr-grid-input { 
    display: grid; 
    grid-template-columns: 1fr 1fr 2fr; 
    gap: 20px; 
    margin-bottom: 40px; 
}

.tkr-grid-result { 
    display: grid; 
    grid-template-columns: 2fr 1fr; 
    grid-auto-rows: min-content;    
    gap: 20px; 
}

/* INPUTS */
.tkr-input-box label { 
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; 
    color: var(--text-muted); font-weight: 700; margin-bottom: 15px; display: block; 
}

.tkr-input-box input { 
    background: transparent; border: none; border-bottom: 2px solid var(--border-color); 
    color: var(--text-main); font-weight: 800; width: 100%; 
    outline: none; padding-bottom: 5px; font-family: var(--font-main); 
    transition: all 0.2s ease; 
    font-size: clamp(2.5rem, 5vw, 3.5rem); 
}

.tkr-input-box input:focus { 
    border-color: var(--accent-primary); 
    background: var(--bg-input-focus);
    border-radius: 4px 4px 0 0; 
}

#calc-btn { 
    grid-column: 1 / -1; background: var(--accent-primary); border-radius: var(--radius); 
    padding: 25px; cursor: pointer; text-align: center; transition: transform 0.2s; 
    min-height: 80px; display: flex; align-items: center; justify-content: center;
}
#calc-btn:hover { transform: scale(1.01); }
#calc-btn span { color: var(--bg-app); font-size: 1.5rem; font-weight: 800; }

/* =========================================
   3. RESULT COMPONENTS
   ========================================= */

.tkr-panic-bar, #guest-warning-banner { grid-column: 1 / -1; }

.tkr-panic-bar { 
    background: rgba(255, 107, 107, 0.1); 
    border: 1px solid var(--accent-danger); color: var(--accent-danger); 
    padding: 8px; text-align: center; border-radius: 8px; margin-bottom: 5px; 
    font-size: 0.85rem; font-weight: 600; 
}
.panic-dot { animation: blink-red 1s infinite; }

/* DANGER BOX */
.danger-box { 
    grid-column: 1; 
    grid-row: span 3; 
    background: var(--accent-danger); border: none; padding: 35px; 
    color: #0d0d0d !important;
    transform: translateZ(0); will-change: contents; backface-visibility: hidden;
    contain: layout style; min-height: 600px;
    display: flex; flex-direction: column; justify-content: space-between;
}
.danger-box * { color: #0d0d0d !important; }

.danger-banner {
    background: rgba(255, 255, 255, 0.4); border: 2px solid #0d0d0d; border-radius: 12px; 
    padding: 10px; text-align: center; margin-bottom: 25px; box-shadow: 3px 3px 0px rgba(0,0,0,0.1);
}
.danger-banner h3 { font-weight: 800; font-size: 1.1rem; text-transform: uppercase; margin: 0; }

.danger-header-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; align-items: center; margin-bottom: 30px; }
.danger-title-area h1 { font-size: 6rem; line-height: 0.9; font-weight: 900; letter-spacing: -0.05em; }
.danger-title-area span { font-size: 1.3rem; font-weight: 800; display: block; margin-top: 5px; }

.danger-handwritten-stats { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; width: 100%; }
.handwritten-row { font-family: 'Courier New', monospace; font-weight: 800; font-size: 1.8rem; line-height: 1.2; white-space: nowrap; letter-spacing: -1px; display: flex; gap: 10px; align-items: baseline; width: 100%; }
.handwritten-row span { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; display: inline-block; }
.handwritten-row small { font-family: var(--font-main); font-size: 1rem; font-weight: 600; text-transform: lowercase; opacity: 0.8; }
.handwritten-note { font-family: var(--font-main); font-weight: 800; font-size: 0.9rem; margin-top: 15px; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.05em; }

.danger-stats-container { background: rgba(0, 0, 0, 0.08); border-radius: 16px; padding: 20px; }
.stat-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(0, 0, 0, 0.1); }
.stat-label { font-size: 0.9rem; font-weight: 600; opacity: 0.8; }
.stat-value { font-size: 1.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }

.ticker-section { margin-top: 25px; text-align: right; height: 100px; min-height: 100px; max-height: 100px; overflow: hidden; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; }
.ticker-label { display: flex; justify-content: flex-end; align-items: baseline; gap: 10px; margin-bottom: 5px; opacity: 0.8; }
.ticker-hand { font-family: 'Comforter Brush', cursive; font-size: 1.8rem; text-transform: lowercase; }
.ticker-caps { font-size: 0.9rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
.ticker-number { font-family: 'Courier New', monospace; font-size: 2.4rem; font-weight: 800; letter-spacing: -1px; display: block; width: 100%; text-align: right; font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; white-space: nowrap; line-height: 1; }

.info-box { grid-column: 2; padding: 25px; }
.info-box h2 { font-size: 2.5rem; line-height: 1; margin-bottom: 5px; }
.retirement-text { color: var(--text-main); }
.weekend-text { color: var(--accent-primary); }
.coffee-text { color: var(--text-main); }

/* --- LIFE BATTERY (Fixed Colors) --- */
.battery-box-wrapper, .tkr-comparison-box, .tkr-control-bar, .tkr-donation-area, .audit-box { grid-column: 1 / -1; }

.battery-box-wrapper { padding: 40px 30px; margin-top: 10px; }
.battery-header { display: flex; align-items: baseline; gap: 15px; margin-bottom: 60px; }

/* The BIG PERCENTAGE: Lime Green */
.battery-header h2 { font-size: 4rem; margin: 0; color: var(--accent-primary) !important; font-weight: 900; }
.battery-header label { font-size: 0.9rem; color: #fff; text-transform: uppercase; letter-spacing: 1px; }

/* The Track (Remaining Life) -> GREEN */
.battery-timeline-track { 
    position: relative; 
    height: 16px; 
    background-color: var(--accent-primary) !important; 
    border-radius: 10px; 
    width: 100%; 
    margin-bottom: 60px; 
    box-shadow: 0 0 20px rgba(190, 242, 100, 0.2);
    overflow: visible;
}

/* The Fill (Consumed Life) -> RED */
.battery-timeline-fill { 
    height: 100%; 
    background-color: var(--accent-danger) !important; 
    width: 0%; 
    border-radius: 10px 0 0 10px; 
    transition: width 1.5s ease; 
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.5);
    z-index: 2;
    position: relative;
}

.marker-retirement { position: absolute; top: -15px; bottom: -15px; width: 2px; background: #fff; left: 80%; z-index: 10; }
.label-retirement { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%) rotate(-5deg); font-family: 'Comforter Brush', cursive; color: #fff; font-size: 1.6rem; white-space: nowrap; }
.marker-death { position: absolute; top: -15px; bottom: -15px; width: 2px; background: var(--accent-danger); right: 0; z-index: 10; }
.label-death { position: absolute; top: 35px; right: -10px; transform: rotate(-5deg); font-family: 'Comforter Brush', cursive; color: var(--accent-danger); font-size: 1.6rem; white-space: nowrap; }
.battery-description { font-size: 0.85rem; color: var(--text-muted); display: block; text-align: left; border-top: 1px dashed var(--border-color); padding-top: 15px; }

/* --- LEGACY PROTOCOL --- */
.legacy-component {
    margin-top: 30px;
    background: rgba(0,0,0,0.4) !important;
    border: 1px solid #333 !important;
}

#tkr-legacy-input {
    background: #000 !important;
    border: 1px solid #333 !important;
    border-radius: 4px;
    color: var(--accent-primary) !important;
    font-family: 'Courier Prime', monospace;
    font-size: 1.1rem;
    padding: 15px;
    width: 100%;
    outline: none;
    margin-right: 10px;
}
#tkr-legacy-input:focus { border-color: var(--accent-primary) !important; }

#btn-save-legacy {
    background: var(--accent-primary) !important; 
    color: #000 !important; 
    padding: 15px 25px; 
    border-radius: 4px; 
    font-weight: 800; 
    font-size: 0.85rem;
    border: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
}
#btn-save-legacy:hover { transform: scale(1.05); }

/* --- DAILY AUDIT BUTTONS (Browser Fixed) --- */
.audit-actions-group {
    display: flex; 
    gap: 15px; 
    justify-content: center;
    margin-top: 20px;
}

.audit-btn {
    -webkit-appearance: none !important;
    appearance: none !important;
    padding: 15px 30px !important;
    border-radius: 8px !important;
    font-weight: 800 !important;
    font-size: 0.9rem !important;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid #444 !important; 
    background-color: transparent !important;
    color: #888 !important;
    box-shadow: none !important;
}

.audit-btn:hover { transform: translateY(-2px); color: #fff !important; }

.btn-waste:hover { 
    border-color: var(--accent-danger) !important; 
    background-color: rgba(255, 107, 107, 0.1) !important; 
    color: var(--accent-danger) !important;
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.2) !important;
}

.btn-worth:hover { 
    border-color: var(--accent-primary) !important; 
    background-color: rgba(190, 242, 100, 0.1) !important; 
    color: var(--accent-primary) !important;
    box-shadow: 0 0 15px rgba(190, 242, 100, 0.2) !important;
}

/* --- SHARE RECEIPT (Fixed Styling) --- */
.tkr-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); z-index: 99999;
    display: none; align-items: center; justify-content: center;
    backdrop-filter: blur(5px);
}
.tkr-modal-overlay.active { display: flex; }

.tkr-modal-content {
    background: #09090b; border: 1px solid #333;
    padding: 30px; border-radius: 20px; width: 90%; max-width: 400px;
    color: #fff; position: relative;
}

.tkr-receipt {
    background-color: #ffffff !important;
    color: #000000 !important;
    font-family: 'Courier Prime', monospace !important;
    padding: 25px !important;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
    margin: 0 auto 20px auto;
    transform: rotate(-1deg);
    border-radius: 2px;
}

/* Force Contrast */
.tkr-receipt * { color: #000000 !important; font-family: 'Courier Prime', monospace !important; }

.receipt-header { border-bottom: 2px dashed #000; padding-bottom: 10px; margin-bottom: 15px; text-align: center; }
.receipt-header h3 { font-size: 1.5rem; font-weight: 900; margin: 0; text-transform: uppercase; }
.receipt-header small { display: block; font-size: 0.8rem; margin-top: 5px; }

.receipt-row { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 8px; font-weight: 700; }
.receipt-divider { border-bottom: 1px dashed #000; margin: 15px 0; }

.receipt-footer { text-align: center; font-size: 0.7rem; margin-top: 15px; font-weight: 700; text-transform: uppercase; }
.receipt-qr-area { text-align: center; margin-top: 15px; }
.receipt-qr-img { width: 80px; height: 80px; display: block; margin: 0 auto; }

.tkr-share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tkr-share-option {
    background: rgba(255,255,255,0.05); border: 1px solid #333; padding: 15px;
    border-radius: 8px; text-align: center; cursor: pointer; color: #fff;
    font-size: 0.85rem; font-weight: 600;
}
.tkr-share-option:hover { background: rgba(255,255,255,0.1); border-color: #fff; }

.tkr-comparison-box { padding: 20px; background: rgba(255, 255, 255, 0.03); border-left: 4px solid var(--accent-primary); border-radius: 4px; margin: 20px 0; display: flex; align-items: center; }
.tkr-comparison-text { font-size: 1.25rem; font-weight: 700; color: var(--text-main); line-height: 1.4; font-family: var(--font-main); }

.tkr-control-bar { display: flex; justify-content: center; gap: 20px; padding: 20px; }
.tkr-ghost-btn, .tkr-share-btn { padding: 12px 30px; border-radius: 50px; font-weight: 600; cursor: pointer; background: transparent; border: 1px solid var(--border-color); color: var(--text-muted); }
.tkr-share-btn { background: var(--text-main); color: var(--bg-app); border: 1px solid var(--text-main); }

.tkr-donation-area { text-align: center; margin-top: 15px; }
.buy-time-link { display: inline-block; font-size: 1rem; color: var(--accent-danger); border: 1px solid var(--accent-danger); padding: 12px 30px; border-radius: 50px; font-weight: 700; text-decoration: none; backface-visibility: hidden; transform: translateZ(0); }
.buy-time-link:hover { background: var(--accent-danger); color: #000; }
.urgency-pulse { animation: pulse-border 2s infinite; }
@keyframes pulse-border { 0% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(255, 107, 107, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0); } }

.tkr-mood-wrapper { display: flex; justify-content: center; margin-bottom: 20px; }
.tkr-mood-switch { background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 50px; padding: 5px; display: inline-flex; gap: 5px; margin-top: 10px; }
.mood-btn { background: transparent; border: 1px solid transparent; color: #666; padding: 8px 18px; font-weight: 700; font-size: 0.8rem; cursor: pointer; border-radius: 40px; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); opacity: 0.7; }
.mood-btn:hover { color: #fff; opacity: 1; }
.mood-btn[data-mood="pessimist"].active, .mood-btn.active-pessimist { background: #ff6b6b !important; color: #000 !important; border-color: #ff6b6b !important; box-shadow: 0 0 15px rgba(255, 107, 107, 0.4); opacity: 1 !important; transform: scale(1.05); }
.mood-btn[data-mood="realist"].active, .mood-btn.active-realist { background: #ffffff !important; color: #000000 !important; border-color: #ffffff !important; box-shadow: 0 0 15px rgba(255, 255, 255, 0.4); opacity: 1 !important; transform: scale(1.05); }
.mood-btn[data-mood="optimist"].active, .mood-btn.active-optimist { background: #bef264 !important; color: #000000 !important; border-color: #bef264 !important; box-shadow: 0 0 15px rgba(190, 242, 100, 0.4); opacity: 1 !important; transform: scale(1.05); }

/* IDENTITY COMPONENT (Bottom Position) */
#retention-dashboard {
    background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, rgba(0,0,0,0.2) 100%) !important;
    border: 1px solid #333 !important;
    padding: 30px !important;
}
#retention-dashboard h3 {
    font-size: 2rem !important; 
    color: var(--accent-primary) !important;
    margin-bottom: 5px !important;
}

/* HIDDEN TIMER (Logic remains, UI hidden) */
.tkr-session-timer { display: none !important; }

/* RESPONSIVE */
@media (max-width: 1024px) {
    .tkr-grid-input { grid-template-columns: 1fr !important; gap: 15px; }
    .tkr-grid-input .tkr-box, #calc-btn, .tkr-hero { grid-column: 1 / -1 !important; width: 100%; text-align: center; }
    .tkr-input-box input { text-align: center; }
    .tkr-grid-result { grid-template-columns: 1fr !important; }
    .danger-box, .info-box, .battery-box-wrapper { grid-column: 1 / -1 !important; grid-row: auto !important; min-height: auto !important; height: auto !important; padding-bottom: 40px; }
    .danger-header-grid { grid-template-columns: 1fr; }
    .danger-title-area h1 { font-size: 4rem; }
    .ticker-number { font-size: 1.5rem !important; white-space: nowrap; width: 100%; max-width: 100%; overflow: hidden; display: block; }
    .handwritten-row { font-size: 1.4rem; white-space: nowrap; }
    .tkr-comparison-box { grid-column: 1 / -1 !important; width: 100%; }
    .tkr-comparison-text { white-space: normal !important; }
    .tkr-control-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px; }
    .tkr-ghost-btn, .tkr-share-btn { width: 100%; padding: 12px 5px; font-size: 0.8rem; display: flex; align-items: center; justify-content: center; }
    .tkr-timer-tooltip { bottom: 50px; right: 10px; }
    
    #tkr-legacy-input { font-size: 0.9rem; padding: 12px; }
    #btn-save-legacy { padding: 12px 15px; font-size: 0.75rem; }
}