/* HARVIS basic screen (2026-10-25, "너나 GPT처럼 쓰기 편하게"; 2026-10-27 space screen): HARVIS as a planet in the
   middle with the departments orbiting it, the conversation and one big composer. The conversation list and
   everything else (work board, approvals, memory) open from ☰. */
:root {
  --bg: #0b0d12;
  --side: #07090d;
  --panel: #10131b;
  --line: #1d2230;
  --line-2: #2a3142;
  --ink: #ececf1;
  --soft: #c5c8d3;
  --dim: #8b90a0;
  --accent: #5eead4;
  --accent-ink: #04221d;
  --user: #222838;
  --amber: #f5c26b;
  --good: #6ee7b7;
  --bad: #fb8a8a;
  --mono: "Cascadia Mono", "Consolas", ui-monospace, monospace;
  --sans: "Pretendard", "Segoe UI Variable Text", "Segoe UI", "Malgun Gothic", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: radial-gradient(ellipse 70% 55% at 20% 10%, rgba(88,64,180,.16), transparent 60%),
                   radial-gradient(ellipse 60% 50% at 85% 85%, rgba(20,140,150,.13), transparent 60%), #05060c;
       color: var(--ink); font: 400 15px/1.7 var(--sans); display: flex; height: 100dvh; overflow: hidden; }
#space { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
button { font: inherit; color: inherit; }
.grow { flex: 1; }
.sr { position: absolute; left: -9999px; }

/* the conversation list */
/* a drawer on every screen: the middle is HARVIS and the conversation only */
#side { position: fixed; left: 0; top: 0; bottom: 0; z-index: 30; width: 82vw; max-width: 300px; transform: translateX(-100%); transition: transform .2s;
        background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 12px 10px; gap: 8px; }
body.side-on #side { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.5); }
.side-top { display: flex; align-items: center; padding: 4px 6px 6px; }
.brand { display: flex; align-items: center; gap: 10px; font: 600 13px var(--mono); letter-spacing: .3em; flex: 1; }
#light { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
body[data-mode="think"] #light { animation: blink 1s infinite; }
body[data-mode="listen"] #light { background: var(--good); animation: blink 1.6s infinite; }
body[data-mode="ask"] #light { background: var(--amber); box-shadow: 0 0 12px var(--amber); animation: blink 1s infinite; }
#side-close, #side-open { background: none; border: 0; color: var(--dim); font-size: 20px; cursor: pointer; padding: 2px 8px; }
.new-chat { background: none; border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; text-align: left; cursor: pointer; color: var(--ink); }
.new-chat:hover { background: #141826; }
.search input { width: 100%; background: #0f121a; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; color: var(--ink); font-size: 13.5px; outline: none; }
.search input:focus { border-color: var(--line-2); }
#convs { flex: 1; overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.group { font-size: 11.5px; color: var(--dim); padding: 12px 8px 4px; letter-spacing: .04em; }
.conv { display: flex; align-items: center; gap: 4px; border-radius: 8px; }
.conv:hover, .conv.on { background: #161a26; }
.conv button.open { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 7px 8px; cursor: pointer; color: var(--soft); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv.on button.open { color: var(--ink); }
.conv button.del { visibility: hidden; background: none; border: 0; color: var(--dim); cursor: pointer; padding: 4px 8px; }
.conv:hover button.del, .conv:focus-within button.del { visibility: visible; }
@media (hover: none) { .conv button.del { visibility: visible; } }
.side-bottom { border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; }
.side-bottom button { background: none; border: 0; text-align: left; padding: 7px 8px; border-radius: 8px; cursor: pointer; color: var(--soft); font-size: 13.5px; }
.side-bottom button:hover { background: #161a26; color: var(--ink); }
.side-bottom b { color: var(--amber); font-weight: 600; margin-left: 4px; }

/* the conversation */
#main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; z-index: 1; }
#bar { display: flex; align-items: center; gap: 10px; padding: 12px 20px; flex: none; }
#title { margin: 0; font: 600 15px var(--sans); color: var(--soft); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#alert { background: rgba(245,194,107,.12); border: 1px solid rgba(245,194,107,.45); color: #ffe2ad; border-radius: 999px; padding: 4px 14px; cursor: pointer; font-size: 13px; max-width: 50vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#chat { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; padding: 12px max(20px, calc(50% - 380px)) 24px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
#chat:empty { display: none; }

/* the universe: HARVIS in the middle, the departments as small planets on one orbit (JS moves them) */
#universe { position: relative; flex: 1; min-height: 220px; --core: min(34vh, 38vw, 300px); }
#main:has(#chat:not(:empty)) #universe { flex: none; height: clamp(150px, 26vh, 230px); min-height: 0; --core: clamp(70px, 13vh, 120px); }
#orbit { position: absolute; left: 50%; top: 50%; width: var(--orbit-w, 70%); height: var(--orbit-h, 40%); transform: translate(-50%, -50%);
         border: 1px solid rgba(148,163,255,.13); border-radius: 50%; pointer-events: none; }
#core { position: absolute; left: 50%; top: 50%; width: var(--core); height: var(--core); transform: translate(-50%, -50%); border: 0; padding: 0;
        border-radius: 50%; cursor: pointer; z-index: 1;
        background:
          radial-gradient(circle at 34% 30%, rgba(255,255,255,.55) 0, rgba(190,255,246,.22) 9%, transparent 26%),
          repeating-linear-gradient(-14deg, transparent 0, rgba(8,30,60,.30) 5%, transparent 10%, rgba(120,240,225,.10) 15%, transparent 21%),
          radial-gradient(circle at 40% 38%, #4ce0cc 0, #1d8fa1 30%, #134a7a 58%, #0a1d3d 82%, #050b18 100%);
        background-size: 100% 100%, 300% 100%, 100% 100%;
        box-shadow: 0 0 calc(var(--core) * .28) rgba(94,234,212,.30), inset calc(var(--core) * -.12) calc(var(--core) * -.14) calc(var(--core) * .3) rgba(0,0,0,.72);
        animation: spin 60s linear infinite; }
#core .atmo { position: absolute; inset: -7%; border-radius: 50%; pointer-events: none;
              background: radial-gradient(circle, transparent 62%, rgba(94,234,212,.20) 68%, transparent 74%); }
body[data-mode="think"] #core { animation: spin 60s linear infinite, breathe 1.6s ease-in-out infinite; }
body[data-mode="speak"] #core { box-shadow: 0 0 calc(var(--core) * .45) rgba(94,234,212,.55), inset calc(var(--core) * -.12) calc(var(--core) * -.14) calc(var(--core) * .3) rgba(0,0,0,.72); }
body[data-mode="listen"] #core .atmo { background: radial-gradient(circle, transparent 62%, rgba(110,231,183,.45) 68%, transparent 75%); animation: blink 1.6s infinite; }
body[data-mode="ask"] #core .atmo { background: radial-gradient(circle, transparent 62%, rgba(245,194,107,.5) 68%, transparent 75%); animation: blink 1s infinite; }
#core-approvals { position: absolute; left: 50%; top: calc(50% + var(--core) / 2 + 8px); transform: translateX(-50%); z-index: 3;
                  background: rgba(245,194,107,.14); border: 1px solid rgba(245,194,107,.55); color: #ffe2ad; border-radius: 999px;
                  padding: 1px 12px; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.moon { position: absolute; left: 0; top: 0; width: var(--size); height: var(--size); margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2);
        border: 0; padding: 0; border-radius: 50%; cursor: pointer; will-change: transform; z-index: 2; --size: clamp(30px, 5vh, 44px);
        background: radial-gradient(circle at 34% 30%, rgba(255,255,255,.75) 0, var(--c) 30%, color-mix(in srgb, var(--c) 45%, #050816) 72%, #04050b 100%);
        box-shadow: 0 0 14px color-mix(in srgb, var(--c) 55%, transparent); transition: filter .2s, box-shadow .2s; }
.moon:hover, .moon:focus-visible { box-shadow: 0 0 26px var(--c); outline: none; filter: brightness(1.25); }
.moon.off { filter: grayscale(.85) brightness(.55); box-shadow: none; }
.moon.off:hover, .moon.off:focus-visible { filter: grayscale(.4) brightness(.9); }
.moon .count { position: absolute; right: -7px; top: -7px; min-width: 17px; height: 17px; border-radius: 9px; padding: 0 4px; background: var(--amber); color: #2a1a00;
               font: 700 10.5px/17px var(--sans); }
.moon .name { position: absolute; left: 50%; top: calc(100% + 3px); transform: translateX(-50%); white-space: nowrap; font-size: 11px; color: var(--soft); display: none; cursor: pointer; }
@media (hover: none) { .moon .name { display: block; } }   /* phones have no hover: the names stay visible */
#moon-label { position: absolute; z-index: 4; cursor: pointer; transform: translate(-50%, calc(-100% - 14px)); white-space: nowrap;
              background: rgba(12,15,26,.94); border: 1px solid var(--line-2); border-radius: 10px; padding: 3px 10px; font-size: 13px; }
#moon-label small { color: var(--dim); margin-left: 6px; font-size: 11.5px; }

/* one department on a big screen */
#dept { position: fixed; inset: 0; z-index: 25; overflow-y: auto; background: rgba(4,6,13,.95); backdrop-filter: blur(6px); padding: 22px max(18px, calc(50% - 620px)) 40px; }
#dept[hidden] { display: none; }
#dept .head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
#dept .swatch { width: 56px; height: 56px; border-radius: 50%; flex: none;
                background: radial-gradient(circle at 34% 30%, rgba(255,255,255,.7) 0, var(--c) 30%, color-mix(in srgb, var(--c) 45%, #050816) 72%, #04050b 100%);
                box-shadow: 0 0 26px color-mix(in srgb, var(--c) 60%, transparent); }
#dept h2 { margin: 0; font: 600 24px var(--sans); }
#dept .job { color: var(--soft); font-size: 13.5px; }
#dept .chips span { display: inline-block; border: 1px solid var(--line-2); border-radius: 999px; padding: 0 10px; margin: 4px 6px 0 0; font-size: 12px; color: var(--soft); }
#dept .state { font-size: 12px; border-radius: 999px; padding: 2px 10px; margin-left: 8px; vertical-align: middle; background: rgba(110,231,183,.12); color: var(--good); }
#dept .state.off { background: rgba(139,144,160,.15); color: var(--dim); }
#dept .x { margin-left: auto; align-self: flex-start; background: none; border: 1px solid var(--line-2); color: var(--soft); border-radius: 10px; padding: 4px 12px; cursor: pointer; }
#dept .chart { margin-bottom: 16px; padding-bottom: 12px; }
#dept .chart-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
#dept .chart-bar h3 { margin: 0 8px 0 0; }
#dept .chart-bar button { background: none; border: 1px solid var(--line-2); color: var(--soft); border-radius: 999px; padding: 2px 12px; cursor: pointer; font-size: 12px; }
#dept .chart-bar button.on { border-color: var(--c, #fbbf24); color: var(--c, #fbbf24); }
#dept .cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.35fr); gap: 16px; align-items: start; }
#dept .col { background: rgba(16,19,27,.88); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px 18px; min-width: 0; }
#dept .col h3 { margin: 0 0 10px; font: 600 14px var(--sans); color: var(--soft); }
#dept .col h3 b { color: var(--amber); margin-left: 4px; }
#dept .perf { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
#dept .perf:last-child { border-bottom: 0; }
#dept .perf .v { color: var(--ink); text-align: right; flex: none; max-width: 55%; }
#dept .kind { display: inline-block; font-size: 10.5px; border-radius: 6px; padding: 0 6px; margin-right: 6px; background: #1d2230; color: var(--dim); }
#dept .kind.real { background: rgba(110,231,183,.14); color: var(--good); }
#dept .kind.paper { background: rgba(245,194,107,.14); color: var(--amber); }
#dept .kind.draft { background: rgba(96,165,250,.14); color: #93c5fd; }
#dept .link { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer;
  text-decoration: underline dotted rgba(255,255,255,.35); text-underline-offset: 3px; }
#dept .link:hover, #dept .link:focus-visible { color: var(--c, #93c5fd); text-decoration-color: currentColor; }
#dept .more { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
#dept .more h4 { margin: 8px 0 4px; font: 600 12px var(--sans); color: var(--dim); }
#dept .more .result-text, #dept .perf-item .result-text { white-space: pre-wrap; font-size: 12.5px; max-height: 40vh; overflow: auto; color: var(--soft); }
#dept .steps { margin: 0; padding-left: 16px; font-size: 12px; color: var(--soft); }
#dept .perf-items { padding: 4px 0 8px 12px; border-left: 2px solid var(--line-2); margin: 2px 0 6px 4px; }
#dept .perf-item { padding: 6px 0; font-size: 12.5px; border-bottom: 1px dashed var(--line); }
#dept .perf-item:last-child { border-bottom: 0; }
#dept .dept-video { display: block; width: 100%; max-height: 70vh; margin-top: 8px; border-radius: 10px; background: #000; }
#dept .perf-item .meta { color: var(--dim); font-size: 11.5px; }
#dept .banner { border: 1px dashed var(--line-2); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; color: var(--soft); font-size: 13px; }
@media (max-width: 1000px) { #dept .cols { grid-template-columns: 1fr; } }
/* the coin desk: chart, positions and coins on the left, the HARVIS conversation on the right (2026-10-29) */
#dept[data-dept="coin"] { padding-left: max(14px, calc(50% - 800px)); padding-right: max(14px, calc(50% - 800px)); }
#dept .desk { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(340px, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
#dept .desk-left { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
#dept .desk-chart video { width: 100%; max-height: 62vh; object-fit: contain; background: #000; border-radius: 10px; display: block; }
#dept .chart-empty { padding: 28px 8px; text-align: center; line-height: 1.7; }
#dept .live-dot { color: var(--good); font-size: 12px; }
#dept .live-dot::before { content: "● "; animation: blink 1.6s infinite; }
#dept .desk-talk { position: sticky; top: 0; display: flex; flex-direction: column; height: calc(100vh - 150px); min-height: 460px; padding: 14px 0 0; }
#dept .desk-talk > h3, #dept .desk-talk > .hint { padding: 0 16px; }
#dept .desk-talk #chat { flex: 1; padding: 10px 14px 12px; gap: 14px; }
#dept .desk-talk #chat:empty { display: flex; }
#dept .desk-talk #state-line, #dept .desk-talk #ask { padding-left: 12px; padding-right: 12px; }
#dept .desk-talk .fine { display: none; }
#dept .venue { font-size: 12px; border-radius: 999px; padding: 1px 10px; background: rgba(245,194,107,.14); color: var(--amber); }
#dept .venue.live { background: rgba(248,113,113,.18); color: #fca5a5; font-weight: 600; }
#dept .acct { font-size: 13px; color: var(--soft); margin-bottom: 8px; }
#dept .warn-line { font-size: 12.5px; color: var(--amber); margin: 4px 0; }
#dept .pos { border: 1px solid var(--line-2); border-left: 3px solid var(--good); border-radius: 10px; padding: 8px 12px; margin: 6px 0; font-size: 13px; }
#dept .pos.short { border-left-color: #f87171; }
#dept .pos-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
#dept .pos-row { color: var(--soft); font-size: 12.5px; }
#dept .up { color: var(--good); }
#dept .down { color: #f87171; }
#dept .desk h4 { margin: 12px 0 4px; font: 600 12px var(--sans); color: var(--dim); }
#dept table.fills { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
#dept table.fills td { padding: 4px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
#dept table.coins tr { cursor: pointer; }
#dept table.coins tr:hover td { background: rgba(255,255,255,.04); }
#dept .checked { font-size: 11.5px; margin-top: 8px; }
#dept .small { font-size: 11.5px; }
#dept .coin-pick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 10px; }
#dept .coin-pick .grow { flex: 1; }
#dept .coin-chip, #dept .stage button, #dept .coin-pick > button.on, #dept .consensus button { background: none; border: 1px solid var(--line-2); color: var(--soft); border-radius: 999px; padding: 1px 10px; cursor: pointer; font-size: 12px; }
#dept .coin-chip.on, #dept .coin-pick > button.on, #dept .consensus button { border-color: var(--c, #fbbf24); color: var(--c, #fbbf24); }
#dept .stage { border-top: 1px solid var(--line); padding: 8px 0; }
#dept .stage .chart-bar { margin-bottom: 4px; }
#dept .ai-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
#dept .ai-col { background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 12.5px; min-width: 0; }
#dept .ai-name { font-weight: 600; color: var(--soft); margin-bottom: 2px; }
#dept .pick { margin: 3px 0; }
#dept .consensus { margin-top: 8px; padding: 8px 10px; border-radius: 10px; border: 1px dashed var(--line-2); font-size: 13px; }
#dept .consensus.agree { border-color: var(--c, #fbbf24); }
#dept .consensus code { display: block; margin: 6px 0; white-space: normal; color: var(--ink); }
#dept .score { margin-top: 6px; }
@media (max-width: 1000px) {
  #dept .desk { grid-template-columns: 1fr; }
  #dept .desk-talk { position: static; height: 70vh; order: -1; }
  #dept table.fills { display: block; overflow-x: auto; }
}
@keyframes spin { to { background-position: 0 0, -300% 0, 0 0; } }
@keyframes breathe { 50% { box-shadow: 0 0 calc(var(--core) * .5) rgba(94,234,212,.55), inset calc(var(--core) * -.12) calc(var(--core) * -.14) calc(var(--core) * .3) rgba(0,0,0,.72); } }
@media (prefers-reduced-motion: reduce) { #core, body[data-mode] #core { animation: none; } }
.msg { white-space: pre-wrap; word-break: break-word; max-width: 100%; animation: appear .2s ease-out both; }
.msg.user { align-self: flex-end; background: var(--user); padding: 10px 16px; border-radius: 20px; max-width: 80%; }
.msg.harvis { align-self: stretch; color: var(--ink); }
.msg.harvis.warn, .msg.harvis.bad, .msg.harvis.good { padding-left: 14px; border-left: 2px solid var(--line-2); }
.msg.harvis.warn { border-left-color: var(--amber); } .msg.harvis.bad { border-left-color: var(--bad); } .msg.harvis.good { border-left-color: var(--good); }
.msg.harvis p { margin: 0 0 10px; } .msg.harvis p:last-child { margin-bottom: 0; }
.msg.harvis ul, .msg.harvis ol { margin: 4px 0 12px; padding-left: 24px; }
.msg.harvis li { margin: 4px 0; }
.msg.harvis h4 { margin: 14px 0 6px; font-size: 15.5px; color: #fff; }
.msg.harvis strong { color: #fff; font-weight: 600; }
.msg .row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.msg button, .panel button { background: none; color: var(--accent); border: 1px solid var(--line-2); border-radius: 10px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.msg button.primary, .panel button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.msg button.ghost, .panel button.ghost { color: var(--soft); }
.msg button:disabled, .panel button:disabled { opacity: .35; cursor: default; }
.msg details { margin-top: 8px; color: var(--dim); font: 11px var(--mono); }
.msg details pre { white-space: pre-wrap; max-height: 160px; overflow: auto; }
.msg.photo img { max-width: min(260px, 70vw); max-height: 220px; border-radius: 12px; display: block; }
#chat > div:not(.msg) { color: var(--dim); font-size: 12.5px; }
#chat > div > button { background: none; border: 1px solid var(--line-2); color: var(--accent); border-radius: 8px; padding: 1px 10px; font-size: 12px; cursor: pointer; }
#state-line { min-height: 20px; padding: 0 max(20px, calc(50% - 380px)); font-size: 12.5px; color: var(--dim); }
#state-line:not(:empty)::before { content: "◦ "; color: var(--accent); }

/* the composer */
#ask { padding: 4px max(20px, calc(50% - 380px)) 14px; flex: none; }
.composer { background: #151924; border: 1px solid var(--line-2); border-radius: 22px; padding: 12px 12px 8px 18px; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.composer:focus-within { border-color: #3a4560; }
#say { width: 100%; resize: none; background: transparent; border: 0; outline: none; color: var(--ink); font: 400 15.5px/1.6 var(--sans); max-height: 220px; min-height: 26px; }
#say::placeholder { color: var(--dim); }
.tools { display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.tools button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--dim); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.tools button:hover { background: rgba(255,255,255,.06); color: var(--ink); }
#send { background: var(--ink); color: #0b0d12; }
#send:hover { background: #fff; color: #0b0d12; }
#mic.on { color: var(--good); animation: blink 1.6s infinite; }
.fine { margin: 6px 0 0; text-align: center; font-size: 11.5px; color: var(--dim); }

/* panels opened from the list's foot: a drawer from the right */
#panels { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); z-index: 27;   /* above a department screen */ overflow-y: auto; background: var(--panel); border-left: 1px solid var(--line-2); box-shadow: -20px 0 60px rgba(0,0,0,.45); }
#panels:empty { display: none; }
.panel { padding: 18px 20px 26px; border-bottom: 1px solid var(--line); position: relative; }
.panel h3 { margin: 0 0 12px; font: 600 15px var(--sans); }
.panel .close { position: absolute; top: 12px; right: 12px; border: 0; color: var(--dim); font: 18px var(--mono); padding: 0 8px; }
.panel h4 { margin: 16px 0 6px; font: 600 12px var(--sans); letter-spacing: .06em; color: var(--dim); }
.panel ul, .panel ol { margin: 0; padding: 0; list-style: none; }
.panel ol { list-style: decimal; padding-left: 20px; }
.panel li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--soft); }
.panel li:last-child { border-bottom: 0; }
.panel .tag { display: inline-block; min-width: 58px; margin-right: 8px; font-size: 11px; color: var(--dim); }
.panel .on { color: var(--good); } .panel .off { color: var(--dim); } .panel .run { color: var(--accent); } .panel .wait { color: var(--amber); }
.panel .muted { color: var(--dim); font-size: 12px; }
.panel .card { background: #161a26; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0; display: block; }
.panel .card strong { display: block; font-size: 13.5px; }
.panel .card .meta { color: var(--dim); font-size: 12px; }
.panel .big { font-size: 18px; font-weight: 600; margin: 4px 0 8px; }
.panel .result-text { white-space: pre-wrap; font-size: 13px; max-height: 60vh; overflow: auto; }
.panel select { background: #161a26; color: var(--soft); border: 1px solid var(--line-2); border-radius: 6px; font-size: 12px; margin: 0 6px; }
.key-form { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.key-form label { display: flex; flex-direction: column; font: 400 11px var(--mono); color: var(--dim); }
.key-form input { background: transparent; border: 1px solid var(--dim); color: inherit; padding: 6px; border-radius: 6px; }

@keyframes appear { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: .4; } }

@media (max-width: 860px) {
  #bar { padding: 10px 12px; }
  #chat, #state-line, #ask { padding-left: 14px; padding-right: 14px; }
}

/* a CSV a built program made, opened on the screen */
table.csv { border-collapse: collapse; font-size: 13px; width: 100%; }
table.csv th, table.csv td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; }
table.csv th { background: var(--soft); }
#main:has(#chat:not(:empty)) .moon { --size: 24px; }

/* Shared conversation remains mounted while a department is open. */
body.dept-on { --talk-width: clamp(320px, 33vw, 460px); }
body.dept-on #main { position: fixed; top: 0; right: 0; bottom: 0; width: var(--talk-width); z-index: 26; background: #0b0e17; border-left: 1px solid var(--line-2); }
body.dept-on #universe { display: none; }
body.dept-on #chat { display: flex; padding: 12px 16px; gap: 14px; }
body.dept-on #chat:empty::before { content: "부서를 보면서 하비스와 대화하세요."; color: var(--dim); font-size: 13px; }
body.dept-on #ask, body.dept-on #state-line { padding-left: 14px; padding-right: 14px; }
body.dept-on #ask { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
body.dept-on .fine { display: none; }
body.dept-on #dept { right: var(--talk-width); padding: 18px 22px 28px; }
body.dept-on #panels { right: var(--talk-width); width: min(560px, calc(100vw - var(--talk-width))); }
body.dept-on #dept .head { gap: 10px; margin-bottom: 14px; }
body.dept-on #dept .head > div:not(.swatch) { min-width: 0; }
body.dept-on #dept .swatch { width: 32px; height: 32px; box-shadow: none; }
body.dept-on #dept h2 { font-size: 20px; }
body.dept-on #dept .head .x { white-space: nowrap; font-size: 12px; }
body.dept-on #dept .desk { grid-template-columns: minmax(0, 1fr); }
body.dept-on #dept .col { padding: 12px 14px; border-radius: 12px; }
body.dept-on #dept .cols { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 10px; }
#dept .dept-about { margin-top: 3px; font-size: 12px; color: var(--dim); }
#dept .dept-about .job { max-width: 65ch; margin-top: 6px; }
#dept .dept-records { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
#dept .dept-records > summary, #dept .desk-secondary > summary { color: var(--soft); cursor: pointer; padding: 5px 0; font-size: 13px; }
#dept .dept-records[open] > summary { margin-bottom: 10px; }
#dept .desk-secondary > .col { margin-top: 10px; }
#dept .price-search-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
#dept .price-search-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--soft); }
#dept .price-search-form input { width: 100%; min-width: 0; border: 1px solid var(--line-2); background: #0b101a; color: var(--ink); border-radius: 8px; padding: 9px 10px; font: inherit; }
#dept .price-search-form > .primary { min-height: 40px; margin-bottom: 0; }
#dept .price-options { grid-column: 1 / -1; font-size: 12px; color: var(--soft); }
#dept .price-options > label { margin-top: 8px; }
#dept .price-search-form > .muted { font-size: 12px; }
#dept .price-help, #dept .price-coverage { margin: 10px 0; font-size: 12px; color: var(--dim); }
#dept summary { cursor: pointer; }
#dept [data-price-progress]:empty { display: none; }
#dept [data-price-progress]:not(:empty) { margin-top: 10px; }
#dept [data-price-results] { margin-top: 12px; }
@media (max-width: 800px) {
  body.dept-on { --talk-height: clamp(210px, 42dvh, 380px); }
  body.dept-on #main { top: auto; width: 100%; height: var(--talk-height); border-left: 0; border-top: 1px solid var(--line-2); }
  body.dept-on #dept { right: 0; bottom: var(--talk-height); padding: 12px 14px 18px; }
  body.dept-on #panels { right: 0; bottom: var(--talk-height); width: 100%; }
  body.dept-on #bar { padding: 6px 12px; }
  body.dept-on #chat { padding: 6px 14px; gap: 10px; }
  body.dept-on .composer { padding-top: 6px; padding-bottom: 4px; }
  body.dept-on #state-line { min-height: 0; }
  body.dept-on #say { max-height: 72px; font-size: 16px; }
  body.dept-on #ask { padding-top: 4px; padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  body.dept-on #dept .head { align-items: flex-start; }
  body.dept-on #dept .swatch { display: none; }
  body.dept-on #dept h2 { font-size: 17px; }
  body.dept-on #dept .state { padding: 1px 6px; margin-left: 5px; font-size: 10px; }
  body.dept-on #dept .price-search-form { gap: 8px; }
}

body.dept-on #title::before { content: "HARVIS · "; color: var(--accent); }
#dept .price-search-form > .ghost { justify-self: start; padding: 3px 10px; font-size: 12px; }
#dept .chart-bar input { min-width: 0; max-width: 100%; background: #0b101a; border: 1px solid var(--line-2); border-radius: 6px; color: var(--ink); padding: 5px 8px; }
#dept table.fills a { color: var(--accent); }

/* Price tables: keep all six columns legible; narrow screens scroll the table. */
#dept table.price-table { display: table; table-layout: fixed; min-width: 760px; }
#dept table.price-table td, #dept table.price-table th {
  white-space: normal; overflow-wrap: anywhere; vertical-align: top; text-align: left;
}
#dept table.price-table th { position: sticky; top: 0; background: #10141d; }
#dept table.price-table th:nth-child(1) { width: 42%; }
#dept table.price-table th:nth-child(2) { width: 15%; }
#dept table.price-table th:nth-child(3) { width: 12%; }
#dept table.price-table th:nth-child(4) { width: 9%; }
#dept table.price-table th:nth-child(5) { width: 13%; }
#dept table.price-table th:nth-child(6) { width: 9%; }

/* Saved-result shortlist,50 rows per immutable page. */
.price-shortlists select,.price-shortlists textarea{max-width:100%;min-width:0}.price-shortlists textarea{width:100%;box-sizing:border-box}.price-shortlist-scroll{overflow-x:auto;max-height:65vh}.price-shortlist-table{table-layout:fixed;width:100%;min-width:620px}.price-shortlist-table th:first-child{width:55%}.price-shortlist-table td{white-space:normal;overflow-wrap:anywhere}.price-shortlists pre{white-space:pre-wrap;overflow-wrap:anywhere}

/* Product titles open the original listing without losing the HARVIS result list. */
.price-product-link {display:block;white-space:normal;overflow-wrap:anywhere;text-decoration:underline;text-underline-offset:3px;}
.price-product-link:focus-visible {outline:2px solid currentColor;outline-offset:3px;}

/* simple price screen (2026-11-16) */
#dept .price-browse h3 { margin: 4px 0 8px; }
#dept .price-items { display: flex; flex-wrap: wrap; gap: 8px; }
#dept .price-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; flex: 0 0 auto; max-width: 220px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #0b101a; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
#dept .price-item b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 196px; }
#dept .price-item span { font-size: 11px; }
#dept .price-item.on, #dept .price-site.on { border-color: var(--c, #6cf); box-shadow: 0 0 0 1px var(--c, #6cf) inset; }
#dept .price-head { margin: 14px 0 8px; }
#dept .price-site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
#dept .price-site { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #0b101a; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
#dept .price-site .n { font-size: 20px; font-weight: 700; }
#dept .price-site span.muted { font-size: 11px; }
#dept .price-site:disabled { opacity: .45; cursor: default; }
#dept .price-hidden { margin-top: 8px; font-size: 12px; }
#dept .price-hidden .link { background: none; border: 0; padding: 0 2px; color: var(--soft); text-decoration: underline; font: inherit; cursor: pointer; }
#dept .price-list h4 { margin: 16px 0 6px; }
#dept .price-rows { list-style: none; margin: 0; padding: 0; }
#dept .price-rows li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--line-2); }
#dept .price-rows .t { min-width: 0; }
#dept .price-rows a { color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
#dept .price-rows a:hover { text-decoration: underline; }
#dept .price-rows .muted { font-size: 11px; margin-top: 2px; }
#dept .price-rows b { white-space: nowrap; }
#dept .price-nav { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
#dept .price-more { margin-top: 18px; }
#dept .price-nav .ghost.on { border-color: var(--c, #6cf); color: var(--ink); }


/* Personal workspace, 2026-11-20. Existing APIs, task controls and voice stay in place. */
body.workspace-ui {background:#0c0f15;color:#e9edf4}
.workspace-ui #space {display:none}
.workspace-ui #main {max-width:none}
.workspace-ui #bar {padding:20px 32px;border-bottom:1px solid #202630;min-height:68px}
.workspace-ui #title {font-size:14px;color:#c2cad7}
.workspace-ui #universe {flex:none;height:82px;min-height:82px;--core:42px;margin-top:24px}
.workspace-ui #orbit,.workspace-ui #moons,.workspace-ui #moon-label {display:none}
.workspace-ui #core {animation:none;box-shadow:0 0 28px #5eead422}
.workspace-ui #core-approvals {top:50%;left:calc(50% + 60px);transform:translateY(-50%)}
#workspace-home {width:min(100% - 48px,880px);margin:0 auto;min-height:0;overflow-y:auto;scrollbar-width:thin;padding:0 0 16px;flex:1}
.welcome {text-align:center;margin:0 0 26px}
.eyebrow {font:600 10px var(--mono);letter-spacing:.22em;color:#75d6c6}
.welcome h2 {font-size:clamp(23px,3.4vw,34px);line-height:1.3;margin:12px 0 10px;letter-spacing:-.05em}
.welcome p {font-size:13px;color:#9aa7b8;margin:0}
.workspace-cards {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.workspace-card {display:flex;flex-direction:column;text-align:left;min-width:0;gap:12px;background:#141a23;border:1px solid #293241;border-radius:16px;padding:19px;cursor:pointer}
.workspace-card:only-child {grid-column:1 / -1}
.workspace-card:hover {border-color:#5bb6a7;background:#18212a}
.workspace-card-label {font-size:12px;color:#aab7c7}
.workspace-card-value {font-size:23px;line-height:1.2;letter-spacing:-.04em}
.workspace-card-detail {font-size:12px;color:#9daabd;line-height:1.55;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:37px}
.workspace-card.attention {border-color:#7c6237}
.workspace-card.attention strong {color:#f5cf8b}
.workspace-recent {margin-top:16px;display:flex;flex-direction:column;gap:8px}
.workspace-result {border:0;border-bottom:1px solid #242d39;background:transparent;text-align:left;display:flex;align-items:center;gap:14px;padding:10px 2px;cursor:pointer}
.workspace-result span,.workspace-result small {font-size:11px;color:#9aa7b8;flex-shrink:0}
.workspace-result strong {font-size:12px;font-weight:400;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}
#workspace-departments {margin-top:20px;border-top:1px solid #242d39;padding-top:13px;color:#aab7c7;font-size:12px}
#workspace-departments summary {cursor:pointer}
#workspace-dept-list {display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.workspace-dept {border:1px solid #303c4b;background:#161d27;border-radius:8px;padding:8px 12px;font-size:12px;cursor:pointer}
#workspace-connection {font-size:11px;color:#8b9aad;margin:15px 0 0}
.workspace-ui #ask {padding:10px max(24px,calc(50% - 440px)) max(12px,env(safe-area-inset-bottom))}
.workspace-ui .composer {background:#171e28;border-color:#344253;border-radius:17px;box-shadow:none}
.workspace-ui #chat {padding-left:max(24px,calc(50% - 420px));padding-right:max(24px,calc(50% - 420px))}
.workspace-ui #state-line {padding-left:max(24px,calc(50% - 420px))}
.workspace-ui #main:has(#chat:not(:empty)) #workspace-home {display:none}
.workspace-ui #main:has(#chat:not(:empty)) #universe {height:56px;min-height:56px;margin-top:0;--core:30px}
.workspace-ui .fine {font-size:10px;color:#8794a6;margin:7px 0 0}
#workspace-switch {display:none}
.workspace-ui button:focus-visible,.workspace-ui a:focus-visible,.workspace-ui summary:focus-visible {outline:2px solid #72dbc5;outline-offset:3px}
body.workspace-ui.dept-on {--talk-width:clamp(320px,30vw,440px)}
body.workspace-ui.dept-on #workspace-home {display:none}
body.workspace-ui.dept-on #main {background:#10151d}
body.workspace-ui.dept-on #dept {background:#0c0f15;padding:18px 24px 30px}
body.workspace-ui.dept-on #chat {padding:14px 20px}
body.workspace-ui.dept-on #bar {padding:17px 16px}
body.workspace-ui.dept-on #ask {padding:8px 14px 14px}
body.workspace-ui.dept-on #dept .col {background:#141a23;border-color:#293241;border-radius:14px}
body.workspace-ui.dept-on #dept .head {margin-bottom:12px}
body.workspace-ui.dept-on #dept h2 {font-size:18px}
#dept .price-history {margin-bottom:8px}
#dept .price-history > summary {padding:8px 0;color:#b7c4d4;font-size:12px}
#dept .price-history[open] .price-items {max-height:180px;overflow:auto;margin:8px 0}
#dept .price-head {margin:8px 0;font-size:12px}
#dept .price-site-grid {display:flex;gap:7px;overflow-x:auto;padding-bottom:5px;scrollbar-width:thin}
#dept .price-site {flex:0 0 124px;padding:8px 10px}
#dept .price-site .n {font-size:17px}
#dept .price-hidden {font-size:11px}
#dept .price-rows li {padding:14px 2px}
#dept .price-rows b {font-size:15px;color:#91e8d6}
#dept .price-more {border-top:1px solid #2c3644;padding-top:12px}
#dept .price-search-form > .ghost {grid-column:2;grid-row:2}
#dept .price-help {margin-bottom:0}
#dept .price-search-form > .muted:empty {display:none}
@media (max-width:800px) {
 .workspace-ui #bar {min-height:52px;padding:12px 16px}
 .workspace-ui #universe {height:62px;min-height:62px;margin-top:10px;--core:34px}
 #workspace-home {width:calc(100% - 32px)}
 .welcome {margin-bottom:18px}.welcome h2 {font-size:25px}
 .welcome p {font-size:12px}
 .workspace-cards {gap:7px}
 .workspace-card {padding:12px 10px;gap:10px;border-radius:12px}
 .workspace-card-value {font-size:18px}
 .workspace-card-label,.workspace-card-detail {font-size:11px}
 .workspace-card-detail {min-height:34px}
 .workspace-result {gap:8px}.workspace-result small {display:none}
 #workspace-departments {margin-top:14px}
 .workspace-ui #ask {padding:8px 16px max(10px,env(safe-area-inset-bottom))}
 .workspace-ui .fine {font-size:9px}
 body.workspace-ui.dept-on #main {height:100dvh;width:100%;top:0;border:0}
 body.workspace-ui.dept-on:not(.workspace-chat) #main {height:96px;top:auto}
 body.workspace-ui.dept-on:not(.workspace-chat) #main #bar,
 body.workspace-ui.dept-on:not(.workspace-chat) #main #chat,
 body.workspace-ui.dept-on:not(.workspace-chat) #main #state-line {display:none}
 body.workspace-ui.dept-on:not(.workspace-chat) #main #ask {margin:auto 0}
 body.workspace-ui.dept-on #dept {bottom:96px;right:0;padding:14px 16px 20px}
 body.workspace-ui.dept-on.workspace-chat #dept {visibility:hidden;pointer-events:none}
 body.workspace-ui.dept-on #workspace-switch {display:block;position:fixed;right:14px;top:12px;z-index:28;background:#1b2932;color:#a7ecdf;border:1px solid #3c5d61;border-radius:8px;font-size:12px;padding:6px 10px;cursor:pointer}
 body.workspace-ui.dept-on #dept .head {padding-right:88px;position:relative;min-height:38px}
 body.workspace-ui.dept-on #dept .head .x {position:absolute;right:0;top:43px;font-size:10px;padding:2px 6px}
 body.workspace-ui.dept-on #dept h2 {font-size:16px}
 body.workspace-ui.dept-on.workspace-chat #bar {padding-right:104px}
 body.workspace-ui.dept-on #dept .col {padding:10px 12px}
 #dept .price-site {flex-basis:110px}
 #dept .price-rows li {gap:8px}
 #dept .price-rows a {font-size:12px}
 #dept .price-rows b {font-size:13px}
}

/* Saved results take priority over an unused search form. */
#dept .price-new-search > summary {color:#b6e9df;font-size:13px;padding:3px 0}
#dept .price-new-search[open] > summary {margin-bottom:10px}
#dept .price-nav button {background:#18232d;border:1px solid #3a4a5b;border-radius:8px;color:#dce6f2;padding:5px 10px;font:inherit;font-size:12px;cursor:pointer}
#dept .price-nav button.on {background:#1c3a3b;border-color:#68cdbb}
@media(max-width:800px){
 body.workspace-ui.dept-on:not(.workspace-chat) #main {height:136px}
 body.workspace-ui.dept-on #dept {bottom:136px}
 body.workspace-ui.dept-on #dept .head {min-height:68px}
}


/* Reopen the server's saved work directly from completed cards. */
#panel-work .card strong > .link {
  color: var(--ink);
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
#panel-work .card .more {
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
#panel-work .card .more .result-text {
  overflow-wrap: anywhere;
}

/* Gate read-only portfolio */
#dept .gate-head, #dept .gate-bar, #dept .gate-position-top {display:flex;align-items:center;gap:12px}
#dept .gate-head {justify-content:space-between;margin:0 0 18px}
#dept .gate-card {background:#141a23;border:1px solid #344253;border-radius:14px;overflow:hidden}
#dept .gate-card-title {padding:18px;cursor:pointer;color:var(--ink)}
#dept .gate-card-title strong {font-size:1.05rem;margin-right:12px}
#dept .gate-card-title .muted, #dept .gate-bar, #dept .gate-basis {font-size:.8rem}
#dept .gate-bar {padding:10px 16px;flex-wrap:wrap;border-top:1px solid var(--line)}
#dept .gate-bar button {margin-left:auto}
#dept .gate-content {padding:0 16px 12px}
#dept .gate-metrics {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
#dept .gate-metric {padding:12px;background:#0c121b;border-radius:9px;overflow-wrap:anywhere}
#dept .gate-metric span {display:block;font-size:.78rem;color:var(--soft);margin-bottom:5px}
#dept .gate-metric strong, #dept .gate-position-top strong {font-variant-numeric:tabular-nums}
#dept .gate-metric:first-child {border:1px solid #42675d}
#dept .gate-positions h3 {font-size:1rem;margin:18px 0 8px}
#dept .gate-position {border-top:1px solid var(--line);padding:9px 0}
#dept .gate-position-top {gap:6px;flex-wrap:wrap}
#dept .gate-position-top strong:last-child {margin-left:auto}
#dept .gate-position .muted {font-size:.8rem;line-height:1.5}
#dept .gate-side {font-size:.78rem;border:1px solid currentColor;border-radius:4px;padding:0 5px}
#dept .gate-side.long {color:#8ce0c3} #dept .gate-side.short {color:#ffb3a3}
#dept .gate-basis {margin-bottom:0}
@media(max-width:650px){
  #dept .gate-head {padding-right:86px;flex-wrap:wrap}
  #dept .gate-metrics {grid-template-columns:repeat(2,minmax(0,1fr))}
  #dept .gate-metric:first-child {grid-column:1/-1}
  #dept .gate-card-title {padding:14px}
}
