body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f5efe6;
  font-family: system-ui, sans-serif;
  color: #3c2a1e;
}

#views {
  flex: 1;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  padding: 24px 16px;
}

.view {
  display: none;
  width: 100%;
  max-width: 400px;
}

.view.active {
  display: block;
}

#app,
.view-inner {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

#app {
  text-align: center;
}

.view-inner h2 {
  margin-top: 0;
}

#recipe-select {
  width: 100%;
  padding: 8px;
  margin-bottom: 16px;
}

#recipe-name {
  margin: 0 0 16px;
  font-size: 1.2rem;
}

#recipe-info {
  margin: -12px 0 16px;
  color: #8a7563;
  font-size: 0.9rem;
}

#timer {
  font-size: 3rem;
  font-variant-numeric: tabular-nums;
  margin-bottom: 16px;
}

#step-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.step-item {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.95rem;
}

.step-item-marker {
  width: 1em;
  flex: 0 0 auto;
}

.step-item-label {
  flex: 0 0 auto;
}

.step-item-target {
  color: #8a7563;
  flex: 0 0 auto;
}

.step-item-remaining {
  margin-left: auto;
  font-size: 0.85rem;
  color: #6f4e37;
  font-weight: bold;
}

.step-item-done {
  color: #b8ab9c;
}

.step-item-done .step-item-target {
  color: #cabfb2;
}

.step-item-current {
  background: #f1e6d8;
  font-weight: bold;
}

.step-item-upcoming {
  color: #3c2a1e;
}

#controls {
  display: flex;
  gap: 8px;
  justify-content: center;
}

button {
  padding: 10px 16px;
  font-size: 1rem;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  background: #eee;
  color: #333;
  font: inherit;
}

#start-btn,
#bean-submit-btn {
  background: #6f4e37;
  color: white;
}

/* タブナビゲーション */

#tab-nav {
  display: flex;
  border-top: 1px solid #e0d5c5;
  background: #ffffff;
  position: sticky;
  bottom: 0;
}

.tab-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-top: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: #8a7563;
}

.tab-btn.active {
  color: #6f4e37;
  font-weight: bold;
  border-top-color: #6f4e37;
}

/* 豆フォーム */

#bean-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

#bean-form input,
#bean-form select,
#bean-form textarea {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font: inherit;
}

#bean-form textarea {
  resize: vertical;
  min-height: 3em;
}

.form-actions {
  display: flex;
  gap: 8px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: #8a7563;
}

/* 一覧共通(豆・レシピ・感想ログで使い回す) */

#bean-list,
#recipe-list,
#log-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-item {
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
}

.list-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.list-item-actions button {
  padding: 4px 8px;
  font-size: 0.8rem;
}

.list-item-meta {
  margin-top: 4px;
  font-size: 0.85rem;
  color: #8a7563;
}

.list-item-text {
  margin-top: 4px;
  font-size: 0.85rem;
  white-space: pre-wrap;
}

.bean-item.archived {
  opacity: 0.5;
}

/* 感想ログフォーム */

#log-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

#log-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: #8a7563;
}

#log-form select,
#log-form textarea {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font: inherit;
  color: #3c2a1e;
}

#log-form textarea {
  resize: vertical;
  min-height: 3em;
}

.star-rating {
  display: flex;
  gap: 4px;
}

.star-btn {
  background: none;
  padding: 0;
  font-size: 1.6rem;
  line-height: 1;
  color: #ddd;
  border: none;
}

.star-btn.selected {
  color: #e0a940;
}

.taste-notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.log-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.log-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: #8a7563;
}

.log-filters select {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font: inherit;
}

/* 感想ログ一覧(コンテナ・箱の見た目は「一覧共通」を参照) */

.log-item-header {
  font-weight: bold;
}

/* レシピフォーム */

#recipe-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

#recipe-form input,
#recipe-form select {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font: inherit;
}

#recipe-add-step-btn {
  align-self: flex-start;
}

.step-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.step-row input {
  flex: 1;
  min-width: 0;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font: inherit;
}

.step-row input[type="number"] {
  flex: 0 0 5em;
}

.step-final-note {
  flex: 0 0 5em;
  font-size: 0.75rem;
  color: #8a7563;
}

.step-row button {
  padding: 8px;
  font-size: 0.8rem;
}

/* レシピ一覧(コンテナ・箱の見た目は「一覧共通」を参照) */

.recipe-item-steps {
  margin: 6px 0 0;
  padding-left: 1.2em;
  font-size: 0.85rem;
  color: #3c2a1e;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* 設定画面 */

.settings-section {
  margin-bottom: 24px;
}

.settings-section h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.settings-desc {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: #8a7563;
}

.import-mode-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0;
  font-size: 0.85rem;
}

#settings-message {
  margin-top: 8px;
  font-size: 0.85rem;
  color: #6f4e37;
}
