/* ═══════════════════════════════════════════════
   HABIT OS — Protocol Habit Tracker
   All values use CSS variables for full theme compat
═══════════════════════════════════════════════ */

/* ── Panel layout — fixed viewport fill, internal scroll only ── */
#panel-habits {
  display: none;
  flex-direction: column;
  position: fixed;
  inset: 0;
  z-index: 10;
  padding: 28px 36px 0;
  overflow: hidden;
}
#panel-habits.active {
  display: flex !important;
  height: 100vh;
  max-height: 100vh;
  min-height: 0;
}
/* Suppress #main scroll when habit panel is active */
#main:has(#panel-habits.active) {
  overflow: hidden;
  padding: 0;
  height: 100vh;
  max-height: 100vh;
}
/* Scrollable content area inside panel */
.habit-panel-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-bottom: 40px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

/* ── Header ── */
.habit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.habit-header-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}
.habit-view-btn {
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text2);
  border-radius: var(--rs);
  padding: 6px 10px;
  font-size: 15px;
  cursor: pointer;
  transition: all .15s;
  font-family: var(--ui-font, 'DM Sans', sans-serif);
}
.habit-view-btn.active,
.habit-view-btn:hover {
  background: var(--bg4);
  color: var(--accent);
  border-color: var(--accent);
}
.habit-new-btn {
  font-family: var(--ui-font, 'DM Sans', sans-serif);
}

/* ── Stats strip ── */
.habit-stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.habit-stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px 14px;
  text-align: center;
  transition: border-color .2s;
}
.habit-stat-card:hover {
  border-color: var(--border2);
}
.habit-stat-val {
  font-size: 24px;
  font-weight: 800;
  font-family: 'DM Mono', monospace;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}
.habit-stat-lbl {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-family: var(--ui-font, 'DM Sans', sans-serif);
}

/* ── Section label ── */
.habit-section-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 12px;
  font-family: var(--ui-font, 'DM Sans', sans-serif);
}

/* ── Empty state ── */
.habit-empty {
  text-align: center;
  padding: 80px 20px;
}
.habit-empty-icon { font-size: 52px; margin-bottom: 16px; }
.habit-empty-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  font-family: var(--ui-font, 'DM Sans', sans-serif);
}
.habit-empty-sub {
  font-size: 13px;
  color: var(--text3);
  line-height: 1.6;
}
.habit-kbd {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  color: var(--text2);
}

/* ── Today checklist ── */
.habit-today-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}
.habit-today-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
  cursor: pointer;
  transition: all .18s;
  user-select: none;
}
.habit-today-card:hover {
  background: var(--bg3);
  border-color: var(--border2);
  transform: translateY(-1px);
}
.habit-today-card.done {
  opacity: .7;
}
.habit-today-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.habit-today-info { flex: 1; min-width: 0; }
.habit-today-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--ui-font, 'DM Sans', sans-serif);
}
.habit-today-streak {
  font-size: 11px;
  color: var(--text3);
  font-family: var(--ui-font, 'DM Sans', sans-serif);
}
.habit-today-check {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: transparent;
  transition:
    background     .22s cubic-bezier(.34,1.56,.64,1),
    border-color   .22s ease,
    color          .18s ease,
    transform      .18s cubic-bezier(.34,1.56,.64,1),
    box-shadow     .22s ease;
  flex-shrink: 0;
}
.habit-today-check.done {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 25%, transparent);
}
.habit-today-card:hover .habit-today-check:not(.done) {
  border-color: var(--green);
  transform: scale(1.08);
}

/* Pop animation shared by circle checks */
@keyframes habitCheckPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.28); }
  70%  { transform: scale(.92); }
  100% { transform: scale(1); }
}
.habit-check-pop {
  animation: habitCheckPop .36s cubic-bezier(.34,1.56,.64,1) forwards !important;
}

/* Ripple burst on the today card when marked done */
@keyframes habitCardFlash {
  0%   { box-shadow: 0 0 0 0px color-mix(in srgb, var(--green) 40%, transparent); }
  60%  { box-shadow: 0 0 0 8px color-mix(in srgb, var(--green) 0%, transparent); }
  100% { box-shadow: none; }
}
.habit-today-card.done {
  opacity: .75;
  animation: habitCardFlash .5s ease forwards;
}

/* ── Grid cards — layout and base re-defined below in "larger, richer" block ── */
.habit-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.habit-card-meta { flex: 1; min-width: 0; }
.habit-card-freq {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 3px;
  font-family: var(--ui-font, 'DM Sans', sans-serif);
}
.habit-card-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity .15s;
}
.habit-card:hover .habit-card-actions { opacity: 1; }
.habit-card-edit, .habit-card-del {
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text2);
  border-radius: 6px;
  width: 28px; height: 28px;
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s;
  font-family: var(--ui-font, 'DM Sans', sans-serif);
}
.habit-card-edit:hover { color: var(--accent); border-color: var(--accent); }
.habit-card-del:hover  { color: var(--red);    border-color: var(--red); }

/* ── Habit card: larger, richer ── */
.habit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}
.habit-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px 20px 18px;
  transition: border-color .2s, box-shadow .25s, transform .18s;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
}
.habit-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--hc, var(--accent));
  opacity: .7;
  border-radius: 18px 18px 0 0;
}
.habit-card:hover {
  border-color: var(--border2);
  box-shadow: 0 8px 32px rgba(0,0,0,.28);
  transform: translateY(-2px);
}
.habit-card.done { opacity: .82; }
.habit-card-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}
.habit-card-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--ui-font, 'DM Sans', sans-serif);
  letter-spacing: -.01em;
}

/* Freq badge / day pills */
.habit-freq-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid;
  font-family: var(--ui-font, 'DM Sans', sans-serif);
}
.habit-card-days-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 3px;
}
.habit-day-pill {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 2px 7px;
  border-radius: 99px;
  border: 1px solid;
  font-family: var(--ui-font, 'DM Sans', sans-serif);
  text-transform: uppercase;
}

/* Progress ring */
.habit-ring {
  flex-shrink: 0;
  margin-right: 2px;
}

/* Stats row */
.habit-card-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.habit-card-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg3);
  border-radius: 10px;
  padding: 8px 6px 6px;
  border: 1px solid var(--border);
}
.habit-card-stat-val {
  font-size: 18px;
  font-weight: 800;
  font-family: 'DM Mono', monospace;
  color: var(--text);
  line-height: 1;
}
.habit-card-stat-lbl {
  font-size: 9px;
  color: var(--text3);
  letter-spacing: .04em;
  margin-top: 3px;
  font-family: var(--ui-font, 'DM Sans', sans-serif);
  text-align: center;
}

/* 7-day week tracker with labels */
.habit-week-track {
  display: flex;
  gap: 4px;
  align-items: flex-start;
  justify-content: space-between;
}
.habit-week-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.habit-week-dot {
  width: 100%;
  aspect-ratio: 1;
  max-width: 32px;
  border-radius: 6px;
  background: var(--border);
  transition: all .15s;
  position: relative;
}
.habit-week-dot.done {
  /* bg set inline */
  border-radius: 8px;
}
.habit-week-dot.off {
  opacity: .18;
}
.habit-week-dot.today {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.habit-week-lbl {
  font-size: 9px;
  font-weight: 700;
  color: var(--text3);
  font-family: 'DM Mono', monospace;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.habit-week-lbl.today {
  color: var(--accent);
}

/* 30-day progress bar */
.habit-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.habit-progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.habit-progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .4s cubic-bezier(.22,1,.36,1);
}
.habit-progress-lbl {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--ui-font, 'DM Sans', sans-serif);
}

/* Legacy mini-bar kept for list-view */
.habit-mini-bar {
  display: flex;
  gap: 3px;
  align-items: center;
}
.habit-mini-dot {
  width: 14px; height: 14px;
  border-radius: 3px;
  background: var(--border);
  transition: all .15s;
  flex-shrink: 0;
}
.habit-mini-dot.done { /* color set inline */ }
.habit-mini-dot.off { opacity: .25; }
.habit-mini-dot.today {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Toggle button */
.habit-toggle-btn {
  width: 100%;
  padding: 9px;
  border-radius: 8px;
  border: 1.5px solid var(--border2);
  background: transparent;
  color: var(--text2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background   .22s cubic-bezier(.34,1.56,.64,1),
    border-color .22s ease,
    color        .18s ease,
    box-shadow   .22s ease,
    transform    .18s cubic-bezier(.34,1.56,.64,1);
  font-family: var(--ui-font, 'DM Sans', sans-serif);
  letter-spacing: .02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  position: relative;
  overflow: hidden;
}
.habit-toggle-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: currentColor;
  opacity: 0;
  transition: opacity .15s;
}
.habit-toggle-btn:hover {
  background: var(--bg3);
  transform: translateY(-1px);
}
.habit-toggle-btn:active {
  transform: scale(.97);
}
.habit-toggle-btn.done {
  /* bg + color set inline, shadow from colour */
  box-shadow: 0 2px 12px color-mix(in srgb, currentColor 35%, transparent);
}

/* Pop keyframe: subtle scale-bounce on confirm */
@keyframes habitBtnPop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.06); }
  65%  { transform: scale(.97); }
  100% { transform: scale(1); }
}
.habit-btn-pop {
  animation: habitBtnPop .38s cubic-bezier(.34,1.56,.64,1) forwards !important;
}

/* Tick draw-in for the ✓ inside the done button */
@keyframes habitTickDraw {
  0%   { opacity: 0; transform: scale(.5) rotate(-15deg); }
  60%  { opacity: 1; transform: scale(1.15) rotate(3deg); }
  100% { opacity: 1; transform: scale(1)    rotate(0deg); }
}
.habit-btn-tick {
  display: inline-block;
}
.habit-tick-draw {
  animation: habitTickDraw .32s cubic-bezier(.34,1.56,.64,1) forwards;
}

.habit-not-today {
  font-size: 11px;
  color: var(--text3);
  text-align: center;
  padding: 6px;
  font-style: italic;
  font-family: var(--ui-font, 'DM Sans', sans-serif);
}

/* ── List view ── */
.habit-list { display: flex; flex-direction: column; gap: 6px; }
.habit-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--rs);
  padding: 12px 14px;
  transition: all .15s;
}
.habit-list-row:hover { background: var(--bg3); border-color: var(--border2); }
.habit-list-row.done { opacity: .7; }
.habit-list-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.habit-list-info { flex: 1; min-width: 0; }
.habit-list-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  font-family: var(--ui-font, 'DM Sans', sans-serif);
}
.habit-list-sub {
  font-size: 11px;
  color: var(--text3);
  margin-top: 1px;
  font-family: var(--ui-font, 'DM Sans', sans-serif);
}
.habit-list-actions {
  display: flex; align-items: center; gap: 6px;
}
.habit-toggle-sm {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border2);
  background: transparent;
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition:
    background     .22s cubic-bezier(.34,1.56,.64,1),
    border-color   .22s ease,
    color          .18s ease,
    transform      .18s cubic-bezier(.34,1.56,.64,1),
    box-shadow     .22s ease;
  font-family: var(--ui-font, 'DM Sans', sans-serif);
  color: var(--text2);
}
.habit-toggle-sm:hover:not(.done) {
  transform: scale(1.1);
  border-color: currentColor;
}
.habit-toggle-sm.done {
  color: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent);
}

/* Stat value bump when streak increments */
@keyframes habitStatBump {
  0%   { transform: scale(1);    opacity: 1; }
  40%  { transform: scale(1.18); opacity: 1; }
  100% { transform: scale(1);    opacity: 1; }
}
.habit-stat-bump {
  animation: habitStatBump .35s cubic-bezier(.34,1.56,.64,1) forwards;
}

/* ── Heatmap ── */
.habit-heatmap {
  padding-top: 4px;
}
.heatmap-months {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  margin-bottom: 2px;
  padding-left: 14px;
}
.heatmap-month-lbl {
  font-size: 9px;
  color: var(--text3);
  font-family: 'DM Mono', monospace;
  white-space: nowrap;
}
.heatmap-body {
  display: flex;
  gap: 2px;
  align-items: flex-start;
}
.heatmap-days {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-top: 1px;
  flex-shrink: 0;
}
.heatmap-days span {
  font-size: 8px;
  color: var(--text3);
  line-height: 10px;
  font-family: 'DM Mono', monospace;
  width: 10px;
  text-align: right;
}
.heatmap-grid {
  display: grid;
  grid-template-rows: repeat(7, 10px);
  grid-auto-flow: column;
  gap: 1px;
  flex: 1;
}
.heatmap-cell {
  width: 100%;
  height: 10px;
  border-radius: 2px;
  transition: opacity .1s;
}
.heatmap-cell:hover { opacity: .8 !important; }

/* ── Modal ── */
#habit-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .18s;
}
#habit-modal.open {
  opacity: 1; pointer-events: all;
}
#habit-modal-box {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 18px;
  padding: 28px 26px 24px;
  width: min(500px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 12px 60px rgba(0,0,0,.5);
  position: relative;
}
.habit-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.habit-modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  font-family: var(--ui-font, 'DM Sans', sans-serif);
}
.habit-modal-close {
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text2);
  border-radius: 50%;
  width: 30px; height: 30px;
  cursor: pointer;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s;
  font-family: var(--ui-font, 'DM Sans', sans-serif);
}
.habit-modal-close:hover { color: var(--red); border-color: var(--red); }
.habit-modal-field { margin-bottom: 16px; }
.habit-modal-lbl {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 8px;
  font-family: var(--ui-font, 'DM Sans', sans-serif);
}
.habit-modal-inp {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  padding: 11px 14px;
  font-family: var(--ui-font, 'DM Sans', sans-serif);
  transition: border-color .18s;
  outline: none;
}
.habit-modal-inp:focus { border-color: var(--accent); }

/* Icon grid */
.habit-icon-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}
.habit-icon-opt {
  width: 40px; height: 40px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: all .12s;
  background: var(--bg3);
}
.habit-icon-opt:hover { border-color: var(--border2); transform: scale(1.08); }
.habit-icon-opt.selected {
  /* border + bg set inline */
}

/* Color grid */
.habit-color-grid {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.habit-color-swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform .12s;
}
.habit-color-swatch:hover { transform: scale(1.15); }
.habit-color-swatch.selected { transform: scale(1.15); }

/* Freq options */
.habit-freq-opts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.habit-freq-opt {
  padding: 7px 14px;
  border-radius: 99px;
  border: 1.5px solid var(--border2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  color: var(--text2);
  background: var(--bg3);
  font-family: var(--ui-font, 'DM Sans', sans-serif);
}
.habit-freq-opt:hover { border-color: var(--border2); color: var(--text); }

/* Day grid */
.habit-day-grid {
  display: flex;
  gap: 6px;
}
.habit-day-opt {
  flex: 1;
  padding: 7px 4px;
  border-radius: 8px;
  border: 1.5px solid var(--border2);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  color: var(--text2);
  background: var(--bg3);
  text-align: center;
  font-family: var(--ui-font, 'DM Sans', sans-serif);
}
.habit-day-opt:hover { border-color: var(--border2); color: var(--text); }

/* Modal actions */
.habit-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ── Daily panel reminders ── */
.habit-daily-section {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 14px;
  margin-bottom: 16px;
}
.habit-daily-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
  margin-bottom: 8px;
  font-family: var(--ui-font, 'DM Sans', sans-serif);
}
.habit-daily-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.habit-daily-item:last-child { border-bottom: none; }
.habit-daily-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: all .15s;
}
.habit-daily-icon {
  font-size: 16px;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
}
.habit-daily-info { flex: 1; min-width: 0; }
.habit-daily-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--ui-font, 'DM Sans', sans-serif);
  transition: all .15s;
}
.habit-daily-name.done {
  text-decoration: line-through;
  color: var(--text3);
}
.habit-daily-streak {
  font-size: 10px;
  color: var(--text3);
  font-family: var(--ui-font, 'DM Sans', sans-serif);
}
.habit-daily-check {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--border2);
  background: transparent;
  font-size: 14px;
  cursor: pointer;
  transition:
    background   .22s cubic-bezier(.34,1.56,.64,1),
    border-color .22s ease,
    color        .18s ease,
    transform    .18s cubic-bezier(.34,1.56,.64,1),
    box-shadow   .22s ease;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-family: var(--ui-font, 'DM Sans', sans-serif);
}
.habit-daily-check.done {
  color: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent);
}
.habit-daily-check:hover:not(.done) {
  transform: scale(1.12);
  border-color: var(--accent);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  #panel-habits { padding: 16px 14px 0; }
  .habit-stats-strip { grid-template-columns: repeat(2, 1fr); }
  .habit-grid { grid-template-columns: 1fr; }
  .habit-icon-grid { grid-template-columns: repeat(6, 1fr); }
  .habit-day-grid { flex-wrap: wrap; }
  .habit-today-grid { grid-template-columns: 1fr; }
  .habit-heatmap { display: none; } /* too small on mobile */
}
