/* ============================================================
   habit-counter v0.2 — リデザイン版
   コンセプト：やさしい・達成感・継続しやすい・視認性・前向き
   主軸：ミントグリーン #4CCB9A / フォント：M PLUS Rounded 1c
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@400;500;700;800;900&display=swap');

:root {
  /* === カラーパレット（仕様書） === */
  --mint: #4CCB9A;
  --mint-deep: #36AE82;
  --mint-light: #C1EBD7;
  --mint-bg: #E8F8F0;

  --sky: #63B7F6;
  --sky-light: #D2E8FC;
  --sky-bg: #EAF4FE;

  --apricot: #FF9F4D;
  --apricot-light: #FFE0C2;
  --apricot-bg: #FFF1E0;

  --yellow: #FFD166;
  --yellow-light: #FFEBB8;

  --pink: #FF6B88;
  --pink-light: #FFD2DC;
  --pink-bg: #FFEEF1;

  --lavender: #A78BFA;
  --lavender-light: #DCD0FF;
  --lavender-bg: #F2EDFE;

  --cream: #FFF7EF;
  --white: #FFFFFF;

  --text: #2D2D2D;
  --text-muted: #7A7A7A;
  --text-light: #B0B0B0;

  --shadow-sm: 0 2px 10px rgba(76, 203, 154, 0.10);
  --shadow-md: 0 6px 20px rgba(76, 203, 154, 0.14);
  --shadow-lg: 0 12px 36px rgba(76, 203, 154, 0.18);
  --shadow-warm: 0 4px 16px rgba(255, 159, 77, 0.12);

  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 36px;
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow-x: hidden;
}

body {
  background: #FFFFFF;
  color: var(--text);
  font-family: 'M PLUS Rounded 1c', -apple-system, BlinkMacSystemFont,
    "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
  padding-bottom: env(safe-area-inset-bottom, 0);
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 16px 100px;
  min-height: 100vh;
}

button {
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ===== Screen ===== */
.screen { animation: fadeIn 0.3s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Greeting Header (ホーム) ===== */
.greeting-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 4px 20px;
  gap: 12px;
}
.greeting-text {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
}
.greeting-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 2px;
}
.bell-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

/* ===== Page Header (他画面) ===== */
.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 4px 20px;
}
.screen-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
  letter-spacing: 0.5px;
  color: var(--text);
}

/* ===== Hero Card with Circular Counter ===== */
.hero-card {
  position: relative;
  background: linear-gradient(180deg, #F0FAF5 0%, #E8F4FE 60%, #FFF7EF 100%);
  border-radius: var(--radius-xl);
  padding: 32px 20px 28px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}

/* 植物・木のSVG背景装飾 */
.hero-decor {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  width: 100%;
  height: 80px;
  pointer-events: none;
  z-index: 0;
}
.hero-clouds {
  position: absolute;
  top: 12px; right: 16px;
  font-size: 18px;
  opacity: 0.6;
  z-index: 0;
}
.hero-mode-label {
  position: relative;
  z-index: 1;
  display: inline-block;
  font-size: 13px;
  font-weight: 800;
  color: var(--mint-deep);
  background: var(--white);
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 8px;
  box-shadow: 0 2px 6px rgba(76, 203, 154, 0.15);
}
.habit-hint {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  font-weight: 600;
}

/* 円形カウンター */
.counter-ring {
  position: relative;
  width: 200px; height: 200px;
  margin: 8px auto 12px;
  z-index: 1;
}
.counter-ring svg {
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}
.counter-ring-bg {
  fill: var(--white);
  stroke: var(--mint-light);
  stroke-width: 8;
}
.counter-ring-fg {
  fill: none;
  stroke: var(--mint);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.counter-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.counter-days {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.counter-num {
  font-size: 64px;
  font-weight: 900;
  color: var(--mint);
  line-height: 1;
  letter-spacing: -1px;
}
.counter-unit {
  font-size: 24px;
  font-weight: 800;
  color: var(--mint-deep);
}
.counter-sub {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
}

.streak-badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--mint);
  color: white;
  font-size: 12px;
  font-weight: 800;
  border-radius: 999px;
  margin-top: 4px;
  box-shadow: 0 2px 8px rgba(76, 203, 154, 0.3);
}

.hero-times {
  position: relative;
  z-index: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin-top: 8px;
}

/* ===== Generic Card ===== */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
}

/* ===== Milestone Progress Card ===== */
.milestone-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
}
.milestone-icon {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.milestone-body { flex: 1; }
.milestone-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.milestone-target {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin: 2px 0 8px;
}
.progress-bar {
  width: 100%;
  height: 10px;
  background: var(--mint-bg);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--mint), var(--mint-deep));
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.milestone-percent {
  font-size: 11px;
  font-weight: 800;
  color: var(--mint-deep);
  text-align: right;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

/* ===== Primary / Secondary Buttons ===== */
.btn-primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  background: linear-gradient(135deg, var(--mint), var(--mint-deep));
  color: white;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(76, 203, 154, 0.30);
  margin-bottom: 10px;
  transition: transform 0.12s, box-shadow 0.12s;
}
.btn-primary:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(76, 203, 154, 0.25);
}
.btn-primary-sub {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.9;
  margin-top: 2px;
}
.btn-primary-col {
  flex-direction: column;
  gap: 0;
  padding: 14px 16px;
}

.btn-secondary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px;
  background: var(--white);
  color: var(--text);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 800;
  border: 2px solid var(--mint-light);
  transition: transform 0.12s, background 0.12s;
}
.btn-secondary:active {
  transform: scale(0.97);
  background: var(--mint-bg);
}

.btn-relapse {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  background: var(--white);
  color: var(--pink);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 800;
  border: 2px solid var(--pink-light);
  transition: transform 0.12s, background 0.12s;
}
.btn-relapse:active {
  transform: scale(0.97);
  background: var(--pink-bg);
}
.btn-icon-emoji { font-size: 18px; }

.action-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 14px;
}

/* ===== Stats Mini ===== */
.stats-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 12px;
}
.stats-mini-item {
  flex: 1;
  text-align: center;
}
.stats-mini-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 600;
}
.stats-mini-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stats-mini-divider {
  width: 1px;
  height: 32px;
  background: var(--mint-light);
}

/* ===== Calendar ===== */
.cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.cal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}
.icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--mint-bg);
  color: var(--mint-deep);
  font-size: 22px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
}
.icon-btn:active { background: var(--mint-light); }

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}
.cal-wd {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
  padding: 4px 0;
}
.cal-wd-sun { color: var(--pink); }
.cal-wd-sat { color: var(--sky); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 14px;
}
.cal-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  background: transparent;
  position: relative;
  overflow: visible;
}
.cal-cell-num {
  position: relative;
  z-index: 3;
}
.cal-cell.cal-sober {
  background: var(--mint);
  color: white;
}
.cal-cell.cal-drink {
  /* 線だけの徳利マークオーバーレイで表現するため背景色なし */
  color: var(--text);
}
.cal-cell.cal-today {
  outline: 2.5px solid var(--apricot);
  outline-offset: -2.5px;
  font-weight: 900;
}
.cal-cell.cal-today:not(.cal-sober):not(.cal-drink) {
  background: var(--apricot);
  color: white;
  box-shadow: 0 2px 8px rgba(255, 159, 77, 0.4);
}
.cal-cell.cal-empty { visibility: hidden; }
.cal-cell.cal-clickable {
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.cal-cell.cal-clickable:active {
  transform: scale(0.92);
}
.cal-cell.cal-confirmed {
  /* 飲酒/禁酒バックグラウンドの上にはなまる重畳 */
}
.cal-hanamaru {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-8deg);
  width: 105%;
  height: 105%;
  object-fit: contain;
  z-index: 2;
  pointer-events: none;
  opacity: 0.92;
}
.cal-drink-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(4deg);
  width: 90%;
  height: 90%;
  object-fit: contain;
  z-index: 2;
  pointer-events: none;
  opacity: 0.92;
}
.cal-cell.cal-drink .cal-cell-num {
  font-weight: 900;
  color: var(--text);
  text-shadow:
    -1.5px -1.5px 0 white,  1.5px -1.5px 0 white,
    -1.5px  1.5px 0 white,  1.5px  1.5px 0 white,
     0    -1.5px 0 white,   0     1.5px 0 white,
    -1.5px  0    0 white,   1.5px  0    0 white,
     0     0     4px rgba(255, 255, 255, 0.95);
}
.cal-cell.cal-confirmed .cal-cell-num {
  font-weight: 900;
  color: var(--text);
  text-shadow:
    -1.5px -1.5px 0 white,  1.5px -1.5px 0 white,
    -1.5px  1.5px 0 white,  1.5px  1.5px 0 white,
     0    -1.5px 0 white,   0     1.5px 0 white,
    -1.5px  0    0 white,   1.5px  0    0 white,
     0     0     4px rgba(255, 255, 255, 0.95);
}

.cal-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.legend-mint    { background: var(--mint); }
.legend-pink    { background: var(--pink); }
.legend-apricot { background: var(--apricot); }
.legend-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: middle;
}

/* ===== Summary Grid ===== */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.summary-item {
  background: var(--cream);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
}
.summary-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}
.summary-value {
  font-size: 24px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}
.summary-mint    { color: var(--mint-deep); }
.summary-pink    { color: var(--pink); }
.summary-apricot { color: var(--apricot); }
.summary-lavender{ color: var(--lavender); }
.summary-unit {
  font-size: 14px;
  font-weight: 700;
  margin-left: 2px;
}

/* ===== Journey Grid (Stats) ===== */
.journey-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.journey-item {
  background: var(--cream);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  text-align: center;
}
.journey-emoji {
  font-size: 28px;
  margin-bottom: 4px;
}
.journey-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 4px;
}
.journey-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ===== History List ===== */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--cream);
  border-radius: var(--radius-md);
}
.history-no {
  font-weight: 800;
  color: var(--mint-deep);
  font-size: 14px;
}
.history-duration {
  font-weight: 800;
  color: var(--text);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.history-date {
  font-size: 11px;
  color: var(--text-muted);
}
.empty-msg {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  padding: 20px;
}

/* ===== Habit list (settings) ===== */
.habit-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.habit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--cream);
  border-radius: var(--radius-md);
  width: 100%;
  text-align: left;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.habit-row.habit-active {
  background: var(--mint-bg);
  border: 2px solid var(--mint);
  color: var(--mint-deep);
}
.habit-row.habit-disabled {
  color: var(--text-light);
  cursor: not-allowed;
}
.habit-emoji { font-size: 24px; }
.habit-name { flex: 1; }
.habit-check {
  font-size: 18px;
  font-weight: 900;
  color: var(--mint-deep);
}
.habit-soon {
  font-size: 11px;
  color: var(--text-light);
  background: var(--white);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
}

.settings-btn {
  width: 100%;
  padding: 14px;
  background: var(--cream);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  transition: background 0.15s;
  text-align: center;
}
.settings-btn:active { background: var(--mint-bg); }
.settings-btn-danger { color: var(--pink); }
.settings-btn-danger:active { background: var(--pink-bg); }

.version-text {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* ===== Tabbar ===== */
.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--white);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid #F0E8DA;
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -4px 20px rgba(76, 203, 154, 0.06);
  z-index: 50;
  max-width: 480px;
  margin: 0 auto;
}
.tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 4px 8px;
  transition: background 0.15s;
  border-radius: 12px;
  margin: 4px;
}
.tab-btn:active { background: var(--mint-bg); }
.tab-icon {
  width: 52px;
  height: 52px;
  object-fit: contain;
  opacity: 0.55;
  transition: opacity 0.2s, transform 0.2s;
}
.tab-active .tab-icon {
  opacity: 1;
  transform: scale(1.06);
}

/* ===== Custom icons (img) ===== */
.btn-primary-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}
.milestone-icon img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
}
.modal-icon-img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  animation: bounce 0.6s ease;
}

/* ===== Modal ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  animation: modalBgIn 0.2s ease;
}
.modal[hidden] { display: none; }
@keyframes modalBgIn {
  from { background: rgba(0, 0, 0, 0); }
  to   { background: rgba(0, 0, 0, 0.4); }
}
.modal-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 28px 22px 24px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}
.modal-card-lg {
  max-height: 82vh;
  overflow-y: auto;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--cream);
  font-size: 18px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.modal-emoji {
  font-size: 56px;
  margin-bottom: 8px;
  display: inline-block;
  animation: bounce 0.6s ease;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

.modal-title {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 8px;
  color: var(--text);
}
.modal-msg {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.7;
  font-weight: 500;
}
.modal-praise {
  font-size: 14px;
  color: var(--mint-deep);
  font-weight: 700;
  background: var(--mint-bg);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
  line-height: 1.6;
}
.modal-note {
  font-size: 13px;
  color: var(--pink);
  font-weight: 700;
  margin-bottom: 16px;
  background: var(--pink-bg);
  border-radius: var(--radius-md);
  padding: 12px;
}

.modal-actions {
  display: flex;
  gap: 8px;
}
.modal-actions-col { flex-direction: column; }

.modal-btn {
  flex: 1;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 15px;
  transition: transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.modal-btn:active { transform: scale(0.96); }
.modal-btn-mint    { background: linear-gradient(135deg, var(--mint), var(--mint-deep)); color: white; box-shadow: 0 4px 14px rgba(76, 203, 154, 0.30); }
.modal-btn-pink    { background: var(--pink); color: white; }
.modal-btn-apricot { background: var(--apricot); color: white; }
.modal-btn-sky     { background: var(--sky); color: white; }
.modal-btn-lavender{ background: var(--lavender); color: white; }
.modal-btn-ghost   { background: var(--cream); color: var(--text-muted); }
.modal-btn-outline { background: var(--white); color: var(--text); border: 2px solid var(--mint-light); }

/* ===== Restart Modal (太陽+双葉SVG) ===== */
.restart-illust {
  width: 100%;
  height: 100px;
  margin: -10px 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.journey-summary {
  background: var(--cream);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 14px;
  text-align: left;
}
.js-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
}
.js-row span { color: var(--text-muted); font-weight: 600; }
.js-row strong {
  color: var(--text);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* ===== Craving Modal (円形タイマー + チェックリスト) ===== */
.craving-clouds {
  font-size: 22px;
  margin-bottom: 4px;
  letter-spacing: 4px;
}
.craving-ring {
  position: relative;
  width: 180px; height: 180px;
  margin: 8px auto 16px;
}
.craving-ring svg {
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}
.craving-ring-bg {
  fill: var(--white);
  stroke: var(--mint-bg);
  stroke-width: 10;
}
.craving-ring-fg {
  fill: none;
  stroke: var(--mint);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}
.craving-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.craving-time {
  font-size: 44px;
  font-weight: 900;
  color: var(--mint-deep);
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
  line-height: 1;
}
.craving-time-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 4px;
}
.craving-status {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 12px;
}
.craving-checklist {
  background: var(--mint-bg);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
  text-align: left;
}
.craving-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}
.craving-check-item .ci-icon {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--mint);
  color: white;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 800;
}

/* ===== Milestone (達成演出) Modal ===== */
.modal-praise-card {
  position: relative;
}

/* ===== Milestone List Modal ===== */
.ms-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  text-align: left;
}
.ms-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--cream);
  border-radius: var(--radius-md);
}
.ms-item.ms-reached {
  background: var(--mint-bg);
}
.ms-item-icon {
  font-size: 24px;
  width: 36px;
  text-align: center;
}
.ms-item-body { flex: 1; }
.ms-item-label {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}
.ms-item-msg {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.ms-item-check {
  color: var(--mint-deep);
  font-weight: 900;
  font-size: 18px;
}

/* ===== Daily greeting hanamaru section ===== */
.dg-hanamaru-card {
  background: linear-gradient(135deg, #FFF0F6 0%, #FFE0C2 100%);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  margin-bottom: 14px;
  text-align: center;
}
.dg-hanamaru-emoji {
  font-size: 48px;
  margin-bottom: 6px;
  animation: bounce 0.6s ease;
}
.dg-hanamaru-msg {
  font-size: 16px;
  font-weight: 800;
  color: var(--pink);
  margin-bottom: 4px;
}
.dg-hanamaru-sub {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ===== Edit modal: status + link button ===== */
.edit-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--cream);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.link-text-btn {
  display: block;
  width: 100%;
  padding: 12px;
  margin-top: 12px;
  background: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-text-btn:active { color: var(--pink); }

.edit-hint {
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--mint-bg);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--mint-deep);
  font-weight: 600;
  line-height: 1.5;
}
.edit-hint-today {
  background: var(--pink-bg);
  color: var(--pink);
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(45, 45, 45, 0.92);
  color: white;
  padding: 14px 22px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  white-space: pre-line;
  max-width: 320px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 300;
}
.toast.toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== Today record modal (今日の記録) ===== */
.today-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.today-opt {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 800;
  text-align: left;
  width: 100%;
  transition: transform 0.1s;
}
.today-opt:active { transform: scale(0.97); }
.today-opt-emoji { font-size: 32px; }
.today-opt-mint {
  background: var(--mint-bg);
  color: var(--mint-deep);
  border: 2px solid var(--mint-light);
}
.today-opt-pink {
  background: var(--pink-bg);
  color: var(--pink);
  border: 2px solid var(--pink-light);
}
.today-opt-body { flex: 1; }
.today-opt-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== Confetti canvas ===== */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
}
