:root {
  color-scheme: dark;
  --bg: #0b1220; --surface: #141c2c; --raised: #1c2638; --fg: #e7eef8;
  --muted: #8d9bb0; --line: #2a364c; --primary: #3b82f6; --primary-fg: #f8fbff;
  --up: #ff5a6a; --down: #6aa7ff;
  --font: "IBM Plex Sans KR", "Apple SD Gothic Neo", sans-serif;
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f6fb; --surface: #ffffff; --raised: #e7eef8; --fg: #142033;
  --muted: #5c6b82; --line: #d5deea; --primary: #2563eb; --primary-fg: #ffffff;
  --up: #e11d48; --down: #2563eb;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
main { position: relative; max-width: 80rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
h1 { margin: 0 0 1.1rem; font-size: 1.7rem; letter-spacing: -0.03em; text-align: center; }
h1 .ver { color: var(--muted); font-size: 0.72em; font-weight: 500; }
.sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; }
.sheet-back { position: absolute; inset: 0; background: rgba(8, 12, 20, .46); }
.sheet-card { position: relative; width: min(26rem, calc(100% - 1.5rem)); margin: 0; background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: 1rem; padding: 1rem 1rem 1.15rem; max-height: min(36rem, calc(100vh - 2rem)); overflow: auto; animation: sheet-in .22s ease; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.sheet-head h2 { margin: 0; font-size: 1.15rem; }
.close-emoji { border: 0; background: transparent; font-size: 1.15rem; line-height: 1; width: 2rem; height: 2rem; border-radius: 999px; }
.sec-row { display: flex; align-items: center; gap: 0.65rem; padding: 0.7rem 0.15rem; border-top: 1px solid var(--line); cursor: grab; user-select: none; touch-action: none; }
.sec-row.dragging { opacity: 0.45; }
.sec-row.off { opacity: 0.45; }
.sec-row .grip { color: var(--muted); letter-spacing: -0.12em; }
.sec-row .sec-name { flex: 1; }
.sec-row .sec-state { color: var(--muted); font-size: 0.8rem; }
.account { position: absolute; top: 1.5rem; right: 1rem; z-index: 25; }
.account > button { width: 2.6rem; height: 2.6rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); display: inline-flex; align-items: center; justify-content: center; }
.account-menu { position: absolute; right: 0; top: 3rem; width: max-content; background: var(--surface); border: 1px solid var(--line); border-radius: 0.8rem; padding: 0.3rem; display: grid; box-shadow: 0 12px 28px rgba(8, 12, 20, .22); }
.account-menu a, .account-menu button { display: block; width: 100%; text-align: left; padding: 0.4rem 0.7rem; border-radius: 0.55rem; color: inherit; text-decoration: none; border: 0; background: transparent; font-size: 0.78rem; white-space: nowrap; }
.account-menu a:hover, .account-menu button:hover { background: var(--raised); }
.copy { margin: 1.6rem 0 0; text-align: center; color: var(--muted); font-size: 0.75rem; }
.auth-wrap { max-width: 26rem; margin: 4rem auto; }
.auth-wrap h1 { font-size: 1.45rem; }
.auth-wrap a { color: var(--primary); }
.g-recaptcha { margin-top: 0.9rem; }
.set-label { margin: 0.9rem 0 0.45rem; }
.style-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.45rem; }
.style-pick button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem; min-height: 4.6rem; border-radius: 0.8rem; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 0.75rem; padding: 0.45rem; }
.style-pick button.on { color: var(--fg); border-color: var(--primary); background: var(--raised); }
.icon svg { display: block; }
.muted { color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-end; justify-content: space-between; }
header.row { margin-bottom: 1rem; align-items: center; }
#tools { align-items: center; }
#account { width: auto; min-width: 14rem; }
.panel, .card, article.item { background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; }
.panel { padding: 1.25rem; }
.cards { display: grid; gap: 0.75rem; margin-top: 1rem; }
@media (min-width: 640px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { overflow: hidden; }
.card, article.item { padding: 1rem; }
.value { margin: 0.5rem 0 0; font-size: 1.35rem; font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
label { display: grid; gap: 0.25rem; margin-top: 0.75rem; }
input, select {
  height: 2.75rem; border-radius: 0.75rem; border: 1px solid var(--line);
  background: var(--bg); padding: 0 0.75rem; min-width: 0; width: 100%;
}
.secret { display: flex; gap: 0.5rem; align-items: center; }
.secret input { flex: 1; width: auto; min-width: 0; }
.secret button.ghost { width: auto; margin: 0; flex: none; white-space: nowrap; padding: 0 0.9rem; }
button.primary, button.ghost {
  height: 2.75rem; border-radius: 0.75rem; border: 0; padding: 0 0.9rem; font-weight: 650;
}
button.primary { background: var(--primary); color: var(--primary-fg); width: 100%; margin-top: 0.9rem; }
button.ghost { background: var(--surface); border: 1px solid var(--line); }
button.link { background: none; border: 0; color: var(--muted); height: 2.75rem; text-decoration: underline; }
h2 { margin: 0; font-size: 1.2rem; }
.addline { display: flex; gap: 0.5rem; margin-top: 0.75rem; align-items: center; }
.addline input, .addline select { flex: 1; width: auto; min-width: 0; }
.addline select { max-width: 16rem; }
.addline button.ghost { width: auto; margin-top: 0; flex: none; white-space: nowrap; padding: 0 1.05rem; }
.spark { display: block; width: 42px; height: 28px; margin-left: auto; }
.news-list { display: grid; }
.news-card { display: grid; gap: 0.25rem; width: 100%; text-align: left; background: transparent; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 0.75rem 0; cursor: pointer; color: inherit; text-decoration: none; }
.news-card .full { display: none; }
.news-card.open .short { display: none; }
.news-card.open .full { display: block; }
.news-card:disabled { cursor: default; }
#newsList, #xPosts { display: grid; grid-template-columns: 1fr; gap: 0.75rem; margin-top: 1rem; align-items: stretch; }
@media (min-width: 720px) { #newsList, #xPosts { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { #newsList, #xPosts { grid-template-columns: 1fr 1fr 1fr; } }
.news-symbol, .x-person { margin-top: 0; min-width: 0; height: 100%; display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line); border-radius: 0.9rem; padding: 0.85rem 0.9rem 0.35rem; }
.news-list { flex: 1; }
.news-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.35rem; }
.news-hide { border: 0; background: transparent; color: var(--muted); height: 1.6rem; padding: 0 0.25rem; font-size: 1.05rem; line-height: 1; }
.news-card strong { white-space: normal; }
.x-person h3 { margin: 0; font-size: 1rem; }
.x-person p { margin: 0.25rem 0 0; }
.x-post { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.75rem 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; cursor: pointer; }
.x-body { flex: 1; min-width: 0; }
.x-body p { margin: 0.25rem 0 0; white-space: pre-wrap; }
.x-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 0.55rem; flex: none; background: var(--raised); }
.x-go { margin-left: auto; align-self: center; flex: none; }
.x-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }
.x-chips button { height: 2rem; border-radius: 999px; border: 1px solid var(--line); background: transparent; padding: 0 0.7rem; color: var(--muted); display: inline-flex; align-items: center; gap: 0.35rem; }
.x-chips .logo-wrap { width: 18px; height: 18px; }
.x-mini { width: 18px; height: 18px; border-radius: 999px; object-fit: cover; flex: none; background: var(--raised); }
.x-ko { margin: 0.35rem 0 0; color: var(--muted); }
.boot { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; background: rgba(7, 11, 18, .55); color: #fff; }
.boot-box { display: flex; flex-direction: column; align-items: center; }
.boot-box img { width: 7.5rem; height: auto; margin-bottom: 0.9rem; border-radius: 20px; }
.boot p { display: flex; align-items: center; gap: 0.75rem; margin: 0; font-size: 1.2rem; font-weight: 650; }
.boot .spin { width: 1.35rem; height: 1.35rem; border-color: rgba(255,255,255,.35); border-top-color: #fff; }
strong.ip { color: var(--primary); }
.guide-line { margin: 0.85rem 0 0; }
a.guide { display: inline-flex; color: var(--muted); font-size: 0.8rem; text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 0.28rem 0.7rem; background: transparent; }
.busy { display: flex; align-items: center; gap: 0.7rem; margin: 0.5rem 0 1rem; }
.busy[hidden] { display: none; }
.spin { width: 1.15rem; height: 1.15rem; border: 2px solid var(--line); border-top-color: var(--primary, #4c8dff); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
#watch, #screen, #external, #news, #xfeed { margin-top: 2.5rem; margin-bottom: 2.5rem; }
.unit { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.unit button { height: 2rem; border: 0; background: transparent; padding: 0 0.8rem; }
.unit button.on { background: var(--primary); color: var(--primary-fg); }
.avgpre { display: inline-flex; align-items: center; justify-content: flex-end; gap: 0.2rem; }
td input.num { height: 2.25rem; }
.named { display: flex; align-items: center; gap: 0.65rem; min-width: 0; }
.logo-wrap { width: 28px; height: 28px; border-radius: 999px; overflow: hidden; flex: none; background: var(--raised); }
.logo-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.8rem; }
.tabs button { height: 2.4rem; border-radius: 999px; border: 1px solid var(--line); background: transparent; padding: 0 0.85rem; cursor: grab; touch-action: pan-y; }
.tabs button.dragging { cursor: grabbing; position: relative; z-index: 2; opacity: 0.9; box-shadow: 0 8px 20px rgba(0,0,0,.35); }
.tabs button.on { background: var(--primary); color: var(--primary-fg); border-color: transparent; }
.tabtools { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.55rem; }
.tabtools button { height: 2.15rem; border-radius: 999px; border: 1px solid var(--line); background: var(--raised); padding: 0 0.75rem; color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.tabtools button:hover { color: var(--fg); background: var(--bg); }
.dock { position: fixed; right: 1rem; bottom: 1rem; z-index: 40; display: flex; flex-direction: column; align-items: flex-end; gap: 0.4rem; }
.dock > button, .dock .unit { box-shadow: 0 8px 22px rgba(15, 23, 42, .18); }
.titleline { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; }
button.ghost.slim { height: 2.15rem; padding: 0 0.8rem; font-size: 0.85rem; }
.dock > button { width: 2.6rem; height: 2.6rem; padding: 0; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); display: inline-flex; align-items: center; justify-content: center; }
.sumline { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--line); }
.sumline span { display: grid; gap: 0.15rem; }
.sumline em { font-style: normal; }
.sumline strong { font-size: 1.05rem; font-weight: 650; }
#externalFx { margin-left: auto; }
a.toss { display: inline-flex; align-items: center; gap: 0.28rem; height: 2rem; padding: 0 0.6rem; border-radius: 999px; border: 1px solid var(--line); color: var(--fg); text-decoration: none; font-size: 0.82rem; white-space: nowrap; }
a.toss svg { flex: none; display: block; }


.error { margin-top: 1rem; background: var(--raised); border: 1px solid var(--line); color: var(--up); border-radius: 0.75rem; padding: 0.75rem 1rem; }
.up { color: var(--up); } .down { color: var(--down); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; table-layout: fixed; font-variant-numeric: tabular-nums; }
#desk col.c-name { width: 18%; }
#desk col.c-qty { width: 9%; }
#desk col.c-money { width: 12%; }
#desk col.c-rsi { width: 9%; }
#desk col.c-chart { width: 5%; }
#desk col.c-go { width: 11%; }
#externalDesk col.c-name { width: 15%; }
#externalDesk col.c-qty { width: 8%; }
#externalDesk col.c-money { width: 12%; }
#externalDesk col.c-rsi { width: 8%; }
#externalDesk col.c-chart { width: 5%; }
#externalDesk col.c-act { width: 6%; }
#externalDesk col.c-go { width: 10%; }
#watchDesk col.c-name { width: 22%; }
#watchDesk col.c-money { width: 14%; }
#watchDesk col.c-rsi { width: 10%; }
#watchDesk col.c-chart { width: 5%; }
#watchDesk col.c-act { width: 7%; }
#watchDesk col.c-go { width: 8%; }
#screenDesk col.c-name { width: 24%; }
#screenDesk col.c-money { width: 14%; }
#screenDesk col.c-rsi { width: 11%; }
#screenDesk col.c-chart { width: 5%; }
#screenDesk col.c-go { width: 10%; }
th, td { padding: 0.55rem 0.35rem; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
th { color: var(--muted); font-weight: 500; }
th.name, td.name { text-align: left; }
.desk { display: none; margin-top: 1rem; overflow-x: hidden; }
.phone { display: grid; gap: 0.75rem; margin-top: 1rem; }
@media (min-width: 768px) { .desk { display: block; } .phone { display: none; } }
.meta { font-size: 0.875rem; }
