:root {
  --accent: #a78bfa;
  --accent-soft: rgba(167, 139, 250, 0.12);
  --accent-glow: rgba(167, 139, 250, 0.22);
}

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

body {
  font-family: Consolas, 'Courier New', monospace;
  background: #080808;
  color: #d0d0d0;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before { display: none; }
.noise { display: none; }

/* ── layout ───────────────────────────────────────────── */

.app-wrap {
  display: flex;
  min-height: 100vh;
}

/* ── sidebar ──────────────────────────────────────────── */

.sidebar {
  width: 180px;
  background: #060606;
  border-right: 1px solid #1a1a1a;
  display: flex;
  flex-direction: column;
  padding: 28px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}

.sidebar-top { margin-bottom: 32px; }

.logo {
  font-size: 15px;
  font-weight: bold;
  font-style: normal;
  color: #e8e8e8;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.logo-sub {
  font-size: 11px;
  color: #2e2e2e;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 6px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 7px 0;
  font-size: 14px;
  color: #555;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: color 0.12s;
  font-family: inherit;
  text-transform: lowercase;
  letter-spacing: 1.5px;
}

.nav-item::before {
  content: '  ';
  white-space: pre;
  color: var(--accent);
  font-size: 11px;
  flex-shrink: 0;
}

.nav-item svg { display: none; }
.nav-more-btn   { display: none; }
.more-menu      { display: none; }
.habit-menu-btn { display: none; }
.goal-menu-btn  { display: none; }

.nav-item:hover { color: #888; }

.nav-item.active { color: #e0e0e0; }
.nav-item.active::before { content: '> '; }

.sidebar-foot {
  font-size: 11px;
  color: #242424;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── main ─────────────────────────────────────────────── */

.main {
  flex: 1;
  padding: 36px 40px;
}

.panel { display: none; animation: fade 0.12s ease; max-width: 900px; margin: 0 auto; }
.panel.active { display: block; }

@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 32px;
  padding-bottom: 14px;
  border-bottom: 1px solid #1a1a1a;
}

.panel-title {
  font-size: 15px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 3px;
}

.panel-date {
  font-size: 14px;
  color: #555;
  letter-spacing: 1px;
}

/* ── stat grid ────────────────────────────────────────── */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 36px;
  border-left: 1px solid #1a1a1a;
  border-bottom: 1px solid #1a1a1a;
}

.stat-card {
  padding: 16px 20px;
  border-top: 1px solid #1a1a1a;
  border-right: 1px solid #1a1a1a;
}

.stat-label {
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.stat-val {
  font-size: 32px;
  font-weight: bold;
  color: #ccc;
  letter-spacing: -1px;
  line-height: 1;
}

.stat-trend {
  font-size: 10px;
  color: #444;
  letter-spacing: 0.5px;
  margin-top: 7px;
}

.stat-trend.up   { color: var(--accent); }
.stat-trend.down { color: #cc4444; }

.stat-val span {
  font-size: 10px;
  color: var(--accent);
  font-weight: normal;
  margin-left: 2px;
  letter-spacing: 0;
}

/* ── section ──────────────────────────────────────────── */

.section { margin-bottom: 32px; }

.section-title {
  font-size: 13px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #1a1a1a;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ── week grid ────────────────────────────────────────── */

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.week-day { text-align: center; padding: 6px 2px; }

.week-day-name {
  font-size: 13px;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 7px;
}

.week-dot {
  width: 8px;
  height: 8px;
  border-radius: 1px;
  margin: 0 auto;
  background: #1e1e1e;
}

.week-dot.full    { background: var(--accent); }
.week-dot.partial { background: #3d2e6a; }

.week-day-num { font-size: 13px; color: #777; margin-top: 6px; }
.week-day.today .week-day-num  { color: var(--accent); }
.week-day.today .week-day-name { color: var(--accent); }

/* ── habits ───────────────────────────────────────────── */

.habit-list { display: flex; flex-direction: column; }

.habit-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #141414;
  transition: opacity 0.1s;
}

.habit-item:last-child { border-bottom: none; }
.habit-item.done { opacity: 0.55; }

.habit-check {
  width: 16px;
  height: 16px;
  border: 1px solid #363636;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.12s;
  font-size: 10px;
  color: transparent;
  font-family: inherit;
}

.habit-check:hover { border-color: var(--accent); }
.habit-check.checked { border-color: var(--accent); color: var(--accent); }
.habit-check.checked::after { content: '✓'; }

.habit-info { flex: 1; min-width: 0; }

.habit-name {
  font-size: 17px;
  color: #d8d8d8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.habit-item.done .habit-name { text-decoration: line-through; color: #3a3a3a; }

.habit-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
}

.cat-badge {
  font-size: 8px;
  padding: 1px 5px;
  border-radius: 1px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.habit-notes { font-size: 13px; color: #5a5a5a; }

.days-badge {
  font-size: 8px;
  padding: 1px 5px;
  border: 1px solid #242424;
  color: #4a4a4a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: transparent;
}

.habit-streak {
  font-size: 14px;
  color: var(--accent);
  flex-shrink: 0;
  min-width: 38px;
  text-align: right;
  letter-spacing: 0.5px;
}

.habit-actions { display: flex; gap: 3px; opacity: 0; transition: 0.12s; }
.habit-item:hover .habit-actions { opacity: 1; }

/* ── icon buttons ─────────────────────────────────────── */

.icon-btn {
  background: transparent;
  border: 1px solid #242424;
  color: #555;
  width: 22px;
  height: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.12s;
  font-size: 12px;
  font-family: inherit;
}

.icon-btn:hover     { color: var(--accent); border-color: var(--accent); }
.icon-btn.del:hover { color: #cc4444;       border-color: #cc4444; }

/* ── goals ────────────────────────────────────────────── */

.goal-list { display: flex; flex-direction: column; }

.goal-item {
  padding: 12px 0;
  border-bottom: 1px solid #141414;
  transition: opacity 0.1s;
}

.goal-item:last-child { border-bottom: none; }
.goal-item.completed  { opacity: 0.55; }

.goal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.goal-name { font-size: 17px; color: #d8d8d8; }
.goal-item.completed .goal-name { text-decoration: line-through; color: #3a3a3a; }

.goal-right { display: flex; align-items: center; gap: 10px; }

.goal-prog {
  font-size: 14px;
  color: #666;
  cursor: pointer;
  transition: color 0.12s;
  letter-spacing: 1px;
}

.goal-prog:hover { color: #888; }
.goal-prog span  { color: var(--accent); }

.goal-actions { display: flex; gap: 3px; opacity: 0; transition: 0.12s; }
.goal-item:hover .goal-actions { opacity: 1; }

.progress-bar {
  height: 1px;
  background: #1e1e1e;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.4s ease;
}

/* ── filters ──────────────────────────────────────────── */

.category-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-btn {
  font-size: 11px;
  padding: 3px 10px;
  border: 1px solid #242424;
  background: transparent;
  color: #666;
  cursor: pointer;
  font-family: inherit;
  text-transform: lowercase;
  transition: 0.12s;
  letter-spacing: 1px;
}

.filter-btn:hover  { color: #888; border-color: #333; }
.filter-btn.active { color: var(--accent); border-color: var(--accent); }

/* ── stats page ───────────────────────────────────────── */

.stats-list { display: flex; flex-direction: column; }

.stats-item {
  padding: 10px 0;
  border-bottom: 1px solid #141414;
}

.stats-item:last-child { border-bottom: none; }

.stats-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.stats-item-name  { font-size: 17px; color: #d0d0d0; }
.stats-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.stats-item-count { font-size: 14px; color: var(--accent); letter-spacing: 1px; }
.stats-item-detail { font-size: 11px; color: #444; letter-spacing: 0.5px; }

/* ── monthly trend chart ──────────────────────────────── */

.month-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 72px;
  border-bottom: 1px solid #1a1a1a;
  margin-bottom: 8px;
}

.month-bar {
  flex: 1;
  background: #2d1f5e;
  min-height: 1px;
  transition: opacity 0.12s;
}

.month-bar:hover  { opacity: 0.7; }
.month-bar.current { background: var(--accent); }
.month-bar.no-data { background: #181818; min-height: 2px; }

.month-labels {
  display: flex;
  gap: 4px;
}

.month-bar-label {
  flex: 1;
  font-size: 8px;
  color: #333;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.month-bar-label.current { color: var(--accent); }

/* ── mood stats ───────────────────────────────────────── */

.mood-stats-row {
  display: flex;
  border: 1px solid #1a1a1a;
}

.mood-stat {
  flex: 1;
  padding: 14px 16px;
  border-right: 1px solid #1a1a1a;
}

.mood-stat:last-child { border-right: none; }

.mood-stat-val {
  font-size: 28px;
  font-weight: bold;
  color: #ccc;
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 6px;
}

.mood-stat-label {
  font-size: 11px;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  line-height: 1.5;
}

.mood-stat-sub {
  color: var(--accent);
  text-transform: lowercase;
  letter-spacing: 0.5px;
}

/* ── settings ─────────────────────────────────────────── */

.settings-section { display: flex; flex-direction: column; gap: 28px; }

.card {
  background: transparent;
  border: none;
  padding: 0;
  position: static;
}

.card-title {
  position: static;
  background: none;
  border: none;
  border-bottom: 1px solid #1a1a1a;
  padding: 0 0 8px;
  font-size: 13px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  font-weight: normal;
  margin-bottom: 14px;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #141414;
}

.settings-row:last-child { border-bottom: none; }
.settings-label { font-size: 17px; color: #d0d0d0; }
.settings-sub   { font-size: 13px; color: #666; margin-top: 3px; }

.cat-list { display: flex; flex-direction: column; margin-bottom: 14px; }

.cat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #141414;
}

.cat-swatch { width: 8px; height: 8px; flex-shrink: 0; }
.cat-name   { font-size: 12px; color: #aaa; flex: 1; letter-spacing: 1px; }

.add-cat-row { display: flex; gap: 8px; align-items: center; }
.add-cat-row input[type=text] { flex: 1; }
.add-cat-row input[type=color] {
  width: 30px;
  height: 30px;
  border: 1px solid #2a2a2a;
  background: transparent;
  cursor: pointer;
  padding: 2px;
}

/* ── buttons ──────────────────────────────────────────── */

.add-btn {
  font-size: 11px;
  font-weight: normal;
  padding: 5px 12px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  text-transform: lowercase;
  transition: 0.12s;
  font-family: inherit;
  letter-spacing: 1px;
}

.add-btn:hover { background: var(--accent-soft); }

.ghost-btn {
  font-size: 13px;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: 0.12s;
  text-transform: lowercase;
  letter-spacing: 1px;
}

.ghost-btn:hover { opacity: 0.6; }

.accent-link { color: var(--accent); cursor: pointer; }

button.convert {
  border: 1px solid #2a2a2a;
  background: transparent;
  color: #777;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: 0.12s;
  text-transform: lowercase;
  letter-spacing: 1px;
  white-space: nowrap;
}

button.convert:hover           { border-color: var(--accent); color: var(--accent); }
button.convert.secondary:hover { border-color: #555;  color: #aaa; }
button.convert.danger:hover    { border-color: #cc4444; color: #cc4444; }

/* ── forms ────────────────────────────────────────────── */

input, select {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid #2a2a2a;
  color: #d0d0d0;
  padding: 8px 0;
  outline: none;
  font-size: 15px;
  transition: border-color 0.12s;
  font-family: inherit;
  letter-spacing: 0.5px;
  border-radius: 0;
}

select {
  background: #080808;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%23555'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  padding-right: 16px;
}

select option { background: #0d0d0d; color: #ccc; }

input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.4); cursor: pointer; }

input:focus, select:focus { border-bottom-color: var(--accent); }
input:hover,  select:hover { border-bottom-color: #444; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }

label {
  font-size: 11px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* ── modals ───────────────────────────────────────────── */

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

.modal {
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  padding: 28px;
  width: 100%;
  max-width: 380px;
}

.modal-title {
  font-size: 11px;
  color: #999;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid #1a1a1a;
}

.modal-actions { display: flex; gap: 8px; margin-top: 10px; }

.confirm-modal {
  max-width: 320px;
  text-align: center;
  padding: 36px 28px 28px;
}


.confirm-message {
  font-size: 14px;
  color: #aaa;
  margin-bottom: 28px;
  line-height: 1.6;
  letter-spacing: 0.5px;
}

.confirm-actions {
  display: flex;
  gap: 8px;
}

.confirm-btn-cancel,
.confirm-btn-ok {
  flex: 1;
  padding: 10px;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  text-transform: lowercase;
  letter-spacing: 1.5px;
  transition: 0.12s;
  border: 1px solid;
  background: transparent;
}

.confirm-btn-cancel {
  border-color: #2a2a2a;
  color: #555;
}

.confirm-btn-cancel:hover {
  border-color: #444;
  color: #888;
}

.confirm-btn-ok {
  border-color: #cc4444;
  color: #cc4444;
}

.confirm-btn-ok:hover {
  background: rgba(204, 68, 68, 0.1);
}

/* ── empty states ─────────────────────────────────────── */

.empty-state {
  font-size: 14px;
  color: #4a4a4a;
  padding: 24px 0;
  text-align: center;
  letter-spacing: 1.5px;
}

/* ── toast ────────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: #0a0a0a;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 7px 14px;
  font-size: 9px;
  text-transform: lowercase;
  letter-spacing: 2px;
  opacity: 0;
  pointer-events: none;
  transition: 0.18s ease;
  z-index: 200;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── login ────────────────────────────────────────────── */

.login-overlay {
  position: fixed;
  inset: 0;
  background: #080808;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.login-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 260px;
}

.login-logo {
  font-size: 22px;
  font-weight: bold;
  font-style: normal;
  color: #e0e0e0;
  letter-spacing: 6px;
  text-transform: uppercase;
}

.login-sub {
  font-size: 13px;
  color: #2e2e2e;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-top: -10px;
  margin-bottom: 12px;
}

.login-card input {
  width: 100%;
  text-align: center;
  letter-spacing: 4px;
}

.login-btn {
  width: 100%;
  padding: 11px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: lowercase;
  cursor: pointer;
  transition: background 0.12s;
}

.login-btn:hover { background: var(--accent-glow); }

.logout-btn {
  background: none;
  border: none;
  color: #242424;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  padding: 2px 6px;
  margin-left: 6px;
  transition: color 0.12s;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.logout-btn:hover { color: var(--accent); }

/* ── day picker ───────────────────────────────────────── */

.day-picker { display: flex; flex-direction: column; gap: 4px; }

.dp-row { display: flex; gap: 4px; }
.dp-row .day-btn { flex: 1; }

.day-btn {
  padding: 6px 8px;
  border: 1px solid #222;
  background: transparent;
  color: #666;
  cursor: pointer;
  font-size: 11px;
  font-family: inherit;
  text-transform: lowercase;
  transition: 0.12s;
  letter-spacing: 1px;
}

.day-btn:hover  { border-color: #444; color: #888; }
.day-btn.active { border-color: var(--accent); color: var(--accent); }

.days-badge {
  font-size: 8px;
  padding: 1px 5px;
  border: 1px solid #242424;
  color: #4a4a4a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: transparent;
}

/* ── notes ────────────────────────────────────────────── */

.note-input-row { margin-bottom: 24px; }

.note-list { display: flex; flex-direction: column; }

.note-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #141414;
  cursor: pointer;
  transition: opacity 0.12s;
}

.note-item:last-child { border-bottom: none; }
.note-item:hover { opacity: 0.72; }
.note-item.expanded { flex-direction: column; align-items: stretch; cursor: default; }
.note-item.expanded:hover { opacity: 1; }

.note-content-wrap { flex: 1; min-width: 0; }

.note-title {
  font-size: 16px;
  color: #d8d8d8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-preview-text {
  font-size: 14px;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 3px;
}

.note-item-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.note-meta {
  font-size: 10px;
  color: #3a3a3a;
  letter-spacing: 0.5px;
}

.note-edit-area {
  width: 100%;
  min-height: 120px;
  background: transparent;
  border: none;
  border-bottom: 1px solid #1e1e1e;
  color: #d0d0d0;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 16px;
  line-height: 1.8;
  padding: 6px 0 10px;
  resize: vertical;
  outline: none;
}

.note-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

/* ── habit calendar ───────────────────────────────────── */

.habit-calendar {
  padding: 12px 0 4px;
  border-top: 1px solid #141414;
  margin-top: 8px;
}

.hcal-month {
  font-size: 9px;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.hcal-grid {
  display: grid;
  grid-template-columns: repeat(7, 28px);
  gap: 3px;
}

.hcal-header {
  font-size: 8px;
  color: #3a3a3a;
  text-align: center;
  text-transform: uppercase;
  padding-bottom: 4px;
}

.hcal-cell {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #3a3a3a;
  border: 1px solid transparent;
}

.hcal-cell.done  { background: var(--accent-soft); color: var(--accent); }
.hcal-cell.today { border-color: #333; color: #777; }
.hcal-cell.done.today { border-color: var(--accent); }

/* ── pins ─────────────────────────────────────────────── */

.icon-btn.pinned { color: var(--accent); border-color: var(--accent); }
.pin-star { color: var(--accent); font-size: 10px; margin-right: 5px; }

/* ── milestone toast ──────────────────────────────────── */

.toast.milestone {
  border-color: #f0d060;
  color: #f0d060;
  letter-spacing: 1.5px;
  font-size: 11px;
  padding: 10px 18px;
}

/* ── weekly summary ───────────────────────────────────── */

.weekly-summary {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 14px 0 18px;
  border-bottom: 1px solid #1a1a1a;
  margin-bottom: 28px;
}

.weekly-summary-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.weekly-label {
  font-size: 11px;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.weekly-val {
  font-size: 28px;
  font-weight: bold;
  color: #ccc;
  letter-spacing: -1px;
  line-height: 1;
}

.weekly-unit {
  font-size: 12px;
  color: var(--accent);
  font-weight: normal;
  margin-left: 2px;
}

.weekly-trend {
  font-size: 12px;
  color: #555;
  letter-spacing: 0.5px;
  flex: 1;
}

.weekly-trend.up   { color: var(--accent); }
.weekly-trend.down { color: #cc4444; }

/* ── year heatmap ─────────────────────────────────────── */

.heatmap-wrap { overflow-x: auto; padding-bottom: 4px; }

.heatmap-months {
  display: grid;
  gap: 2px;
  margin-bottom: 4px;
  height: 16px;
}

.heatmap-month {
  font-size: 10px;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.heatmap-grid {
  display: grid;
  grid-template-rows: repeat(7, 12px);
  grid-auto-flow: column;
  gap: 2px;
}

.hcmap-cell {
  width: 12px;
  height: 12px;
  border-radius: 1px;
  background: #141414;
}

.hcmap-cell.level-1 { background: #2d1f5e; }
.hcmap-cell.level-2 { background: #4a2d90; }
.hcmap-cell.level-3 { background: #6b3fc0; }
.hcmap-cell.level-4 { background: var(--accent); }
.hcmap-cell.today   { outline: 1px solid var(--accent); outline-offset: 1px; }

/* ── drag to reorder ──────────────────────────────────── */

.drag-handle {
  color: #333;
  cursor: grab;
  font-size: 14px;
  flex-shrink: 0;
  padding: 0 4px;
  user-select: none;
}

.drag-handle:hover { color: #666; }

.habit-item[draggable] { cursor: default; }
.habit-item.dragging   { opacity: 0.4; }
.habit-item.drag-over  { border-bottom-color: var(--accent); }

/* ── goal deadline ────────────────────────────────────── */

.goal-deadline {
  font-size: 12px;
  letter-spacing: 0.5px;
}

/* ── archived habits ──────────────────────────────────── */

.archived-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #141414;
}

.archived-item:last-child { border-bottom: none; }

.archived-name {
  font-size: 15px;
  color: #666;
}

.archived-actions { display: flex; gap: 8px; }

/* ── celebration toast ────────────────────────────────── */

.toast.celebrate {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── mood picker ──────────────────────────────────────── */

.mood-picker {
  display: flex;
  gap: 6px;
}

.mood-btn {
  flex: 1;
  padding: 8px 4px;
  border: 1px solid #1e1e1e;
  background: transparent;
  color: #444;
  font-family: inherit;
  font-size: 10px;
  cursor: pointer;
  text-transform: lowercase;
  letter-spacing: 1px;
  transition: 0.12s;
}

.mood-btn:hover { border-color: #333; color: #777; }
.mood-btn[data-level="1"].active { border-color: #cc4444; color: #cc4444; }
.mood-btn[data-level="2"].active { border-color: #dd7733; color: #dd7733; }
.mood-btn[data-level="3"].active { border-color: #ccaa44; color: #ccaa44; }
.mood-btn[data-level="4"].active { border-color: #44aa66; color: #44aa66; }
.mood-btn[data-level="5"].active { border-color: var(--accent); color: var(--accent); }

/* ── mood heatmap row ─────────────────────────────────── */

.heatmap-mood-label {
  font-size: 9px;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 10px;
  margin-bottom: 4px;
}

.hcmap-cell.mood-level-0 { background: #141414; }
.hcmap-cell.mood-level-1 { background: #5a1a1a; }
.hcmap-cell.mood-level-2 { background: #7a3a20; }
.hcmap-cell.mood-level-3 { background: #5a4a10; }
.hcmap-cell.mood-level-4 { background: #1a4a2a; }
.hcmap-cell.mood-level-5 { background: #3d2e6a; }

/* ── day editor ───────────────────────────────────────── */

.day-editor-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #141414;
  cursor: pointer;
  transition: opacity 0.1s;
}

.day-editor-item:last-child { border-bottom: none; }
.day-editor-item:hover { opacity: 0.72; }

.day-editor-name {
  font-size: 16px;
  color: #d8d8d8;
}

.day-editor-name.done {
  text-decoration: line-through;
  color: #3a3a3a;
}

.week-day:hover .week-dot { opacity: 0.7; }

/* ── recurring badge ──────────────────────────────────── */

.recurring-badge {
  font-size: 9px;
  padding: 1px 5px;
  border: 1px solid #2a3a2a;
  color: #4a8a5a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: transparent;
  margin-left: 7px;
  vertical-align: middle;
}

/* ── pause ────────────────────────────────────────────── */

.habit-item.paused { opacity: 0.45; }
.icon-btn.paused   { color: #f0a020; border-color: #f0a020; }

.paused-badge {
  font-size: 8px;
  padding: 1px 5px;
  border: 1px solid #3a3a2a;
  color: #888860;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: transparent;
}

/* ── search overlay ───────────────────────────────────── */

.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  z-index: 300;
}

.search-box {
  width: 100%;
  max-width: 520px;
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
}

.search-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid #1a1a1a;
}

.search-slash {
  font-size: 16px;
  color: var(--accent);
  font-weight: bold;
  flex-shrink: 0;
}

.search-input-row input {
  flex: 1;
  border: none;
  font-size: 15px;
  padding: 0;
  width: auto;
}

.search-input-row input:focus,
.search-input-row input:hover { border: none; }

.search-close {
  font-size: 9px;
  color: #333;
  background: none;
  border: 1px solid #1e1e1e;
  font-family: inherit;
  padding: 3px 8px;
  cursor: pointer;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: 0.12s;
  flex-shrink: 0;
}

.search-close:hover { color: #666; border-color: #333; }

.search-results { max-height: 360px; overflow-y: auto; }

.search-group-label {
  font-size: 9px;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 10px 18px 6px;
}

.search-result {
  padding: 10px 18px;
  cursor: pointer;
  border-bottom: 1px solid #111;
  transition: background 0.1s;
}

.search-result:last-child { border-bottom: none; }
.search-result:hover { background: #0f0f0f; }

.search-result-name { font-size: 15px; color: #ccc; }
.search-result-sub  { font-size: 12px; color: #555; margin-top: 2px; }

.search-empty {
  padding: 20px 18px;
  font-size: 13px;
  color: #333;
  letter-spacing: 1px;
}

/* ── mobile — bottom nav ──────────────────────────────── */

@media (max-width: 800px) {
  .app-wrap {
    flex-direction: column;
    min-height: 100dvh;
  }

  .main {
    order: 1;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px 16px;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }

  .panel { max-width: 100%; }

  .sidebar {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    width: 100%;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    flex-direction: row;
    align-items: flex-start;
    flex-shrink: 0;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    border-right: none;
    border-top: 1px solid #1a1a1a;
    background: #080808;
  }

  .main {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }

  .sidebar-top, .sidebar-foot { display: none; }

  .nav {
    flex-direction: row;
    width: 100%;
    gap: 0;
    flex: 1;
  }

  .nav-item {
    flex: 1;
    flex-direction: column;
    gap: 3px;
    padding: 10px 4px;
    font-size: 11px;
    justify-content: center;
    align-items: center;
    text-align: center;
    letter-spacing: 0.5px;
    border-top: 2px solid transparent;
    min-height: 44px;
  }

  .nav-item::before        { display: none; }
  .nav-item.active         { color: var(--accent); border-top-color: var(--accent); }
  .nav-item.active::before { display: none; }

  /* hide overflow nav items, show more button */
  .nav-item[data-panel="notes"],
  .nav-item[data-panel="archive"],
  .nav-item[data-panel="settings"] { display: none; }
  .nav-more-btn { display: flex; }

  /* more menu */
  .more-menu {
    position: fixed;
    inset: 0;
    z-index: 200;
  }
  .more-menu-backdrop {
    position: absolute;
    inset: 0;
  }
  .more-menu-sheet {
    position: absolute;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    left: 0;
    right: 0;
    background: #0f0f0f;
    border-top: 1px solid #1e1e1e;
    padding: 4px 0;
  }
  .more-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 16px 24px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 14px;
    color: #888;
    text-transform: lowercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    text-align: left;
  }
  .more-menu-item.active { color: var(--accent); }

  .stat-grid { grid-template-columns: repeat(2, 1fr); }

  .habit-actions, .goal-actions { opacity: 1; }

  /* prevent iOS from zooming in on input focus */
  input, select { font-size: 16px; }

  /* bump up text for mobile readability */
  .panel-title   { font-size: 13px; }
  .panel-date    { font-size: 12px; }
  .section-title { font-size: 13px; }
  .card-title    { font-size: 13px; }
  .stat-label    { font-size: 12px; }
  .stat-val      { font-size: 28px; }
  .habit-name    { font-size: 16px; }
  .goal-name     { font-size: 16px; }
  .habit-notes   { font-size: 13px; }
  .goal-prog     { font-size: 14px; }
  .habit-streak  { font-size: 13px; }
  .note-title    { font-size: 16px; }
  .note-preview-text { font-size: 13px; }
  .settings-label { font-size: 16px; }
  .settings-sub  { font-size: 13px; }
  .add-btn       { font-size: 13px; }
  .ghost-btn     { font-size: 12px; }
  .filter-btn    { font-size: 12px; }
  .nav-item      { font-size: 11px; }
  .empty-state   { font-size: 13px; }

  /* habit + goal action sheets */
  .habit-actions  { display: none !important; }
  .goal-actions   { display: none !important; }
  .goal-menu-btn  {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    padding: 8px 14px;
    color: #555;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
  }
  .habit-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    padding: 8px 14px;
    color: #555;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
  }

  .action-sheet-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #0f0f0f;
    border-top: 1px solid #1e1e1e;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 301;
  }
  .action-sheet-title {
    padding: 16px 24px 14px;
    font-size: 11px;
    color: #444;
    letter-spacing: 2px;
    text-transform: uppercase;
    border-bottom: 1px solid #161616;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .action-sheet-item {
    display: block;
    width: 100%;
    padding: 17px 24px;
    background: none;
    border: none;
    border-bottom: 1px solid #111;
    font-family: inherit;
    font-size: 16px;
    color: #ccc;
    text-align: left;
    letter-spacing: 1px;
    cursor: pointer;
  }
  .action-sheet-item:last-child { border-bottom: none; }
  .action-sheet-danger { color: #f87171; }
  .action-sheet-cancel { color: #444; font-size: 14px; }

  /* modals as bottom sheets */
  .modal-overlay {
    align-items: flex-end;
    background: rgba(0,0,0,0.7);
  }
  .modal {
    max-width: 100%;
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding: 24px 20px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    max-height: 88vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 480px) {
  .week-grid { gap: 2px; }
  .week-day  { padding: 5px 1px; }
  .week-day-name { font-size: 9px; letter-spacing: 0; }
  .week-day-num  { font-size: 9px; }
}
