/* Full-screen profile area — Kiez-Signal styling */
.profile-page-body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background-color: var(--bg-main);
  background-image: var(--bg-grad);
  background-attachment: fixed;
}

/* .kq sets overflow:hidden + height:100% on body — allow page scroll */
body.kq.profile-page-body {
  overflow-x: hidden;
  overflow-y: auto;
  height: auto;
}

.profile-app-shell {
  min-height: 100dvh;
  height: auto;
  overflow: visible;
}

.profile-app-shell.kq {
  overflow: visible;
  height: auto;
}

.profile-app-shell .app-header.global-header {
  margin-bottom: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}

.profile-app-shell .app-header.global-header .brand.brand-link {
  flex: 0 0 auto;
}

.profile-app-shell .app-header.global-header #header-city-tabs {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
}

.profile-app-shell .header-hub-nav:not([hidden]) {
  flex: 1 1 auto;
  min-width: 0;
}

.profile-app-shell .app-header.global-header .stats-bar {
  flex: 0 0 auto;
  margin-left: auto;
  flex-wrap: nowrap;
}

.profile-app-shell .xp-pill--active {
  border-color: color-mix(in srgb, var(--signal) 45%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--signal) 20%, transparent);
}

.profile-app {
  display: grid;
  grid-template-columns: 1fr;
  min-height: calc(100dvh - var(--kq-header-offset, 72px));
  width: 100%;
  max-width: min(120rem, 100vw);
  margin: 0 auto;
}

.profile-app--ready {
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  min-height: 100dvh;
}

.profile-app--ready .profile-main-column {
  min-height: 0;
}

.profile-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.25rem 1rem;
  background: color-mix(in srgb, var(--bg-surface, var(--surface, #171A24)) 94%, transparent);
  border-right: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.profile-app--ready .profile-sidebar {
  position: sticky;
  top: var(--kq-header-offset, 72px);
  align-self: start;
  z-index: 40;
  max-height: calc(100dvh - var(--kq-header-offset, 72px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.profile-sidebar[hidden] {
  display: none;
}

.profile-sidebar-brand {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.profile-back-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
}

.profile-back-link:hover {
  color: var(--signal);
}

.profile-sidebar-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--kreide);
}

.profile-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.profile-nav-item {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
}

.profile-nav-item:hover {
  color: var(--kreide);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}

.profile-nav-item.is-active {
  color: var(--kreide);
  border-color: rgba(255, 82, 51, 0.35);
  background: linear-gradient(90deg, rgba(255, 82, 51, 0.14), rgba(255, 82, 51, 0.04));
  box-shadow: inset 3px 0 0 var(--signal);
}

.profile-admin-nav {
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.profile-admin-nav-label {
  margin: 0 0 0.5rem;
  padding: 0 0.85rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--signal);
}

.profile-nav-item--admin.is-active {
  border-color: rgba(220, 38, 38, 0.45);
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.16), rgba(220, 38, 38, 0.04));
  box-shadow: inset 3px 0 0 #dc2626;
}

.profile-admin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  margin-left: 0.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
  background: #dc2626;
}

.profile-admin-action {
  max-width: 36rem;
}

.profile-admin-gate {
  max-width: 32rem;
}

.admin-ai-dashboard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.admin-ai-dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex-shrink: 0;
}

.admin-ai-dashboard-status {
  margin: 0.75rem 0 0;
}

.admin-ai-dashboard {
  max-width: none;
}

.profile-main:has(.admin-ai-dashboard) {
  overflow: visible;
}

.admin-ai-dashboard-mount-wrap.is-loading {
  opacity: 0.55;
  pointer-events: none;
  min-height: 8rem;
}

.admin-ai-dashboard-mount-wrap.is-loading::after {
  content: "…";
  display: block;
  text-align: center;
  padding: 3rem 0;
  font-size: 2rem;
  color: var(--ai-muted);
}

.admin-ai-dashboard-mount-wrap {
  margin-top: 1rem;
  position: relative;
}

.admin-ai-dashboard-mount {
  display: block;
  width: 100%;
}

.ai-dash-hint {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--ai-muted);
}

.ai-dash-root {
  /* Bridge KiezQuiz theme tokens (avoid --text: that is the font family in .kq) */
  --ai-text: var(--text-primary, var(--kreide, #fcfbf8));
  --ai-muted: var(--text-muted, var(--text-3, #9aa0b0));
  --ai-surface: var(--surface, var(--bg-surface, #171a24));
  --ai-surface-2: var(--surface-2, var(--bg-surface-hover, #252938));
  --ai-line: var(--line, var(--border-color, #363b4f));
  --ai-accent: var(--himmel, #5aa9ff);
  color: var(--ai-text);
  font-size: 0.95rem;
  line-height: 1.5;
}

.ai-dash-meta {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  color: var(--ai-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.ai-dash-ops-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ai-dash-ops-pill--ok {
  background: #e6f4ea;
  color: #1a7f37;
}

.ai-dash-ops-pill--off {
  background: #fff8e1;
  color: #9a6700;
}

.ai-dash-h2 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ai-text);
}

.ai-dash-root h3,
.ai-dash-root h4,
.ai-dash-root .ai-dash-member-name,
.ai-dash-root .ai-dash-project-title,
.ai-dash-root .ai-dash-auto-name,
.ai-dash-root .ai-dash-todo-task,
.ai-dash-root .ai-dash-tl-date,
.ai-dash-root .ai-dash-tl-what {
  color: var(--ai-text);
}

/* ---- Überblick: Kennzahlen-Kacheln ---- */
.ai-dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.ai-dash-stat {
  background: var(--ai-surface);
  border: 1px solid var(--ai-line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  text-align: center;
}

.ai-dash-stat--accent {
  border-color: var(--ai-accent);
  background: color-mix(in srgb, var(--ai-accent) 12%, var(--ai-surface));
}

.ai-dash-stat-num {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ai-accent);
}

.ai-dash-stat-label {
  font-size: 0.75rem;
  color: var(--ai-muted);
}

/* ---- Dein Schreibtisch ---- */
.ai-dash-desk {
  background: linear-gradient(135deg, rgba(130, 80, 223, 0.08), rgba(9, 105, 218, 0.06));
  border: 1px solid var(--ai-line);
  border-radius: 14px;
  padding: 1rem 1.15rem 1.15rem;
  margin-bottom: 1.5rem;
}

.ai-dash-desk-head {
  margin-bottom: 0.85rem;
}

.ai-dash-desk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
}

.ai-dash-desk-card {
  background: var(--ai-surface);
  border: 1px solid var(--ai-line);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
}

.ai-dash-desk-card h3 {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
}

/* ---- Organigramm-Leiste ---- */
.ai-dash-org-lane {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
  padding: 0.85rem;
  background: var(--ai-surface);
  border: 1px solid var(--ai-line);
  border-radius: 12px;
}

.ai-dash-org-node {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 2px solid var(--ai-line);
}

.ai-dash-org-node--owner { background: #fbefff; border-color: #8250df; color: #6b3fc0; }
.ai-dash-org-node--ceo { background: #ddf4ff; border-color: #0969da; color: #0a5fc0; }
.ai-dash-org-node--team { background: #eef1f4; border-color: #8b93a7; color: #57606a; }

.ai-dash-org-arrow {
  color: var(--ai-muted);
  font-weight: 700;
}

/* ---- Organigramm-Baum ---- */
.ai-dash-org-tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1rem;
  background: var(--ai-surface);
  border: 1px solid var(--ai-line);
  border-radius: 12px;
}

.ai-dash-org-tier {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
}

.ai-dash-org-vline {
  width: 2px;
  height: 1.25rem;
  background: var(--ai-line);
}

.ai-dash-org-branch-label {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ai-muted);
}

.ai-dash-org-ceo-desc {
  margin: 0;
  max-width: 36rem;
  font-size: 0.82rem;
  color: var(--ai-muted);
}

.ai-dash-org-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.65rem;
  width: 100%;
  margin-top: 0.25rem;
}

.ai-dash-org-agent {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.65rem 0.75rem;
  background: var(--ai-surface-2);
  border: 1px solid var(--ai-line);
  border-left: 3px solid #8b93a7;
  border-radius: 10px;
  min-width: 0;
}

.ai-dash-org-agent.ai-dash-status--ok { border-left-color: #1a7f37; }
.ai-dash-org-agent.ai-dash-status--warn { border-left-color: #bf8700; }
.ai-dash-org-agent.ai-dash-status--urgent { border-left-color: #cf222e; }
.ai-dash-org-agent.ai-dash-status--paused,
.ai-dash-org-agent.ai-dash-status--neutral { border-left-color: #8b93a7; }

.ai-dash-org-agent .ai-dash-emoji { font-size: 1.35rem; }
.ai-dash-org-agent-text { font-size: 0.84rem; min-width: 0; }
.ai-dash-org-agent-text strong { display: block; }
.ai-dash-org-agent .ai-dash-badge { align-self: flex-start; font-size: 0.72rem; }

/* ---- Sektionen ---- */
.ai-dash-section {
  margin-bottom: 1.75rem;
}

.ai-dash-section > .ai-dash-hint {
  margin-bottom: 0.9rem;
}

/* ---- Team-Mitglied-Karten ---- */
.ai-dash-members {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.ai-dash-member.is-ceo {
  grid-column: 1 / -1;
}

.ai-dash-member {
  background: var(--ai-surface);
  border: 1px solid var(--ai-line);
  border-left: 4px solid var(--ai-line);
  border-radius: 12px;
  padding: 1rem 1.15rem;
}

.ai-dash-member.is-ceo {
  border-left-color: #0969da;
  background: linear-gradient(135deg, rgba(9, 105, 218, 0.05), rgba(26, 127, 55, 0.04));
}

.ai-dash-member.ai-dash-status--ok { border-left-color: #1a7f37; }
.ai-dash-member.ai-dash-status--warn { border-left-color: #bf8700; }
.ai-dash-member.ai-dash-status--urgent { border-left-color: #cf222e; }
.ai-dash-member.ai-dash-status--paused,
.ai-dash-member.ai-dash-status--neutral { border-left-color: #8b93a7; }
.ai-dash-member.is-ceo.ai-dash-status--ok { border-left-color: #0969da; }

.ai-dash-member-head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.4rem;
}

.ai-dash-emoji {
  font-size: 1.6rem;
  line-height: 1;
}

.ai-dash-member-id { min-width: 0; }

.ai-dash-member-name {
  margin: 0;
  font-size: 1.05rem;
}

.ai-dash-role {
  margin: 0.1rem 0 0;
  font-size: 0.78rem;
  color: var(--ai-muted);
}

.ai-dash-badge {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.ai-dash-badge--ok { background: #e6f4ea; color: #1a7f37; }
.ai-dash-badge--warn { background: #fff8e1; color: #9a6700; }
.ai-dash-badge--urgent { background: #ffebe9; color: #cf222e; }
.ai-dash-badge--paused { background: #eef1f4; color: #57606a; }
.ai-dash-badge--neutral { background: #eef1f4; color: #57606a; }

.ai-dash-explain {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.ai-dash-status-msg {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  color: var(--ai-muted);
}

/* ---- Kennzahlen ---- */
.ai-dash-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.4rem;
  margin: 0 0 0.9rem;
}

.ai-dash-metric {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.6rem;
  background: color-mix(in srgb, var(--ai-text) 4%, transparent);
  border-radius: 8px;
  font-size: 0.82rem;
}

.ai-dash-metric-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: #8b93a7;
}

.ai-dash-metric.ai-dash-status--ok .ai-dash-metric-dot { background: #1a7f37; }
.ai-dash-metric.ai-dash-status--warn .ai-dash-metric-dot { background: #bf8700; }
.ai-dash-metric.ai-dash-status--urgent .ai-dash-metric-dot { background: #cf222e; }
.ai-dash-metric.ai-dash-status--paused .ai-dash-metric-dot,
.ai-dash-metric.ai-dash-status--neutral .ai-dash-metric-dot { background: #8b93a7; }

.ai-dash-metric-label { color: var(--ai-muted); }
.ai-dash-metric-value { margin-left: auto; font-weight: 600; text-align: right; }

/* ---- Spalten: Todos + Automationen ---- */
.ai-dash-member-cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.25rem;
}

.ai-dash-block h4 {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ai-muted);
}

/* ---- Todo-Tabelle ---- */
.ai-dash-todo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.ai-dash-todo-table th {
  text-align: left;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ai-muted);
  padding: 0 0.4rem 0.3rem 0;
  font-weight: 600;
}

.ai-dash-todo-table td {
  padding: 0.4rem 0.4rem 0.4rem 0;
  border-top: 1px solid var(--ai-line);
  vertical-align: top;
}

.ai-dash-todo-task { font-weight: 500; }

.ai-dash-due-cell { white-space: nowrap; }
.ai-dash-due { display: block; }
.ai-dash-due-rel {
  display: block;
  font-size: 0.72rem;
  color: var(--ai-muted);
}
.ai-dash-due-rel.is-soon { color: #bf8700; font-weight: 600; }
.ai-dash-due-rel.is-over { color: #cf222e; font-weight: 600; }

.ai-dash-prio {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}
.ai-dash-prio--urgent { background: #ffebe9; color: #cf222e; }
.ai-dash-prio--warn { background: #fff8e1; color: #9a6700; }
.ai-dash-prio--ok { background: #e6f4ea; color: #1a7f37; }
.ai-dash-prio--neutral { background: #eef1f4; color: #57606a; }

/* ---- Automations-Liste ---- */
.ai-dash-auto-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ai-dash-auto-list li {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding-left: 0.65rem;
  border-left: 2px solid var(--ai-line);
}

.ai-dash-auto-name { font-weight: 600; font-size: 0.85rem; }
.ai-dash-auto-next { font-size: 0.75rem; color: var(--ai-accent); }

.ai-dash-automations-section {
  background: linear-gradient(180deg, rgba(9, 105, 218, 0.04), transparent);
  border: 1px solid var(--ai-line);
  border-radius: 14px;
  padding: 1rem 1.1rem 1.15rem;
}

.ai-dash-bundle-note {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.75rem;
  background: rgba(9, 105, 218, 0.08);
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.45;
}

.ai-dash-auto-table .ai-dash-auto-slug {
  display: block;
  font-size: 0.68rem;
  margin-top: 0.1rem;
}

.ai-dash-cron {
  font-size: 0.72rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: color-mix(in srgb, var(--ai-text) 6%, transparent);
}

.ai-dash-kind {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
}

.ai-dash-kind--n8n { background: #ddf4ff; color: #0969da; }
.ai-dash-kind--cron { background: #eef1f4; color: #57606a; }
.ai-dash-kind--github_action { background: #fbefff; color: #6b3fc0; }
.ai-dash-kind--cursor_legacy { background: #fff8e1; color: #9a6700; }

.ai-dash-run-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

.ai-dash-run-badge--ok { background: #e6f4ea; color: #1a7f37; }
.ai-dash-run-badge--warn { background: #fff8e1; color: #9a6700; }
.ai-dash-run-badge--urgent { background: #ffebe9; color: #cf222e; }
.ai-dash-run-badge--neutral { background: #eef1f4; color: #57606a; }

.ai-dash-auto-detail-row td {
  font-size: 0.78rem;
  color: var(--ai-muted);
  padding-top: 0;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--ai-line);
}

.ai-dash-auto-row td {
  vertical-align: top;
  padding-bottom: 0.25rem;
  border-bottom: none;
}

.ai-dash-auto-last {
  font-size: 0.78rem;
  white-space: nowrap;
}

.ai-dash-member-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  flex-shrink: 0;
}

.ai-dash-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 1rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--ai-line);
}

.ai-dash-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--ai-line);
  background: var(--ai-surface);
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--ai-text);
}

.ai-dash-tab.is-active {
  background: color-mix(in srgb, var(--ai-accent) 18%, var(--ai-surface));
  border-color: var(--ai-accent);
  color: var(--ai-accent);
  font-weight: 600;
}

.ai-dash-tab-panel {
  margin-top: 0.5rem;
}

.ai-dash-desk-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}

.ai-dash-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.ai-dash-filter-btn {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--ai-line);
  background: var(--ai-surface);
  color: var(--ai-text);
  font-size: 0.75rem;
  cursor: pointer;
}

.ai-dash-filter-btn.is-active {
  background: var(--ai-surface-2);
  font-weight: 600;
}

.ai-dash-routine-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.85rem;
}

.ai-dash-routine-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--ai-surface-2);
  color: var(--ai-muted);
  border: 1px solid var(--ai-line);
}

.ai-dash-team-nav {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.65rem;
}

.ai-dash-team-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.75rem;
  border: 1px solid var(--ai-line);
  border-radius: 12px;
  background: var(--ai-surface);
  color: var(--ai-text);
  text-align: left;
  cursor: pointer;
  border-left: 3px solid #8b93a7;
}

.ai-dash-team-card.is-ceo { border-left-color: #0969da; }
.ai-dash-team-card.ai-dash-status--ok { border-left-color: #1a7f37; }
.ai-dash-team-card.ai-dash-status--warn { border-left-color: #bf8700; }
.ai-dash-team-card.ai-dash-status--urgent { border-left-color: #cf222e; }

.ai-dash-team-card-lage {
  font-size: 0.75rem;
  color: var(--ai-muted);
  line-height: 1.35;
}

.ai-dash-ceo-refs {
  margin-top: 1rem;
  display: grid;
  gap: 0.5rem;
}

.ai-dash-ceo-ref {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--ai-line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--ai-text) 3%, transparent);
  color: var(--ai-text);
  cursor: pointer;
  text-align: left;
  border-left: 3px solid #8b93a7;
}

.ai-dash-ceo-ref.ai-dash-status--ok { border-left-color: #1a7f37; }
.ai-dash-ceo-ref.ai-dash-status--warn { border-left-color: #bf8700; }

.ai-dash-project-summary,
.ai-dash-project-note {
  margin: 0.25rem 0 0.4rem;
  font-size: 0.78rem;
  color: var(--ai-muted);
  line-height: 1.4;
}

.ai-dash-todo-note {
  display: block;
  margin-top: 0.15rem;
}

.ai-dash-data-overview {
  margin-top: 1.25rem;
}

.ai-dash-explain {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--ai-muted);
}

/* ---- Listen, Chips, Muted ---- */
.ai-dash-list {
  margin: 0;
  padding-left: 1.1rem;
}
.ai-dash-list li { margin: 0.3rem 0; font-size: 0.86rem; }

.ai-dash-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.ai-dash-chip {
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--ai-surface-2);
  color: var(--ai-muted);
}

.ai-dash-muted {
  color: var(--ai-muted);
  font-size: 0.8rem;
}

.ai-dash-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ai-muted);
}

.ai-dash-member-foot {
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--ai-line);
}
.ai-dash-member-foot p { margin: 0.2rem 0; font-size: 0.82rem; }
.ai-dash-today { font-size: 0.86rem; }

/* ---- Executive: Lage + KPIs ---- */
.ai-dash-lage {
  margin: 0 0 0.9rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.ai-dash-h3 {
  margin: 1.5rem 0 0.6rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ai-text);
}

.ai-dash-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.6rem;
  margin: 0 0 1rem;
}

.ai-dash-kpi {
  background: color-mix(in srgb, var(--ai-text) 3%, transparent);
  border: 1px solid var(--ai-line);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  border-top: 3px solid #8b93a7;
}
.ai-dash-kpi.ai-dash-status--ok { border-top-color: #1a7f37; }
.ai-dash-kpi.ai-dash-status--warn { border-top-color: #bf8700; }
.ai-dash-kpi.ai-dash-status--urgent { border-top-color: #cf222e; }
.ai-dash-kpi.ai-dash-status--paused,
.ai-dash-kpi.ai-dash-status--neutral { border-top-color: #8b93a7; }

.ai-dash-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

.ai-dash-kpi-label {
  font-size: 0.74rem;
  color: var(--ai-muted);
  line-height: 1.2;
}

.ai-dash-kpi-figure {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.4rem;
}

.ai-dash-kpi-value {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ai-text);
}
.ai-dash-kpi.ai-dash-status--ok .ai-dash-kpi-value { color: #1a7f37; }
.ai-dash-kpi.ai-dash-status--warn .ai-dash-kpi-value { color: #9a6700; }
.ai-dash-kpi.ai-dash-status--urgent .ai-dash-kpi-value { color: #cf222e; }

.ai-dash-kpi-target {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.7rem;
  color: var(--ai-muted);
}

.ai-dash-spark {
  width: 56px;
  height: 26px;
  flex-shrink: 0;
  color: #8b93a7;
}
.ai-dash-spark--ok { color: #1a7f37; }
.ai-dash-spark--warn { color: #bf8700; }
.ai-dash-spark--urgent { color: #cf222e; }

.ai-dash-src {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  white-space: nowrap;
}
.ai-dash-src--live { background: #e6f4ea; color: #1a7f37; }
.ai-dash-src--manuell { background: #eef1f4; color: #57606a; }
.ai-dash-src--pending { background: #fff8e1; color: #9a6700; }
.ai-dash-src--neutral { background: #eef1f4; color: #57606a; }

/* ---- GSC Wochen-Chart (Marie) ---- */
.ai-dash-chart-block {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid color-mix(in srgb, var(--ai-text) 8%, transparent);
}

.ai-dash-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.ai-dash-chart-head h4 {
  margin: 0;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ai-muted);
}

.ai-dash-chart-meta {
  margin: 0 0 0.65rem;
  font-size: 0.76rem;
  color: var(--ai-muted);
}

.ai-dash-bar-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
  align-items: end;
  height: 7.5rem;
  padding: 0.25rem 0.15rem 0;
}

.ai-dash-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 0.2rem;
  min-width: 0;
}

.ai-dash-bar-val {
  font-size: 0.68rem;
  font-weight: 700;
  color: #1a7f37;
  line-height: 1;
  min-height: 0.85rem;
}

.ai-dash-bar-col.is-pending .ai-dash-bar-val {
  color: var(--ai-muted);
  font-weight: 500;
}

.ai-dash-bar {
  display: block;
  width: 100%;
  max-width: 2.25rem;
  min-height: 4px;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, #3fb950 0%, #1a7f37 100%);
}

.ai-dash-bar-col.is-pending .ai-dash-bar {
  background: rgba(139, 147, 167, 0.25);
  min-height: 4px;
}

.ai-dash-bar-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ai-muted);
}

/* ---- Kommende Projekte ---- */
.ai-dash-projects {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.ai-dash-project-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 0.5rem;
  margin-bottom: 0.3rem;
}

.ai-dash-project-title { font-weight: 600; font-size: 0.88rem; }
.ai-dash-project-meta { font-size: 0.76rem; color: var(--ai-muted); }

.ai-dash-progress {
  position: relative;
  height: 1.1rem;
  background: color-mix(in srgb, var(--ai-text) 8%, transparent);
  border-radius: 999px;
  overflow: hidden;
}

.ai-dash-progress-bar {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, #0969da, #1a7f37);
  border-radius: 999px;
}

.ai-dash-progress-val {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ai-text);
}

/* ---- Organigramm & Arbeitsweise ---- */
.ai-dash-org-roles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.5rem;
  margin: 1rem 0;
}

.ai-dash-org-role {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.6rem 0.7rem;
  background: var(--ai-surface);
  border: 1px solid var(--ai-line);
  border-left: 3px solid #8b93a7;
  border-radius: 8px;
}
.ai-dash-org-role.ai-dash-status--ok { border-left-color: #1a7f37; }
.ai-dash-org-role.ai-dash-status--warn { border-left-color: #bf8700; }
.ai-dash-org-role.ai-dash-status--urgent { border-left-color: #cf222e; }

.ai-dash-org-role .ai-dash-emoji { font-size: 1.2rem; }
.ai-dash-org-role-text { font-size: 0.84rem; min-width: 0; }
.ai-dash-org-role-desc {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--ai-muted);
}

/* ---- Zeitleiste ---- */
.ai-dash-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ai-dash-timeline-item {
  display: grid;
  grid-template-columns: auto 7.5rem 1fr;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: var(--ai-surface);
  border: 1px solid var(--ai-line);
  border-left: 4px solid var(--ai-line);
  border-radius: 8px;
}
.ai-dash-timeline-item.ai-dash-status--urgent { border-left-color: #cf222e; }
.ai-dash-timeline-item.ai-dash-status--warn { border-left-color: #bf8700; }
.ai-dash-timeline-item.ai-dash-status--ok { border-left-color: #1a7f37; }

.ai-dash-tl-date { font-size: 0.82rem; font-weight: 600; }
.ai-dash-tl-what { font-size: 0.88rem; }
.ai-dash-tl-note { grid-column: 2 / -1; }

/* ---- Automations-Tabelle ---- */
.ai-dash-table-wrap { overflow-x: auto; }

.ai-dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  background: var(--ai-surface);
  border: 1px solid var(--ai-line);
  border-radius: 8px;
}

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

.ai-dash-table th {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--ai-muted);
  background: color-mix(in srgb, var(--ai-text) 4%, transparent);
}

.ai-dash-owner { white-space: nowrap; }
.ai-dash-num { text-align: center; }

@media (max-width: 900px) {
  .ai-dash-stats { grid-template-columns: repeat(2, 1fr); }
  .ai-dash-member-cols { grid-template-columns: 1fr; gap: 1rem; }
}

@media (max-width: 720px) {
  .admin-ai-dashboard-head {
    flex-direction: column;
    gap: 0.75rem;
  }
  .ai-dash-timeline-item {
    grid-template-columns: auto 1fr;
  }
  .ai-dash-tl-date { grid-column: 2; }
  .ai-dash-tl-what { grid-column: 2; }
  .ai-dash-tl-note { grid-column: 2; }
}

.profile-main-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.profile-page-head {
  padding: 1.25rem 1.5rem 0.35rem;
}

.profile-page-eyebrow {
  display: block;
  margin: 0 0 0.35rem;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--signal);
}

.profile-page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  font-weight: 800;
  color: var(--kreide);
  letter-spacing: -0.02em;
}

.profile-global-rank-card {
  margin-bottom: 1.5rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 191, 0, 0.25);
  background: rgba(255, 191, 0, 0.06);
}

.profile-cities-heading {
  margin: 0 0 0.75rem;
}

.profile-city-stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.profile-city-details {
  border: 1px solid var(--acc-line, var(--border-color));
  border-radius: var(--radius-lg);
  background: var(--acc-fill-soft, rgba(255, 255, 255, 0.03));
  overflow: hidden;
}

.profile-city-summary {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  color: var(--kreide);
}

.profile-city-summary::-webkit-details-marker {
  display: none;
}

.profile-city-summary::after {
  content: '▾';
  margin-left: auto;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.profile-city-details[open] .profile-city-summary::after {
  transform: rotate(180deg);
}

.profile-city-summary-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--acc-bright, var(--signal));
  box-shadow: 0 0 8px var(--acc-glow, transparent);
  flex-shrink: 0;
}

.profile-city-summary-name {
  font-family: var(--font-display);
  font-size: 1rem;
}

.profile-city-summary-rank {
  font-size: 0.82rem;
  color: var(--acc-bright, var(--color-xp));
}

.profile-city-summary-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.profile-city-details-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--acc-line, rgba(255, 255, 255, 0.08));
}

.profile-trophy-gallery {
  margin-bottom: 0.75rem;
}

.profile-history-list .profile-history-item {
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-main {
  flex: 1;
  padding: 1.25rem 1.5rem 2.5rem;
  overflow: auto;
}

.profile-state {
  max-width: 36rem;
  margin: 4rem auto 0;
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.profile-state h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  color: var(--kreide);
}

.profile-state--error {
  border-color: rgba(255, 82, 51, 0.35);
}

.profile-state p {
  margin: 0 0 1.25rem;
  color: var(--text-secondary);
}

.profile-link-btn {
  display: inline-flex;
  text-decoration: none;
}

.profile-panel {
  background: var(--surface, var(--bg-surface));
  border: 1px solid var(--line, var(--border-color));
  border-radius: var(--radius, var(--radius-lg));
  padding: 1.25rem 1.25rem 1.5rem;
  box-shadow: var(--shadow, 0 12px 40px -20px rgba(0, 0, 0, 0.55));
}

.profile-panel-intro {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.profile-city-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.profile-city-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  border-top: 2px solid rgba(255, 82, 51, 0.45);
  transition: var(--transition-fast);
}

.profile-city-card:hover {
  border-color: rgba(255, 82, 51, 0.35);
  transform: translateY(-1px);
}

.profile-city-card h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--kreide);
}

.profile-stat-line {
  margin: 0.25rem 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.profile-history-list {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.profile-history-item {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.profile-history-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.profile-history-mode {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--kreide);
}

.profile-history-districts {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 0.1rem;
}

.profile-history-score {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.profile-account-actions {
  margin-bottom: 0.5rem;
}

.profile-account-block {
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-color);
}

.profile-account-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 28rem;
  margin-top: 0.75rem;
}

.profile-account-form .auth-field input {
  width: 100%;
  box-sizing: border-box;
}

.profile-panel .profile-account-block .profile-section-title {
  margin-bottom: 0.35rem;
}

.profile-panel .profile-account-block .profile-feedback:not([hidden]) {
  margin: 0;
}

.profile-panel .profile-account-actions {
  margin-top: 0.5rem;
  padding-top: 0.25rem;
}

.profile-panel .kq-btn {
  width: auto;
  min-width: 8rem;
}

.profile-btn-signout {
  display: inline-flex;
}

.profile-search-field {
  flex: 1;
  min-width: min(100%, 260px);
}

.profile-autocomplete-container {
  position: relative;
}

.profile-autocomplete-dropdown {
  top: calc(100% + 4px);
  bottom: auto;
  margin-bottom: 0;
}

.profile-autocomplete-item {
  width: 100%;
  border: none;
  background: transparent;
  font: inherit;
  text-align: left;
}

.profile-delete-modal {
  max-width: 420px;
  text-align: left;
}

.profile-danger-banner {
  display: inline-block;
  margin-bottom: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(220, 50, 50, 0.18);
  border: 1px solid rgba(220, 50, 50, 0.55);
  color: #ff6b6b;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.profile-delete-confirm-label {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
}

.profile-delete-confirm-label input {
  margin-top: 0.15rem;
  accent-color: #ef4444;
}

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

.profile-delete-actions .profile-btn-danger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.profile-btn-danger {
  background: rgba(220, 50, 50, 0.2);
  border: 1px solid rgba(220, 50, 50, 0.5);
  color: #ff6b6b;
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font: inherit;
}

.profile-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: min(100%, 200px);
}

.profile-field-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.profile-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.profile-search-row .text-input-field {
  flex: 1;
  min-width: 160px;
}

.profile-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.18);
}

.profile-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.profile-data-table th,
.profile-data-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.profile-data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.profile-data-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.02);
}

.profile-data-table .profile-num-col {
  text-align: right;
  white-space: nowrap;
}

.profile-request-list,
.profile-friend-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.profile-request-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
}

.profile-request-actions {
  display: flex;
  gap: 0.35rem;
}

.profile-empty {
  margin: 0;
  padding: 1rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.profile-section-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--kreide);
}

.profile-danger-zone {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(220, 50, 50, 0.25);
}

.profile-danger-zone p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.profile-btn-danger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.profile-feedback {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.profile-feedback--error {
  color: #ffb4b4;
}

@media (max-width: 960px) {
  .profile-app--ready {
    grid-template-columns: 1fr;
  }

  .profile-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .profile-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .profile-nav-item {
    width: auto;
  }
}

@media (max-width: 720px) {
  .profile-page-head,
  .profile-main {
    padding-inline: 1rem;
  }
}

/* Player dashboard — overview section */
.profile-dashboard-hero {
  margin-bottom: 1.25rem;
}

.profile-dashboard-greeting {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  font-weight: 700;
  color: var(--kreide);
}

.profile-dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

.profile-stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.05rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.03);
}

.profile-stat-card--xp {
  border-color: rgba(255, 191, 0, 0.25);
  background: rgba(255, 191, 0, 0.06);
}

.profile-stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
}

.profile-stat-value {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--kreide);
  line-height: 1.1;
}

.profile-stat-meta {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.profile-stat-bar {
  margin-top: 0.35rem;
}

.profile-stat-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.profile-dashboard-cities-lead {
  margin-top: -0.35rem;
  margin-bottom: 1rem;
}

.profile-dashboard-cities {
  margin-bottom: 0.5rem;
}

.profile-city-module {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.profile-city-module > .city-tile {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  margin-bottom: 0;
}

.profile-city-module > .profile-city-details {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: none;
  margin-top: 0;
}

.profile-city-details-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
  padding: 0.65rem 1rem;
  cursor: pointer;
  list-style: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.profile-city-details-toggle::-webkit-details-marker {
  display: none;
}

.profile-city-details-toggle::after {
  content: '▾';
  margin-left: auto;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.profile-city-details[open] .profile-city-details-toggle::after {
  transform: rotate(180deg);
}

.profile-city-details-toggle-label {
  color: var(--acc-bright, var(--text-primary));
  font-weight: 700;
}

.profile-city-details-toggle-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.profile-dashboard-cities .wish-tile {
  align-self: stretch;
}

.profile-city-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1rem 1.05rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--acc-line, var(--border-color));
  background: var(--acc-fill-soft, rgba(255, 255, 255, 0.03));
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
}

.profile-city-card:hover {
  border-color: var(--acc, var(--signal));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.profile-city-card--soon {
  opacity: 0.72;
}

.profile-city-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.profile-city-card-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--kreide);
}

.profile-city-card-home {
  color: var(--signal);
  margin-left: 0.2rem;
}

.profile-city-card-rank,
.profile-city-card-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  white-space: nowrap;
}

.profile-city-card-greet,
.profile-city-card-blurb {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.profile-city-card-stats {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.profile-city-card-cta {
  margin-top: auto;
  padding-top: 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--acc, var(--signal));
}

/* Unified player dashboard layout */
.profile-dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 1.25rem;
  align-items: start;
  margin-top: 0.5rem;
}

.profile-dashboard-main {
  min-width: 0;
}

.profile-dashboard-aside {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: sticky;
  top: 1rem;
}

.profile-widget {
  padding: 1rem 1.05rem;
  border-radius: var(--radius, var(--radius-lg));
  border: 1px solid var(--line, var(--border-color));
  background: var(--surface, rgba(255, 255, 255, 0.03));
}

.profile-widget-title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--kreide);
}

.profile-widget-lead {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.profile-widget-badge {
  margin: 0 0 0.65rem;
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 82, 51, 0.12);
  border: 1px solid rgba(255, 82, 51, 0.3);
  color: var(--signal);
  font-size: 0.78rem;
  font-weight: 700;
}

.profile-widget-empty {
  padding: 0.5rem 0;
  text-align: left;
}

.profile-friend-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.profile-friend-chip {
  display: inline-block;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.profile-widget-link {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--signal);
  cursor: pointer;
}

.profile-widget-link:hover {
  text-decoration: underline;
}

.profile-widget-lb {
  margin-bottom: 0.65rem;
  min-height: 2rem;
}

.profile-mini-lb {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.profile-mini-lb-row {
  display: grid;
  grid-template-columns: 1.5rem 1fr auto;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.profile-mini-lb-rank {
  font-weight: 800;
  color: var(--text-muted);
  font-family: var(--font-mono, monospace);
}

.profile-mini-lb-user {
  font-weight: 600;
  color: var(--kreide);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-mini-lb-score {
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.profile-city-summary-home {
  color: var(--signal);
  margin-left: 0.15rem;
}

.profile-city-details-actions {
  margin-bottom: 0.85rem;
}

.profile-city-play-btn {
  text-decoration: none;
}

.profile-trophy-gallery .trophy-tile {
  border-color: var(--line, var(--border-color));
  background: color-mix(in srgb, var(--surface-2, rgba(255, 255, 255, 0.03)) 80%, transparent);
}

.profile-trophy-gallery .trophy-tile--earned {
  border-color: color-mix(in srgb, var(--bernstein, #F4B53C) 45%, var(--line));
  background: color-mix(in srgb, var(--bernstein, #F4B53C) 10%, transparent);
}

@media (max-width: 960px) {
  .profile-dashboard-layout {
    grid-template-columns: 1fr;
  }

  .profile-dashboard-aside {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .profile-dashboard-aside .profile-widget {
    flex: 1 1 min(100%, 280px);
  }
}

/* —— Settings panel —— */
.profile-settings-panel {
  max-width: 40rem;
}

.profile-settings-block {
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-color);
}

.profile-settings-block:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.profile-settings-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.profile-settings-hint {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
  min-width: 0;
}

.profile-settings-manual-label {
  margin: 0.75rem 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.profile-settings-manual.is-hidden {
  display: none;
}

.profile-settings-switch {
  flex-shrink: 0;
  width: 2.75rem;
  height: 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface-hover);
  cursor: pointer;
  position: relative;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.profile-settings-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: var(--text-primary);
  transition: transform 0.2s ease;
}

.profile-settings-switch.is-on {
  background: color-mix(in srgb, var(--signal) 35%, var(--bg-surface));
  border-color: color-mix(in srgb, var(--signal) 55%, var(--border-color));
}

.profile-settings-switch.is-on::after {
  transform: translateX(1.25rem);
}

.profile-settings-segment {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.profile-settings-segment-btn {
  flex: 1 1 auto;
  min-width: 7rem;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.profile-settings-segment-btn.is-active {
  border-color: color-mix(in srgb, var(--signal) 50%, var(--border-color));
  background: color-mix(in srgb, var(--signal) 12%, var(--bg-surface));
  color: var(--text-primary);
}

.profile-settings-block--danger .profile-btn-danger {
  margin-top: 0.65rem;
}
