:root {
  color-scheme: light dark;
  --bg: #f3f0e8;
  --panel: #fbf7ef;
  --panel-strong: #fffdf8;
  --text: #25231f;
  --muted: #736b60;
  --line: rgba(37, 35, 31, 0.14);
  --accent: #9a4f32;
  --accent-strong: #74351f;
  --accent-soft: rgba(154, 79, 50, 0.12);
  --shadow: 0 18px 55px rgba(67, 48, 34, 0.1);
  --radius: 24px;
  --container: min(1180px, calc(100vw - 32px));
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171512;
    --panel: #211e19;
    --panel-strong: #29241e;
    --text: #f2eadf;
    --muted: #b6ab9e;
    --line: rgba(242, 234, 223, 0.15);
    --accent: #d58b63;
    --accent-strong: #f0b18a;
    --accent-soft: rgba(213, 139, 99, 0.14);
    --shadow: 0 18px 55px rgba(0, 0, 0, 0.26);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 10% 0%, var(--accent-soft), transparent 32rem),
    linear-gradient(180deg, var(--bg), color-mix(in srgb, var(--bg) 90%, var(--panel)));
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans CJK JP", sans-serif;
  line-height: 1.55;
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: var(--container);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 54px) 0 56px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow: var(--shadow);
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.58fr);
  gap: 22px;
  align-items: stretch;
  padding: clamp(28px, 5vw, 54px);
}

.kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1,
h2 {
  letter-spacing: -0.05em;
  line-height: 1;
}

h1 {
  max-width: 9ch;
  margin-bottom: 18px;
  font-size: clamp(42px, 6.6vw, 78px);
  font-weight: 680;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 660;
}

.intro-text {
  max-width: 520px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 20px);
}

.session-card {
  display: grid;
  align-content: end;
  min-height: 230px;
  padding: 26px;
  border-radius: calc(var(--radius) - 8px);
  background: var(--panel-strong);
}

.session-label {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.session-card strong {
  display: block;
  margin-bottom: 12px;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.session-card span:last-child {
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 18px;
  margin-top: 18px;
}

.steps {
  display: grid;
  gap: 10px;
  padding: 14px;
  align-content: start;
}

.step-button {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: transparent;
  color: var(--text);
  text-align: left;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.step-button:hover,
.step-button:focus-visible {
  border-color: var(--line);
  background: color-mix(in srgb, var(--panel-strong) 84%, transparent);
  outline: none;
}

.step-button:active {
  transform: translateY(1px) scale(0.99);
}

.step-button.active {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  background: var(--accent-soft);
}

.step-button span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--panel-strong);
  color: var(--accent);
  font-weight: 800;
}

.step-button strong {
  font-size: 16px;
}

.step-button small {
  color: var(--muted);
}

.practice {
  padding: clamp(22px, 4vw, 34px);
}

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

.timer {
  font-variant-numeric: tabular-nums;
  font-size: clamp(56px, 10vw, 104px);
  font-weight: 760;
  letter-spacing: -0.07em;
  line-height: 0.92;
}

.timer-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.primary,
.ghost {
  min-height: 44px;
  padding: 0 17px;
  border-radius: 999px;
  font-weight: 760;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.primary {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff9f2;
}

.primary:hover,
.primary:focus-visible {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  outline: none;
}

.ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}

.ghost:hover,
.ghost:focus-visible {
  background: var(--panel-strong);
  outline: none;
}

.primary:active,
.ghost:active {
  transform: translateY(1px) scale(0.99);
}

.instruction {
  padding: 28px 0 20px;
}

.instruction p,
.instruction li,
.review p {
  color: var(--muted);
}

.instruction ul {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding-left: 1.25rem;
}

.audio-box {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel-strong) 74%, transparent);
}

.audio-heading {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
}

.audio-heading span {
  color: var(--muted);
  font-size: 13px;
}

.audio-box label,
.note-panel label {
  color: var(--text);
  font-weight: 760;
}

#audioFile {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-strong);
  color: var(--muted);
}

#audioFile::file-selector-button {
  margin-right: 12px;
  border: 0;
  border-radius: 999px;
  padding: 9px 13px;
  background: var(--accent);
  color: #fff9f2;
  font-weight: 760;
}

#audioPlayer {
  width: 100%;
}

.notes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.note-panel {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.note-panel.wide {
  grid-column: 1 / -1;
}

textarea {
  width: 100%;
  min-height: 142px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: var(--panel-strong);
  color: var(--text);
  outline: none;
}

textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 54%, var(--line));
}

.review {
  display: grid;
  grid-template-columns: 0.9fr 1fr;
  gap: 24px;
  align-items: center;
  margin-top: 18px;
  padding: clamp(24px, 4vw, 36px);
}

.review p {
  max-width: 560px;
  margin-bottom: 0;
}

.check-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.check-list label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel-strong) 70%, transparent);
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

@media (max-width: 840px) {
  .app-shell {
    width: min(100vw - 24px, 720px);
  }

  .intro,
  .workspace,
  .notes-grid,
  .review {
    grid-template-columns: 1fr;
  }

  .session-card {
    min-height: 160px;
  }

  .timer-block {
    align-items: flex-start;
    flex-direction: column;
  }

  .timer-actions {
    justify-content: flex-start;
  }

  .check-list {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
}
