/* =============================================================================
   AI Groove – Dashboard, Einstellungen, Hilfe
   ========================================================================== */

.page {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(var(--s-5) + var(--safe-t)) calc(var(--s-5) + var(--safe-r)) calc(var(--s-7) + var(--safe-b))
    calc(var(--s-5) + var(--safe-l));
}

.page__inner {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--s-6);
}

/* --- Kopfbereich ----------------------------------------------------------- */

.brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.brand__mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  flex: none;
  background: linear-gradient(150deg, var(--c-accent), var(--c-mint));
  box-shadow: var(--sh-glow);
  position: relative;
  overflow: hidden;
}

.brand__mark::after {
  content: '';
  position: absolute;
  inset: 11px;
  background: var(--c-bg);
  clip-path: polygon(0 40%, 22% 40%, 22% 8%, 45% 8%, 45% 92%, 68% 92%, 68% 30%, 100% 30%, 100% 62%, 0 62%);
}

.brand__name {
  font-size: var(--fs-lg);
  font-weight: 680;
  letter-spacing: -0.025em;
}

.brand__ver {
  font-size: var(--fs-xs);
  color: var(--c-text-faint);
  font-family: var(--font-mono);
}

.page-head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
}

.page-head__spacer {
  flex: 1;
}

/* --- Hero ------------------------------------------------------------------ */

.hero {
  position: relative;
  padding: clamp(28px, 6vw, 56px);
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  border: 1px solid var(--c-border);
  box-shadow: var(--sh-3), inset 0 1px 0 var(--glass-hi);
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    70% 120% at 100% 0%,
    color-mix(in srgb, var(--c-accent) 22%, transparent),
    transparent 60%
  );
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-text-faint);
  margin-bottom: var(--s-3);
}

.hero__title {
  font-size: clamp(32px, 7vw, 56px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.02;
  background: linear-gradient(120deg, var(--c-text) 30%, var(--c-accent-soft) 75%, var(--c-mint));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  max-width: 16ch;
}

.hero__sub {
  margin-top: var(--s-4);
  color: var(--c-text-dim);
  font-size: clamp(14px, 2.2vw, 17px);
  line-height: 1.55;
  max-width: 56ch;
}

.hero__actions {
  margin-top: var(--s-5);
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.hero__wave {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(46%, 420px);
  height: 100%;
  opacity: 0.5;
  pointer-events: none;
}

/* --- Kachelraster ---------------------------------------------------------- */

.section-title {
  font-size: var(--fs-sm);
  font-weight: 640;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-text-faint);
  margin-bottom: var(--s-3);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: var(--s-4);
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-2);
  padding: var(--s-4);
  min-height: 132px;
  text-align: left;
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: var(--sh-1), inset 0 1px 0 var(--glass-hi);
  transition:
    transform var(--d-med) var(--e-spring),
    box-shadow var(--d-med) var(--e-out),
    border-color var(--d-med) var(--e-out),
    background var(--d-med) var(--e-out);
}

.tile:hover {
  transform: translateY(-3px);
  border-color: var(--c-border-strong);
  box-shadow: var(--sh-3);
  background: var(--c-surface-2);
}

.tile:active {
  transform: translateY(-1px) scale(0.99);
}

.tile:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.tile__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--c-accent) 18%, transparent);
  color: var(--c-accent-soft);
  margin-bottom: var(--s-1);
}

.tile__title {
  font-size: var(--fs-lg);
  font-weight: 620;
  letter-spacing: -0.02em;
}

.tile__text {
  font-size: var(--fs-sm);
  color: var(--c-text-dim);
  line-height: 1.5;
}

.tile--primary {
  background: linear-gradient(
    140deg,
    color-mix(in srgb, var(--c-accent) 30%, transparent),
    color-mix(in srgb, var(--c-mint) 14%, transparent)
  );
  border-color: color-mix(in srgb, var(--c-accent) 45%, transparent);
}

.tile--primary .tile__icon {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* --- Zuletzt verwendete Projekte ------------------------------------------- */

.recent {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.recent__row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  transition: background var(--d-fast) var(--e-out), border-color var(--d-fast) var(--e-out);
}

.recent__row:hover {
  background: var(--c-surface-2);
  border-color: var(--c-border-strong);
}

.recent__main {
  flex: 1;
  min-width: 0;
  text-align: left;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
}

.recent__name {
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent__meta {
  font-size: var(--fs-xs);
  color: var(--c-text-faint);
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-top: 2px;
}

/* --- Einstellungen / Formularseiten ---------------------------------------- */

.settings-group {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding: var(--s-5);
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
}

.settings-row {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  flex-wrap: wrap;
}

.settings-row__label {
  flex: 1;
  min-width: 190px;
}

.settings-row__label b {
  display: block;
  font-weight: 600;
}

.settings-row__label span {
  display: block;
  font-size: var(--fs-xs);
  color: var(--c-text-faint);
  line-height: 1.5;
  margin-top: 2px;
}

.settings-row__control {
  flex: none;
  min-width: 180px;
  display: flex;
  justify-content: flex-end;
  gap: var(--s-2);
}

.kbd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.kbd-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--c-border);
}

.kbd-table td:last-child {
  text-align: right;
}

kbd {
  display: inline-block;
  min-width: 24px;
  padding: 2px 7px;
  border-radius: var(--r-xs);
  border: 1px solid var(--c-border-strong);
  border-bottom-width: 2px;
  background: var(--c-surface-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-align: center;
}

/* --- Hilfe / Tutorial ------------------------------------------------------ */

.steps {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  counter-reset: step;
}

.step {
  display: flex;
  gap: var(--s-4);
  padding: var(--s-4);
  border-radius: var(--r-md);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
}

.step::before {
  counter-increment: step;
  content: counter(step);
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--c-accent) 26%, transparent);
  color: var(--c-text);
  font-size: var(--fs-sm);
  font-weight: 700;
  font-family: var(--font-mono);
}

.step b {
  display: block;
  margin-bottom: 2px;
}

.step span {
  color: var(--c-text-dim);
  font-size: var(--fs-sm);
  line-height: 1.55;
}

.prose {
  color: var(--c-text-dim);
  font-size: var(--fs-md);
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.prose h3 {
  color: var(--c-text);
  font-size: var(--fs-lg);
  margin-top: var(--s-2);
}

.prose ul {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: var(--s-4);
}

.prose li {
  list-style: disc;
}

/* --- Coach-Marks (First-Run) ----------------------------------------------- */

.coach {
  position: fixed;
  z-index: 5800;
  width: min(320px, calc(100vw - 32px));
  padding: var(--s-4);
  border-radius: var(--r-md);
  background: var(--c-bg-elev);
  border: 1px solid var(--c-accent);
  box-shadow: var(--sh-3), var(--sh-glow);
  animation: modal-in var(--d-med) var(--e-spring);
}

.coach__title {
  font-weight: 660;
  margin-bottom: 4px;
}

.coach__text {
  font-size: var(--fs-sm);
  color: var(--c-text-dim);
  line-height: 1.55;
}

.coach__foot {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-4);
}

.coach__count {
  font-size: var(--fs-xs);
  color: var(--c-text-faint);
  font-family: var(--font-mono);
  margin-right: auto;
}

.coach-spot {
  position: fixed;
  z-index: 5700;
  border-radius: var(--r-md);
  box-shadow:
    0 0 0 3px var(--c-accent),
    0 0 0 9999px rgba(4, 6, 12, 0.66);
  pointer-events: none;
  transition: all var(--d-med) var(--e-out);
}
