:root {
  /* ── Design Tokens ──────────────────────────────── */
  --color-primary:        #f97316;
  --color-primary-light:  #fff7ed;
  --color-primary-mid:    #fed7aa;
  --color-primary-dark:   #ea6c0a;
  --color-bg-base:        #fafaf8;
  --color-bg-surface:     #ffffff;
  --color-bg-muted:       #f4f4f0;
  --color-text-primary:   #111111;
  --color-text-secondary: #666666;
  --color-text-muted:     #bbbbbb;
  --color-border:         #e8e8e4;
  --shadow-card:          0 1px 3px rgba(0,0,0,0.06), 0 1px 12px rgba(0,0,0,0.03);
  --shadow-card-hover:    0 4px 16px rgba(0,0,0,0.08);
  --shadow-cta:           0 4px 20px rgba(249,115,22,0.35);

  /* ── Legacy aliases (後方互換) ──────────────────── */
  --bg-color:    var(--color-bg-surface);
  --bg-secondary: var(--color-bg-muted);
  --text-main:   var(--color-text-primary);
  --text-muted:  var(--color-text-secondary);
  --accent:      var(--color-primary);
  --attention:   var(--color-primary);
  --border-color: var(--color-border);

  --timer-control-safe-area: 132px;
  --safe-area-bottom: 0px;
  --font-sans: 'Noto Sans JP', 'Outfit', sans-serif;
}

@supports (padding: env(safe-area-inset-bottom)) {
  :root {
    --safe-area-bottom: env(safe-area-inset-bottom);
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  overflow-x: clip;
  max-width: 100%;
  background-color: var(--color-bg-base);
}

body {
  background-color: var(--color-bg-base);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: clip;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  box-shadow: 0 0 20px rgba(0,0,0,0.05);
}

/* Screens */
.screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 20px 20px 100px 20px;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.screen.active {
  display: flex;
  opacity: 1;
  pointer-events: all;
  transform: none;
  position: relative;
}

.screen:not(.active) {
  display: none;
}

#timer-screen {
  padding-bottom: var(--timer-control-safe-area);
}

header {
  background-color: var(--color-bg-base);
  margin: -20px -20px 20px -20px;
  padding: 20px 20px 16px;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}

header h1 {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 300;
}

/* Shared Accordion Styling */
.method-explanation, .advanced-settings {
  margin-top: 12px;
  background: var(--color-bg-surface);
  border: none;
  border-radius: 20px;
  text-align: left;
  overflow: hidden;
  box-shadow: 0 2px 20px rgba(0,0,0,0.07);
  transition: box-shadow 0.18s;
}

.method-explanation:hover, .advanced-settings:hover {
  box-shadow: 0 4px 28px rgba(0,0,0,0.10);
}

/* カード内 accordion → ボックスではなくリスト行として扱う */
.card > .advanced-settings {
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  margin-top: 0;
  margin-left: -20px;
  margin-right: -20px;
  border-top: 1px solid var(--color-border);
}

.card > .advanced-settings:hover {
  box-shadow: none;
}

.method-explanation summary, .advanced-settings > summary {
  padding: 16px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  list-style: none;
  position: relative;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.18s;
  user-select: none;
}

.method-explanation summary::-webkit-details-marker,
.advanced-settings > summary::-webkit-details-marker {
  display: none;
}

.method-explanation summary::after, .advanced-settings > summary::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--text-muted);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s, color 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.05);
  line-height: 1;
}

.method-explanation[open] summary::after, .advanced-settings[open] > summary::after {
  content: '−';
  transform: rotate(180deg);
  background: var(--text-main);
  color: var(--bg-color);
}

.method-content {
  padding: 0 16px 16px 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.method-content p {
  margin-bottom: 8px;
}

.method-content a {
  color: var(--accent);
  text-decoration: underline;
  font-weight: 600;
}

/* Base Card Style */
.card {
  background: var(--color-bg-surface);
  border: none;
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.07);
  transition: box-shadow 0.18s;
}

.card:hover {
  box-shadow: 0 4px 28px rgba(0,0,0,0.10);
}

.form-group {
  margin-bottom: 16px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-group.half {
  flex: 1;
}

label {
  display: block;
  font-size: 11px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

input[type="number"], select {
  width: 100%;
  background: var(--color-bg-base);
  border: 1.5px solid var(--color-border);
  color: var(--text-main);
  padding: 12px 16px;
  border-radius: 9999px;
  font-family: 'Outfit', 'Noto Sans JP', sans-serif;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.18s, background 0.18s;
  text-align: center;
}

input:focus, select:focus {
  border-color: var(--accent);
  background: var(--bg-color);
}

/* Toggle Switch */
.toggle-container {
  display: flex;
  background: var(--color-bg-muted);
  border-radius: 9999px;
  padding: 3px;
  border: 1px solid var(--color-border);
}

.toggle-container input[type="radio"] {
  display: none;
}

.toggle-btn {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  margin: 0;
  color: var(--color-text-muted);
  border-radius: 9999px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.toggle-container input[type="radio"]:checked + .toggle-btn {
  background: var(--bg-color);
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.post-brew-controls {
  width: 100%;
}
.post-brew-controls.hidden {
  display: none;
}

.login-benefit-message {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--color-primary-mid);
  border-radius: 10px;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.5;
}

.login-benefit-message--compact {
  margin: 8px 0 0;
  padding: 8px 10px;
  font-size: 0.8rem;
}

body.is-authenticated .login-benefit-message {
  display: none;
}

/* Evaluation Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 1;
  transition: opacity 0.3s;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  background: var(--bg-color);
  width: 90%;
  max-width: 400px;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.1);
  transform: translateY(0);
  transition: transform 0.3s;
}

.modal-overlay.hidden .modal-card {
  transform: translateY(20px);
}

.eval-section label {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
}

.eval-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.feedback-card {
  animation: slideUp 0.3s ease-out;
  margin-top: 20px;
  padding: 12px;
  border-radius: 8px;
  background: #f8f9fa;
  border-left: 4px solid #8d6e63;
  font-size: 0.9rem;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.eval-btn {
  background: var(--color-bg-muted);
  border: 1.5px solid var(--color-border);
  color: var(--color-text-secondary);
  padding: 12px 4px;
  font-size: 0.8rem;
  text-align: center;
  border-radius: 9999px;
  transition: all 0.18s;
}

.eval-btn.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

/* History List */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  flex: 1;
}

.history-item {
  background: var(--color-bg-muted);
  border: 1px solid var(--color-border);
  padding: 12px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.history-item-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

.history-badge {
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 12px;
  font-weight: 600;
  display: inline-block;
}

.history-badge.unevaluated {
  background: #E2E8F0;
  color: #475569;
}

.history-badge.evaluated {
  background: #FEF3C7;
  color: #92400E;
}

.history-eval-btn {
  background: var(--bg-color);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 8px;
  font-size: 0.85rem;
  width: 100%;
  margin-top: 4px;
}

button {
  cursor: pointer;
  border: none;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  border-radius: 9999px;
  transition: all 0.18s ease;
}

.primary-btn {
  width: 100%;
  padding: 18px 36px;
  background: var(--color-primary);
  color: #ffffff;
  border-radius: 9999px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: var(--shadow-cta);
}

.primary-btn:active {
  transform: scale(0.98);
  box-shadow: none;
}

.secondary-btn {
  padding: 10px 18px;
  background: var(--color-bg-muted);
  color: #333333;
  border: none;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
}

.icon-btn {
  background: none;
  color: var(--text-main);
  padding: 8px;
}

.timer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -20px -20px 16px -20px;
  padding: 16px 20px;
  background-color: var(--color-bg-base);
  border-bottom: 1px solid var(--color-border);
}

.timer-header span {
  font-weight: 600;
}

/* Timer Screen */
.timer-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 32px 0;
}

.circular-progress {
  position: relative;
  width: 240px;
  height: 240px;
}

.circular-progress svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.circular-progress circle {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
}

.circular-progress .bg {
  stroke: var(--bg-secondary);
}

.circular-progress .progress {
  stroke: var(--accent);
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  transition: stroke-dashoffset 1s linear;
}

.timer-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

#time-display {
  font-size: 3.5rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  line-height: 1;
  color: var(--color-text-primary);
  letter-spacing: -0.5px;
}

#total-time-display {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 8px;
  font-family: 'Outfit', sans-serif;
}

.step-info {
  text-align: center;
  margin-bottom: 24px;
  padding: 24px 20px;
}

.step-info h2 {
  font-size: 1.2rem;
  margin-bottom: 4px;
  color: var(--text-main);
  font-weight: 600;
}

.step-info p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

/* ステップカード内の数値ゾーン: 「このステップの量」と「スケールの目標値」を1行で読ませる */
.step-target-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  margin: 10px 0 2px;
  background: var(--color-bg-muted);
  border-radius: 8px;
}
.step-target-row p {
  margin-bottom: 0;
  text-align: left;
}
.step-target {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-shrink: 0;
}
.step-target .label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}
.step-target strong {
  font-size: 2rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.5px;
}

/* Tips section */
.tips-box {
  border-top: 1px dashed var(--border-color);
  padding-top: 16px;
  text-align: left;
}

.tips-header {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
}

#current-step-tip {
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.5;
  margin-bottom: 0;
  text-align: left;
}

.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  position: fixed;
  bottom: var(--pwa-offset, 0);   /* PWAバナー表示中はその分だけ上へ退避（被り防止） */
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  padding: 16px 20px 32px 20px;
  background: transparent;
  pointer-events: none;
  z-index: 10;
  transition: bottom 0.2s ease;
}

.controls > * {
  pointer-events: auto;
}

.brew-controls {
  gap: 24px;
  justify-content: center;
  align-items: center;
}

.control-spacer {
  width: 56px;
  flex: none;
}

.floating-play-btn {
  background-color: var(--color-primary) !important;
  color: #FFFFFF !important;
  border: none;
  border-radius: 50%;
  box-shadow: var(--shadow-cta) !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.floating-play-btn:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(249,115,22,0.3) !important;
}

.post-brew-controls {
  display: grid;
  gap: 10px;
  width: min(100%, 360px);
  padding: 14px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

/* ログイン状態で表示を出し分ける共通ユーティリティ */
body.is-authenticated .guest-only { display: none !important; }
body:not(.is-authenticated) .auth-only { display: none !important; }

.post-brew-controls {
  display: grid;
  gap: 12px;
}

.login-save-actions {
  display: grid;
  gap: 8px;
}

.login-save-actions .primary-btn,
.login-save-actions .secondary-btn {
  min-height: 48px;
  padding: 12px 10px;
}

.post-brew-note p {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  margin-bottom: 2px;
}

.post-brew-link {
  appearance: none;
  background: none;
  border: none;
  color: var(--color-primary);
  cursor: pointer;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 4px 8px;
  text-decoration: underline;
  text-underline-offset: 3px;
  justify-self: center;
}

.square-btn {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
}

.hidden {
  display: none !important;
}

/* Glossary / Term Links */
.glossary-term {
  border-bottom: 1.5px dotted var(--primary-color);
  color: var(--primary-color);
  cursor: help;
  font-weight: 600;
  padding: 0 2px;
}

.glossary-popover {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  width: 260px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  padding: 16px;
  z-index: 100;
  animation: popIn 0.2s ease-out;
  border: 1px solid var(--border-color);
  pointer-events: auto;
}

.glossary-popover::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -8px;
  border-width: 8px;
  border-style: solid;
  border-color: #ffffff transparent transparent transparent;
}

.popover-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 0.9rem;
}

.popover-body {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-main);
}

@keyframes popIn {
  from { opacity: 0; transform: translateX(-50%) translateY(0); }
  to { opacity: 1; transform: translateX(-50%) translateY(-10px); }
}

/* ===== Phase 1: Extracted Inline Styles ===== */

/* Text / date inputs */
input[type="text"], input[type="date"], input[type="email"], input[type="password"] {
  width: 100%;
  background: var(--color-bg-base);
  border: 1.5px solid var(--color-border);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-size: 12px;
  outline: none;
  transition: border-color 0.18s, background 0.18s;
}

input[type="text"]:focus, input[type="date"]:focus, input[type="email"]:focus, input[type="password"]:focus {
  border-color: var(--accent);
  background: var(--bg-color);
}

textarea {
  width: 100%;
  background: var(--color-bg-base);
  border: 1.5px solid var(--color-border);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  outline: none;
  resize: vertical;
  transition: border-color 0.18s, background 0.18s;
}

textarea:focus {
  border-color: var(--accent);
  background: var(--bg-color);
}

.textarea-sm { height: 60px; }
.textarea-md { height: 80px; }

/* Margin utilities */
.mt-24 { margin-top: 24px; }
.mb-24 { margin-bottom: 24px; }

/* Header helpers */
.header-relative { position: relative; }
.header-corner-btn { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); }

/* History badge: 未評価の抽出数を表示 */
#history-open-btn { position: absolute; }
.history-notification-dot {
  position: absolute;
  top: 0;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #E53E3E;
  border-radius: 9999px;
  border: 2px solid var(--bg-color);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
  pointer-events: none;
}

/* Advanced Settings panel (styles merged with .method-explanation above) */

.settings-body {
  padding: 16px;
  background: var(--bg-color);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.grind-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Footer */
.footer-copy {
  text-align: center;
  padding: 24px 0 32px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Modal helpers */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-title { margin: 0; }
.modal-close { padding: 0; }

.header-auth-btn {
  left: 20px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.auth-card {
  max-width: 420px;
}

.auth-description {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.7;
  margin-top: 6px;
}

.auth-form {
  display: grid;
  gap: 18px;
}

.auth-form label {
  display: block;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.auth-form input {
  width: 100%;
}

.auth-form .primary-btn {
  margin-top: 4px;
}

.auth-password-hint {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.6;
  margin-top: 8px;
}

.auth-message {
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 14px;
  padding: 10px 12px;
}

.auth-message.error {
  background: #fef2f2;
  color: #b91c1c;
}

.auth-message.success {
  background: #ecfdf5;
  color: #047857;
}

.auth-links {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  text-align: center;
}

.auth-links button {
  appearance: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* お気に入り誘導モーダル (#fav-auth-modal): 説明文と CTA の間に呼吸を置く */
#fav-auth-modal .auth-description {
  margin: 2px 0 20px;
}

/* アカウントモードの設定ブロック（メール変更・パスワード変更・配信設定） */
.account-block {
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}
.account-block label {
  margin-bottom: 10px;
}
.account-block input {
  width: 100%;
}
.account-block .auth-password-hint {
  margin-top: 10px;
}
.account-action-btn {
  width: 100%;
  margin-top: 14px;
  padding: 12px 18px;
  font-size: 0.9rem;
}
.account-optin-note {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.6;
  margin-top: 8px;
  padding-left: 26px;
}

.modal-card--history {
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.modal-card--scrollable {
  max-height: 90vh;
  overflow-y: auto;
}

/* Readonly info block (Edit Modal) */
.readonly-info {
  background: var(--bg-secondary);
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
}

.readonly-info-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.readonly-info-title {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.readonly-info-meta {
  display: flex;
  gap: 16px;
  font-size: 0.9rem;
}

/* Feedback card content */
.feedback-title {
  font-weight: 600;
  margin-bottom: 4px;
  color: #5d4037;
}

/* Eval modal */
.eval-modal-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.eval-section + .eval-section { margin-top: 16px; }

.eval-actions {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.eval-btn-row {
  display: flex;
  gap: 10px;
}

.eval-btn-row .secondary-btn {
  flex: 1;
  font-size: 0.85rem;
}

/* PWA Install Banner */
.pwa-banner {
  position: fixed;
  bottom: 16px;
  bottom: calc(16px + var(--safe-area-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 480px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  z-index: 9999;
  padding: 12px 14px;
}
.pwa-banner-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pwa-banner-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
}
.pwa-banner-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  font-size: 0.85rem;
  line-height: 1.4;
}
.pwa-banner-text strong {
  font-size: 0.9rem;
}
.pwa-banner-btn {
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 9999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}
.pwa-banner-close {
  background: none;
  border: none;
  font-size: 1rem;
  color: #999;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  line-height: 1;
}

/* Section heading */
.section-heading-divider {
  margin-top: 24px;
  margin-bottom: 12px;
  border-bottom: 1px solid #eee;
  padding-bottom: 4px;
}

/* Timer screen */
.back-btn {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.back-chevron {
  font-size: 1.2rem;
  font-weight: 400;
}

.home-btn { margin-bottom: 12px; }

.eval-current-btn {
  width: 100%;
  font-size: 0.85rem;
  color: var(--text-muted);
  justify-content: center;
}

/* History item content */
.history-date {
  font-size: 0.8rem;
  color: #666;
}

.history-actions {
  display: flex;
  align-items: center;
}

.history-overall-icon {
  font-size: 1.2rem;
  margin-right: 12px;
}

.edit-history-btn {
  background: none;
  border: none;
  color: #4CAF50;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  margin-right: 12px;
}

.delete-history-btn {
  background: none;
  border: none;
  color: #f44336;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.history-meta {
  font-size: 0.85rem;
  color: #555;
}

.history-eval-box {
  font-size: 0.75rem;
  color: #555;
  background: #fff;
  padding: 6px;
  border-radius: 4px;
  border: 1px solid #eee;
}

.history-eval-memo {
  margin-top: 4px;
  border-top: 1px dashed #ddd;
  padding-top: 4px;
  color: #444;
}

.history-unevaluated {
  font-size: 0.75rem;
  color: #888;
}

.history-empty {
  color: var(--color-text-muted);
  text-align: center;
  margin-top: 24px;
}

/* ── Design Token 追加仕上げ ───────────────────────── */

/* placeholder 色を textMuted に統一 */
::placeholder { color: var(--color-text-muted); }

/* focus-visible のアウトラインを primary に統一 */
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* slider accent */
input[type="range"] { accent-color: var(--color-primary); }

/* インタラクション要素に transition 統一 */
input, select, textarea, button { transition: all 0.18s; }

/* header-corner-btn を padding に合わせて調整 */
.header-corner-btn { right: 20px; }

/* =====================================================================
   EasyDrip トップ画面リデザイン (ed-*)  — 末尾追記のみ / 既存ルール不変更
   既存の入力要素は app.js が参照し続けるため display:none で隠すだけ
   ===================================================================== */

/* app.js と新UIの状態ブリッジは常に非表示 */
#setup-state-bridge { display: none !important; }

/* --- ルートと共通 --- */
#ed-root { display: block; }
.ed-boot {
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  text-align: center;
}
.ed-boot-error { color: #b91c1c; }
.ed-section { margin-bottom: 14px; }
.ed-label {
  font-size: 0.625rem; font-weight: 700; color: var(--color-text-muted);
  letter-spacing: 0.18em; text-transform: uppercase; display: block; margin-bottom: 8px;
}
.ed-card {
  background: var(--color-bg-surface); border-radius: 20px; padding: 20px;
  margin-bottom: 12px; box-shadow: var(--shadow-card);
}
.ed-num { font-family: 'Outfit', sans-serif; }

/* --- モードトグル --- */
.ed-mode {
  display: flex; background: var(--color-bg-muted); border-radius: 9999px;
  padding: 3px; border: 1px solid var(--color-border);
}
.ed-mode button {
  flex: 1; padding: 9px 0; border-radius: 9999px; border: none; cursor: pointer;
  font-weight: 600; font-size: 0.875rem; font-family: inherit; background: transparent;
  color: var(--color-text-muted); transition: all 0.2s;
}
.ed-mode button.active {
  background: var(--color-bg-surface); color: var(--color-text-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* --- レシピカルーセル --- */
.ed-carousel {
  display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.ed-carousel::-webkit-scrollbar { display: none; }
.ed-reccard {
  flex-shrink: 0; width: 158px; padding: 13px 14px 12px; border-radius: 16px;
  position: relative; background: var(--color-bg-surface);
  border: 1.5px solid var(--color-border); text-align: left; cursor: pointer;
  font-family: inherit; box-shadow: var(--shadow-card); transition: all 0.2s;
}
.ed-reccard.active { background: var(--color-primary-light); border-color: var(--color-primary); box-shadow: none; }
.ed-reccard-name { font-size: 0.875rem; font-weight: 700; color: var(--color-text-primary); margin-bottom: 2px; padding-right: 36px; line-height: 1.3; }
.ed-reccard.active .ed-reccard-name { color: var(--color-primary); }
.ed-reccard-sub { font-size: 0.625rem; color: var(--color-text-muted); margin-bottom: 10px; font-style: italic; min-height: 0.9em; }
.ed-reccard-tags { display: flex; gap: 5px; }
.ed-reccard-tag { font-size: 0.625rem; font-weight: 600; padding: 3px 8px; border-radius: 9999px; background: var(--color-bg-muted); color: var(--color-text-secondary); white-space: nowrap; }
.ed-reccard.active .ed-reccard-tag.is-drip { background: var(--color-primary); color: #fff; }
.ed-badge { position: absolute; top: 10px; right: 10px; font-size: 0.5625rem; font-weight: 700; padding: 2px 7px; border-radius: 9999px; }
.ed-badge.pinned { color: var(--color-primary); background: var(--color-primary-mid); }
.ed-badge.mine { color: #7c3aed; background: #ede9fe; }
.ed-badge.last { color: var(--color-text-muted); background: var(--color-bg-muted); }
.ed-recadd {
  flex-shrink: 0; width: 88px; padding: 13px 10px; border-radius: 16px;
  border: 1.5px dashed var(--color-border); background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  font-family: inherit; color: var(--color-text-muted);
}
.ed-recadd.guard { border-color: var(--color-primary); background: var(--color-primary-light); color: var(--color-primary); }
.ed-recadd .ed-plus { font-size: 1.375rem; line-height: 1; }
.ed-recadd span:last-child { font-size: 0.625rem; font-weight: 700; text-align: center; line-height: 1.3; }

/* --- ValueRail --- */
.ed-rail-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 2px; }
.ed-rail-controls { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ed-rail-stepper {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--color-border);
  background: var(--color-bg-app); color: var(--color-text-secondary);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.25rem; font-weight: 700; line-height: 1; cursor: pointer;
  user-select: none; touch-action: manipulation;
}
.ed-rail-stepper:active { background: var(--color-primary-light); color: var(--color-primary); border-color: var(--color-primary); }
.ed-rail-stepper:disabled { opacity: 0.35; cursor: default; }
.ed-rail-value { background: none; border: none; cursor: text; padding: 0; display: flex; align-items: baseline; gap: 2px; font-family: inherit; }
.ed-rail-num { font-size: 2.25rem; font-weight: 800; font-family: 'Outfit', sans-serif; color: var(--color-text-primary); letter-spacing: 0; line-height: 1; }
.ed-rail-unit { font-size: 0.8125rem; color: var(--color-text-muted); }
.ed-rail-input {
  width: 90px; font-size: 2.125rem; font-weight: 800; font-family: 'Outfit', sans-serif;
  color: var(--color-primary); border: none; border-bottom: 2px solid var(--color-primary);
  background: transparent; text-align: right; outline: none; padding: 0 0 2px;
}
/* スライダー式レール: track 全体がドラッグ・タップの当たり判定。つまみは pointer-events なし */
.ed-rail-track {
  position: relative; height: 56px; cursor: pointer;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.ed-rail-ruler { position: absolute; left: 14px; right: 14px; top: 0; bottom: 0; }
.ed-rail-tick {
  position: absolute; bottom: 6px; width: 2px; height: 8px;
  background: var(--color-border); border-radius: 1px; transform: translateX(-50%);
}
.ed-rail-tick.labeled { height: 12px; }
.ed-rail-tick-num {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  font-size: 0.7rem; font-weight: 500; color: var(--color-text-muted);
  font-family: 'Outfit', sans-serif; line-height: 1;
}
.ed-rail-thumb {
  position: absolute; bottom: 2px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: left 0.12s; pointer-events: none; z-index: 2;
}
.ed-dragging .ed-rail-thumb { transition: none; }
.ed-rail-thumb-num {
  font-size: 1rem; font-weight: 800; color: var(--color-primary);
  font-family: 'Outfit', sans-serif; line-height: 1;
  background: var(--color-bg-surface); padding: 0 3px; border-radius: 3px;
}
.ed-rail-thumb-arrow {
  width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 6px solid var(--color-primary);
}
.ed-rail-thumb-bar { width: 3px; height: 20px; background: var(--color-primary); border-radius: 2px; }
.ed-divider { height: 1px; background: var(--color-border); margin: 18px 0; }

/* --- 比率ピル / 保存バナー --- */
.ed-ratio-row { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.ed-ratio-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 9999px;
  background: var(--color-primary-light); border: 1px solid var(--color-primary-mid);
  cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.ed-ratio-pill.unlocked { background: var(--color-bg-muted); border-color: var(--color-border); }
.ed-ratio-pill svg { width: 12px; height: 12px; }
.ed-ratio-pill-text { font-size: 0.6875rem; font-weight: 700; color: var(--color-primary); }
.ed-ratio-pill.unlocked .ed-ratio-pill-text { color: var(--color-text-muted); }
.ed-save-banner {
  margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #fffbeb; border: 1px solid #fde68a;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.ed-save-banner-text { font-size: 0.6875rem; color: #92400e; line-height: 1.5; }
.ed-save-banner button {
  flex-shrink: 0; padding: 7px 12px; border-radius: 9999px; background: var(--color-primary); color: #fff;
  border: none; font-size: 0.6875rem; font-weight: 700; cursor: pointer; font-family: inherit;
}

/* --- アイス合計 --- */
.ed-ice-total { margin-top: 12px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.ed-ice-total-sub { font-size: 0.6875rem; color: var(--color-text-muted); }
.ed-ice-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 9999px; background: #e0f2fe; }
.ed-ice-pill-label { font-size: 0.6875rem; font-weight: 600; color: #0369a1; }
.ed-ice-pill-num { font-size: 0.875rem; font-weight: 800; font-family: 'Outfit', sans-serif; color: #0c4a6e; }

/* --- 抽出設定カード --- */
.ed-settings-block { margin-bottom: 18px; }
.ed-settings-block:last-child { margin-bottom: 0; }
.ed-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.ed-chip {
  padding: 7px 14px; border-radius: 9999px; border: 1.5px solid var(--color-border);
  background: var(--color-bg-surface); color: var(--color-text-secondary); font-size: 0.75rem;
  font-weight: 600; cursor: pointer; white-space: nowrap; font-family: inherit; transition: all 0.15s;
}
.ed-chip.active { border-color: var(--color-primary); background: var(--color-primary-light); color: var(--color-primary); }
.ed-chip.dashed { border-style: dashed; color: var(--color-text-muted); }
.ed-chip.guard { border-style: dashed; border-color: var(--color-primary); color: var(--color-primary); background: var(--color-primary-light); }
.ed-grind-seg { display: flex; gap: 6px; }
.ed-grind-seg button {
  flex: 1; padding: 12px 0; border-radius: 12px; border: 1.5px solid var(--color-border);
  background: var(--color-bg-surface); color: var(--color-text-secondary); font-size: 0.75rem;
  font-weight: 700; cursor: pointer; font-family: inherit; transition: all 0.15s;
}
.ed-grind-seg button.active { border-color: var(--color-primary); background: var(--color-primary); color: #fff; }
.ed-mill-list { display: flex; flex-direction: column; gap: 7px; }
.ed-mill-item {
  padding: 11px 14px; border-radius: 12px; font-family: inherit; text-align: left; cursor: pointer;
  background: var(--color-bg-base); border: 1.5px solid var(--color-border); color: var(--color-text-primary);
  font-size: 0.8125rem; font-weight: 600; transition: all 0.15s;
}
.ed-mill-item.active { background: var(--color-primary-light); border-color: var(--color-primary); color: var(--color-primary); }
.ed-mill-add { border-style: dashed; color: var(--color-text-muted); background: transparent; font-size: 0.75rem; }

/* --- 今日の豆 --- */
.ed-bean-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ed-bean-change { background: none; border: none; color: var(--color-primary); font-size: 0.75rem; font-weight: 700; cursor: pointer; font-family: inherit; padding: 0; }
.ed-bean-row {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px;
  background: var(--color-primary-light); border: 1.5px solid var(--color-primary); cursor: pointer;
  text-align: left; font-family: inherit;
}
.ed-bean-empty {
  width: 100%; padding: 14px; border-radius: 14px; border: 1.5px dashed var(--color-border);
  background: transparent; color: var(--color-text-secondary); font-size: 0.8125rem; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.ed-bean-name { font-size: 0.9375rem; font-weight: 700; color: var(--color-text-primary); margin-bottom: 4px; }
.ed-bean-shop { font-size: 0.6875rem; color: var(--color-text-secondary); }
.ed-roast-badge { display: inline-block; padding: 3px 8px; border-radius: 9999px; font-size: 0.625rem; font-weight: 700; flex-shrink: 0; }
.ed-roast-light { background: #fff7ed; color: #ea580c; }
.ed-roast-medium { background: #fef3c7; color: #b45309; }
.ed-roast-dark { background: #efe6df; color: #7c4a2d; }

/* --- 固定CTA --- */
.ed-cta-bar {
  position: fixed; bottom: var(--pwa-offset, 0); left: 50%; transform: translateX(-50%); width: 100%; max-width: 430px;
  padding: 16px 16px calc(28px + var(--safe-area-bottom)); z-index: 50; pointer-events: none;
  background: linear-gradient(to top, var(--color-bg-base) 72%, transparent);
  transition: bottom 0.2s ease;
}
.ed-cta {
  width: 100%; padding: 18px; background: var(--color-primary); color: #fff; border: none;
  border-radius: 9999px; font-size: 1rem; font-weight: 700; letter-spacing: 0.02em;
  box-shadow: var(--shadow-cta); cursor: pointer; font-family: inherit; pointer-events: auto; transition: opacity 0.2s;
}
.ed-cta:disabled { opacity: 0.45; cursor: not-allowed; }
#ed-root { padding-bottom: 96px; }

/* --- ActionModal --- */
.ed-modal-overlay {
  position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center;
  padding: 0 24px; background: rgba(0,0,0,0.48); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity 0.22s;
}
.ed-modal-overlay.open { opacity: 1; pointer-events: auto; }
.ed-modal {
  width: 100%; max-width: 360px; background: var(--color-bg-surface); border-radius: 22px;
  padding: 28px 24px 22px; box-shadow: 0 8px 40px rgba(0,0,0,0.22);
  transform: scale(0.96) translateY(8px); transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
.ed-modal-overlay.open .ed-modal { transform: scale(1) translateY(0); }
.ed-modal-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--color-primary-light); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.ed-modal-icon svg { width: 22px; height: 22px; }
.ed-modal-title { font-size: 1rem; font-weight: 700; color: var(--color-text-primary); margin-bottom: 8px; line-height: 1.4; }
.ed-modal-body { font-size: 0.8125rem; color: var(--color-text-secondary); line-height: 1.7; margin: 0 0 24px; }
.ed-modal-primary { width: 100%; padding: 18px; background: var(--color-primary); color: #fff; border: none; border-radius: 9999px; font-size: 0.9375rem; font-weight: 700; cursor: pointer; font-family: inherit; box-shadow: var(--shadow-cta); margin-bottom: 10px; }
.ed-modal-secondary { width: 100%; padding: 13px; background: transparent; color: var(--color-text-secondary); border: 1.5px solid var(--color-border); border-radius: 9999px; font-size: 0.875rem; font-weight: 600; cursor: pointer; font-family: inherit; }

/* --- ボトムシート（豆/レシピ登録） --- */
.ed-sheet-overlay {
  position: fixed; inset: 0; z-index: 320; background: rgba(0,0,0,0.45); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity 0.25s; display: flex; align-items: flex-end;
}
.ed-sheet-overlay.open { opacity: 1; pointer-events: auto; }
.ed-sheet {
  width: 100%; max-width: 430px; margin: 0 auto; background: var(--color-bg-surface);
  border-radius: 22px 22px 0 0; transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32,0.72,0,1); max-height: 86vh; overflow-y: auto;
  padding: 0 20px calc(40px + var(--safe-area-bottom));
}
.ed-sheet-overlay.open .ed-sheet { transform: translateY(0); }
.ed-sheet-grip { display: flex; justify-content: center; padding: 12px 0 4px; }
.ed-sheet-grip span { width: 36px; height: 4px; border-radius: 2px; background: var(--color-border); }
.ed-sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 0 18px; border-bottom: 1px solid var(--color-border); margin-bottom: 20px; }
.ed-sheet-title { font-size: 1.0625rem; font-weight: 700; color: var(--color-text-primary); }
.ed-sheet-close { background: none; border: none; font-size: 1.25rem; color: var(--color-text-muted); cursor: pointer; font-family: inherit; padding: 4px; line-height: 1; }
.ed-field { margin-bottom: 16px; }
.ed-field label { display: block; }
.ed-input {
  width: 100%; padding: 12px 16px; border-radius: 12px; border: 1.5px solid var(--color-border);
  background: var(--color-bg-base); font-size: 0.875rem; color: var(--color-text-primary);
  font-family: inherit; outline: none; box-sizing: border-box;
}
.ed-input:focus { border-color: var(--color-primary); }
.ed-sheet .ed-cta { position: static; box-shadow: var(--shadow-cta); }
.ed-bean-pick {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px;
  background: var(--color-bg-base); border: 1.5px solid var(--color-border); cursor: pointer;
  text-align: left; font-family: inherit; margin-bottom: 10px; transition: all 0.18s;
}
.ed-bean-pick.active { background: var(--color-primary-light); border-color: var(--color-primary); }
.ed-sheet-note { padding: 12px 14px; border-radius: 12px; background: var(--color-bg-muted); margin-bottom: 20px; font-size: 0.75rem; color: var(--color-text-secondary); line-height: 1.6; }

/* ── 規約リンク・同意チェック ─────────────────────── */
.footer-copy a {
  color: var(--color-text-secondary);
  text-decoration: underline;
}

.auth-form .auth-consent-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.5;
  cursor: pointer;
}

.auth-consent-label input[type="checkbox"] {
  width: auto;
  margin: 3px 0 0;
  accent-color: var(--color-primary);
}

.auth-consent-label a {
  color: var(--color-primary);
}

/* --- 規約再同意モーダル (#consent-modal) --- */
.consent-card .modal-title {
  line-height: 1.4;
  margin-bottom: 6px;
}

.consent-check-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.5;
  margin: 16px 0 14px;
  cursor: pointer;
}

.consent-card .primary-btn:disabled {
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.45;
}

.consent-hint {
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.5;
  margin-top: 14px;
}

/* =====================================================================
   おまかせスタート / 前回のアドバイス (ed-tab*, ed-quick*, ed-advice*)
   ===================================================================== */

/* --- タブ（おまかせ / こだわり）--- */
.ed-tabbar {
  display: flex; background: var(--color-bg-muted); border-radius: 9999px;
  padding: 3px; border: 1px solid var(--color-border); margin-bottom: 16px;
}
.ed-tab {
  flex: 1; padding: 10px 0; border-radius: 9999px; border: none; cursor: pointer;
  font-weight: 700; font-size: 0.875rem; font-family: inherit; background: transparent;
  color: var(--color-text-muted); transition: all 0.2s;
}
.ed-tab.active {
  background: var(--color-bg-surface); color: var(--color-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* --- おまかせパネル --- */
.ed-quick-seg { display: flex; gap: 8px; }
.ed-quick-opt {
  flex: 1; padding: 12px 4px; border-radius: 14px; border: 1.5px solid var(--color-border);
  background: var(--color-bg-surface); cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 3px; transition: all 0.15s;
}
.ed-quick-opt-label { font-size: 0.875rem; font-weight: 700; color: var(--color-text-primary); }
.ed-quick-opt-sub { font-size: 0.625rem; color: var(--color-text-muted); }
.ed-quick-opt.active { border-color: var(--color-primary); background: var(--color-primary-light); }
.ed-quick-opt.active .ed-quick-opt-label { color: var(--color-primary); }
.ed-quick-recipe-name { font-size: 1.0625rem; font-weight: 700; color: var(--color-text-primary); margin-bottom: 6px; }
.ed-quick-why { font-size: 0.8125rem; color: var(--color-text-secondary); line-height: 1.7; margin: 0 0 14px; }
.ed-quick-rows { border-top: 1px solid var(--color-border); }
.ed-quick-row { padding: 11px 0; border-bottom: 1px solid var(--color-border); }
.ed-quick-row:last-child { border-bottom: none; padding-bottom: 0; }
.ed-quick-row-main { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ed-quick-row-label { font-size: 0.8125rem; font-weight: 600; color: var(--color-text-secondary); }
.ed-quick-row-val { font-size: 1rem; font-weight: 800; font-family: 'Outfit', 'Noto Sans JP', sans-serif; color: var(--color-text-primary); }
.ed-quick-row-hint { font-size: 0.6875rem; color: var(--color-text-muted); margin-top: 3px; line-height: 1.5; }
.ed-quick-more {
  display: block; width: 100%; background: none; border: none; cursor: pointer; font-family: inherit;
  color: var(--color-text-secondary); font-size: 0.75rem; font-weight: 600; padding: 4px 0 8px;
  text-decoration: underline; text-underline-offset: 3px;
}

/* --- 前回のアドバイスカード --- */
.ed-advice {
  background: var(--color-primary-light); border: 1.5px solid var(--color-primary-mid);
  border-radius: 20px; padding: 16px 18px; margin-bottom: 14px;
}
.ed-advice-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.ed-advice-title { font-size: 0.8125rem; font-weight: 700; color: var(--color-primary-dark); line-height: 1.5; }
.ed-advice-close {
  background: none; border: none; color: var(--color-text-muted); cursor: pointer;
  font-size: 0.875rem; padding: 2px; line-height: 1; font-family: inherit; flex-shrink: 0;
}
.ed-advice-body { font-size: 0.8125rem; color: var(--color-text-secondary); line-height: 1.7; margin: 0 0 10px; }
.ed-advice-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ed-advice-chip {
  font-size: 0.6875rem; font-weight: 700; padding: 4px 10px; border-radius: 9999px;
  background: var(--color-bg-surface); color: var(--color-primary-dark); border: 1px solid var(--color-primary-mid);
}
.ed-advice-apply {
  width: 100%; padding: 12px; border: none; border-radius: 9999px; cursor: pointer;
  background: var(--color-primary); color: #fff; font-size: 0.875rem; font-weight: 700; font-family: inherit;
}

/* =====================================================================
   注ぎガイド（真上視点のドリッパー）+ 水位ゲージ (bv-*) — js/brew-visual.js
   ===================================================================== */
.bv-root { text-align: center; padding: 4px 0 0; }
.bv-root svg { width: 100%; max-width: 320px; height: auto; display: block; margin: 0 auto; }
.bv-caption { font-size: 0.8125rem; font-weight: 700; color: var(--color-text-primary); margin-top: 6px; }
.bv-hint { font-size: 0.75rem; color: var(--color-text-secondary); margin-top: 3px; line-height: 1.6; }
.bv-ghost {
  display: flex; align-items: baseline; justify-content: center; gap: 8px;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--color-border);
}
.bv-ghost-label { font-size: 0.6875rem; font-weight: 700; color: var(--color-text-muted); }
.bv-ghost-val { font-size: 1.5rem; font-weight: 800; font-family: 'Outfit', sans-serif; color: var(--color-primary); line-height: 1; }
.bv-ghost-target { font-size: 0.6875rem; color: var(--color-text-muted); }

/* 属性変更（濡れ広がり・水面・水位）を滑らかに補間 */
#bv-wet, #bv-sheen { transition: r 0.3s linear; }
#bv-gauge { transition: y 0.25s linear, height 0.25s linear; }

/* モードごとの表示制御（軌道そのものは JS の rAF が描く） */
#bv-sheen, #bv-vortex, #bv-spoon { display: none; }
.bv-mode-wait #bv-sheen, .bv-mode-release #bv-sheen { display: inline; }
.bv-mode-release #bv-vortex { display: inline; }
.bv-mode-agitate #bv-spoon { display: inline; }
.bv-mode-wait #bv-dot, .bv-mode-release #bv-dot, .bv-mode-agitate #bv-dot,
.bv-mode-done #bv-dot { display: none; }

/* 一気に注ぐ・中心注ぎ: 中央固定のドットが脈打つ */
.bv-mode-dump #bv-dot circle:first-child,
.bv-mode-center #bv-dot circle:first-child {
  animation: bv-pulse 1s ease-in-out infinite;
  transform-box: fill-box; transform-origin: center;
}
@keyframes bv-pulse {
  0%, 100% { transform: scale(1); opacity: 0.35; }
  50% { transform: scale(1.6); opacity: 0.12; }
}

/* 蒸らしのガスの泡（bloom ステップのみ） */
.bv-bub { opacity: 0; transform-box: fill-box; transform-origin: center; }
.bv-bloom .bv-bub { animation: bv-pop 2.2s ease-in-out infinite; }
.bv-bloom .bv-bub-1 { animation-delay: 0.7s; }
.bv-bloom .bv-bub-2 { animation-delay: 1.4s; }
@keyframes bv-pop {
  0%, 100% { opacity: 0; transform: scale(0.5); }
  40% { opacity: 0.85; transform: scale(1.1); }
  65% { opacity: 0.4; transform: scale(1); }
}

/* 一時停止中はCSSアニメも停止（軌道のrAFはJS側で停止する） */
.bv-paused .bv-bub, .bv-paused #bv-dot circle:first-child { animation-play-state: paused; }

/* モーション低減設定を尊重 */
@media (prefers-reduced-motion: reduce) {
  .bv-root * { animation: none !important; }
}

/* =====================================================================
   履歴の資産化（統計・前回比・マイレシピ化）+ 豆の鮮度/残量
   ===================================================================== */
.history-stats {
  display: flex; gap: 18px; justify-content: center; align-items: baseline;
  background: var(--color-bg-muted); border-radius: 14px; padding: 12px 16px; margin-bottom: 14px;
  font-size: 0.8125rem; color: var(--color-text-secondary);
}
.history-stats strong { font-family: 'Outfit', sans-serif; font-size: 1.125rem; color: var(--color-text-primary); margin: 0 2px; }
.history-diff {
  display: flex; flex-wrap: wrap; gap: 5px; align-items: center;
  font-size: 0.6875rem; color: var(--color-text-muted); margin: 6px 0 2px;
}
.history-diff span {
  background: var(--color-primary-light); color: var(--color-primary-dark);
  border: 1px solid var(--color-primary-mid); border-radius: 9999px;
  padding: 2px 8px; font-weight: 700;
}
.save-recipe-btn {
  background: none; border: none; cursor: pointer; font-size: 1rem;
  color: var(--color-primary); padding: 2px 6px; line-height: 1;
}
.ed-bean-meta { font-size: 0.6875rem; color: var(--color-text-muted); margin-top: 4px; }
.ed-bean-restock {
  display: block; text-align: center; margin-top: 10px; padding: 10px;
  border-radius: 12px; background: var(--color-primary-light);
  border: 1px solid var(--color-primary-mid);
  color: var(--color-primary-dark); font-size: 0.75rem; font-weight: 700;
  text-decoration: none;
}

/* --- 豆の編集導線 --- */
.ed-bean-pick-edit {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--color-border); background: var(--color-bg-surface);
  color: var(--color-text-muted); font-size: 0.9375rem; cursor: pointer; font-family: inherit;
}
.ed-bean-editbtn {
  display: block; width: 100%; margin-top: 8px; padding: 10px;
  border-radius: 12px; border: 1.5px dashed var(--color-border); background: none;
  color: var(--color-text-secondary); font-size: 0.75rem; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.ed-bean-delete {
  display: block; width: 100%; margin-top: 12px; padding: 10px;
  border: none; background: none; color: #dc2626;
  font-size: 0.8125rem; font-weight: 700; cursor: pointer; font-family: inherit;
}

/* --- レシピの表示切替（カード ⇄ 一覧） --- */
.ed-rec-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.ed-rec-viewtoggle {
  background: none; border: 1px solid var(--color-border); border-radius: 9999px;
  padding: 5px 12px; font-size: 0.6875rem; font-weight: 700; color: var(--color-text-secondary);
  cursor: pointer; font-family: inherit;
}
.ed-reclist { display: flex; flex-direction: column; gap: 8px; }
.ed-reclist .ed-reccard { width: 100%; }
.ed-reclist .ed-recadd { width: 100%; flex-direction: row; padding: 12px; gap: 8px; }
.ed-reclist .ed-recadd span:last-child { font-size: 0.75rem; }

/* --- 抽出完了後のワンタップ評価（豆の再購入・レシピお気に入り） --- */
.post-quick {
  background: var(--color-bg-surface); border-radius: 16px; padding: 14px 16px;
  box-shadow: var(--shadow-card); display: grid; gap: 12px;
}
.post-quick-row { display: grid; gap: 8px; }
.post-quick-label { font-size: 0.8125rem; font-weight: 700; color: var(--color-text-primary); text-align: center; }
.post-quick-seg { display: flex; gap: 6px; }
.post-quick-seg button {
  flex: 1; padding: 10px 2px; border-radius: 12px; border: 1.5px solid var(--color-border);
  background: var(--color-bg-surface); font-size: 0.75rem; font-weight: 600;
  color: var(--color-text-secondary); cursor: pointer; font-family: inherit;
}
.post-quick-seg button.active {
  border-color: var(--color-primary); background: var(--color-primary-light); color: var(--color-primary);
}
.post-fav-btn {
  width: 100%; padding: 11px; border-radius: 12px; border: 1.5px solid var(--color-border);
  background: var(--color-bg-surface); font-size: 0.8125rem; font-weight: 700;
  color: var(--color-text-secondary); cursor: pointer; font-family: inherit;
}
.post-fav-btn.active { border-color: #e11d48; background: #fff1f2; color: #e11d48; }
.post-adjust-btn {
  width: 100%; padding: 10px; border: none; background: none; cursor: pointer; font-family: inherit;
  font-size: 0.8125rem; font-weight: 600; color: var(--color-text-secondary);
  text-decoration: underline; text-underline-offset: 3px;
}

/* --- レシピカードのお気に入りハート --- */
.ed-reccard { cursor: pointer; }
.ed-reccard-fav {
  position: absolute; bottom: 8px; right: 8px;
  width: 30px; height: 30px; border-radius: 50%; border: none;
  background: transparent; color: var(--color-text-muted);
  font-size: 1rem; line-height: 1; cursor: pointer; font-family: inherit;
}
.ed-reccard-fav.on { color: #e11d48; }
