@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700;800&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  --paper: #f3f5f8;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --ink: #10243b;
  --text: #2c3e50;
  --muted: #5c6c7d;
  --subtle: #748394;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --soft: #eef2f6;
  --navy: #14283f;
  --navy-hover: #1e3a5a;
  --gold: #b38038;
  --gold-soft: #faf3e6;
  --gain: #d14345;
  --gain-bg: #fdf2f2;
  --loss: #2e6fd1;
  --loss-bg: #eff5fd;
  --green: #25735a;
  --green-bg: #eaf5f0;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 3px rgba(16, 36, 59, 0.04), 0 10px 30px rgba(16, 36, 59, 0.045);
  --shadow-lg: 0 24px 60px rgba(10, 25, 47, 0.22);
  font-family: 'DM Sans', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  touch-action: manipulation;
}

button {
  cursor: pointer;
  color: inherit;
}

a {
  color: inherit;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2.5px solid #356ca3;
  outline-offset: 2px;
}

button:focus:not(:focus-visible) {
  outline: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  color: var(--ink);
}

button svg,
.icon {
  width: 18px;
  height: 18px;
  flex: none;
}

button svg {
  vertical-align: middle;
}

svg {
  display: block;
}

input,
select,
textarea {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  min-height: 44px;
  padding: 10px 13px;
  width: 100%;
  outline: none;
  font-size: 13.5px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #3f6f9e;
  box-shadow: 0 0 0 3px rgba(63, 111, 158, 0.14);
}

input::placeholder,
textarea::placeholder {
  color: #8c9aa8;
}

label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #3f5164;
  margin-bottom: 7px;
}

textarea {
  resize: vertical;
}

form {
  margin: 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  white-space: nowrap;
  font-size: 13px;
}

th {
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
  font-weight: 600;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--line);
}

th,
td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #f8fafd;
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

td strong {
  font-weight: 600;
  color: var(--ink);
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 1000;
}

.skip-link:focus {
  top: 12px;
}

.initial-loading {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 18px;
  text-align: center;
  justify-items: center;
  color: var(--muted);
  font-size: 13.5px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: var(--navy);
  color: #e8c595;
  border-radius: 10px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -2px;
  padding-right: 2px;
  box-shadow: 0 4px 12px rgba(20, 40, 63, 0.16);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: var(--ink);
  line-height: 1.2;
}

.brand-caption {
  font-size: 9px;
  letter-spacing: 1.8px;
  margin-top: 3px;
  color: var(--subtle);
  font-weight: 600;
}

.eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.6px;
  color: var(--gold);
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.tiny {
  font-size: 11.5px;
  line-height: 1.5;
}

.gain {
  color: var(--gain) !important;
}

.loss {
  color: var(--loss) !important;
}

.neutral {
  color: var(--muted) !important;
}

.positive {
  color: var(--green);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 8px;
  min-height: 40px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
  white-space: nowrap;
}

.button:hover {
  background: #f1f5f9;
  border-color: #b6c2cf;
}

.button:active {
  transform: translateY(1px);
}

.button.primary {
  background: var(--navy);
  color: #ffffff;
  border-color: var(--navy);
}

.button.primary:hover {
  background: var(--navy-hover);
  border-color: var(--navy-hover);
}

.button.small {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 12px;
}

.button.ghost {
  background: transparent;
  border-color: transparent;
}

.button.danger {
  color: var(--gain);
  background: var(--gain-bg);
  border-color: #f3c6c6;
}

.button.danger:hover {
  background: #fae4e4;
}

.button.full {
  width: 100%;
}

.text-button {
  padding: 4px 2px;
  border: 0;
  background: none;
  color: #365f87;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.text-button:hover {
  color: var(--navy);
  text-decoration: underline;
}

.icon-button {
  height: 36px;
  width: 36px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
  transition: background 0.15s ease;
}

.icon-button:hover {
  background: var(--soft);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  line-height: 1.25;
  font-weight: 600;
  border-radius: 6px;
  padding: 4px 9px;
  background: var(--soft);
  color: #46586b;
  white-space: nowrap;
}

.badge.amber {
  background: #fbf0da;
  color: #8c6322;
}

.badge.green {
  background: var(--green-bg);
  color: #216650;
}

.badge.blue {
  background: var(--loss-bg);
  color: #255ca8;
}

.badge.red {
  background: var(--gain-bg);
  color: #b43638;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
  flex: none;
}

.divider {
  height: 1px;
  background: var(--line);
}

.field {
  margin-bottom: 18px;
}

.field-help {
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--muted);
  margin-top: 7px;
}

.form-error {
  font-size: 12.5px;
  font-weight: 500;
  color: #b83737;
  line-height: 1.6;
  margin: 12px 0;
}

.empty-state {
  padding: 40px 22px;
  text-align: center;
  color: var(--muted);
  display: grid;
  justify-items: center;
  gap: 10px;
  font-size: 13px;
  line-height: 1.75;
}

.empty-state .icon {
  width: 28px;
  height: 28px;
  color: #9aa7b5;
}

.empty-state strong {
  font-weight: 600;
  color: var(--ink);
  font-size: 14px;
}

.toast-region {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: grid;
  gap: 8px;
  width: min(92vw, 440px);
  pointer-events: none;
}

.toast {
  background: #172e47;
  color: #ffffff;
  box-shadow: 0 10px 30px rgba(16, 36, 59, 0.24);
  padding: 13px 18px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.55;
  animation: toast-in 0.2s ease;
}

.toast.error {
  background: #9e3535;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.noscript {
  padding: 30px;
}

.mono {
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* Welcome & Auth */
.welcome {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1.1fr) minmax(420px, 1fr);
  background: var(--surface);
}

.welcome-story {
  background: linear-gradient(160deg, #13263d 0%, #19324e 100%);
  color: #c5d1dd;
  padding: 48px clamp(36px, 5vw, 96px);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
}

.welcome-story .brand-name {
  color: #ffffff;
}

.welcome-story .brand-caption {
  color: #93a4b6;
}

.welcome-story .brand-mark {
  background: #27405b;
  color: #ebd0a0;
}

.story-copy {
  position: relative;
  z-index: 1;
  margin: 56px 0;
}

.story-copy .eyebrow {
  color: #deb97c;
  margin-bottom: 20px;
}

.story-copy h1 {
  font-size: clamp(34px, 3.5vw, 52px);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -1.8px;
  color: #ffffff;
}

.story-copy h1 span {
  color: #e4c287;
}

.story-description {
  font-size: 14px;
  line-height: 1.9;
  margin-top: 22px;
  color: #b4c3d3;
  max-width: 420px;
  word-break: keep-all;
}

.story-visual {
  margin-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 22px;
  max-width: 420px;
}

.story-line {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: #a9bacb;
  letter-spacing: 1.2px;
  margin-bottom: 16px;
}

.story-visual svg {
  width: 100%;
  height: 92px;
}

.story-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.story-tags span {
  font-size: 11px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  color: #c1d0de;
  background: rgba(255, 255, 255, 0.04);
}

.story-foot {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 1.2px;
  color: #8499ae;
  position: relative;
  z-index: 1;
  gap: 20px;
}

.story-decoration {
  position: absolute;
  width: 650px;
  height: 650px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  transform: rotate(-28deg);
  right: -290px;
  bottom: -180px;
  border-radius: 100px;
  box-shadow: 0 0 0 65px rgba(255, 255, 255, 0.02), 0 0 0 130px rgba(255, 255, 255, 0.01);
  pointer-events: none;
}

.welcome-form-area {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px 40px;
  background: #f8fafc;
}

.welcome-form {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px 30px;
  box-shadow: var(--shadow);
}

.welcome-form h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.7px;
  margin: 10px 0 10px;
}

.welcome-subtitle {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
  margin-bottom: 22px;
  white-space: pre-line;
}

.welcome-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: var(--soft);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 22px;
}

.welcome-mode-tab {
  border: 0;
  background: transparent;
  border-radius: 7px;
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.welcome-mode-tab:hover {
  color: var(--ink);
}

.welcome-mode-tab.active {
  background: var(--surface);
  color: var(--navy);
  box-shadow: 0 1px 3px rgba(16, 36, 59, 0.1);
}

.welcome-form .field {
  margin-bottom: 16px;
}

.welcome-form input,
.welcome-form select {
  background: var(--surface);
  min-height: 45px;
}

.welcome-form .button.primary {
  min-height: 46px;
  font-size: 14px;
}

.welcome-form-footer {
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  line-height: 1.75;
  margin-top: 24px;
}

.welcome-or {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--subtle);
  font-size: 11.5px;
  font-weight: 500;
  margin: 22px 0 16px;
}

.welcome-or:before,
.welcome-or:after {
  content: '';
  height: 1px;
  background: var(--line);
  flex: 1;
}

.demo-entry {
  padding: 15px 16px;
  border: 1px solid var(--line-strong);
  background: var(--surface-alt);
  border-radius: 11px;
  display: flex;
  align-items: center;
  gap: 13px;
  text-align: left;
  width: 100%;
  color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.demo-entry:hover {
  border-color: #7c95ae;
  background: #f0f5fa;
}

.demo-entry > .icon {
  width: 22px;
  height: 22px;
  color: #4b6e91;
}

.demo-entry strong {
  font-size: 13px;
  font-weight: 700;
  display: block;
}

.demo-entry small {
  font-size: 11.5px;
  color: var(--muted);
  display: block;
  margin-top: 3px;
}

.demo-entry > .arrow {
  margin-left: auto;
  color: #6b7f94;
}

.setup-notice {
  padding: 12px 14px;
  border-radius: 8px;
  background: #fbf3e4;
  border: 1px solid #eedcb9;
  color: #845f26;
  font-size: 12px;
  line-height: 1.7;
  margin-bottom: 18px;
}

.welcome-switch {
  margin-top: 14px;
  text-align: center;
}

.welcome-version {
  margin-top: 28px;
  color: var(--subtle);
  font-size: 10.5px;
  letter-spacing: 1.5px;
  font-weight: 600;
}

.connection-note {
  font-size: 12px;
  line-height: 1.7;
  color: #845f26;
  background: #fbf3e4;
  border: 1px solid #eedcb9;
  padding: 12px 14px;
  margin-bottom: 18px;
  border-radius: 8px;
}

/* App Shell */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 224px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 35;
  padding: 24px 16px 18px;
  overflow-y: auto;
}

.sidebar .brand {
  padding: 0 6px 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.nav-section-title {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--subtle);
  margin: 18px 12px 8px;
  font-weight: 700;
}

.nav-list {
  display: grid;
  gap: 4px;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 11px 12px;
  border-radius: 9px;
  color: #536475;
  font-size: 13.5px;
  font-weight: 500;
  min-height: 43px;
  position: relative;
  transition: background 0.14s ease, color 0.14s ease;
}

.nav-button .icon {
  width: 18px;
  height: 18px;
  color: #778798;
}

.nav-button:hover {
  background: #f3f6fa;
  color: var(--navy);
}

.nav-button:hover .icon {
  color: var(--navy);
}

.nav-button.active {
  background: #eaf1f8;
  color: var(--navy);
  font-weight: 700;
}

.nav-button.active .icon {
  color: var(--navy);
}

.nav-button.active:before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  background: var(--navy);
  border-radius: 0 3px 3px 0;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 24px;
}

.sidebar-note {
  padding: 14px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.75;
}

.sidebar-note strong {
  display: block;
  font-size: 12px;
  color: var(--ink);
  margin-bottom: 4px;
  font-weight: 600;
}

.sidebar-legal {
  font-size: 9.5px;
  color: var(--subtle);
  letter-spacing: 0.7px;
  line-height: 1.7;
  margin: 14px 6px 0;
}

.shell-body {
  grid-column: 2;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  height: 68px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  padding: 0 32px;
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--subtle);
  min-width: 0;
}

.breadcrumb strong {
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.kst-clock {
  font-size: 12px;
  font-weight: 600;
  color: #465a6e;
  background: var(--soft);
  padding: 6px 11px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}

.kst-clock .icon {
  width: 14px;
  height: 14px;
  color: #5a7490;
}

.topbar-separator {
  height: 22px;
  width: 1px;
  background: var(--line);
}

.profile-button {
  border: 1px solid transparent;
  background: transparent;
  padding: 4px 8px 4px 4px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  transition: background 0.14s ease, border-color 0.14s ease;
}

.profile-button:hover {
  background: var(--soft);
  border-color: var(--line);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e5edf6;
  color: var(--navy);
  font-size: 13px;
  display: grid;
  place-items: center;
  font-weight: 700;
  flex: none;
}

.profile-label {
  text-align: left;
  line-height: 1.25;
}

.profile-label small {
  display: block;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--subtle);
  margin-top: 2px;
}

.menu-button {
  display: none;
}

.demo-banner {
  min-height: 40px;
  padding: 10px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: #fbf2de;
  border-bottom: 1px solid #ead8b1;
  color: #7b5a25;
  font-size: 12px;
  line-height: 1.6;
}

.demo-banner strong {
  font-weight: 700;
  margin-right: 8px;
}

.demo-banner .text-button {
  color: #7b5a25;
  font-size: 12px;
  flex: none;
}

.workspace {
  padding: 28px 32px 32px;
  max-width: 1680px;
  margin: auto;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.page-header .eyebrow {
  font-size: 10.5px;
  margin-bottom: 7px;
}

.page-header h1 {
  font-size: 26px;
  letter-spacing: -0.8px;
  font-weight: 800;
  line-height: 1.3;
}

.page-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.6;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}

.data-state {
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}

.data-state.live {
  color: #216e53;
}

.data-state.partial {
  color: #936827;
}

.data-state-action {
  appearance: none;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  min-height: 34px;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.data-state-action:hover {
  background: var(--surface-alt);
  border-color: var(--line-strong);
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 22px;
  align-items: start;
}

.main-column {
  min-width: 0;
  display: grid;
  gap: 22px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 20px 22px 16px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.3px;
}

.panel-title .icon {
  width: 17px;
  height: 17px;
  color: #4f6c8a;
}

.panel-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.55;
}

.panel-foot {
  padding: 13px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface-alt);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--muted);
}

/* Market Indicators Grid */
.market-section-label {
  padding: 10px 22px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #36506b;
  background: var(--surface-alt);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
}

.market-section-label:before {
  content: '';
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--gold);
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.quote-card {
  min-width: 0;
  padding: 18px 18px 15px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  position: relative;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.quote-card:nth-child(4n) {
  border-right: 0;
}

.quote-card:nth-last-child(-n+4) {
  border-bottom: 0;
}

.quote-card-clickable {
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.quote-card-clickable:hover {
  background: #f5f8fc;
  box-shadow: inset 0 0 0 1px #c3d4e6;
}

.quote-card-clickable:focus-visible,
.market-table-chart-link:focus-visible {
  outline: 2px solid #356ca3;
  outline-offset: -3px;
  border-radius: 6px;
}

.quote-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.quote-name {
  font-size: 12.5px;
  color: #384a5e;
  font-weight: 650;
  line-height: 1.35;
}

.quote-group {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--subtle);
  flex-shrink: 0;
}

.quote-card-clickable .quote-group {
  color: #2f5e8a;
  background: #eaf1f8;
  padding: 2px 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
}

.quote-card-clickable .quote-group .icon {
  width: 11px;
  height: 11px;
}

.quote-value-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 10px;
  min-height: 28px;
}

.quote-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.6px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.quote-unit {
  font-size: 11px;
  color: var(--subtle);
  font-weight: 500;
}

.quote-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  min-height: 22px;
}

.quote-change {
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.quote-spark {
  width: 68px;
  height: 22px;
  flex: none;
}

.quote-missing {
  font-size: 11.5px;
  color: var(--subtle);
}

.quote-source {
  font-size: 10.5px;
  color: var(--subtle);
  margin-top: 8px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* Brief Panel */
.brief-panel {
  position: relative;
  background: var(--surface);
  border-top: 3px solid var(--navy);
}

.brief-panel .panel-head {
  padding-bottom: 0;
}

.brief-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 1.5px;
  font-weight: 700;
}

.brief-content {
  padding: 16px 24px 22px;
}

.brief-content h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.7px;
  line-height: 1.5;
  max-width: 740px;
  word-break: keep-all;
  white-space: pre-line;
}

.brief-points {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.brief-point {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.7;
  padding: 11px 14px;
  background: var(--surface-alt);
  border-radius: 10px;
  border: 1px solid var(--line);
}

.brief-point .point-number {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: var(--navy);
  background: #e6eef7;
  padding: 2px 7px;
  border-radius: 6px;
  margin-top: 2px;
  font-weight: 700;
  flex-shrink: 0;
}

.brief-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  background: var(--surface-alt);
  padding: 12px 24px;
  font-size: 11.5px;
  gap: 12px;
  color: var(--muted);
}

.brief-footer .icon {
  height: 13px;
  width: 13px;
  flex-shrink: 0;
}

.brief-foot-note {
  display: flex;
  gap: 7px;
  align-items: center;
}

/* Impact Grids */
.impact-index-grid,
.impact-themes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 0 22px 18px;
}

.impact-domestic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 22px 18px;
}

/* Sectors & Leaders */
.section-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.sector-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 20px 20px;
}

.sector-tile {
  padding: 12px 13px;
  border-radius: 9px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  min-height: 44px;
}

.sector-tile.gain-bg {
  background: var(--gain-bg);
  border-color: #f6dcdc;
}

.sector-tile.loss-bg {
  background: var(--loss-bg);
  border-color: #dbe7fa;
}

.sector-tile span:first-child {
  color: var(--text);
  font-weight: 500;
}

.sector-tile strong {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.leaders-list {
  padding: 0 20px 10px;
}

.leader-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.leader-row:last-child {
  border: 0;
}

.leader-monogram {
  height: 34px;
  width: 34px;
  border-radius: 9px;
  background: var(--soft);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--navy);
  flex: none;
}

.leader-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.leader-symbol {
  font-size: 11px;
  color: var(--subtle);
  margin-top: 2px;
  letter-spacing: 0.3px;
}

.leader-change {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.leader-value {
  font-size: 11.5px;
  color: var(--muted);
  text-align: right;
  margin-top: 2px;
  font-weight: 500;
}

.compact-empty {
  padding: 26px 22px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--muted);
}

/* Outlook */
.outlook-tabs {
  display: flex;
  gap: 6px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.outlook-tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  padding: 12px 14px;
  border: 0;
  background: none;
  color: var(--muted);
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  position: relative;
  min-height: 44px;
}

.tab:hover {
  color: var(--ink);
}

.tab.active {
  color: var(--navy);
  font-weight: 700;
}

.tab.active:after {
  content: '';
  height: 2.5px;
  background: var(--navy);
  position: absolute;
  bottom: 0;
  left: 8px;
  right: 8px;
  border-radius: 2px 2px 0 0;
}

.outlook-body {
  padding: 22px;
}

.outlook-headline {
  font-size: 17px;
  line-height: 1.65;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.4px;
  word-break: keep-all;
}

.outlook-markets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}

.outlook-market {
  border: 1px solid var(--line);
  background: var(--surface-alt);
  border-radius: 10px;
  padding: 15px 16px;
}

.outlook-market strong {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.7px;
  color: var(--navy);
  background: #e7eff7;
  padding: 2px 8px;
  border-radius: 5px;
  margin-bottom: 9px;
}

.outlook-market p {
  font-size: 13px;
  line-height: 1.75;
  color: var(--text);
}

.outlook-reason-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}

.outlook-reason-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 15px 16px;
  background: #fbfdfb;
}

.outlook-reason-box.risk {
  background: #fdfbf7;
}

.reason-title {
  font-size: 12.5px;
  color: #216650;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  gap: 7px;
  align-items: center;
}

.reason-title .dot {
  background: #2f8568;
}

.reason-title.risk {
  color: #8c6322;
}

.reason-title.risk .dot {
  background: #c49245;
}

.reason-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.reason-list li {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text);
  padding-left: 12px;
  position: relative;
}

.reason-list li:before {
  content: '·';
  position: absolute;
  left: 0;
  font-weight: 700;
  color: var(--subtle);
}

.invalidation {
  margin-top: 16px;
  background: #f5f7fa;
  border-left: 3px solid var(--gold);
  padding: 12px 15px;
  border-radius: 0 8px 8px 0;
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text);
}

.invalidation strong {
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}

.outlook-confidence {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
}

.outlook-confidence .icon {
  width: 14px;
  height: 14px;
}

/* Events */
.event-list {
  padding: 0 22px 10px;
}

.event-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.event-row:last-child {
  border: 0;
}

.event-time {
  min-width: 68px;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
}

.event-time small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  margin-top: 3px;
}

.event-country {
  height: 26px;
  width: 26px;
  border: 1px solid var(--line-strong);
  background: var(--surface-alt);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  color: var(--navy);
  flex: none;
  margin-top: 2px;
}

.event-info {
  min-width: 0;
  flex: 1;
}

.event-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.5;
}

.event-description {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.65;
  margin-top: 4px;
}

.event-importance {
  display: flex;
  gap: 3px;
  align-items: center;
  padding-top: 6px;
  margin-left: auto;
}

.event-importance i {
  width: 4px;
  height: 10px;
  display: block;
  background: var(--gold);
  border-radius: 2px;
}

.event-importance i.dim {
  background: #e2e7ed;
}

.page-footer {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  line-height: 1.7;
  margin-top: 26px;
  padding: 0 4px;
}

/* Tables & Toolbars */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 0 22px 18px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-chip {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: 7px 13px;
  min-height: 36px;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.filter-chip:hover {
  background: var(--surface-alt);
  color: var(--ink);
}

.filter-chip.active {
  border-color: var(--navy);
  background: var(--navy);
  color: #ffffff;
}

.search-field {
  position: relative;
  width: 240px;
}

.search-field input {
  font-size: 12.5px;
  padding-left: 34px;
  min-height: 38px;
}

.search-field > .icon {
  position: absolute;
  left: 11px;
  top: 11px;
  width: 15px;
  height: 15px;
  color: var(--subtle);
}

.data-table-name {
  font-size: 13px;
}

.data-table-name small {
  display: block;
  font-size: 11px;
  color: var(--subtle);
  font-weight: 400;
  margin-top: 3px;
}

.market-table-chart-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: none;
  color: #26598a;
  font-size: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.market-table-chart-link:hover {
  color: var(--navy);
}

.market-table-chart-link .icon {
  width: 13px;
  height: 13px;
}

.source-link {
  color: #2f5e8a;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.source-link:hover {
  text-decoration: underline;
}

.source-link .icon {
  height: 12px;
  width: 12px;
}

.source-cards {
  display: grid;
  gap: 12px;
  padding: 0 22px 22px;
}

.source-card {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.source-icon {
  height: 34px;
  width: 34px;
  border-radius: 8px;
  background: var(--soft);
  display: grid;
  place-items: center;
  color: #4b6c8e;
  flex: none;
}

.source-icon .icon {
  width: 17px;
  height: 17px;
}

.source-body {
  flex: 1;
  min-width: 0;
}

.source-name {
  font-size: 13.5px;
  color: var(--ink);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.source-description {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
  margin-top: 6px;
}

.source-disclaimer {
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
  padding: 18px 22px;
  background: var(--surface-alt);
  border-top: 1px solid var(--line);
}

.source-disclaimer strong {
  color: var(--ink);
  display: block;
  margin-bottom: 4px;
}

/* Admin Views */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.stat-box {
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-box .stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.stat-box .stat-value {
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 800;
  color: var(--ink);
  margin-top: 10px;
  letter-spacing: -0.8px;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.stat-box .stat-caption {
  font-size: 11.5px;
  color: var(--subtle);
  margin-top: 6px;
}

.admin-note {
  background: #eff4fa;
  border: 1px solid #d7e2ef;
  padding: 15px 18px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.75;
  color: #36506b;
}

.status-dot {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
}

.status-dot.disabled {
  color: #9e4c49;
}

.row-actions {
  display: flex;
  gap: 7px;
  align-items: center;
}

.settings-form {
  padding: 0 22px 22px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.settings-form .field {
  margin: 0;
  max-width: 280px;
  flex: 1;
}

.settings-form input {
  min-height: 40px;
}

.settings-form .button {
  min-height: 40px;
}

.admin-empty {
  padding: 32px 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

/* Desk Rail & Chat */
.desk-rail {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.rail-date {
  padding: 18px 20px;
  background: linear-gradient(135deg, #e7eef6 0%, #eef3f9 100%);
  border: 1px solid #d6e1ed;
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rail-date-title {
  font-size: 10px;
  font-weight: 700;
  color: #546d87;
  letter-spacing: 1.2px;
  margin-bottom: 6px;
}

.rail-date-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.rail-date .icon {
  height: 24px;
  width: 24px;
  color: #4f6f90;
}

.rail-note {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.rail-note .eyebrow {
  font-size: 10px;
  letter-spacing: 1.3px;
}

.rail-note p {
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--muted);
  margin-top: 9px;
  word-break: keep-all;
}

.rail-note strong {
  color: var(--ink);
  font-weight: 700;
}

.chat-panel {
  position: sticky;
  top: 86px;
  min-height: 460px;
  display: flex;
  flex-direction: column;
}

.chat-panel .panel-head {
  padding: 18px 18px 14px;
  align-items: flex-start;
}

.chat-panel .panel-title {
  font-size: 14px;
}

.chat-status {
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
}

.chat-header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.online-avatars {
  display: flex;
  padding: 0 18px 12px;
  gap: 5px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  min-height: 38px;
}

.online-avatar {
  height: 24px;
  width: 24px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--navy);
  background: #e6eef7;
  border-radius: 50%;
  border: 2px solid var(--surface);
}

.online-names {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
  margin-left: 4px;
}

.chat-messages {
  padding: 16px;
  height: 280px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
}

.chat-message {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.chat-message .avatar {
  height: 26px;
  width: 26px;
  font-size: 11px;
  margin-top: 1px;
}

.chat-message-body {
  min-width: 0;
  flex: 1;
}

.chat-message-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.chat-message-header time {
  font-size: 10px;
  color: var(--subtle);
  font-weight: 400;
}

.chat-text {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text);
  word-break: break-word;
  white-space: pre-wrap;
}

.chat-message.own .chat-text {
  color: var(--ink);
  background: #eef3fa;
  border-radius: 0 10px 10px 10px;
  padding: 8px 11px;
}

.chat-compose {
  margin-top: auto;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
}

.chat-compose-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.chat-compose textarea {
  font-size: 12.5px;
  min-height: 40px;
  height: 40px;
  max-height: 100px;
  padding: 9px 11px;
  resize: none;
  background: var(--surface-alt);
  line-height: 1.5;
}

.chat-compose .icon-button {
  height: 40px;
  width: 40px;
  background: var(--navy);
  border-color: var(--navy);
  color: #ffffff;
}

.chat-compose .icon-button:disabled {
  background: #c8d2dc;
  border-color: #c8d2dc;
  opacity: 1;
}

.chat-compose-help {
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--subtle);
  margin-top: 8px;
}

.chat-mode-label {
  font-size: 11px;
  color: #845f26;
  background: #fbf3e4;
  padding: 7px 16px;
  line-height: 1.55;
  border-top: 1px solid #eedcb9;
}

.chat-close {
  display: none;
}

.rail-close-overlay {
  display: none;
}

.chat-toggle {
  display: none;
}

.disconnected-note {
  font-size: 11.5px;
  color: #845f26;
  padding: 10px 16px;
  background: #fbf5e8;
  line-height: 1.6;
}

.chat-empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
  min-height: 220px;
  gap: 10px;
  align-items: center;
}

.chat-empty .icon {
  height: 24px;
  width: 24px;
  color: #9aa7b5;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 36, 59, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal {
  background: var(--surface);
  width: 100%;
  max-width: 450px;
  max-height: 90vh;
  overflow: auto;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}

.modal-head {
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-head h2 {
  font-size: 18px;
  letter-spacing: -0.5px;
  font-weight: 700;
}

.modal-head p {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.65;
  margin-top: 6px;
}

.modal-body {
  padding: 22px 24px 24px;
}

.modal-actions {
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  margin-top: 22px;
}

.profile-info {
  display: grid;
  gap: 12px;
  font-size: 13px;
  margin-bottom: 22px;
  padding: 14px 16px;
  background: var(--surface-alt);
  border-radius: 10px;
  border: 1px solid var(--line);
}

.profile-info > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.profile-info span {
  color: var(--muted);
}

.profile-info strong {
  font-weight: 600;
  color: var(--ink);
}

.modal-notice {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}

/* Historical Index Chart Modal */
.market-history-modal {
  max-width: 880px;
  width: min(880px, 100%);
}

.market-history-modal .modal-body {
  padding: 20px 26px 24px;
}

.market-chart-ranges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 12px;
}

.market-chart-range {
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 8px;
  padding: 8px 14px;
  min-height: 36px;
  color: var(--muted);
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.market-chart-range:hover {
  background: var(--surface-alt);
  color: var(--ink);
}

.market-chart-range.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #ffffff;
  font-weight: 700;
}

.market-chart-range:focus-visible,
.market-chart-scrubber:focus-visible {
  outline: 2px solid #356ca3;
  outline-offset: 2px;
}

.market-chart-extent {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-bottom: 16px;
}

.market-chart-extent .market-chart-range {
  font-size: 12px;
  padding: 7px 12px;
  min-height: 34px;
}

.market-chart-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.market-chart-current {
  display: block;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 26px;
  line-height: 1.3;
  color: var(--ink);
}

.market-chart-date {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.market-chart-change {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 5px 10px;
  border-radius: 7px;
  background: var(--soft);
}

.market-chart-change.gain {
  color: var(--gain);
  background: var(--gain-bg);
}

.market-chart-change.loss {
  color: var(--loss);
  background: var(--loss-bg);
}

.market-chart-container {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 14px 16px;
}

.market-chart-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.market-chart-axis {
  fill: var(--muted);
  font-size: 11px;
  font-family: 'DM Sans', 'Noto Sans KR', sans-serif;
}

.market-chart-gridline {
  stroke: #e2e8f0;
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.market-chart-path {
  stroke: var(--gain);
  stroke-width: 2.6;
  vector-effect: non-scaling-stroke;
}

.market-chart-svg.loss .market-chart-path {
  stroke: var(--loss);
}

.market-chart-svg.neutral .market-chart-path {
  stroke: #56799c;
}

.market-chart-crosshair {
  stroke: #94a3b8;
  stroke-width: 1.2;
  stroke-dasharray: 4 5;
}

.market-chart-marker {
  fill: #ffffff;
  stroke: var(--gain);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.market-chart-svg.loss .market-chart-marker {
  stroke: var(--loss);
}

.market-chart-wick {
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
}

.market-chart-body {
  stroke-width: 0.7;
  vector-effect: non-scaling-stroke;
}

.market-candle-up {
  stroke: var(--gain);
  fill: var(--gain);
}

.market-candle-down {
  stroke: var(--loss);
  fill: var(--loss);
}

.market-chart-scrubber {
  display: block;
  width: 100%;
  margin: 10px 0 0;
  min-height: 28px;
  accent-color: var(--navy);
  cursor: ew-resize;
}

.market-chart-reading {
  font-size: 12.5px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-align: center;
  margin-top: 6px;
  font-weight: 600;
}

.market-chart-empty {
  padding: 48px 24px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  line-height: 1.75;
}

.market-chart-footnote {
  margin-top: 14px;
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--muted);
}

.market-chart-footnote a {
  display: inline-flex;
  margin-top: 6px;
}

.market-chart-stale {
  color: #a6522e;
  font-weight: 600;
  margin-top: 6px;
}

/* Instrument Search */
.instrument-search-panel {
  display: grid;
  gap: 18px;
}

.instrument-form {
  display: grid;
  gap: 16px;
  padding: 0 22px;
}

.instrument-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.instrument-tabs .tab {
  padding: 9px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  min-height: 40px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.instrument-tabs .tab.active {
  background: var(--navy);
  color: #ffffff;
  border-color: var(--navy);
}

.instrument-tabs .tab.active:after {
  display: none;
}

.instrument-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.instrument-search-row label {
  margin-bottom: 7px;
}

.instrument-search-row .button {
  min-height: 44px;
  padding: 10px 20px;
}

.instrument-samples {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 0 22px;
}

.instrument-samples > span {
  margin-right: 4px;
  font-weight: 600;
}

.instrument-sample {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 7px 12px;
  background: var(--surface-alt);
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  transition: background 0.14s ease, border-color 0.14s ease;
}

.instrument-sample:hover {
  background: #e9f0f8;
  border-color: #9ab3cc;
}

.instrument-search-feedback {
  margin: 0 22px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 28px 20px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 13px;
  text-align: center;
}

.instrument-result {
  margin: 0 22px;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  border-radius: 12px;
  padding: 22px;
  display: grid;
  gap: 14px;
}

.instrument-result-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.instrument-result-heading h3 {
  font-size: 20px;
  font-weight: 800;
  margin: 5px 0 3px;
}

.instrument-code {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
}

.instrument-result-quote {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
}

.instrument-result-quote strong {
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.instrument-result-quote span {
  font-size: 14.5px;
  font-weight: 700;
}

/* Responsive Breakpoints */
@media (min-width: 1700px) {
  .workspace {
    padding: 32px 40px;
  }
  .topbar {
    padding: 0 40px;
  }
  .content-layout {
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 26px;
  }
  .quote-value {
    font-size: 24px;
  }
  .quote-spark {
    width: 82px;
  }
  .chat-messages {
    height: 330px;
  }
}

@media (max-width: 1270px) {
  .app-shell {
    grid-template-columns: 196px minmax(0, 1fr);
  }
  .sidebar {
    width: 196px;
    padding: 22px 12px 18px;
  }
  .workspace {
    padding: 24px 22px 26px;
  }
  .topbar {
    padding: 0 22px;
  }
  .demo-banner {
    padding-left: 22px;
    padding-right: 22px;
  }
  .content-layout {
    grid-template-columns: minmax(0, 1fr) 264px;
    gap: 18px;
  }
  .impact-domestic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .quote-spark {
    width: 48px;
  }
}

@media (max-width: 1100px) {
  .content-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .desk-rail {
    display: none;
  }
  .desk-rail.chat-open {
    display: flex;
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 70;
    width: min(350px, 92vw);
    background: var(--paper);
    padding: 16px;
    flex-direction: column;
    overflow: auto;
    box-shadow: -10px 0 40px rgba(16, 36, 59, 0.2);
  }
  .desk-rail.chat-open .rail-date,
  .desk-rail.chat-open .rail-note {
    display: none;
  }
  .desk-rail.chat-open .chat-panel {
    flex: 1;
    position: static;
    min-height: 0;
  }
  .desk-rail.chat-open .chat-messages {
    height: auto;
    flex: 1;
    min-height: 120px;
  }
  .desk-rail.chat-open .chat-close {
    display: grid;
  }
  .rail-close-overlay.visible {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(16, 36, 59, 0.42);
    z-index: 65;
    border: 0;
  }
  .chat-toggle {
    display: flex;
    position: fixed;
    bottom: max(20px, env(safe-area-inset-bottom));
    right: 20px;
    background: var(--navy);
    color: #ffffff;
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    align-items: center;
    gap: 8px;
    z-index: 40;
    box-shadow: 0 8px 24px rgba(16, 36, 59, 0.28);
    font-size: 13px;
    font-weight: 600;
  }
  .page-footer {
    padding-bottom: 68px;
  }
  .welcome {
    grid-template-columns: 1fr 1fr;
  }
  .welcome-story {
    padding: 36px;
  }
  .story-copy h1 {
    font-size: 36px;
  }
  .welcome-form-area {
    padding: 40px 28px;
  }
}

@media (max-width: 860px) {
  .market-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .quote-card:nth-child(4n) {
    border-right: 1px solid var(--line);
  }
  .quote-card:nth-child(2n) {
    border-right: 0;
  }
  .quote-card:nth-last-child(-n+4) {
    border-bottom: 1px solid var(--line);
  }
  .quote-card:nth-last-child(-n+2) {
    border-bottom: 0;
  }
  .section-pair,
  .impact-index-grid,
  .impact-themes-grid,
  .outlook-markets,
  .outlook-reason-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .shell-body {
    grid-column: 1;
  }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    width: 248px;
    z-index: 80;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 10px 0 40px rgba(16, 36, 59, 0.22);
  }
  .nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(16, 36, 59, 0.45);
    backdrop-filter: blur(2px);
    z-index: 75;
    border: 0;
  }
  .menu-button {
    display: grid;
  }
  .topbar {
    height: 60px;
    padding: 0 16px;
  }
  .breadcrumb > span:first-child,
  .breadcrumb > span:nth-child(2) {
    display: none;
  }
  .breadcrumb strong {
    font-size: 14px;
  }
  .topbar-right {
    gap: 8px;
  }
  .kst-clock {
    padding: 5px 9px;
    font-size: 11px;
  }
  .topbar-separator,
  .profile-label {
    display: none;
  }
  .profile-button {
    padding: 2px;
  }
  .workspace {
    padding: 20px 14px 24px;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
  }
  .page-header h1 {
    font-size: 22px;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .demo-banner {
    padding: 10px 16px;
    font-size: 11.5px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .main-column {
    gap: 16px;
  }
  .panel-head {
    padding: 16px 16px 13px;
  }
  .panel-foot {
    padding: 12px 16px;
  }
  .market-section-label {
    padding: 9px 16px;
  }
  .quote-card {
    padding: 14px 14px 12px;
    min-height: 118px;
  }
  .quote-value {
    font-size: 20px;
  }
  .quote-spark {
    width: 48px;
  }
  .brief-content {
    padding: 14px 16px 18px;
  }
  .brief-content h2 {
    font-size: 19px;
  }
  .brief-footer {
    padding: 11px 16px;
    flex-direction: column;
    align-items: flex-start;
  }
  .impact-index-grid,
  .impact-themes-grid,
  .impact-domestic-grid {
    padding: 0 16px 16px;
  }
  .impact-domestic-grid {
    padding-top: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sector-list {
    padding: 0 16px 16px;
  }
  .leaders-list {
    padding: 0 16px 8px;
  }
  .outlook-tabs {
    padding: 0 12px;
  }
  .outlook-body {
    padding: 16px;
  }
  .invalidation {
    flex-direction: column;
    gap: 4px;
  }
  .toolbar {
    padding: 0 16px 14px;
  }
  .search-field {
    width: 100%;
  }
  th,
  td {
    padding: 12px;
  }
  .event-list {
    padding: 0 16px 8px;
  }
  .source-cards {
    padding: 0 16px 16px;
  }
  .source-disclaimer {
    padding: 15px 16px;
  }
  .summary-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .settings-form {
    flex-direction: column;
    align-items: stretch;
    padding: 0 16px 18px;
  }
  .settings-form .field {
    max-width: none;
  }
  .instrument-form,
  .instrument-samples {
    padding: 0 16px;
  }
  .instrument-search-feedback,
  .instrument-result {
    margin: 0 16px;
    padding: 18px 16px;
  }
  .instrument-search-row {
    grid-template-columns: 1fr;
  }
  .instrument-search-row .button {
    width: 100%;
  }
  .instrument-result-heading {
    flex-wrap: wrap;
  }
  .page-footer {
    flex-direction: column;
    gap: 6px;
    padding-bottom: 74px;
  }
  .chat-toggle {
    bottom: 16px;
    right: 16px;
    padding: 11px 16px;
    font-size: 12px;
  }
  .welcome {
    display: flex;
    flex-direction: column;
  }
  .welcome-story {
    min-height: auto;
    padding: 22px 20px 24px;
  }
  .story-copy {
    margin: 22px 0 0;
  }
  .story-copy .eyebrow {
    margin-bottom: 10px;
  }
  .story-copy h1 {
    font-size: 27px;
    letter-spacing: -1px;
  }
  .story-description {
    font-size: 13px;
    line-height: 1.75;
    margin-top: 12px;
  }
  .story-visual,
  .story-foot {
    display: none;
  }
  .welcome-form-area {
    padding: 20px 16px 32px;
  }
  .welcome-form {
    padding: 24px 20px;
    max-width: 440px;
  }
  .modal-backdrop {
    padding: 12px;
  }
  .modal-head {
    padding: 18px 18px 14px;
  }
  .modal-body {
    padding: 18px;
  }
  .market-history-modal {
    max-width: 100%;
    max-height: 94dvh;
  }
  .market-history-modal .modal-body {
    padding: 16px 14px 20px;
  }
  .market-chart-current {
    font-size: 22px;
  }
  .market-chart-container {
    padding: 10px 8px 12px;
  }
  .market-chart-wick {
    stroke-width: 1.2;
  }
  .market-chart-body {
    stroke-width: 0.5;
  }
}

@media (max-width: 420px) {
  .impact-domestic-grid {
    grid-template-columns: 1fr;
  }
  .sector-list {
    grid-template-columns: 1fr;
  }
  .quote-value {
    font-size: 18.5px;
  }
  .quote-spark {
    width: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}

@media print {
  .sidebar,
  .topbar,
  .demo-banner .text-button,
  .desk-rail,
  .chat-toggle,
  .header-actions,
  .nav-backdrop {
    display: none !important;
  }
  .app-shell,
  .content-layout {
    display: block;
  }
  .shell-body {
    grid-column: 1;
  }
  .workspace {
    padding: 0;
  }
  .panel {
    break-inside: avoid;
    box-shadow: none;
  }
  .main-column {
    gap: 15px;
  }
  .page-footer {
    padding: 0;
  }
  .demo-banner {
    background: #ffffff;
    color: #333333;
    border: 1px solid #999999;
  }
}


/* ── Visual hierarchy refresh: distinguish each market topic at a glance. ── */
.quote-overview-panel > .panel-head{
  background:#fff;
  border-bottom:1px solid #d5dfe9;
  padding:24px 25px 21px;
}
.quote-overview-panel > .panel-head .panel-title{
  font-size:18px;
  font-weight:800;
  color:#112943;
  letter-spacing:-.5px;
}
.quote-overview-panel > .panel-head .panel-subtitle{
  margin-top:8px;
  font-size:12.5px;
  line-height:1.7;
  color:#536779;
  max-width:680px;
}
.metric-jump{
  display:flex;flex-wrap:wrap;align-items:center;
  gap:8px;padding:14px 22px;
  background:#eef2f7;
  border-bottom:1px solid #d9e2ec;
}
.metric-jump-label{
  font-size:11px;font-weight:750;color:#40566d;margin-right:8px;
}
.metric-jump-button{
  display:inline-flex;align-items:center;gap:7px;
  min-height:36px;padding:7px 12px;
  border:1px solid #cbd7e5;border-radius:8px;
  background:#fff;color:#263f5a;
  font-size:11.5px;font-weight:700;white-space:nowrap;
}
.metric-jump-button:hover{background:#dde9f7;border-color:#8faac5}
.metric-jump-button>span{font-weight:550}
.metric-sections{display:grid;gap:22px;padding:24px;background:#f4f6f9}
.metric-section{
  --metric-accent:#315d87;
  --metric-soft:#edf3f9;
  border:1px solid #d6e0ea;
  border-radius:12px;
  background:#fff;
  overflow:hidden;
  scroll-margin-top:28px;
  box-shadow:0 3px 10px rgba(17,41,67,.045);
}
.metric-korea{--metric-accent:#235d8c;--metric-soft:#edf5fc}
.metric-global{--metric-accent:#4c4f9e;--metric-soft:#f1f0fc}
.metric-macro{--metric-accent:#217f78;--metric-soft:#edf8f5}
.metric-commodities{--metric-accent:#956220;--metric-soft:#fff5e8}
.metric-crypto{--metric-accent:#9a5f32;--metric-soft:#fff5ec}
.metric-other{--metric-accent:#596e83;--metric-soft:#f0f3f7}
.metric-section-heading{
  display:flex;align-items:center;gap:15px;
  padding:17px 19px;
  background:var(--metric-soft);
  border-left:5px solid var(--metric-accent);
  border-bottom:1px solid #dce5ee;
}
.metric-section-number{
  font-size:15px;line-height:1.1;font-weight:800;
  color:var(--metric-accent);
  font-variant-numeric:tabular-nums;
  min-width:28px;
}
.metric-section-copy{flex:1;min-width:0}
.metric-section-title{
  font-size:16px;line-height:1.45;
  font-weight:800;letter-spacing:-.3px;color:#162d45;
}
.metric-section-description{
  font-size:11.5px;line-height:1.65;color:#526677;
  margin-top:4px;word-break:keep-all;
}
.metric-section-coverage{
  display:inline-block;flex:none;
  background:#fff;border:1px solid #d7e1ec;border-radius:20px;
  padding:6px 9px;font-size:10.5px;font-weight:650;color:#4e6176;
}
.metric-section .market-grid{
  gap:11px;padding:15px;
  border:0;background:#f9fbfd;
}
.metric-section .quote-card,
.metric-section .quote-card:nth-child(4n),
.metric-section .quote-card:nth-last-child(-n+4){
  min-height:143px;
  padding:16px 15px 13px;
  border:1px solid #dbe3ed;
  border-radius:10px;
  background:#fff;
  box-shadow:0 1px 2px rgba(17,41,67,.025);
}
.metric-section .quote-card:hover{
  border-color:#a8bdd4;
  box-shadow:0 3px 10px rgba(24,62,98,.07);
}
.metric-section .quote-name{
  font-size:12.5px;font-weight:750;
  color:#263d55;line-height:1.5;
}
.metric-section .quote-value{
  font-size:24px;font-weight:800;
  letter-spacing:-.7px;color:#152b42;
}
.metric-section .quote-unit{font-size:11px}
.metric-section .quote-bottom{margin-top:12px}
.metric-section .quote-source{
  border-top:1px solid #ecf0f5;
  padding-top:9px;margin-top:10px;
}
.metric-section .quote-change{font-weight:750}
@media (max-width:850px){
  .metric-sections{padding:15px;gap:16px}
  .metric-section-heading{padding:15px 14px;gap:10px}
  .metric-section-title{font-size:14.5px}
  .metric-section-description{font-size:11px}
  .metric-section .market-grid{padding:10px;gap:9px}
  .quote-overview-panel>.panel-head{padding:20px 17px}
  .metric-jump{padding:12px 14px}
}
@media (max-width:480px){
  .metric-section-heading{flex-wrap:wrap}
  .metric-section-coverage{margin-left:38px}
  .metric-jump-label{width:100%}
  .metric-jump-button{font-size:10.5px;min-height:34px;padding:7px 9px}
  .metric-section .quote-card,
  .metric-section .quote-card:nth-child(4n),
  .metric-section .quote-card:nth-last-child(-n+4){min-height:140px;padding:13px 11px}
  .metric-section .quote-value{font-size:21px}
}

/* Topic hierarchy beyond quote cards */
.nav-group-label{
  margin:18px 11px 5px;
  font-size:10px;line-height:1.4;font-weight:800;
  color:#596e82;letter-spacing:.4px;
}
.nav-list .nav-group-label:first-child{margin-top:1px}
.overview-section-intro{
  display:flex;align-items:center;gap:14px;
  padding:18px 20px;
  border-radius:12px;
  background:#e9eef5;
  border:1px solid #cdd9e7;
  border-left:5px solid #2b5a88;
}
.overview-section-mark{
  display:grid;place-items:center;
  width:40px;height:40px;flex:none;
  color:#1b527e;border-radius:10px;
  background:#fff;border:1px solid #cfdae7;
}
.overview-section-mark .icon{width:21px;height:21px}
.overview-section-intro h2{font-size:17px;font-weight:800;letter-spacing:-.3px;color:#16344f}
.overview-section-intro p{margin-top:4px;font-size:12px;line-height:1.6;color:#50677d}
@media(max-width:600px){
  .overview-section-intro{padding:15px 14px}
  .overview-section-intro h2{font-size:15px}
  .overview-section-intro p{font-size:11px}
}

/* Readable category dividers inside the complete market table */
.market-table-section td{
  padding:0!important;
  border-bottom:1px solid #c7d7e7!important;
  border-top:2px solid #b5cadf!important;
  white-space:normal;
  background:#e9f0f8!important;
}
.market-table-section-inner{
  display:flex;align-items:center;flex-wrap:wrap;gap:9px 14px;
  padding:13px 18px;
  color:#3d5975;
  font-size:11.5px;
}
.market-table-section-inner strong{
  color:#173852;font-size:14px;font-weight:800;
}
.market-table-section-inner small{
  margin-left:auto;font-size:10.5px;color:#5f7387;
  background:#fff;border:1px solid #cbd9e8;border-radius:12px;
  padding:4px 9px;font-weight:650;
}
.market-table-section + tr td{border-top:0}
@media(max-width:540px){
  .market-table-section-inner{padding:13px 12px;gap:5px 9px}
  .market-table-section-inner strong{font-size:13px}
  .market-table-section-inner small{margin-left:0}
}

/* UI-only card presentation: does not change feeds, caching or chart modal. */
.metric-section .quote-card{min-height:128px;padding:18px 16px;gap:12px;justify-content:flex-start}
.metric-section .quote-card .quote-top{align-items:center}
.metric-section .quote-card .quote-name{font-size:15px;line-height:1.35;font-weight:800;overflow-wrap:anywhere}
.metric-section .quote-card .quote-value-row{margin-top:0;flex-wrap:wrap;gap:5px}
.metric-section .quote-card .quote-value{font-size:clamp(23px,2.8vw,31px);line-height:1.15;font-variant-numeric:tabular-nums}
.metric-section .quote-card .quote-bottom{margin-top:auto}
.metric-section .quote-card .quote-change{font-size:13px}
.metric-section .quote-card .quote-spark,.metric-section .quote-card .quote-source{display:none}
.quote-drilldown{width:24px;height:24px;flex:none;display:inline-flex;align-items:center;justify-content:center;color:#386d99;background:#edf4fb;border-radius:50%}
.quote-drilldown .icon{width:14px;height:14px}
.metric-korea .market-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:760px){
 .metric-section .quote-card{min-height:125px;padding:15px 12px;gap:9px}
 .metric-section .quote-card .quote-name{font-size:13px}
 .metric-section .quote-card .quote-value{font-size:clamp(19px,4.8vw,26px)}
 .metric-section .quote-card .quote-change{font-size:12px}
 .metric-korea .market-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* Keep index labels visible on the first two Korea cards after live quote refresh. */
.metric-korea .market-grid > .quote-card:nth-child(1) .quote-top::before,
.metric-korea .market-grid > .quote-card:nth-child(2) .quote-top::before {
  display:block;flex:1;min-width:0;font-size:15px;font-weight:800;
  line-height:1.35;color:#263d55;
}
.metric-korea .market-grid > .quote-card:nth-child(1) .quote-top::before {content:'코스피'}
.metric-korea .market-grid > .quote-card:nth-child(2) .quote-top::before {content:'코스닥'}
.metric-korea .market-grid > .quote-card:nth-child(-n+2) .quote-top > .quote-name {display:none}
@media(max-width:760px){
 .metric-korea .market-grid > .quote-card:nth-child(-n+2) .quote-top::before{font-size:13px}
}
