.intro {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}


:root {
  --bg: #f6f3ee;
  --ink: #24211d;
  --muted: #70695f;
  --line: #d9d0c3;
  --paper: #fffaf2;
  --user: #315f72;
  --ai: #7a4b35;
  --fast: #d65a31;
  --slow: #2f7d68;
  --friction: #6d5bd0;
  --drift: #b7475c;
  --alert: #fff1dd;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.stage,
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(52, 45, 35, 0.08);
}

.stage {
  min-height: calc(100vh - 56px);
  padding: 28px;
  display: flex;
  flex-direction: column;
}

.stage__header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}

.label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  font-weight: 700;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 5vw, 54px);
  line-height: 1.08;
}

h2 {
  font-size: 17px;
  margin-bottom: 14px;
}

.turn-counter {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  color: var(--muted);
  font-weight: 700;
  background: #fff;
}

.conversation {
  display: grid;
  gap: 18px;
  margin: 34px 0 24px;
}

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

.bubble span,
.disclosure span {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.bubble p {
  margin: 0;
  font-size: clamp(20px, 3vw, 32px);
  line-height: 1.55;
}

.bubble--user {
  border-left: 6px solid var(--user);
}

.bubble--ai {
  border-left: 6px solid var(--ai);
}

.disclosure {
  min-height: 92px;
  margin-top: auto;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid #e4b870;
  background: var(--alert);
}

.disclosure.is-empty {
  opacity: 0.45;
  border-color: var(--line);
  background: #fff;
}

.disclosure p {
  margin: 0;
  font-size: 20px;
  line-height: 1.5;
  font-weight: 700;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

button {
  appearance: none;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: #000;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.panel {
  display: grid;
  gap: 16px;
  align-content: start;
}

.card {
  padding: 18px;
}

.state-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #e9e1d5;
  font-size: 13px;
  font-weight: 700;
}

.note {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.meter + .meter {
  margin-top: 16px;
}

.meter__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 14px;
}

.meter__track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8dfd2;
}

.meter__bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  transition: width 260ms ease;
}

.meter__bar--fast {
  background: var(--fast);
}

.meter__bar--slow {
  background: var(--slow);
}

.meter__bar--friction {
  background: var(--friction);
}

.meter__bar--drift {
  background: var(--drift);
}

.intervention {
  margin-bottom: 0;
  min-height: 28px;
  color: var(--muted);
  line-height: 1.7;
}

@media (max-width: 880px) {
  .app {
    grid-template-columns: 1fr;
  }

  .stage {
    min-height: auto;
  }

  .stage__header {
    display: grid;
  }
}

@media (max-width: 520px) {
  .app {
    width: min(100% - 20px, 1180px);
    padding: 10px 0;
  }

  .stage,
  .card {
    padding: 16px;
  }

  .controls button {
    flex: 1 1 calc(50% - 10px);
  }
}
