:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-2: #eef4f5;
  --text: #182124;
  --muted: #627174;
  --border: #d8e1e2;
  --accent: #0f7c80;
  --accent-2: #2f9d72;
  --warning: #b7791f;
  --risk: #b54545;
  --blue: #2d6cdf;
  --shadow: 0 18px 50px rgba(28, 43, 47, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(15, 124, 128, 0.05), transparent 280px),
    var(--bg);
  color: var(--text);
}

button,
a {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.82);
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.brand span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #13383b;
  color: white;
  font-weight: 800;
}

.brand strong {
  font-size: 14px;
  line-height: 1.25;
}

nav {
  display: grid;
  gap: 6px;
}

nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

nav a.active,
nav a:hover {
  background: #e6f3f3;
  color: #0d5d61;
}

svg {
  display: block;
}

nav svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

main {
  padding: 28px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}

.term-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 7px 10px;
  border: 1px solid rgba(15, 124, 128, 0.28);
  border-radius: 8px;
  background: #eaf7f7;
  color: #0d5d61;
}

.term-badge span {
  font-size: 11px;
  font-weight: 900;
}

.term-badge strong {
  font-size: 14px;
  line-height: 1;
}

.topbar p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

button.danger {
  border-color: rgba(181, 69, 69, 0.32);
  background: #fff1f1;
  color: var(--risk);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.ai-status {
  margin: -8px 0 18px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdfd;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ai-status.connected {
  border-color: rgba(47, 157, 114, 0.3);
  background: #eaf7ef;
  color: #20724e;
}

.ai-warning {
  margin-top: 6px;
  color: var(--warning);
  line-height: 1.45;
}

.view-switch {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.view-switch button {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.view-switch button.active {
  background: var(--accent);
  color: white;
}

.simple-dashboard {
  display: grid;
  grid-template-columns: 0.9fr 1.8fr;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.simple-main,
.annual-report-preview {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  padding: 18px;
}

.simple-main {
  background:
    linear-gradient(135deg, rgba(15, 124, 128, 0.11), rgba(255, 255, 255, 0.86)),
    var(--surface);
}

.simple-main h2,
.annual-report-preview h3 {
  margin-top: 5px;
  font-size: 20px;
  line-height: 1.28;
}

.simple-main p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

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

.annual-signal-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.annual-report-preview {
  grid-column: 1 / -1;
}

.annual-report-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  align-items: center;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(15, 124, 128, 0.24);
  border-radius: 8px;
  background: #f3fbfb;
}

.annual-report-card strong {
  grid-row: span 2;
  font-size: 38px;
  line-height: 1;
  color: var(--accent);
}

.annual-report-card p {
  color: #334144;
  font-size: 13px;
  line-height: 1.6;
}

.annual-report-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.annual-signal-list div {
  min-height: 68px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdfd;
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 10px;
}

.annual-signal-list strong {
  display: block;
  font-size: 24px;
  line-height: 1;
  color: var(--accent);
}

.annual-signal-list span,
.annual-signal-list small {
  display: block;
  margin-top: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.annual-signal-list small {
  grid-column: 2;
}

.annual-report-full {
  display: grid;
  gap: 16px;
}

.annual-section {
  display: grid;
  gap: 10px;
}

.annual-section h3 {
  font-size: 16px;
  line-height: 1.35;
}

.annual-section p {
  color: #334144;
  font-size: 12px;
  line-height: 1.65;
}

.annual-chart {
  min-height: 300px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdfd;
}

.annual-metric-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.annual-metric-selector button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.annual-metric-selector button.active {
  border-color: var(--accent);
  background: #eef8f8;
  color: var(--accent);
}

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

.annual-ranking {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdfd;
}

.annual-ranking h4 {
  font-size: 13px;
}

.annual-ranking div {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: 8px;
  background: #eef8f8;
}

.annual-ranking.warn div {
  background: #fff7e8;
}

.annual-ranking span,
.annual-ranking b,
.annual-ranking small {
  font-size: 12px;
  font-weight: 900;
}

.annual-ranking strong {
  font-size: 12px;
}

.annual-ranking small {
  grid-column: 2 / -1;
  color: var(--muted);
  font-weight: 800;
}

.annual-ranking p {
  color: var(--muted);
  font-size: 12px;
}

.annual-voice-list {
  display: grid;
  gap: 8px;
}

.annual-voice-list.compact {
  margin-top: 4px;
}

.annual-voice-item {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdfd;
}

.annual-voice-item strong {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  font-size: 12px;
}

.annual-voice-item span {
  color: var(--muted);
}

.annual-voice-item p {
  margin-top: 6px;
  color: #334144;
  font-size: 12px;
  line-height: 1.55;
}

.overview-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.2fr 1fr;
  gap: 16px;
  align-items: stretch;
}

.metric-strip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.overview-grid::before {
  content: "詳細ダッシュボード";
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.metric-tile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 78px;
  padding: 14px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 26px rgba(21, 37, 40, 0.05);
}

.metric-tile.good {
  border-left-color: var(--accent);
  background: #f7fbfb;
}

.metric-tile.warn {
  border-left-color: var(--warning);
  background: #fffaf0;
}

.metric-tile.risk {
  border-left-color: var(--risk);
  background: #fff6f6;
}

.metric-tile span,
.section-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric-tile strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
  line-height: 1;
}

.metric-tile strong b {
  margin-left: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.metric-tile small {
  padding: 5px 7px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
  background: #eaf7ef;
  color: var(--accent-2);
}

.metric-tile.warn small {
  background: #fff6df;
  color: var(--warning);
}

.metric-tile.risk small {
  background: #fdecec;
  color: var(--risk);
}

.seasonal-events-panel {
  display: grid;
  gap: 14px;
}

.seasonal-event-list {
  display: grid;
  gap: 10px;
}

.seasonal-event-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdfd;
}

.seasonal-event-card div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.seasonal-event-card strong {
  color: var(--text);
  font-size: 14px;
}

.seasonal-event-card span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef8f8;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.seasonal-event-card p,
.empty-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.seasonal-event-card small {
  color: #667579;
  font-size: 11px;
  font-weight: 800;
}

.panel,
.policy-preview,
.guardrail {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-header h2 {
  margin-top: 3px;
  font-size: 18px;
  line-height: 1.25;
}

.panel-header small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.radar {
  width: min(100%, 300px);
  margin: 0 auto;
}

.radar-grid {
  fill: #f2f8f8;
  stroke: #c6d8da;
  stroke-width: 1;
}

.radar-grid.inner {
  fill: none;
}

.radar-axis line {
  stroke: #d5e1e2;
}

.radar-axis text {
  fill: var(--muted);
  font-size: 8px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: middle;
}

.radar-area {
  fill: rgba(15, 124, 128, 0.28);
  stroke: var(--accent);
  stroke-width: 2;
}

.radar circle {
  fill: #ffffff;
  stroke: var(--accent);
  stroke-width: 2;
}

.line-chart {
  width: 100%;
  height: auto;
}

.chart-grid line {
  stroke: #e2eaeb;
}

.line {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line.support {
  stroke: var(--accent);
}

.line.happiness {
  stroke: var(--accent-2);
}

.line.fairness {
  stroke: var(--risk);
}

.chart-labels text {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-anchor: middle;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.legend span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 2px;
  background: var(--accent);
}

.legend .happiness::before {
  background: var(--accent-2);
}

.legend .fairness::before {
  background: var(--risk);
}

.sentiment-row {
  display: grid;
  grid-template-columns: 112px 1fr;
  align-items: center;
  gap: 12px;
  margin: 13px 0;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.hidden-score-panel {
  grid-column: 1 / -1;
  background:
    linear-gradient(135deg, rgba(19, 56, 59, 0.05), rgba(255, 255, 255, 0.92)),
    var(--surface);
}

.hidden-score-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.hidden-score-row {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 10px;
  min-height: 124px;
  padding: 10px;
  border: 1px dashed #b7c8ca;
  border-radius: 8px;
  background: rgba(247, 251, 251, 0.82);
}

.hidden-score-row.revealed {
  border-style: solid;
  background: rgba(253, 255, 255, 0.94);
}

.hidden-score-row span {
  font-size: 12px;
  font-weight: 900;
}

.hidden-score-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

.masked-score {
  display: grid;
  place-items: center;
  min-height: 30px;
  border-radius: 8px;
  background: #e7eeee;
  color: #647579;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 2px;
}

.revealed-score {
  display: grid;
  place-items: center;
  min-height: 38px;
  border-radius: 8px;
  background: #eef8f5;
  color: var(--accent);
  font-size: 24px;
  font-weight: 900;
}

.revealed-score.warn {
  background: #fff7e6;
  color: var(--warning);
}

.revealed-score.risk {
  background: #fdeeee;
  color: var(--risk);
}

.stacked-bar {
  display: flex;
  height: 14px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-2);
}

.stacked-bar i {
  display: block;
  height: 100%;
}

.positive {
  background: var(--accent-2);
}

.neutral {
  background: #a9b8bb;
}

.negative {
  background: var(--risk);
}

.workbench {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr 0.9fr;
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.single-view {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.two-column-view {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}

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

.voice-analysis {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

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

.analysis-summary div {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdfd;
}

.analysis-summary strong {
  font-size: 20px;
  line-height: 1;
}

.analysis-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.framework-chart {
  width: 100%;
  height: clamp(360px, 48vh, 560px);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f7fbfb;
}

.chart-stage {
  display: grid;
  gap: 10px;
}

.chart-tabs {
  display: inline-flex;
  width: fit-content;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdfd;
}

.chart-tabs button {
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.chart-tabs button.active {
  background: var(--accent);
  color: white;
}

.chart-fallback {
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 24px;
  color: var(--muted);
  font-weight: 900;
}

.cluster-map {
  width: 100%;
}

.cluster-map line {
  stroke: rgba(98, 113, 116, var(--opacity));
  stroke-width: 2;
}

.cluster-node circle {
  fill: #dfe9ea;
  stroke: white;
  stroke-width: 4;
}

.cluster-node.good circle {
  fill: #cfeedd;
}

.cluster-node.risk circle {
  fill: #f4d5d5;
}

.cluster-node text {
  text-anchor: middle;
  fill: #182124;
  font-size: 11px;
  font-weight: 900;
}

.cluster-node .count {
  fill: var(--muted);
  font-size: 10px;
}

.distance-list {
  display: grid;
  gap: 6px;
}

.distance-list span {
  padding: 7px 9px;
  border-radius: 8px;
  background: #eef4f5;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
}

.voice-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdfd;
}

.avatar-slot {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.avatar-slot.sky {
  background: #e8f1ff;
  color: #2459a8;
}

.avatar-slot.green {
  background: #e8f6ef;
  color: #20724e;
}

.avatar-slot.rose {
  background: #fdeced;
  color: #a83f49;
}

.voice-card header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 7px;
}

.voice-card strong {
  font-size: 14px;
}

.voice-card span,
.voice-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.voice-card em {
  color: var(--accent);
}

.voice-card p {
  color: #334144;
  font-size: 13px;
  line-height: 1.6;
}

.voice-card small {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.voice-hierarchy {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdfd;
}

.voice-hierarchy.compact-tree {
  margin-top: 0;
  max-height: 220px;
  overflow: auto;
}

.panel-header.compact {
  margin-bottom: 8px;
}

.panel-header.compact h3 {
  margin-top: 2px;
  font-size: 16px;
}

.voice-hierarchy ul {
  list-style: none;
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.voice-hierarchy li {
  display: grid;
  gap: 6px;
}

.voice-hierarchy li > div {
  display: grid;
  gap: 3px;
  padding: 8px 8px 8px calc(8px + var(--depth) * 12px);
  border-left: 3px solid rgba(15, 124, 128, 0.24);
  background: #f7fbfb;
  border-radius: 6px;
}

.voice-hierarchy strong {
  font-size: 12px;
}

.voice-hierarchy span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
}

.issue-map {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f7fbfb;
  padding: 8px;
}

.issue-map svg {
  width: 100%;
}

.issue-map path {
  fill: none;
  stroke: #b5c8cb;
  stroke-width: 2;
}

.issue-map .node {
  stroke: white;
  stroke-width: 4;
}

.issue-map .voice {
  fill: #b8d8f6;
}

.issue-map .issue-main {
  fill: #0f7c80;
}

.issue-map .issue-sub {
  fill: #89c8ac;
}

.issue-map .policy {
  fill: #173d40;
}

.issue-map text {
  fill: white;
  font-size: 13px;
  font-weight: 900;
  text-anchor: middle;
  dominant-baseline: middle;
}

.issue-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.issue-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 12px;
  min-height: 60px;
  text-align: left;
}

.issue-row span {
  font-size: 13px;
  font-weight: 900;
}

.issue-row strong {
  color: var(--accent);
}

.issue-row small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.issue-row.selected {
  border-color: rgba(15, 124, 128, 0.38);
  background: #ecf7f7;
}

.decision-column {
  display: grid;
  gap: 16px;
}

.policy-preview {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.issue-chat-panel {
  padding: 18px;
}

.chat-thread {
  display: grid;
  gap: 10px;
}

.chat-message {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdfd;
}

.chat-message.user {
  background: #eef8f8;
  border-color: rgba(15, 124, 128, 0.24);
}

.chat-message span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.chat-message p {
  color: #334144;
  font-size: 12px;
  line-height: 1.55;
}

.chat-input-preview {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  padding: 9px;
  border: 1px dashed #b7c8ca;
  border-radius: 8px;
  background: #f7fbfb;
}

.chat-input-preview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.chat-input-preview input {
  min-width: 0;
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  outline: none;
}

.chat-input-preview button {
  min-height: 32px;
  padding: 0 10px;
}

.policy-preview h3,
.guardrail h3 {
  margin-top: 5px;
  font-size: 18px;
  line-height: 1.35;
}

.policy-preview p,
.guardrail p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.budget-ring {
  width: 116px;
  height: 116px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  justify-self: center;
  background:
    radial-gradient(circle at center, white 56%, transparent 57%),
    conic-gradient(var(--accent) var(--value), #dce8e9 0);
}

.budget-ring strong {
  font-size: 30px;
}

.budget-ring span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.impact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.finance-note {
  justify-self: center;
  padding: 7px 10px;
  border-radius: 8px;
  background: #eef4f5;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.policy-detail-grid,
.policy-group-grid {
  display: grid;
  gap: 10px;
}

.policy-detail-section,
.policy-group-section {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdfd;
}

.policy-detail-section h4,
.policy-group-section h4 {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.policy-detail-section ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.policy-detail-section li,
.policy-group-section p {
  color: #445457;
  font-size: 12px;
  line-height: 1.55;
}

.policy-group-section {
  display: grid;
  gap: 8px;
}

.policy-group-section div {
  padding: 9px;
  border-radius: 8px;
  background: #eef8f8;
}

.policy-group-section.warn div {
  background: #fff7e8;
}

.policy-group-section strong {
  display: block;
  margin-bottom: 3px;
  color: var(--accent);
  font-size: 12px;
}

.turn-complete-note,
.turn-end-label {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid rgba(15, 124, 128, 0.2);
  border-radius: 8px;
  background: #eef8f8;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.impact-list span {
  padding: 7px 9px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
  background: #eaf7ef;
  color: #20724e;
}

.impact-list .warn {
  background: #fff6df;
  color: var(--warning);
}

.turn-result-preview {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(15, 124, 128, 0.24);
  border-radius: 8px;
  background: #f3fbfb;
}

.turn-result-preview.empty {
  border-style: dashed;
  background: #fbfdfd;
}

.turn-result-preview span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.turn-result-preview p {
  margin: 0;
  color: #334144;
  font-size: 12px;
  line-height: 1.6;
}

.turn-result-preview small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.5;
}

.result-delta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.result-delta-list b {
  padding: 5px 7px;
  border-radius: 8px;
  background: white;
  color: #20724e;
  font-size: 11px;
}

.result-view {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(520px, 1.4fr);
  gap: 16px;
  align-items: start;
}

.policy-history-list {
  display: grid;
  gap: 12px;
}

.policy-history-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdfd;
}

.policy-history-card header span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.policy-history-card h3 {
  margin-top: 3px;
  font-size: 15px;
  line-height: 1.35;
}

.policy-history-card p {
  color: #334144;
  font-size: 12px;
  line-height: 1.6;
}

.policy-history-result {
  padding: 10px;
  border-radius: 8px;
  background: #eef8f8;
}

.policy-history-result strong {
  color: var(--accent);
  font-size: 12px;
}

.guardrail {
  padding: 18px;
  border-left: 4px solid var(--warning);
}

.guardrail span {
  color: var(--warning);
  font-size: 12px;
  font-weight: 900;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(19, 33, 36, 0.28);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(520px, 100%);
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(19, 33, 36, 0.24);
}

.save-modal {
  width: min(680px, 100%);
}

.modal p {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.modal label {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.modal label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.modal input,
.modal select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 11px;
  font: inherit;
  font-size: 13px;
  background: white;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

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

.memory-summary-grid div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdfd;
}

.memory-summary-grid strong {
  font-size: 24px;
  line-height: 1;
}

.memory-summary-grid span,
.save-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.save-status {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #eef4f5;
}

.save-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .brand strong,
  nav span {
    display: none;
  }

  .sidebar {
    padding: 18px 12px;
  }

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

  .simple-dashboard {
    grid-template-columns: 1fr;
  }

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

  .overview-grid,
  .workbench,
  .two-column-view {
    grid-template-columns: 1fr;
  }

  .memory-summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  nav {
    grid-template-columns: repeat(3, 1fr);
  }

  nav span,
  .brand strong {
    display: inline;
  }

  main {
    padding: 18px;
  }

  .topbar,
  .top-actions {
    display: grid;
  }

  .view-switch {
    width: 100%;
  }

  .view-switch button {
    width: 100%;
  }

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

  .simple-metrics,
  .annual-signal-list {
    grid-template-columns: 1fr;
  }

  .hidden-score-row {
    grid-template-columns: 1fr;
  }

  .chat-input-preview {
    grid-template-columns: 1fr;
  }

  .sentiment-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
