﻿:root {
  --page-bg: #f7f5f1;
  --panel-bg: rgba(255, 255, 255, 0.92);
  --panel-strong: #ffffff;
  --text-primary: #181d26;
  --text-secondary: #615d59;
  --text-muted: #8b857f;
  --line: rgba(24, 29, 38, 0.1);
  --line-strong: rgba(24, 29, 38, 0.18);
  --brand: #1b61c9;
  --brand-deep: #154fa7;
  --brand-soft: #edf5ff;
  --accent-warm: #f4efe7;
  --success: #146c43;
  --success-soft: #edf8f1;
  --danger: #c34a36;
  --danger-soft: #fff0ec;
  --shadow-soft: 0 20px 50px rgba(12, 21, 36, 0.06);
  --shadow-card:
    rgba(0, 0, 0, 0.03) 0px 10px 30px,
    rgba(45, 127, 249, 0.08) 0px 1px 3px,
    rgba(0, 0, 0, 0.04) 0px 0px 0px 1px inset;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--text-primary);
  background:
    radial-gradient(circle at top left, rgba(27, 97, 201, 0.08), transparent 32%),
    linear-gradient(180deg, #faf8f4 0%, #f3f1ec 100%);
}

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

button,
textarea,
input {
  font: inherit;
}

.shell {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.panel {
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
  gap: 24px;
  padding: 28px;
  margin-bottom: 24px;
}

.eyebrow,
.section-kicker,
.hero-stat-label,
.hero-note-label {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.hero-text {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.7;
}

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

.primary-btn,
.secondary-btn,
.inline-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.primary-btn:hover,
.secondary-btn:hover,
.inline-btn:hover {
  transform: translateY(-1px);
}

.primary-btn {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 12px 28px rgba(27, 97, 201, 0.22);
}

.secondary-btn,
.inline-btn {
  background: #fff;
  color: var(--text-primary);
  border-color: var(--line);
}

.primary-btn.small,
.secondary-btn.small,
.inline-btn.small {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
}

.inline-btn {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
}

.inline-btn.is-primary {
  background: var(--brand);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(27, 97, 201, 0.18);
}

.inline-btn.is-ghost {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: transparent;
}

.hero-side {
  display: grid;
  gap: 14px;
}

.hero-stat,
.hero-note {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}

.hero-stat strong {
  display: block;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.hero-note span:last-child {
  color: var(--text-secondary);
  line-height: 1.6;
}

.content {
  display: grid;
  gap: 24px;
}

.kpi-grid,
.two-column,
.notes-layout,
.chart-grid {
  display: grid;
  gap: 20px;
}

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

.two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chart-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
}

.notes-layout {
  grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.15fr);
}

.kpi-card,
.chart-panel,
.word-panel,
.editor-panel {
  padding: 24px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.badge-neutral {
  background: #f1efeb;
  color: var(--text-secondary);
}

.kpi-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.kpi-label {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
}

.kpi-chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.kpi-value {
  margin-top: 18px;
  font-size: clamp(30px, 3vw, 42px);
  font-weight: 700;
  letter-spacing: -0.06em;
}

.kpi-sub {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
}

.chart-frame {
  padding-top: 18px;
}

.line-chart {
  min-height: 244px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.95) 100%);
  overflow: hidden;
}

.line-chart svg {
  display: block;
  width: 100%;
  height: 244px;
}

.line-chart-axis {
  stroke: rgba(24, 29, 38, 0.08);
  stroke-width: 1;
}

.line-chart-grid {
  stroke: rgba(24, 29, 38, 0.06);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.line-chart-area {
  fill: rgba(27, 97, 201, 0.12);
}

.line-chart-line {
  fill: none;
  stroke: var(--brand);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-chart-dot {
  fill: #fff;
  stroke: var(--brand);
  stroke-width: 2;
}

.line-chart-label {
  fill: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.chart-empty {
  min-height: 244px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.7;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.chart-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.chart-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(27, 97, 201, 0.12);
}

.donut-layout {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.donut-card {
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-chart {
  position: relative;
  width: 188px;
  height: 188px;
  border-radius: 50%;
  background: conic-gradient(var(--brand) 0deg, rgba(24, 29, 38, 0.08) 0deg 360deg);
  box-shadow: inset 0 0 0 1px rgba(24, 29, 38, 0.06);
}

.donut-chart::after {
  content: "";
  position: absolute;
  inset: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: inset 0 0 0 1px rgba(24, 29, 38, 0.06);
}

.donut-center {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  gap: 4px;
}

.donut-center strong {
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.donut-center span {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.donut-legend {
  display: grid;
  gap: 12px;
}

.donut-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.donut-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.donut-item strong {
  font-size: 15px;
}

.donut-item span {
  color: var(--text-muted);
  font-size: 13px;
}

.accuracy-list,
.action-stack,
.review-list,
.recent-notes {
  display: grid;
  gap: 14px;
  padding: 20px 24px 24px;
}

.accuracy-item,
.action-card,
.review-item,
.recent-note-card,
.word-item {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.accuracy-item,
.action-card,
.review-item,
.recent-note-card {
  padding: 16px;
}

.clickable-card {
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.clickable-card:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

.accuracy-head,
.word-item-top,
.word-meta-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.accuracy-copy {
  flex: 1;
}

.accuracy-name {
  font-size: 16px;
  font-weight: 700;
}

.accuracy-value {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.accuracy-bar {
  overflow: hidden;
  height: 10px;
  background: #efece7;
  border-radius: 999px;
  margin-top: 12px;
}

.accuracy-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #71a3ef);
}

.accuracy-actions,
.action-actions,
.review-actions,
.recent-note-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.action-card h3,
.review-item h3,
.recent-note-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.action-card p,
.review-item p,
.recent-note-card p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

.action-card footer,
.review-item footer,
.recent-note-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 13px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.filter-chip {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text-secondary);
  cursor: pointer;
}

.filter-chip.is-active {
  border-color: transparent;
  background: var(--text-primary);
  color: #fff;
}

.word-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.word-item {
  padding: 16px;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.word-item:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.word-item.is-active {
  border-color: rgba(27, 97, 201, 0.4);
  box-shadow: 0 10px 24px rgba(27, 97, 201, 0.1);
}

.word-value {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.word-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f3f1ed;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.tag.is-brand {
  background: var(--brand-soft);
  color: var(--brand);
}

.save-state {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.editor-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 18px 24px 0;
}

.editor-label {
  display: block;
  padding: 18px 24px 10px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 700;
}

.note-input {
  width: calc(100% - 48px);
  margin: 0 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  outline: none;
  resize: vertical;
  background: #fff;
  color: var(--text-primary);
  line-height: 1.7;
}

.note-input:focus {
  border-color: rgba(27, 97, 201, 0.48);
  box-shadow: 0 0 0 4px rgba(27, 97, 201, 0.08);
}

.note-input--single {
  min-height: 56px;
}

.note-input--multi {
  min-height: 220px;
}

.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 24px 24px;
}

.mini-card {
  min-height: 118px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.mini-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--text-secondary);
}

.mini-card p {
  margin: 0;
  line-height: 1.7;
}

@media (max-width: 1080px) {
  .kpi-grid,
  .two-column,
  .chart-grid,
  .notes-layout,
  .hero {
    grid-template-columns: 1fr;
  }

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

  .donut-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 24px, 100%);
    padding: 20px 0 40px;
  }

  .hero,
  .kpi-card,
  .chart-panel,
  .word-panel,
  .editor-panel,
  .accuracy-list,
  .action-stack,
  .review-list,
  .recent-notes {
    padding-left: 18px;
    padding-right: 18px;
  }

  .hero-side,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .chart-frame {
    padding-top: 16px;
  }

  .line-chart,
  .line-chart svg {
    min-height: 220px;
    height: 220px;
  }

  .note-input {
    width: calc(100% - 36px);
    margin: 0 18px;
  }

  .editor-meta,
  .editor-label,
  .editor-footer,
  .insight-grid {
    padding-left: 18px;
    padding-right: 18px;
  }

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

  .editor-footer,
  .accuracy-head,
  .action-card footer,
  .review-item footer,
  .recent-note-card footer,
  .word-item-top,
  .word-meta-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero h1 {
    font-size: 42px;
  }

  .donut-chart {
    width: 164px;
    height: 164px;
  }

  .donut-chart::after {
    inset: 22px;
  }
}
