@font-face {
  font-family: "Outfit";
  src: url("fonts/Outfit-Variable.ttf") format("truetype");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root,
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f5f7;
  --bg-elevated: #ffffff;
  --sidebar: rgba(245, 245, 247, 0.86);
  --panel: #ffffff;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.12);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --faint: #8e8e93;
  --accent: #22c55e;
  --accent-hover: #16a34a;
  --accent-soft: rgba(34, 197, 94, 0.12);
  --accent-text: #ffffff;
  --ok: #248a3d;
  --ok-soft: rgba(36, 138, 61, 0.12);
  --warn: #b25000;
  --warn-soft: rgba(178, 80, 0, 0.12);
  --danger: #d70015;
  --danger-soft: rgba(215, 0, 21, 0.1);
  --bonus: #5856d6;
  --bonus-soft: rgba(88, 86, 214, 0.12);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06);
  --modal-scrim: rgba(0, 0, 0, 0.32);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Outfit", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  --sidebar-w: 240px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --bg-elevated: #1c1c1e;
  --sidebar: rgba(28, 28, 30, 0.92);
  --panel: #1c1c1e;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --faint: #8e8e93;
  --accent: #30d158;
  --accent-hover: #4ade80;
  --accent-soft: rgba(48, 209, 88, 0.18);
  --accent-text: #ffffff;
  --ok: #30d158;
  --ok-soft: rgba(48, 209, 88, 0.16);
  --warn: #ff9f0a;
  --warn-soft: rgba(255, 159, 10, 0.16);
  --danger: #ff453a;
  --danger-soft: rgba(255, 69, 58, 0.16);
  --bonus: #bf5af2;
  --bonus-soft: rgba(191, 90, 242, 0.18);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --shadow-card: 0 2px 14px rgba(0, 0, 0, 0.35);
  --modal-scrim: rgba(0, 0, 0, 0.55);
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

a {
  color: var(--accent);
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

/* —— Auth —— */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: var(--bg);
}

.auth-shell {
  width: 100%;
  max-width: 420px;
  position: relative;
}

.auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 2rem 1.75rem 1.5rem;
}

.auth-brand {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-brand-row {
  justify-content: center;
}

.auth-brand .brand-mark {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.auth-sub {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-title {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.auth-hint {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.auth-form .field {
  margin-bottom: 1rem;
}

.auth-form label,
.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.auth-form input,
.field input,
.field textarea,
.field select,
.editor-toolbar + .wysiwyg {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}

.auth-form input:focus,
.field input:focus,
.field textarea:focus,
.field select:focus,
.wysiwyg:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.auth-field-hint {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.auth-error {
  margin-bottom: 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.9rem;
}

.auth-success {
  margin-bottom: 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 0.9rem;
}

.auth-submit {
  width: 100%;
  margin-top: 0.25rem;
}

.auth-footer {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.auth-tools {
  position: absolute;
  top: 0;
  right: 0;
}

.auth-demo-note {
  margin-top: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--ok);
  font-size: 0.82rem;
  line-height: 1.4;
}

/* —— App shell —— */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  padding: 1.35rem 0.85rem 1rem;
  padding-top: max(1.35rem, env(safe-area-inset-top, 0px));
  padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  border-right: 1px solid var(--line);
  background: var(--sidebar);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  overflow: hidden;
}

.brand {
  flex-shrink: 0;
  padding: 0.45rem 0.7rem 0.5rem;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.brand-logo {
  width: 1.65rem;
  height: auto;
  flex-shrink: 0;
  color: var(--accent);
}

.brand-mark {
  display: block;
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.brand-mark em {
  font-style: normal;
  color: var(--accent);
  font-weight: 650;
}

.brand-sub {
  margin-top: 0.28rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 500;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.62rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text);
}

html[data-theme="dark"] .nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 550;
}

.nav-ico {
  width: 1.1rem;
  opacity: 0.9;
  flex-shrink: 0;
}

.nav-item span:last-child {
  font-size: 0.92rem;
}

.nav-divider {
  height: 1px;
  background: var(--line);
  margin: 0.45rem 0.5rem;
}

.sidebar-user {
  margin-top: auto;
  padding: 0.75rem 0.5rem 0;
  border-top: 1px solid var(--line);
}

.sidebar-user-name {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  padding: 0 0.35rem;
}

.sidebar-user-name strong {
  color: var(--text);
  font-weight: 600;
}

.sidebar-tools {
  padding: 0.25rem 0.35rem 0.35rem;
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--muted);
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

html[data-theme="light"] .theme-ico-sun,
html[data-theme="dark"] .theme-ico-moon {
  display: none;
}

.main {
  min-width: 0;
  padding: 1.4rem 1.75rem 2.5rem;
  background: var(--bg);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
  flex-wrap: wrap;
}

.page-title {
  margin: 0;
  font-size: clamp(1.65rem, 2.6vw, 2rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.page-sub {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 40rem;
  line-height: 1.45;
}

.top-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid var(--line-strong);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 0.55rem 0.95rem;
  border-radius: 980px;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 520;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.btn:hover {
  background: var(--bg);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-text);
}

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

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--accent);
}

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

.btn-danger {
  background: var(--danger);
  border-color: transparent;
  color: #fff;
}

.btn-danger-soft {
  background: var(--danger-soft);
  border-color: transparent;
  color: var(--danger);
}

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
}

.btn-lg {
  padding: 0.85rem 1.35rem;
  font-size: 1rem;
  font-weight: 600;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 560;
}

.badge-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.badge-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge-bonus {
  background: var(--bonus-soft);
  color: var(--bonus);
}

.badge-muted {
  background: rgba(0, 0, 0, 0.05);
  color: var(--muted);
}

html[data-theme="dark"] .badge-muted {
  background: rgba(255, 255, 255, 0.08);
}

.badge-mock {
  background: var(--accent-soft);
  color: var(--accent);
}

/* —— Stats —— */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 1.35rem;
}

.stat {
  padding: 0.95rem 1.05rem;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}

.stat-val {
  font-size: 1.55rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-val.accent {
  color: var(--accent);
}

.stat-val.bonus {
  color: var(--bonus);
}

.stat-val.warn {
  color: var(--warn);
}

.badge-late {
  background: var(--warn-soft);
  color: var(--warn);
}

.btn-warn-soft {
  background: var(--warn-soft);
  border-color: transparent;
  color: var(--warn);
}

.btn-warn-soft:hover {
  filter: brightness(0.97);
}

.stat-label {
  margin-top: 0.35rem;
  font-size: 0.76rem;
  color: var(--muted);
}

/* —— Emergency —— */
.emergency-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.35rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--danger-soft), rgba(215, 0, 21, 0.04));
  border: 1px solid rgba(215, 0, 21, 0.22);
  flex-wrap: wrap;
}

.emergency-banner h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--danger);
}

.emergency-banner p {
  margin: 0.25rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  max-width: 28rem;
  line-height: 1.4;
}

.btn-emergency {
  background: var(--danger);
  border-color: transparent;
  color: #fff;
  min-width: 10rem;
  font-weight: 600;
}

.btn-emergency:hover {
  filter: brightness(1.06);
  background: var(--danger);
}

/* —— Cards / panels —— */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.15rem 1.2rem;
  margin-bottom: 1rem;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.panel-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 620;
  letter-spacing: -0.02em;
}

.panel-meta {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

/* —— Reminder cards —— */
.reminder-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 1.1rem 1.15rem;
  margin-bottom: 0.85rem;
  box-shadow: var(--shadow-card);
}

.reminder-card.is-done {
  opacity: 0.72;
}

.reminder-card.is-bonus {
  border-color: rgba(88, 86, 214, 0.28);
  background: linear-gradient(180deg, var(--bonus-soft), var(--panel) 48%);
}

.reminder-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.reminder-time {
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.reminder-project {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0.75rem 0 1rem;
}

.task-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--line);
}

.task-row.done {
  opacity: 0.65;
}

.task-check {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  flex-shrink: 0;
  margin-top: 0.1rem;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.task-check.is-checked {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.task-check svg {
  width: 0.7rem;
  height: 0.7rem;
}

.task-body {
  flex: 1;
  min-width: 0;
}

.task-title {
  font-weight: 560;
  font-size: 0.95rem;
}

.task-preview {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.task-media {
  margin-top: 0.55rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #111;
  aspect-ratio: 16 / 9;
  max-width: 22rem;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.85rem;
  position: relative;
}

.task-media::after {
  content: "▶ Video-Einbettung";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.45);
}

.reminder-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.streak-rule {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--muted);
}

/* —— Segmented control —— */
.seg {
  display: inline-flex;
  padding: 0.2rem;
  border-radius: 980px;
  background: var(--bg);
  border: 1px solid var(--line);
  gap: 0.15rem;
  flex-wrap: wrap;
}

.seg-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.4rem 0.85rem;
  border-radius: 980px;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 520;
}

.seg-btn.is-active {
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-card);
}

/* —— Calendar / overview —— */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.4rem;
}

.cal-head {
  text-align: center;
  font-size: 0.72rem;
  color: var(--faint);
  font-weight: 560;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.35rem 0;
}

.cal-day {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  font-size: 0.85rem;
  font-weight: 550;
  cursor: pointer;
}

.cal-day.is-today {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.cal-day.is-empty {
  opacity: 0.35;
  cursor: default;
}

.cal-dots {
  display: flex;
  gap: 0.15rem;
}

.cal-dot {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: var(--accent);
}

.cal-dot.miss {
  background: var(--danger);
}

.cal-dot.bonus {
  background: var(--bonus);
}

.cal-dot.late {
  background: var(--warn);
}

.heatmap {
  display: grid;
  grid-template-columns: repeat(18, minmax(0, 1fr));
  gap: 0.28rem;
}

.heat-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  background: rgba(34, 197, 94, 0.12);
}

.heat-cell.l1 { background: rgba(34, 197, 94, 0.25); }
.heat-cell.l2 { background: rgba(34, 197, 94, 0.45); }
.heat-cell.l3 { background: rgba(34, 197, 94, 0.7); }
.heat-cell.l4 { background: var(--accent); }
.heat-cell.miss { background: var(--danger-soft); }

/* —— Project / list rows —— */
.list-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.list-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.list-row:first-child {
  padding-top: 0;
}

.proj-icon {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
  font-weight: 650;
}

.proj-icon.alt {
  background: var(--bonus-soft);
  color: var(--bonus);
}

.proj-icon.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.list-body {
  flex: 1;
  min-width: 0;
}

.list-title {
  font-weight: 580;
  font-size: 0.98rem;
}

.list-meta {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.list-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

/* —— Forms —— */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  border: 1px solid var(--line-strong);
  background: var(--bg-elevated);
  color: var(--muted);
  padding: 0.4rem 0.75rem;
  border-radius: 980px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 520;
}

.chip.is-on {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
}

.time-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.time-slot {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem 0.35rem 0.75rem;
  border-radius: 980px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 0.88rem;
  font-weight: 550;
}

.time-slot button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0.1rem 0.25rem;
  font-size: 1rem;
  line-height: 1;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.4rem;
}

.editor-toolbar button {
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  border-radius: 6px;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--muted);
}

.wysiwyg {
  min-height: 8rem;
  line-height: 1.5;
}

.wysiwyg:empty::before {
  content: attr(data-placeholder);
  color: var(--faint);
}

.threshold-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px dashed var(--line-strong);
}

.threshold-box strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.threshold-box p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

/* —— Admin table —— */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.admin-table th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.invite-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
}

/* —— Modal —— */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--modal-scrim);
  display: grid;
  place-items: center;
  padding: 1.25rem;
  z-index: 100;
}

.modal {
  width: 100%;
  max-width: 520px;
  max-height: min(90vh, 720px);
  overflow: auto;
  background: var(--panel);
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 1.35rem 1.35rem 1.15rem;
}

.modal.wide {
  max-width: 680px;
}

.modal h2 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.modal-lead {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.15rem;
  flex-wrap: wrap;
}

.audio-mock {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--line);
}

.audio-wave {
  flex: 1;
  height: 2rem;
  border-radius: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--accent) 0 3px,
    transparent 3px 7px
  );
  opacity: 0.55;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

/* —— Mobile —— */
.mobile-topbar {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  padding-top: max(0.75rem, env(safe-area-inset-top, 0px));
  border-bottom: 1px solid var(--line);
  background: var(--sidebar);
  position: sticky;
  top: 0;
  z-index: 40;
}

.mobile-brand {
  font-weight: 650;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.mobile-brand em {
  font-style: normal;
  color: var(--accent);
}

.menu-toggle {
  border: 0;
  background: transparent;
  padding: 0.35rem;
  cursor: pointer;
  color: var(--text);
}

.menu-toggle svg {
  width: 1.4rem;
  height: 1.4rem;
  display: block;
}

.sidebar-overlay {
  display: none;
}

.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 0.7rem 1.1rem;
  border-radius: 980px;
  font-size: 0.88rem;
  font-weight: 520;
  z-index: 200;
  box-shadow: var(--shadow);
}

.name-ideas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.name-chip {
  padding: 0.4rem 0.75rem;
  border-radius: 980px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 0.85rem;
  font-weight: 550;
}

.name-chip strong {
  color: var(--accent);
  font-weight: 650;
}

@media (max-width: 960px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-2,
  .grid-3,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .heatmap {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
}

/* —— Filters / project chips / settings —— */
.filter-tabs {
  margin-bottom: 1rem;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--line-strong);
  background: var(--bg-elevated);
  color: var(--muted);
  padding: 0.4rem 0.8rem;
  border-radius: 980px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 520;
}

.filter-chip.is-on {
  background: color-mix(in srgb, var(--proj, var(--accent)) 16%, transparent);
  border-color: transparent;
  color: var(--text);
  font-weight: 560;
}

.project-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.65rem 0.28rem 0.45rem;
  border-radius: 980px;
  font-size: 0.78rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--proj, var(--accent)) 16%, transparent);
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--proj, var(--accent)) 35%, transparent);
}

.project-chip.is-muted {
  background: var(--bg);
  border-color: var(--line);
  color: var(--muted);
}

.project-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.reminder-project-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.late-hint {
  font-size: 0.72rem;
  color: var(--warn);
  font-weight: 520;
}

.reminder-card.has-project-accent {
  border-left: 4px solid var(--proj, var(--accent));
}

.reminder-card.is-late {
  border-color: color-mix(in srgb, var(--warn) 40%, var(--line));
  background: linear-gradient(180deg, var(--warn-soft), var(--panel) 55%);
  opacity: 1;
}

.reminder-plan {
  border-left: 4px solid var(--proj, var(--accent));
}

.list-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.scoring-card {
  padding: 0.95rem 1.1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}

.scoring-card-title {
  font-weight: 620;
  font-size: 0.95rem;
  margin-bottom: 0.55rem;
  letter-spacing: -0.02em;
}

.scoring-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.scoring-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.4;
}

.soft-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}

.soft-banner strong {
  display: block;
  font-size: 0.92rem;
}

.soft-banner p {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.soft-banner-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.toggle-row:last-of-type {
  border-bottom: 0;
}

.toggle-row strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 580;
}

.toggle-hint {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.toggle-row input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.settings-doc {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px dashed var(--line-strong);
}

.settings-doc h3 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.settings-doc ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.55;
}

.settings-doc code,
.panel-meta code {
  font-size: 0.8em;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
}

.empty-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.5rem 0;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

@media (max-width: 820px) {
  .mobile-topbar {
    display: flex;
  }

  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(280px, 86vw);
    z-index: 50;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: var(--modal-scrim);
    z-index: 45;
  }

  .main {
    padding: 1.1rem 1rem 5rem;
  }

  .streak-rule {
    margin-left: 0;
    width: 100%;
  }
}
