:root {
  color-scheme: dark;
  font-family: "Yu Gothic UI", "Segoe UI", sans-serif;
  color: #f1e7db;
  background: #17120f;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  display: grid;
  place-items: center;
  padding: 28px 18px;
  background: #17120f;
}

button,
select,
input {
  font: inherit;
}

button,
select {
  touch-action: manipulation;
}

.timer-card {
  width: min(100%, 420px);
  padding: 30px 26px 26px;
  border: 1px solid #49372d;
  border-radius: 22px 19px 23px 20px;
  background: #211a16;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}

h1 {
  margin: 0 0 12px;
  color: #e6c9a9;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 7vw, 2rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
}

.current-step {
  margin: 0 0 10px;
  color: #c8a783;
  font-size: 0.9rem;
  text-align: center;
}

.timer-display {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 24px 12px;
  border: 2px solid #8b6045;
  border-radius: 15px 18px 14px 17px;
  background: #15110f;
  box-shadow: 3px 3px 0 #3b2a22;
  transform: rotate(-0.2deg);
}

#time-display {
  color: #fff8ef;
  font-family: "Courier New", monospace;
  font-size: clamp(4.4rem, 20vw, 5.8rem);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -0.09em;
  line-height: 1;
}

.status {
  min-height: 1.4em;
  margin: 12px 0 18px;
  color: #ad9988;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-align: center;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 24px;
}

.control-button {
  display: grid;
  width: 60px;
  height: 60px;
  flex: 0 0 60px;
  place-items: center;
  padding: 0;
  border: 1px solid #654b3c;
  border-radius: 50%;
  color: #ead7c2;
  background: #352820;
  box-shadow: 0 3px 0 #17110e;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  transition: background-color 120ms ease, transform 120ms ease;
}

.control-button.start {
  border-color: #d0a073;
  color: #251912;
  background: #c99463;
}

.control-button.sound[aria-expanded="true"] {
  border-color: #d0a073;
  color: #251912;
  background: #c99463;
}

.control-button.sound[aria-expanded="true"]:hover {
  background: #dda978;
}

.control-button:hover {
  background: #49362b;
  transform: translateY(-1px);
}

.control-button.start:hover {
  background: #dda978;
}

.control-button:active {
  box-shadow: none;
  transform: translateY(2px);
}

.control-button:focus-visible,
#timer-preset:focus-visible,
#alert-sound:focus-visible,
#bgm-track:focus-visible,
#alert-volume:focus-visible,
#bgm-volume:focus-visible,
#alert-enabled:focus-visible + .toggle-track,
#bgm-enabled:focus-visible + .toggle-track,
.memo-button:focus-visible,
.bean-collapsible summary:focus-visible,
.rating-button:focus-visible,
.bean-form input:focus-visible,
.bean-form select:focus-visible,
.bean-form textarea:focus-visible,
.sound-close-button:focus-visible,
.sound-close-text-button:focus-visible,
.edit-button:focus-visible,
.text-button:focus-visible,
.add-step-button:focus-visible,
.save-button:focus-visible,
.step-row input:focus-visible,
.menu-name-field input:focus-visible,
.delete-button:focus-visible {
  outline: 2px solid #e7b27d;
  outline-offset: 3px;
}

.step-selector {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.preset-field {
  position: relative;
}

.preset-field::after {
  position: absolute;
  top: 50%;
  right: 16px;
  color: #bb9673;
  content: "⌄";
  font-size: 1rem;
  pointer-events: none;
  transform: translateY(-58%);
}

#timer-preset {
  width: 100%;
  min-height: 48px;
  padding: 11px 42px 11px 15px;
  border: 1px solid #5d4639;
  border-radius: 10px 12px 9px 11px;
  appearance: none;
  color: #eee0d1;
  background: #191411;
  cursor: pointer;
}

.sound-settings {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #49372d;
  border-radius: 13px 15px 12px 14px;
  background: #1a1512;
}

.sound-settings[hidden] {
  display: none;
}

.sound-settings-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sound-settings h2 {
  margin: 0;
  color: #ddc1a4;
  font-size: 0.88rem;
  font-weight: 600;
}

.sound-close-button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  border: 1px solid #554035;
  border-radius: 50%;
  color: #dfcbb7;
  background: #30241e;
  cursor: pointer;
  font-size: 1.1rem;
}

.sound-group {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px dashed #49372d;
}

.sound-group h3 {
  margin: 0;
  color: #c8a783;
  font-size: 0.8rem;
  font-weight: 600;
}

.sound-setting-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  color: #ad9988;
  font-size: 0.78rem;
}

#alert-sound,
#bgm-track {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #554035;
  border-radius: 8px;
  color: #eee0d1;
  background: #110e0c;
  cursor: pointer;
}

.volume-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-items: center;
  gap: 9px;
}

input[type="range"] {
  width: 100%;
  height: 34px;
  margin: 0;
  accent-color: #c99463;
  cursor: pointer;
  touch-action: pan-y;
}

.volume-control output {
  color: #dfcbb7;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.toggle-switch {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.toggle-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toggle-track {
  position: relative;
  width: 40px;
  height: 22px;
  border: 1px solid #654b3c;
  border-radius: 999px;
  background: #30241e;
  transition: background-color 120ms ease;
}

.toggle-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ad9988;
  content: "";
  transition: background-color 120ms ease, transform 120ms ease;
}

#alert-enabled:checked + .toggle-track,
#bgm-enabled:checked + .toggle-track {
  border-color: #c38e60;
  background: #6d4b34;
}

#alert-enabled:checked + .toggle-track::after,
#bgm-enabled:checked + .toggle-track::after {
  background: #f0d1ae;
  transform: translateX(18px);
}

.toggle-label {
  min-width: 25px;
  color: #dfcbb7;
  font-size: 0.72rem;
}

.bgm-status {
  min-height: 1.2em;
  margin: 0;
  color: #c8a783;
  font-size: 0.7rem;
  text-align: right;
}

.sound-close-text-button {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid #654b3c;
  border-radius: 9px;
  color: #dfcbb7;
  background: #30241e;
  cursor: pointer;
}

.edit-button,
.memo-button,
.text-button,
.add-step-button,
.save-button,
.delete-button {
  border: 1px solid #654b3c;
  border-radius: 10px;
  color: #dfcbb7;
  background: #30241e;
  cursor: pointer;
  transition: background-color 120ms ease;
}

.edit-button {
  min-height: 48px;
  padding: 0 15px;
}

.edit-button:hover,
.memo-button:hover,
.text-button:hover,
.add-step-button:hover,
.delete-button:hover:not(:disabled) {
  background: #443228;
}

.bean-memo-actions {
  margin-top: 10px;
}

.memo-button {
  width: 100%;
  min-height: 44px;
  padding: 9px 15px;
  border-radius: 10px 12px 9px 11px;
  color: #ead7c2;
  font-weight: 700;
}

.memo-button[aria-expanded="true"] {
  border-color: #c38e60;
  color: #251912;
  background: #c99463;
}

.step-editor {
  margin-top: 18px;
  padding: 18px 14px 14px;
  border: 1px solid #49372d;
  border-radius: 13px 15px 12px 14px;
  background: #1a1512;
}

.step-editor[hidden] {
  display: none;
}

.editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.step-editor h2 {
  margin: 0;
  color: #ddc1a4;
  font-size: 0.95rem;
  font-weight: 600;
}

.text-button {
  padding: 7px 9px;
  font-size: 0.73rem;
}

.menu-name-field {
  display: grid;
  gap: 6px;
  margin-top: 15px;
  color: #ad9988;
  font-size: 0.76rem;
}

.step-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 16px;
}

.step-row {
  display: grid;
  grid-template-columns: minmax(70px, 1fr) 66px 15px 66px 15px auto;
  gap: 6px;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px dashed #49372d;
}

.step-name {
  color: #dfc5a9;
  font-size: 0.85rem;
}

.step-row input,
.menu-name-field input {
  width: 100%;
  min-width: 0;
  padding: 9px 8px;
  border: 1px solid #554035;
  border-radius: 8px;
  color: #f0e3d5;
  background: #110e0c;
}

.unit {
  color: #9f8a79;
  font-size: 0.72rem;
}

.delete-button {
  min-height: 38px;
  padding: 7px 8px;
  color: #d7a99b;
  font-size: 0.72rem;
}

.delete-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.add-step-button {
  width: 100%;
  padding: 7px;
  margin-bottom: 9px;
  border-style: dashed;
  font-size: 1.2rem;
}

.save-button {
  width: 100%;
  padding: 11px 16px;
  border-color: #c38e60;
  color: #251912;
  background: #c99463;
  font-weight: 700;
}

.save-button:hover {
  background: #dda978;
}

.editor-message {
  min-height: 1.2em;
  margin: 8px 0 0;
  color: #c8a783;
  font-size: 0.73rem;
  text-align: center;
}

.bean-memo-panel {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  padding: 18px 14px 14px;
  border: 1px solid #49372d;
  border-radius: 13px 15px 12px 14px;
  background: #1a1512;
}

.bean-memo-panel[hidden] {
  display: none;
}

.bean-memo-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.bean-memo-panel h2,
.bean-list-area h3,
.bean-form-section h3 {
  margin: 0;
  color: #ddc1a4;
  font-size: 0.95rem;
  font-weight: 600;
}

.bean-form-mode {
  margin: 5px 0 0;
  color: #ad9988;
  font-size: 0.72rem;
}

.bean-form,
.bean-form-section,
.bean-list-area,
.bean-list {
  display: grid;
  gap: 12px;
}

.bean-form-section {
  padding-top: 12px;
  border-top: 1px dashed #49372d;
}

.bean-collapsible {
  border-top: 1px dashed #49372d;
  padding-top: 10px;
}

.bean-collapsible summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #49372d;
  border-radius: 8px;
  color: #dfcbb7;
  background: #211a16;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  list-style: none;
}

.bean-collapsible summary::-webkit-details-marker {
  display: none;
}

.bean-collapsible summary::after {
  color: #c99463;
  content: "▼";
  font-size: 0.68rem;
  transition: transform 120ms ease;
}

.bean-collapsible[open] summary::after {
  transform: rotate(180deg);
}

.bean-collapsible.compact {
  border-top: 0;
  padding-top: 0;
}

.bean-collapsible-body {
  display: grid;
  gap: 10px;
  padding-top: 10px;
}

.bean-section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.overall-score {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #ad9988;
  font-size: 0.72rem;
}

.overall-score output {
  display: grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid #8b6045;
  border-radius: 50%;
  color: #251912;
  background: #c99463;
  font-weight: 700;
}

.bean-rating-section {
  gap: 10px;
}

.bean-radar-chart {
  width: min(100%, 260px);
  aspect-ratio: 1;
  justify-self: center;
  overflow: visible;
}

.radar-grid {
  fill: none;
  stroke: #49372d;
  stroke-width: 1;
}

.radar-axis {
  stroke: #554035;
  stroke-width: 1;
}

.radar-shape {
  fill: rgba(201, 148, 99, 0.32);
  stroke: #e0ad78;
  stroke-width: 2;
}

.radar-point {
  fill: #f0d1ae;
  stroke: #8b6045;
  stroke-width: 1;
}

.radar-label {
  fill: #dfcbb7;
  font-size: 8px;
  text-anchor: middle;
}

.flavor-preview {
  display: grid;
  gap: 7px;
  color: #ad9988;
  font-size: 0.74rem;
}

.flavor-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 24px;
}

.flavor-tag {
  padding: 4px 7px;
  border: 1px solid #5d4639;
  border-radius: 999px;
  color: #f0d8bf;
  background: #30241e;
  font-size: 0.72rem;
}

.flavor-tag.empty {
  border-style: dashed;
  color: #9f8a79;
  background: transparent;
}

.bean-field,
.bean-check-field,
.rating-control {
  display: grid;
  gap: 6px;
  color: #ad9988;
  font-size: 0.76rem;
}

.bean-field[hidden] {
  display: none;
}

.bean-field-grid,
.rating-button-list {
  display: grid;
  gap: 10px;
}

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

.rating-button-list {
  gap: 8px;
}

.rating-control {
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
}

.rating-buttons {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.rating-button {
  min-height: 34px;
  padding: 0;
  border: 1px solid #554035;
  border-radius: 8px;
  color: #dfcbb7;
  background: #110e0c;
  cursor: pointer;
  font-size: 0.78rem;
}

.rating-button.is-active {
  border-color: #c38e60;
  color: #251912;
  background: #c99463;
  font-weight: 700;
}

.bean-form input:not([type="checkbox"]):not([type="hidden"]),
.bean-form select,
.bean-form textarea {
  width: 100%;
  min-width: 0;
  padding: 9px 8px;
  border: 1px solid #554035;
  border-radius: 8px;
  color: #f0e3d5;
  background: #110e0c;
}

.bean-form textarea {
  resize: vertical;
}

.bean-check-field {
  align-content: end;
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 58px;
}

.bean-check-field input {
  width: 18px;
  height: 18px;
  accent-color: #c99463;
}

.bean-list-area {
  padding-top: 12px;
  border-top: 1px dashed #49372d;
}

.bean-empty {
  margin: 0;
  color: #9f8a79;
  font-size: 0.76rem;
  text-align: center;
}

.bean-card {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid #49372d;
  border-radius: 8px;
  background: #211a16;
}

.bean-card-main {
  display: grid;
  gap: 4px;
}

.bean-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #f0d8bf;
  font-size: 0.9rem;
  font-weight: 700;
}

.bean-favorite {
  color: #f0c36d;
  font-size: 0.82rem;
}

.bean-card-meta,
.bean-card-rating {
  color: #ad9988;
  font-size: 0.73rem;
  line-height: 1.45;
}

.bean-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 430px) {
  body {
    align-items: start;
    padding: 14px 10px;
  }

  .timer-card {
    padding: 24px 17px 20px;
    border-radius: 18px 16px 20px 17px;
  }

  .timer-display {
    min-height: 158px;
  }

  #time-display {
    font-size: clamp(4rem, 21vw, 5rem);
  }

  .controls {
    gap: 11px;
  }

  .control-button {
    width: 56px;
    height: 56px;
    flex-basis: 56px;
  }

  .step-editor {
    padding-inline: 10px;
  }

  .sound-settings {
    padding-inline: 10px;
  }

  .bean-memo-panel {
    padding-inline: 10px;
  }

  .bean-field-grid,
  .rating-button-list {
    grid-template-columns: 1fr;
  }

  .bean-section-title-row {
    align-items: start;
  }

  .rating-control {
    grid-template-columns: 1fr;
  }

  .step-row {
    grid-template-columns: minmax(64px, 1fr) 55px 12px 55px 12px;
    gap: 4px;
  }

  .delete-button {
    grid-column: 1 / -1;
    min-height: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .control-button,
  .edit-button,
  .text-button,
  .add-step-button,
  .save-button,
  .delete-button,
  .sound-close-button,
  .sound-close-text-button,
  .toggle-track,
  .toggle-track::after,
  .bean-collapsible summary::after {
    transition: none;
  }
}

/* Phase 1: Claude Design timer screen adaptation */
:root {
  color-scheme: light;
  --ivory: #f6f3ec;
  --greige: #ece8df;
  --paper: #fffefa;
  --wood-700: #3f3028;
  --wood-600: #6b4a36;
  --wood-400: #a98267;
  --sage: #7f9684;
  --sage-text: #4f7159;
  --sage-soft: #e6ebe4;
  --terracotta: #9f432d;
  --terracotta-border: #d09a86;
  --terracotta-soft: #f4e4db;
  --wood-soft: #f0e5d8;
  --text-primary: var(--wood-700);
  --text-normal: #5f4a3f;
  --text-body: var(--text-normal);
  --text-heading: var(--wood-600);
  --text-muted: #75655a;
  --text-disabled: #8f837b;
  --text-danger: var(--terracotta);
  --text-placeholder: #7f7168;
  --text-on-brown: #fffefa;
  --border-line: #e0dacd;
  --border-strong: #cfc6b5;
  --focus-ring: #b08a66;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(63, 48, 40, 0.05), 0 4px 14px rgba(63, 48, 40, 0.06);
  --shadow-button: 0 1px 2px rgba(63, 48, 40, 0.12);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  font-family: "Yu Gothic", "Yu Gothic UI", "Hiragino Kaku Gothic ProN", "Segoe UI", sans-serif;
  color: var(--text-body);
  background: var(--ivory);
}

body {
  display: grid;
  place-items: start center;
  padding: 24px 16px 40px;
  color: var(--text-body);
  background: var(--ivory);
  line-height: 1.7;
}

button,
select,
input {
  color: inherit;
}

.timer-card {
  width: min(100%, 440px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
  margin-bottom: 14px;
}

h1 {
  margin: 0;
  color: var(--text-heading);
  font-family: "Segoe UI", "Yu Gothic UI", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: left;
}

.layout-timer,
.sound-settings,
.step-editor,
.bean-memo-panel {
  border: 1px solid var(--border-line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-card);
}

.layout-timer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px 20px 24px;
}

.layout-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.current-step {
  margin: 0;
  color: var(--text-heading);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
}

.timer-display {
  display: grid;
  min-height: auto;
  place-items: center;
  padding: 4px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}

#time-display {
  color: var(--text-primary);
  font-family: "Segoe UI", "Yu Gothic UI", sans-serif;
  font-size: clamp(4.4rem, 21vw, 5.6rem);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.05;
}

.status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 1.4em;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-align: center;
}

body.is-running .status {
  color: var(--sage-text);
  font-weight: 700;
}

body.is-running .status::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sage);
  content: "";
}

.progress-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.progress-chips::-webkit-scrollbar {
  display: none;
}

.progress-chip {
  flex: 0 0 auto;
  padding: 5px 13px;
  border: 1px solid var(--border-line);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  background: var(--greige);
  font-size: 0.78rem;
  white-space: nowrap;
  transition: background-color 120ms ease, color 120ms ease;
}

.progress-chip.current {
  border-color: var(--wood-600);
  color: var(--text-on-brown);
  background: var(--wood-600);
  font-weight: 700;
}

.progress-chip.done {
  border-color: var(--sage-soft);
  color: var(--sage-text);
  background: var(--sage-soft);
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--greige);
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--sage);
  transition: width 220ms var(--ease-out);
}

.next-step {
  min-height: 1.4em;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
}

.controls {
  align-items: center;
  gap: 20px;
  margin: 4px 0 0;
}

.control-button {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border: 1.5px solid var(--border-strong);
  color: var(--wood-600);
  background: var(--paper);
  box-shadow: var(--shadow-button);
  font-size: 1rem;
}

.control-button:hover {
  background: var(--wood-soft);
}

.control-button.start,
body.is-paused #start-button,
body.is-running #pause-button {
  width: 72px;
  height: 72px;
  border-color: var(--wood-600);
  color: var(--text-on-brown);
  background: var(--wood-600);
}

.control-button.start:hover,
body.is-paused #start-button:hover,
body.is-running #pause-button:hover {
  background: #5b3e2d;
}

#pause-button {
  display: none;
}

body.is-running #start-button {
  display: none;
}

body.is-running #pause-button {
  display: grid;
}

.app-header .control-button.sound {
  width: 44px;
  height: 44px;
  border-color: var(--border-line);
  color: var(--wood-400);
  background: transparent;
  box-shadow: none;
}

.app-header .control-button.sound:hover {
  background: var(--wood-soft);
}

.app-header .control-button.sound[aria-expanded="true"] {
  border-color: var(--wood-600);
  color: var(--text-on-brown);
  background: var(--wood-600);
}

.step-selector {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.preset-field::after {
  color: var(--wood-400);
}

#timer-preset {
  min-height: 48px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-body);
  background: var(--paper);
}

.edit-button,
.memo-button,
.text-button,
.add-step-button,
.sound-close-text-button {
  border: 1.5px solid var(--wood-600);
  border-radius: var(--radius-md);
  color: var(--wood-600);
  background: var(--paper);
}

.edit-button {
  padding: 0 18px;
  font-weight: 700;
}

.edit-button:hover,
.memo-button:hover,
.text-button:hover,
.add-step-button:hover,
.sound-close-text-button:hover {
  background: var(--wood-soft);
}

.bean-memo-actions {
  margin: 0;
}

.memo-button {
  min-height: 48px;
  border-color: var(--border-strong);
  color: var(--wood-600);
  background: var(--greige);
}

.memo-button[aria-expanded="true"] {
  border-color: var(--wood-600);
  color: var(--text-on-brown);
  background: var(--wood-600);
}

.sound-settings,
.step-editor,
.bean-memo-panel {
  margin-top: 0;
  padding: 18px 16px;
}

.sound-settings h2,
.step-editor h2,
.bean-memo-panel h2,
.bean-list-area h3,
.bean-form-section h3 {
  color: var(--text-heading);
  font-weight: 700;
}

.sound-group,
.bean-form-section,
.bean-list-area,
.bean-collapsible,
.step-row {
  border-color: var(--border-line);
}

.sound-setting-row,
.menu-name-field,
.bean-field,
.bean-check-field,
.rating-control,
.editor-message,
.bean-form-mode,
.bean-card-meta,
.bean-card-rating,
.unit,
.bean-empty,
.flavor-tag.empty {
  color: var(--text-muted);
}

.step-name {
  color: var(--text-normal);
  font-weight: 700;
}

#alert-sound,
#bgm-track,
.step-row input,
.menu-name-field input,
.bean-form input:not([type="checkbox"]):not([type="hidden"]),
.bean-form select,
.bean-form textarea {
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-body);
  background: var(--paper);
}

.toggle-track {
  border-color: var(--border-strong);
  background: var(--greige);
}

.toggle-track::after {
  background: var(--paper);
  box-shadow: var(--shadow-button);
}

#alert-enabled:checked + .toggle-track,
#bgm-enabled:checked + .toggle-track {
  border-color: var(--sage);
  background: var(--sage);
}

.save-button,
.rating-button.is-active,
.overall-score output {
  border-color: var(--wood-600);
  color: var(--text-on-brown);
  background: var(--wood-600);
}

.delete-button {
  border-color: #c87958;
  color: #9f4b32;
  background: #fff4ef;
  font-weight: 700;
  opacity: 1;
}

.delete-button:hover:not(:disabled) {
  border-color: #a95338;
  color: #7f3825;
  background: #f9e4da;
}

.delete-button:disabled {
  border-color: #d7d0c8;
  color: #9c928b;
  background: #eeeae4;
  opacity: 0.65;
  cursor: not-allowed;
}

.bean-card {
  border-color: var(--border-line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-button);
}

.bean-collapsible summary {
  min-height: 44px;
  border-color: var(--border-line);
  border-radius: var(--radius-md);
  color: var(--wood-600);
  background: var(--greige);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-placeholder);
  opacity: 1;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  color: var(--text-disabled);
}

.control-button:focus-visible,
#timer-preset:focus-visible,
#alert-sound:focus-visible,
#bgm-track:focus-visible,
#alert-volume:focus-visible,
#bgm-volume:focus-visible,
#alert-enabled:focus-visible + .toggle-track,
#bgm-enabled:focus-visible + .toggle-track,
.memo-button:focus-visible,
.bean-collapsible summary:focus-visible,
.rating-button:focus-visible,
.bean-form input:focus-visible,
.bean-form select:focus-visible,
.bean-form textarea:focus-visible,
.sound-close-button:focus-visible,
.sound-close-text-button:focus-visible,
.edit-button:focus-visible,
.text-button:focus-visible,
.add-step-button:focus-visible,
.save-button:focus-visible,
.step-row input:focus-visible,
.menu-name-field input:focus-visible,
.delete-button:focus-visible {
  outline-color: var(--focus-ring);
  outline-offset: 2px;
}

.delete-button:focus-visible {
  outline: 3px solid rgba(200, 121, 88, 0.25);
  outline-offset: 2px;
}

@media (max-width: 430px) {
  body {
    padding: 14px 16px 32px;
  }

  .layout-timer {
    padding: 22px 16px 20px;
  }

  #time-display {
    font-size: clamp(4rem, 22vw, 5rem);
  }

  .controls {
    gap: 14px;
  }
}

@media (min-width: 920px) {
  body {
    padding: 48px 32px;
  }

  .timer-card {
    display: grid;
    width: min(100%, 1020px);
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    column-gap: 32px;
    align-items: start;
  }

  .app-header {
    grid-column: 1 / -1;
    margin-bottom: 24px;
  }

  h1 {
    font-size: 1.45rem;
  }

  .layout-timer {
    position: sticky;
    top: 24px;
    grid-column: 1;
    padding: 36px 28px 32px;
  }

  .layout-side {
    grid-column: 2;
    margin-top: 0;
  }

  #time-display {
    font-size: 6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .progress-bar-fill,
  .progress-chip {
    transition: none;
  }
}

/* Phase 2: sound settings panel */
.sound-settings {
  width: 100%;
  max-width: 480px;
  justify-self: stretch;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--border-line);
  border-radius: var(--radius-lg);
  color: var(--text-normal);
  background: var(--paper);
  box-shadow: var(--shadow-card);
}

.sound-settings-heading {
  align-items: center;
  padding-bottom: 2px;
}

.sound-settings h2 {
  color: var(--text-heading);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0;
}

.sound-close-button {
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  color: var(--wood-600);
  background: var(--paper);
  box-shadow: var(--shadow-button);
  font-size: 1.05rem;
}

.sound-close-button:hover {
  background: var(--wood-soft);
}

.sound-group {
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border-line);
  border-radius: var(--radius-md);
  background: #fffaf5;
  box-shadow: 0 1px 2px rgba(63, 48, 40, 0.04);
}

.sound-group h3 {
  color: var(--text-heading);
  font-size: 0.92rem;
  font-weight: 800;
}

.sound-setting-row {
  grid-template-columns: minmax(88px, 0.42fr) minmax(0, 1fr);
  gap: 14px;
  color: var(--text-normal);
  font-size: 0.86rem;
  font-weight: 700;
}

.sound-setting-row > span:first-child {
  color: var(--text-muted);
  font-weight: 700;
}

#alert-sound,
#bgm-track {
  min-height: 46px;
  padding: 10px 38px 10px 12px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-normal);
  background: var(--paper);
}

#alert-sound:disabled,
#bgm-track:disabled,
#alert-volume:disabled,
#bgm-volume:disabled {
  color: var(--text-disabled);
  cursor: not-allowed;
  opacity: 0.72;
}

#alert-sound:disabled,
#bgm-track:disabled {
  border-color: #d7d0c8;
  background: #eeeae4;
}

.sound-settings .volume-control {
  grid-template-columns: minmax(0, 1fr) minmax(38px, auto);
  gap: 12px;
}

.sound-settings input[type="range"] {
  height: 40px;
  accent-color: var(--wood-600);
}

.sound-settings input[type="range"]:disabled {
  accent-color: var(--text-disabled);
}

.sound-settings .volume-control output {
  min-width: 38px;
  color: var(--text-normal);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: right;
}

.sound-settings .toggle-track {
  width: 46px;
  height: 26px;
  border-color: var(--border-strong);
  background: var(--greige);
}

.sound-settings .toggle-track::after {
  top: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  background: var(--paper);
  box-shadow: var(--shadow-button);
}

#alert-enabled:checked + .toggle-track,
#bgm-enabled:checked + .toggle-track {
  border-color: var(--sage-text);
  background: var(--sage);
}

#alert-enabled:checked + .toggle-track::after,
#bgm-enabled:checked + .toggle-track::after {
  background: var(--paper);
  transform: translateX(20px);
}

.sound-settings .toggle-label {
  min-width: 32px;
  color: var(--text-normal);
  font-size: 0.8rem;
  font-weight: 800;
}

.bgm-status {
  min-height: 1.4em;
  margin: -2px 2px 0;
  color: var(--sage-text);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: right;
}

.sound-close-text-button {
  min-height: 46px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--wood-600);
  background: var(--paper);
  font-weight: 800;
}

.sound-close-text-button:hover {
  background: var(--wood-soft);
}

@media (max-width: 430px) {
  .sound-settings {
    max-width: none;
    padding: 16px;
  }

  .sound-group {
    padding: 14px;
  }

  .sound-setting-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .sound-settings .toggle-switch {
    min-height: 44px;
  }
}

@media (min-width: 920px) {
  .sound-settings {
    max-width: 480px;
    justify-self: start;
  }
}

/* Phase 3: bean memo list */
.bean-list-area {
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--border-line);
}

.bean-list-area h3 {
  color: var(--text-heading);
  font-size: 1rem;
  font-weight: 800;
}

.bean-list {
  gap: 14px;
}

.bean-card {
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border-line);
  border-radius: var(--radius-lg);
  color: var(--text-normal);
  background: var(--paper);
  box-shadow: var(--shadow-card);
}

.bean-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.bean-card-title-group {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.bean-card-name {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.45;
}

.bean-card-rating-badge {
  display: inline-grid;
  min-width: 56px;
  min-height: 36px;
  place-items: center;
  padding: 6px 10px;
  border: 1.5px solid var(--wood-600);
  border-radius: var(--radius-pill);
  color: var(--text-on-brown);
  background: var(--wood-600);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.bean-favorite {
  width: fit-content;
  padding: 3px 9px;
  border: 1px solid var(--terracotta-border);
  border-radius: var(--radius-pill);
  color: var(--text-danger);
  background: var(--terracotta-soft);
  font-size: 0.74rem;
  font-weight: 800;
}

.bean-card-main {
  gap: 8px;
}

.bean-card-roaster,
.bean-card-meta {
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.bean-card-roaster {
  color: var(--text-normal);
  font-size: 0.9rem;
  font-weight: 700;
}

.bean-card-meta {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.bean-card-flavors {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 2px;
}

.bean-card-flavor-tag {
  max-width: 100%;
  padding: 5px 10px;
  border: 1px solid var(--sage-soft);
  border-radius: var(--radius-pill);
  overflow-wrap: anywhere;
  color: var(--sage-text);
  background: var(--sage-soft);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.35;
}

.bean-card-actions {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.bean-card-actions .text-button,
.bean-card-actions .delete-button {
  min-height: 44px;
  font-weight: 800;
}

.bean-empty-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 22px 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--text-normal);
  background: var(--greige);
  text-align: center;
}

.bean-empty-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: var(--wood-600);
  background: var(--paper);
  font-size: 1rem;
}

.bean-empty-title {
  margin: 0;
  color: var(--text-heading);
  font-size: 0.98rem;
  font-weight: 800;
}

.bean-empty-card .bean-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.bean-empty-card .text-button {
  min-height: 44px;
  padding-inline: 18px;
  font-weight: 800;
}

@media (max-width: 430px) {
  .bean-card {
    padding: 14px;
  }

  .bean-card-header {
    grid-template-columns: 1fr;
  }

  .bean-card-rating-badge {
    justify-self: start;
  }

  .bean-card-actions {
    gap: 8px;
  }
}
