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

:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --bg2: #f2f3f5;
  --bg3: #eceef1;
  --surface: #ffffff;
  --border: #e3e6eb;
  --text: #16181d;
  --text2: #5b6470;
  --text3: #9aa3af;
  --accent: #2383e2;
  --accent-strong: #1a6fc4;
  --accent-light: #eaf2fc;
  --accent-rgb: 35, 131, 226;
  --success: #0f7b6c;
  --warning: #e9973f;
  --danger: #d44c47;
  --sidebar-w: 240px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 18, 21, 0.05);
  --shadow-md: 0 8px 20px -10px rgba(16, 18, 21, 0.12);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1115;
  --bg2: #16181d;
  --bg3: #23262c;
  --surface: #16181d;
  --border: #262a31;
  --text: #e6e8ec;
  --text2: #9aa3af;
  --text3: #5f6a76;
  --accent: #4d9bf0;
  --accent-strong: #6db0f5;
  --accent-light: rgba(77, 155, 240, 0.16);
  --accent-rgb: 77, 155, 240;
  --success: #4fc3a5;
  --warning: #f0a94f;
  --danger: #e26a63;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 20px -10px rgba(0, 0, 0, 0.55);
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
    "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ─── LAYOUT ─────────────────────────────────────── */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

.mobile-topbar {
  display: none; align-items: center; justify-content: space-between;
  padding: 0 16px; height: 52px; border-bottom: 1px solid var(--border);
  background: var(--surface); position: sticky; top: 0; z-index: 100;
}
.mobile-logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
.mobile-logo-mark { width: 22px; height: 22px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.live-clock-mini { font-size: 13px; color: var(--text2); font-variant-numeric: tabular-nums; }
.hamburger { background: none; border: none; font-size: 20px; color: var(--text); padding: 4px; }

/* ─── SIDEBAR ─────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); background: var(--bg2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 20px 0; overflow-y: auto;
  flex-shrink: 0; transition: transform 0.25s ease;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px 20px; border-bottom: 1px solid var(--border);
}
.logo-icon { width: 26px; height: 26px; }
.logo-text { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }

.sidebar-clock {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  background: var(--surface); margin: 12px 12px 0; border-radius: var(--radius);
}
.clock-time {
  font-size: 22px; font-weight: 600; color: var(--text);
  font-variant-numeric: tabular-nums; letter-spacing: 1px;
}
.clock-date { font-size: 11px; color: var(--text2); margin-top: 2px; }

.nav-links { list-style: none; padding: 12px 0; flex: 1; }
.nav-links li { margin: 2px 8px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-radius: var(--radius); color: var(--text); font-size: 14px;
  font-weight: 500; transition: background 0.15s; text-decoration: none;
}
.nav-item:hover { background: var(--bg3); text-decoration: none; }
.nav-item.active { background: var(--accent-light); color: var(--accent); }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer { padding: 16px 12px; border-top: 1px solid var(--border); margin-top: auto; }
.btn-notify {
  width: 100%; padding: 8px; border-radius: var(--radius);
  background: var(--accent-light); color: var(--accent);
  border: 1px solid var(--border); font-size: 12px; font-weight: 500;
  transition: background 0.15s;
}
.btn-notify:hover { background: var(--bg3); }
.freeze-info {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px; font-size: 12px; color: var(--text2);
}
.freeze-count { font-weight: 700; color: var(--accent); font-size: 14px; cursor: pointer; }

.pref-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.lang-select {
  flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); color: var(--text);
  font-size: 12px;
}
.icon-btn {
  width: 30px; height: 30px; flex-shrink: 0; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text); transition: background 0.15s;
}
.icon-btn:hover { background: var(--bg3); }

/* ─── MAIN CONTENT ─────────────────────────────────────── */
.main-content { flex: 1; overflow-y: auto; padding: 32px 36px; background: var(--bg); }

.page { display: none; animation: fadeIn 0.2s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity:0; transform: translateY(6px); } to { opacity:1; transform: translateY(0); } }

.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 28px; flex-wrap: wrap; gap: 12px;
}
.page-title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.page-subtitle { font-size: 13px; color: var(--text2); margin-top: 4px; }
.today-badge {
  background: var(--accent-light); color: var(--accent);
  padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600;
}

/* ─── STATS ROW ─────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow); transition: border-color 0.15s, box-shadow 0.15s;
}
.stat-card:hover { border-color: #c3c9d2; box-shadow: var(--shadow-md); }
.stat-icon { font-size: 26px; }
.stat-value { font-size: 22px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-label { font-size: 11px; color: var(--text2); margin-top: 2px; }

/* ─── SECTION TITLE ─────────────────────────────────────── */
.section-title {
  font-size: 12px; font-weight: 600; color: var(--text2); text-transform: uppercase;
  letter-spacing: 0.8px; margin: 24px 0 12px;
}

/* ─── CURRENT HOUR CARD ─────────────────────────────────────── */
.current-hour-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); margin-bottom: 4px;
}
.hour-label { font-size: 18px; font-weight: 600; margin-bottom: 14px; color: var(--text); }
.hour-habits { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.hour-progress-bar {
  height: 6px; background: var(--bg3); border-radius: 3px; overflow: hidden; margin-bottom: 6px;
}
.hour-progress-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.4s ease; width: 0%; }
.hour-progress-text { font-size: 12px; color: var(--text2); }

/* ─── HABIT TODAY LIST ─────────────────────────────────────── */
.habits-today-list { display: flex; flex-direction: column; gap: 10px; }
.habit-today-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); transition: border-color 0.15s, box-shadow 0.15s;
}
.habit-today-row:hover { border-color: #c3c9d2; box-shadow: var(--shadow-md); }
.habit-emoji { font-size: 20px; width: 32px; text-align: center; }
.habit-info { flex: 1; min-width: 0; }
.habit-name { font-weight: 600; font-size: 14px; color: var(--text); }
.habit-meta { font-size: 11px; color: var(--text2); margin-top: 2px; }
.habit-actions { display: flex; align-items: center; gap: 8px; }
.habit-progress-mini { display: flex; align-items: center; gap: 6px; }
.mini-bar { width: 80px; height: 5px; background: var(--bg3); border-radius: 3px; overflow: hidden; }
.mini-bar-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }
.qty-controls { display: flex; align-items: center; gap: 6px; }
.qty-btn {
  width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--bg2); font-size: 14px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; justify-content: center; transition: background 0.15s;
}
.qty-btn:hover { background: var(--bg3); }
.qty-value { font-size: 13px; font-weight: 600; min-width: 24px; text-align: center; font-variant-numeric: tabular-nums; }
.btn-timer {
  padding: 5px 10px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg2); font-size: 12px; color: var(--text); transition: background 0.15s;
}
.btn-timer:hover { background: var(--bg3); }
.btn-note { padding: 5px 8px; border-radius: 6px; border: none; background: none; font-size: 16px; color: var(--text2); }
.btn-note:hover { color: var(--text); }
.btn-complete {
  padding: 5px 12px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg2); font-size: 12px; font-weight: 500; color: var(--text);
  transition: all 0.15s;
}
.btn-complete:hover { background: var(--bg3); }
.btn-complete.done {
  background: rgba(15, 123, 108, 0.12); color: var(--success); border-color: rgba(15, 123, 108, 0.35);
}
.habit-streak { font-size: 12px; color: var(--warning); font-weight: 600; white-space: nowrap; }

/* ─── WEEK OVERVIEW ─────────────────────────────────────── */
.week-overview { display: flex; gap: 6px; flex-wrap: wrap; }
.week-day {
  flex: 1; min-width: 80px; padding: 10px 8px; border-radius: var(--radius);
  border: 1px solid var(--border); text-align: center; background: var(--surface);
}
.week-day.today { border-color: var(--accent); background: var(--accent-light); }
.week-day-name { font-size: 10px; color: var(--text2); font-weight: 600; text-transform: uppercase; }
.week-day-date { font-size: 16px; font-weight: 700; margin: 4px 0; font-variant-numeric: tabular-nums; }
.week-day-pct { font-size: 11px; color: var(--text2); font-variant-numeric: tabular-nums; }
.week-day-bar { height: 4px; background: var(--bg3); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.week-day-bar-fill { height: 100%; background: var(--accent); border-radius: 2px; }

/* ─── TIMELINE ─────────────────────────────────────── */
.timeline-legend { display: flex; gap: 14px; align-items: center; font-size: 12px; color: var(--text2); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.legend-dot.done { background: var(--success); }
.legend-dot.active { background: var(--accent); }
.legend-dot.pending { background: var(--bg3); border: 1px solid var(--border); }

.timeline-container { display: flex; flex-direction: column; gap: 4px; }
.timeline-slot {
  display: flex; align-items: stretch; border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden; background: var(--surface);
  transition: box-shadow 0.2s;
}
.timeline-slot.slot-past { opacity: 0.55; }
.timeline-slot.slot-now {
  border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-light);
}
.timeline-slot.slot-future { background: var(--surface); }

.slot-time {
  width: 72px; flex-shrink: 0; background: var(--bg2); padding: 12px 10px;
  font-size: 12px; font-weight: 600; color: var(--text2); text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-right: 1px solid var(--border);
}
.slot-now-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  margin-top: 4px; animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.4);opacity:0.6} }

.slot-habits { flex: 1; padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.slot-empty { color: var(--text3); font-size: 12px; font-style: italic; }

.slot-habit-pill {
  display: flex; align-items: center; gap: 6px; padding: 6px 10px;
  border-radius: 20px; border: 1px solid var(--border); background: var(--bg2);
  font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.15s;
}
.slot-habit-pill:hover { box-shadow: var(--shadow); }
.slot-habit-pill.pill-done {
  background: rgba(15, 123, 108, 0.12); border-color: rgba(15, 123, 108, 0.35); color: var(--success);
}
.slot-habit-pill.pill-active { background: var(--accent-light); border-color: var(--border); color: var(--accent); }
.pill-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* ─── HABITS GRID ─────────────────────────────────────── */
.habits-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.habit-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); transition: border-color 0.15s, box-shadow 0.15s;
  display: flex; flex-direction: column; gap: 10px;
}
.habit-card:hover { border-color: #c3c9d2; box-shadow: var(--shadow-md); }
.habit-card-header { display: flex; align-items: center; gap: 10px; }
.habit-card-icon {
  width: 38px; height: 38px; border-radius: 8px; display: flex;
  align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0;
}
.habit-card-info { flex: 1; min-width: 0; }
.habit-card-name { font-weight: 600; font-size: 14px; }
.habit-card-type {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--text2); margin-top: 2px;
}
.habit-card-actions { display: flex; gap: 6px; margin-top: 4px; }
.btn-icon {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg2); font-size: 13px; display: flex; align-items: center;
  justify-content: center; transition: background 0.15s;
}
.btn-icon:hover { background: var(--bg3); }
.habit-card-stats { display: flex; gap: 14px; font-size: 12px; color: var(--text2); }
.habit-stat { display: flex; flex-direction: column; align-items: center; }
.habit-stat-val { font-size: 15px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.habit-stat-lbl { font-size: 10px; text-transform: uppercase; }

/* ─── ANALYTICS ─────────────────────────────────────── */
.analytics-tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.tab-btn {
  padding: 7px 16px; border: none; background: none; font-size: 13px;
  font-weight: 500; color: var(--text2); border-radius: 6px; transition: all 0.15s;
}
.tab-btn:hover { background: var(--bg2); color: var(--text); }
.tab-btn.active { background: var(--accent-light); color: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; }
.chart-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.chart-title { font-size: 14px; font-weight: 600; margin-bottom: 18px; color: var(--text); }
canvas { max-width: 100%; }

/* Heatmap */
.heatmap-container { display: flex; flex-wrap: wrap; gap: 4px; }
.heatmap-day {
  width: 28px; height: 28px; border-radius: 4px; display: flex;
  align-items: center; justify-content: center; font-size: 9px;
  font-weight: 600; color: #fff; cursor: default; font-variant-numeric: tabular-nums;
}
.heatmap-label { width: 100%; font-size: 11px; color: var(--text2); margin: 8px 0 4px; font-weight: 600; }

/* ─── ACHIEVEMENTS ─────────────────────────────────────── */
.achievements-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.achievement-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 16px; text-align: center; box-shadow: var(--shadow); transition: all 0.2s;
}
.achievement-card.locked { opacity: 0.4; filter: grayscale(1); }
.achievement-card.unlocked { border-color: #f5c842; background: rgba(245, 200, 66, 0.08); }
.achievement-icon { font-size: 36px; margin-bottom: 8px; }
.achievement-name { font-size: 13px; font-weight: 600; color: var(--text); }
.achievement-desc { font-size: 11px; color: var(--text2); margin-top: 4px; }
.achievement-date { font-size: 10px; color: var(--text3); margin-top: 6px; }

/* ─── MODAL ─────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.35); display: none;
  align-items: center; justify-content: center; z-index: 999; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; width: 100%; max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18); max-height: 90vh; overflow-y: auto;
}
.modal-sm { max-width: 360px; }
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px 16px; border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 17px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 18px; color: var(--text2); padding: 4px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px; border-top: 1px solid var(--border);
}

/* ─── FORM ─────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg2); color: var(--text);
  font-size: 14px; transition: border-color 0.15s; outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--accent); background: var(--surface);
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text3); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.type-toggle { display: flex; gap: 6px; flex-wrap: wrap; }
.type-btn {
  padding: 7px 14px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg2); font-size: 12px; font-weight: 500; color: var(--text2);
  transition: all 0.15s;
}
.type-btn.active { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }

.toggle-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle-switch input { display: none; }
.toggle-track {
  width: 36px; height: 20px; background: var(--bg3); border-radius: 10px;
  position: relative; transition: background 0.2s; flex-shrink: 0;
}
.toggle-track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px; border-radius: 50%; background: #fff;
  transition: left 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-track { background: var(--accent); }
.toggle-switch input:checked + .toggle-track::after { left: 19px; }
.toggle-label { font-size: 13px; color: var(--text); font-weight: normal; text-transform: none; }

.color-picker { display: flex; gap: 8px; align-items: center; }
.color-dot {
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: transform 0.15s;
}
.color-dot:hover, .color-dot.selected { transform: scale(1.2); border-color: var(--text); }

/* ─── BUTTONS ─────────────────────────────────────── */
.btn-primary {
  padding: 8px 18px; border-radius: var(--radius); border: 1px solid transparent;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 600;
  box-shadow: none; transition: background 0.15s;
}
.btn-primary:hover { background: var(--accent-strong); }
[data-theme="dark"] .btn-primary { color: #0f1115; }
.btn-secondary {
  padding: 8px 18px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg2);
  color: var(--text); font-size: 13px; font-weight: 500; transition: background 0.15s;
}
.btn-secondary:hover { background: var(--bg3); }

/* ─── TIMER MODAL ─────────────────────────────────────── */
.timer-body { text-align: center; padding: 24px; }
.timer-ring-wrap { position: relative; width: 120px; height: 120px; margin: 0 auto 20px; }
.timer-ring { width: 120px; height: 120px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--bg3); stroke-width: 8; }
.ring-fill { fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 0.5s linear; }
.timer-display {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--text);
}
.timer-controls { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ─── TOAST ─────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #1a1d23; color: #fff; padding: 10px 20px; border-radius: 20px;
  font-size: 13px; opacity: 0; transition: all 0.3s; z-index: 9999; pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── EMPTY ─────────────────────────────────────── */
.empty-msg { color: var(--text3); font-size: 13px; font-style: italic; padding: 8px 0; }
.nav-link-inline { font-weight: 600; }

/* ─── SCROLLBAR ─────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 3px; }

/* ─── REDUCED MOTION ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ─── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 768px) {
  .mobile-topbar { display: flex; }
  .app-shell { flex-direction: column; height: auto; min-height: 100vh; }
  .sidebar {
    position: fixed; top: 52px; left: 0; bottom: 0; z-index: 200;
    transform: translateX(-100%); width: 260px;
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { padding: 20px 16px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .achievements-grid { grid-template-columns: repeat(2, 1fr); }
  .habits-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .week-overview { gap: 4px; }
  .week-day { min-width: 38px; padding: 6px 4px; }
  .week-day-name { font-size: 8px; }
}
