:root {
  --bg: #f5f0e7;
  --bg-strong: #e8dcc5;
  --surface: #ffffff;
  --surface-muted: #f7f3ec;
  --surface-strong: #eef3f8;
  --line: #d4d8de;
  --line-strong: #b7bec8;
  --text: #18222f;
  --text-muted: #56606d;
  --text-soft: #6a7480;
  --accent: #1255b4;
  --accent-soft: #d9e8ff;
  --accent-ink: #163a6b;
  --buy: #1d6a37;
  --buy-soft: #e4f6e9;
  --hold: #8a5a10;
  --hold-soft: #f9edd6;
  --sell: #a42633;
  --sell-soft: #fde8eb;
  --review: #8d4600;
  --review-soft: #ffe9d3;
  --blocked: #5a2133;
  --blocked-soft: #f3e1e8;
  --warning: #8a4f00;
  --warning-soft: #fff0da;
  --shadow: 0 18px 42px rgba(24, 34, 47, 0.10);
  --radius-xl: 24px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --nav-offset: 58px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(18, 85, 180, 0.10), transparent 32%),
    radial-gradient(circle at top left, rgba(29, 106, 55, 0.08), transparent 26%),
    var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input,
select,
.button-link,
.toolbar-button {
  min-height: 44px;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
}

select {
  appearance: none;
}

code {
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
  font-size: 0.92em;
  background: #f0f4f8;
  color: var(--text);
  padding: 0.18em 0.44em;
  border-radius: 8px;
}

[hidden] {
  display: none !important;
}

.site-shell {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 16px 12px 48px;
}

.hero-panel,
.section-panel,
.summary-card,
.watch-card,
.ticker-card,
.chart-card,
.card-block,
.sticky-mini-header,
.filter-bar,
.section-nav,
.section-toolbar {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(24, 34, 47, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero-panel,
.section-panel,
.watch-card,
.ticker-card,
.chart-card,
.card-block,
.filter-bar {
  padding: 16px;
}

.section-panel {
  margin-top: 24px;
}

.hero-stack,
.content-stack,
.detail-list,
.card-copy-group {
  display: grid;
  gap: 16px;
}

.hero-copy,
.section-heading {
  display: grid;
  gap: 8px;
}

.compact-heading {
  gap: 12px;
}

.eyebrow,
.section-kicker,
.summary-label,
.metric-label,
.chart-eyebrow,
.ticker-code {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-title {
  margin: 0;
  font-size: clamp(2rem, 6vw, 2.8rem);
  line-height: 1.08;
}

.hero-subtitle,
.section-note,
.card-meta,
.chart-note,
.ticker-company,
.filter-meta {
  color: var(--text-muted);
}

.hero-subtitle,
.section-note,
.card-copy,
.detail-copy {
  margin: 0;
}

.summary-grid,
.priority-grid,
.ticker-grid,
.metric-grid,
.hero-metrics,
.info-grid {
  display: grid;
  gap: 14px;
}

.summary-grid,
.hero-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.summary-card {
  padding: 14px;
}

.summary-value,
.metric-value {
  margin-top: 8px;
  font-size: clamp(1.38rem, 5vw, 1.8rem);
  font-weight: 800;
  line-height: 1.08;
}

.priority-grid,
.ticker-grid,
.info-grid {
  grid-template-columns: 1fr;
}

.pill-row,
.link-row,
.cta-row,
.chip-row,
.toolbar-actions,
.mini-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.pill,
.status-pill,
.signal-pill,
.kpi-chip,
.disabled-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
}

.pill,
.disabled-pill {
  background: var(--surface-muted);
  color: var(--text);
  border: 1px solid var(--line);
}

.signal-pill.buy {
  background: var(--buy-soft);
  color: var(--buy);
}

.signal-pill.hold {
  background: var(--hold-soft);
  color: var(--hold);
}

.signal-pill.sell {
  background: var(--sell-soft);
  color: var(--sell);
}

.signal-pill.review {
  background: var(--review-soft);
  color: var(--review);
}

.signal-pill.blocked {
  background: var(--blocked-soft);
  color: var(--blocked);
}

.status-pill.publishable {
  background: var(--buy-soft);
  color: var(--buy);
}

.status-pill.publish_with_warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-pill.manual_review_required {
  background: var(--review-soft);
  color: var(--review);
}

.status-pill.blocked {
  background: var(--blocked-soft);
  color: var(--blocked);
}

.button-link,
.toolbar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}

.button-link:hover,
.toolbar-button:hover {
  text-decoration: none;
}

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

.watch-card,
.ticker-card {
  display: grid;
  gap: 14px;
}

.watch-top,
.ticker-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.watch-title,
.ticker-title,
.section-title {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.3;
}

.metric-inline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  font-size: 0.98rem;
}

.metric-grid,
.hero-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-card,
.compact-block {
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: 1px solid rgba(24, 34, 47, 0.06);
}

.accent-block {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.accent-block .metric-label {
  color: var(--accent-ink);
}

.caution-block {
  background: #fdf1e5;
}

.bullet-list,
.detail-list {
  margin: 0;
  padding-left: 1.2rem;
}

.detail-list {
  padding-left: 0;
}

.reason-item {
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: 1px solid rgba(24, 34, 47, 0.06);
}

.card-block {
  box-shadow: none;
}

.page-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.filter-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  margin-top: 24px;
  backdrop-filter: blur(12px);
}

.filter-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 700;
}

.empty-state,
.chart-placeholder {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fbf7f0 0%, #f4eee4 100%);
  color: var(--text-muted);
}

.collapsible {
  border: 1px solid rgba(24, 34, 47, 0.08);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 0 14px;
}

.collapsible summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 0;
  font-weight: 700;
}

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

.collapsible[open] {
  padding-bottom: 14px;
}

.sticky-mini-header {
  position: sticky;
  top: 0;
  z-index: 35;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  margin-top: 16px;
  font-size: 0.94rem;
}

.mini-divider {
  color: var(--text-soft);
  margin: 0 6px;
}

.section-nav {
  position: sticky;
  top: var(--nav-offset);
  z-index: 34;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px;
  margin-top: 12px;
  white-space: nowrap;
}

.section-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--text);
  background: var(--surface-muted);
  border: 1px solid transparent;
  font-weight: 700;
}

.section-nav a.is-active,
.section-nav a[aria-current="page"] {
  background: var(--accent-soft);
  border-color: rgba(18, 85, 180, 0.18);
  color: var(--accent-ink);
}

.section-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 12px;
  margin-top: 12px;
  box-shadow: none;
}

.chart-stack {
  display: grid;
  gap: 16px;
}

.chart-card {
  display: grid;
  gap: 12px;
}

.chart-link {
  display: block;
}

.chart-card img {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid rgba(24, 34, 47, 0.08);
  background: #ffffff;
}

.chart-head {
  display: grid;
  gap: 6px;
}

.detail-shell .section-panel {
  scroll-margin-top: 128px;
}

.kpi-chip {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.footer-note {
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (min-width: 700px) {
  .site-shell {
    padding: 22px 20px 56px;
  }

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

  .priority-grid,
  .ticker-grid,
  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .watch-top,
  .ticker-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }

  .filter-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .site-shell {
    padding: 14px 12px 40px;
  }

  .hero-panel,
  .section-panel,
  .watch-card,
  .ticker-card,
  .chart-card,
  .filter-bar,
  .sticky-mini-header,
  .section-nav,
  .section-toolbar {
    border-radius: 18px;
  }

  .hero-title {
    font-size: 2rem;
  }

  .summary-value,
  .metric-value {
    font-size: 1.42rem;
  }

  .section-toolbar {
    justify-content: stretch;
  }

  .toolbar-button {
    flex: 1 1 0;
  }

  .section-nav {
    top: 54px;
  }
}
