/* Notion-inspired tokens */
:root {
  --bg: #ffffff;
  --text: #37352f;
  --text-secondary: rgba(55, 53, 47, 0.65);
  --text-tertiary: rgba(55, 53, 47, 0.45);
  --hover: rgba(55, 53, 47, 0.06);
  --hover-strong: rgba(55, 53, 47, 0.09);
  --divider: rgba(55, 53, 47, 0.09);
  --border: rgba(55, 53, 47, 0.16);
  --accent: #2383e2;
  --accent-bg: rgba(35, 131, 226, 0.14);
  --danger: #e03e3e;
  --success-bg: #2383e2;

  --radius-sm: 3px;
  --radius: 6px;
  --tab-height: 56px;
  --content-max: 640px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191919;
    --text: rgba(255, 255, 255, 0.81);
    --text-secondary: rgba(255, 255, 255, 0.56);
    --text-tertiary: rgba(255, 255, 255, 0.4);
    --hover: rgba(255, 255, 255, 0.055);
    --hover-strong: rgba(255, 255, 255, 0.09);
    --divider: rgba(255, 255, 255, 0.09);
    --border: rgba(255, 255, 255, 0.14);
    --accent: #529cca;
    --accent-bg: rgba(82, 156, 202, 0.2);
    --danger: #ff7369;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    "Inter", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--tab-height) + env(safe-area-inset-bottom));
}

/* --- Page header (Notion-style page title) --- */

.page-header {
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 40px) 24px 18px;
}

.page-icon {
  font-size: 50px;
  line-height: 1;
  margin-bottom: 10px;
  user-select: none;
}

.page-title {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-meta {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-sep {
  color: var(--text-tertiary);
}

/* --- Main content --- */

main {
  flex: 1;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 10px 24px 32px;
}

.view[hidden] { display: none; }

.block-title {
  margin: 28px 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0;
  text-transform: none;
}
.block-title:first-child { margin-top: 6px; }

/* --- Today: check rows --- */

.habit-list {
  list-style: none;
  padding: 0;
  margin: 6px 0 20px;
  display: flex;
  flex-direction: column;
}

.habit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  margin: 0 -8px;
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
  transition: background-color 80ms ease;
  -webkit-tap-highlight-color: transparent;
}

.habit-row:hover { background: var(--hover); }
.habit-row:active { background: var(--hover-strong); }

.toggle-indicator {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  transition: background-color 80ms ease, border-color 80ms ease;
}

.habit-row[aria-pressed="true"] .toggle-indicator {
  background: var(--habit-color, var(--accent));
  border-color: var(--habit-color, var(--accent));
  color: #ffffff;
}

.habit-label {
  font-size: 15px;
  color: var(--text);
}

.habit-row[aria-pressed="true"] .habit-label {
  color: var(--text-secondary);
  text-decoration: line-through;
  text-decoration-color: var(--text-tertiary);
}

/* --- Buttons --- */

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 14px;
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 80ms ease, background-color 80ms ease;
}
.primary-btn:hover { opacity: 0.92; }
.primary-btn:active { opacity: 0.85; }

.primary-btn.compact { padding: 4px 12px; min-height: 32px; font-size: 14px; }

.ghost-btn {
  background: transparent;
  color: var(--text-tertiary);
  border: none;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 80ms ease, color 80ms ease;
  min-height: 32px;
}
.ghost-btn:hover { background: var(--hover); color: var(--danger); }

.ghost-btn.pending {
  background: var(--danger);
  color: #ffffff;
}
.ghost-btn.pending:hover {
  background: var(--danger);
  color: #ffffff;
  opacity: 0.92;
}

/* --- History: habit × day grid --- */

.habit-grid {
  display: grid;
  gap: 2px;
  margin: 4px 0 14px;
}

.habit-grid-cell {
  aspect-ratio: 1 / 1;
  border-radius: 2px;
  background: var(--hover-strong);
  transition: background-color 100ms ease;
}
.habit-grid-cell[data-today="true"] {
  box-shadow: inset 0 0 0 1px var(--text);
}

.habit-legend {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-secondary);
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.legend-label {
  line-height: 1.3;
}

.history-list {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  display: flex;
  flex-direction: column;
}

.history-item {
  padding: 10px 8px;
  margin: 0 -8px;
  border-radius: var(--radius);
  border-top: 1px solid var(--divider);
}
.history-item:first-child { border-top: none; }

.history-date {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.history-summary {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.history-empty {
  padding: 12px 0;
  font-size: 14px;
  color: var(--text-tertiary);
}

/* --- Habits edit --- */

.habits-edit-list {
  list-style: none;
  padding: 0;
  margin: 6px 0 14px;
  display: flex;
  flex-direction: column;
}

.habit-edit-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 4px 8px;
  margin: 0 -8px;
  border-radius: var(--radius);
  transition: background-color 80ms ease;
}
.habit-edit-row:hover { background: var(--hover); }

.habit-edit-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.habit-edit-row input[type="text"] {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  padding: 8px 0;
  min-width: 0;
  font-family: inherit;
}
.habit-edit-row input[type="text"]:focus { outline: none; }

.add-habit {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 0;
  margin: 0 -8px;
  border-top: 1px solid var(--divider);
  padding-top: 10px;
}

.add-habit input[type="text"] {
  flex: 1;
  min-height: 36px;
  padding: 6px 8px;
  background: transparent;
  color: var(--text);
  border: none;
  font-size: 15px;
  font-family: inherit;
}
.add-habit input[type="text"]::placeholder { color: var(--text-tertiary); }
.add-habit input[type="text"]:focus { outline: none; }

/* --- Tab bar --- */

.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: calc(var(--tab-height) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--divider);
  z-index: 10;
}

.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  min-width: 0;
  -webkit-tap-highlight-color: transparent;
  transition: color 80ms ease;
}

.tab[aria-selected="true"] { color: var(--text); }
.tab:active { color: var(--text-secondary); }

/* --- Auth gate (bulletproof: driven by .auth-required on <html>) --- */

.auth-required .page-header,
.auth-required main,
.auth-required .tab-bar { display: none !important; }

html:not(.auth-required) #view-auth { display: none !important; }

/* --- Auth view --- */

.auth-view {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top) + 24px) 24px 24px;
}
.auth-view[hidden] { display: none; }

.auth-card {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.auth-title {
  margin: 6px 0 4px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-sub {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-form input[type="email"] {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
}
.auth-form input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
}

.auth-form .primary-btn {
  width: 100%;
  min-height: 40px;
}

.auth-status {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
  min-height: 1.45em;
}
.auth-status[data-kind="success"] { color: var(--accent); }
.auth-status[data-kind="error"] { color: var(--danger); }

/* --- Account / logout in habits tab --- */

.account-btn {
  margin: 6px 0 24px;
  padding: 6px 8px;
}

/* --- Reminder settings (Habits tab) --- */

.reminder-settings {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0 20px;
}

.reminder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 4px;
  font-size: 15px;
  color: var(--text-primary);
}

.reminder-label {
  flex: 1;
}

.reminder-toggle {
  appearance: none;
  -webkit-appearance: none;
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: var(--hover);
  position: relative;
  cursor: pointer;
  transition: background-color 120ms ease;
}
.reminder-toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 120ms ease;
}
.reminder-toggle:checked {
  background: var(--accent, #2375CE);
}
.reminder-toggle:checked::after {
  transform: translateX(18px);
}
.reminder-toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.reminder-time {
  appearance: none;
  -webkit-appearance: none;
  background: var(--hover);
  border: none;
  border-radius: var(--radius);
  padding: 6px 10px;
  font: inherit;
  color: var(--text-primary);
  min-width: 100px;
  text-align: right;
}
.reminder-time:disabled { opacity: 0.5; }

.reminder-status {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
  min-height: 1.45em;
}
.reminder-status[data-kind="ok"] { color: var(--accent); }
.reminder-status[data-kind="warn"] { color: var(--danger); }
.reminder-status[data-kind="hint"] { color: var(--text-secondary); }
.reminder-status[data-kind="muted"] { color: var(--text-secondary); }

/* --- Date navigation (Tag view) --- */

.date-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 -8px 6px;
}

.date-arrow {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 22px;
  line-height: 1;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 80ms ease, color 80ms ease, opacity 80ms ease;
}
.date-arrow:hover { background: var(--hover); color: var(--text); }
.date-arrow:disabled { opacity: 0.25; cursor: default; }

.date-label {
  flex: 1;
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 80ms ease;
}
.date-label:hover { background: var(--hover); }
.date-label.is-today { color: var(--text-secondary); cursor: default; }
.date-label.is-today:hover { background: transparent; }

/* --- Auto-save status pill --- */

.day-status {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-tertiary);
  min-height: 1.2em;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 140ms ease, transform 140ms ease;
}
.day-status.visible { opacity: 1; transform: none; }

/* --- Tagesreflexion (collapsible) --- */

/* .reflection carries .card now — box styling comes from .card */

.reflection-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.reflection-caret {
  display: inline-block;
  color: var(--text-tertiary);
  transition: transform 120ms ease;
}
.reflection.open .reflection-caret { transform: rotate(90deg); }

.reflection-hint {
  margin-left: auto;
  font-weight: 400;
  color: var(--text-tertiary);
}

.reflection-body {
  display: none;
  flex-direction: column;
  padding: 4px 0 16px;
}
.reflection.open .reflection-body {
  display: flex;
  animation: reflection-in 140ms ease;
}
@keyframes reflection-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.field-label {
  margin: 14px 0 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}
.field-label:first-child { margin-top: 0; }

.reflection-input {
  width: 100%;
  resize: vertical;
  min-height: 44px;
  padding: 10px 12px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.45;
}
.reflection-input::placeholder { color: var(--text-tertiary); }
.reflection-input:focus { outline: none; border-color: var(--accent); }

/* --- Mood scale 1–5 --- */

.mood-scale { display: flex; gap: 8px; }

.mood-dot {
  flex: 1;
  appearance: none;
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  height: 44px;
  border-radius: var(--radius);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 90ms ease, border-color 90ms ease,
    color 90ms ease, transform 90ms ease;
}
.mood-dot:hover { background: var(--hover); }
.mood-dot:active { transform: scale(0.94); }
.mood-dot.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

/* --- History: clickable cells & reflection markers --- */

.habit-grid-cell {
  appearance: none;
  border: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.history-item {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.history-item:hover { background: var(--hover); }

.history-date {
  display: flex;
  align-items: center;
  gap: 8px;
}
.history-mood {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
}
.history-reflection-mark {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* --- Start dashboard --- */

/* Shared card primitive — used by every view so the subpages match the
   Start dashboard. `.dash-card` kept as an alias (Start markup unchanged). */
.card,
.dash-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 14px 16px;
  margin-bottom: 12px;
}
.card:first-child,
.dash-card:first-child { margin-top: 4px; }

.card-head,
.dash-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.card-title,
.dash-card-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
}
.card-meta,
.dash-card-meta {
  font-size: 12px;
  color: var(--text-tertiary);
}

.dash-empty {
  margin: 0;
  font-size: 13px;
  color: var(--text-tertiary);
}

/* Heute — quick-entry pills (chip-weight, per approved mockup v3) */
.dash-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dash-pill {
  appearance: none;
  font-family: inherit;
  font-size: 12px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 90ms ease, color 90ms ease,
    border-color 90ms ease, transform 90ms ease;
}
.dash-pill:hover { background: var(--hover); }
.dash-pill:active { transform: scale(0.96); }
.dash-pill.on {
  color: #ffffff;
  border-color: transparent;
}

/* Konsistenz — per-habit bars */
.dash-legend {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-tertiary);
  margin-bottom: 5px;
}
.dash-bar {
  height: 8px;
  border-radius: 5px;
  background: var(--hover);
  overflow: hidden;
  margin-bottom: 11px;
}
.dash-bar:last-child { margin-bottom: 0; }
.dash-bar > div {
  height: 100%;
  border-radius: 5px;
  transition: width 200ms ease;
}

/* Streaks — chips */
.dash-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.dash-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--hover);
  padding: 5px 10px;
  border-radius: 999px;
}
.dash-chip.muted { color: var(--text-tertiary); }

/* Stimmung — sparkline */
.dash-mood-svg {
  width: 100%;
  height: auto;
  display: block;
}
.dash-mood-foot {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 8px;
}
.dash-mood-avg {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* --- Statistik / Report --- */

.period-sel {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 4px 0 16px;
}
.period-pill {
  appearance: none;
  font-family: inherit;
  font-size: 12px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 90ms ease, color 90ms ease, border-color 90ms ease;
}
.period-pill:hover { background: var(--hover); }
.period-pill.on {
  background: var(--accent);
  border-color: transparent;
  color: #ffffff;
}

.stat-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.stat-tile {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
.stat-tile-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.stat-tile-label {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-secondary);
}

.stats-svg { width: 100%; height: auto; display: block; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-wd {
  text-align: center;
  font-size: 11px;
  color: var(--text-tertiary);
  padding-bottom: 2px;
}
.cal-day {
  appearance: none;
  font-family: inherit;
  font-size: 13px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: var(--hover);
  color: var(--text-secondary);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 90ms ease, color 90ms ease;
}
.cal-day:disabled { opacity: 0.3; cursor: default; }
.cal-day.partial {
  background: var(--accent-bg);
  color: var(--text);
}
.cal-day.perfect {
  background: var(--accent);
  color: #ffffff;
}
.cal-day.is-today { box-shadow: inset 0 0 0 1.5px var(--text); }

/* --- Day overlay (past-day capture from Statistik) --- */

.day-overlay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}
.day-back {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--accent);
  font-family: inherit;
  font-size: 14px;
  padding: 6px 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.day-overlay-head .date-nav { margin: 0; flex: 0 0 auto; }
.day-overlay-head .date-label { flex: 0 0 auto; cursor: default; }

/* --- Reflexionen list (Statistik) --- */

.refl-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  appearance: none;
  background: transparent;
  border: none;
  border-top: 1px solid var(--divider);
  padding: 10px 4px;
  font-family: inherit;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.refl-row:first-child { border-top: none; }
.refl-row:hover { background: var(--hover); }
.refl-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #6940a5;
  flex-shrink: 0;
}
.refl-dot.muted { background: var(--text-tertiary); }
.refl-tx { flex: 1; min-width: 0; }
.refl-date { font-size: 13px; color: var(--text); }
.refl-snip {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.refl-cv { color: var(--text-tertiary); flex-shrink: 0; }

/* --- Per-Habit-Detail (Increment C) --- */

.habit-detail-btn {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 19px;
  line-height: 1;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 80ms ease, color 80ms ease;
}
.habit-detail-btn:hover { background: var(--hover); color: var(--text); }

.habit-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  padding: 8px 10px;
}
.habit-name-dot {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* Habit-detail calendar is read-only (non-interactive cells). */
#habit-cal .cal-day { cursor: default; }
#habit-cal .cal-day.done { background: var(--accent); color: #ffffff; }
#habit-cal .cal-day.fut { opacity: 0.3; }

/* --- Ember brand mark (replaces the 📊 emoji in .page-icon) --- */
.page-icon svg {
  display: block;
  width: 50px;
  height: 50px;
}
@media (prefers-color-scheme: dark) {
  .page-icon .em-base { fill: #39435F; }
  .page-icon .em-core { fill: #FFE3A6; }
}

