:root {
  --bg-1: #fff5e8;
  --bg-2: #eaf3ff;
  --card: #ffffffde;
  --ink: #1d2735;
  --muted: #596982;
  --line: #d4dfed;
  --primary: #ea5729;
  --primary-deep: #bf3f18;
  --good: #1d7c4d;
  --warn: #9a3412;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  background: linear-gradient(155deg, var(--bg-1), var(--bg-2));
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1050px 560px at 94% -8%, #ffd5bc 0%, transparent 60%),
    radial-gradient(860px 430px at -12% 18%, #d0e7ff 0%, transparent 56%);
}

.app {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 14px 30px;
}

.hero h1 {
  margin: 0;
  font-size: 40px;
  letter-spacing: -0.5px;
}

.hero p {
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 17px;
}

.card {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 14px 34px rgba(19, 35, 58, 0.1);
  padding: 14px;
}

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

.chip {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #f2bca8;
  background: #fff2ed;
  color: #8a2f12;
  font-size: 12px;
  font-weight: 700;
}

.focus-card h2 {
  margin: 8px 0 8px;
  font-size: 24px;
}

.today-state {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.today-state.done {
  color: var(--good);
  border-color: #b5dfca;
  background: #ebfaef;
}

.today-state.progress {
  color: #8a4500;
  border-color: #f3d7bd;
  background: #fff5eb;
}

.muted {
  margin: 4px 0;
  color: var(--muted);
  font-size: 14px;
}

.week-progress-row {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}

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

.week-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #0ea47f, #2b7fe4);
  transition: width 180ms ease;
}

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

.mode-wrap {
  margin-top: 10px;
}

.mode-switch {
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.mode-btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #4b5e77;
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.mode-btn.active {
  border-color: #f6b49f;
  background: #fff2ec;
  color: #a03815;
}

.wizard-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.wizard-head h2 {
  margin: 0;
}

.step-counter {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.step-rail {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.rail-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 6px;
  text-align: center;
  background: #fff;
  color: #61728b;
}

.rail-item span {
  display: block;
  font-size: 11px;
  font-weight: 700;
}

.rail-item em {
  display: block;
  font-style: normal;
  font-size: 12px;
  margin-top: 2px;
}

.rail-item.done {
  border-color: #addfc4;
  color: var(--good);
  background: #ebfaef;
}

.rail-item.active {
  border-color: #f6b49f;
  color: #a03815;
  background: #fff2ec;
}

.stage-meta {
  margin-top: 10px;
}

.step-name {
  font-weight: 700;
  font-size: 20px;
}

.step-hint {
  margin-top: 4px;
  color: var(--muted);
}

.timer-wrap {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}

.timer {
  font-size: 56px;
  line-height: 1;
  letter-spacing: -1px;
  font-weight: 700;
}

.timer-state {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.step-content {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.step-content h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.action-stack {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 16px;
  font-weight: 700;
}

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

.btn.ghost {
  background: #f8fbff;
}

.btn:disabled {
  opacity: 0.6;
}

.feedback {
  margin-top: 10px;
  color: #0a5b72;
  font-size: 14px;
}

.script {
  margin: 0;
  white-space: pre-wrap;
  border: 1px dashed #e2cab8;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  font-size: 13px;
}

.details-card summary {
  cursor: pointer;
  font-weight: 700;
}

.details-grid {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.details-grid .wide {
  grid-column: 1 / -1;
}

.label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
}

.inline-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hidden {
  display: none;
}

.mini-timer {
  font-size: 36px;
  font-weight: 700;
  margin-top: 8px;
}

.scenario-box {
  white-space: pre-line;
  border: 1px solid #bdd8e6;
  border-radius: 10px;
  background: #f3fbff;
  padding: 10px;
}

.input,
.select {
  width: 100%;
  margin-top: 6px;
  border: 1px solid #bccadd;
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 14px;
}

.word-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.word-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 7px 8px;
  font-size: 12px;
  cursor: pointer;
}

.word-chip strong {
  font-size: 12px;
  color: #25344a;
}

.word-chip span {
  color: #6a7a92;
  font-size: 11px;
}

.audio-player {
  width: 100%;
  margin-top: 8px;
}

.phrase-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
}

.stats {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.stat-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
}

.plan-ok {
  color: var(--good);
  font-weight: 700;
}

.plan-warn {
  color: var(--warn);
  font-weight: 700;
}

@media (min-width: 840px) {
  .details-grid {
    grid-template-columns: 1fr 1fr;
  }

  .action-stack {
    grid-template-columns: 1fr 1fr;
  }

  .btn.primary {
    grid-column: 1 / -1;
  }
}
