/* Dream Interpretation — indigo night, moonlit mist */
:root {
    --bg0: #0b0a18;
    --bg1: #181430;
    --card: rgba(32,26,58,.72);
    --line: rgba(170,160,255,.16);
    --line2: rgba(170,160,255,.34);
    --ink: #f2eeff;
    --dim: #b0a8d8;
    --faint: #7870a8;
    --gold: #eec882;
    --vio: #c8b8ff;
    --vio2: #7060a8;
    --pink: #e8a0d8;
}
* { box-sizing: border-box; }
html, body {
    margin: 0; overflow: hidden; color: var(--ink);
    background: radial-gradient(1200px 800px at 70% -10%, #1e1a44, var(--bg0) 60%);
    font-family: 'Segoe UI', system-ui, sans-serif; height: 100%;
}
#app { height: 100%; display: flex; flex-direction: column; }

#topbar { display: flex; align-items: center; gap: 8px; padding: 10px 14px 6px; }
.brand { font: 700 20px 'Georgia', serif; letter-spacing: .5px;
    background: linear-gradient(120deg, #f0ecff, var(--vio) 60%, var(--gold));
    -webkit-background-clip: text; background-clip: text; color: transparent; margin-right: auto; }
.chip {
    font: 600 10.5px 'Segoe UI'; letter-spacing: .08em; color: var(--dim);
    background: rgba(40,32,74,.55); border: 1px solid var(--line); border-radius: 999px;
    padding: 5px 11px; cursor: default; white-space: nowrap;
}
.chip-amber { color: var(--gold); border-color: rgba(238,200,130,.35); }
button.chip { cursor: pointer; font-weight: 700; letter-spacing: .06em; }
button.chip:hover { border-color: var(--line2); color: #fff; }
.icon-btn {
    width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--line);
    background: rgba(40,32,74,.55); color: var(--dim); font-size: 15px; cursor: pointer;
}
.icon-btn:hover { color: #fff; border-color: var(--line2); }
.icon-btn.sm { width: 24px; height: 24px; font-size: 12px; }
#verdictChip { color: #b8d8e8; border-color: rgba(150,200,255,.3); }

#chips { display: flex; gap: 8px; padding: 0 14px 8px; }
#chips .chip { font-size: 11.5px; padding: 7px 14px; }

#stage { position: relative; flex: 1; min-height: 0; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
#content {
    position: absolute; inset: 0; overflow-y: auto; display: none;
    padding: 14px 16px 90px; scrollbar-width: thin;
}
#content::-webkit-scrollbar { width: 8px; }
#content::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

#dock {
    padding: 8px; margin: 0 auto 10px; width: min(96vw, 920px);
    background: rgba(26,20,50,.85); border: 1px solid var(--line); border-radius: 20px;
    backdrop-filter: blur(10px); box-shadow: 0 8px 40px rgba(0,0,0,.4);
}
.dock-row { display: flex; justify-content: space-between; gap: 4px; }
#dock button {
    flex: 1; border: 0; background: transparent; color: var(--faint); cursor: pointer;
    padding: 6px 2px 4px; border-radius: 12px; font-size: 8.5px; letter-spacing: .02em;
    display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0;
}
#dock button .g { font-size: 17px; line-height: 1; filter: grayscale(.6) opacity(.7); }
#dock button i { font-style: normal; }
#dock button.on { color: var(--gold); background: rgba(238,200,130,.08); }
#dock button.on .g { filter: none; }
#dock button:hover { color: var(--dim); }

.scroll { max-width: 640px; margin: 0 auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 12px; backdrop-filter: blur(6px); }
.card-h { font: 700 14px 'Georgia', serif; color: var(--gold); letter-spacing: .04em; margin-bottom: 8px; }
.card-b { font-size: 13px; color: var(--dim); line-height: 1.55; }
.card-b b { color: var(--ink); }
.card-b ul { margin: 6px 0; padding-left: 18px; }
.card-b li { margin: 4px 0; }
.kpis { display: flex; gap: 8px; margin: 10px 0 4px; flex-wrap: wrap; }
.kpi { flex: 1; min-width: 90px; text-align: center; background: rgba(24,18,44,.55); border: 1px solid var(--line); border-radius: 12px; padding: 9px 6px; }
.kpi-v { font: 700 17px 'Georgia', serif; color: var(--gold); }
.kpi-l { font-size: 9.5px; color: var(--faint); letter-spacing: .06em; text-transform: uppercase; margin-top: 2px; }
.kpi-s { font-size: 9px; color: var(--dim); margin-top: 3px; }
.srcb { display: inline-block; font-size: 9.5px; padding: 1px 7px; border-radius: 8px; margin: 2px 4px 2px 0; letter-spacing: .4px; }
.srcb-measured { color: #a8e0b8; background: rgba(80,190,120,.14); border: 1px solid rgba(140,230,170,.4); }
.srcb-leaning  { color: #f0d8a8; background: rgba(230,180,80,.13); border: 1px solid rgba(240,200,110,.4); }
.srcb-tradition{ color: #e8c8f8; background: rgba(200,140,240,.12); border: 1px solid rgba(220,170,255,.35); }
.row-center { display: flex; justify-content: center; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.btn {
    background: linear-gradient(135deg, rgba(150,110,220,.3), rgba(80,55,150,.3)); color: #fff;
    border: 1px solid var(--line2); border-radius: 11px; padding: 9px 16px; font: 600 12px 'Segoe UI'; cursor: pointer;
}
.btn:hover { border-color: rgba(180,150,255,.55); }
.btn.amber { background: linear-gradient(135deg, rgba(238,200,130,.35), rgba(150,95,150,.3)); color: #ffe9b8; }
.btn.sm { padding: 6px 11px; font-size: 11px; }
.dim { color: var(--faint); font-size: 11.5px; }
.tips { margin: 6px 0; padding-left: 16px; }
.tips li { margin: 6px 0; }
.srow { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid rgba(170,160,255,.08); }
.srow .sn { width: 26px; height: 26px; border-radius: 50%; background: rgba(238,200,130,.15); border: 1px solid var(--line2);
    display: flex; align-items: center; justify-content: center; font-size: 13px; flex: none; }
.srow .st { flex: 1; font-size: 12.5px; color: var(--dim); }
.srow .st b { color: var(--ink); }
.drow { display: flex; align-items: flex-start; gap: 10px; padding: 9px 4px; border-bottom: 1px solid rgba(170,160,255,.08); }
.drow .dn { width: 30px; height: 30px; border-radius: 50%; background: rgba(160,140,255,.14); border: 1px solid var(--line2);
    display: flex; align-items: center; justify-content: center; font-size: 14px; flex: none; }
.drow .dt { flex: 1; font-size: 12.5px; color: var(--dim); }
.drow .dt b { color: var(--ink); }
.trow { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid rgba(170,160,255,.08); font-size: 12.5px; color: var(--dim); }
.trow b { color: var(--vio); min-width: 90px; font-weight: 600; }
textarea#tellText {
    width: 100%; background: #18122f; color: var(--ink); border: 1px solid var(--line);
    border-radius: 11px; padding: 10px 12px; font: 14px 'Segoe UI'; resize: vertical; color-scheme: dark;
}
textarea#tellText:focus { outline: none; border-color: rgba(180,150,255,.6); }

#overlay {
    position: fixed; inset: 0; z-index: 50; background: rgba(6,5,16,.6); backdrop-filter: blur(3px);
    display: none; align-items: flex-end; justify-content: center;
}
#overlay.open, #overlay:has(.sheet.on) { display: flex; }
.sheet {
    display: none; width: 100%; max-width: 480px; max-height: 84vh; overflow-y: auto;
    background: linear-gradient(170deg, #201a40, #120e26); border: 1px solid var(--line2); border-bottom: 0;
    border-radius: 22px 22px 0 0; padding: 16px 18px 30px;
    animation: rise .3s cubic-bezier(.2,.8,.2,1); box-shadow: 0 -12px 60px rgba(140,110,255,.16);
}
.sheet.on { display: block; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; font-size: 15px; margin-bottom: 10px; color: #eee8ff; }
.sheet input, .sheet select {
    width: 100%; background: #18122f; color: var(--ink); border: 1px solid var(--line);
    border-radius: 11px; padding: 10px 12px; font: 14px 'Segoe UI'; margin-bottom: 8px; color-scheme: dark;
}
.sheet input:focus, .sheet select:focus { outline: none; border-color: rgba(180,150,255,.6); }
.sheet-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.sheet-row label { min-width: 64px; font-size: 11.5px; color: var(--dim); letter-spacing: .05em; }
.sheet-row input[type="checkbox"] { width: auto; }
.sheet .btn { width: 100%; margin-top: 6px; }
.sheet-sub { font-size: 11px; color: var(--faint); margin-top: 8px; }
#dtBody p { font-size: 13px; color: var(--dim); margin: 6px 0; }
#dtBody b { color: var(--vio); }
.bgsel {
    border: 1px solid var(--line); background: rgba(40,30,80,.55); color: var(--dim);
    font: 600 11px 'Segoe UI'; padding: 8px 12px; border-radius: 11px; cursor: pointer;
}
.bgsel:hover { color: #fff; border-color: var(--line2); }
.bgsel.on { background: linear-gradient(135deg, rgba(150,110,230,.4), rgba(80,60,150,.4)); color: #fff; border-color: var(--line2); }

#hint {
    position: fixed; left: 50%; bottom: 118px; transform: translateX(-50%) translateY(8px);
    z-index: 40; background: rgba(32,25,60,.92); border: 1px solid var(--line2); color: var(--ink);
    font: 600 12px 'Segoe UI'; padding: 9px 16px; border-radius: 999px; opacity: 0;
    transition: all .3s; pointer-events: none; max-width: 88vw; text-align: center;
}
#hint.show { opacity: 1; transform: translateX(-50%); }
#statusline {
    position: fixed; left: 14px; bottom: 10px; z-index: 25; font: 600 10.5px 'Segoe UI';
    color: var(--faint); letter-spacing: .05em; pointer-events: none;
}
#goaBrand { transition: opacity .3s; }
body.wpchrome #topbar, body.wpchrome #chips, body.wpchrome #dock,
body.wpchrome #statusline, body.wpchrome #content, body.wpchrome #hint { display: none !important; }

@media (max-width: 640px) {
    #topbar { padding: 8px 10px 4px; }
    #chips { padding: 0 10px 6px; }
    #dock { border-radius: 18px; padding: 6px 6px; margin-bottom: 6px; }
    #dock button { min-width: 34px; padding: 5px 5px 4px; }
    #dock button i { font-size: 7px; }
}
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
