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

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --border: #e1e4e8;
  --text: #1a1a2e;
  --muted: #6b7280;
  --green: #16a34a;
  --green-bg: #dcfce7;
  --yellow: #d97706;
  --yellow-bg: #fef3c7;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --orange: #ea580c;
  --orange-bg: #ffedd5;
  --blue: #2563eb;
  --blue-bg: #dbeafe;
  --primary: #2c3e50;
  --radius: 10px;
  --shadow: 0 1px 4px rgba(0,0,0,.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

/* ── Nav ── */
nav {
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 16px;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: wrap;
}
nav .nav-brand {
  font-weight: 700;
  font-size: 16px;
  margin-right: 12px;
  white-space: nowrap;
}
nav button {
  background: none;
  border: none;
  color: rgba(255,255,255,.7);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all .15s;
  white-space: nowrap;
}
nav button:hover { background: rgba(255,255,255,.1); color: #fff; }
nav button.active { background: rgba(255,255,255,.2); color: #fff; font-weight: 600; }

/* ── Layout ── */
main { max-width: 900px; margin: 0 auto; padding: 20px 16px 60px; }

.screen { display: none; }
.screen.active { display: block; }

/* ── Cards ── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

/* ── Day header ── */
.day-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.day-date { font-size: 22px; font-weight: 700; }
.day-type-badge {
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--blue-bg);
  color: var(--blue);
  font-weight: 600;
}
.status-badge {
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 700;
}
.status-green { background: var(--green-bg); color: var(--green); }
.status-yellow { background: var(--yellow-bg); color: var(--yellow); }
.status-red { background: var(--red-bg); color: var(--red); }

.load-bar {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-top: 8px;
}
.load-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--border);
  transition: background .2s;
}
.load-dot.on { background: var(--orange); }
.load-label { font-size: 12px; color: var(--muted); margin-left: 6px; }

.focus-row { margin-top: 10px; font-size: 14px; color: var(--muted); }
.focus-row span { color: var(--text); font-weight: 600; }
.motto { margin-top: 10px; font-size: 13px; color: var(--muted); font-style: italic; }

.red-note {
  margin-top: 8px;
  font-size: 13px;
  color: var(--red);
  padding: 8px 12px;
  background: var(--red-bg);
  border-radius: 6px;
}

/* ── Day parts ── */
.part-section { margin-bottom: 20px; }
.part-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
}
.part-count {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

/* ── Activity items ── */
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  background: var(--surface);
  transition: border-color .15s;
}
.activity-item.status-done { opacity: .6; border-color: var(--green); }
.activity-item.status-skipped { opacity: .5; }
.activity-item.status-overload { border-color: var(--orange); background: var(--orange-bg); }
.activity-item.status-moved { opacity: .55; }

.activity-meta {
  flex: 1;
  min-width: 0;
}
.activity-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.activity-name { font-weight: 600; font-size: 15px; }
.domain-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--blue-bg);
  color: var(--blue);
  white-space: nowrap;
}
.imp-badge {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.imp-core { background: #fce7f3; color: #9d174d; }
.imp-support { background: #ede9fe; color: #5b21b6; }
.imp-optional { background: var(--bg); color: var(--muted); }

.activity-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }

.activity-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.btn-status {
  border: none;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: all .15s;
  white-space: nowrap;
}
.btn-done    { background: var(--green-bg);  color: var(--green); }
.btn-skip    { background: var(--bg);        color: var(--muted); }
.btn-move    { background: var(--blue-bg);   color: var(--blue); }
.btn-overload { background: var(--orange-bg); color: var(--orange); font-weight: 700; }
.btn-status:hover { filter: brightness(.9); }
.btn-status.active-status { outline: 2px solid currentColor; }

/* ── Empty state ── */
.empty-day {
  text-align: center;
  padding: 48px 20px;
}
.empty-day h2 { font-size: 20px; margin-bottom: 10px; }
.empty-day p { color: var(--muted); margin-bottom: 24px; font-size: 14px; }

/* ── Create day form ── */
.create-day-form { max-width: 480px; margin: 0 auto; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.form-group select,
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  background: var(--surface);
  color: var(--text);
}
.form-group textarea { min-height: 80px; resize: vertical; }
.day-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.day-type-option {
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all .15s;
}
.day-type-option:hover { border-color: var(--primary); }
.day-type-option.selected { border-color: var(--primary); background: var(--blue-bg); }
.day-type-option .dt-name { font-weight: 700; font-size: 14px; }
.day-type-option .dt-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: all .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #1a252f; }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #d1d5db; }
.btn-danger { background: var(--red-bg); color: var(--red); }

/* ── Family screen ── */
/* ── Dashboard ─────────────────────────────────────────────────────────────── */
.dash-header-card { margin-bottom: 14px; }
.dash-header-row { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 8px; }
.dash-date { font-size: 16px; font-weight: 700; color: var(--text); }
.dash-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.dash-progress-wrap { margin-top: 12px; }
.dash-prog-labels { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.dash-progress-bar { height: 10px; background: var(--border); border-radius: 5px; overflow: hidden; }
.dash-progress-fill { height: 100%; background: var(--green); border-radius: 5px; transition: width .4s; }

.dash-now-card {
  background: #f0f9ff;
  border: 2px solid #93c5fd;
  margin-bottom: 16px;
}
.dash-now-title { font-size: 14px; font-weight: 700; color: #2563eb; margin-bottom: 12px; }
.dash-now-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.dash-now-col { }
.dash-now-person { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.dash-now-act { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.3; }
.dash-now-empty { font-size: 13px; color: var(--muted); }

.dash-leaders-card { margin-bottom: 16px; }
.dash-leaders-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.dash-leaders-list { display: flex; flex-direction: column; gap: 8px; }
.dash-leader-row { display: flex; align-items: center; gap: 8px; }
.dash-leader-place { font-size: 20px; width: 28px; text-align: center; flex-shrink: 0; }
.dash-leader-avatar { font-size: 18px; flex-shrink: 0; }
.dash-leader-name { font-size: 14px; font-weight: 600; color: var(--text); width: 60px; flex-shrink: 0; }
.dash-leader-bar-wrap { flex: 1; }
.dash-leader-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.dash-leader-bar-fill { height: 100%; border-radius: 4px; transition: width .4s; }
.dash-leader-pct { font-size: 13px; font-weight: 700; color: var(--text); width: 36px; text-align: right; flex-shrink: 0; }
.dash-leader-score { font-size: 11px; color: var(--muted); width: 36px; text-align: right; flex-shrink: 0; }

.dash-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-member-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.dash-member-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.dash-avatar { font-size: 36px; line-height: 1; }
.dash-name { font-size: 17px; font-weight: 700; color: var(--text); }
.dash-role { font-size: 11px; color: var(--muted); margin-top: 2px; }
.dash-bar-wrap { margin-bottom: 10px; }
.dash-bar-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.dash-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.dash-bar-fill { height: 100%; border-radius: 4px; transition: width .4s; }
.dash-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.stat-chip { font-size: 12px; padding: 2px 8px; border-radius: 12px; font-weight: 600; }
.stat-done     { background: var(--green-bg); color: var(--green); }
.stat-overload { background: var(--orange-bg); color: var(--orange); }
.stat-total    { background: var(--bg); color: var(--muted); }
.dash-tasks { border-top: 1px solid var(--border); padding-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.dash-task { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text); }
.dash-task.t-done .dtask-title { text-decoration: line-through; color: var(--muted); }
.dash-task.t-over .dtask-title { color: var(--orange); }
.dtask-icon { font-size: 11px; width: 14px; text-align: center; flex-shrink: 0; }
.td-done    { color: var(--green); }
.td-overload { color: var(--orange); }
.td-skipped { color: var(--muted); }
.td-planned { color: var(--border); }
.td-moved   { color: var(--blue); }
.dtask-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dtask-time { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.dash-more-btn {
  background: none; border: none; cursor: pointer;
  font-size: 11px; color: var(--blue); padding: 4px 0 0;
  text-align: left; font-family: inherit;
}
.dash-more-btn:hover { text-decoration: underline; }
.dash-more-extra { flex-direction: column; gap: 3px; }
.dash-empty { font-size: 13px; color: var(--muted); }

/* legacy (other screens still use these dots) */
.task-line { font-size: 13px; padding: 3px 0; display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--bg); }
.task-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.member-tasks { margin-top: 8px; }

@media (max-width: 700px) {
  .dash-now-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Activities screen ── */
.activities-domain { margin-bottom: 20px; }
.domain-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 0;
  border-bottom: 2px solid var(--border);
}
.domain-code { font-size: 18px; font-weight: 800; color: var(--primary); }
.domain-title-text { font-size: 16px; font-weight: 600; }
.activity-ref-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  margin-bottom: 6px;
  background: var(--surface);
}
.activity-ref-item.inactive { opacity: .45; }
.ref-name { flex: 1; font-size: 14px; }
.ref-meta { display: flex; gap: 6px; align-items: center; flex-shrink: 0; flex-wrap: wrap; }
.type-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg);
  color: var(--muted);
}
.toggle-btn {
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
}
.toggle-on  { background: var(--green-bg); color: var(--green); }
.toggle-off { background: var(--red-bg); color: var(--red); }

/* ── Evening sync ── */
.sync-form .form-group textarea { min-height: 72px; }
.sync-done {
  padding: 16px;
  background: var(--green-bg);
  border-radius: 8px;
  margin-top: 12px;
}
.sync-done h4 { color: var(--green); margin-bottom: 8px; }
.sync-done p { font-size: 14px; color: var(--text); margin-bottom: 6px; }

/* ── Weekly ── */
.week-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.week-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  text-align: center;
}
.week-stat-num { font-size: 28px; font-weight: 800; }
.week-stat-label { font-size: 12px; color: var(--muted); }
.num-green { color: var(--green); }
.num-yellow { color: var(--yellow); }
.num-red { color: var(--red); }
.num-orange { color: var(--orange); }

.syncs-list .sync-entry {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: 14px;
}
.sync-entry .se-date { font-weight: 700; margin-bottom: 4px; font-size: 13px; color: var(--muted); }
.sync-entry .se-q { color: var(--muted); font-size: 12px; }
.sync-entry .se-a { margin-bottom: 6px; }

.decisions-list .decision-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 10px 14px;
  margin-bottom: 8px;
  background: var(--surface);
  font-size: 14px;
}
.decision-item .di-title { font-weight: 600; }
.decision-item .di-desc { color: var(--muted); font-size: 13px; margin-top: 2px; }
.decision-item .di-meta { font-size: 11px; color: var(--muted); margin-top: 4px; }
.di-del { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 16px; flex-shrink: 0; padding: 2px 4px; }
.di-del:hover { color: var(--red); }

/* ── Settings ── */
.day-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.day-type-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
}
.day-type-card h3 { font-size: 15px; margin-bottom: 6px; }
.day-type-card p { font-size: 13px; color: var(--muted); line-height: 1.5; }

.tz-row { display: flex; gap: 10px; align-items: center; }
.tz-preview { font-size: 13px; color: var(--muted); margin-top: 8px; }

.cell-empty-block { background: var(--bg) !important; border: 1px dashed var(--border) !important; opacity: 0.6; }
.cell-empty-label { font-size: 13px; color: var(--muted); flex: 1; }
.empty-slot { display: flex; align-items: center; justify-content: center; min-height: 20px; }
.ca-slot-add { opacity: 0; transition: opacity .15s; font-size: 11px; }
.td-member:hover .ca-slot-add { opacity: 0.45; }
.ca-slot-add:hover { opacity: 1 !important; }

/* ── Section title ── */
.section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--primary);
}
.section-subtitle { font-size: 13px; color: var(--muted); margin-bottom: 16px; }

/* ── Failed activities ── */
.fail-list { list-style: none; }
.fail-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--bg);
  font-size: 14px;
}
.fail-count {
  font-weight: 700;
  min-width: 24px;
  text-align: right;
  color: var(--red);
}

/* ── Loading ── */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--muted);
  font-size: 15px;
}

/* ── Schedule grid ── */
.schedule-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.schedule-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}
.schedule-table thead tr {
  background: var(--primary);
  color: #fff;
}
.th-time {
  width: 100px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  border-right: 1px solid rgba(255,255,255,.15);
  position: sticky;
  left: 0;
  z-index: 3;
}
.th-member {
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  border-right: 1px solid rgba(255,255,255,.1);
  min-width: 180px;
}
.th-member:last-child { border-right: none; }

.schedule-row { border-bottom: 2px solid var(--border); }
.schedule-row:last-child { border-bottom: none; }
.row-empty { opacity: 0.38; }
.row-empty .td-time { padding: 3px 8px; }
.row-empty .td-member { padding: 3px 8px; min-height: 0; }
.row-empty .time-clock { font-size: 11px; font-weight: 500; }

/* current-time highlighting */
.slot-past { opacity: 0.5; }
.slot-past.row-empty { opacity: 0.18; }
.slot-current .td-time { background: var(--primary) !important; }
.slot-current .time-clock { color: #fff; }
.slot-current .time-progress { color: rgba(255,255,255,0.75); }

.td-time {
  padding: 10px 8px;
  vertical-align: top;
  border-right: 2px solid var(--border);
  background: var(--bg);
  width: 72px;
  text-align: center;
  position: sticky;
  left: 0;
  z-index: 2;
}
.time-clock { font-size: 14px; font-weight: 800; color: var(--primary); letter-spacing: .5px; }
.time-progress { font-size: 11px; color: var(--muted); margin-top: 4px; font-weight: 600; }

/* time period coloring */
.tp-morning { background: #fffbeb; }
.tp-day     { background: var(--bg); }
.tp-evening { background: #eff6ff; }
.tp-night   { background: #f5f3ff; }

.td-member {
  padding: 8px;
  vertical-align: top;
  border-right: 1px solid var(--border);
  min-width: 180px;
}
.td-member:last-child { border-right: none; }

/* grid cell */
.grid-cell {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 9px;
  margin-bottom: 6px;
  background: var(--surface);
  transition: border-color .15s;
}
.grid-cell:last-child { margin-bottom: 0; }
.grid-cell.cell-done     { border-color: var(--green);  background: var(--green-bg);  opacity: .75; }
.grid-cell.cell-skipped  { opacity: .45; }
.grid-cell.cell-overload { border-color: var(--orange); background: var(--orange-bg); }
.grid-cell.cell-moved    { opacity: .55; border-color: var(--blue); }

.cell-top {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}
.cell-name { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; }

.cell-actions {
  display: flex;
  gap: 3px;
}
.ca-btn {
  border: none;
  border-radius: 5px;
  padding: 3px 7px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 700;
  background: var(--bg);
  color: var(--muted);
  transition: all .12s;
}
.ca-btn:hover { filter: brightness(.9); }
.ca-done  { color: var(--green); }
.ca-skip  { color: var(--muted); }
.ca-move  { color: var(--blue); }
.ca-over  { color: var(--orange); }
.ca-edit  { color: var(--muted); opacity: .55; padding: 2px 5px; margin-left: auto; }
.ca-edit:hover { opacity: 1; color: var(--primary); }
.ca-save  { color: var(--green); font-weight: 700; }
.ca-active { outline: 2px solid currentColor; background: #fff; }

/* slot editor dropdown */
.slot-select {
  width: 100%;
  padding: 5px 7px;
  border: 1.5px solid var(--blue);
  border-radius: 6px;
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  margin-bottom: 5px;
  cursor: pointer;
}
.slot-edit-btns { display: flex; gap: 4px; }

/* ── Activities (tabs) ── */
.acts-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.acts-tab {
  border: none;
  background: none;
  padding: 8px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  border-radius: 0;
  transition: all .15s;
}
.acts-tab:hover { color: var(--primary); }
.acts-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Desktop/mobile visibility */
.acts-mobile-only  { display: none; }
.acts-desktop-only { display: block; }
@media (max-width: 700px) {
  .acts-mobile-only  { display: block; }
  .acts-desktop-only { display: none !important; }
}

/* 4-column catalog grid (desktop) */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: start;
}
.cat-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.cat-col-hdr {
  padding: 12px 14px 10px;
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  border-bottom: 2px solid var(--border);
}
.cat-col-body { padding: 8px 10px 4px; flex: 1; }

/* Domain groups */
.cat-domain-group { margin-bottom: 10px; }
.cat-domain-hdr {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0 4px 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.cat-domain-name { font-size: 12px; font-weight: 600; color: var(--muted); }
.acts-empty { padding: 14px 0; text-align: center; color: var(--muted); font-size: 13px; }

/* Add button inside col */
.acts-add-row { padding: 8px 10px 10px; }
.btn-sm { padding: 6px 12px; font-size: 13px; width: 100%; justify-content: center; }

.act-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  margin-bottom: 5px;
  background: var(--surface);
  cursor: default;
  user-select: none;
}
.act-row:hover { border-color: #c0c7d0; }
.act-row-editing { background: #f8faff; border-color: var(--blue); }
.act-title { flex: 1; font-size: 14px; }
.act-btns  { display: flex; gap: 4px; flex-shrink: 0; margin-left: auto; }
.act-btn   {
  border: none; border-radius: 5px; padding: 4px 8px;
  font-size: 13px; cursor: pointer; background: var(--bg); color: var(--muted);
  transition: all .12s;
}
.act-btn:hover { background: var(--border); color: var(--text); }
.act-del:hover { background: var(--red-bg); color: var(--red); }
.act-save { background: var(--green-bg); color: var(--green); font-weight: 700; }
.act-save:hover { background: var(--green); color: #fff; }

/* inline inputs */
.act-inp-time  { width: 62px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 5px; font-size: 13px; }
.act-inp-title { flex: 1; padding: 4px 8px; border: 1px solid var(--border); border-radius: 5px; font-size: 14px; }
.act-inp-dom   { padding: 4px 6px; border: 1px solid var(--border); border-radius: 5px; font-size: 13px; }

.acts-add-row  { margin-top: 8px; }
.act-add-form  {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 2px dashed var(--border);
  border-radius: 7px;
  background: var(--bg);
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--primary);
  color: #fff;
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  z-index: 10000;
  max-width: 88vw;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-warn { background: var(--orange); }
.toast-ok   { background: var(--green); }

/* ── Context menu ── */
.ctx-menu {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  padding: 4px;
  min-width: 180px;
  z-index: 9999;
  font-size: 14px;
}
.ctx-item {
  padding: 7px 12px;
  border-radius: 5px;
  cursor: pointer;
  color: var(--text);
  transition: background .1s;
}
.ctx-item:first-child { color: var(--muted); font-size: 12px; font-weight: 600; cursor: default; }
.ctx-item:first-child:hover { background: none; }
.ctx-item:hover { background: var(--bg); }
.ctx-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Responsive ── */
@media (max-width: 600px) {
  nav { height: auto; padding: 8px; }
  .activity-actions { gap: 3px; }
  .btn-status { padding: 4px 6px; font-size: 11px; }
  .day-type-grid { grid-template-columns: 1fr; }
  .week-stats { grid-template-columns: repeat(3, 1fr); }
}
