:root {
  color-scheme: light;
  --bg: #faf8f3;
  --surface: #ffffff;
  --surface-strong: #f0f3f2;
  --text: #17202a;
  --muted: #607080;
  --line: #d9e1ea;
  --primary: #1d6f8f;
  --primary-dark: #14546c;
  --accent: #b75d2a;
  --good: #198754;
  --warn: #b7791f;
  --radius: 8px;
  --shadow: 0 8px 18px rgba(29, 45, 60, 0.06);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(29, 111, 143, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(29, 111, 143, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
}

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

a:hover {
  text-decoration: underline;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 48px);
  background: rgba(250, 248, 243, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  color: var(--text);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav a {
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 0.95rem;
}

.site-nav a[aria-current="page"],
.site-nav a:hover {
  background: var(--surface-strong);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 1.2rem;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 28px;
  align-items: center;
  min-height: auto;
  padding: 30px 0 22px;
}

.hero-strip {
  display: block;
  margin-top: 8px;
  padding: 24px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-strip .hero-copy {
  max-width: none;
}

.hero-strip .hero-copy h1 {
  max-width: 1100px;
  margin-bottom: 10px;
  font-size: clamp(1.55rem, 2.4vw, 2.45rem);
}

.hero-strip .hero-copy p {
  max-width: 980px;
  margin-bottom: 0;
}

.hero-copy h1,
.page-title h1 {
  margin: 8px 0 18px;
  font-size: clamp(1.65rem, 3vw, 2.55rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.hero-copy h1 span {
  display: block;
  margin-bottom: 6px;
  color: var(--primary-dark);
  font-size: 0.72em;
}

.hero-copy p,
.page-title p {
  max-width: 720px;
  color: var(--muted);
}

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

.hero-actions,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
}

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

.button.disabled {
  color: var(--muted);
  background: var(--surface-strong);
}

.hero-panel,
.analysis-card,
.info-panel,
.notice,
.work-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-panel {
  border-style: dashed;
  padding: 22px;
}

.panel-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 1.1rem;
}

.panel-heading span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.metric-grid div {
  padding: 16px;
  background: var(--surface-strong);
  border-radius: var(--radius);
}

.metric-value {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
}

.metric-label,
.muted,
.platform {
  color: var(--muted);
}

.platform {
  margin: 0 0 4px;
  font-size: 0.85rem;
  font-weight: 700;
}

.mini-chart,
.sparkline {
  display: flex;
  align-items: end;
  gap: 10px;
  height: 190px;
  margin-top: 14px;
  padding: 18px;
  background: linear-gradient(180deg, #fff, #f0f3f2);
  border-radius: var(--radius);
}

.compact-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.compact-stats span {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.mini-chart span,
.sparkline span {
  flex: 1;
  min-width: 16px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--primary), #6ea6b8);
}

.section,
.page {
  padding: 36px 0;
}

.home-dashboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding-top: 24px;
  padding-bottom: 12px;
}

.page {
  min-height: 70vh;
}

.page-title {
  padding: 42px 0 22px;
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading h2,
.analysis-card h2,
.info-panel h2,
.text-page h2 {
  margin: 4px 0 12px;
  font-size: 1.35rem;
  line-height: 1.3;
}

.notice {
  padding: 16px 18px;
  border-left: 4px solid var(--accent);
}

.notice p {
  margin: 4px 0 0;
}

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

.work-card {
  overflow: hidden;
}

.work-card.wide {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}

.cover {
  display: flex;
  align-items: end;
  min-height: 220px;
  padding: 18px;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.cover:hover {
  text-decoration: none;
}

.cover.large {
  min-height: 360px;
  border-radius: var(--radius);
}

.cover-blue {
  background: linear-gradient(135deg, #1d6f8f, #263f76);
}

.cover-green {
  background: linear-gradient(135deg, #2a7f62, #295267);
}

.cover-amber {
  background: linear-gradient(135deg, #b75d2a, #7d4d6b);
}

.work-body {
  padding: 18px;
}

.work-body h2,
.work-body h3 {
  margin: 0 0 8px;
  line-height: 1.35;
}

.tag-list,
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list span,
.tag-cloud span,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
}

.info-panel,
.analysis-card {
  padding: 20px;
}

.ranking-panel {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.ranking-link-panel {
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.ranking-link-panel:hover {
  border-color: var(--primary);
  text-decoration: none;
  transform: translateY(-1px);
}

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

.rank-list li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: var(--surface-strong);
  border-radius: var(--radius);
}

.rank-list li::before {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--primary-dark);
  font-weight: 800;
  content: counter(list-item);
}

.rank-list a,
.rank-list strong {
  font-weight: 800;
}

.rank-list span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
}

.plain-list {
  padding-left: 1.2em;
}

.bar-list {
  display: grid;
  gap: 14px;
}

.bar-list div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

meter {
  width: 100%;
  height: 14px;
}

meter::-webkit-meter-bar {
  background: var(--surface-strong);
  border: 0;
  border-radius: 999px;
}

meter::-webkit-meter-optimum-value {
  background: var(--primary);
  border-radius: 999px;
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 0.86rem;
}

.positive {
  color: var(--good);
  font-weight: 800;
}

.status.sale {
  background: #fff0df;
  color: var(--warn);
}

.status.steady {
  background: #eaf7f0;
  color: var(--good);
}

.status.watch {
  background: #e9f2f8;
  color: var(--primary-dark);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.donut {
  display: grid;
  place-items: center;
  width: 150px;
  aspect-ratio: 1;
  margin: 10px auto 14px;
  border-radius: 50%;
  background: conic-gradient(var(--primary) 0 82%, var(--surface-strong) 82% 100%);
  color: var(--text);
  font-size: 2rem;
  font-weight: 800;
}

.tag-cloud span:nth-child(2n) {
  background: #eaf7f0;
}

.tag-cloud span:nth-child(3n) {
  background: #fff0df;
}

.text-page {
  max-width: 820px;
}

.work-detail {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 34px 0;
}

.work-detail h1 {
  margin: 6px 0 14px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.14;
}

.big-number {
  margin: 8px 0;
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.1;
}

.text-link {
  font-weight: 800;
}

.note-list {
  display: grid;
  gap: 14px;
}

.note-item,
.note-article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.note-item h2 {
  margin: 0 0 6px;
  font-size: 1.15rem;
}

.note-item p,
.note-article p {
  margin-top: 0;
}

.note-date {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.note-article h1 {
  margin: 8px 0 18px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.2;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 28px clamp(18px, 4vw, 48px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

@media (max-width: 920px) {
  .hero,
  .split,
  .work-detail {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .card-grid,
  .dashboard-grid,
  .home-dashboard {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  main {
    width: min(100% - 24px, 1180px);
  }

  .site-header {
    align-items: flex-start;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-nav {
    position: absolute;
    top: 64px;
    left: 12px;
    right: 12px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: flex;
  }

  .card-grid,
  .dashboard-grid,
  .home-dashboard,
  .work-card.wide {
    grid-template-columns: 1fr;
  }

  .work-card.wide {
    grid-column: auto;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .bar-list div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .site-footer {
    flex-direction: column;
  }
}
