/* ============================================
   breathe — focus timer
   セージグリーン × ボタニカル
   ============================================ */

:root {
  /* セージグリーン */
  --sage-50:  #F4F7F1;
  --sage-100: #E5EDDF;
  --sage-200: #C9D9BD;
  --sage-300: #AEC59B;
  --sage-400: #9CAF88;
  --sage-500: #7E956A;
  --sage-600: #607851;
  --sage-700: #4A5E40;

  /* クリーム下地(参考画像の柔らかい背景) */
  --cream-50:  #FAF8EE;
  --cream-100: #F4F2E8;
  --cream-200: #ECE9D8;
  --cream-300: #DBD9C2;

  /* テキスト */
  --text:       #4A5240;
  --text-mute:  #8A9080;
  --text-light: #B5B8A8;
  --text-dark:  #2C3328;

  /* 機能色 */
  --bg:         #F4F2E8;
  --card:       #FFFFFC;
  --card-soft:  #F8F6EC;
  --border:     #E5E2D2;
  --border-soft:#EFEDE0;
  --shadow-sm:  0 1px 3px rgba(74, 82, 64, 0.04);
  --shadow:     0 2px 12px rgba(74, 82, 64, 0.05), 0 1px 3px rgba(74, 82, 64, 0.04);
  --shadow-lg:  0 8px 28px rgba(74, 82, 64, 0.08);
  --danger:     #C97474;

  /* タイポ */
  --font-jp: 'Noto Serif JP', 'Hiragino Mincho ProN', 'Yu Mincho', 'Yu Gothic UI', serif;
  --font-en: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-script: 'Dancing Script', 'Brush Script MT', cursive;
  --font-ui: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Yu Gothic UI', 'Meiryo', sans-serif;
}

/* ============================================
   リセット
   ============================================ */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overscroll-behavior: none; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.01em;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
svg { width: 100%; height: 100%; display: block; }
ul { list-style: none; }
img { display: block; max-width: 100%; }

/* ============================================
   背景装飾(植物の葉影、淡い光)
   ============================================ */
.bg-decor {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-leaf {
  position: absolute;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.18;
  filter: blur(0.3px);
}
.bg-leaf-tr {
  width: 60vw; height: 60vw; max-width: 700px; max-height: 700px;
  top: -10vw; right: -12vw;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400'><g fill='none' stroke='%237E956A' stroke-width='1.2' stroke-linecap='round'><path d='M50 350 Q 200 200 380 50'/><path d='M70 360 Q 110 280 80 240'/><path d='M120 320 Q 160 250 130 220'/><path d='M170 280 Q 210 220 180 195'/><path d='M220 235 Q 260 180 230 160'/><path d='M270 195 Q 310 145 290 125'/><path d='M105 270 Q 150 240 110 215'/><path d='M155 225 Q 200 200 165 175'/><path d='M205 185 Q 245 165 215 145'/><ellipse cx='90' cy='250' rx='6' ry='14' fill='%23AEC59B' stroke='none' transform='rotate(-30 90 250)'/><ellipse cx='140' cy='230' rx='6' ry='14' fill='%23AEC59B' stroke='none' transform='rotate(-25 140 230)'/><ellipse cx='190' cy='200' rx='6' ry='14' fill='%23AEC59B' stroke='none' transform='rotate(-22 190 200)'/><ellipse cx='240' cy='170' rx='6' ry='14' fill='%23AEC59B' stroke='none' transform='rotate(-20 240 170)'/></g></svg>");
}
.bg-leaf-br {
  width: 40vw; height: 40vw; max-width: 480px; max-height: 480px;
  bottom: -8vw; right: -6vw;
  opacity: 0.12;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400'><g fill='none' stroke='%237E956A' stroke-width='1.2' stroke-linecap='round'><path d='M380 380 Q 250 250 80 80'/><path d='M340 380 Q 320 320 280 300'/><path d='M280 360 Q 250 300 220 280'/><ellipse cx='300' cy='320' rx='6' ry='14' fill='%23AEC59B' stroke='none' transform='rotate(40 300 320)'/></g></svg>");
}
.bg-glow {
  position: absolute;
  width: 80vw; height: 80vw;
  top: -30vw; left: -20vw;
  background: radial-gradient(circle, rgba(255, 250, 220, 0.5) 0%, rgba(255, 250, 220, 0) 60%);
  pointer-events: none;
}

/* ============================================
   レイアウト
   ============================================ */
#app {
  position: relative;
  min-height: 100vh;
  z-index: 1;
}

.content {
  position: relative;
  z-index: 2;
}

/* ============================================
   サイドバー (PC)
   ============================================ */
.sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.brand {
  font-family: var(--font-script);
  font-size: 28px;
  color: var(--sage-600);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.brand-dot { color: var(--sage-400); }

.nav-list { display: flex; flex-direction: column; align-items: center; gap: 4px; }

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 60px;
  padding: 12px 4px;
  border-radius: 14px;
  color: var(--text-mute);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: all 0.18s ease;
}
.nav-item svg { width: 22px; height: 22px; opacity: 0.85; }
.nav-item:hover { color: var(--sage-600); }
.nav-item.active {
  background: var(--sage-100);
  color: var(--sage-700);
}
.nav-item.active svg { opacity: 1; }

.sidebar-foot { margin-top: auto; padding-bottom: 16px; }
.vase-card {
  width: 90px;
  background: var(--card);
  border-radius: 16px;
  padding: 14px 8px 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.vase-illust { width: 60px; height: 75px; margin: 0 auto 6px; }
.vase-caption {
  font-family: var(--font-script);
  font-size: 13px;
  color: var(--sage-600);
  line-height: 1.3;
}

/* ============================================
   PCレイアウト(>= 900px): サイドバー + 中央
   ============================================ */
@media (min-width: 900px) {
  #app {
    display: grid;
    grid-template-columns: 110px 1fr;
    min-height: 100vh;
  }
  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 28px 0 18px;
    gap: 24px;
  }
  .brand { margin-bottom: 6px; }
  .content {
    padding: 36px 48px 48px;
    max-width: 1280px;
    width: 100%;
  }
}

/* ============================================
   iPhoneレイアウト(< 900px): 下タブ
   ============================================ */
@media (max-width: 899px) {
  .sidebar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: calc(64px + env(safe-area-inset-bottom));
    background: rgba(252, 250, 240, 0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid var(--border-soft);
    z-index: 90;
    flex-direction: row;
    padding: 6px 4px env(safe-area-inset-bottom);
    gap: 0;
  }
  .brand, .sidebar-foot { display: none; }
  .nav-list {
    flex-direction: row;
    width: 100%;
    justify-content: space-around;
    align-items: center;
    gap: 0;
  }
  .nav-item {
    width: auto;
    flex: 1;
    padding: 6px 2px;
    font-size: 10px;
    border-radius: 12px;
  }
  .nav-item svg { width: 20px; height: 20px; }
  .nav-item.active {
    background: transparent;
    color: var(--sage-600);
  }
  .nav-item.active::before {
    content: '';
    position: absolute;
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--sage-500);
    margin-top: -2px;
  }
  .nav-item { position: relative; }
  .content {
    padding: 16px 16px calc(80px + env(safe-area-inset-bottom)) 16px;
  }
}

/* ============================================
   ヘッダー(挨拶 + 日付)
   ============================================ */
.greeting {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 16px;
  margin-bottom: 22px;
}
.greeting-text h1 {
  font-family: var(--font-jp);
  font-size: 28px;
  font-weight: 400;
  color: var(--text-dark);
  letter-spacing: 0.04em;
  line-height: 1.4;
  margin-bottom: 6px;
}
.greeting-text p {
  font-family: var(--font-jp);
  font-size: 13px;
  color: var(--text-mute);
  font-weight: 300;
  letter-spacing: 0.06em;
}
.greeting-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}
.greeting-date {
  font-family: var(--font-en);
  font-size: 16px;
  color: var(--text-mute);
  letter-spacing: 0.05em;
}
.greeting-bell {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-mute);
}
.greeting-bell svg { width: 18px; height: 18px; }
.greeting-bell:active { transform: scale(0.95); }

@media (max-width: 899px) {
  .greeting { grid-template-columns: 1fr auto; gap: 8px; }
  .greeting-text h1 { font-size: 22px; }
  .greeting-text p { font-size: 12px; }
  .greeting-date { font-size: 13px; }
  .greeting-bell { width: 34px; height: 34px; }
}

/* ============================================
   グリッド(Home)
   ============================================ */
.home-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  grid-template-rows: auto auto auto;
  gap: 18px;
}
.home-grid > .timer-card { grid-row: span 2; }
.home-grid > .stats-row { grid-column: span 2; }
.home-grid > .bottom-row { grid-column: span 2; }

@media (max-width: 899px) {
  .home-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .home-grid > .timer-card,
  .home-grid > .tasks-card,
  .home-grid > .quote-card,
  .home-grid > .stats-row,
  .home-grid > .bottom-row { grid-column: span 1; grid-row: auto; }
}

/* ============================================
   カード共通
   ============================================ */
.card {
  background: var(--card);
  border-radius: 22px;
  padding: 20px 22px;
  box-shadow: var(--shadow);
  position: relative;
}
.card-soft {
  background: var(--card-soft);
  border-radius: 22px;
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage-600);
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--sage-100);
}
.pill-dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--sage-500);
}

/* ============================================
   タイマーカード
   ============================================ */
.timer-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 26px 28px 28px;
  gap: 18px;
}
.timer-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.timer-head .icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-mute);
}
.timer-head .icon-btn:hover { color: var(--sage-600); background: var(--sage-50); }
.timer-head .icon-btn svg { width: 20px; height: 20px; }

.timer-ring-wrap {
  position: relative;
  width: min(88%, 320px);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.timer-ring {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}
.timer-ring circle {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}
.timer-ring .ring-track { stroke: var(--sage-100); }
.timer-ring .ring-progress {
  stroke: var(--sage-400);
  transition: stroke-dashoffset 0.6s linear;
}
.timer-ring-knob {
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--sage-300);
  box-shadow: 0 2px 6px rgba(126, 149, 106, 0.25);
  transform: translate(-50%, -50%);
  transition: top 0.6s linear, left 0.6s linear;
}
.timer-display {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
}
.timer-state {
  font-family: var(--font-jp);
  font-size: 13px;
  color: var(--sage-500);
  letter-spacing: 0.1em;
  font-weight: 400;
}
.timer-time {
  font-family: var(--font-en);
  font-size: 76px;
  font-weight: 300;
  color: var(--sage-600);
  letter-spacing: 0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.timer-leaf {
  width: 26px; height: 26px;
  margin-top: 6px;
  color: var(--sage-300);
}

.timer-goal {
  text-align: center;
  margin-top: 4px;
}
.timer-goal-label {
  font-family: var(--font-en);
  font-size: 14px;
  color: var(--sage-600);
  font-style: italic;
  background: var(--sage-50);
  padding: 4px 14px;
  border-radius: 999px;
  display: inline-block;
}
.timer-goal-text {
  margin-top: 12px;
  font-family: var(--font-jp);
  font-size: 14px;
  color: var(--text);
  letter-spacing: 0.06em;
}

.timer-controls {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 6px;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--sage-400);
  color: #FFFFFF;
  border-radius: 999px;
  padding: 14px 44px;
  min-width: 200px;
  font-family: var(--font-en);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.05em;
  box-shadow: 0 6px 18px rgba(126, 149, 106, 0.28);
  transition: all 0.18s ease;
}
.btn-primary:hover { background: var(--sage-500); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary svg { width: 16px; height: 16px; }

.btn-circle {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mute);
  box-shadow: var(--shadow-sm);
  transition: all 0.15s;
}
.btn-circle:hover { color: var(--sage-600); border-color: var(--sage-300); }
.btn-circle svg { width: 18px; height: 18px; }

/* ============================================
   タスクカード
   ============================================ */
.tasks-card { padding: 22px 22px 18px; }
.tasks-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.tasks-title {
  font-family: var(--font-en);
  font-size: 22px;
  font-weight: 400;
  color: var(--text-dark);
  letter-spacing: 0.02em;
}
.tasks-progress {
  font-family: var(--font-en);
  font-size: 14px;
  color: var(--sage-600);
  background: var(--sage-50);
  padding: 5px 14px;
  border-radius: 999px;
  letter-spacing: 0.05em;
}

.task-list { display: flex; flex-direction: column; }
.task-item {
  display: grid;
  grid-template-columns: 24px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  transition: background 0.15s;
}
.task-item:last-child { border-bottom: none; }
.task-item:hover { background: var(--cream-50); border-radius: 10px; }
.task-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--sage-300);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: all 0.15s;
  flex-shrink: 0;
}
.task-check svg {
  width: 12px; height: 12px;
  color: #FFFFFF;
  opacity: 0;
  transition: opacity 0.15s;
}
.task-item.done .task-check {
  background: var(--sage-400);
  border-color: var(--sage-400);
}
.task-item.done .task-check svg { opacity: 1; }
.task-item.done .task-title {
  color: var(--text-light);
  text-decoration: line-through;
  text-decoration-color: var(--text-light);
}
.task-title {
  font-size: 14px;
  color: var(--text);
  letter-spacing: 0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-time {
  font-family: var(--font-en);
  font-size: 13px;
  color: var(--text-mute);
  letter-spacing: 0.02em;
}
.task-del {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  opacity: 0;
  transition: opacity 0.15s;
}
.task-item:hover .task-del { opacity: 1; }
.task-del:hover { color: var(--danger); background: var(--cream-100); }
.task-del svg { width: 14px; height: 14px; }

.task-add {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 4px;
  margin-top: 6px;
  color: var(--sage-500);
  font-size: 14px;
  font-weight: 500;
  border-top: 1px dashed var(--border);
}
.task-add svg { width: 16px; height: 16px; }
.task-add:hover { color: var(--sage-600); }

/* ============================================
   引用カード(quote with photo)
   ============================================ */
.quote-card {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  min-height: 200px;
  background: linear-gradient(135deg, #F0EFE0, #E8E5CF);
  background-image:
    linear-gradient(110deg, rgba(244,242,232,0.85) 0%, rgba(244,242,232,0.45) 50%, rgba(244,242,232,0.1) 100%),
    url('https://images.unsplash.com/photo-1490312278390-ab64016e0aa9?w=800&q=80');
  background-size: cover;
  background-position: center right;
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: var(--shadow);
}
.quote-text {
  font-family: var(--font-jp);
  font-size: 15px;
  color: var(--text-dark);
  line-height: 2;
  letter-spacing: 0.08em;
  font-weight: 400;
  max-width: 60%;
}
.quote-divider {
  width: 30px;
  height: 1px;
  background: var(--sage-400);
  margin-top: 14px;
}

/* ============================================
   統計帯
   ============================================ */
.stats-row {
  background: var(--card);
  border-radius: 20px;
  padding: 18px 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  gap: 18px;
  align-items: center;
  box-shadow: var(--shadow);
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 12px;
  border-right: 1px solid var(--border-soft);
}
.stat:last-of-type { border-right: none; }
.stat-head {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-mute);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.stat-head svg { width: 14px; height: 14px; opacity: 0.7; }
.stat-value {
  font-family: var(--font-en);
  font-size: 30px;
  font-weight: 400;
  color: var(--sage-600);
  letter-spacing: 0.02em;
  line-height: 1.1;
}
.stat-sub {
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: 0.05em;
}

.weekchart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 56px;
  padding-left: 12px;
}
.weekchart-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.weekchart-bar {
  width: 7px;
  background: var(--sage-200);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.4s;
}
.weekchart-col.today .weekchart-bar { background: var(--sage-500); }
.weekchart-col.weekend .weekchart-label { color: var(--danger); opacity: 0.6; }
.weekchart-label {
  font-family: var(--font-en);
  font-size: 10px;
  color: var(--text-light);
  letter-spacing: 0.05em;
}

@media (max-width: 899px) {
  .stats-row { grid-template-columns: repeat(3, 1fr); padding: 14px; gap: 8px; }
  .stat { padding-right: 8px; }
  .stat-value { font-size: 22px; }
  .weekchart { display: none; }
}

/* ============================================
   下段(BGM + Note)
   ============================================ */
.bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 899px) {
  .bottom-row { grid-template-columns: 1fr; gap: 14px; }
}

.bgm-card {
  display: grid;
  grid-template-columns: 1fr 80px;
  grid-template-rows: auto 1fr auto;
  gap: 4px 14px;
  padding: 18px 20px 14px;
}
.bgm-label {
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-mute);
  font-size: 12px;
  letter-spacing: 0.08em;
}
.bgm-label svg { width: 14px; height: 14px; }
.bgm-art {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 80px; height: 80px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, #C9D9BD, #AEC59B);
  background-image:
    linear-gradient(135deg, rgba(174,197,155,0.4), rgba(126,149,106,0.5)),
    url('https://images.unsplash.com/photo-1502083896352-259057ae65b1?w=300&q=80');
  background-size: cover;
  background-position: center;
}
.bgm-title {
  grid-column: 1;
  font-family: var(--font-en);
  font-size: 19px;
  color: var(--text-dark);
  font-weight: 400;
  line-height: 1.2;
  font-style: italic;
}
.bgm-author {
  grid-column: 1;
  font-size: 12px;
  color: var(--text-mute);
  letter-spacing: 0.04em;
  margin-top: 2px;
}
.bgm-controls {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding-top: 10px;
}
.bgm-controls .ctrl {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-mute);
  border-radius: 50%;
}
.bgm-controls .ctrl:hover { color: var(--sage-600); }
.bgm-controls .ctrl svg { width: 18px; height: 18px; }
.bgm-controls .ctrl-play {
  width: 44px; height: 44px;
  background: var(--sage-400);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(126, 149, 106, 0.3);
}
.bgm-controls .ctrl-play:hover { background: var(--sage-500); color: #FFFFFF; }
.bgm-controls .ctrl-play svg { width: 16px; height: 16px; }

.bgm-progress {
  grid-column: 1 / -1;
  height: 3px;
  background: var(--sage-100);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}
.bgm-progress-fill {
  height: 100%;
  width: 35%;
  background: var(--sage-400);
  border-radius: 2px;
  transition: width 0.3s linear;
}

.note-card {
  padding: 20px 22px;
  position: relative;
}
.note-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.note-title {
  font-family: var(--font-en);
  font-size: 16px;
  color: var(--text-dark);
  font-weight: 400;
  letter-spacing: 0.02em;
}
.note-edit {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-light);
}
.note-edit svg { width: 14px; height: 14px; }
.note-edit:hover { color: var(--sage-600); }

.note-text {
  width: 100%;
  min-height: 80px;
  resize: none;
  border: none;
  background: transparent;
  font-family: var(--font-jp);
  font-size: 14px;
  line-height: 2;
  color: var(--text);
  letter-spacing: 0.06em;
  outline: none;
}
.note-text::placeholder { color: var(--text-light); }
.note-heart {
  position: absolute;
  bottom: 14px;
  right: 18px;
  color: var(--sage-300);
  width: 40px;
  height: 30px;
  opacity: 0.7;
}

/* ============================================
   サブページ(Timer/Tasks/Stats/Journal/Focus/Settings)
   ============================================ */
.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 22px;
}
.page-title {
  font-family: var(--font-jp);
  font-size: 26px;
  font-weight: 400;
  color: var(--text-dark);
  letter-spacing: 0.04em;
}
.page-sub {
  font-family: var(--font-jp);
  font-size: 13px;
  color: var(--text-mute);
  margin-top: 4px;
  letter-spacing: 0.06em;
}
@media (max-width: 899px) {
  .page-title { font-size: 22px; }
}

/* Timer page (大きいタイマー専用) */
.big-timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  gap: 28px;
}
.big-timer .timer-ring-wrap { width: min(92%, 460px); }
.big-timer .timer-time { font-size: 96px; }
@media (max-width: 899px) {
  .big-timer { padding: 20px 0; }
  .big-timer .timer-time { font-size: 72px; }
}

.timer-modes {
  display: inline-flex;
  background: var(--card);
  border-radius: 999px;
  padding: 4px;
  box-shadow: var(--shadow-sm);
  gap: 4px;
}
.timer-mode {
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-mute);
  letter-spacing: 0.04em;
  transition: all 0.15s;
}
.timer-mode.active {
  background: var(--sage-400);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(126, 149, 106, 0.25);
}

/* Stats page */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.bigstat {
  background: var(--card);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.bigstat .stat-value { font-size: 38px; }
.bigstat-trend {
  font-size: 12px;
  color: var(--sage-500);
  margin-top: 4px;
}

.chart-card {
  background: var(--card);
  border-radius: 22px;
  padding: 22px 26px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.chart-card-title {
  font-family: var(--font-en);
  font-size: 18px;
  color: var(--text-dark);
  margin-bottom: 14px;
}
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 180px;
  padding-top: 20px;
}
.chart-bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.chart-bars .bar {
  width: 100%;
  background: linear-gradient(to top, var(--sage-300), var(--sage-200));
  border-radius: 8px 8px 0 0;
  min-height: 4px;
}
.chart-bars .col.today .bar { background: linear-gradient(to top, var(--sage-500), var(--sage-400)); }
.chart-bars .label { font-size: 11px; color: var(--text-mute); font-family: var(--font-en); }

/* Journal */
.journal-list { display: flex; flex-direction: column; gap: 12px; }
.journal-entry {
  background: var(--card);
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}
.journal-date {
  font-family: var(--font-en);
  font-size: 13px;
  color: var(--sage-500);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.journal-text {
  font-family: var(--font-jp);
  font-size: 14px;
  line-height: 1.9;
  color: var(--text);
  letter-spacing: 0.04em;
  white-space: pre-wrap;
}

.journal-compose {
  background: var(--card);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}
.journal-compose textarea {
  width: 100%;
  min-height: 100px;
  resize: vertical;
  border: none;
  background: transparent;
  font-family: var(--font-jp);
  font-size: 14px;
  line-height: 1.9;
  color: var(--text);
  outline: none;
}
.journal-compose-foot { display: flex; justify-content: flex-end; margin-top: 8px; }

.btn-secondary {
  background: var(--sage-50);
  color: var(--sage-600);
  border-radius: 999px;
  padding: 8px 22px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.03em;
  border: 1px solid var(--sage-100);
}
.btn-secondary:hover { background: var(--sage-100); }

/* Focus page (集中モード = 全画面タイマー) */
.focus-quotes {
  background: var(--card);
  border-radius: 22px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
  text-align: center;
  margin-top: 18px;
}
.focus-quote {
  font-family: var(--font-jp);
  font-size: 18px;
  color: var(--text-dark);
  line-height: 2;
  letter-spacing: 0.1em;
}
.focus-quote-author {
  font-family: var(--font-en);
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 14px;
  font-style: italic;
}

/* Settings */
.setting-group {
  background: var(--card);
  border-radius: 18px;
  padding: 8px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}
.setting-group-title {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-mute);
  text-transform: uppercase;
  margin: 16px 0 8px;
  padding-left: 4px;
}
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-soft);
}
.setting-row:last-child { border-bottom: none; }
.setting-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.setting-name { font-size: 14px; color: var(--text); }
.setting-desc { font-size: 12px; color: var(--text-light); letter-spacing: 0.03em; }
.setting-control input[type="number"],
.setting-control input[type="text"],
.setting-control input[type="password"] {
  background: var(--cream-50);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 6px 10px;
  width: 110px;
  text-align: right;
  font-size: 14px;
}
.setting-control input:focus { outline: none; border-color: var(--sage-300); background: var(--card); }

/* スイッチ */
.switch { position: relative; width: 42px; height: 24px; display: inline-block; }
.switch input { display: none; }
.switch-track {
  position: absolute; inset: 0;
  background: var(--cream-200);
  border-radius: 999px;
  transition: background 0.2s;
}
.switch-track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: #FFFFFF;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
}
.switch input:checked + .switch-track { background: var(--sage-400); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }

/* ============================================
   モーダル
   ============================================ */
.modal {
  position: fixed; inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal.hidden { display: none; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(74, 82, 64, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal-content {
  position: relative;
  background: var(--card);
  border-radius: 22px;
  padding: 24px 24px 20px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  z-index: 1;
}
.modal-title {
  font-family: var(--font-jp);
  font-size: 18px;
  color: var(--text-dark);
  margin-bottom: 14px;
  letter-spacing: 0.04em;
}
.modal-field { margin-bottom: 14px; }
.modal-field label {
  display: block;
  font-size: 12px;
  color: var(--text-mute);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}
.modal-field input,
.modal-field select {
  width: 100%;
  background: var(--cream-50);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
}
.modal-field input:focus { outline: none; border-color: var(--sage-300); background: var(--card); }
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

/* ============================================
   トースト
   ============================================ */
.toast {
  position: fixed;
  bottom: max(80px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(74, 82, 64, 0.92);
  color: #FFFFFF;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.05em;
  z-index: 300;
  box-shadow: var(--shadow-lg);
  transition: opacity 0.2s, transform 0.2s;
}
.toast.hidden { opacity: 0; transform: translateX(-50%) translateY(8px); pointer-events: none; }
@media (min-width: 900px) { .toast { bottom: 32px; } }

/* ============================================
   認証画面
   ============================================ */
.auth-screen {
  position: fixed; inset: 0;
  z-index: 500;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  background: var(--card);
  border-radius: 22px;
  padding: 36px 28px 28px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.auth-icon {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--sage-100);
  display: flex; align-items: center; justify-content: center;
  color: var(--sage-600);
}
.auth-icon svg { width: 26px; height: 26px; }
.auth-title {
  font-family: var(--font-script);
  font-size: 28px;
  color: var(--sage-600);
  margin-bottom: 4px;
}
.auth-sub {
  font-size: 13px;
  color: var(--text-mute);
  margin-bottom: 18px;
  letter-spacing: 0.05em;
}
.auth-input {
  width: 100%;
  background: var(--cream-50);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px;
  text-align: center;
  letter-spacing: 0.2em;
}
.auth-input:focus { outline: none; border-color: var(--sage-300); background: var(--card); }
.auth-error {
  margin-top: 10px;
  color: var(--danger);
  font-size: 12px;
}
.auth-hint {
  margin-top: 16px;
  font-size: 11px;
  color: var(--text-light);
  line-height: 1.7;
}

/* ============================================
   ユーティリティ
   ============================================ */
.hidden { display: none !important; }
.text-muted { color: var(--text-mute); }
.divider {
  height: 1px;
  background: var(--border-soft);
  margin: 12px 0;
}

/* スクロールバー(PC) */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--cream-300); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }
