/* ────────────────────────────────────────────
   Valance — Mood Tracker
   Design System & Component Styles
──────────────────────────────────────────── */

:root {
  /* カラーパレット — パステルライトテーマ */
  --bg: #f0edf8;
  --surface: #faf8ff;
  --surface2: #ede9f7;
  --border: #d8d0f0;
  --text-primary: #3a3360;
  --text-secondary: #7a6fa8;
  --text-muted: #b0a8d0;

  /* 気分カラー（グラデーション） */
  --manic-3: #ff7aaa;
  --manic-2: #ffaacc;
  --manic-1: #ffd0e8;
  --stable:  #b8b0e8;
  --depressed-1: #a8d8f8;
  --depressed-2: #78b8e8;
  --depressed-3: #5090c8;

  --accent: #9d8fff;
  --accent-light: #c4baff;
  --success: #7de8b8;
  --danger: #ff8fa0;
  --warning: #ffd88a;

  /* レイアウト */
  --header-h: 64px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(120,100,200,.18);
  --transition: .2s ease;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Noto Sans JP', 'Inter', sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 15% 20%, rgba(255,200,230,.45) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 10%, rgba(200,230,255,.45) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(210,255,230,.4) 0%, transparent 55%),
    radial-gradient(ellipse at 90% 70%, rgba(255,230,180,.35) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ── Header ── */
#app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(240,237,248,.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.header-inner {
  max-width: 540px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-icon {
  font-size: 1.35rem;
  color: #9d8fff;
  animation: logoPulse 4s ease-in-out infinite;
}
@keyframes logoPulse {
  0%,100% { opacity: 1; }
  50% { opacity: .55; }
}
.logo-text {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text-primary);
}

/* ── Tab Nav ── */
.tab-nav {
  display: flex;
  gap: 4px;
  background: var(--surface2);
  border-radius: 40px;
  padding: 4px;
}
.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 14px;
  border-radius: 36px;
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
}
.tab-btn i { font-size: .9rem; }
.tab-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 12px rgba(157,143,255,.45);
}
.tab-btn:hover:not(.active) { color: var(--text-secondary); }

/* ── Main Layout ── */
#app-main {
  max-width: 540px;
  margin: 0 auto;
  padding-top: calc(var(--header-h) + 16px);
  padding-bottom: 40px;
  min-height: 100vh;
}

.tab-content { display: none; padding: 0 14px; animation: fadeIn .25s ease; }
.tab-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 14px;
  margin-bottom: 12px;
}

.card-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 14px;
}
.card-label i { color: #9d8fff; }

/* ── Date Input ── */
.datetime-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: .95rem;
  outline: none;
  transition: var(--transition);
}
.datetime-input:focus { border-color: var(--accent); }

/* ── Mood Spectrum ── */
.mood-spectrum-wrap { position: relative; margin-bottom: 10px; }

.mood-spectrum {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}

.mood-dot {
  flex: 1;
  aspect-ratio: 1;
  max-width: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  border: 2px solid transparent;
  position: relative;
}
.mood-dot:hover { transform: scale(1.15); }
.mood-dot.selected {
  transform: scale(1.25);
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(157,143,255,.35), 0 4px 16px rgba(120,100,200,.3);
}

.mood-label-row {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}
.pole-label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .05em;
}
.pole-label.manic { color: var(--manic-3); }
.pole-label.stable { color: var(--stable); }
.pole-label.depressed { color: var(--depressed-3); }

.mood-current-label {
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 2px;
  min-height: 1.5em;
  transition: var(--transition);
}

/* ── Sliders ── */
.slider-rows { display: flex; flex-direction: column; gap: 14px; }

.slider-row {
  display: grid;
  grid-template-columns: 26px 80px 1fr 28px;
  align-items: center;
  gap: 8px;
}
.slider-icon { font-size: 1rem; text-align: center; }
.slider-name { font-size: .82rem; color: var(--text-secondary); }
.slider-val {
  font-size: .85rem;
  font-weight: 600;
  color: #7060cc;
  text-align: right;
}

.detail-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: var(--surface2);
  outline: none;
  cursor: pointer;
}
.detail-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,111,255,.3);
  transition: var(--transition);
}
.detail-slider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 5px rgba(124,111,255,.4);
}

/* ── Sleep ── */
.sleep-row {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.sleep-field { display: flex; align-items: center; gap: 10px; }
.sleep-label { font-size: .82rem; color: var(--text-secondary); }
.sleep-input-wrap { display: flex; align-items: center; gap: 4px; }
.sleep-input {
  width: 72px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 8px 10px;
  font-size: .95rem;
  text-align: center;
  outline: none;
}
.sleep-input:focus { border-color: var(--accent); }
.sleep-unit { font-size: .82rem; color: var(--text-secondary); }

.sleep-quality-wrap { display: flex; align-items: center; gap: 10px; }
.sleep-stars { display: flex; gap: 4px; }
.star-btn {
  font-size: 1.45rem;
  color: var(--text-muted);
  transition: var(--transition);
  line-height: 1;
  padding: 0 1px;
}
.star-btn.active { color: var(--warning); text-shadow: 0 0 8px rgba(255,197,107,.4); }
.star-btn:hover { transform: scale(1.15); }

/* ── Medication Toggle ── */
.toggle-btn {
  display: flex;
  align-items: center;
  gap: 12px;
}
.toggle-track {
  width: 48px; height: 26px;
  background: var(--surface2);
  border-radius: 99px;
  border: 1px solid var(--border);
  position: relative;
  transition: background .25s;
  flex-shrink: 0;
}
.toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform .25s, background .25s;
}
.toggle-btn[data-active="true"] .toggle-track { background: var(--success); border-color: var(--success); }
.toggle-btn[data-active="true"] .toggle-thumb { transform: translateX(22px); background: #fff; }
.toggle-text { font-size: .9rem; color: var(--text-secondary); transition: var(--transition); }
.toggle-btn[data-active="true"] .toggle-text { color: var(--success); }

/* ── Tags ── */
.tags-preset {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.tag-pill {
  padding: 5px 13px;
  border-radius: 99px;
  font-size: .8rem;
  font-weight: 500;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: var(--transition);
}
.tag-pill.selected {
  background: rgba(157,143,255,.2);
  border-color: var(--accent);
  color: #7060cc;
}
.tag-pill:hover { border-color: var(--accent); color: var(--text-primary); }

.tag-custom-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.tag-custom-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 8px 12px;
  font-size: .85rem;
  outline: none;
}
.tag-custom-input:focus { border-color: var(--accent); }
.tag-custom-input::placeholder { color: var(--text-muted); }
.tag-add-btn {
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: .85rem;
  transition: var(--transition);
}
.tag-add-btn:hover { background: var(--accent-light); }

.selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 8px;
}
.selected-tag {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(157,143,255,.2);
  border: 1px solid rgba(157,143,255,.6);
  font-size: .78rem;
  color: #7060cc;
}
.selected-tag button {
  color: #7060cc;
  font-size: .7rem;
  opacity: .7;
}
.selected-tag button:hover { opacity: 1; }

/* ── Note ── */
.note-textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 12px 14px;
  font-size: .9rem;
  line-height: 1.65;
  resize: vertical;
  outline: none;
  transition: var(--transition);
}
.note-textarea:focus { border-color: var(--accent); }
.note-textarea::placeholder { color: var(--text-muted); }
.note-charcount {
  text-align: right;
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 5px;
}

/* ── Save Button ── */
.save-wrap { padding: 8px 0 20px; }
.save-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), #b8a8ff);
  color: #fff;
  padding: 15px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .04em;
  box-shadow: 0 4px 20px rgba(157,143,255,.35);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.save-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(157,143,255,.5); }
.save-btn:active { transform: translateY(1px); }

/* ── History ── */
.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 12px;
}
.history-header h2 { font-size: 1.05rem; font-weight: 600; }

.filter-btn {
  font-size: .82rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 99px;
  transition: var(--transition);
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent-light); }

.filter-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.filter-panel.hidden { display: none; }
.filter-row { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--text-secondary); flex-wrap: wrap; }
.filter-row input, .filter-row select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 6px 10px;
  font-size: .82rem;
  outline: none;
}
.apply-filter-btn {
  align-self: flex-start;
  background: var(--accent);
  color: #fff;
  padding: 7px 16px;
  border-radius: 99px;
  font-size: .82rem;
  font-weight: 600;
  transition: var(--transition);
}
.apply-filter-btn:hover { background: var(--accent-light); }

/* ── History List ── */
.history-list { display: flex; flex-direction: column; gap: 10px; }

.entry-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.entry-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
}
.entry-card:hover { border-color: var(--accent); transform: translateX(2px); }

.entry-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.entry-datetime { font-size: .78rem; color: var(--text-muted); }
.entry-mood-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 600;
}

.entry-scores {
  display: flex;
  gap: 14px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.entry-score-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .78rem;
  color: var(--text-secondary);
}

.entry-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 6px;
}
.entry-tag {
  padding: 2px 8px;
  border-radius: 99px;
  font-size: .72rem;
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.entry-note-preview {
  font-size: .82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 4px;
}
.entry-note-preview.has-note { color: var(--text-primary); }

.empty-state {
  text-align: center;
  color: var(--text-muted);
  font-size: .9rem;
  padding: 48px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.empty-state i { font-size: 2rem; opacity: .4; }

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
}
.page-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  font-size: .85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: var(--transition);
}
.page-btn.active, .page-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Chart Tab ── */
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 14px;
}
.chart-header h2 { font-size: 1.05rem; font-weight: 600; }
.chart-range-btns { display: flex; gap: 4px; }
.range-btn {
  padding: 5px 11px;
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: var(--transition);
}
.range-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.chart-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.stat-icon { font-size: 1.3rem; }
.stat-label { font-size: .75rem; color: var(--text-secondary); }
.stat-value { font-size: 1.2rem; font-weight: 700; color: #7060cc; }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(100,80,160,.35);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: modalIn .2s ease;
}
.modal-overlay.hidden { display: none; }
@keyframes modalIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 540px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  animation: sheetUp .25s ease;
}
@keyframes sheetUp { from { transform: translateY(60px); } to { transform: none; } }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
.modal-date { font-size: .92rem; font-weight: 600; color: var(--text-secondary); }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1rem;
  transition: var(--transition);
}
.modal-close:hover { background: var(--danger); color: #fff; }

.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 18px; }

.modal-section-title {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 8px;
}

.modal-mood-display {
  display: flex;
  align-items: center;
  gap: 12px;
}
.modal-mood-dot {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.5);
}
.modal-mood-label { font-size: 1.2rem; font-weight: 700; }
.modal-mood-level { font-size: .82rem; color: var(--text-muted); }

.modal-scores-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.modal-score-item {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-score-icon { font-size: 1.1rem; }
.modal-score-info { display: flex; flex-direction: column; }
.modal-score-name { font-size: .72rem; color: var(--text-muted); }
.modal-score-val { font-size: .95rem; font-weight: 600; }

.modal-note-box {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: .88rem;
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}
.modal-no-note { color: var(--text-muted); font-style: italic; font-size: .85rem; }

.modal-tags-display { display: flex; flex-wrap: wrap; gap: 6px; }
.modal-tag-item {
  padding: 4px 12px;
  border-radius: 99px;
  font-size: .78rem;
  background: rgba(157,143,255,.2);
  border: 1px solid rgba(157,143,255,.5);
  color: #7060cc;
}

.modal-sleep-row { display: flex; gap: 20px; }
.modal-sleep-item { display: flex; flex-direction: column; gap: 3px; }
.modal-sleep-label { font-size: .72rem; color: var(--text-muted); }
.modal-sleep-val { font-size: 1rem; font-weight: 600; }

.modal-footer {
  padding: 14px 20px 20px;
  border-top: 1px solid var(--border);
}
.modal-delete-btn {
  color: var(--danger);
  font-size: .85rem;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: .7;
  transition: var(--transition);
}
.modal-delete-btn:hover { opacity: 1; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 12px 22px;
  font-size: .88rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  z-index: 500;
  transition: transform .3s cubic-bezier(.175,.885,.32,1.275), opacity .3s;
  white-space: nowrap;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
}
.toast.hidden { display: none; }

/* ── Mood Color Helpers (via inline style) ── */
.mood-dot[data-level="-3"] { background: var(--manic-3); }
.mood-dot[data-level="-2"] { background: var(--manic-2); }
.mood-dot[data-level="-1"] { background: var(--manic-1); }
.mood-dot[data-level="0"]  { background: var(--stable); }
.mood-dot[data-level="1"]  { background: var(--depressed-1); }
.mood-dot[data-level="2"]  { background: var(--depressed-2); }
.mood-dot[data-level="3"]  { background: var(--depressed-3); }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* ── Responsive ── */
@media (max-width: 400px) {
  .slider-row { grid-template-columns: 22px 68px 1fr 24px; }
  .tab-btn span { display: none; }
  .tab-btn { padding: 8px 16px; }
  .tab-btn i { font-size: 1rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

.log-scroll { overflow-y: auto; }

/* ── 日時入力ラッパー ── */
.datetime-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.datetime-wrap .datetime-input { flex: 1; margin-bottom: 0; }

.now-btn {
  flex-shrink: 0;
  background: linear-gradient(135deg, #c4baff, #a8d8f8);
  color: #5040a0;
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: .82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(157,143,255,.25);
}
.now-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(157,143,255,.4); }
.now-btn.now-flash { background: linear-gradient(135deg, #7de8b8, #a8f0d0); color: #208060; }
.now-btn i { transition: transform .3s; }
.now-btn:active i { transform: rotate(180deg); }

.live-clock {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: .06em;
  text-align: center;
  padding: 6px 0 2px;
  font-variant-numeric: tabular-nums;
}

/* ── 結果タブ ── */
.report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 14px;
}
.report-header h2 { font-size: 1.05rem; font-weight: 600; }

/* サマリーバナー */
.report-summary-banner {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  scrollbar-width: none;
}
.report-summary-banner::-webkit-scrollbar { display: none; }

.rsb-item {
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 80px;
}
.rsb-icon { font-size: 1.4rem; line-height: 1; }
.rsb-label { font-size: .68rem; color: var(--text-muted); }
.rsb-val { font-size: 1rem; font-weight: 700; color: var(--text-primary); }

/* 気分分布バー */
.report-card { margin-bottom: 12px; }
.mood-dist-bars { display: flex; flex-direction: column; gap: 10px; }
.dist-row {
  display: grid;
  grid-template-columns: 24px 90px 1fr 38px;
  align-items: center;
  gap: 8px;
}
.dist-emoji { font-size: 1rem; text-align: center; }
.dist-label { font-size: .78rem; color: var(--text-secondary); white-space: nowrap; }
.dist-bar-wrap {
  height: 10px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
}
.dist-bar {
  height: 100%;
  border-radius: 99px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
  min-width: 4px;
}
.dist-count { font-size: .78rem; color: var(--text-muted); text-align: right; }

/* メモ一覧 */
.report-notes { display: flex; flex-direction: column; gap: 10px; }
.rp-note-item {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  padding-left: 16px;
}
.rp-note-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.rp-note-date { font-size: .72rem; color: var(--text-muted); }
.rp-note-mood { font-size: .75rem; font-weight: 600; }
.rp-note-text {
  font-size: .85rem;
  line-height: 1.65;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* タグ頻度 */
.tag-freq-list { display: flex; flex-direction: column; gap: 9px; }
.tf-row {
  display: grid;
  grid-template-columns: 100px 1fr 28px;
  align-items: center;
  gap: 8px;
}
.tf-tag {
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 600;
  border: 1px solid;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tf-bar-wrap {
  height: 8px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
}
.tf-bar {
  height: 100%;
  border-radius: 99px;
  opacity: .7;
  transition: width .6s cubic-bezier(.4,0,.2,1);
  min-width: 4px;
}
.tf-cnt { font-size: .78rem; color: var(--text-muted); text-align: right; }

/* ── PDF ボタン ── */
.pdf-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: .8rem;
  font-weight: 600;
  background: linear-gradient(135deg, #ffb3cc, #c4baff);
  color: #3a3360;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(157,143,255,.25);
  font-family: inherit;
}
.pdf-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(157,143,255,.4);
}
.pdf-btn:active { transform: translateY(0); }
.pdf-btn i { font-size: .85rem; }
