:root {
  --bg: #eef3f9;
  --panel: #ffffff;
  --panel-soft: #f6f8fb;
  --border: #dbe4ef;
  --text: #20304a;
  --muted: #70819b;
  --accent: #5c6cf2;
  --accent-2: #25bdb5;
  --danger: #ef476f;
  --warn: #f0b429;
  --overview-risk-accent: #a56f26;
  --shadow: 0 8px 24px rgba(39, 54, 82, 0.08);
  /* DESIGN.md §2.2 — heading + gateway ramp (values codify current usage) */
  --heading: #17233a;
  --gateway-navy: #111f36;
  --gateway-navy-2: #172f4f;
  --gateway-teal-deep: #0f625f;
  --gateway-teal: #0f766e;
  --gateway-teal-bright: #72ddd5;
  --gateway-teal-soft: #8fe8e1;
  /* DESIGN.md §3 — type scale (8 steps) */
  --fs-caption: 11px;
  --fs-small: 12px;
  --fs-body-sm: 13px;
  --fs-body: 14px;
  --fs-lead: 16px;
  --fs-h3: 18px;
  --fs-h2: 20px;
  --fs-display: 23px;
}

@font-face {
  font-family: "LINE Seed Sans";
  src: url("https://cdn.jsdelivr.net/gh/woffz/b2@main/LineSeed/LineSeed.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "LINE Seed Sans";
  src: url("https://cdn.jsdelivr.net/gh/woffz/b2@main/LineSeed/LineSeed-700.woff2") format("woff2");
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "LINE Seed Sans", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.sr-only {
  width: 1px;
  height: 1px;
  position: absolute;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.app-shell {
  height: 100vh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: 48px;
  display: grid;
  grid-template-columns: 230px minmax(260px, 420px) 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  color: #17233a;
  font-size: 16px;
}

.sidebar-toggle {
  width: 30px;
  height: 30px;
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  justify-self: end;
  z-index: 4;
  display: grid;
  place-items: center;
  margin-top: 12px;
  margin-right: 8px;
  padding: 0;
  color: #51637d;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 7px;
  box-shadow: 0 3px 10px rgba(39, 54, 82, 0.12);
  font-size: 24px;
  line-height: 1;
}

.sidebar-toggle:hover,
.sidebar-toggle:focus-visible {
  color: var(--accent);
  background: #eef2ff;
  border-color: #aeb9ff;
  outline: none;
}

.search-wrap {
  position: relative;
  min-width: 0;
}

.search {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: #edf3fb;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
}

.search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.search-suggestions {
  position: absolute;
  top: 39px;
  right: 0;
  left: 0;
  z-index: 10;
  max-height: 320px;
  overflow: auto;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-option {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 9px 10px;
  color: var(--text);
  background: #fff;
  border: 0;
  border-radius: 6px;
  text-align: left;
}

.search-option:hover {
  background: #eef4fc;
}

.search-option span {
  color: var(--muted);
  font-size: 12px;
}

.company-tabs,
.main-tabs,
.finance-subtabs,
.ir-section-tabs,
.range-tabs,
.file-links {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.company-tab,
.main-tabs button,
.finance-subtabs button,
.ir-section-tabs button,
.range-tabs button,
.ghost-button,
.file-links a,
.side-tabs button {
  min-height: 32px;
  border: 1px solid var(--border);
  color: #51637d;
  background: var(--panel-soft);
  border-radius: 6px;
  padding: 0 12px;
  text-decoration: none;
  white-space: nowrap;
}

.company-tab.active,
.main-tabs button.active,
.finance-subtabs button.active,
.ir-section-tabs button.active,
.range-tabs button.active,
.side-tabs button.active {
  color: var(--text);
  background: #fff;
  border-color: #b8c7dc;
  font-weight: 700;
}

.ghost-button {
  color: var(--accent-2);
  background: #f5fffe;
  border-color: #91dfda;
  font-weight: 700;
}

/* Market regime badge — topbar right, fed by /api/market-context */
.market-regime-badge {
  position: relative;
  z-index: 20;
  display: inline-flex;
  min-width: 0;
}

.market-regime-badge:hover,
.market-regime-badge:focus-within {
  z-index: 160;
}

.market-regime-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: #51637d;
  background: var(--panel-soft);
  font-size: var(--fs-small);
  font-weight: 700;
  white-space: nowrap;
}

.market-regime-chip::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.market-regime-chip.is-risk-on {
  color: var(--gateway-teal);
  background: #edfbf8;
  border-color: #91dfda;
}

.market-regime-chip.is-risk-off {
  color: #c02a51;
  background: #fdeff3;
  border-color: #f4b6c6;
}

.market-regime-badge.is-stale .market-regime-chip {
  opacity: 0.55;
}

.market-regime-stale-date {
  font-weight: 400;
}

.market-regime-badge .expert-tooltip-content {
  right: 0;
  left: auto;
  min-width: 260px;
  max-width: min(320px, calc(100vw - 32px));
  font-size: var(--fs-small);
  font-weight: 400;
  white-space: normal;
}

.market-regime-badge .expert-tooltip-content::before {
  right: 14px;
  left: auto;
}

.market-regime-badge:hover .expert-tooltip-content,
.market-regime-badge:focus-within .expert-tooltip-content {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.market-regime-tooltip-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e6edf6;
  font-weight: 700;
}

.market-regime-signals {
  display: grid;
  gap: 5px;
}

.market-regime-signal {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.market-regime-signal span:last-child {
  color: var(--muted);
}

.market-regime-signal.is-missing span:last-child {
  color: var(--warn);
}

.market-regime-tooltip-foot {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid #e6edf6;
  color: var(--muted);
  font-size: var(--fs-caption);
}

button:disabled,
.ghost-button:disabled,
.analysis-cancel-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.file-links {
  justify-content: flex-end;
}

.file-links a.excel-download {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  color: #12382f;
  background: linear-gradient(180deg, #ffffff 0%, #f2fbf8 100%);
  border-color: #a9dccc;
  border-radius: 8px;
  box-shadow: 0 7px 18px rgba(24, 95, 73, 0.1);
  font-weight: 800;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.file-links a.excel-download:hover {
  border-color: #67c4a7;
  box-shadow: 0 10px 24px rgba(24, 95, 73, 0.16);
  transform: translateY(-1px);
}

.excel-label {
  display: grid;
  place-items: center;
  text-align: center;
  line-height: 1.05;
}

.excel-label strong {
  font-size: 13px;
}

.excel-label small {
  color: #5f7c72;
  font-size: 11px;
  font-weight: 700;
}

.workspace {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: 320px 1fr;
  position: relative;
}

/* Collapsed: keep a narrow first column so the toggle has a gutter of its own
   instead of floating over the panel content (it sits at the same height as the
   identity banner). The panel keeps its full-bleed backgrounds, so banner, tabs
   and cards all stay aligned with each other. */
.workspace.sidebar-collapsed {
  grid-template-columns: 38px minmax(0, 1fr);
}

.workspace.sidebar-collapsed .sidebar {
  display: none;
}

.workspace.sidebar-collapsed .sidebar-toggle {
  justify-self: start;
  margin-right: 0;
  border-left: 0;
  border-radius: 0 7px 7px 0;
}

.workspace.sidebar-collapsed .main-panel {
  grid-column: 2;
}

.sidebar {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  height: 100%;
  position: sticky;
  top: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  overflow: auto;
}

.company-card {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
}

.ticker-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.ticker-line h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.ticker-line span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ticker-line span:empty {
  display: none;
}

.price-line {
  margin-top: 12px;
  color: var(--danger);
  font-size: 24px;
  font-weight: 800;
}

.price-delay {
  min-height: 16px;
  margin-top: 2px;
  color: #8ba0ba;
  font-size: 11px;
  font-weight: 700;
}

.price-delay:empty {
  display: none;
}

.price-changes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.change-chip {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  color: #51637d;
  background: #f6f8fb;
  border: 1px solid #e7eef7;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.change-chip b,
.change-chip em {
  font: inherit;
}

.change-chip em {
  font-style: normal;
}

.change-chip.up {
  color: #b8322a;
  background: #fff5f4;
  border-color: #ffd8d4;
}

.change-chip.down {
  color: #285fa7;
  background: #f1f6ff;
  border-color: #d5e4ff;
}

.change-chip.loading {
  color: var(--muted);
}

.mini-metrics {
  margin: 12px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
}

.mini-metrics div {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.mini-metrics dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mini-metrics dd {
  margin: 0;
  font-weight: 800;
  font-size: 13px;
}

.feed {
  padding: 12px 16px 24px;
}

.mobile-feed-toggle,
.tab-label-short {
  display: none;
}

.news-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 12px;
}

.news-panel-head h2 {
  margin: 0;
  color: #17233a;
  font-size: 18px;
  line-height: 1.25;
}

.news-panel-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.news-filter-tabs {
  display: grid;
  grid-template-columns: 0.75fr 0.95fr 1.25fr 0.95fr 0.85fr;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: visible;
}

.news-filter-tabs button {
  min-height: 30px;
  min-width: 0;
  padding: 0 7px;
  color: #51637d;
  background: #f6f8fb;
  border: 1px solid #e1e9f4;
  border-radius: 7px;
  font-size: clamp(10px, 3vw, 12px);
  font-weight: 900;
  white-space: nowrap;
}

.news-filter-tabs button.active {
  color: #0f766e;
  background: #ecfffb;
  border-color: #8ee1d6;
}

.news-list {
  display: grid;
  gap: 0;
}

.news-feed-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  gap: 10px;
  align-items: start;
}

.news-copy {
  min-width: 0;
}

.news-title {
  display: block;
  color: #17233a;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
  text-decoration: none;
}

.news-title:hover {
  color: var(--accent);
}

.news-meta {
  margin-top: 5px;
  color: #8090a8;
  font-size: 12px;
  font-weight: 800;
}

.news-summary-wrap {
  position: relative;
  align-self: start;
}

.news-summary-trigger {
  width: 74px;
  height: 58px;
  display: grid;
  place-items: center;
  color: #31506f;
  background: linear-gradient(180deg, #f7fbff 0%, #eaf2fb 100%);
  border: 1px solid #dde7f3;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.news-summary-trigger:hover,
.news-summary-trigger:focus-visible {
  color: #075985;
  background: #eff9ff;
  border-color: #7dd3fc;
  outline: none;
}

.news-summary-preview {
  position: fixed;
  z-index: 1000;
  width: 280px;
  padding: 12px 14px;
  color: #24344d;
  background: #ffffff;
  border: 1px solid #cfe0f2;
  border-radius: 10px;
  box-shadow: 0 16px 38px rgba(28, 46, 74, 0.18);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  text-align: left;
  white-space: normal;
  user-select: text;
}

.news-summary-preview.is-pinned {
  border-color: #69c7bd;
  box-shadow: 0 18px 42px rgba(15, 118, 110, 0.2);
}

.news-summary-preview strong {
  display: block;
  margin-bottom: 6px;
  color: #0f766e;
  font-size: 13px;
  font-weight: 900;
}

.news-summary-preview span {
  display: block;
}

.news-summary-preview span + span {
  margin-top: 5px;
}

.news-summary-preview em {
  display: block;
  margin-top: 8px;
  color: #0f766e;
  font-style: normal;
  font-weight: 900;
}

.more-news-link {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  color: #0f766e;
  background: #f5fffe;
  border: 1px solid #a9e6dc;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.more-news-link:hover {
  border-color: #54cfc0;
}

.news-page {
  grid-column: 1 / -1;
  display: grid;
  gap: 14px;
  padding-top: 16px;
}

.news-page-head {
  position: relative;
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.news-page-head p,
.news-page-head h1,
.news-page-head span {
  margin: 0;
}

.news-page-head p {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 900;
}

.news-page-head h1 {
  margin-top: 4px;
  color: #17233a;
  font-size: 26px;
  line-height: 1.2;
}

.news-page-head span {
  display: block;
  margin-top: 6px;
  color: #66758d;
  font-size: 13px;
  font-weight: 700;
}

.news-page-head-action {
  position: absolute;
  top: 16px;
  right: 16px;
}

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

.news-page-tabs button {
  min-height: 34px;
  padding: 0 14px;
  color: #51637d;
  background: #ffffff;
  border: 1px solid #dbe5f1;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
}

.news-page-tabs button.active {
  color: #0f766e;
  background: #ecfffb;
  border-color: #8ee1d6;
}

.news-page-list {
  display: grid;
  gap: 12px;
}

.news-page-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.news-page-item.has-thumbnail {
  grid-template-columns: 180px minmax(0, 1fr);
}

.news-page-thumb {
  width: 180px;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #0f766e;
  background: #ecfffb;
  border: 1px solid #d6f3ef;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.news-page-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-page-thumb-fallback {
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  text-align: center;
}

.news-page-thumb-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #ffffff;
  background: #0f766e;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 900;
}

.news-page-thumb-source {
  max-width: 140px;
  color: #0f766e;
  font-size: 12px;
  line-height: 1.25;
}

.news-page-item-main {
  min-width: 0;
}

.news-page-badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 0 8px;
  color: #0f766e;
  background: #ecfffb;
  border: 1px solid #b7eee6;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.news-page-item h2 {
  margin: 8px 0 5px;
  font-size: 20px;
  line-height: 1.35;
}

.news-page-item h2 a {
  display: -webkit-box;
  overflow: hidden;
  color: #17233a;
  text-decoration: none;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.news-page-item h2 a:hover {
  color: var(--accent);
}

.news-page-item ul {
  margin: 12px 0 0;
  padding-left: 18px;
  color: #35445c;
  font-size: 14px;
  line-height: 1.65;
}

.news-page-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.news-page-tags span {
  color: #5e728f;
  font-size: 12px;
  font-weight: 800;
}

/* Ownership (13F) subsection — IR tab. Factual tones only: reuses the
   up/down colors of .valuation-revision, no filled signal badges. */
.ir-ownership-meta {
  margin: 0;
  font-size: 12px;
  color: #6f7f99;
}

.ir-ownership-meta.stale {
  color: #c26b1a;
  font-weight: 700;
}

.ir-ownership-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0;
  font-size: 12.5px;
  color: #51637d;
  font-weight: 700;
}

.ir-ownership-table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.ir-ownership-table-wrap table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 12.5px;
}

.ir-ownership-table-wrap th,
.ir-ownership-table-wrap td {
  padding: 8px 12px;
  border-bottom: 1px solid #e8eff8;
  text-align: left;
  white-space: nowrap;
}

.ir-ownership-table-wrap .num {
  text-align: right;
}

.ir-ownership-table-wrap thead th {
  color: #6f7f99;
  background: #f7faff;
  font-weight: 900;
}

.ir-ownership-table-wrap tbody th {
  color: var(--text);
  font-weight: 700;
}

.ir-ownership-table-wrap tbody tr:last-child th,
.ir-ownership-table-wrap tbody tr:last-child td {
  border-bottom: none;
}

.ir-ownership-group,
.ir-ownership-status {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  color: #51637d;
}

.ir-ownership-status.up {
  color: #1a9c6b;
  border-color: rgba(26, 156, 107, 0.35);
}

.ir-ownership-status.down {
  color: #d5484a;
  border-color: rgba(213, 72, 74, 0.35);
}

.ir-ownership-change {
  color: #8291a9;
}

.ir-ownership-change.up {
  color: #1a9c6b;
}

.ir-ownership-change.down {
  color: #d5484a;
}

.ir-ownership-amend {
  margin-left: 6px;
  padding: 0 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 400;
  color: #8291a9;
}

.ir-ownership-notheld,
.ir-ownership-legend,
.ir-ownership-breadth,
.ir-ownership-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: #6f7f99;
}

.analysis-page {
  grid-column: 1 / -1;
  display: grid;
  gap: 16px;
  padding-top: 16px;
}

.analysis-note-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 28px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.analysis-note-hero p,
.analysis-note-hero h1,
.analysis-note-hero span {
  margin: 0;
}

.analysis-note-hero p {
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 900;
}

.analysis-note-hero h1 {
  margin-top: 8px;
  color: #17233a;
  font-size: 34px;
  line-height: 1.15;
}

.analysis-note-hero span {
  display: block;
  margin-top: 8px;
  color: #60728c;
  font-size: 14px;
  font-weight: 800;
}

.analysis-note-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.analysis-note-meta {
  color: #72839b;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.analysis-edit-toggle.active {
  color: #ffffff;
  background: var(--accent-2);
  border-color: var(--accent-2);
}

.analysis-history-toggle.active {
  color: #ffffff;
  background: #17233a;
  border-color: #17233a;
}

.analysis-history-panel {
  display: grid;
  gap: 14px;
  padding: 20px 24px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.analysis-history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.analysis-history-head span {
  display: block;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 900;
}

.analysis-history-head h2 {
  margin: 4px 0 0;
  color: #17233a;
  font-size: 22px;
  line-height: 1.25;
}

.analysis-history-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.analysis-history-panel > p {
  margin: 0;
  color: #60728c;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.analysis-current-version-card {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  color: #315c9b;
  background: #edf4ff;
  border: 1px solid #c9dcfb;
  border-radius: 8px;
}

.analysis-current-version-card span,
.analysis-current-version-card strong,
.analysis-current-version-card small {
  display: block;
}

.analysis-current-version-card span {
  font-size: 11px;
  font-weight: 900;
}

.analysis-current-version-card strong {
  color: #17233a;
  font-size: 18px;
  font-weight: 950;
}

.analysis-current-version-card small {
  color: #536782;
  font-size: 12px;
  font-weight: 700;
}

.analysis-version-form {
  display: grid;
  grid-template-columns: auto minmax(80px, 100px) minmax(80px, 100px) minmax(180px, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 14px;
  background: #ffffff;
  border: 1px solid #dce7f4;
  border-radius: 8px;
}

.analysis-version-form-head {
  display: grid;
  gap: 3px;
  min-width: 130px;
}

.analysis-version-form-head span,
.analysis-version-form label small {
  color: #72839b;
  font-size: 11px;
  font-weight: 900;
}

.analysis-version-form-head strong {
  color: #17233a;
  font-size: 14px;
  font-weight: 950;
}

.analysis-version-form label {
  display: grid;
  gap: 5px;
}

.analysis-version-form input {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  color: #17233a;
  background: #fbfdff;
  border: 1px solid #cbd8eb;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
}

.analysis-version-form input:focus {
  outline: 2px solid rgba(37, 189, 181, 0.22);
  border-color: #78d6d0;
}

.analysis-version-number-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 34px;
  background: #fbfdff;
  border: 1px solid #cbd8eb;
  border-radius: 6px;
  overflow: hidden;
}

.analysis-version-number-field em {
  padding: 0 9px;
  color: #315c9b;
  font-size: 13px;
  font-style: normal;
  font-weight: 950;
}

.analysis-version-number-field input {
  min-height: 32px;
  border: 0;
  border-left: 1px solid #dce7f4;
  border-radius: 0;
}

.analysis-version-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.analysis-danger-button {
  min-height: 32px;
  padding: 0 12px;
  color: #9f1d1d;
  background: #fff5f5;
  border: 1px solid #f0b8b8;
  border-radius: 6px;
  font-weight: 800;
}

.analysis-danger-button:hover {
  color: #7f1d1d;
  border-color: #e28484;
}

.analysis-history-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  gap: 14px;
}

.analysis-history-columns section,
.analysis-history-columns details {
  min-width: 0;
  padding: 14px;
  background: #f8fbff;
  border: 1px solid #e4ecf7;
  border-radius: 8px;
}

.analysis-history-columns h3,
.analysis-history-columns summary {
  margin: 0 0 10px;
  color: #17233a;
  font-size: 14px;
  font-weight: 900;
}

.analysis-history-columns summary {
  cursor: pointer;
}

.analysis-history-columns summary span {
  color: var(--accent-2);
}

.analysis-version-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #dce7f4;
  border-radius: 8px;
}

.analysis-version-item + .analysis-version-item {
  margin-top: 8px;
}

.analysis-version-item.active {
  border-color: #8fb5ee;
  box-shadow: inset 4px 0 0 #3b82f6;
}

.analysis-version-item strong,
.analysis-version-item span {
  display: block;
  min-width: 0;
}

.analysis-version-item strong {
  color: #17233a;
  font-size: 14px;
  font-weight: 900;
}

.analysis-version-item span {
  margin-top: 4px;
  color: #60728c;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.analysis-history-empty {
  padding: 14px;
  color: #60728c;
  background: #ffffff;
  border: 1px dashed #cad7e9;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.analysis-history-empty.warn {
  color: #8a4b0f;
  background: #fff8ec;
  border-color: #f0d19a;
}

.analysis-document-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: start;
  gap: 16px;
}

.analysis-document {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.analysis-toc {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 72px);
  overflow: auto;
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.analysis-toc strong {
  display: block;
  margin-bottom: 12px;
  color: #17233a;
  font-size: 14px;
  font-weight: 900;
}

.analysis-toc a {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  margin: 2px -8px;
  padding: 6px 8px;
  color: #51637d;
  border-radius: 6px;
  text-decoration: none;
  line-height: 1.35;
  transition: color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.analysis-toc a:hover {
  color: var(--accent);
  background: #f4f7ff;
}

.analysis-toc a.active {
  color: #17233a;
  background: #effcfb;
  box-shadow: inset 3px 0 0 var(--accent-2);
}

.analysis-toc a.active span {
  color: #0f9f98;
}

.analysis-toc span {
  color: var(--accent-2);
  font-weight: 900;
}

.analysis-toc-chapter {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 900;
}

.analysis-toc a.analysis-toc-section {
  margin-top: 8px;
  padding-left: 24px;
  font-size: 12px;
  font-weight: 800;
}

.analysis-mobile-toc {
  display: none;
  min-width: 0;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.analysis-mobile-toc > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  color: #17233a;
  cursor: pointer;
  list-style: none;
}

.analysis-mobile-toc > summary::-webkit-details-marker {
  display: none;
}

.analysis-mobile-toc > summary::after {
  content: "+";
  color: var(--accent-2);
  font-size: 20px;
  font-weight: 900;
}

.analysis-mobile-toc[open] > summary::after {
  content: "−";
}

.analysis-mobile-toc > summary strong {
  font-size: 16px;
  font-weight: 900;
}

.analysis-mobile-toc > summary span {
  margin-left: auto;
  color: #708198;
  font-size: 12px;
  font-weight: 800;
}

.analysis-mobile-toc nav {
  max-height: 52vh;
  overflow: auto;
  padding: 4px 14px 14px;
  border-top: 1px solid #edf2f8;
}

.analysis-mobile-toc nav a {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
  color: #51637d;
  border-radius: 6px;
  text-decoration: none;
  line-height: 1.4;
}

.analysis-mobile-toc nav a.active {
  color: #17233a;
  background: #effcfb;
  box-shadow: inset 3px 0 0 var(--accent-2);
}

.analysis-mobile-toc nav a > span {
  color: var(--accent-2);
  font-weight: 900;
}

.analysis-mobile-toc nav .analysis-toc-chapter {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 900;
}

.analysis-mobile-toc nav .analysis-toc-section {
  padding-left: 20px;
  font-size: 13px;
  font-weight: 800;
}

.analysis-chapter {
  min-width: 0;
  scroll-margin-top: 72px;
  padding: 24px 28px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.analysis-chapter-head {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding-bottom: 16px;
  border-bottom: 1px solid #edf2f8;
}

.analysis-chapter-head > span {
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: #17233a;
  border-radius: 8px;
  font-size: 20px;
  font-weight: 900;
}

.analysis-chapter-head h2 {
  margin: 0;
  color: #17233a;
  font-size: 28px;
  line-height: 1.25;
}

.analysis-chapter-hero {
  width: min(100%, 900px);
  margin: 22px auto 0;
  overflow: hidden;
  background: #0b1426;
  border: 1px solid #dce7f4;
  border-radius: 8px;
}

.analysis-chapter-hero img {
  display: block;
  width: 100%;
  height: auto;
}

.analysis-chapter-hero figcaption {
  padding: 10px 14px;
  color: #607089;
  background: #f8fbff;
  font-size: 13px;
  line-height: 1.5;
}

/* Admin-only identity editor (feeds .identity-banner). Shown in the analysis
   notebook whenever edit mode is on. */
.analysis-identity-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px 18px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.analysis-identity-panel > strong,
.analysis-identity-summary strong {
  color: #17233a;
  font-size: 14px;
  font-weight: 900;
}

.analysis-identity-summary {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.analysis-identity-summary span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.analysis-identity-panel-editor {
  display: grid;
  justify-content: stretch;
}

.analysis-identity-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
}

.analysis-identity-fields label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.analysis-identity-field-wide {
  grid-column: 1 / -1;
}

.analysis-identity-fields small {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.analysis-identity-remove {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.analysis-identity-remove.disabled small {
  color: #a6b2c4;
}

.analysis-identity-actions {
  display: flex;
  gap: 10px;
}

@media (max-width: 820px) {
  .analysis-identity-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}

.analysis-representative-image-editor {
  display: grid;
  gap: 12px;
  margin-top: 22px;
  padding: 18px 0;
  border-bottom: 1px solid #edf2f8;
}

.analysis-representative-image-editor > strong {
  color: #17233a;
  font-size: 14px;
  font-weight: 900;
}

.analysis-representative-image-layout {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.analysis-representative-image-preview {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  min-width: 0;
  overflow: hidden;
  color: #91a0b6;
  background: #0b1426;
  border: 1px solid #dce7f4;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

.analysis-representative-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.analysis-representative-image-fields {
  display: grid;
  gap: 12px;
}

.analysis-representative-image-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.analysis-representative-image-field > span {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.analysis-representative-image-field input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  color: #17233a;
  background: #fbfdff;
  border: 1px solid #cbd8eb;
  border-radius: 8px;
  font: inherit;
}

.analysis-representative-image-field input:focus {
  outline: 2px solid rgba(37, 189, 181, 0.22);
  border-color: #78d6d0;
}

.analysis-representative-image-remove {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  color: #9f2f3a;
  font-size: 13px;
  font-weight: 800;
}

.analysis-representative-image-remove.disabled {
  color: #94a3b8;
}

.analysis-chapter-head-editor {
  align-items: end;
}

.analysis-title-editor,
.analysis-section-number-editor {
  display: grid;
  gap: 6px;
}

.analysis-title-editor small,
.analysis-section-number-editor small {
  color: #72839b;
  font-size: 12px;
  font-weight: 800;
}

.analysis-title-editor input,
.analysis-section-number-editor input {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  color: #17233a;
  background: #fbfdff;
  border: 1px solid #cbd8eb;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 900;
}

.analysis-title-editor input:focus,
.analysis-section-number-editor input:focus {
  outline: 2px solid rgba(37, 189, 181, 0.22);
  border-color: #78d6d0;
}

.analysis-section-number-editor input {
  text-align: center;
}

.analysis-title-actions {
  display: flex;
  gap: 8px;
}

.analysis-chapter-head small,
.analysis-subsection-head small {
  display: inline-flex;
  margin-top: 7px;
  color: #72839b;
  font-size: 12px;
  font-weight: 800;
}

.analysis-subsection-stack {
  display: grid;
  gap: 22px;
  margin-top: 22px;
}

.analysis-subsection {
  min-width: 0;
  scroll-margin-top: 72px;
}

.analysis-subsection + .analysis-subsection {
  padding-top: 22px;
  border-top: 1px solid #edf2f8;
}

.analysis-subsection-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
  cursor: pointer;
  list-style: none;
}

.analysis-subsection-head::-webkit-details-marker {
  display: none;
}

.analysis-subsection-head > div {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  padding-left: 28px;
}

.analysis-subsection-head > div::before {
  content: "+";
  position: absolute;
  top: 2px;
  left: 0;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: #0f766e;
  background: #ecfffb;
  border: 1px solid #b7eee6;
  border-radius: 5px;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.analysis-subsection[open] > .analysis-subsection-head > div::before {
  content: "−";
}

.analysis-subsection-head span {
  color: var(--accent-2);
  font-size: 24px;
  font-weight: 900;
  line-height: 1.35;
}

.analysis-subsection-head h3 {
  margin: 0;
  color: #17233a;
  font-size: 24px;
  line-height: 1.35;
}

.analysis-section-edit,
.analysis-cancel-button {
  min-height: 32px;
  padding: 0 12px;
  color: #51637d;
  background: #f7faff;
  border: 1px solid #dce7f4;
  border-radius: 6px;
  font-weight: 800;
}

.analysis-subsection-body {
  padding-top: 2px;
}

.analysis-section-edit:hover,
.analysis-cancel-button:hover {
  border-color: #9fb0ff;
  color: var(--accent);
}

.analysis-markdown {
  color: #2e4059;
  font-size: 19px;
  line-height: 1.75;
}

.analysis-markdown h2,
.analysis-markdown h3,
.analysis-markdown h4 {
  color: #17233a;
  line-height: 1.35;
}

.analysis-markdown h2 {
  margin: 28px 0 12px;
  font-size: 24px;
}

.analysis-markdown h3 {
  margin: 24px 0 10px;
  font-size: 23px;
}

.analysis-markdown h4 {
  margin: 22px 0 8px;
  color: #0f766e;
  font-size: 22px;
}

.analysis-markdown p {
  margin: 0 0 18px;
}

.analysis-markdown strong {
  color: #17233a;
  font-weight: 900;
}

.analysis-editor ul,
.analysis-editor ol,
.analysis-markdown ul,
.analysis-markdown ol {
  margin: 10px 0 18px;
  padding-left: 22px;
}

.analysis-editor .analysis-checklist,
.analysis-markdown .analysis-checklist {
  padding-left: 4px;
  list-style: none;
}

.analysis-markdown li {
  margin: 6px 0;
}

.analysis-editor li {
  margin: 6px 0;
}

.analysis-editor blockquote,
.analysis-markdown blockquote {
  margin: 18px 0;
  padding: 16px 18px;
  color: #17233a;
  background: #ffffff;
  border: 1px solid #dbe4ef;
  border-left: 4px solid var(--accent-2);
  border-radius: 8px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.65;
}

.analysis-editor blockquote.analysis-quote-box,
.analysis-markdown blockquote.analysis-quote-box {
  color: #21324c;
  background: #f8fbff;
  border: 1px solid #d6e2f1;
  border-left: 4px solid #6f8ff5;
  box-shadow: 0 10px 24px rgba(45, 69, 112, 0.08);
}

.analysis-editor blockquote.analysis-quote-pull,
.analysis-markdown blockquote.analysis-quote-pull {
  position: relative;
  padding: 24px 28px 20px 56px;
  color: #17233a;
  background: #ffffff;
  border: 0;
  border-top: 1px solid #d6e2f1;
  border-bottom: 1px solid #d6e2f1;
  border-radius: 0;
  font-size: 22px;
  font-weight: 900;
}

.analysis-editor blockquote.analysis-quote-pull::before,
.analysis-markdown blockquote.analysis-quote-pull::before {
  content: "“";
  position: absolute;
  top: 4px;
  left: 12px;
  color: #25bdb5;
  font-size: 56px;
  line-height: 1;
}

.analysis-editor blockquote.analysis-quote-note,
.analysis-markdown blockquote.analysis-quote-note {
  color: #1f3a5f;
  background: #eef6ff;
  border-color: #bfdbfe;
  border-left-color: #3b82f6;
  font-size: 15px;
  font-weight: 700;
}

.analysis-editor blockquote.analysis-quote-line,
.analysis-markdown blockquote.analysis-quote-line {
  padding: 12px 0 12px 18px;
  background: transparent;
  border: 0;
  border-left: 5px solid var(--accent-2);
  border-radius: 0;
  border-left-color: var(--accent-2);
  font-size: 17px;
  font-weight: 800;
}

.analysis-editor blockquote.analysis-quote-insight,
.analysis-markdown blockquote.analysis-quote-insight {
  color: #223053;
  background: #f4f2ff;
  border-color: #d8d2ff;
  border-left-color: #7c3aed;
  font-weight: 800;
}

.analysis-editor blockquote.analysis-quote-metric,
.analysis-markdown blockquote.analysis-quote-metric {
  color: #102a43;
  background: #f7fbff;
  border-color: #cfe3f7;
  border-left-color: #0e7490;
  font-size: 18px;
  font-weight: 900;
}

.analysis-editor blockquote.analysis-quote-risk,
.analysis-markdown blockquote.analysis-quote-risk {
  color: #5f2a12;
  background: #fff6ed;
  border-color: #fed7aa;
  border-left-color: #f97316;
}

.analysis-editor blockquote.analysis-quote-success,
.analysis-markdown blockquote.analysis-quote-success {
  color: #17432b;
  background: #f0fdf4;
  border-color: #bbf7d0;
  border-left-color: #22c55e;
}

.analysis-editor blockquote.analysis-quote-note::before,
.analysis-markdown blockquote.analysis-quote-note::before,
.analysis-editor blockquote.analysis-quote-insight::before,
.analysis-markdown blockquote.analysis-quote-insight::before,
.analysis-editor blockquote.analysis-quote-metric::before,
.analysis-markdown blockquote.analysis-quote-metric::before,
.analysis-editor blockquote.analysis-quote-risk::before,
.analysis-markdown blockquote.analysis-quote-risk::before,
.analysis-editor blockquote.analysis-quote-success::before,
.analysis-markdown blockquote.analysis-quote-success::before {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.analysis-editor blockquote.analysis-quote-note::before,
.analysis-markdown blockquote.analysis-quote-note::before {
  content: "NOTE";
  color: #2563eb;
}

.analysis-editor blockquote.analysis-quote-insight::before,
.analysis-markdown blockquote.analysis-quote-insight::before {
  content: "INSIGHT";
  color: #6d28d9;
}

.analysis-editor blockquote.analysis-quote-metric::before,
.analysis-markdown blockquote.analysis-quote-metric::before {
  content: "METRIC";
  color: #0e7490;
}

.analysis-editor blockquote.analysis-quote-risk::before,
.analysis-markdown blockquote.analysis-quote-risk::before {
  content: "RISK";
  color: #c2410c;
}

.analysis-editor blockquote.analysis-quote-success::before,
.analysis-markdown blockquote.analysis-quote-success::before {
  content: "UPSIDE";
  color: #15803d;
}

.analysis-markdown a {
  color: #2563eb;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.analysis-markdown img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 16px 0;
  border: 1px solid #dce7f4;
  border-radius: 8px;
}

.analysis-finance-chart {
  display: grid;
  gap: 18px;
  margin: 16px 0 22px;
}

.analysis-finance-chart-card {
  min-width: 0;
  padding: 14px 14px 8px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #dce7f4;
  border-radius: 10px;
}

.analysis-finance-chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 6px;
}

.analysis-finance-chart-head strong {
  color: #20304a;
  font-size: 15px;
}

.analysis-finance-chart-head span {
  color: #70819b;
  font-size: 12px;
}

.analysis-finance-chart-canvas {
  width: 100%;
  height: 300px;
}

.analysis-chart-tooltip-note {
  display: inline-block;
  max-width: 280px;
  margin-top: 5px;
  color: #5c6cf2;
  font-weight: 700;
  white-space: normal;
}

.analysis-editor .analysis-finance-chart:empty::before {
  content: "Finance 데이터 연동 차트";
  display: block;
  padding: 20px;
  color: #70819b;
  text-align: center;
  background: #f7faff;
  border: 1px dashed #b9c7dc;
  border-radius: 8px;
}

.analysis-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  margin: 14px 0 20px;
  border: 1px solid #dce7f4;
  border-radius: 8px;
  background: #ffffff;
}

.analysis-table-wrap.analysis-table-width-narrow {
  width: max-content;
}

.analysis-table-wrap.analysis-table-width-normal,
.analysis-table-wrap:not(.analysis-table-width-narrow):not(.analysis-table-width-wide) {
  width: 100%;
}

.analysis-table-wrap.analysis-table-width-wide {
  width: 100%;
}

.analysis-markdown table,
.analysis-editor table,
.analysis-table-wrap table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  background: #ffffff;
  color: #3d4d64;
  font-size: 15px;
  line-height: 1.45;
}

.analysis-table-width-narrow table {
  width: auto;
  min-width: 0;
}

.analysis-table-width-wide table {
  min-width: 760px;
}

.analysis-markdown th,
.analysis-markdown td,
.analysis-editor th,
.analysis-editor td,
.analysis-table-wrap th,
.analysis-table-wrap td,
.analysis-table-wrap thead td {
  padding: 8px 10px;
  color: #3d4d64;
  background: #ffffff;
  border: 1px solid #edf2f8;
  font-size: 15px;
  line-height: 1.45;
  text-align: left;
  vertical-align: top;
}

.analysis-markdown th,
.analysis-markdown thead td,
.analysis-editor th,
.analysis-editor thead td,
.analysis-table-wrap th {
  color: #17233a;
  background: #f7faff;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.35;
}

.analysis-markdown table p,
.analysis-markdown table div,
.analysis-editor table p,
.analysis-editor table div,
.analysis-table-wrap p,
.analysis-table-wrap div {
  margin: 0;
}

.analysis-markdown table p + p,
.analysis-editor table p + p,
.analysis-table-wrap p + p {
  margin-top: 6px;
}

.analysis-markdown table strong,
.analysis-editor table strong,
.analysis-table-wrap strong {
  color: #17233a;
  font-weight: 900;
}

.analysis-markdown tbody tr:nth-child(even) td,
.analysis-editor tbody tr:nth-child(even) td,
.analysis-table-wrap tbody tr:nth-child(even) td {
  background: #fbfdff;
}

.analysis-markdown .analysis-source-note,
.analysis-editor .analysis-source-note {
  margin-top: 18px;
  color: #708198;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.analysis-todo {
  padding: 18px;
  background: #f8fbff;
  border: 1px dashed #cad7e9;
  border-radius: 8px;
}

.analysis-todo strong {
  color: #17233a;
  font-size: 15px;
  font-weight: 900;
}

.analysis-todo p {
  margin: 8px 0 0;
  color: #60728c;
  font-size: 14px;
  line-height: 1.6;
}

.analysis-editor-toolbar {
  position: sticky;
  top: 8px;
  z-index: 45;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  margin-bottom: 10px;
  padding: 12px;
  background: #f8fbff;
  border: 1px solid #dce7f4;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(23, 35, 58, 0.08);
}

.analysis-toolbar-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-right: 10px;
  border-right: 1px solid #dbe6f4;
}

.analysis-toolbar-group:last-child {
  padding-right: 0;
  border-right: 0;
}

.analysis-toolbar-menu {
  position: relative;
}

.analysis-toolbar-menu[open] {
  z-index: 120;
}

.analysis-toolbar-menu > summary {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  color: #3d4d64;
  background: #ffffff;
  border: 1px solid #d6e2f1;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.analysis-toolbar-menu > summary::-webkit-details-marker {
  display: none;
}

.analysis-toolbar-menu[open] > summary,
.analysis-toolbar-menu > summary:hover {
  color: var(--accent);
  border-color: #9fb0ff;
}

.analysis-menu-caret {
  color: #8292aa;
  font-size: 10px;
}

.analysis-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 130;
  min-width: 190px;
  padding: 10px;
  background: #ffffff;
  border: 1px solid #d6e2f1;
  border-radius: 8px;
  box-shadow: 0 14px 38px rgba(23, 35, 58, 0.16);
}

.analysis-quote-menu-panel {
  min-width: 380px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.analysis-menu-option {
  width: 100%;
  justify-content: flex-start;
  margin: 2px 0;
  border-color: transparent;
  background: transparent;
  text-align: left;
}

.analysis-quote-menu-panel .analysis-menu-option {
  margin: 0;
}

.analysis-menu-option:hover {
  color: #007c73;
  background: #effcfb;
  border-color: #b7efea;
}

.analysis-quote-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  height: auto;
  min-height: 54px;
  gap: 2px;
  white-space: normal;
}

.analysis-quote-option small {
  color: #708198;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.analysis-palette-group > span {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.analysis-color-grid {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 166px;
}

.analysis-menu-divider {
  height: 1px;
  margin: 8px 2px;
  background: #dce7f4;
}

.analysis-table-color-label {
  margin: 0 2px 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.analysis-editor-toolbar button,
.analysis-editor-toolbar select,
.analysis-color-control,
.analysis-image-control {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  color: #3d4d64;
  background: #ffffff;
  border: 1px solid #d6e2f1;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
}

.analysis-editor-toolbar button:hover,
.analysis-image-control:hover {
  color: var(--accent);
  border-color: #9fb0ff;
}

.analysis-toolbar-icon {
  min-width: 22px;
  color: #3d4d64;
  font-size: 18px;
  line-height: 1;
  text-align: center;
}

.analysis-icon-text-color {
  border-bottom: 4px solid #17233a;
}

.analysis-icon-highlight {
  padding: 2px 4px;
  border: 1px solid #d6e2f1;
  box-shadow: inset 0 -8px 0 #fff2a8;
}

.analysis-icon-align {
  font-size: 17px;
}

.analysis-icon-list {
  font-size: 15px;
  letter-spacing: -1px;
}

.analysis-editor-toolbar .analysis-color-swatch {
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  background: var(--swatch);
  border-color: #cbd8eb;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.analysis-editor-toolbar .analysis-color-swatch:hover {
  border-color: #17233a;
  transform: translateY(-1px);
}

.analysis-highlight-swatch {
  box-shadow: inset 0 0 0 1px rgba(23, 35, 58, 0.08);
}

.analysis-color-control input {
  width: 26px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
}

.analysis-image-control input {
  display: none;
}

.analysis-editor {
  width: 100%;
  min-height: 360px;
  overflow: auto;
  padding: 14px;
  color: #17233a;
  background: #fbfdff;
  border: 1px solid #cbd8eb;
  border-radius: 8px;
  font-size: 20px;
  line-height: 1.75;
}

.analysis-subsection-editor .analysis-subsection-head {
  cursor: default;
}

.analysis-subsection-editor .analysis-subsection-head-editor {
  display: grid;
  grid-template-columns: minmax(92px, 124px) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.analysis-subsection-editor .analysis-subsection-head > div {
  padding-left: 0;
}

.analysis-subsection-editor .analysis-subsection-head > div::before {
  display: none;
}

.analysis-editor:focus {
  outline: 2px solid rgba(37, 189, 181, 0.22);
  border-color: #78d6d0;
}

.analysis-editor table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  background: #ffffff;
  color: #3d4d64;
  font-size: 14px;
  line-height: 1.45;
}

.analysis-editor th,
.analysis-editor td {
  padding: 8px 10px;
  color: #3d4d64;
  background: #ffffff;
  border: 1px solid #edf2f8;
  font-size: 14px;
  line-height: 1.45;
  vertical-align: top;
}

.analysis-editor th,
.analysis-editor thead td {
  color: #17233a;
  background: #f7faff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
}

.analysis-editor img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 12px 0;
  border-radius: 8px;
}

.analysis-editor hr,
.analysis-markdown hr {
  margin: 22px 0;
  border: 0;
  border-top: 1px solid #dce7f4;
}

.analysis-editor pre,
.analysis-markdown pre {
  overflow: auto;
  padding: 14px;
  color: #e5edf9;
  background: #17233a;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
}

.analysis-formula {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 1px 7px;
  color: #17233a;
  background: #f8fafc;
  border: 1px solid #cbd8eb;
  border-radius: 5px;
  font-family: Georgia, "Times New Roman", serif;
}

.analysis-editor .analysis-image-resizer,
.analysis-markdown .analysis-image-resizer {
  position: relative;
  display: block;
  max-width: 100%;
  margin: 14px 0;
  vertical-align: top;
}

.analysis-editor .analysis-image-row,
.analysis-markdown .analysis-image-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  margin: 14px 0;
}

.analysis-editor .analysis-image-row > .analysis-image-resizer,
.analysis-markdown .analysis-image-row > .analysis-image-resizer {
  flex: 0 1 auto;
  min-width: 120px;
  margin: 0;
}

.analysis-editor .analysis-image-resizer.analysis-align-left,
.analysis-markdown .analysis-image-resizer.analysis-align-left {
  margin-left: 0;
  margin-right: auto;
}

.analysis-editor .analysis-image-resizer.analysis-align-center,
.analysis-markdown .analysis-image-resizer.analysis-align-center {
  margin-left: auto;
  margin-right: auto;
}

.analysis-editor .analysis-image-resizer.analysis-align-right,
.analysis-markdown .analysis-image-resizer.analysis-align-right {
  margin-left: auto;
  margin-right: 0;
}

.analysis-editor .analysis-image-resizer {
  outline: 1px solid transparent;
  border-radius: 8px;
  cursor: grab;
}

.analysis-editor .analysis-image-resizer:hover,
.analysis-editor .analysis-image-resizer.resizing,
.analysis-editor .analysis-image-resizer.analysis-image-selected {
  outline-color: #25bdb5;
}

.analysis-editor .analysis-image-resizer.analysis-image-dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.analysis-editor .analysis-image-resizer.analysis-image-drop-left::before,
.analysis-editor .analysis-image-resizer.analysis-image-drop-right::after {
  content: "";
  position: absolute;
  top: -4px;
  bottom: -4px;
  z-index: 3;
  width: 4px;
  background: #25bdb5;
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(37, 189, 181, 0.18);
}

.analysis-editor .analysis-image-resizer.analysis-image-drop-left::before {
  left: -8px;
}

.analysis-editor .analysis-image-resizer.analysis-image-drop-right::after {
  right: -8px;
}

.analysis-editor .analysis-image-resizer img,
.analysis-markdown .analysis-image-resizer img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0;
  border-radius: 8px;
}

.analysis-image-caption {
  display: block;
  margin-top: 7px;
  color: #708198;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

.analysis-editor .analysis-image-handle {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 14px;
  height: 14px;
  background: #25bdb5;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(23, 35, 58, 0.22);
  cursor: nwse-resize;
}

.analysis-markdown .analysis-image-handle {
  display: none;
}

.analysis-image-popover {
  position: fixed;
  z-index: 80;
  width: min(320px, calc(100vw - 20px));
  padding: 10px;
  color: #17233a;
  background: #ffffff;
  border: 1px solid #cbd8eb;
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(23, 35, 58, 0.18);
}

.analysis-image-popover[hidden] {
  display: none;
}

.analysis-image-popover-row {
  display: flex;
  gap: 6px;
}

.analysis-image-popover button {
  min-height: 30px;
  flex: 1;
  padding: 0 9px;
  color: #51637d;
  background: #f7faff;
  border: 1px solid #dce7f4;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.analysis-image-popover button:hover,
.analysis-image-popover button.active {
  color: #0f766e;
  background: #ecfffb;
  border-color: #8fded5;
}

.analysis-image-caption-field {
  display: grid;
  gap: 5px;
  margin: 8px 0;
}

.analysis-image-caption-field span {
  color: #72839b;
  font-size: 11px;
  font-weight: 800;
}

.analysis-image-caption-field input {
  width: 100%;
  min-height: 32px;
  padding: 0 9px;
  color: #17233a;
  background: #fbfdff;
  border: 1px solid #cbd8eb;
  border-radius: 6px;
  font-size: 13px;
}

.analysis-image-caption-field input:focus {
  outline: 2px solid rgba(37, 189, 181, 0.22);
  border-color: #78d6d0;
}

.analysis-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.analysis-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  background: linear-gradient(135deg, #ffffff 0%, #f7fbff 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.analysis-hero p,
.analysis-hero h1,
.analysis-hero span,
.analysis-hero strong {
  margin: 0;
}

.analysis-hero p,
.analysis-eyebrow,
.analysis-card-head span {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 900;
}

.analysis-hero h1 {
  margin-top: 6px;
  color: #17233a;
  font-size: 30px;
  line-height: 1.15;
}

.analysis-hero strong {
  display: block;
  margin-top: 10px;
  color: #17233a;
  font-size: 18px;
  line-height: 1.45;
}

.analysis-hero span {
  display: block;
  max-width: 980px;
  margin-top: 8px;
  color: #53647d;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.65;
}

.analysis-hero small {
  flex: 0 0 auto;
  color: #72839b;
  font-size: 12px;
  font-weight: 800;
}

.analysis-signal-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.6fr);
  gap: 16px;
  padding: 18px 20px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.analysis-signal-card h2 {
  margin: 5px 0 0;
  color: #17233a;
  font-size: 18px;
  line-height: 1.35;
}

.analysis-signal-card dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.analysis-signal-card dl div {
  padding: 12px;
  background: #f7faff;
  border: 1px solid #dfe8f5;
  border-radius: 8px;
}

.analysis-signal-card dt {
  color: #6b7c94;
  font-size: 12px;
  font-weight: 800;
}

.analysis-signal-card dd {
  margin: 6px 0 0;
  color: #17233a;
  font-size: 18px;
  font-weight: 900;
}

.analysis-signal-card small {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.analysis-section-stack {
  display: grid;
  gap: 14px;
}

.analysis-card {
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.analysis-card-head h2 {
  margin: 5px 0 0;
  color: #17233a;
  font-size: 22px;
  line-height: 1.3;
}

.analysis-card > p {
  margin: 14px 0 0;
  color: #3d4d64;
  font-size: 15px;
  line-height: 1.75;
}

.analysis-item-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.analysis-card-explainer .analysis-item-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.analysis-item,
.analysis-risk-list div {
  padding: 14px;
  background: #f8fbff;
  border: 1px solid #e1eaf6;
  border-radius: 8px;
}

.analysis-item strong,
.analysis-risk-list strong {
  display: inline-flex;
  margin-bottom: 8px;
  color: #0f766e;
  font-size: 13px;
  font-weight: 900;
}

.analysis-item h3 {
  margin: 0 0 8px;
  color: #17233a;
  font-size: 16px;
  line-height: 1.35;
}

.analysis-item p,
.analysis-risk-list p {
  margin: 0;
  color: #42536b;
  font-size: 14px;
  line-height: 1.65;
}

.analysis-risk-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.analysis-risk-list div {
  background: #fff8f7;
  border-color: #f5d7d2;
}

.analysis-risk-list strong {
  color: #c2410c;
}

.analysis-source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.analysis-source-list a,
.analysis-source-list span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  color: #51637d;
  background: #f7faff;
  border: 1px solid #dce7f4;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.analysis-source-list a:hover {
  color: var(--accent);
  border-color: #9fb0ff;
}

.analysis-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.news-empty {
  margin: 6px 0;
}

.feed-item {
  margin-bottom: 12px;
  padding: 14px;
  background: #f7faff;
  border: 1px solid #e9eff7;
  border-radius: 8px;
}

.feed-item strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.feed-item a {
  color: var(--text);
  text-decoration: none;
}

.feed-item a:hover {
  color: var(--accent);
}

.feed-item p {
  margin: 4px 0;
  color: #53657f;
  font-size: 13px;
  line-height: 1.45;
}

.feed-item time {
  display: block;
  margin-top: 10px;
  color: #8ba0ba;
  font-size: 12px;
  font-weight: 700;
}

.filing-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-bottom: 8px;
  padding: 0 7px;
  color: #2f6fdb;
  background: #edf5ff;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
}

.main-panel {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  height: 100%;
  overflow: auto;
}

.main-tabs {
  height: 44px;
  padding: 0 16px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  background: #e7eef7;
  border-bottom: 1px solid var(--border);
}

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

/* Company identity strip above the tabs — the only place the company is named
   on the main panel, so it stays on every tab (contract §3.2 안 A). Price and
   valuation deliberately stay out: the sidebar and the price-trend card already
   carry them. */
.identity-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 12px 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.identity-banner-mark {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  overflow: hidden;
  color: var(--gateway-teal);
  background: linear-gradient(145deg, #f1f8f8 0%, #e2f1f0 100%);
  border: 1px solid #cfe2e6;
  border-radius: 8px;
  font-size: var(--fs-lead);
  font-weight: 900;
  letter-spacing: 0.02em;
}

/* Company logos are wordmarks, not square glyphs. Drop the monogram tile chrome
   and let the box follow the artwork's aspect ratio, otherwise a ~5:1 wordmark
   is shrunk to a few pixels tall inside the 44px square. */
.identity-banner-mark-logo {
  width: auto;
  max-width: 140px;
  height: 32px;
  background: none;
  border: none;
  border-radius: 0;
}

.identity-banner-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.identity-banner-mark-logo img {
  width: auto;
  max-width: 100%;
}

.identity-banner-copy {
  min-width: 0;
}

.identity-banner-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  min-width: 0;
}

.identity-banner-name {
  color: var(--heading);
  font-size: var(--fs-h3);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.identity-banner-symbol {
  color: var(--muted);
  font-size: var(--fs-body-sm);
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.identity-banner-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.identity-banner-tag {
  padding: 1px 8px;
  color: #51637d;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: var(--fs-caption);
  font-weight: 700;
  white-space: nowrap;
}

.identity-banner-tagline {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  margin: 3px 0 0;
  color: var(--gateway-teal);
  font-size: var(--fs-body);
  font-weight: 800;
  line-height: 1.4;
}

.toolbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
}

.finance-subtabs {
  flex-wrap: wrap;
}

.ir-section-tabs {
  grid-column: 1 / -1;
  flex-wrap: wrap;
  padding: 0;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  align-items: start;
  gap: 16px;
  padding: 0 18px 28px;
}

.content-grid > * {
  min-width: 0;
}

.section-title {
  grid-column: 1 / -1;
  margin: 14px 0 -4px;
  font-size: 18px;
  font-weight: 800;
}

.call-summary-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.summary-source-link {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: #17233a;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(39, 54, 82, 0.06);
}

.summary-source-link:hover {
  border-color: #9fb0ff;
  color: #2f46d5;
}

.chart-card {
  min-height: 330px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.chart-card.wide {
  grid-column: span 2;
}

.chart-card.full {
  grid-column: 1 / -1;
}

.expert-panel-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(260px, 3fr);
  align-items: stretch;
  gap: 16px;
  min-width: 0;
}

.expert-panel-row > .chart-card {
  min-width: 0;
  min-height: 0;
}

.expert-focus-chart {
  display: flex;
  flex-direction: column;
}

.expert-focus-chart .chart {
  flex: 1;
  height: 316px;
  min-height: 316px;
}

.expert-side-card {
  display: flex;
  flex-direction: column;
}

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.chart-head h2 {
  margin: 0;
  font-size: 15px;
}

.chart-head h3 {
  margin: 0;
  color: #17233a;
  font-size: 14px;
}

.chart-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.expert-panel-title {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.expert-panel-title h2 {
  min-width: 0;
}

.chart {
  width: 100%;
  height: 272px;
}

.product-growth-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.product-growth-panel {
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
}

.product-growth-chart .chart {
  height: 316px;
  min-height: 316px;
}

.expert-hero {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.7fr);
  gap: 14px;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.expert-eyebrow {
  display: block;
  margin-bottom: 7px;
  color: #2f6fdb;
  font-size: 12px;
  font-weight: 900;
}

.expert-hero h1 {
  margin: 0 0 5px;
  color: #17233a;
  font-size: 20px;
}

.expert-hero p,
.expert-hero-note,
.expert-note {
  margin: 0;
  color: #596a84;
  font-size: 12.5px;
  line-height: 1.5;
}

.expert-hero-questions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.expert-hero-questions li {
  background: #f6f9fd;
  border: 1px solid #e4ecf7;
  border-radius: 8px;
}

.expert-hero-questions a {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  color: #17233a;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  text-decoration: none;
  transition: background 0.15s;
}

.expert-hero-questions a:hover {
  color: var(--accent-2);
  background: #eef4fb;
}

.expert-hero-questions a span,
.expert-hero-questions a em {
  display: block;
}

.expert-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 0;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}

.expert-status.good {
  color: #137a61;
  background: #e8fbf5;
}

.expert-status.warn {
  color: #9a5d12;
  background: #fff4df;
}

.expert-status.neutral {
  color: #315c9b;
  background: #edf4ff;
}

.expert-hero-note {
  align-self: center;
  padding: 10px 0 10px 12px;
  border-left: 1px solid #dce7f4;
  font-size: 12px;
}

.expert-hero-note strong,
.expert-hero-note span {
  display: block;
}

.expert-hero-note strong {
  margin-bottom: 4px;
  color: #17233a;
  font-size: 12px;
}

.expert-source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.expert-source-row em {
  padding: 3px 7px;
  color: #42526d;
  background: #f6f9fd;
  border: 1px solid #e4ecf7;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.expert-summary-card {
  grid-column: 1 / -1;
  min-height: auto;
  padding: 0;
  overflow: visible;
  background: #ffffff;
}

.expert-summary-layout {
  display: grid;
  grid-template-columns: minmax(270px, 0.9fr) minmax(0, 1.8fr);
  gap: 0;
}

.expert-summary-main {
  min-width: 0;
  display: grid;
  align-content: start;
}

.expert-summary-lead {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
  padding: 18px;
  color: #ffffff;
  background: linear-gradient(135deg, #243b63, #2d6f86);
}

.expert-summary-lead span {
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.25;
}

.expert-summary-lead h2 {
  margin: 8px 0 10px;
  color: #ffffff;
  font-size: 20px;
  line-height: 1.3;
}

.expert-summary-lead dl {
  margin: 0;
}

.expert-summary-lead div {
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.expert-summary-lead div:first-child {
  margin-top: 8px;
}

.expert-summary-lead dt {
  margin-bottom: 3px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
  font-weight: 900;
}

.expert-summary-lead dd {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  line-height: 1.55;
}

.expert-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: start;
  gap: 6px;
  padding: 8px 8px 0;
}

.expert-summary-grid > div {
  position: relative;
  display: grid;
  align-content: start;
  min-width: 0;
  min-height: 108px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #e8eff8;
  border-radius: 8px;
  overflow: visible;
}

.expert-summary-label,
.expert-summary-grid small,
.expert-summary-grid p {
  display: block;
}

.expert-summary-kpi-head {
  min-width: 0;
  min-height: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.expert-summary-label {
  flex: 1 1 auto;
  min-width: 0;
  color: #6f7f99;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expert-summary-kpi-head > .expert-badge {
  flex: 0 0 auto;
  margin-top: 0;
}

.expert-summary-kpi-head > .expert-info-tooltip {
  margin-left: auto;
}

.expert-summary-kpi-head > .expert-badge + .expert-summary-label {
  flex: 0 1 auto;
}

.expert-summary-kpi-head > .expert-summary-label + .expert-info-tooltip {
  margin-left: auto;
}

.expert-summary-grid > div > strong {
  display: block;
  margin-top: 8px;
  color: #17233a;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.15;
}

.expert-summary-grid small {
  margin-top: 5px;
  color: #596a84;
  font-size: 11px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.expert-summary-proof {
  min-width: 0;
  margin: 8px;
  padding-top: 8px;
  border-top: 1px solid #edf2f8;
}

.expert-summary-proof-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
}

.expert-summary-proof-title {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.expert-summary-proof-title > strong {
  color: #17233a;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
}

.expert-summary-proof-title .expert-tooltip-content {
  min-width: 320px;
  max-width: min(420px, calc(100vw - 44px));
}

.expert-summary-proof-head > span {
  color: #6f7f99;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.expert-summary-proof-chart {
  min-width: 0;
  height: 150px;
}

.expert-summary-proof-chart .empty-state {
  height: 100%;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 12px;
}

.expert-info-tooltip {
  position: relative;
  z-index: 20;
  display: inline-flex;
  flex: 0 0 auto;
  vertical-align: middle;
}

.expert-badge-tooltip {
  position: relative;
  z-index: 20;
  display: inline-flex;
  flex: 0 0 auto;
}

.expert-info-tooltip:hover,
.expert-info-tooltip:focus-within,
.expert-badge-tooltip:hover,
.expert-badge-tooltip:focus-within {
  z-index: 160;
}

.expert-info-trigger {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  padding: 0;
  color: #4f6f96;
  background: linear-gradient(180deg, #ffffff 0%, #eef5ff 100%);
  border: 1px solid #bcd1eb;
  border-radius: 50%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(28, 52, 82, 0.08);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  cursor: help;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.expert-info-trigger:hover {
  color: #245a9c;
  background: #f7fbff;
  border-color: #82addd;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 4px 10px rgba(45, 91, 146, 0.16);
  transform: translateY(-1px);
}

.expert-info-trigger span {
  transform: translateY(-0.5px);
}

.expert-info-trigger:focus-visible {
  outline: 2px solid rgba(69, 130, 210, 0.36);
  outline-offset: 2px;
}

.expert-tooltip-content {
  position: absolute;
  display: none;
  top: calc(100% + 8px);
  left: 0;
  z-index: 80;
  width: max-content;
  min-width: 280px;
  max-width: min(360px, calc(100vw - 44px));
  padding: 14px;
  color: #253248;
  background: #ffffff;
  border: 1px solid #d7e3f2;
  border-radius: 10px;
  box-shadow: 0 16px 36px rgba(23, 35, 58, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  white-space: normal;
  overflow-wrap: anywhere;
}

.expert-tooltip-content::before {
  position: absolute;
  top: -6px;
  left: 12px;
  width: 10px;
  height: 10px;
  background: inherit;
  border-top: 1px solid #d7e3f2;
  border-left: 1px solid #d7e3f2;
  content: "";
  transform: rotate(45deg);
}

.expert-info-tooltip:hover .expert-tooltip-content,
.expert-info-tooltip:focus-within .expert-tooltip-content,
.expert-badge-tooltip:hover .expert-tooltip-content,
.expert-badge-tooltip:focus-within .expert-tooltip-content {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.expert-badge-tooltip .expert-tooltip-content {
  right: 0;
  left: auto;
  min-width: 250px;
  max-width: min(320px, calc(100vw - 44px));
}

.expert-badge-tooltip .expert-tooltip-content::before {
  right: 14px;
  left: auto;
}

.expert-summary-grid > div:nth-child(4) .expert-tooltip-content,
.expert-summary-grid > div:nth-child(5) .expert-tooltip-content {
  right: 0;
  left: auto;
}

.expert-summary-grid > div:nth-child(4) .expert-tooltip-content::before,
.expert-summary-grid > div:nth-child(5) .expert-tooltip-content::before {
  right: 14px;
  left: auto;
}

.expert-tooltip-section,
.expert-tooltip-title,
.expert-tooltip-text {
  display: block;
}

.expert-tooltip-title {
  color: #2f6fdb;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.expert-tooltip-text {
  margin-top: 5px;
  color: #42526d;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.expert-tooltip-text strong {
  display: inline;
  clear: none;
  padding-top: 0;
  color: #17233a;
  font-size: inherit;
  font-weight: 950;
}

.expert-tooltip-content hr {
  height: 1px;
  margin: 10px 0;
  background: #e6eef8;
  border: 0;
}

.expert-summary-grid p {
  margin: 8px 0 0;
  color: #42526d;
  font-size: 12px;
  line-height: 1.45;
}

.expert-card-foot {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid #e8eff8;
}

.expert-card-foot em,
.expert-card-foot span {
  display: block;
}

.expert-card-foot em {
  width: fit-content;
  padding: 2px 6px;
  color: #315c9b;
  background: #edf4ff;
  border-radius: 999px;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.expert-card-foot span {
  color: #6f7f99;
  font-size: 11px;
  line-height: 1.35;
}

.expert-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-top: 7px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.expert-badge.good {
  color: #137a61;
  background: #e8fbf5;
  border: 1px solid #b8eadc;
}

.expert-badge.warn {
  color: #9a5d12;
  background: #fff4df;
  border: 1px solid #f2d299;
}

.expert-badge.neutral {
  color: #315c9b;
  background: #edf4ff;
  border: 1px solid #c9dcfb;
}

.expert-badge.muted {
  color: #6f7f99;
  background: #f1f4f8;
  border: 1px solid #dce4ef;
}

.expert-guide {
  margin: 0 0 8px;
}

.expert-guide summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-height: 24px;
  padding: 0 8px;
  color: #2f6fdb;
  background: #f6f9fd;
  border: 1px solid #e4ecf7;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.expert-guide summary::-webkit-details-marker {
  display: none;
}

.expert-guide summary::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: #7b8ba3;
  background: #ffffff;
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
}

.expert-guide[open] summary::before {
  content: "−";
}

.expert-guide ul {
  margin: 8px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 14px;
  padding: 10px 12px 10px 28px;
  background: #f8fbff;
  border: 1px solid #e4ecf7;
  border-radius: 8px;
}

.expert-guide li,
.expert-guide p {
  min-width: 0;
  color: #596a84;
  font-size: 12px;
  line-height: 1.45;
}

.expert-guide p {
  margin: 8px 0 0;
  margin-bottom: 0;
  padding: 10px 12px;
  background: #f8fbff;
  border: 1px solid #e4ecf7;
  border-radius: 8px;
}

.expert-guide .expert-alert-explainer {
  margin-top: 8px;
}

.expert-guide summary .expert-badge {
  min-height: 18px;
  margin-top: 0;
  padding: 0 6px;
  font-size: 10px;
}

.expert-question-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  scroll-margin-top: 82px;
  transition: background 0.3s;
  border-radius: 6px;
}

.expert-question-title:target {
  background: #eef4ff;
  box-shadow: inset 3px 0 0 var(--accent);
  padding-left: 10px;
}

.expert-question-title span,
.expert-question-title small {
  display: block;
}

.expert-question-title small {
  color: #6f7f99;
  font-size: 12px;
  font-weight: 900;
}

.expert-segment-card {
  min-height: auto;
}

.expert-segment-layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  align-items: stretch;
  gap: 18px;
}

.expert-segment-copy {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}

.expert-segment-copy-item {
  padding-bottom: 16px;
  border-bottom: 1px solid #e8eff8;
}

.expert-segment-heading {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.expert-segment-marker {
  flex: 0 0 auto;
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: var(--segment-color);
  box-shadow: 0 0 10px var(--segment-color);
}

.expert-segment-heading strong {
  min-width: 0;
  color: #17233a;
  font-size: 16px;
  font-weight: 900;
}

.expert-segment-heading small {
  color: var(--segment-color);
  font-size: 16px;
  font-weight: 900;
}

.expert-segment-copy p {
  margin: 8px 0 0;
  color: #596a84;
  font-size: 14px;
  line-height: 1.6;
}

.business-segment-desc {
  min-height: 0;
}

.business-segment-desc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.business-segment-desc-item {
  min-width: 0;
  padding: 12px 14px;
  background: #fbfdff;
  border: 1px solid #e8eff8;
  border-radius: 10px;
}

.business-segment-desc-heading {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.business-segment-desc-marker {
  flex: 0 0 auto;
  width: 4px;
  height: 16px;
  border-radius: 999px;
  background: var(--segment-color);
}

.business-segment-desc-heading strong {
  min-width: 0;
  color: #17233a;
  font-size: 15px;
  font-weight: 900;
}

.business-segment-desc-heading small {
  color: var(--segment-color);
  font-size: 12px;
  font-weight: 800;
}

.business-segment-desc-item p {
  margin: 8px 0 0;
  color: #596a84;
  font-size: 13px;
  line-height: 1.6;
}

.business-segment-desc-note {
  margin: 12px 0 0;
  color: #8291a9;
  font-size: 12px;
  line-height: 1.5;
}

/* §5.1 summary card: three chips, one per multiple, linking to their cards. */
.valuation-summary-card {
  min-height: 0;
}

.valuation-summary-caption {
  margin: 0 0 10px;
  color: #596b84;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.valuation-summary-chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.valuation-summary-chip {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 0;
  padding: 8px 12px;
  color: inherit;
  background: #f2f6fb;
  border: 1px solid #dfe8f2;
  border-radius: 8px;
  text-decoration: none;
}

.valuation-summary-chip:hover,
.valuation-summary-chip:focus-visible {
  border-color: #9fb0ff;
}

.valuation-summary-chip-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  color: #17233a;
  font-size: 12px;
  font-weight: 800;
}

.valuation-summary-chip-line b {
  font-size: 15px;
  font-weight: 900;
}

.valuation-summary-chip-aux {
  padding: 1px 8px;
  color: #596b84;
  background: #fff;
  border: 1px solid #dfe8f2;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.valuation-summary-gauge {
  display: block;
}

/* Per-card range control (§6): pills in the card's own header row. */
.valuation-card-ranges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.valuation-card-ranges button {
  padding: 3px 12px;
  color: #596b84;
  background: #f2f6fb;
  border: 1px solid #dfe8f2;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.valuation-card-ranges button.active {
  color: #2f46d5;
  background: #e8edff;
  border-color: #9fb0ff;
}

/* Earnings-vs-price and moving averages side by side, 50/50 on desktop,
   stacked below 900px. Each card keeps its own range control. */
.valuation-top-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  min-width: 0;
}

.valuation-top-row > * {
  min-width: 0;
}

/* Top-row charts fit their panel instead of scrolling: the range control picks
   the span, so the whole window is on screen and the y-axis stays in view. */
.valuation-top-card .chart {
  width: 100%;
  min-width: 0;
  height: 300px;
}

/* Title and the range pills share the header row; the meta/caption line gets
   its own line below so it never wraps the title mid-word. */
.valuation-top-card .chart-head {
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.valuation-top-meta,
.valuation-earnings-caption {
  display: block;
  margin: 0 0 6px;
  color: #596b84;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.valuation-metric-card {
  min-height: 0;
  align-self: stretch;
}

/* Small, muted dictionary gloss beside a metric card title. */
.valuation-metric-def {
  color: #8291a9;
  font-size: 11.5px;
  font-weight: 700;
}

/* 12M forward multiple printed beside the TTM hero number. */
.valuation-metric-fwd {
  color: #596b84;
  font-size: 14px;
  font-weight: 800;
}

/* Exclusion notice (loss / negative equity) in place of the hero number. */
.valuation-metric-excluded {
  color: #596b84;
  font-size: 15px !important;
  font-weight: 800 !important;
  line-height: 1.45;
}

.valuation-band-card {
  min-height: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
}

.valuation-band-card .chart {
  flex: 1 1 auto;
  height: auto;
  min-height: 272px;
}

.valuation-band-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 2px;
  color: #687991;
  font-size: 11px;
}

/* display:flex above would defeat the hidden attribute. */
.valuation-band-controls[hidden] {
  display: none;
}

.valuation-band-controls span {
  font-weight: 800;
}

.valuation-band-controls button {
  padding: 3px 10px;
  color: #596b84;
  background: #f2f6fb;
  border: 1px solid #dfe8f2;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.valuation-band-controls button.active {
  color: #2f46d5;
  background: #e8edff;
  border-color: #9fb0ff;
}

/* One-sentence reading of what the band panel signifies. */
.valuation-band-guide {
  margin: 6px 0 0;
  color: #596b84;
  font-size: 12px;
  line-height: 1.55;
}

/* Text alternative to each valuation chart (§10): reached through the header
   ⊞ button and rendered inside the shared layer. Scrolls inside its own box,
   so 390px keeps page horizontal scroll at zero. Shared by the band cards and
   the earnings-vs-price card. */
.valuation-table-wrap {
  margin: 8px 0 0;
  overflow-x: auto;
}

.valuation-data-table {
  width: 100%;
  min-width: 300px;
  border-collapse: collapse;
  font-size: 11.5px;
}

.valuation-data-table th,
.valuation-data-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #e8eff8;
  text-align: right;
  white-space: nowrap;
}

.valuation-data-table thead th {
  color: #6f7f99;
  background: #f7faff;
  font-weight: 900;
}

.valuation-data-table th:first-child {
  text-align: left;
}

.valuation-data-table tbody th {
  color: #17233a;
  font-weight: 800;
}

.valuation-data-table td {
  color: #21304a;
  font-weight: 700;
}

/* E rows are consensus estimates, not realised trades — tinted amber like the
   chart's estimate region so the two read as one thing. */
.valuation-data-table tr.is-estimate th,
.valuation-data-table tr.is-estimate td {
  color: #8a6420;
  background: #fdf7ec;
}

/* Why the estimate region is or is not drawn, and what a shift changed. Always
   present: an unexplained absence is the thing this replaces. */
.valuation-band-status {
  margin: 6px 0 0;
  padding: 2px 0 2px 9px;
  border-left: 2px solid #e3d5b0;
  color: #7b746a;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.55;
}

/* Stale-data warning (expired consensus): keep the amber alert box the muted
   default drops, so a data-freshness caveat never reads as routine info. */
.valuation-band-status.warn {
  padding: 7px 9px;
  border: 1px solid #f0e2c8;
  border-left: 1px solid #f0e2c8;
  border-radius: 6px;
  background: #fdf7ec;
  color: #8a6420;
  font-weight: 700;
}

.valuation-band-status:empty {
  display: none;
}

.valuation-status-action {
  padding: 2px 9px;
  color: #2f46d5;
  background: #fff;
  border: 1px solid #9fb0ff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.valuation-revision {
  margin-left: 4px;
  font-size: 11px;
  font-style: normal;
  color: #8291a9;
}

.valuation-revision.up {
  color: #1a9c6b;
}

.valuation-revision.down {
  color: #d5484a;
}

.valuation-metric-hero {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  min-width: 0;
}

.valuation-metric-hero > small {
  color: #687991;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* Bullet gauge: current multiple's position inside the historical
   distribution (min-max track, 10-90% shaded band). */
.valuation-metric-gauge {
  margin-top: 14px;
}

.valuation-gauge-track {
  position: relative;
  height: 10px;
  background: #eef3f9;
  border-radius: 999px;
}

.valuation-gauge-band {
  position: absolute;
  top: 0;
  bottom: 0;
  background: #ccd9f8;
  border-radius: 999px;
}

.valuation-gauge-marker {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 3px;
  margin-left: -1.5px;
  background: #17233a;
  border-radius: 2px;
}

.valuation-gauge-scale {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  color: #8291a9;
  font-size: 11px;
}

.valuation-metric-ratio {
  min-width: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.valuation-metric-ratio strong {
  color: #17233a;
  font-size: 27px;
  font-weight: 900;
  line-height: 1.1;
}

.valuation-gauge-caption {
  margin: 6px 0 0;
  color: #8291a9;
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* Position word, from the same quantiles the gauge shades. */
.valuation-position-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}

.valuation-position-badge.upper {
  color: #a1442f;
  background: #fdeee9;
}

.valuation-position-badge.lower {
  color: #1a6f8c;
  background: #e8f4f9;
}

.valuation-position-badge.outside {
  box-shadow: inset 0 0 0 1px currentColor;
}

.valuation-position-badge.muted {
  color: #687991;
  background: #f0f3f8;
  white-space: normal;
}

/* A fallback price is never silent: the badge names it wherever it is used. */
.valuation-stale-badge {
  color: #8a6420;
  background: #fdf7ec;
  border: 1px solid #f0e2c8;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 800;
}

/* Basis-prefixed trajectory: row = accounting basis, left to right = time. */
.valuation-trajectory {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-top: 11px;
  border-top: 1px solid #e8eff8;
}

.valuation-traj-row {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.valuation-traj-label {
  color: #687991;
  font-size: 11px;
  font-weight: 800;
}

.valuation-traj-steps {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.valuation-traj-step b {
  color: #17233a;
  font-size: 15px;
  font-weight: 900;
}

.valuation-traj-step i {
  color: #687991;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.valuation-traj-arrow {
  color: #b6c2d4;
  font-size: 11px;
  font-weight: 800;
}

.valuation-traj-meta,
.valuation-traj-warn {
  color: #8291a9;
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.valuation-traj-warn {
  color: #8a6420;
  font-weight: 700;
}

.valuation-traj-note {
  margin: 0;
  color: #596b84;
  font-size: 11.5px;
  line-height: 1.55;
}

/* 높으면 / 낮으면 — always both, so neither reads as a direction call. */
.valuation-reading {
  display: grid;
  gap: 7px;
  margin: 12px 0 0;
  padding-top: 11px;
  border-top: 1px solid #e8eff8;
}

.valuation-reading > div {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
  min-width: 0;
}

.valuation-reading dt {
  color: #687991;
  font-size: 11px;
  font-weight: 800;
}

.valuation-reading dd {
  margin: 0;
  color: #596b84;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.valuation-metric-caution {
  margin: 0 0 8px;
  color: #8a6420;
  font-size: 11.5px;
  line-height: 1.55;
}

/* ---- band card header (always expanded — no fold) ---- */

/* §8 fold: a native <details> wraps the band card body. Desktop renders open;
   ≤640px starts closed. The summary keeps its list-item marker as the
   open/closed cue, so no state verb is written into the text. */
.valuation-band-card-fold {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.valuation-band-fold-summary {
  min-width: 0;
  padding: 2px 0;
  cursor: pointer;
}

.valuation-band-fold-position::before {
  content: "· ";
}

.valuation-band-fold-title {
  color: #17233a;
  font-size: var(--fs-h2, 15px);
  font-weight: 800;
}

.valuation-band-fold-position {
  color: #687991;
  font-size: 11.5px;
  font-weight: 800;
}

.valuation-band-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.valuation-band-subtitle {
  margin: 4px 0 0;
  color: #687991;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* ---- §7.1 shared layer (native <dialog>) ---- */

/* Layer content lives in the card until a trigger moves it into the dialog,
   so the card's own update paths keep writing to it. The dock is never seen. */
.valuation-layer-dock[hidden],
.valuation-layer-source[hidden] {
  display: none;
}

/* ⓘ / ⊞ triggers, and the head note they sit beside on the metric cards. */
.valuation-card-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.valuation-band-body > .valuation-card-tools {
  margin: 4px 0 0;
}

/* The metric-card header now carries the ⓘ beside the freshness note; let the
   row wrap rather than squeeze the title at 360px. */
.valuation-metric-card .chart-head {
  flex-wrap: wrap;
}

/* .chart-head span would otherwise recolour and resize the glyph spans. */
.valuation-card-tools .valuation-tool-button span {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.valuation-tool-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  color: #596b84;
  background: #f2f6fb;
  border: 1px solid #dfe8f2;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.valuation-tool-button[aria-expanded="true"] {
  color: #2f46d5;
  background: #e8edff;
  border-color: #9fb0ff;
}

/* §7.2 surface row: the basis toggle (PER only) plus the 고급 trigger. This
   row must stay one line at 360px, which is why the advanced badge collapses
   to a count there. */
.valuation-band-controls-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 2px;
}

.valuation-band-controls-row .valuation-band-controls {
  margin: 0;
}

.valuation-advanced-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  color: #596b84;
  background: #f2f6fb;
  border: 1px solid #dfe8f2;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.valuation-advanced-toggle.has-active {
  color: #2f46d5;
  background: #e8edff;
  border-color: #9fb0ff;
}

/* Descriptive badge on desktop, count badge ≤640px; the button's aria-label
   carries the full state either way. */
.valuation-advanced-count {
  display: none;
}

.valuation-layer {
  width: min(380px, calc(100vw - 32px));
  max-width: none;
  padding: 0;
  color: #21304a;
  background: #ffffff;
  border: 1px solid #dfe8f2;
  border-radius: 12px;
  box-shadow: 0 14px 38px rgba(23, 35, 58, 0.16);
}

.valuation-layer.is-wide {
  width: min(520px, calc(100vw - 32px));
}

.valuation-layer::backdrop {
  background: rgba(23, 35, 58, 0.45);
}

.valuation-layer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #e8eff8;
}

.valuation-layer-title {
  margin: 0;
  color: #17233a;
  font-size: var(--fs-h2, 15px);
  font-weight: 800;
}

.valuation-layer-close {
  flex: none;
  padding: 3px 10px;
  color: #596b84;
  background: #f2f6fb;
  border: 1px solid #dfe8f2;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.valuation-layer-body {
  max-height: min(70vh, 560px);
  padding: 12px 16px 16px;
  overflow-y: auto;
}

.valuation-layer-heading {
  margin: 12px 0 0;
  color: #17233a;
  font-size: 12px;
  font-weight: 800;
}

.valuation-layer-list {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding-left: 16px;
  color: #596b84;
  font-size: 11.5px;
  line-height: 1.55;
}

.valuation-layer-list strong {
  color: #17233a;
}

.valuation-layer-note {
  margin: 6px 0 0;
  color: #596b84;
  font-size: 11px;
  line-height: 1.5;
}

/* Inside the layer these paragraphs are body copy, not card chrome. */
.valuation-layer-body .valuation-band-subtitle,
.valuation-layer-body .valuation-band-guide {
  margin: 0 0 8px;
}

.valuation-layer-body .valuation-band-controls {
  margin: 0;
}

.valuation-layer-body .valuation-band-controls + .valuation-band-controls {
  margin-top: 12px;
}

.expert-segment-insight-band {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 0.9fr;
  gap: 12px;
  margin-top: 14px;
}

.expert-segment-insight-card {
  min-width: 0;
  padding: 13px 14px;
  color: #40536d;
  background: #ffffff;
  border: 1px solid #e0e9f5;
  border-left: 4px solid #8aa3c2;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(23, 35, 58, 0.04);
}

.expert-segment-takeaway {
  background: rgba(41, 128, 185, 0.055);
  border: 1px solid rgba(41, 128, 185, 0.18);
  border-left: 4px solid #2f80ed;
}

.expert-segment-profitability {
  background: rgba(39, 174, 96, 0.04);
  border-color: rgba(39, 174, 96, 0.16);
  border-left-color: #2fb57d;
}

.expert-segment-watch {
  background: rgba(240, 180, 41, 0.075);
  border-color: rgba(219, 164, 55, 0.2);
  border-left-color: #f0b429;
}

.expert-segment-insight-card strong {
  display: block;
  color: #174f7c;
  font-size: 13px;
  font-weight: 900;
}

.expert-segment-profitability strong {
  color: #0f766e;
}

.expert-segment-watch strong {
  color: #7a4d00;
}

.expert-segment-insight-card p {
  margin-top: 7px;
  font-size: 13px;
  line-height: 1.55;
}

.expert-segment-insight-card ul {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding-left: 17px;
  color: #596a84;
  font-size: 12.5px;
  line-height: 1.45;
}

.expert-chart-pair {
  display: grid;
  grid-template-columns: minmax(390px, 440px) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  min-width: 0;
}

.expert-chart-block {
  min-width: 0;
}

.expert-pie-block {
  max-width: 440px;
}

.expert-chart-block > span {
  display: block;
  margin-bottom: 4px;
  color: #6f7f99;
  font-size: 12px;
  font-weight: 900;
}

.expert-chart-small {
  height: 315px;
}

.expert-pie-block .expert-chart-small {
  height: 335px;
}

.expert-kpi-card {
  min-height: auto;
}

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

.expert-kpi-grid div {
  min-width: 0;
  padding: 10px 0;
  border-top: 1px solid #e8eff8;
}

.expert-kpi-grid span,
.expert-kpi-grid small {
  display: block;
}

.expert-kpi-grid span {
  color: #6f7f99;
  font-size: 12px;
  font-weight: 900;
}

.expert-kpi-grid strong {
  display: block;
  margin-top: 4px;
  color: #17233a;
  font-size: 22px;
  font-weight: 900;
}

.expert-kpi-grid small {
  margin-top: 3px;
  color: #596a84;
  font-size: 12px;
  line-height: 1.35;
}

.expert-side-card .chart-head {
  align-items: flex-start;
}

.expert-side-card .expert-info-tooltip .expert-tooltip-content {
  right: 0;
  left: auto;
}

.expert-side-card .expert-info-tooltip .expert-tooltip-content::before {
  right: 14px;
  left: auto;
}

.expert-fcf-card .expert-badge {
  gap: 4px;
  min-height: 24px;
  margin-top: 0;
  padding: 0 9px;
  white-space: nowrap;
}

.expert-fcf-metric-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}

.expert-fcf-metric-grid div {
  padding: 11px 0 12px;
}

.expert-fcf-metric-grid strong,
.expert-margin-metric-grid strong {
  font-size: 21px;
}

.expert-margin-metric-grid {
  grid-template-columns: 1fr;
  gap: 0;
  margin-bottom: 12px;
}

.expert-insight-callout {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding: 12px;
  color: #6b4d0d;
  background: rgba(242, 201, 76, 0.1);
  border: 1px solid rgba(242, 201, 76, 0.32);
  border-radius: 8px;
}

.expert-insight-callout > span {
  flex: 0 0 auto;
  line-height: 1.35;
}

.expert-insight-callout strong,
.expert-insight-callout p {
  color: inherit;
}

.expert-insight-callout strong {
  display: block;
  font-size: 12px;
  font-weight: 900;
}

.expert-insight-callout p {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

.cash-quality-takeaway {
  color: #174f7c;
  background: rgba(41, 128, 185, 0.06);
  border-color: rgba(41, 128, 185, 0.2);
}

.expert-trend-value {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.expert-kpi-grid .expert-trend-value,
.expert-kpi-grid .expert-trend-value span {
  display: inline-flex;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

.expert-kpi-grid .expert-trend-value span {
  color: inherit;
}

.expert-trend-value.positive {
  color: #137a61;
}

.expert-trend-value.negative {
  color: #c73642;
}

.expert-trend-value.neutral {
  color: #6f7f99;
}

.product-growth-kpi .expert-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 20px;
  margin-top: 0;
  padding: 0 8px;
}

.product-growth-insight {
  display: flex;
  gap: 9px;
  margin-top: 10px;
  padding: 11px 12px;
  color: #6b4d0d;
  background: #fff8e6;
  border: 1px solid #f1dfaa;
  border-radius: 8px;
}

.product-growth-insight > span {
  flex: 0 0 auto;
  line-height: 1.35;
}

.product-growth-insight p {
  margin: 0;
  color: inherit;
  font-size: 12px;
  line-height: 1.45;
}

.product-growth-insight strong {
  display: block;
  margin-bottom: 4px;
  color: #5a3d06;
  font-size: 12px;
  font-weight: 900;
}

.product-growth-watch {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.product-growth-watch span {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 8px;
  color: #6b4d0d;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(219, 164, 55, 0.26);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.product-growth-call-color {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 8px;
  margin-top: -4px;
  padding: 15px 16px;
  color: #174f7c;
  background: rgba(41, 128, 185, 0.06);
  border: 1px solid rgba(41, 128, 185, 0.2);
  border-left: 4px solid #2f80ed;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(23, 35, 58, 0.04);
}

.product-growth-call-color strong {
  color: #174f7c;
  font-weight: 900;
}

.product-growth-call-color > div:first-child > strong {
  display: block;
  font-size: 13px;
}

.product-growth-call-color ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #40536d;
  font-size: 13px;
  line-height: 1.6;
}

.product-growth-call-color li.mb-1 {
  margin-bottom: 4px;
}

.product-growth-call-tags {
  display: flex;
  flex-wrap: wrap;
  align-self: start;
  justify-content: flex-start;
  gap: 6px;
  margin-left: 18px;
}

.product-growth-call-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 8px;
  color: #174f7c;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(47, 128, 237, 0.2);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.expert-note {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid #e8eff8;
}

.expert-note.compact {
  color: #6f7f99;
  font-size: 11.5px;
}

.expert-more {
  margin-top: 6px;
}

.expert-more summary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #2f6fdb;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.expert-more summary::-webkit-details-marker {
  display: none;
}

.expert-more summary::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: #7b8ba3;
  background: #f1f5fa;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1;
}

.expert-more[open] summary::before {
  content: "−";
}

.expert-more p,
.expert-more ul {
  margin: 5px 0 0;
  color: #596a84;
  font-size: 11px;
  line-height: 1.45;
}

.expert-more ul {
  padding-left: 16px;
}

.expert-more li {
  margin: 3px 0;
}

.expert-more .expert-alert-explainer {
  margin-top: 8px;
}

.expert-empty-card {
  min-height: 180px;
}

.expert-alert-card {
  grid-column: 1 / -1;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr);
  align-items: center;
  gap: 14px;
  padding: 14px 44px 14px 16px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-left: 4px solid #45c4bd;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.expert-alert-card > .expert-info-tooltip {
  position: absolute;
  top: 14px;
  right: 16px;
}

.expert-alert-card > .expert-info-tooltip .expert-tooltip-content {
  right: 0;
  left: auto;
}

.expert-alert-card > .expert-info-tooltip .expert-tooltip-content::before {
  right: 14px;
  left: auto;
}

.expert-alert-card .expert-alert-explainer {
  grid-column: 1 / -1;
}

.expert-alert-card.warning {
  border-left-color: #f0a040;
  background: #fffaf2;
}

.expert-alert-card h2 {
  margin: 0 0 4px;
  color: #17233a;
  font-size: 16px;
}

.expert-alert-card p {
  margin: 0;
  color: #596a84;
  font-size: 12.5px;
  line-height: 1.45;
}

.expert-alert-points {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 17px;
  color: #596a84;
  font-size: 12.5px;
  line-height: 1.45;
}

.expert-alert-points li {
  padding-left: 1px;
}

.expert-alert-points strong {
  color: #253248;
  font-weight: 900;
}

.expert-alert-link {
  display: inline-block;
  margin-top: 8px;
  color: #2f6fdb;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.expert-alert-link:hover {
  text-decoration: underline;
}

.expert-alert-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.expert-alert-metrics div {
  min-width: 0;
  padding: 10px;
  background: #ffffff;
  border: 1px solid #e8eff8;
  border-radius: 8px;
}

.expert-alert-metrics span,
.expert-alert-metrics small {
  display: block;
}

.expert-alert-metrics span {
  color: #6f7f99;
  font-size: 11px;
  font-weight: 900;
}

.expert-alert-metrics strong {
  display: block;
  margin-top: 3px;
  color: #17233a;
  font-size: 18px;
  font-weight: 900;
}

.expert-alert-metrics small {
  margin-top: 2px;
  color: #596a84;
  font-size: 11px;
  line-height: 1.3;
}

.expert-alert-metrics em {
  font-style: normal;
}

.expert-alert-change {
  color: #c2410c;
  font-weight: 900;
}

.expert-alert-explainer {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.expert-alert-explainer div {
  min-width: 0;
  padding: 10px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid #f0dfc2;
  border-radius: 8px;
}

.expert-alert-explainer strong {
  display: block;
  color: #17233a;
  font-size: 12px;
  font-weight: 900;
}

.expert-alert-explainer p {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
}

.inventory-scenario-panel,
.working-capital-panel {
  min-height: auto;
  box-shadow: 0 4px 6px rgba(23, 35, 58, 0.05);
}

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

.inventory-ratio-chart {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #e8eff8;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(23, 35, 58, 0.05);
}

.inventory-ratio-chart .chart {
  height: 330px;
}

.inventory-signal-stack {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inventory-ratio-note,
.inventory-current-insight {
  min-width: 0;
  padding: 12px 14px;
  color: #4f6178;
  background: #ffffff;
  border: 1px solid #dfe6f0;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(23, 35, 58, 0.05);
}

.inventory-ratio-note {
  flex: 0 0 auto;
  border-color: #d8e2ef;
  background: #fbfcfe;
}

.inventory-current-insight {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(41, 128, 185, 0.09) 0%, rgba(41, 128, 185, 0.035) 100%);
  border-color: rgba(41, 128, 185, 0.22);
  border-left: 4px solid #2f80ed;
}

.inventory-ratio-note strong,
.inventory-current-insight > strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #17233a;
  font-size: 13.5px;
  font-weight: 900;
}

.inventory-ratio-note strong span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  color: #315c9b;
  background: #edf4ff;
  border: 1px solid #c9dcfb;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.inventory-current-insight > strong span {
  font-size: 13px;
}

.inventory-ratio-note p,
.inventory-current-insight p {
  margin: 6px 0 0;
  color: #5d6d82;
  font-size: 12.5px;
  line-height: 1.5;
}

.inventory-current-insight p + p {
  margin-top: 8px;
}

.inventory-current-insight p strong {
  color: #17233a;
  font-weight: 900;
}

.inventory-insight-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.inventory-insight-highlights span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  color: #174f7c;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(47, 128, 237, 0.22);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 900;
}

.inventory-signal-row {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 12px;
}

.inventory-signal-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 15px;
  border: 1px solid #dfe9f5;
  border-left: 4px solid #45c4bd;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(23, 35, 58, 0.05);
  word-break: keep-all;
}

.inventory-signal-card.positive {
  background: rgba(39, 174, 96, 0.04);
  border-color: rgba(39, 174, 96, 0.18);
  border-left-color: #2fb57d;
}

.inventory-signal-card.warning {
  background: rgba(235, 87, 87, 0.04);
  border-color: rgba(235, 87, 87, 0.18);
  border-left-color: #eb5757;
}

.inventory-signal-card strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #17233a;
  font-size: 14.5px;
  font-weight: 900;
}

.inventory-signal-card strong span {
  font-size: 12px;
}

.inventory-signal-card ul {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding-left: 18px;
  color: #5d6d82;
  font-size: 12.5px;
  line-height: 1.45;
}

.working-capital-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.working-capital-kpi-banner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.working-capital-kpi-banner div {
  min-width: 0;
  padding: 12px;
  background: #f8fbff;
  border: 1px solid #e0e9f5;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(23, 35, 58, 0.05);
}

.working-capital-kpi-banner span,
.working-capital-kpi-banner strong,
.working-capital-kpi-banner small {
  display: block;
}

.working-capital-kpi-banner span {
  color: #6f7f99;
  font-size: 11px;
  font-weight: 900;
}

.working-capital-kpi-banner strong {
  margin-top: 3px;
  color: #17233a;
  font-size: 23px;
  font-weight: 900;
}

.working-capital-kpi-banner small {
  margin-top: 3px;
  color: #596a84;
  font-size: 12px;
  line-height: 1.35;
}

.working-capital-paired-rows {
  display: grid;
  gap: 16px;
}

.working-capital-paired-row {
  display: grid;
  grid-template-columns: minmax(0, 2.35fr) minmax(280px, 1fr);
  align-items: start;
  gap: 16px;
}

.working-capital-chart-panel,
.working-capital-info-card {
  min-width: 0;
  padding: 10px 12px 8px;
  border: 1px solid #e8eff8;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(23, 35, 58, 0.05);
}

.working-capital-chart-panel {
  background: #ffffff;
}

.working-capital-chart-panel .chart {
  height: 246px;
}

.working-capital-info-card {
  padding: 22px 20px;
  border-color: #dfe9f5;
}

.working-capital-info-card.days-info {
  background: rgba(99, 130, 242, 0.05);
  border-color: rgba(99, 130, 242, 0.22);
}

.working-capital-info-card.flow-info {
  background: rgba(39, 174, 96, 0.05);
  border-color: rgba(39, 174, 96, 0.22);
}

.working-capital-info-card > strong {
  display: block;
  color: #17233a;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
}

.working-capital-chip {
  display: inline-flex;
  width: fit-content;
  margin-top: 10px;
  padding: 5px 12px;
  color: #315c9b;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(99, 130, 242, 0.2);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 900;
  line-height: 1.2;
}

.working-capital-info-card.flow-info .working-capital-chip {
  color: #137a61;
  border-color: rgba(39, 174, 96, 0.24);
}

.working-capital-info-card dl {
  display: grid;
  gap: 18px;
  margin: 18px 0 0;
}

.working-capital-info-card dt {
  color: #17233a;
  font-size: 15px;
  font-weight: 900;
}

.working-capital-info-card dd {
  margin: 7px 0 0;
  color: #526279;
  font-size: 15.5px;
  line-height: 1.68;
}

.working-capital-info-card dd strong {
  display: inline;
  color: #17233a;
  font-size: inherit;
  font-weight: 900;
}

.working-capital-info-card dd em {
  color: #c73642;
  font-style: normal;
  font-weight: 900;
}

.expert-pattern-card {
  min-height: auto;
}

.expert-compact-details {
  min-height: auto;
  padding: 10px 12px;
}

.expert-pattern-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
}

.expert-pattern-grid div {
  min-width: 0;
  padding: 11px;
  background: #f8fbff;
  border: 1px solid #e4ecf7;
  border-radius: 8px;
}

.expert-pattern-grid strong {
  display: block;
  color: #17233a;
  font-size: 12px;
  font-weight: 900;
}

.expert-pattern-grid p {
  margin: 6px 0 0;
  color: #596a84;
  font-size: 12px;
  line-height: 1.45;
}

.expert-future-card {
  min-height: auto;
  padding: 10px 12px;
}

.expert-liquidity-card {
  min-height: auto;
}

.expert-liquidity-title {
  gap: 8px;
  flex-wrap: wrap;
}

.expert-liquidity-title .expert-badge {
  margin-top: 0;
}

.expert-liquidity-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
}

.expert-liquidity-strip div {
  min-width: 0;
  padding: 10px;
  background: #f8fbff;
  border: 1px solid #e4ecf7;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(23, 35, 58, 0.05);
}

.expert-liquidity-strip span,
.expert-liquidity-strip strong,
.expert-liquidity-strip small,
.expert-liquidity-implication {
  display: block;
}

.expert-liquidity-strip span {
  color: #6f7f99;
  font-size: 11px;
  font-weight: 900;
}

.expert-liquidity-strip strong {
  margin-top: 4px;
  color: #17233a;
  font-size: 20px;
  font-weight: 900;
}

.expert-liquidity-strip small {
  margin-top: 3px;
  color: #596a84;
  font-size: 11px;
  line-height: 1.35;
}

.expert-liquidity-implication {
  margin-top: 9px;
  color: #7b889b;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.45;
}

.expert-liquidity-insight {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 12px;
  padding: 13px 14px;
  color: #40536d;
  background: rgba(41, 128, 185, 0.05);
  border: 1px solid rgba(41, 128, 185, 0.16);
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(23, 35, 58, 0.04);
}

.expert-liquidity-insight > span {
  flex: 0 0 auto;
  line-height: 1.35;
}

.expert-liquidity-insight p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

.expert-liquidity-insight strong {
  color: #1b5f99;
  font-weight: 900;
}

.expert-watchlist-card {
  min-height: auto;
}

.expert-watchlist-priority {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  padding: 12px 14px;
  color: #40536d;
  background: rgba(41, 128, 185, 0.055);
  border: 1px solid rgba(41, 128, 185, 0.18);
  border-left: 4px solid #2f80ed;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(23, 35, 58, 0.04);
}

.expert-watchlist-priority strong {
  flex: 0 0 auto;
  color: #174f7c;
  font-size: 13px;
  font-weight: 900;
}

.expert-watchlist-priority p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
}

.expert-watchlist {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
}

.expert-watchlist-item {
  position: relative;
  min-width: 0;
  padding: 12px;
  background: #f8fbff;
  border: 1px solid #e4ecf7;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(23, 35, 58, 0.05);
}

.expert-watchlist-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.expert-watchlist-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.expert-watchlist-head .expert-badge {
  flex: 0 0 auto;
  margin-top: 0;
  padding: 0 6px;
  min-height: 20px;
  font-size: 10px;
}

.expert-watchlist-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: #ffffff;
  background: var(--accent);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 900;
  flex-shrink: 0;
}

.expert-watchlist-title {
  display: block;
  margin-top: 0;
  color: #17233a;
  font-size: 12.5px;
  font-weight: 900;
  line-height: 1.35;
}

.expert-watchlist dl {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 11px 9px;
  margin: 14px 0 0;
}

.expert-watchlist dt,
.expert-watchlist dd {
  min-width: 0;
  margin: 0;
  font-size: 11.5px;
  line-height: 1.3;
}

.expert-watchlist dt {
  color: #6f7f99;
  font-weight: 900;
}

.expert-watchlist dd {
  color: #596a84;
  word-break: break-word;
}

.expert-watchlist dd.expert-watchlist-current {
  color: #17233a;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.15;
}

.expert-watchlist-condition-label.good,
.expert-watchlist-condition.good {
  color: #137a61;
}

.expert-watchlist-condition-label.caution,
.expert-watchlist-condition.caution {
  color: #c2410c;
}

.expert-watchlist dd.expert-watchlist-condition {
  font-weight: 800;
}

.expert-dashboard-footnote {
  grid-column: 1 / -1;
  margin: -2px 4px 0;
  color: #8a97aa;
  font-size: 12px;
  line-height: 1.55;
}

.summary-top {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 1fr);
  gap: 16px;
}

.overview-investment-gateway {
  grid-column: 1 / -1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.35fr);
  gap: 24px;
  padding: 22px 26px;
  color: #ffffff;
  background: linear-gradient(135deg, #111f36 0%, #172f4f 58%, #0f625f 135%);
  border: 1px solid #244567;
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(20, 40, 70, 0.16);
}

.overview-investment-copy,
.overview-investment-points,
.overview-investment-points li,
.overview-investment-points strong {
  min-width: 0;
}

.overview-gateway-eyebrow {
  display: block;
  color: var(--gateway-teal-bright);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.overview-investment-copy h2 {
  margin: 12px 0 0;
  color: #ffffff;
  font-size: 23px;
  line-height: 1.25;
}

.overview-investment-lead {
  display: block;
  margin-top: 10px;
  color: #d7e4f2;
  font-size: 14px;
  line-height: 1.6;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.overview-investment-lead:hover {
  color: #ffffff;
}

.overview-investment-lead:focus-visible,
.overview-gateway-cta:focus-visible,
.overview-gateway-secondary-cta:focus-visible,
.overview-risk-list a:focus-visible,
.overview-risk-cta:focus-visible {
  outline: 3px solid rgba(37, 189, 181, 0.52);
  outline-offset: 3px;
  border-radius: 4px;
}

.overview-gateway-cta,
.overview-gateway-secondary-cta,
.overview-risk-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0f766e;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.overview-investment-cta {
  margin-top: 18px;
  color: #8fe8e1;
}

.overview-gateway-cta span,
.overview-gateway-secondary-cta span,
.overview-risk-cta span {
  font-size: 18px;
  transition: transform 0.16s ease;
}

.overview-gateway-cta:hover span,
.overview-gateway-secondary-cta:hover span,
.overview-risk-cta:hover span {
  transform: translateX(3px);
}

.overview-investment-points {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(207, 231, 243, 0.2);
}

.overview-investment-points li {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 11px 0;
  border-bottom: 1px solid rgba(207, 231, 243, 0.2);
}

.overview-investment-points li > span {
  color: #72ddd5;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.overview-investment-points strong {
  color: #f5f9ff;
  font-size: 14.5px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* Three-tier point row (category chip → title → supporting line). The copy
   wrapper keeps the chip out of `li > span`, which styles the 01/02/03
   number. */
.overview-point-copy {
  min-width: 0;
  display: grid;
  justify-items: start;
  gap: 5px;
}

.overview-point-label {
  padding: 2px 9px;
  color: #b6ede8;
  background: rgba(37, 189, 181, 0.16);
  border: 1px solid rgba(114, 221, 213, 0.4);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.overview-point-support {
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  color: #c3d6e9;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.overview-gateway-card {
  min-width: 0;
  padding: 20px 22px;
  background: linear-gradient(145deg, #ffffff 0%, #f7fbfc 100%);
  border: 1px solid #cfe2e6;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(25, 52, 76, 0.1);
}

/* Stretch to the row height so this card always matches 핵심 위험 beside it
   (contract §6.1 — .content-grid is align-items:start, so without this the
   shorter card ends at its own content height). Same pattern as
   .overview-risk-gateway below. */
.overview-financial-structure {
  grid-column: span 2;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  border-top: 3px solid var(--accent-2);
}

.overview-financial-structure .overview-financial-body {
  flex: 1;
}

.overview-financial-structure .overview-gateway-actions {
  margin-top: auto;
}

.overview-risk-gateway {
  grid-column: span 1;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  background: linear-gradient(145deg, #ffffff 0%, #fffdfa 100%);
  border-color: var(--overview-risk-accent);
  border-top-width: 3px;
}

.overview-gateway-head h2 {
  margin: 6px 0 0;
  color: #17233a;
  font-size: 20px;
  line-height: 1.3;
}

.overview-financial-structure .overview-gateway-eyebrow {
  color: var(--gateway-teal);
}

.overview-risk-gateway .overview-gateway-eyebrow {
  color: var(--overview-risk-accent);
}

/* Revenue/expense Sankey — Overview 매출·비용 흐름 card. Drops into the
   two-column slot the 재무 구조 KPI flow held, with 핵심 위험 in the third.
   Stretches to the row height because .content-grid is align-items:start. */
.overview-sankey-card {
  grid-column: span 2;
  align-self: stretch;
  display: flex;
  flex-direction: column;
}

.overview-sankey-card .chart-head {
  align-items: flex-start;
  flex-wrap: wrap;
}

/* Window rail (TTM + fiscal years) reuses the valuation range-button styling. */
.sankey-window-ranges {
  margin-left: auto;
}

/* Language toggle sits at the card's bottom-right (5 o'clock), away from the
   window rail at the top so the head is not crowded with two button groups. */
.sankey-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.sankey-window-ranges button:disabled {
  color: #a8b4c6;
  background: #f6f8fb;
  border-color: #e7ecf3;
  cursor: not-allowed;
}

.sankey-caption {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: var(--fs-caption);
}

/* Six node columns with two-line labels need more height than the shared chart
   box; the card ends level with 핵심 위험 beside it (flex:1). */
.overview-sankey-card .chart {
  flex: 1;
  height: 420px;
  min-height: 420px;
}

.overview-financial-body {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.overview-financial-body.has-table-and-mix {
  grid-template-columns: minmax(0, 1.5fr) minmax(190px, 0.72fr);
}

/* KPI flow: two input tiles → the cash they leave → the balance it builds.
   Three tile columns with a labelled arrow between them. */
.overview-kpi-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 0.92fr) auto minmax(0, 0.92fr);
  align-items: stretch;
  gap: 10px;
}

/* The result and balance stages hold one tile each; centring them against the
   two-tile input column lines every tile up with the arrows. */
.overview-kpi-stage {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 10px;
}

.overview-kpi-tile {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 12px 13px;
  background: #f5f9fb;
  border: 1px solid #dfe9ef;
  border-radius: 8px;
}

.overview-kpi-label {
  color: #63738a;
  font-size: 12px;
  font-weight: 900;
}

.overview-kpi-value {
  color: #17233a;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.overview-kpi-sub {
  color: #41516a;
  font-size: 12px;
  font-weight: 700;
}

.overview-kpi-caption {
  margin: 3px 0 0;
  color: #596b84;
  font-size: var(--fs-body-sm);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.overview-kpi-asof {
  margin-top: 5px;
  padding: 2px 7px;
  color: #53647d;
  background: #e8f0f5;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.overview-kpi-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 74px;
  color: var(--gateway-teal);
}

.overview-kpi-arrow-glyph {
  font-size: 19px;
  line-height: 1;
}

.overview-kpi-arrow small {
  color: #63738a;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  word-break: keep-all;
}

.overview-segment-mix-strip .overview-segment-mix-head h3 {
  color: #17233a;
  font-size: 14px;
}

.overview-mix-note {
  margin: 6px 0 0;
  color: #687991;
  font-size: 11.5px;
  line-height: 1.45;
}

.overview-mix-role {
  color: #4c7f7a;
  font-size: 11.5px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.overview-financial-table,
.overview-segment-mix {
  min-width: 0;
}

.overview-financial-table h3,
.overview-segment-mix h3 {
  margin: 0 0 9px;
  color: #364760;
  font-size: 13px;
}

.overview-financial-table table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: var(--fs-body-sm);
}

.overview-financial-table th,
.overview-financial-table td {
  padding: 8px 9px;
  border-bottom: 1px solid #e4edf3;
  color: #41516a;
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
}

.overview-financial-table thead th {
  color: #63738a;
  background: #f2f7fa;
  font-weight: 900;
}

.overview-financial-table tbody th {
  color: #17233a;
  font-weight: 900;
}

.overview-segment-mix {
  padding: 14px;
  background: #f5f9fb;
  border: 1px solid #dfe9ef;
  border-radius: 8px;
}

.overview-segment-mix-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.overview-segment-mix-head span {
  color: #687991;
  font-size: 12px;
  font-weight: 900;
}

.overview-segment-mix-bar {
  height: 15px;
  display: flex;
  overflow: hidden;
  margin: 10px 0 14px;
  background: #e6edf2;
  border-radius: 999px;
}

.overview-segment-mix-bar span {
  flex: 0 0 var(--mix-share);
  min-width: 0;
  background: var(--mix-color);
}

.overview-segment-mix-legend {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Explicit columns for every child: a segment with no role label must leave
   its column empty rather than shift the amount and percent leftwards. */
.overview-segment-mix-legend li {
  min-width: 0;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 7px;
  color: #596b84;
  font-size: var(--fs-body-sm);
}

.overview-segment-mix-legend li::before { grid-column: 1; }
.overview-segment-mix-legend li > span { grid-column: 2; }
.overview-segment-mix-legend li > .overview-mix-role { grid-column: 3; }
.overview-segment-mix-legend li > small { grid-column: 4; }
.overview-segment-mix-legend li > strong { grid-column: 5; }

.overview-segment-mix-legend li small {
  color: #687991;
  font-size: var(--fs-body-sm);
  font-weight: 700;
}

.overview-segment-mix-legend li::before {
  width: 9px;
  height: 9px;
  background: var(--mix-color);
  border-radius: 3px;
  content: "";
}

.overview-segment-mix-legend li span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.overview-segment-mix-legend strong {
  color: #22314a;
  font-weight: 900;
}

.overview-gateway-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #e3ebf1;
}

.overview-gateway-secondary-cta {
  color: #53647d;
}

.overview-risk-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.overview-risk-list a {
  min-width: 0;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 10px;
  color: #24334b;
  background: #ffffff;
  border: 1px solid #e4e7e9;
  border-radius: 7px;
  text-decoration: none;
}

.overview-risk-list a:hover {
  border-color: var(--overview-risk-accent);
}

.overview-risk-list span {
  color: var(--overview-risk-accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.overview-risk-list strong {
  min-width: 0;
  font-size: 12.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.overview-risk-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.overview-risk-copy p {
  margin: 0;
  color: #62718a;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.overview-risk-cta {
  margin-top: auto;
  padding-top: 16px;
  color: var(--overview-risk-accent);
}

.price-trend-card {
  min-height: 430px;
}

.price-trend-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
}

.eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-2);
  font-size: var(--fs-small);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.price-trend-header h2 {
  margin: 0;
  color: #17233a;
  font-size: 20px;
}

.price-trend-value {
  text-align: right;
}

.call-summary-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.call-summary-card {
  position: relative;
  min-height: 360px;
  padding: 16px 18px 18px 22px;
  overflow: hidden;
}

.call-summary-card::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 0;
  width: 4px;
  background: #5c6cf2;
  border-radius: 0 4px 4px 0;
}

.key-summary::before {
  background: #25bdb5;
}

.call-summary-card .chart-head {
  align-items: baseline;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf1f7;
}

.call-summary-card .chart-head h2 {
  color: #17233a;
  font-size: 19px;
  line-height: 1.3;
}

.call-summary-card .chart-head span {
  color: #7b8ba3;
  font-size: 13px;
  font-weight: 800;
}

.call-summary-body {
  color: #263246;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Segoe UI", sans-serif;
  font-size: 15.5px;
  font-weight: 400;
  line-height: 1.75;
  overflow: visible;
}

.markdown-body.call-summary-body h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.markdown-body.call-summary-body h3 {
  margin: 26px 0 10px;
  color: #17233a;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.45;
}

.markdown-body.call-summary-body h3::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  background: #5c6cf2;
  border-radius: 999px;
  vertical-align: 0.08em;
}

.key-summary .markdown-body.call-summary-body h3::before {
  background: #25bdb5;
}

.markdown-body.call-summary-body p,
.markdown-body.call-summary-body li {
  color: #263246;
  font-size: 15.5px;
  font-weight: 400;
  line-height: 1.75;
}

.markdown-body.call-summary-body p {
  margin-bottom: 16px;
}

.markdown-body.call-summary-body ul {
  margin: 0 0 18px 20px;
}

.markdown-body.call-summary-body li {
  margin: 9px 0;
  padding-left: 2px;
}

.markdown-body.call-summary-body strong {
  color: #17233a;
  font-weight: 700;
}

.summary-keyword {
  color: #17233a;
  font-weight: 800;
}

.summary-keyword::after {
  content: ": ";
}

.summary-text {
  color: #263246;
  font-weight: 400;
}

.business-call-summary-card {
  min-height: 0;
  padding: 16px 18px;
}

.business-call-summary-card .chart-head {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf1f7;
}

.business-call-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.business-call-summary-column {
  min-width: 0;
}

.business-call-summary-column + .business-call-summary-column {
  padding-left: 16px;
  border-left: 1px solid #edf1f7;
}

.business-call-summary-column h3 {
  margin: 0 0 10px;
  color: #17233a;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
}

.business-call-summary-column ul {
  margin: 0;
  padding-left: 18px;
}

.business-call-summary-column li {
  margin: 9px 0;
  color: #263246;
  font-size: 13.5px;
  line-height: 1.6;
}

.business-call-period {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-right: 7px;
  padding: 0 7px;
  color: #2f46d5;
  background: #eef1ff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  vertical-align: 0.08em;
}

.business-call-empty {
  margin: 0;
  color: #6f7f99;
  font-size: 13px;
  line-height: 1.6;
}

.markdown-body.call-summary-body mark {
  padding: 1px 4px;
  color: #17233a;
  background: #fff1bf;
  border-radius: 4px;
  font-weight: 800;
}

.price-trend-value strong {
  display: block;
  color: #17233a;
  font-size: 30px;
  line-height: 1;
}

.price-trend-value span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.price-trend-value.up span {
  color: #ef4438;
}

.price-trend-value.down span {
  color: #2f6fdb;
}

.price-range-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 8px;
  border-bottom: 1px solid var(--border);
}

.price-range-tabs button {
  min-height: 32px;
  padding: 0 4px 8px;
  color: #51637d;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  font-weight: 800;
}

.price-range-tabs button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.price-chart {
  height: 230px;
}

.price-stats {
  margin: 12px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 10px;
}

.price-stats div {
  min-width: 0;
  padding: 10px 12px;
  background: #f7faff;
  border: 1px solid #e8eff8;
  border-radius: 8px;
}

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

.price-stats dd {
  margin: 5px 0 0;
  color: #17233a;
  font-size: 14px;
  font-weight: 900;
}

.summary-table-stack {
  display: grid;
  gap: 16px;
}

/* Summary tables in their new home at the top of Finance > 재무제표. Full
   width of the 3-column content grid, tables side by side. The cards hold
   different row counts, so they stretch to a shared height rather than
   leaving the shorter one's bottom edge floating. */
.financials-summary-tables {
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Analyst consensus card — sits where the summary tables used to be. */
.summary-top-single {
  grid-template-columns: minmax(0, 1fr);
}

.consensus-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.consensus-targets {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.consensus-targets-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.consensus-targets-head h3 {
  margin: 0;
  color: var(--heading);
  font-size: var(--fs-body-sm);
  font-weight: 900;
}

.consensus-targets-count {
  margin-left: auto;
  color: var(--muted);
  font-size: var(--fs-small);
  font-weight: 800;
  white-space: nowrap;
}

.consensus-targets-caption {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-caption);
  line-height: 1.4;
}

.consensus-targets-expired {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: var(--fs-caption);
  line-height: 1.5;
}

.consensus-rows {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.consensus-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eef2f7;
}

.consensus-row span {
  color: var(--muted);
  font-size: var(--fs-body-sm);
  font-weight: 800;
}

.consensus-row strong {
  color: var(--heading);
  font-size: var(--fs-h3);
  font-weight: 900;
}

.consensus-row em {
  color: var(--gateway-teal);
  font-size: var(--fs-body-sm);
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.consensus-meta {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
}

.consensus-meta > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.consensus-meta dt {
  color: var(--muted);
  font-size: var(--fs-small);
  font-weight: 800;
}

.consensus-meta dd {
  margin: 0;
  color: var(--text);
  font-size: var(--fs-body-sm);
  font-weight: 800;
}

.consensus-basis {
  margin: 12px 0 0;
  padding: 8px 10px;
  color: #8a6116;
  background: #fdf6e7;
  border: 1px solid #f1dfb6;
  border-radius: 6px;
  font-size: var(--fs-small);
  line-height: 1.5;
}

.consensus-source {
  margin: auto 0 0;
  padding-top: 12px;
  color: var(--muted);
  font-size: var(--fs-caption);
  line-height: 1.5;
}

@media (max-width: 900px) {
  .financials-summary-tables {
    grid-template-columns: minmax(0, 1fr);
  }
}

.summary-table-card {
  min-width: 0;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.summary-table-card h2 {
  margin: 0 0 10px;
  color: #17233a;
  font-size: 15px;
}

.summary-table-wrap {
  overflow-x: auto;
}

/* Fixed layout so the two cards side by side share one column geometry instead
   of each sizing its own columns to its own row labels. */
.summary-table-card table {
  width: 100%;
  min-width: 460px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 12px;
}

.summary-table-card th,
.summary-table-card td {
  padding: 8px 9px;
  border-bottom: 1px solid #e8eff8;
  text-align: right;
  white-space: nowrap;
}

.summary-table-card thead th {
  color: #6f7f99;
  background: #f7faff;
  font-weight: 900;
}

/* Widest row label across both tables is "잉여현금흐름 FCF"; pinning the width
   keeps the label column identical in each card. */
.summary-table-card th:first-child {
  width: 112px;
  text-align: left;
}

.summary-table-card tbody th {
  color: #17233a;
  font-weight: 900;
}

.summary-table-card td {
  color: #21304a;
  font-weight: 800;
}

/* Stack the YoY change under the value, same trick as the provisional badge
   below: on one line the five quarter columns no longer fit the half-width
   card and the oldest ones get clipped. */
.summary-table-card td .up,
.summary-table-card td .down {
  display: block;
}

.summary-table-card .up {
  color: #ef4438;
}

.summary-table-card .down {
  color: #2f6fdb;
}

/* Provisional fiscal-year column badge (DESIGN.md §5.4). Stacks a caption under
   the label so the "잠정" tag never widens the column. */
.summary-table-card th.col-provisional {
  white-space: normal;
}

.col-provisional-label {
  display: block;
}

.col-provisional-badge {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-caption);
  font-weight: 900;
  line-height: 1.1;
  color: var(--overview-risk-accent);
}

/* Overview trust signal — one caption line under the summary tables. */
.overview-trust-note {
  grid-column: 1 / -1;
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: var(--fs-caption);
  color: var(--muted);
}

.overview-trust-note.is-flagged .overview-trust-chip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-weight: 900;
  color: var(--overview-risk-accent);
  background: var(--panel);
  border: 1px solid var(--warn);
}

.overview-trust-link {
  color: var(--overview-risk-accent);
  font-weight: 900;
  text-decoration: none;
}

.overview-trust-link:hover {
  text-decoration: underline;
}

/* Data Trust card (Finance tab). DESIGN.md §5.4. */
.data-trust-card {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.data-trust-head {
  align-items: center;
}

.data-trust-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: var(--fs-caption);
  font-weight: 900;
}

.data-trust-badge-pass {
  color: var(--muted);
  background: var(--panel-soft);
  border: 1px solid var(--border);
}

.data-trust-badge-flag {
  color: var(--overview-risk-accent);
  background: var(--panel-soft);
  border: 1px solid var(--warn);
}

.data-trust-policy,
.data-trust-coverage,
.data-trust-counts,
.data-trust-fy {
  margin: 0;
  font-size: var(--fs-body-sm);
  color: var(--text);
}

.data-trust-coverage {
  font-weight: 900;
}

.data-trust-fy {
  color: var(--overview-risk-accent);
}

.data-trust-footnote {
  margin: 0;
  font-size: var(--fs-caption);
  color: var(--muted);
}

.data-trust-expander {
  margin-top: 2px;
}

.data-trust-expander > summary {
  cursor: pointer;
  font-size: var(--fs-body-sm);
  color: var(--muted);
}

.data-trust-issue-list,
.data-trust-note-list {
  margin: 8px 0 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.data-trust-issue {
  display: grid;
  grid-template-columns: minmax(64px, auto) minmax(0, 1fr);
  gap: 8px;
  font-size: var(--fs-caption);
  color: var(--text);
}

.data-trust-issue-id {
  font-weight: 900;
  color: var(--muted);
}

.data-trust-issue-block .data-trust-issue-id {
  color: var(--overview-risk-accent);
}

.data-trust-issue-ref {
  color: var(--muted);
}

.data-trust-note-list {
  font-size: var(--fs-caption);
  color: var(--muted);
}

.data-trust-admin-line {
  margin: 8px 0 0;
  font-size: var(--fs-caption);
  color: var(--muted);
}

.ir-layout {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 320px;
  gap: 16px;
  min-height: 650px;
  font-family: "LINE Seed Sans", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Segoe UI", sans-serif;
}

.ir-layout button,
.ir-layout input,
.ir-layout a,
.ir-layout p,
.ir-layout li,
.ir-layout h1,
.ir-layout h2,
.ir-layout h3,
.ir-layout dt,
.ir-layout dd,
.ir-layout span,
.ir-layout strong,
.ir-layout small {
  font-family: inherit;
}

.ir-events,
.ir-document,
.ir-notes {
  min-width: 0;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.ir-events,
.ir-notes {
  position: sticky;
  top: 16px;
  align-self: start;
  max-height: calc(100vh - 80px);
  overflow: auto;
  overscroll-behavior: contain;
}

.ir-panel-head {
  margin-bottom: 12px;
}

.ir-panel-head h2,
.ir-document-head h2 {
  margin: 0;
  color: #17233a;
  font-size: 18px;
}

.ir-event-list {
  display: grid;
  gap: 8px;
}

.ir-event {
  width: 100%;
  padding: 12px;
  color: var(--text);
  background: #f7faff;
  border: 1px solid #e7eef7;
  border-radius: 8px;
  text-align: left;
}

.ir-event.active {
  background: #eef4ff;
  border-color: #9fb0ff;
  box-shadow: inset 3px 0 0 var(--accent);
}

.ir-event strong,
.ir-event span,
.ir-event small {
  display: block;
}

.ir-event strong {
  font-size: 14px;
}

.ir-event span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ir-event small {
  margin-top: 8px;
  color: #8a6680;
  font-size: 11px;
  font-weight: 800;
}

.ir-document {
  display: flex;
  flex-direction: column;
  min-height: 650px;
}

.ir-document-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.ir-document-head p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.ir-doc-actions {
  display: flex;
  gap: 8px;
}

.ir-download {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: #12382f;
  background: #f5fffe;
  border: 1px solid #91dfda;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.ir-doc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.ir-doc-tabs button {
  min-height: 34px;
  padding: 0 12px;
  color: #51637d;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 800;
}

.ir-doc-tabs button.active {
  color: #17233a;
  background: #fff;
  border-color: #9fb0ff;
  box-shadow: inset 0 -3px 0 var(--accent);
}

.ir-doc-text {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 18px;
  overflow: auto;
  color: #25344d;
  background: #fbfdff;
  border: 1px solid #e7eef7;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.75;
}

.ir-doc-text.ir-summary-doc {
  padding: 0;
  background: transparent;
  border: 0;
}

.ir-doc-text.ir-slide-doc {
  padding: 0;
  overflow: hidden;
  background: #303241;
  border-color: #303241;
}

.ir-slide-viewer {
  height: min(78vh, 860px);
  min-height: 620px;
  background: #303241;
}

.ir-slide-viewer iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #303241;
}

.ir-summary-doc .call-summary-grid {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px;
}

.ir-summary-doc .call-summary-card {
  min-height: auto;
  box-shadow: none;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  margin: 0 0 14px;
  color: #0f1d35;
  line-height: 1.35;
}

.markdown-body h1 {
  font-size: 22px;
}

.markdown-body h2 {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid #e7eef7;
  font-size: 17px;
}

.markdown-body h3 {
  margin-top: 20px;
  font-size: 15px;
}

.markdown-body p {
  margin: 0 0 16px;
  color: #10233f;
  font-weight: 600;
}

.markdown-body strong {
  color: #071a34;
  font-weight: 900;
}

.markdown-body em {
  color: #31435f;
}

.markdown-body code {
  padding: 2px 5px;
  color: #1c4a66;
  background: #edf7fb;
  border: 1px solid #d6edf5;
  border-radius: 5px;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.92em;
}

.markdown-body mark {
  padding: 2px 5px;
  color: #13223a;
  background: linear-gradient(180deg, rgba(255, 235, 135, 0.35) 0%, rgba(255, 214, 92, 0.65) 100%);
  border-radius: 5px;
  box-decoration-break: clone;
}

.translation-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.translation-section {
  margin: 0 0 22px;
  padding: 18px;
  background: #f8fbff;
  border: 1px solid #dce7f5;
  border-radius: 12px;
}

.translation-section > h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  color: #13233d;
}

.translation-pair > section {
  min-width: 0;
  padding: 16px;
  background: #ffffff;
  border: 1px solid #e5edf7;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.75;
}

.translation-pair h2 {
  font-size: 16px;
  line-height: 1.45;
}

.translation-pair h3 {
  font-size: 15px;
  line-height: 1.45;
}

.translation-pair p,
.translation-pair li {
  font-size: 14px;
  line-height: 1.75;
}

/* Outranks .markdown-body p (0,1,1), which otherwise overrides the label's
   weight and size inside .ir-doc-text.markdown-body. */
.translation-pair .translation-col-label {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  color: var(--accent-2);
  font-size: var(--fs-small);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.markdown-body ul {
  margin: 0 0 16px 18px;
  padding: 0;
}

.markdown-body li {
  margin: 6px 0;
  color: #10233f;
  font-weight: 600;
}

.ir-notes {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ir-notes-grid {
  display: grid;
  gap: 12px;
}

.ir-metric-grid {
  display: grid;
  gap: 12px;
}

.ir-snapshot-section {
  padding: 12px;
  background: #fbfdff;
  border: 1px solid #e4ebf5;
  border-radius: 8px;
}

.ir-snapshot-section h3 {
  margin: 0;
  color: var(--heading);
  font-size: var(--fs-body-sm);
}

.ir-snapshot-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.ir-snapshot-head span {
  color: var(--muted);
  font-size: var(--fs-caption);
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.takeaway-section {
  background: #f2fbff;
  border-color: #d7edf6;
}

.takeaway-list {
  display: grid;
  gap: 9px;
}

.takeaway-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
}

.sentiment-icon {
  width: 12px;
  height: 12px;
  margin-top: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #11a36a;
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(17, 163, 106, 0.14);
}

.takeaway-item.positive .sentiment-icon {
  background: #11a36a;
  box-shadow: 0 0 0 4px rgba(17, 163, 106, 0.14);
}

.takeaway-item.negative .sentiment-icon {
  background: #e91f4f;
  box-shadow: 0 0 0 4px rgba(233, 31, 79, 0.14);
}

.takeaway-item.neutral .sentiment-icon {
  background: #f2b705;
  box-shadow: 0 0 0 4px rgba(242, 183, 5, 0.18);
}

.takeaway-item p {
  margin: 0;
  color: #4f5d70;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.55;
}

.takeaway-item p strong,
.takeaway-item p mark {
  color: #263449;
  font-weight: 900;
}

.takeaway-more {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid #d7edf6;
}

.takeaway-more summary,
.source-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #2f6fdb;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.takeaway-more summary::-webkit-details-marker,
.source-section summary::-webkit-details-marker {
  display: none;
}

.takeaway-more summary::after,
.source-section summary::after {
  content: "+";
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}

.takeaway-more[open] summary::after,
.source-section[open] summary::after {
  content: "−";
}

.takeaway-more .takeaway-list {
  margin-top: 10px;
}

.metric-section {
  background: #fff;
}

.compact-section {
  padding: 10px 12px;
}

.ir-metric-list {
  margin: 0;
}

.ir-metric-list div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px solid #e4ebf5;
}

.ir-metric-list div:first-child {
  border-top: 0;
}

.ir-metric-list dt {
  color: #4f5d70;
  font-size: 12px;
  font-weight: 700;
}

.ir-metric-list dd {
  margin: 0;
  color: #3f4b5d;
  font-size: 12.5px;
  font-weight: 900;
  text-align: right;
}

.ir-metric-list dd.positive {
  color: #0b8d57;
}

.ir-metric-list dd.negative {
  color: #d6284f;
}

.ir-source-links {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.ir-source-links a,
.ir-source-links span {
  color: #2f6fdb;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  word-break: break-word;
}

.source-section {
  padding: 10px 12px;
}

.source-section summary span {
  color: var(--heading);
  font-size: var(--fs-body-sm);
}

.source-section summary small {
  color: var(--muted);
  font-size: var(--fs-caption);
  font-weight: 800;
  text-transform: uppercase;
}

.empty-state,
.status {
  margin: 0 18px 18px;
  padding: 18px;
  color: #586b84;
  background: #fff;
  border: 1px dashed #c7d4e6;
  border-radius: 8px;
}

.hidden {
  display: none !important;
}

.report-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 360px;
  background: var(--panel);
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 28px rgba(31, 45, 69, 0.12);
  z-index: 5;
  overflow: auto;
}

.drawer-header {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}

.icon-button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
  border-radius: 6px;
  color: var(--text);
}

.report-list {
  padding: 12px;
}

.report-row {
  width: 100%;
  margin-bottom: 8px;
  padding: 12px;
  text-align: left;
  color: var(--text);
  background: #f8fbff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.report-row strong {
  display: block;
}

.report-row span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1500px) {
  .ir-layout {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .ir-notes {
    grid-column: 1 / -1;
    order: 1;
    display: block;
  }

  .ir-events,
  .ir-notes {
    position: static;
    top: auto;
    align-self: stretch;
    max-height: none;
    overflow: visible;
    overscroll-behavior: auto;
  }

  .ir-notes > .ir-panel-head {
    margin-bottom: 12px;
  }

  .ir-notes-grid {
    display: grid;
    gap: 12px;
  }

  .ir-notes-grid > * {
    width: 100%;
    margin: 0;
  }

  .ir-notes-grid .takeaway-list,
  .ir-metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ir-events {
    order: 2;
  }

  .ir-document {
    order: 3;
  }
}

@media (max-width: 1400px) {
  .expert-segment-layout {
    grid-template-columns: 1fr;
  }

  .expert-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .expert-summary-grid > div:nth-child(3n) .expert-tooltip-content {
    right: 0;
    left: auto;
  }

  .expert-summary-grid > div:nth-child(3n) .expert-tooltip-content::before {
    right: 14px;
    left: auto;
  }

  .expert-watchlist {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1320px) {
  .inventory-scenario-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 280px 1fr;
  }

  .content-grid {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }

  .analysis-signal-card,
  .analysis-item-grid,
  .analysis-card-explainer .analysis-item-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analysis-signal-card > div:first-child {
    grid-column: 1 / -1;
  }

  .analysis-signal-card dl {
    grid-column: 1 / -1;
  }

  .expert-summary-layout,
  .expert-segment-layout {
    grid-template-columns: 1fr;
  }

  .expert-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .expert-alert-explainer,
  .expert-pattern-grid,
  .expert-watchlist,
  .expert-liquidity-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .expert-alert-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .ir-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .ir-event-list {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .analysis-document-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .analysis-toc {
    display: none;
  }

  .analysis-mobile-toc {
    display: block;
  }
}

@media (min-width: 900px) and (max-width: 1100px) {
  .workspace.sidebar-collapsed .ir-layout {
    grid-template-columns: 230px minmax(0, 1fr);
  }
}

@media (max-width: 1000px) {
  .overview-investment-gateway,
  .summary-top {
    grid-template-columns: minmax(0, 1fr);
  }

  .overview-sankey-card,
  .overview-financial-structure,
  .overview-risk-gateway {
    grid-column: 1 / -1;
  }

  /* The node columns keep their widths as the card narrows, so the flow needs
     more vertical room here than on a wide screen, not less. */
  .overview-sankey-card .chart {
    height: 480px;
    min-height: 480px;
  }

  .overview-financial-body.has-table-and-mix {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .ir-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ir-metric-grid > :last-child {
    grid-column: 1 / -1;
  }

  .content-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .chart-card.wide {
    grid-column: auto;
  }

  .valuation-top-row {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .expert-focus-chart .chart {
    height: 280px;
    min-height: 280px;
  }

  .expert-guide ul {
    grid-template-columns: 1fr;
  }

  .expert-summary-grid,
  .expert-watchlist {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-growth-call-color {
    grid-template-columns: 1fr;
  }

  .product-growth-call-tags {
    justify-content: flex-start;
  }

  .expert-summary-grid > div:nth-child(2n) .expert-tooltip-content {
    right: 0;
    left: auto;
  }

  .expert-summary-grid > div:nth-child(2n) .expert-tooltip-content::before {
    right: 14px;
    left: auto;
  }

  .expert-alert-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .expert-chart-pair {
    grid-template-columns: 1fr;
  }

  .inventory-scenario-layout {
    grid-template-columns: 1fr;
  }

  .working-capital-paired-row {
    grid-template-columns: 1fr;
  }

  .expert-segment-layout {
    grid-template-columns: 1fr;
  }

  .expert-segment-insight-band {
    grid-template-columns: 1fr;
  }

  .expert-hero {
    grid-template-columns: 1fr;
  }

  .expert-hero-note {
    padding: 10px 0 0;
    border-left: 0;
    border-top: 1px solid #dce7f4;
  }
}

@media (max-width: 820px) {
  .app-shell {
    height: auto;
    overflow: visible;
  }

  .topbar {
    height: auto;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px 10px;
  }

  .market-regime-badge {
    justify-self: start;
  }

  .market-regime-badge .expert-tooltip-content {
    right: auto;
    left: 0;
    max-width: calc(100vw - 20px);
  }

  .market-regime-badge .expert-tooltip-content::before {
    right: auto;
    left: 14px;
  }

  .workspace,
  .workspace.sidebar-collapsed {
    display: block;
    height: auto;
  }

  .workspace > .sidebar-toggle,
  .workspace.sidebar-collapsed > .sidebar-toggle {
    display: none;
  }

  .sidebar,
  .workspace.sidebar-collapsed .sidebar {
    display: block;
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    overflow: visible;
  }

  .company-card {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: 8px 10px;
    padding: 10px 12px;
  }

  .ticker-line h1 {
    font-size: 15px;
  }

  .price-line {
    margin-top: 0;
    font-size: 20px;
  }

  .price-delay,
  .mini-metrics {
    display: none;
  }

  .price-changes {
    min-width: 0;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 4px;
    margin-top: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .price-changes .change-chip:first-child {
    margin-left: auto;
  }

  .price-changes::-webkit-scrollbar {
    display: none;
  }

  .change-chip {
    min-height: 24px;
    flex: 0 0 auto;
    padding: 0 6px;
    white-space: nowrap;
  }

  .mobile-feed-toggle {
    width: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    color: #51637d;
    background: #f7faff;
    border: 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 800;
  }

  .mobile-feed-toggle-icon {
    font-size: 18px;
    transition: transform 0.16s ease;
  }

  .sidebar.mobile-feed-open .mobile-feed-toggle-icon {
    transform: rotate(180deg);
  }

  .sidebar:not(.mobile-feed-open) .feed {
    display: none;
  }

  .main-panel {
    grid-column: auto;
    height: auto;
    overflow: visible;
  }

  /* Banner height budget ≤88px (contract §3.3): smaller mark, tags dropped,
     tagline allowed a second line. */
  .identity-banner {
    gap: 10px;
    padding: 8px 12px;
  }

  .identity-banner-mark {
    width: 36px;
    height: 36px;
    font-size: var(--fs-body);
  }

  .identity-banner-mark-logo {
    width: auto;
    max-width: 104px;
    height: 24px;
  }

  .identity-banner-name {
    font-size: var(--fs-lead);
  }

  .identity-banner-symbol {
    font-size: var(--fs-small);
  }

  .identity-banner-tags {
    display: none;
  }

  .identity-banner-tagline {
    -webkit-line-clamp: 2;
    font-size: var(--fs-body-sm);
  }

  .main-tabs {
    height: 48px;
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 6px 8px;
  }

  .main-tabs button {
    min-width: 0;
    min-height: 36px;
    padding: 0 4px;
    font-size: 12px;
  }

  .tab-label-wide {
    display: none;
  }

  .tab-label-short {
    display: inline;
  }

  .content-grid {
    grid-template-columns: 1fr;
    padding: 0 12px 20px;
  }

  .analysis-representative-image-layout {
    grid-template-columns: 1fr;
  }

  .summary-top {
    grid-template-columns: 1fr;
  }

  .overview-investment-gateway {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 18px;
  }

  .overview-investment-copy h2 {
    font-size: var(--fs-h2);
  }

  .overview-investment-lead {
    font-size: 14px;
    line-height: 1.6;
  }

  .overview-investment-points strong {
    font-size: 15px;
  }

  /* The narrow column fits ~24 characters per line, so the desktop 2-line
     clamp cuts the supporting sentences mid-phrase. Contract §5.1 allows the
     stacked card to grow, so raise the clamp instead of truncating. */
  .overview-point-support {
    -webkit-line-clamp: 4;
    line-clamp: 4;
  }

  .overview-gateway-card {
    padding: 18px;
  }

  /* Same chain read top-to-bottom: the arrow glyph turns to point down. */
  .overview-kpi-flow {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .overview-kpi-arrow {
    flex-direction: row;
    gap: 8px;
    width: auto;
  }

  .overview-kpi-arrow-glyph {
    transform: rotate(90deg);
  }

  /* Stacked tiles pair up the two short fields per row (label with its as-of
     chip, value with its sub) so four tiles stay readable without turning the
     card into a scroll of its own. */
  .overview-kpi-tile {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 2px 8px;
    padding: 10px 12px;
  }

  .overview-kpi-label {
    grid-area: 1 / 1;
  }

  .overview-kpi-asof {
    grid-area: 1 / 2;
    justify-self: end;
    margin-top: 0;
  }

  .overview-kpi-value {
    grid-area: 2 / 1;
    font-size: 22px;
  }

  .overview-kpi-sub {
    grid-area: 2 / 2;
    justify-self: end;
  }

  .overview-kpi-caption {
    grid-area: 3 / 1 / auto / 3;
    margin-top: 1px;
  }

  .call-summary-grid {
    grid-template-columns: 1fr;
  }

  .business-call-summary-grid {
    grid-template-columns: 1fr;
  }

  .business-call-summary-column + .business-call-summary-column {
    padding-top: 12px;
    padding-left: 0;
    border-top: 1px solid #edf1f7;
    border-left: 0;
  }

  .chart-card.wide {
    grid-column: auto;
  }

  .expert-hero,
  .expert-summary-layout,
  .expert-segment-layout,
  .expert-chart-pair,
  .expert-kpi-grid,
  .expert-summary-grid,
  .expert-alert-explainer,
  .expert-pattern-grid,
  .expert-watchlist,
  .working-capital-kpi-banner,
  .expert-liquidity-strip {
    grid-template-columns: 1fr;
  }

  .expert-alert-card {
    grid-template-columns: 1fr;
  }

  .expert-hero-questions {
    grid-template-columns: 1fr;
  }

  .expert-question-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .expert-alert-metrics {
    grid-template-columns: 1fr;
  }

  .expert-hero-note {
    padding: 10px 0 0;
    border-left: 0;
    border-top: 1px solid #dce7f4;
  }

  .expert-chart-small {
    height: 280px;
  }

  .price-trend-header {
    display: block;
  }

  .price-trend-value {
    margin-top: 12px;
    text-align: left;
  }

  .price-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ir-layout {
    grid-template-columns: 1fr;
  }

  .ir-notes-grid {
    grid-template-columns: 1fr;
  }

  .ir-notes-grid .takeaway-list,
  .ir-metric-grid {
    grid-template-columns: 1fr;
  }

  .ir-metric-grid > :last-child {
    grid-column: auto;
  }

  .news-page-item {
    grid-template-columns: 1fr;
  }

  .news-page-thumb {
    width: 100%;
    max-width: 360px;
  }

  .analysis-hero,
  .analysis-signal-card {
    display: block;
  }

  .analysis-hero small {
    display: block;
    margin-top: 12px;
  }

  .analysis-note-hero,
  .analysis-note-actions,
  .analysis-subsection-head {
    display: block;
  }

  .analysis-note-actions {
    margin-top: 12px;
  }

  .analysis-document-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .analysis-toc {
    display: none;
  }

  .analysis-mobile-toc {
    display: block;
  }

  .analysis-history-head,
  .analysis-version-item {
    grid-template-columns: 1fr;
  }

  .analysis-history-head,
  .analysis-history-actions {
    display: grid;
    justify-content: stretch;
  }

  .analysis-version-form {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .analysis-version-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .analysis-history-columns {
    grid-template-columns: 1fr;
  }

  .analysis-note-actions .ghost-button,
  .analysis-section-edit {
    margin-top: 10px;
  }

  .analysis-chapter {
    padding: 18px;
  }

  .analysis-chapter-head {
    grid-template-columns: 1fr;
  }

  .analysis-signal-card dl,
  .analysis-item-grid,
  .analysis-card-explainer .analysis-item-grid,
  .analysis-risk-list {
    grid-template-columns: 1fr;
    margin-top: 14px;
  }

  .translation-pair {
    grid-template-columns: 1fr;
  }

  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .report-drawer {
    width: 100%;
  }
}

@media (max-width: 640px) {
  /* Wrap instead of ellipsis: a truncated basis or as-of date is worse than a
     second line (AC-6 — nothing clipped, no horizontal page scroll). */
  .valuation-reading > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .valuation-metric-ratio strong {
    font-size: 23px;
  }

  .valuation-band-fold-title {
    font-size: 14px;
  }

  /* One chip per row; the anchor rows stay comfortable touch targets. */
  .valuation-summary-chips {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Collapsed band summary is the whole card surface here (§5.3): give the
     row touch-target height. */
  .valuation-band-fold-summary {
    padding: 10px 0;
  }

  /* §7.1: the layer becomes a bottom sheet that scrolls inside itself, and the
     page behind it stops scrolling while it is open. */
  .valuation-layer,
  .valuation-layer.is-wide {
    width: 100%;
    margin: auto auto 0;
    border-bottom: 0;
    border-radius: 12px 12px 0 0;
  }

  .valuation-layer-body {
    max-height: 70vh;
  }

  body.valuation-layer-open {
    overflow: hidden;
  }

  /* §7.2 narrow-width discipline: the content box is 300px at 360px viewport,
     so the basis group drops its visible label (the group aria-label still
     names it) and the advanced badge shows a count instead of the full state.
     Both together keep [기준 …] [고급 n ▾] on one row. */
  .valuation-basis-controls > span {
    width: 1px;
    height: 1px;
    position: absolute;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .valuation-advanced-full {
    display: none;
  }

  .valuation-advanced-count {
    display: inline;
  }

  .overview-investment-copy h2 {
    font-size: var(--fs-h2);
  }

  /* Narrow enough that name/amount/percent cannot share one row. Every child
     gets an explicit cell: without it `small` auto-placed into the 9px dot
     column and overlapped `strong`, rendering "$2*12.51*%". */
  .overview-segment-mix-legend li {
    grid-template-columns: 9px minmax(0, 1fr) auto;
    align-items: start;
    row-gap: 2px;
  }

  .overview-segment-mix-legend li::before {
    grid-area: 1 / 1;
    margin-top: 5px;
  }

  .overview-segment-mix-legend li > span {
    grid-area: 1 / 2;
  }

  .overview-segment-mix-legend li > strong {
    grid-area: 1 / 3;
  }

  .overview-segment-mix-legend li > .overview-mix-role {
    grid-area: 2 / 2;
  }

  .overview-segment-mix-legend li > small {
    grid-area: 2 / 3;
  }

  .expert-watchlist-priority {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .expert-summary-grid,
  .expert-alert-metrics,
  .expert-alert-explainer,
  .expert-pattern-grid,
  .expert-watchlist,
  .expert-kpi-grid,
  .expert-hero-questions,
  .inventory-signal-row {
    grid-template-columns: 1fr;
  }

  .expert-summary-grid > div > strong {
    font-size: 18px;
  }

  .expert-info-tooltip,
  .expert-badge-tooltip {
    position: static;
  }

  .expert-tooltip-content,
  .expert-badge-tooltip .expert-tooltip-content,
  .expert-summary-grid > div:nth-child(4) .expert-tooltip-content,
  .expert-summary-grid > div:nth-child(5) .expert-tooltip-content {
    right: auto;
    left: 0;
    width: min(300px, calc(100vw - 48px));
    min-width: 0;
    max-width: none;
  }

  .expert-tooltip-content::before,
  .expert-badge-tooltip .expert-tooltip-content::before,
  .expert-summary-grid > div:nth-child(4) .expert-tooltip-content::before,
  .expert-summary-grid > div:nth-child(5) .expert-tooltip-content::before {
    right: auto;
    left: 14px;
  }

  .expert-alert-card {
    grid-template-columns: 1fr;
  }

  .expert-hero {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .expert-chart-small {
    height: 250px;
  }

  .analysis-editor .analysis-image-row,
  .analysis-markdown .analysis-image-row {
    flex-direction: column;
  }

  .analysis-editor .analysis-image-row > .analysis-image-resizer,
  .analysis-markdown .analysis-image-row > .analysis-image-resizer {
    width: 100% !important;
  }

  .analysis-finance-chart-card {
    padding: 10px 8px 6px;
  }

  .analysis-finance-chart-head {
    display: block;
  }

  .analysis-finance-chart-head span {
    display: block;
    margin-top: 2px;
  }

  .analysis-finance-chart-canvas {
    height: 270px;
  }

  .ir-ownership-table-wrap th,
  .ir-ownership-table-wrap td {
    padding: 6px 8px;
  }

  .ir-ownership-table-wrap table {
    min-width: 700px;
  }
}

@media print {
  @page {
    size: A4;
    margin: 14mm;
  }

  html,
  body {
    width: auto;
    height: auto;
    overflow: visible;
    color: #111827;
    background: #ffffff;
  }

  .topbar,
  .sidebar,
  .toolbar,
  .analysis-note-actions,
  .analysis-history-panel,
  .analysis-toc,
  .analysis-mobile-toc,
  .analysis-section-edit,
  .analysis-editor-toolbar,
  .analysis-editor-actions,
  .analysis-cancel-button {
    display: none !important;
  }

  .app-shell,
  .workspace,
  .main-panel,
  .content-grid,
  .analysis-page,
  .analysis-document-layout,
  .analysis-document {
    display: block !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    padding: 0 !important;
    background: #ffffff !important;
  }

  .analysis-page {
    gap: 0;
  }

  .analysis-note-hero,
  .analysis-chapter {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #ffffff;
  }

  .analysis-note-hero {
    display: block;
    padding: 0 0 10mm;
    border-bottom: 1px solid #d1d5db;
  }

  .analysis-note-hero p {
    color: #374151;
    font-size: 10pt;
  }

  .analysis-note-hero h1 {
    color: #111827;
    font-size: 24pt;
  }

  .analysis-note-hero span {
    color: #4b5563;
    font-size: 10pt;
  }

  .analysis-chapter {
    break-before: page;
    page-break-before: always;
    padding: 0;
  }

  .analysis-chapter:first-child {
    break-before: auto;
    page-break-before: auto;
  }

  .analysis-chapter-head {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    padding: 0 0 6mm;
    border-bottom: 1px solid #d1d5db;
  }

  .analysis-chapter-head > span {
    min-width: 34px;
    min-height: 34px;
    color: #ffffff;
    background: #111827;
    font-size: 14pt;
  }

  .analysis-chapter-head h2 {
    color: #111827;
    font-size: 18pt;
  }

  .analysis-subsection-stack {
    gap: 8mm;
    margin-top: 7mm;
  }

  .analysis-subsection {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .analysis-subsection + .analysis-subsection {
    padding-top: 6mm;
    border-top: 1px solid #e5e7eb;
  }

  .analysis-subsection-head {
    cursor: default;
  }

  .analysis-subsection-head > div {
    padding-left: 0;
  }

  .analysis-subsection-head > div::before {
    display: none;
  }

  .analysis-subsection-head span,
  .analysis-subsection-head h3 {
    color: #111827;
    font-size: 14pt;
  }

  .analysis-markdown {
    color: #111827;
    font-size: 10.5pt;
    line-height: 1.55;
  }

  .analysis-markdown h2 {
    font-size: 13pt;
  }

  .analysis-markdown h3,
  .analysis-markdown h4 {
    font-size: 11.5pt;
  }

  .analysis-markdown blockquote {
    color: #111827;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-left: 3px solid #6b7280;
    font-size: 10.5pt;
  }

  .analysis-markdown a {
    color: #111827;
    text-decoration: none;
  }

  .analysis-table-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible;
    border: 0;
  }

  .analysis-table-wrap table,
  .analysis-markdown table {
    width: 100%;
    min-width: 0;
    font-size: 8.5pt;
  }

  .analysis-table-wrap th,
  .analysis-table-wrap td,
  .analysis-markdown th,
  .analysis-markdown td {
    padding: 5px 6px;
    border-color: #d1d5db;
  }

  .analysis-markdown img {
    max-height: 170mm;
    border: 1px solid #d1d5db;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .analysis-finance-chart,
  .analysis-finance-chart-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .analysis-finance-chart-card {
    border-color: #d1d5db;
  }

  .analysis-finance-chart-canvas {
    height: 105mm;
  }
}

/* ---- Admin login modal ---- */
.login-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(21, 32, 52, 0.45);
}

.login-modal.hidden {
  display: none;
}

.login-card {
  width: min(340px, calc(100vw - 48px));
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 22px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-card h2 {
  margin: 0;
  font-size: 17px;
  color: var(--text);
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}

.login-field input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 14px;
  background: var(--panel-soft);
  color: var(--text);
}

.login-field input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
}

.login-error {
  margin: 0;
  font-size: 12px;
  color: var(--danger);
}

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