:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #667085;
  --line: #d7dde8;
  --soft: #f4f7fb;
  --navy: #0f2f5f;
  --teal: #087f8c;
  --amber: #c77700;
  --danger: #b42318;
  --ok: #087443;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  color: var(--ink);
  background: #eef2f7;
}

.topbar {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 24px;
}

h2 {
  margin-bottom: 10px;
  font-size: 24px;
}

h3 {
  margin-bottom: 0;
  font-size: 15px;
}

.tabs {
  display: flex;
  gap: 8px;
}

.tab, .primary {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  padding: 10px 14px;
  cursor: pointer;
}

.tab.is-active, .primary {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

main {
  padding: 18px;
}

.demo-panel {
  display: none;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 18px;
}

.demo-panel.is-active {
  display: grid;
}

.side, .module {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.side {
  padding: 20px;
}

.lead {
  color: var(--muted);
  line-height: 1.7;
}

.question {
  border-left: 4px solid var(--teal);
  background: #eefafa;
  padding: 12px;
  margin: 18px 0;
  line-height: 1.55;
}

.question span {
  display: block;
  font-weight: 800;
  margin-bottom: 4px;
}

.control-group {
  display: grid;
  gap: 6px;
  margin: 18px 0 12px;
}

label {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fff;
  color: var(--ink);
}

.workspace {
  display: grid;
  gap: 14px;
}

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

.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.kpi span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.kpi strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.grid.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.module {
  min-height: 240px;
  padding: 16px;
}

.module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.status {
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
}

.status.ok {
  background: #eaf7ef;
  color: var(--ok);
}

.status.warn {
  background: #fff4e5;
  color: var(--amber);
}

.bars {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 86px 1fr 52px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  background: #e6ebf3;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--navy));
}

.bottlenecks, .actions, .product-list {
  display: grid;
  gap: 10px;
}

.item {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px;
  background: #fbfcfe;
}

.item-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
  font-weight: 800;
}

.item p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.flow div {
  background: var(--navy);
  color: #fff;
  border-radius: 6px;
  padding: 12px;
  text-align: center;
  font-weight: 800;
}

.draft {
  min-height: 200px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
  padding: 14px;
  line-height: 1.7;
  white-space: pre-line;
}

@media (max-width: 980px) {
  .topbar, .demo-panel.is-active, .grid.two, .kpis {
    display: grid;
    grid-template-columns: 1fr;
  }

  .tabs {
    flex-wrap: wrap;
  }
}
