@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

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

:root {
  --bg: #0d1117;
  --surface-0: #0d1117;
  --surface-1: #161b22;
  --surface-2: #21262d;
  --surface-3: #30363d;
  --border: #30363d;
  --border-subtle: #21262d;
  --text-0: #f0f6fc;
  --text-1: #c9d1d9;
  --text-2: #8b949e;
  --text-3: #484f58;
  --accent: #22c55e;
  --accent-dim: rgba(34,197,94,0.12);
  --accent-dim2: rgba(34,197,94,0.2);
  --danger: #f85149;
  --danger-dim: rgba(248,81,73,0.1);
  --warning: #f59e0b;
  --font-ui: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

html, body { height: 100%; overflow: hidden; }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text-1);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}

button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }

/* ---- App Shell ---- */
#app { display: none; height: 100%; flex-direction: column; max-width: 800px; margin: 0 auto; }
#app.visible { display: flex; }

.app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}
.app-content::-webkit-scrollbar { width: 6px; }
.app-content::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }

/* ---- Bottom Nav ---- */
.nav-bar {
  display: flex;
  background: var(--surface-1);
  border-top: 1px solid var(--border-subtle);
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
  flex-shrink: 0;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s;
  border-radius: var(--radius-sm);
}
.nav-item:hover { color: var(--text-2); }
.nav-item.active { color: var(--accent); }
.nav-item svg { width: 20px; height: 20px; transition: transform 0.2s; }
.nav-item.active svg { transform: scale(1.1); }

/* ---- Auth / Login ---- */
#auth-screen {
  display: none;
  height: 100%;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
#auth-screen.visible { display: flex; }

.login-card {
  width: 100%;
  max-width: 360px;
  padding: 40px 32px;
  text-align: center;
}
.login-logo { margin-bottom: 8px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.login-logo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  width: 48px;
}
.login-logo-cell {
  width: 14px; height: 14px;
  background: var(--accent);
  border-radius: 3px;
  animation: logoPulse 2s ease-in-out infinite;
}
@keyframes logoPulse {
  0%, 100% { opacity: var(--o, 0.3); }
  50% { opacity: calc(var(--o, 0.3) * 2.5); }
}
.login-title { font-size: 28px; font-weight: 700; color: var(--text-0); letter-spacing: -0.03em; margin-bottom: 4px; }
.login-subtitle { color: var(--text-2); font-size: 14px; margin-bottom: 32px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.login-tab {
  flex: 1;
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface-2);
  transition: all 0.2s;
}
.login-tab.active { background: var(--accent); color: #000; font-weight: 600; }
.login-error { color: var(--danger); font-size: 12px; text-align: center; min-height: 16px; }

/* ---- View Header ---- */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.view-header h2 { font-size: 22px; font-weight: 600; color: var(--text-0); letter-spacing: -0.02em; }
.view-header-actions { display: flex; align-items: center; gap: 10px; }

/* ---- Today View ---- */
.today-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 0 24px;
  gap: 6px;
}
.today-greeting { font-size: 24px; font-weight: 600; color: var(--text-0); letter-spacing: -0.03em; }
.today-date { font-size: 13px; color: var(--text-2); font-family: var(--font-mono); letter-spacing: 0.01em; }
.today-progress { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.progress-ring-container { position: relative; width: 64px; height: 64px; }
.progress-pct {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 15px; font-weight: 600; color: var(--text-0);
}
.progress-label { font-size: 13px; color: var(--text-2); }
.progress-done { color: var(--text-0); font-weight: 600; }

/* ---- Overdue Banner ---- */
.overdue-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--danger-dim);
  border: 1px solid rgba(248,81,73,0.2);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  cursor: pointer;
  transition: background 0.2s;
}
.overdue-banner:hover { background: rgba(248,81,73,0.15); }
.overdue-count { color: var(--danger); font-weight: 600; font-size: 13px; }
.overdue-hint { color: var(--text-2); font-size: 12px; flex: 1; }
.overdue-list {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  overflow: hidden;
}
.overdue-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}
.overdue-item:last-child { border-bottom: none; }
.overdue-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.overdue-name { flex: 1; color: var(--text-1); }
.overdue-date { color: var(--text-3); font-family: var(--font-mono); font-size: 11px; }
.overdue-backfill {
  font-size: 11px; font-weight: 500; color: var(--accent);
  padding: 3px 8px; border-radius: var(--radius-sm);
  background: var(--accent-dim);
  transition: background 0.2s;
}
.overdue-backfill:hover { background: var(--accent-dim2); }

/* ---- Section Titles ---- */
.section-title {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.section-count {
  font-family: var(--font-mono); font-size: 10px;
  background: var(--surface-2); padding: 1px 6px; border-radius: 100px;
}

/* ---- Tracker Cards (Today) ---- */
.tracker-cards { display: flex; flex-direction: column; gap: 6px; margin-bottom: 24px; }
.tracker-card {
  display: flex;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.15s;
  animation: fadeIn 0.2s ease backwards;
}
.tracker-card:hover { border-color: var(--border); }
.tracker-card.completed { opacity: 0.6; }
.tracker-card.completed:hover { opacity: 0.8; }
.tracker-card-accent { width: 3px; flex-shrink: 0; }
.tracker-card-body { flex: 1; padding: 12px 14px; min-width: 0; }
.tracker-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.tracker-card-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tracker-card-name { font-size: 14px; font-weight: 500; color: var(--text-0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tracker-card-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tracker-card-group { font-size: 16px; flex-shrink: 0; }
.tracker-card-input { display: flex; align-items: center; gap: 8px; }

/* ---- Log Controls ---- */
.check-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border);
  transition: all 0.25s;
}
.check-btn:hover { border-color: var(--accent); color: var(--accent); }
.check-btn.checked { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.check-btn.checked svg { animation: checkPop 0.3s ease; }
@keyframes checkPop { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ---- Filter Pills ---- */
.group-filter-pills {
  display: flex; gap: 6px;
  overflow-x: auto; padding-bottom: 4px; margin-bottom: 20px;
  scrollbar-width: none;
}
.group-filter-pills::-webkit-scrollbar { display: none; }
.filter-pill {
  flex-shrink: 0; padding: 5px 12px; border-radius: 100px;
  font-size: 12px; font-weight: 500; color: var(--text-2);
  border: 1px solid var(--border); background: transparent;
  transition: all 0.2s; display: flex; align-items: center; gap: 4px;
}
.filter-pill:hover { border-color: var(--text-3); color: var(--text-1); }
.filter-pill.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* ---- Tracker List ---- */
.tracker-group-section { margin-bottom: 20px; }
.tracker-list { display: flex; flex-direction: column; gap: 2px; }
.group-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; margin-bottom: 6px;
}
.group-color-bar { width: 3px; height: 18px; border-radius: 2px; }
.group-emoji { font-size: 14px; }
.group-name { font-size: 13px; font-weight: 600; color: var(--text-0); flex: 1; }
.group-count {
  font-size: 11px; font-family: var(--font-mono); color: var(--text-3);
  background: var(--surface-2); padding: 1px 6px; border-radius: 100px;
}
.tracker-list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--surface-1); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); transition: border-color 0.2s;
}
.tracker-list-item:hover { border-color: var(--border); }
.tracker-list-item.inactive { opacity: 0.5; }
.tracker-list-color { width: 3px; height: 28px; border-radius: 2px; flex-shrink: 0; }
.tracker-list-info { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tracker-list-name { font-size: 13px; font-weight: 500; color: var(--text-0); }
.tracker-list-meta { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.tracker-list-stats { display: flex; align-items: center; gap: 8px; }
.tracker-list-actions { flex-shrink: 0; display: flex; gap: 4px; }

/* ---- Badges / Chips ---- */
.badge {
  font-size: 10px; font-weight: 500; font-family: var(--font-mono);
  padding: 1px 6px; border-radius: 100px;
  background: var(--surface-2); color: var(--text-2);
}
.badge.green { background: var(--accent-dim); color: var(--accent); }
.badge.danger { background: var(--danger-dim); color: var(--danger); }
.badge.muted { color: var(--text-3); }

/* ---- Stat Cards ---- */
.stat-cards { display: flex; gap: 10px; margin-bottom: 16px; }
.stat-card {
  flex: 1; background: var(--surface-1); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 14px;
  display: flex; flex-direction: column; gap: 2px; text-align: center;
}
.stat-value { font-size: 20px; font-weight: 600; color: var(--text-0); font-family: var(--font-mono); }
.stat-label { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }

/* ---- Calendar ---- */
.calendar-nav {
  display: flex; align-items: center; justify-content: center;
  gap: 20px; margin-bottom: 16px;
}
.cal-arrow {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); color: var(--text-2);
  font-size: 16px; transition: all 0.2s;
}
.cal-arrow:hover { background: var(--surface-2); color: var(--text-0); }
.cal-month-label {
  font-size: 16px; font-weight: 600; color: var(--text-0);
  min-width: 160px; text-align: center;
}
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-day-name {
  text-align: center; font-size: 10px; font-weight: 600;
  color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; padding: 6px 0;
}
.cal-cell {
  aspect-ratio: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; border-radius: var(--radius-sm); background: var(--surface-1);
  cursor: pointer; transition: background 0.2s, outline-color 0.2s;
  outline: 2px solid transparent; padding: 4px;
}
.cal-cell:hover { background: var(--surface-2); }
.cal-cell.empty { background: transparent; cursor: default; }
.cal-cell.today { outline-color: var(--accent); }
.cal-cell.selected { background: var(--surface-2); outline-color: var(--text-2); }
.cal-day-num { font-size: 12px; font-family: var(--font-mono); color: var(--text-1); font-weight: 500; }
.cal-dots { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; max-width: 40px; }
.cal-dot { width: 5px; height: 5px; border-radius: 50%; }
.cal-dot.filled { background: var(--dot-color, var(--accent)); }
.cal-dot.hollow { background: transparent; border: 1px solid var(--dot-color, var(--accent)); opacity: 0.5; }
.day-panel {
  margin-top: 16px; background: var(--surface-1);
  border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden;
}
.day-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border-subtle);
  font-size: 13px; font-weight: 500; color: var(--text-0);
}
.day-panel-list { max-height: 320px; overflow-y: auto; }
.day-panel-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border-subtle);
}
.day-panel-item:last-child { border-bottom: none; }
.day-panel-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.day-panel-name { flex: 1; font-size: 13px; color: var(--text-1); }
.day-panel-value { font-family: var(--font-mono); font-size: 12px; color: var(--text-2); }
.day-panel-log { font-size: 11px; font-weight: 500; color: var(--accent); padding: 3px 8px; border-radius: var(--radius-sm); background: var(--accent-dim); }
.day-panel-log:hover { background: var(--accent-dim2); }

/* ---- Heatmap ---- */
.heatmap-section { margin-bottom: 24px; }
.heatmap-controls { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.heatmap-toggle { display: flex; gap: 4px; }
.heatmap-nav { display: flex; align-items: center; gap: 8px; }
.heatmap-label { font-size: 14px; font-weight: 600; color: var(--text-0); min-width: 100px; text-align: center; }
.heatmap-grid { overflow-x: auto; }
.heatmap-cells { display: flex; gap: 2px; }
.heatmap-week-col { display: flex; flex-direction: column; gap: 2px; }
.heatmap-cell {
  width: 12px; height: 12px; border-radius: 2px;
  transition: outline-color 0.15s; outline: 1px solid transparent;
}
.heatmap-cell:hover:not(.future) { outline-color: var(--text-2); cursor: pointer; }
.heatmap-cell.today { outline-color: var(--text-0); }
.heatmap-cell.future { opacity: 0; pointer-events: none; }
.heatmap-cell-monthly {
  aspect-ratio: 1; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  transition: outline-color 0.15s; outline: 1px solid transparent; cursor: default;
}
.heatmap-cell-monthly:hover:not(.future):not(.empty) { outline-color: var(--text-2); cursor: pointer; }
.heatmap-cell-monthly.today { outline-color: var(--text-0); outline-width: 2px; }
.heatmap-cell-monthly.empty { background: transparent !important; }
.heatmap-cell-monthly.future { opacity: 0.15; pointer-events: none; }
.heatmap-day-num { font-size: 11px; font-family: var(--font-mono); color: var(--text-0); font-weight: 500; }
.heatmap-legend {
  display: flex; align-items: center; gap: 4px;
  justify-content: flex-end; margin-top: 16px;
}
.heatmap-legend-label { font-size: 11px; color: var(--text-3); }
.heatmap-tooltip {
  position: fixed;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 10px;
  font-size: 11px; pointer-events: none; z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  white-space: nowrap;
}
.heatmap-month-labels { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
.heatmap-month-label { font-size: 9px; color: var(--text-3); font-family: var(--font-mono); padding-left: 2px; }

/* ---- Modals ---- */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  align-items: flex-end; justify-content: center;
}
.modal-overlay.visible { display: flex; }
.modal {
  width: 100%; max-width: 520px; max-height: 90vh;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow-y: auto; padding: 20px 20px max(20px, env(safe-area-inset-bottom));
  animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px;
}
.modal-title { font-size: 17px; font-weight: 600; color: var(--text-0); }
.modal-close { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); color: var(--text-3); transition: all 0.2s; }
.modal-close:hover { background: var(--surface-2); color: var(--text-1); }
.modal-footer { display: flex; gap: 8px; margin-top: 20px; }
.modal-footer .btn-primary { flex: 1; }

/* ---- Tracker Detail (Sheet inside modal area) ---- */
.tracker-info-card {
  background: var(--surface-2); border-radius: var(--radius-md); padding: 14px; margin-bottom: 16px;
}
.tracker-info-name { font-size: 18px; font-weight: 600; color: var(--text-0); margin-bottom: 4px; }
.tracker-info-meta { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- Forms ---- */
.form-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.form-field label { font-size: 12px; font-weight: 500; color: var(--text-2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input[type="text"], input[type="password"], input[type="number"], input[type="date"],
select, textarea {
  width: 100%; padding: 10px 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-0);
  font-family: var(--font-ui); font-size: 14px;
  outline: none; transition: border-color 0.2s;
}
input[type="text"]:focus, input[type="password"]:focus, input[type="number"]:focus,
input[type="date"]:focus, select:focus, textarea:focus { border-color: var(--accent); }
select option { background: var(--surface-2); }
textarea { resize: vertical; min-height: 80px; }
.color-picker-row { display: flex; gap: 8px; flex-wrap: wrap; }
.color-swatch {
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: border-color 0.2s, transform 0.15s;
}
.color-swatch.selected { border-color: var(--text-0); transform: scale(1.15); }
.color-swatch:hover { transform: scale(1.1); }

/* ---- Buttons ---- */
.btn-primary {
  padding: 10px 16px; background: var(--accent); color: #000;
  font-weight: 600; font-size: 13px; border-radius: var(--radius-sm);
  transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.88; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-ghost {
  padding: 10px 16px; color: var(--text-2);
  font-size: 13px; font-weight: 500; border-radius: var(--radius-sm); transition: all 0.2s;
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text-0); }
.btn-outline {
  padding: 8px 16px; border: 1px solid var(--border); color: var(--text-1);
  font-size: 13px; font-weight: 500; border-radius: var(--radius-sm); transition: all 0.2s;
}
.btn-outline:hover { border-color: var(--text-3); }
.btn-danger {
  padding: 8px 16px; background: var(--danger-dim); color: var(--danger);
  font-size: 13px; font-weight: 600; border-radius: var(--radius-sm); transition: all 0.2s;
}
.btn-danger:hover { background: rgba(248,81,73,0.2); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.icon-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); color: var(--text-3); transition: all 0.2s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text-1); }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-dim); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---- Input type controls ---- */
.rating-stars { display: flex; gap: 4px; }
.star-btn { font-size: 22px; color: var(--text-3); transition: color 0.15s; }
.star-btn.active { color: var(--warning); }
.star-btn:hover ~ .star-btn { color: var(--text-3) !important; }
.choice-options { display: flex; gap: 6px; flex-wrap: wrap; }
.choice-option {
  padding: 6px 14px; border-radius: 100px;
  font-size: 13px; font-weight: 500; color: var(--text-2);
  border: 1px solid var(--border); background: transparent;
  transition: all 0.2s;
}
.choice-option:hover { border-color: var(--text-3); color: var(--text-1); }
.choice-option.selected { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.number-input-row { display: flex; align-items: center; gap: 8px; }
.number-unit { color: var(--text-2); font-size: 13px; white-space: nowrap; }

/* ---- Empty State ---- */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 20px; gap: 8px;
}
.empty-icon { font-size: 32px; }
.empty-text { color: var(--text-3); font-size: 14px; }
.empty-action { margin-top: 8px; }

/* ---- Schedule type chip tags ---- */
.sched-tag {
  font-size: 10px; font-family: var(--font-mono);
  color: var(--text-3); background: var(--surface-2);
  padding: 1px 6px; border-radius: 4px;
}

/* ---- Tabs within modals ---- */
.inner-tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.inner-tab {
  padding: 6px 14px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 500; color: var(--text-2); background: var(--surface-2); transition: all 0.2s;
}
.inner-tab.active { background: var(--accent-dim); color: var(--accent); }

/* ---- Group manage list ---- */
.group-manage-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--surface-1);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
  margin-bottom: 4px; transition: border-color 0.2s;
}
.group-manage-item:hover { border-color: var(--border); }
.group-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.group-manage-name { flex: 1; font-size: 13px; font-weight: 500; color: var(--text-0); }
.group-manage-count { font-size: 11px; font-family: var(--font-mono); color: var(--text-3); }

/* ---- Log modal note ---- */
.log-note-toggle { font-size: 12px; color: var(--accent); cursor: pointer; margin-top: 8px; display: inline-block; }

/* ---- Chart (number/rating over time) ---- */
.chart-wrapper { width: 100%; overflow-x: auto; }

/* ---- History entries ---- */
.history-entry {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: var(--surface-1);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); margin-bottom: 4px;
}
.history-date { font-family: var(--font-mono); font-size: 12px; color: var(--text-2); width: 80px; flex-shrink: 0; }
.history-value { flex: 1; font-size: 13px; color: var(--text-0); }
.history-note { font-size: 12px; color: var(--text-3); flex: 1; }

/* ---- Misc ---- */
.divider { height: 1px; background: var(--border-subtle); margin: 16px 0; }
.text-muted { color: var(--text-3); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.w-full { width: 100%; }

@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
  .stat-cards { flex-wrap: wrap; }
  .modal { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
}
