:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #eef3f7;
  --line: #d8e0e8;
  --text: #17212b;
  --muted: #667483;
  --accent: #006d77;
  --accent-strong: #004f58;
  --rise: #d63f32;
  --fall: #2364aa;
  --shadow: 0 18px 50px rgba(23, 33, 43, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.topbar nav {
  display: flex;
  gap: 22px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
  gap: 48px;
  align-items: end;
  padding: 56px 32px 28px;
}

.hero-copy {
  max-width: 820px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-copy p:last-child {
  max-width: 660px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.market-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.market-strip div {
  padding: 18px;
  background: var(--surface);
}

.market-strip span,
.market-strip strong,
.market-strip em {
  display: block;
}

.market-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.market-strip strong {
  margin: 8px 0 4px;
  font-size: 20px;
}

.market-strip em {
  font-style: normal;
  font-weight: 800;
}

.up {
  color: var(--rise);
}

.down {
  color: var(--fall);
}

.workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  padding: 20px 32px 28px;
}

.sidebar,
.chart-panel,
.insight-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.sidebar {
  padding: 18px;
}

.search span,
.date-row label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.search input,
.date-row input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

.search input:focus,
.date-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 109, 119, 0.16);
}

.stock-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.stock-item {
  width: 100%;
  min-height: 66px;
  padding: 12px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
}

.stock-item.active {
  border-color: var(--accent);
  background: #e2f3f2;
}

.stock-item strong,
.stock-item span {
  display: block;
}

.stock-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.chart-panel {
  min-width: 0;
  padding: 22px;
}

.panel-header,
.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-header h2,
.section-title h2 {
  margin-bottom: 6px;
  font-size: 26px;
}

#selectedMeta {
  margin-bottom: 0;
  color: var(--muted);
}

.intervals {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.intervals button {
  min-width: 58px;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.intervals button.active {
  background: var(--accent);
  color: #fff;
}

.chart-shell {
  height: 520px;
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

#tradingview_chart {
  width: 100%;
  height: 100%;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.stats-grid div {
  min-height: 76px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.stats-grid span,
.stats-grid strong {
  display: block;
}

.stats-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stats-grid strong {
  margin-top: 8px;
  font-size: 18px;
}

.insights {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 20px;
  padding: 0 32px 44px;
}

.insight-block {
  padding: 22px;
}

.event-list,
.news-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.event-card,
.news-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.event-card header,
.news-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.event-card time,
.news-card time {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.event-card strong {
  color: var(--rise);
}

.event-card p,
.news-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.date-row {
  display: grid;
  grid-template-columns: 80px minmax(0, 220px);
  align-items: end;
  gap: 12px;
  margin-top: 6px;
}

.empty {
  padding: 18px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

@media (max-width: 980px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px;
  }

  .hero,
  .workspace,
  .insights {
    grid-template-columns: 1fr;
    padding-right: 20px;
    padding-left: 20px;
  }

  .market-strip,
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar nav {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .hero {
    gap: 24px;
    padding-top: 36px;
  }

  h1 {
    font-size: 38px;
  }

  .panel-header,
  .section-title {
    display: block;
  }

  .intervals {
    margin-top: 16px;
  }

  .chart-shell {
    height: 420px;
  }

  .date-row {
    grid-template-columns: 1fr;
  }
}
