:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #fff;
  --ink: #17202b;
  --muted: #536171;
  --line: #c6cdd6;
  --accent: #235dcc;
  --good: #17633e;
  --bad: #ac303e;
  --wash: #eaf0fb;
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s6: 24px;
  --s8: 32px;
  --s12: 48px;
  --radius: 8px;
  --small: 14px;
  --body: 16px;
  --h2: 20px;
  --h1: 30px;
  --metric: 24px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11151c;
  --surface: #191f29;
  --ink: #eff3f8;
  --muted: #abb8c9;
  --line: #526174;
  --accent: #9bbcff;
  --good: #8bd7ad;
  --bad: #ffabb3;
  --wash: #243249;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    var(--body)/1.5 -apple-system,
    BlinkMacSystemFont,
    "Apple SD Gothic Neo",
    "Malgun Gothic",
    sans-serif;
  font-variant-numeric: tabular-nums;
}
a {
  color: var(--accent);
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-thickness: 2px;
}
button,
select,
textarea {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
button,
select {
  min-height: 44px;
  padding: var(--s2) var(--s4);
}
button {
  cursor: pointer;
  white-space: normal;
}
button:hover {
  background: var(--wash);
}
button:active {
  background: var(--line);
}
button:disabled {
  cursor: wait;
  opacity: 0.65;
}
button.primary {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}
button.primary:hover {
  opacity: 0.9;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
textarea {
  width: 100%;
  padding: var(--s3);
  resize: vertical;
  min-height: 160px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: var(--h1);
  line-height: 1.25;
  margin-bottom: var(--s2);
  letter-spacing: -0.02em;
}
h2 {
  font-size: var(--h2);
  line-height: 1.25;
  margin-bottom: var(--s4);
}
h3 {
  font-size: var(--body);
}
p {
  margin-bottom: var(--s3);
}
small {
  display: block;
  font-size: var(--small);
  color: var(--muted);
}
.muted,
.empty {
  color: var(--muted);
  font-size: var(--small);
}
.empty {
  padding: var(--s4) 0;
}
.header {
  padding: var(--s4) var(--s8);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  gap: var(--s4);
}
.brand {
  font-size: var(--h2);
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}
.brand span {
  font-size: var(--small);
  color: var(--muted);
  font-weight: 400;
  margin-left: var(--s4);
}
nav {
  display: flex;
  align-items: center;
  gap: var(--s6);
}
nav a {
  font-size: var(--small);
}
main {
  max-width: 1440px;
  margin: auto;
  padding: var(--s8);
}
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s6);
  margin-bottom: var(--s4);
}
.heading p {
  margin: 0;
}
.feedback {
  font-size: var(--small);
  min-height: 44px;
  padding: var(--s3) 0;
  overflow-wrap: anywhere;
}
.feedback.error {
  color: var(--bad);
}
.status-band {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s4) var(--s8);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: var(--s4) 0;
  font-size: var(--small);
}
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  margin-right: var(--s2);
}
.status-dot.active {
  background: var(--good);
}
.markets {
  display: flex;
  flex-wrap: wrap;
  padding: var(--s6) 0;
  gap: var(--s6);
}
.market {
  flex: 1 1 155px;
}
.market > span {
  font-size: var(--small);
  color: var(--muted);
}
.market strong {
  display: block;
  font-size: var(--body);
  margin: var(--s1) 0;
}
.market strong span {
  font-size: var(--small);
  font-weight: 400;
  display: block;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--s6);
  align-items: start;
}
.main-column,
.rail {
  min-width: 0;
  display: grid;
  gap: var(--s6);
}
.panel {
  padding: var(--s6);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  flex-wrap: wrap;
  margin-bottom: var(--s4);
}
.section-heading h2 {
  margin: 0;
}
.strategy-label {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: var(--small);
}
.decision {
  padding: var(--s4) 0;
  border-top: 1px solid var(--line);
}
.decision p {
  font-size: var(--small);
  color: var(--muted);
  margin-top: var(--s2);
}
.notice {
  font-size: var(--small);
  color: var(--muted);
  margin-bottom: var(--s2);
}
.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  margin: var(--s4) 0;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: var(--small);
  white-space: nowrap;
}
th,
td {
  text-align: right;
  border-bottom: 1px solid var(--line);
  padding: var(--s3) var(--s2);
}
th {
  font-weight: 500;
  color: var(--muted);
}
th:first-child,
td:first-child {
  text-align: left;
}
td small {
  font-size: var(--small);
}
tbody tr:last-child td {
  border-bottom: 0;
}
.positive {
  color: var(--good);
}
.negative {
  color: var(--bad);
}
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}
details {
  border-top: 1px solid var(--line);
  padding-top: var(--s3);
  margin-top: var(--s4);
}
summary {
  cursor: pointer;
  min-height: 44px;
  display: list-item;
  padding: var(--s2) 0;
  font-size: var(--small);
  font-weight: 600;
}
details p {
  font-size: var(--small);
  line-height: 1.7;
}
form {
  display: grid;
  gap: var(--s3);
}
form label {
  font-size: var(--small);
}
form p {
  margin: 0;
}
.portfolio {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s6);
  margin: var(--s6) 0;
}
.portfolio dt {
  font-size: var(--small);
  color: var(--muted);
}
.portfolio dd {
  margin: var(--s1) 0 0;
  font-size: var(--metric);
  font-weight: 650;
  overflow-wrap: anywhere;
}
.news-list,
.event-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.news-list li,
.event-list li {
  padding: var(--s4) 0;
  border-bottom: 1px solid var(--line);
}
.news-list li:last-child,
.event-list li:last-child {
  border: 0;
}
.news-meta {
  font-size: var(--small);
  color: var(--muted);
  margin-bottom: var(--s2);
}
.news-list a {
  color: var(--ink);
  font-weight: 600;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.news-list p {
  font-size: var(--small);
  color: var(--muted);
  margin: var(--s2) 0 0;
}
.event-list p {
  font-size: var(--small);
  margin: var(--s2) 0 0;
  overflow-wrap: anywhere;
}
.rail > section > button {
  width: 100%;
}
.rail p {
  line-height: 1.7;
}
.skip {
  position: fixed;
  top: -100px;
  left: var(--s4);
  z-index: 2;
  background: var(--surface);
  padding: var(--s4);
}
.skip:focus {
  top: var(--s4);
}
footer {
  font-size: var(--small);
  color: var(--muted);
  margin-top: var(--s8);
  padding-top: var(--s6);
  border-top: 1px solid var(--line);
}
.guide {
  max-width: 900px;
}
.guide section {
  margin: var(--s8) 0;
}
.guide li {
  margin: var(--s3) 0;
}
.guide code {
  overflow-wrap: anywhere;
  white-space: normal;
}
.formula {
  padding: var(--s4);
  background: var(--wash);
  overflow-wrap: anywhere;
}
.guide p {
  line-height: 1.8;
}
@media (max-width: 960px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rail > section:last-child {
    grid-column: 1/-1;
  }
  .brand span {
    display: none;
  }
}
@media (max-width: 600px) {
  main {
    padding: var(--s6) var(--s4);
  }
  .header {
    padding: var(--s4);
    flex-wrap: wrap;
  }
  nav {
    gap: var(--s3);
  }
  .heading {
    align-items: stretch;
    flex-direction: column;
  }
  .heading button {
    align-self: flex-start;
  }
  .panel {
    padding: var(--s4);
  }
  .rail {
    grid-template-columns: minmax(0, 1fr);
  }
  h1 {
    font-size: var(--metric);
  }
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .strategy-label {
    flex-wrap: wrap;
  }
  .controls button {
    flex: 1;
  }
  .portfolio {
    gap: var(--s4);
  }
  .portfolio dd {
    font-size: var(--h2);
  }
  .market {
    flex-basis: 120px;
  }
  .brand {
    font-size: var(--body);
  }
  .guide {
    padding: var(--s4);
  }
}

/* 공개 대시보드 로그인 화면 */
.login { max-width: 22rem; margin: 12vh auto; padding: 0 1rem; }
.login form { display: grid; gap: 0.9rem; margin-top: 1rem; }
.login label { display: grid; gap: 0.35rem; font-weight: 600; }
.login input { font: inherit; padding: 0.6rem 0.7rem; border: 1px solid currentColor; border-radius: 0.4rem; background: transparent; color: inherit; }
.login button { font: inherit; padding: 0.65rem; border-radius: 0.4rem; cursor: pointer; }
.login .error { color: #c62828; }
