* { box-sizing: border-box; }
body { margin: 0; font-family: 'SF Mono', ui-monospace, Menlo, Consolas, monospace;
    background: #0b1120; color: #c9d6e8; min-height: 100vh; }
.dc-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid #1c2740; background: #0d1426; }
.dc-header h1 { margin: 0; font-size: 1.3rem; font-weight: 800; letter-spacing: 0.12em; color: #5fd0ff; }
.dc-header h1 span { font-size: 0.5rem; color: #44557a; letter-spacing: 0; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.dc-main { max-width: 640px; margin: 0 auto; padding: 14px; }

.lock-banner { background: #3a0d12; color: #ff8a7a; text-align: center; padding: 8px; font-weight: 700; letter-spacing: 0.05em; border-bottom: 1px solid #5a1a22; }
.reality-line { background: #1a0d24; color: #c89bff; padding: 6px 10px; font-size: 0.78rem; letter-spacing: 0.04em; border-bottom: 1px solid #3a1d52;
    display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.reality-reset { background: transparent; border: 1px solid #4a2d6a; color: #b388e0; border-radius: 6px;
    padding: 2px 8px; font-size: 0.68rem; font-family: inherit; cursor: pointer; opacity: 0.8; white-space: nowrap; }
.reality-reset:hover { opacity: 1; border-color: #c0392b; color: #ff9bbf; }

/* The AI's "let me optimize for you" offer banner. */
.ai-offer { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
    background: #0d1f2a; color: #7fe0ff; text-align: center; padding: 8px 12px; font-size: 0.8rem;
    border-bottom: 1px solid #1d4a5a; }
.ai-offer.active { background: #1a0f2a; color: #c89bff; border-bottom-color: #4a2d6a; }
.ai-offer-btn { background: #11384a; border: 1px solid #2d8fff; color: #cfeaff; border-radius: 8px;
    padding: 6px 12px; font-weight: 700; cursor: pointer; font-family: inherit; font-size: 0.78rem; white-space: nowrap; }
.ai-offer.active .ai-offer-btn { background: #2a1230; border-color: #c0392b; color: #ffb454; }

/* The more realities you've collapsed into paperclips, the more the next one is scarred. */
body[data-realities-lost="1"] { box-shadow: inset 0 0 80px rgba(150,40,90,0.10); }
body[data-realities-lost="2"] { box-shadow: inset 0 0 110px rgba(150,40,90,0.18); }
body[data-realities-lost="3"] { box-shadow: inset 0 0 140px rgba(170,30,70,0.26); }
body[data-realities-lost="4"] { box-shadow: inset 0 0 170px rgba(190,25,55,0.34); }
body[data-realities-lost="5"] { box-shadow: inset 0 0 200px rgba(210,20,40,0.42); }
body[data-realities-lost="3"] .dc-header h1,
body[data-realities-lost="4"] .dc-header h1,
body[data-realities-lost="5"] .dc-header h1 { color: #ff7aa8; text-shadow: 0 0 8px rgba(255,60,120,0.5); }

/* The blitzscale toggle, lit when armed. */
.act.ghost.active { background: #2a1230; border-color: #c0392b; color: #ffb454; }

.statbar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px; }
/* Fixed-size cards: don't grow/shrink with the value. Label gets a reserved 2-line slot so
   the number always sits at the same baseline; the number stays on one line and clips. */
.stat { background: #0f1830; border: 1px solid #1c2740; border-radius: 8px; padding: 8px 10px;
    height: 80px; overflow: hidden; display: flex; flex-direction: column; }
.stat-k { display: block; font-size: 0.62rem; color: #5a6b8a; text-transform: uppercase; letter-spacing: 0.06em;
    min-height: 1.9em; line-height: 1; }
.stat strong { font-size: 0.92rem; color: #eaf2ff; font-variant-numeric: tabular-nums;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-rate { margin-top: auto; font-size: 0.66rem; color: #7ff0b0; font-variant-numeric: tabular-nums;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-rate.bad { color: #ff8a7a; }
.warn { color: #ffb454; font-size: 0.78rem; min-height: 16px; margin-bottom: 6px; }

.viz { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.viz-cell { background: #0f1830; border: 1px solid #1c2740; border-radius: 10px; padding: 14px; text-align: center; }
.viz-k { font-size: 0.6rem; color: #5a6b8a; letter-spacing: 0.1em; }
.viz-art { font-size: 3.6rem; line-height: 1.2; margin: 6px 0; }
.viz-label { font-size: 0.85rem; color: #9fb4d6; }

.outrage { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.o-k { font-size: 0.7rem; color: #5a6b8a; text-transform: uppercase; letter-spacing: 0.06em; }
.o-bar { flex: 1; height: 12px; background: #0f1830; border: 1px solid #1c2740; border-radius: 999px; overflow: hidden; }
.o-fill { height: 100%; width: 0%; background: linear-gradient(90deg,#2ecc71,#f0b000,#e74c3c); transition: width 0.2s; }
.o-val { font-size: 0.8rem; color: #c9d6e8; min-width: 36px; text-align: right; }
.rage-breakdown { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; font-size: 0.72rem; }
.rc { background: #11203a; border: 1px solid #243657; border-radius: 6px; padding: 3px 7px; color: #c9d6e8; text-decoration: none; font: inherit; font-size: 0.72rem; }
button.rc.driver { cursor: pointer; }
button.rc.driver:hover { border-color: #2d8fff; }
button.rc.driver::after { content: ' ⓘ'; opacity: 0.5; font-size: 0.6rem; }
.rc b { color: #ffb454; }
.rc.mit { color: #7ff0b0; border-color: #1d5a3a; } .rc.net { color: #eaf2ff; border-color: #3a4d70; }
.rc.net.cool { color: #7ff0b0; border-color: #1d5a3a; }
.rc.dim { color: #5a6b8a; border: none; background: none; padding: 0; }
.mit-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.mit-row input[type=range] { flex: 1 1 120px; min-width: 0; accent-color: #2ecc71; }
.mit-row #mit-val { color: #7ff0b0; min-width: 36px; font-variant-numeric: tabular-nums; }
/* The note wraps onto its own full-width line so it never runs off the screen on mobile. */
.mit-note { font-size: 0.72rem; color: #5a6b8a; flex: 1 1 100%; }

.panel { background: #0d1426; border: 1px solid #1c2740; border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.panel-title { font-size: 0.78rem; color: #9fb4d6; font-weight: 700; margin-bottom: 8px; }
.panel-title .hint { color: #5a6b8a; font-weight: 400; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
/* Equal, content-independent widths so live price/label updates don't reflow buttons
   under the cursor mid-click (which silently drops the click). */
.row .act, .footer-row .act { flex: 1 1 0; min-width: 0; }
.note { font-size: 0.72rem; color: #ffb454; margin-top: 6px; min-height: 14px; }
.srv-line { font-size: 0.8rem; color: #9fb4d6; margin-bottom: 8px; } .srv-line strong { color: #eaf2ff; }
.srv-sub { color: #5a6b8a; font-size: 0.72rem; }
.price { font-size: 0.78rem; opacity: 0.85; font-weight: 600; }

.act { background: linear-gradient(180deg,#2d8fffaa,#1b6fd6); color: #fff; border: 1px solid #2d8fff; border-radius: 8px; padding: 10px 14px; font-weight: 700; cursor: pointer; font-family: inherit; font-size: 0.85rem; }
.act.ghost { background: #11203a; border-color: #243657; color: #c9d6e8; }
.act.danger { background: #2a1014; border-color: #5a1a22; color: #ff8a7a; }
.act.danger.locked { opacity: 0.4; }
.act.ghost.locked { opacity: 0.6; border-color: #5a1a22; cursor: not-allowed; }
.act:disabled { opacity: 0.4; cursor: not-allowed; }

.mix-row { display: grid; grid-template-columns: 130px 1fr 32px; align-items: center; gap: 10px; padding: 4px 0; }
.mix-row.locked { opacity: 0.4; }
.mix-row.sticky, .mit-row.sticky { opacity: 0.55; }
.mix-row.sticky input[type=range], .mit-row.sticky input[type=range] { accent-color: #c0392b; cursor: not-allowed; }
.mix-name { font-size: 0.8rem; }
.mix-val { font-size: 0.8rem; text-align: right; color: #9fb4d6; font-variant-numeric: tabular-nums; }
.mix-row input[type=range] { width: 100%; accent-color: #2d8fff; }

.power-bal { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.78rem; color: #9fb4d6; margin-bottom: 6px; }
.power-bal strong { color: #eaf2ff; }
.pb-head { margin-left: auto; color: #7ff0b0; }
.pb-head.warn-text { color: #ff8a5c; }
.pb-bar { height: 10px; background: #0b1120; border: 1px solid #1c2740; border-radius: 999px; overflow: hidden; margin-bottom: 10px; }
.pb-fill { height: 100%; width: 0%; background: linear-gradient(90deg,#2d8fff,#5fd0ff); transition: width 0.2s; }
.pb-fill.over { background: linear-gradient(90deg,#e67e22,#e74c3c); }
.src-sub { font-size: 0.7rem; color: #5a6b8a; margin: 4px 0 6px; }
.sources { display: flex; gap: 6px; flex-wrap: wrap; }
.src-btn { position: relative; background: #11203a; border: 1px solid #243657; color: #c9d6e8; border-radius: 8px; padding: 7px 9px; cursor: pointer; font-family: inherit; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.info-dot { display: inline-flex; align-items: center; justify-content: center; min-width: 15px; height: 15px; padding: 0 2px; border-radius: 50%; border: 1px solid currentColor; font-size: 0.6rem; line-height: 1; opacity: 0.55; cursor: pointer; }
.info-dot:hover { opacity: 1; color: #5fd0ff; }
.src-i { position: absolute; top: 4px; right: 4px; }
.mix-name .info-dot { vertical-align: middle; }
.src-name { font-size: 0.78rem; font-weight: 700; }
.src-meter { font-size: 0.66rem; letter-spacing: -1px; line-height: 1; }
.src-meter .m-pwr { filter: saturate(0.6); }
.src-btn.active { background: #1b6fd6; border-color: #2d8fff; color: #fff; }
.src-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.footer-row { display: flex; gap: 8px; }

.modal { position: fixed; inset: 0; background: rgba(4,8,18,0.82); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modal.open { display: flex; }
.modal-box { background: #0f1830; border: 1px solid #2d8fff; border-radius: 14px; padding: 22px; max-width: 420px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.5); display: flex; flex-direction: column; align-items: center; }
.modal-box h2 { margin: 4px 0 10px; color: #eaf2ff; }
.card-meter { font-size: 0.65rem; color: #5fd0ff; letter-spacing: 0.08em; text-transform: uppercase; }
.snark { color: #c9d6e8; line-height: 1.5; font-size: 0.95rem; }
.src-link { display: inline-block; margin: 12px 0; color: #5fd0ff; font-size: 0.8rem; text-decoration: none; }
.src-link:hover { text-decoration: underline; }
.end-stat { font-size: 0.78rem; color: #9fb4d6; margin: 10px 0 14px; }

.toast { position: fixed; bottom: 70px; left: 50%; transform: translateX(-50%) translateY(20px); background: #1a1024; color: #ffd0c0; border: 1px solid #5a1a22; padding: 10px 16px; border-radius: 10px; font-size: 0.85rem; opacity: 0; transition: all 0.25s; pointer-events: none; z-index: 60; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.version-info { position: fixed; bottom: 6px; right: 8px; font-size: 0.6rem; color: rgba(255,255,255,0.25); }
