* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #faf8f4;
  color: #1a1a1a;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Safe area pour iPhone (notch / Dynamic Island / home bar) */
#panel-maison {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ============================================================
   Barre de titre macOS + Tab nav — zone sombre unifiée
   ============================================================ */

.titlebar {
  height: 38px;
  -webkit-app-region: drag;
  flex-shrink: 0;
  background: #1a1a1a;
}

.tab-nav {
  display: flex;
  padding: 0 16px;
  background: #1a1a1a;
  flex-shrink: 0;
}

.tab-btn {
  padding: 9px 16px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #5c5c5c;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  letter-spacing: 0.04em;
  transition: color 0.15s, border-color 0.15s;
  -webkit-app-region: no-drag;
}

.tab-btn:hover { color: #c8c4bc; }

.tab-btn.active {
  color: #faf8f4;
  border-bottom-color: #EAB308;
}

/* ============================================================
   Panels
   ============================================================ */

#panel-todos {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#panel-habits {
  flex: 1;
  overflow-y: auto;
  flex-direction: column;
  display: none;
  font-family: 'Georgia', serif;
  background: #faf8f4;
  color: #1a1a1a;
}

#panel-maison {
  flex: 1;
  overflow-y: auto;
  display: none;
  background: #faf8f4;
}

/* ============================================================
   Todos — dark header
   ============================================================ */

.todos-top {
  background: #1a1a1a;
  padding: 14px 20px 16px;
  flex-shrink: 0;
}

.todos-top .header { margin-bottom: 12px; }
.todos-top .date-label { color: #808080; }
.todos-top .title { color: #faf8f4; }
.todos-top .settings-btn { color: #faf8f4; }

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.todos-legend {
  display: flex;
  gap: 8px;
}

.todos-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(250,248,244,0.5);
  letter-spacing: 0.04em;
}

.todos-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-CN    { background: #3b82f6; }
.dot-COM   { background: #EAB308; }
.dot-Perso { background: #10b981; }
.todos-top .settings-btn:hover { background: rgba(255,255,255,0.08); }
.todos-top .progress-info { color: rgba(250,248,244,0.5); }
.todos-top .progress-bar { background: rgba(255,255,255,0.12); }
.todos-top .progress-fill { background: #EAB308; }

/* ============================================================
   Contenu scrollable
   ============================================================ */

.container {
  flex: 1;
  overflow: auto;
  padding: 20px 24px 24px;
  background: #faf8f4;
}

/* ============================================================
   Planning grid (Todos)
   ============================================================ */

.todo-planning-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(140px, 1fr));
  gap: 12px;
  min-width: 700px;
}

.todo-day-col {
  background: #fff;
  border-radius: 14px;
  padding: 14px 12px;
  border: 1.5px solid #e8e4dc;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s;
}

.todo-day-col.is-today {
  border-color: #EAB308;
  border-width: 2px;
}

.todo-day-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.todo-day-name {
  font-size: 10px;
  font-weight: 800;
  color: #b0a898;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.todo-day-col.is-today .todo-day-name { color: #EAB308; }

.todo-day-num {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.1;
  margin-top: 1px;
}

.todo-day-col.is-today .todo-day-num { color: #1a1a1a; }

.todo-day-count {
  font-size: 11px;
  color: #a8a29e;
  background: #f0ede8;
  border-radius: 99px;
  padding: 2px 7px;
  font-family: sans-serif;
  align-self: flex-start;
}

.todo-day-tasks {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  margin-bottom: 6px;
}

.todo-day-empty {
  color: #d4cfc8;
  font-size: 14px;
  text-align: center;
  padding: 12px 0;
}

/* Task pills */
.todo-task-pill {
  border-radius: 8px;
  padding: 7px 8px;
  border-left: 3px solid #e8e4dc;
  background: #faf8f4;
  display: flex;
  align-items: flex-start;
  gap: 5px;
  animation: slideIn 0.15s ease;
}

.todo-task-pill.done { opacity: 0.42; }

.cat-pill-CN    { background: #dbeafe; border-left-color: #3b82f6; }
.cat-pill-CN .pill-text { color: #1e3a8a; }

.cat-pill-COM   { background: #fef3c7; border-left-color: #EAB308; }
.cat-pill-COM .pill-text { color: #78350f; }

.cat-pill-Perso { background: #dcfce7; border-left-color: #10b981; }
.cat-pill-Perso .pill-text { color: #064e3b; }

.todo-task-pill.done { background: #f5f4f2 !important; border-left-color: #e0dcd4 !important; }
.todo-task-pill.done .pill-text { color: #bbb !important; }

.pill-check {
  width: 16px;
  height: 16px;
  min-width: 16px;
  border-radius: 50%;
  border: 1.5px solid #d0d0c8;
  background: transparent;
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
  margin-top: 1px;
  flex-shrink: 0;
}

.pill-check.checked {
  background: #1a1a1a;
  border-color: #1a1a1a;
}

.pill-text {
  flex: 1;
  font-size: 12px;
  line-height: 1.4;
  color: #1a1a1a;
  word-break: break-word;
  min-width: 0;
  cursor: text;
}
.pill-text:hover { text-decoration: underline dotted #aaa; }

.todo-task-pill.done .pill-text {
  text-decoration: line-through;
  color: #bbb;
}

.pill-cat-sub {
  display: block;
  font-size: 9px;
  font-weight: 700;
  opacity: 0.6;
  margin-top: 3px;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.pill-delete {
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s;
}

.pill-delete:hover { color: #ef4444; }

/* + Add button */
.todo-day-add-btn {
  width: 100%;
  font-size: 18px;
  background: none;
  border: 1.5px dashed #e8e4dc;
  border-radius: 8px;
  color: #EAB308;
  cursor: pointer;
  padding: 4px;
  transition: border-color 0.15s;
  margin-top: auto;
}

.todo-day-add-btn:hover { border-color: #EAB308; }

/* Inline add form */
.todo-add-inline {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: auto;
}

.todo-add-input {
  width: 100%;
  font-size: 12px;
  padding: 5px 7px;
  border-radius: 7px;
  border: 1.5px solid #EAB308;
  font-family: inherit;
  box-sizing: border-box;
  outline: none;
  background: white;
}

.todo-cat-row {
  display: flex;
  gap: 3px;
}

.todo-cat-mini {
  flex: 1;
  padding: 3px 0;
  border: 1px solid #e0e0d8;
  border-radius: 6px;
  background: white;
  font-size: 10px;
  font-weight: 700;
  color: #999;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
}

.todo-cat-mini.cat-mini-CN    { background: #dbeafe; border-color: #93c5fd; color: #1e3a8a; }
.todo-cat-mini.cat-mini-COM   { background: #fef3c7; border-color: #fcd34d; color: #78350f; }
.todo-cat-mini.cat-mini-Perso { background: #dcfce7; border-color: #6ee7b7; color: #064e3b; }

.todo-cat-mini.cat-mini-CN.active    { background: #3b82f6; border-color: #3b82f6; color: white; }
.todo-cat-mini.cat-mini-COM.active   { background: #EAB308; border-color: #EAB308; color: #78350f; }
.todo-cat-mini.cat-mini-Perso.active { background: #10b981; border-color: #10b981; color: white; }

.todo-add-actions {
  display: flex;
  gap: 4px;
}

.todo-submit-btn {
  flex: 1;
  padding: 4px 0;
  background: #1a1a1a;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}

.todo-submit-btn:hover { background: #333; }

.todo-cancel-btn {
  padding: 4px 8px;
  background: #f0ede8;
  color: #888;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.date-label {
  font-size: 12px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.title {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a1a;
  margin-top: 2px;
}

.settings-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  padding: 4px;
  border-radius: 8px;
  transition: background 0.15s;
  -webkit-app-region: no-drag;
}

.settings-btn:hover { background: rgba(0,0,0,0.06); }

/* Progress */
.progress-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #666;
}

.progress-bar {
  height: 5px;
  background: #e8e4dc;
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #EAB308;
  border-radius: 99px;
  transition: width 0.4s ease;
}

/* ============================================================
   Sélecteur de date
   ============================================================ */

.date-picker {
  display: flex;
  gap: 5px;
  margin-bottom: 8px;
}

.date-pill {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  border: 1.5px solid #e8e8e0;
  border-radius: 10px;
  background: white;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.date-pill:hover {
  border-color: #c8c4bc;
  background: #f5f2ec;
}

.date-pill.active {
  background: #1a1a1a;
  border-color: #1a1a1a;
}

.date-pill-label {
  font-size: 11px;
  font-weight: 700;
  color: #666;
  text-transform: capitalize;
}

.date-pill.active .date-pill-label { color: white; }

.date-pill-count {
  font-size: 12px;
  font-weight: 700;
  color: #1a1a1a;
  background: #e8e4dc;
  border-radius: 99px;
  padding: 0 5px;
  min-width: 18px;
  text-align: center;
}

.date-pill.active .date-pill-count {
  color: #1a1a1a;
  background: white;
}

/* ============================================================
   Formulaire ajout
   ============================================================ */

.add-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.add-row {
  display: flex;
  gap: 8px;
}

.add-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid #e0e0d8;
  border-radius: 10px;
  font-size: 14px;
  background: white;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.add-input:focus {
  border-color: #EAB308;
  box-shadow: 0 0 0 3px rgba(234,179,8,0.12);
}

.add-btn {
  padding: 10px 18px;
  background: #EAB308;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(234,179,8,0.35);
}

.add-btn:hover {
  background: #ca9a06;
  box-shadow: 0 4px 12px rgba(234,179,8,0.45);
}

.add-btn:active { transform: scale(0.95); }

/* ============================================================
   Sélecteur de catégorie
   ============================================================ */

.category-selector {
  display: flex;
  gap: 6px;
}

.cat-btn {
  flex: 1;
  padding: 8px 0;
  border: 1.5px solid #e0e0d8;
  border-radius: 10px;
  background: white;
  font-size: 13px;
  font-weight: 600;
  color: #999;
  cursor: pointer;
  transition: all 0.15s;
}

.cat-btn[data-cat="CN"].active    { background: #2563eb; border-color: #2563eb; color: white; box-shadow: 0 2px 8px rgba(37,99,235,0.3); }
.cat-btn[data-cat="COM"].active   { background: #EAB308; border-color: #EAB308; color: white; box-shadow: 0 2px 8px rgba(234,179,8,0.35); }
.cat-btn[data-cat="Perso"].active { background: #10b981; border-color: #10b981; color: white; box-shadow: 0 2px 8px rgba(16,185,129,0.3); }

.cat-btn:hover:not(.active) {
  border-color: #ccc;
  color: #555;
  background: #f5f2ec;
}

/* Badges de catégorie */
.cat-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  flex-shrink: 0;
  letter-spacing: 0.3px;
}

.cat-CN    { background: #93c5fd; color: #1e3a8a; border: 1px solid #60a5fa; }
.cat-COM   { background: #fcd34d; color: #78350f; border: 1px solid #fbbf24; }
.cat-Perso { background: #6ee7b7; color: #064e3b; border: 1px solid #34d399; }

/* ============================================================
   Liste de tâches
   ============================================================ */

.tasks-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-title {
  font-size: 10px;
  font-weight: 700;
  color: #b0a898;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}

.empty-state {
  text-align: center;
  padding: 28px 0;
  color: #bbb;
  font-size: 14px;
}

.empty-state .emoji {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border-radius: 12px;
  padding: 11px 14px;
  border: 1.5px solid #ece8e0;
  border-left-width: 3px;
  transition: border-color 0.15s, opacity 0.2s, box-shadow 0.15s, transform 0.15s;
  animation: slideIn 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.task-item:hover:not(.done) {
  border-color: #d5d0c8;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.task-item.done {
  opacity: 0.45;
  border-left-color: #e0dcd4 !important;
}

.cat-item-CN    { border-left-color: #3b82f6; }
.cat-item-COM   { border-left-color: #EAB308; }
.cat-item-Perso { border-left-color: #10b981; }

@keyframes slideIn {
  from { transform: translateY(-6px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.task-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #d0d0c8;
  background: white;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.task-checkbox.checked {
  background: #1a1a1a;
  border-color: #1a1a1a;
}

.task-checkbox.checked::after {
  content: '✓';
  color: white;
  font-size: 11px;
  font-weight: 700;
}

.task-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
}

.task-item.done .task-text {
  text-decoration: line-through;
  color: #aaa;
}

.delete-btn {
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 4px;
  border-radius: 6px;
  transition: color 0.15s;
  line-height: 1;
}

.delete-btn:hover { color: #ef4444; }

/* ============================================================
   Historique calendrier
   ============================================================ */

.history-section {
  border-top: 1.5px solid #ece8e0;
  padding-top: 14px;
}

.history-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.history-toggle .arrow {
  font-size: 12px;
  color: #aaa;
  transition: transform 0.2s;
}

.history-toggle.open .arrow { transform: rotate(180deg); }

.history-list {
  display: none;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.history-list.open { display: flex; }

.cal-strip {
  display: flex;
  gap: 5px;
}

.cal-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 7px 4px;
  border-radius: 10px;
  background: white;
  border: 1.5px solid #e8e8e0;
  cursor: pointer;
  transition: all 0.15s;
  gap: 2px;
}

.cal-day:hover:not(.selected) { border-color: #c0c0b8; }

.cal-day.selected {
  background: #1a1a1a;
  border-color: #1a1a1a;
}

.cal-day.all-done:not(.selected) {
  border-color: #10b981;
  background: #f0fdf4;
}

.cal-day-name {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #aaa;
}

.cal-day-num {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.1;
}

.cal-day-stats { font-size: 10px; color: #888; }

.cal-day.selected .cal-day-name,
.cal-day.selected .cal-day-stats { color: rgba(255,255,255,0.6); }

.cal-day.selected .cal-day-num { color: white; }

.cal-tasks {
  background: white;
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cal-empty {
  font-size: 13px;
  color: #bbb;
  text-align: center;
  padding: 8px 0;
}

.history-task {
  font-size: 13px;
  color: #555;
  padding: 5px 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border-radius: 7px;
  transition: background 0.12s;
}

.history-task:hover { background: #f5f5f0; }

.history-task.done-task .history-task-text {
  color: #aaa;
  text-decoration: line-through;
}

.history-task-text { flex: 1; }

/* ============================================================
   Modal settings
   ============================================================ */

.btn-test-telegram {
  width: 100%;
  padding: 7px 0;
  background: white;
  border: 1.5px solid #e0e0d8;
  border-radius: 8px;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  margin-top: 4px;
  transition: border-color 0.15s, color 0.15s;
}

.btn-test-telegram:hover { border-color: #EAB308; color: #a07000; }

#telegramTestResult {
  font-size: 12px;
  margin-top: 6px;
  min-height: 16px;
  color: #555;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal {
  background: white;
  border-radius: 16px;
  padding: 24px;
  width: 320px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
}

.modal h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}

.settings-group {
  background: #f8f8f4;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

.settings-group-title {
  font-size: 10px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.modal label {
  display: block;
  font-size: 13px;
  color: #666;
  margin-bottom: 6px;
}

.modal input[type="time"],
.modal input[type="text"],
.modal input[type="password"] {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid #e0e0d8;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  margin-bottom: 10px;
  background: white;
  transition: border-color 0.15s;
}

.modal input[type="time"]:focus,
.modal input[type="text"]:focus,
.modal input[type="password"]:focus {
  border-color: #EAB308;
  box-shadow: 0 0 0 3px rgba(234,179,8,0.1);
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn-cancel {
  padding: 8px 16px;
  border: 1.5px solid #e0e0d8;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: border-color 0.15s;
}

.btn-cancel:hover { border-color: #c8c4bc; }

.btn-save {
  padding: 8px 16px;
  background: #1a1a1a;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s;
}

.btn-save:hover { background: #333; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ddd; border-radius: 99px; }

/* ============================================================
   Habits panel
   ============================================================ */

#habits-root { display: flex; flex-direction: column; }

.hb-header {
  background: #1a1a1a;
  color: #faf8f4;
  padding: 18px 24px 14px;
}

.hb-eyebrow {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #808080;
  margin-bottom: 4px;
}

.hb-heading {
  font-size: 20px;
  font-weight: bold;
  letter-spacing: -0.5px;
}

.hb-sub {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}

.hb-week-strip {
  display: flex;
  gap: 5px;
  margin-top: 14px;
}

.hb-day-btn {
  flex: 1;
  padding: 7px 2px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  background: rgba(255,255,255,0.06);
  color: #faf8f4;
  font-family: 'Georgia', serif;
  font-size: 10px;
  letter-spacing: 0.05em;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.hb-day-btn.today  { background: rgba(234,179,8,0.2); }
.hb-day-btn.active { background: #EAB308; color: #1a1a1a; font-weight: bold; }

.hb-day-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #EAB308;
  display: block;
}

.hb-day-dot.dark { background: #1a1a1a; }

.hb-progress-section { padding: 14px 24px 0; }

.hb-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #666;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.hb-complete { color: #16a34a; font-weight: bold; }

.hb-progress-bar {
  height: 5px;
  background: #e5e2db;
  border-radius: 99px;
  overflow: hidden;
}

.hb-progress-fill {
  height: 100%;
  background: #EAB308;
  border-radius: 99px;
  transition: width 0.4s ease;
}

.hb-progress-fill.complete { background: #16a34a; }

.hb-week-total {
  margin-top: 6px;
  font-size: 11px;
  color: #999;
}

.hb-filters {
  display: flex;
  gap: 7px;
  padding: 14px 24px 4px;
}

.hb-filter-btn {
  padding: 4px 13px;
  border-radius: 99px;
  border: 1.5px solid #d5d1c8;
  background: transparent;
  color: #666;
  font-family: 'Georgia', serif;
  font-size: 11px;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: all 0.15s;
}

.hb-filter-btn.active {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #faf8f4;
}

.hb-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 10px 24px 24px;
}

.hb-card {
  background: #fff;
  border: 1.5px solid #e8e4dc;
  border-radius: 11px;
  overflow: hidden;
  transition: all 0.2s;
}

.hb-card.done        { background: #f0fdf4; border-color: #bbf7d0; }
.hb-card.unavailable { opacity: 0.45; }

.hb-card-main {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.hb-card.unavailable .hb-card-main { cursor: default; }

.hb-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 2px solid #c0bdb5;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  font-size: 11px;
  color: #fff;
}

.hb-checkbox.checked { background: #16a34a; border-color: #16a34a; }

.hb-icon  { font-size: 18px; flex-shrink: 0; }
.hb-info  { flex: 1; min-width: 0; }

.hb-title {
  font-weight: bold;
  font-size: 13px;
  color: #1a1a1a;
}

.hb-title.done { text-decoration: line-through; color: #6b7280; }

.hb-desc {
  font-size: 11px;
  color: #888;
  margin-top: 1px;
}

.hb-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}

.hb-badge {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 99px;
}

.hb-badge-fitness   { background: #fef3c7; color: #d97706; }
.hb-badge-mindset   { background: #e0f2fe; color: #0369a1; }
.hb-badge-nutrition { background: #dcfce7; color: #15803d; }

.hb-time { font-size: 9px; color: #aaa; }

.hb-tip-toggle {
  width: 100%;
  padding: 5px 14px;
  background: transparent;
  border: none;
  border-top: 1px solid #f0ece4;
  cursor: pointer;
  text-align: left;
  font-size: 10px;
  color: #aaa;
  font-family: 'Georgia', serif;
  letter-spacing: 0.05em;
}

.hb-card.done .hb-tip-toggle { border-top-color: #d1fae5; }

.hb-tip {
  padding: 9px 14px 12px;
  background: #fffbeb;
  border-top: 1px solid #fde68a;
  font-size: 12px;
  color: #78350f;
  line-height: 1.6;
}

.hb-footer {
  padding: 16px 24px 28px;
  font-size: 11px;
  color: #aaa;
  line-height: 1.7;
  border-top: 1px solid #ece8e0;
}

.hb-footer strong { color: #888; }
