@font-face {
  font-family: "Pretendard Local";
  src: url("/assets/fonts/PretendardVariable.woff2") format("woff2-variations");
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SUIT Local";
  src: url("/assets/fonts/SUIT-Variable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-body:
    "Pretendard Local",
    "Pretendard Variable",
    "Apple SD Gothic Neo",
    "Noto Sans KR",
    "Malgun Gothic",
    sans-serif;
  --font-display:
    "SUIT Local",
    "SUIT Variable",
    "Pretendard Local",
    "Pretendard Variable",
    "Apple SD Gothic Neo",
    "Noto Sans KR",
    "Malgun Gothic",
    sans-serif;
  --brand-50: #e7f7f4;
  --brand-100: #d0f0ea;
  --brand-200: #a7dfd8;
  --brand-300: #77cbc4;
  --brand-400: #47b3b2;
  --brand-500: #138c99;
  --brand-600: #0f7489;
  --brand-700: #0f5a6d;
  --brand-800: #103f50;
  --brand-900: #102734;
  --ink-strong: #102230;
  --ink: #283d4b;
  --muted-strong: #566a79;
  --muted: #7a8c99;
  --paper: #eef4f5;
  --paper-strong: #fbfdfd;
  --panel: rgba(251, 253, 253, 0.98);
  --panel-soft: rgba(245, 249, 250, 0.98);
  --line: rgba(16, 34, 48, 0.095);
  --line-strong: rgba(16, 34, 48, 0.17);
  --danger: #c95b5b;
  --danger-soft: rgba(201, 91, 91, 0.12);
  --success: #11906a;
  --success-soft: rgba(17, 144, 106, 0.12);
  --warning: #b97d19;
  --shadow-lg: 0 24px 56px rgba(8, 24, 35, 0.085);
  --shadow-md: 0 12px 28px rgba(8, 24, 35, 0.06);
  --shadow-sm: 0 2px 10px rgba(8, 24, 35, 0.045);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --max-width: 1680px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow-x: clip;
}

body {
  font-family: var(--font-body);
  font-weight: 460;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-synthesis-weight: none;
  color: var(--ink);
  background:
    radial-gradient(circle at 0% 0%, rgba(19, 140, 153, 0.085), transparent 20%),
    radial-gradient(circle at 100% 12%, rgba(71, 179, 178, 0.055), transparent 18%),
    linear-gradient(180deg, #edf3f4 0%, #e8eff1 44%, #edf2f3 100%);
  color: var(--ink);
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.18));
  z-index: 0;
}

body[data-auth="locked"] .app-shell,
body[data-auth="loading"] .app-shell,
body[data-auth="authenticated"] .auth-screen,
body[data-auth="unauthenticated"] .app-shell {
  display: none;
}

body[data-auth="authenticated"] .app-shell {
  display: block;
}

body[data-auth="unauthenticated"] .auth-screen,
body[data-auth="loading"] .auth-screen {
  display: grid;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

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

code {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  padding: 0.12rem 0.42rem;
  border-radius: 999px;
  background: rgba(18, 42, 57, 0.07);
  color: var(--ink-strong);
}

a {
  color: var(--brand-700);
}

.hidden {
  display: none !important;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(100%, var(--max-width));
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 22px 40px;
  overflow-x: clip;
}

.bg-orb {
  position: fixed;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(70px);
  opacity: 0.7;
  z-index: 0;
}

.bg-orb-a {
  top: -100px;
  left: -90px;
  width: 320px;
  height: 320px;
  background: rgba(22, 154, 167, 0.22);
}

.bg-orb-b {
  top: 140px;
  right: -90px;
  width: 360px;
  height: 360px;
  background: rgba(76, 191, 187, 0.22);
}

.bg-orb-c {
  bottom: -80px;
  left: 50%;
  width: 340px;
  height: 340px;
  transform: translateX(-50%);
  background: rgba(13, 100, 121, 0.12);
}

.auth-screen,
.app-shell {
  position: relative;
  z-index: 1;
}

.auth-screen {
  min-height: calc(100vh - 72px);
  align-items: center;
}

.panel,
.auth-card,
.auth-showcase,
.hero-stage,
.legal-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: visible;
  padding: 18px;
}

.panel::before,
.auth-card::before,
.auth-showcase::before,
.hero-stage::before,
.legal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.48), transparent 18%);
}

.panel > *,
.auth-card > *,
.auth-showcase > *,
.hero-stage > *,
.legal-card > * {
  position: relative;
  z-index: 1;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 560px) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.auth-card {
  padding: 26px;
}

.auth-showcase,
.hero-stage {
  padding: 20px;
}

.auth-card h1,
.hero h1,
.overview-head h2,
.panel-heading h2,
.panel-heading h3,
.empty-state h2,
.auth-showcase h2,
.legal-hero h1,
.legal-card h2 {
  margin: 0;
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-weight: 760;
  letter-spacing: -0.05em;
  line-height: 1.08;
  word-break: keep-all;
}

.auth-card h1,
.hero h1,
.legal-hero h1 {
  font-size: clamp(2.4rem, 4vw, 4.7rem);
}

.panel-kicker,
.eyebrow {
  margin: 0 0 8px;
  display: inline-flex;
  align-items: center;
  min-height: 1.2rem;
  padding-top: 0;
  color: var(--brand-600);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 760;
  line-height: 1.35;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.run-card-title,
.metric-card strong,
.legend-item strong,
.section-row strong,
.watch-item strong,
.news-item strong,
.meta-pill strong,
.notice-copy strong,
.site-footer strong,
.legal-nav strong {
  font-family: var(--font-display);
  font-weight: 720;
  letter-spacing: -0.02em;
}

.hero-text,
.hero-note,
.overview-copy,
.empty-state p,
.auth-help,
.auth-help p,
.job-status p,
.chart-note p,
.legend-item p,
.section-row p,
.run-card > p,
.metric-card .small,
.showcase-item p,
.site-footer p,
.article-prose p,
.article-prose li,
.consent-copy,
.legal-subtitle {
  margin: 0;
  overflow-wrap: anywhere;
  word-break: keep-all;
  line-height: 1.7;
  color: var(--muted-strong);
}

.panel-kicker,
.meta-pill .label,
.metric-card .label,
.section-row strong,
.legend-item strong,
.small,
.badge,
.legal-link,
.hero-chip,
.session-badge,
.run-card-title,
.panel-heading h2,
.panel-heading h3,
.overview-head h2 {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.hero-text {
  margin-top: 16px;
  font-size: 1rem;
}

.auth-form {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  margin-top: 22px;
}

.composer-form {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) 150px;
  align-items: end;
}

.auth-form .query-field {
  min-width: 0;
}

.auth-form .primary-button {
  min-width: 172px;
  width: auto;
  white-space: nowrap;
  word-break: keep-all;
  align-self: end;
}

.auth-help,
.notice-strip {
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(22, 154, 167, 0.15);
  background: rgba(245, 250, 252, 0.96);
  box-shadow: none;
}

.auth-help p + p {
  margin-top: 8px;
}

.consent-copy {
  margin-top: 14px;
  font-size: 0.92rem;
}

.consent-copy a,
.legal-link {
  font-weight: 700;
}

.auth-error {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--danger-soft);
  border: 1px solid rgba(201, 91, 91, 0.22);
  color: var(--danger);
  font-weight: 700;
}

.showcase-copy {
  max-width: 34rem;
}

.showcase-art,
.hero-stage-art {
  width: 100%;
  border-radius: calc(var(--radius-lg) + 4px);
  border: 1px solid rgba(18, 42, 57, 0.08);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.showcase-art {
  margin: 16px 0 14px;
}

.showcase-grid,
.hero-stage-grid,
.hero-metrics,
.recent-runs,
.result-view,
.dashboard,
.chart-side,
.chart-legend,
.chart-note,
.list-stack,
.info-stack,
.legal-grid {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.recent-runs {
  gap: 8px;
}

.showcase-grid,
.hero-stage-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.showcase-item,
.stage-stat {
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(15, 35, 50, 0.08);
  background: rgba(239, 245, 246, 0.9);
  box-shadow: none;
}

.showcase-item strong,
.stage-stat strong,
.legend-item strong,
.section-row strong,
.meta-pill strong,
.metric-card strong,
.notice-copy strong,
.site-footer strong,
.legal-nav strong {
  display: block;
  color: var(--ink-strong);
}

.legend-item strong,
.section-row strong,
.watch-item strong,
.news-item strong,
.meta-pill .label,
.metric-card .label,
.metric-card .small,
.section-row .small,
.small {
  line-height: 1.62;
}

.showcase-item p,
.stage-stat p {
  margin-top: 8px;
  font-size: 0.92rem;
}

.link-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.legal-link,
.badge,
.hero-chip,
.session-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(18, 42, 57, 0.08);
  background: rgba(247, 251, 252, 0.96);
  color: var(--brand-700);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.45;
  text-decoration: none;
  white-space: normal;
  word-break: break-word;
  box-shadow: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(420px, 1.04fr);
  gap: 16px;
  margin-bottom: 14px;
  align-items: stretch;
}

.hero-copy,
.hero-stage,
.composer,
.sidebar,
.dashboard > .panel,
.chart-panel,
.notice-strip,
.site-footer {
  animation: fade-up 260ms ease-out both;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 24px 22px;
}

.hero-copy-panel {
  background:
    linear-gradient(180deg, rgba(249, 252, 252, 0.985), rgba(240, 246, 247, 0.965)),
    var(--panel);
  box-shadow: var(--shadow-md);
}

.hero-copy-panel::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(19, 140, 153, 0.78), rgba(16, 39, 52, 0.22) 64%, transparent);
  pointer-events: none;
}

.hero-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(15, 35, 50, 0.08);
}

.hero-chip {
  background: rgba(238, 244, 245, 0.94);
  color: var(--brand-800);
  border-color: rgba(16, 34, 48, 0.08);
}

.hero-chip-solid {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  border-color: transparent;
}

.hero-stage {
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(251, 253, 253, 0.992), rgba(241, 247, 248, 0.972)),
    var(--panel);
  box-shadow: var(--shadow-md);
}

.hero-stage-top,
.hero-panel-top,
.panel-heading,
.overview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.hero-stage-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.94fr);
  gap: 18px;
  align-items: center;
  margin: 16px 0 14px;
}

.hero-stage-copy {
  min-width: 0;
}

.session-badge {
  justify-content: flex-start;
  background: rgba(240, 246, 247, 0.98);
  color: var(--ink);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(310px, 0.88fr) minmax(0, 1.12fr);
  gap: 14px;
  margin-bottom: 14px;
  align-items: stretch;
}

.notice-strip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 0;
  min-height: 100%;
  background:
    linear-gradient(180deg, rgba(248, 252, 252, 0.985), rgba(239, 245, 246, 0.965)),
    var(--panel);
}

.notice-copy p {
  margin-top: 8px;
}

.composer,
.sidebar,
.dashboard > .panel,
.chart-panel,
.overview-panel {
  padding: 16px;
}

.composer,
.sidebar,
.dashboard > .panel,
.chart-panel,
.overview-panel,
.notice-strip,
.site-footer {
  overflow: visible;
}

.composer {
  margin-bottom: 0;
  background:
    linear-gradient(180deg, rgba(251, 253, 253, 0.992), rgba(242, 247, 248, 0.975)),
    var(--panel);
  box-shadow: var(--shadow-md);
}

.sidebar {
  align-self: start;
  position: sticky;
  top: 18px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(250, 252, 252, 0.992), rgba(241, 246, 247, 0.972)),
    var(--panel);
}

.panel-heading {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(16, 34, 48, 0.09);
}

.panel-heading.compact {
  margin-bottom: 10px;
}

.market-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.market-pill {
  display: block;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(242, 247, 248, 0.98);
  cursor: pointer;
  box-shadow: none;
}

.market-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.market-pill span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 999px;
  font-weight: 700;
  color: var(--muted-strong);
  line-height: 1.4;
  transition:
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.market-pill input:checked + span {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  box-shadow: 0 10px 22px rgba(15, 116, 137, 0.2);
}

.query-field {
  display: grid;
  gap: 8px;
}

.query-field span,
.meta-pill .label,
.metric-card .label {
  font-size: 0.9rem;
  color: var(--muted);
}

.query-field input {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(245, 249, 250, 0.98);
  color: var(--ink-strong);
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.query-field input:focus {
  border-color: rgba(15, 116, 137, 0.4);
  box-shadow: 0 0 0 3px rgba(15, 116, 137, 0.12);
}

.primary-button,
.ghost-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  line-height: 1.4;
  white-space: normal;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease,
    border-color 160ms ease;
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.ghost-button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}

.primary-button {
  min-height: 52px;
  padding: 14px 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  box-shadow: 0 10px 22px rgba(15, 116, 137, 0.18);
}

.ghost-button {
  min-height: 46px;
  padding: 11px 16px;
  color: var(--ink);
  background: rgba(241, 246, 247, 0.98);
  border: 1px solid var(--line);
  box-shadow: none;
}

.job-status {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(15, 35, 50, 0.08);
  background: rgba(243, 248, 249, 0.98);
  box-shadow: none;
  min-height: 58px;
  display: flex;
  align-items: center;
}

.job-status[data-tone="busy"] {
  border-color: rgba(19, 140, 153, 0.22);
  background: rgba(232, 247, 248, 0.98);
}

.job-status[data-tone="success"] {
  border-color: rgba(17, 144, 106, 0.2);
  background: rgba(236, 249, 245, 0.98);
}

.job-status[data-tone="warning"] {
  border-color: rgba(185, 125, 25, 0.2);
  background: rgba(252, 247, 236, 0.98);
}

.job-status[data-tone="error"] {
  border-color: rgba(201, 91, 91, 0.18);
  background: rgba(252, 244, 244, 0.98);
}

.job-status-line {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.job-status-badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 31px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(16, 39, 52, 0.08);
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.job-status-text {
  min-width: 0;
  flex: 1 1 auto;
  color: var(--ink-strong);
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-status[data-tone="busy"] .job-status-badge {
  background: rgba(19, 140, 153, 0.14);
  color: var(--brand-700);
}

.job-status[data-tone="success"] .job-status-badge {
  background: rgba(17, 144, 106, 0.14);
  color: var(--success);
}

.job-status[data-tone="warning"] .job-status-badge {
  background: rgba(185, 125, 25, 0.14);
  color: var(--warning);
}

.job-status[data-tone="error"] .job-status-badge {
  background: rgba(201, 91, 91, 0.12);
  color: var(--danger);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(290px, 330px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.dashboard {
  min-width: 0;
}

.run-card {
  width: 100%;
  text-align: left;
  padding: 15px 15px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(15, 35, 50, 0.08);
  background: rgba(248, 251, 252, 0.98);
  box-shadow: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.run-card:hover,
.run-card.active {
  border-color: rgba(22, 154, 167, 0.22);
  background: rgba(241, 247, 248, 0.98);
  transform: translateY(-1px);
}

.run-card.active {
  background:
    linear-gradient(90deg, rgba(22, 154, 167, 0.08), rgba(22, 154, 167, 0.02) 26%, transparent 52%),
    rgba(241, 247, 248, 0.98);
  box-shadow: inset 3px 0 0 var(--brand-600);
}

.run-card-head,
.run-card-title,
.run-card > p,
.run-card > .small {
  min-width: 0;
}

.run-card-head h3,
.run-card-head p,
.run-card > p {
  margin: 0;
}

.run-card > p + p {
  margin-top: 10px;
}

.run-card-title {
  font-size: 1.02rem;
  line-height: 1.45;
  color: var(--ink-strong);
}

.run-card .small {
  font-size: 0.82rem;
  color: var(--muted);
}

.small {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.68;
}

.empty-state {
  padding: 22px;
}

.empty-state p {
  margin-top: 12px;
}

.overview-panel {
  padding: 20px 20px 18px;
  background:
    linear-gradient(180deg, rgba(251, 253, 253, 0.992), rgba(240, 246, 247, 0.972)),
    var(--panel);
  box-shadow: var(--shadow-md);
}

.overview-copy {
  margin-top: 10px;
}

.meta-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: min(100%, 360px);
}

.meta-pill,
.metric-card,
.legend-item,
.section-row,
.watch-item,
.news-item {
  border: 1px solid rgba(15, 35, 50, 0.08);
  background: rgba(244, 248, 249, 0.96);
  border-radius: var(--radius-md);
  box-shadow: none;
  overflow: visible;
  display: grid;
  align-content: start;
  gap: 2px;
}

.meta-pill,
.metric-card,
.legend-item,
.section-row,
.watch-item,
.news-item {
  min-width: 0;
}

.meta-pill {
  padding: 10px 12px;
}

.meta-pill strong,
.metric-card strong {
  margin-top: 4px;
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.hero-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 16px;
  gap: 10px;
}

.metric-card {
  position: relative;
  padding: 14px 14px 13px;
}

.metric-card .small {
  margin-top: 6px;
}

.two-up {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.two-up > .panel {
  align-self: start;
}

.analysis-board {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: 8px;
  grid-auto-flow: dense;
  gap: 14px;
  align-items: start;
}

.analysis-board > .two-up {
  display: contents;
}

.analysis-board > .two-up > .panel {
  min-width: 0;
  height: max-content;
  margin: 0;
  grid-column: span 6;
}

#section-macro,
#section-watch,
#section-news {
  grid-column: span 5;
}

#section-trade,
#section-fundamentals,
#section-ticker-news {
  grid-column: span 7;
}

.accent-panel {
  background:
    linear-gradient(180deg, rgba(247, 252, 252, 0.992), rgba(238, 245, 246, 0.972)),
    var(--panel);
}

.chart-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.live-chart {
  height: 468px;
  min-height: 468px;
  width: 100%;
  min-width: 0;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(15, 35, 50, 0.08);
  background:
    linear-gradient(180deg, rgba(249, 252, 252, 0.992), rgba(236, 244, 246, 0.975)),
    radial-gradient(circle at top left, rgba(19, 140, 153, 0.09), transparent 32%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.chart-side {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.chart-legend {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.legend-item,
.section-row,
.watch-item,
.news-item {
  padding: 14px 16px;
}

.section-row {
  gap: 6px;
  padding: 15px 16px 14px;
  background:
    linear-gradient(180deg, rgba(246, 250, 251, 0.98), rgba(241, 247, 248, 0.96)),
    rgba(244, 248, 249, 0.96);
}

.section-row strong {
  font-size: 0.96rem;
  color: var(--ink-strong);
}

.section-row p {
  color: var(--muted-strong);
}

.legend-item p,
.section-row p,
.watch-item p,
.news-item p {
  margin-top: 5px;
}

.chart-note {
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(245, 250, 251, 0.992), rgba(238, 245, 246, 0.976)),
    rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(22, 154, 167, 0.12);
  box-shadow: none;
}

.chart-note strong,
.chart-note p {
  display: block;
}

.chart-note p + p {
  margin-top: 8px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.badge {
  color: var(--brand-700);
}

.badge.positive {
  color: var(--success);
  background: var(--success-soft);
}

.chart-panel .legend-item {
  padding: 12px 13px;
  border-radius: 12px;
  box-shadow: none;
  background: rgba(243, 248, 249, 0.98);
}

.chart-panel .legend-item strong {
  font-size: 0.88rem;
  line-height: 1.4;
}

.chart-panel .legend-item p {
  margin-top: 3px;
  font-size: 0.98rem;
  line-height: 1.45;
  color: var(--ink);
}

.section-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(18, 42, 57, 0.08);
  overflow-x: auto;
  scrollbar-width: none;
}

.section-nav::-webkit-scrollbar {
  display: none;
}

.section-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 10px 10px 0 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted-strong);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
}

.section-chip:hover {
  color: var(--brand-800);
  border-bottom-color: rgba(22, 154, 167, 0.26);
  background: rgba(239, 245, 246, 0.92);
}

#section-chart,
#section-macro,
#section-trade,
#section-fundamentals,
#section-watch,
#section-news {
  scroll-margin-top: 18px;
}

.legend-swatch {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 8px;
  border-radius: 999px;
  vertical-align: middle;
}

.chart-empty {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 430px;
  padding: 20px;
  text-align: center;
  color: var(--muted-strong);
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 249, 251, 0.94)),
    rgba(255, 255, 255, 0.9);
}

#watchlist,
#ticker-news,
#chart-summary,
#fundamentals-summary,
#macro-cycle,
#trade-plan {
  display: grid;
  gap: 0;
}

#watchlist > .watch-item,
#ticker-news > .news-item {
  padding: 14px 2px;
  border: 0;
  border-top: 1px solid rgba(15, 35, 50, 0.08);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#watchlist > .watch-item,
#ticker-news > .news-item {
  display: grid;
  gap: 6px;
}

#watchlist > .watch-item strong,
#ticker-news > .news-item strong {
  font-size: 0.95rem;
  color: var(--ink-strong);
}

#watchlist > .watch-item p,
#ticker-news > .news-item p {
  margin-top: 0;
  font-size: 0.92rem;
  color: var(--muted-strong);
}

#ticker-news > .news-item {
  padding-left: 4px;
  padding-right: 4px;
}

#macro-cycle > .section-row,
#trade-plan > .section-row,
#chart-summary > .section-row,
#fundamentals-summary > .section-row {
  background:
    linear-gradient(180deg, rgba(246, 250, 251, 0.98), rgba(240, 246, 247, 0.96)),
    rgba(245, 249, 250, 0.92);
}

#macro-cycle,
#trade-plan,
#chart-summary,
#fundamentals-summary {
  gap: 10px;
}

#watchlist,
#ticker-news {
  gap: 0;
}

#watchlist > :first-child,
#ticker-news > :first-child {
  padding-top: 0;
  border-top: 0;
}

#watchlist > :last-child,
#ticker-news > :last-child {
  padding-bottom: 0;
}

#chart-image {
  width: 100%;
  border-radius: calc(var(--radius-lg) + 2px);
  border: 1px solid rgba(18, 42, 57, 0.08);
}

.site-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(18, 42, 57, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(238, 249, 251, 0.84)),
    rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-sm);
}

.site-footer-copy {
  max-width: 38rem;
}

.site-footer p {
  margin-top: 8px;
}

.legal-page-body {
  background:
    radial-gradient(circle at 12% 14%, rgba(22, 154, 167, 0.18), transparent 20%),
    radial-gradient(circle at 88% 10%, rgba(76, 191, 187, 0.18), transparent 24%),
    linear-gradient(180deg, #f8fdfe 0%, #eef7fb 48%, #f4fbfc 100%);
}

.legal-shell {
  display: grid;
  gap: 14px;
}

.legal-hero,
.legal-card {
  padding: 20px;
}

.legal-subtitle {
  margin-top: 14px;
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.legal-nav strong {
  width: 100%;
  margin-bottom: 4px;
}

.legal-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
}

.article-prose {
  display: grid;
  gap: 20px;
}

.article-prose section + section {
  padding-top: 18px;
  border-top: 1px solid rgba(18, 42, 57, 0.08);
}

.article-prose h2,
.article-prose h3 {
  margin: 0;
  color: var(--ink-strong);
  line-height: 1.35;
}

.article-prose ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted-strong);
}

.article-prose li + li {
  margin-top: 8px;
}

.legal-side-list {
  display: grid;
  gap: 10px;
}

.legal-side-list article {
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(18, 42, 57, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 250, 252, 0.92)),
    rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
}

.legal-side-list p {
  margin-top: 8px;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(18, 42, 57, 0.05);
}

::-webkit-scrollbar-thumb {
  background: rgba(18, 42, 57, 0.18);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(18, 42, 57, 0.28);
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1400px) {
  .hero-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1220px) {
  .auth-layout,
  .hero,
  .workspace-grid,
  .content-grid,
  .chart-shell,
  .legal-grid {
    grid-template-columns: 1fr;
  }

  .analysis-board {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .analysis-board > .two-up > .panel,
  #section-macro,
  #section-trade,
  #section-fundamentals,
  #section-watch,
  #section-news,
  #section-ticker-news {
    grid-column: 1 / -1;
  }

  .auth-form,
  .composer-form {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .hero-stage-body,
  .showcase-grid,
  .hero-stage-grid {
    grid-template-columns: 1fr;
  }

  .meta-stack {
    min-width: 0;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 880px) {
  .page-shell {
    padding: 14px 12px 28px;
  }

  .panel,
  .auth-card,
  .auth-showcase,
  .hero-stage,
  .composer,
  .sidebar,
  .overview-panel,
  .chart-panel,
  .dashboard > .panel,
  .legal-hero,
  .legal-card {
    padding: 16px;
  }

  .hero-stage-top,
  .overview-head,
  .panel-heading,
  .notice-strip,
  .site-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-metrics,
  .market-switch {
    grid-template-columns: 1fr;
  }

  .meta-stack {
    grid-template-columns: 1fr;
  }

  .section-nav {
    gap: 0;
  }

  .live-chart,
  .chart-empty {
    height: 380px;
    min-height: 380px;
  }
}

@media (max-width: 640px) {
  .job-status-line {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .job-status-text {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .auth-card h1,
  .hero h1,
  .legal-hero h1 {
    font-size: clamp(2rem, 10vw, 3.1rem);
  }

  .auth-form .primary-button {
    width: 100%;
    min-width: 0;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .section-chip {
    flex: 1 1 calc(50% - 6px);
  }

  .live-chart,
  .chart-empty {
    height: 332px;
    min-height: 332px;
  }
}
