/* Settings: the profile form, the machine choice and the way back to onboarding. */

.st {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  padding-bottom: calc(var(--s-8) + env(safe-area-inset-bottom, 0px));
}

/* ---------- Top bar ---------- */
.st-top {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.st-top__inner {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  min-height: calc(64px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
}
.st-top__right { margin-left: auto; }

/* A form reads as one column — same width as the account screen. */
.st-top__inner,
.st-main { max-width: calc(760px + 2 * var(--gutter)); }
.st-main { padding-top: var(--s-6); }

/* ---------- Heading ---------- */
.st-head {
  display: grid;
  gap: var(--s-3);
  margin-bottom: var(--s-6);
}
.st-head__title {
  font-size: clamp(2rem, 6vw, 3rem);
  letter-spacing: -0.03em;
}
.st-head__sub {
  max-width: 54ch;
  color: var(--text-2);
  font-size: var(--fs-18);
}

/* ---------- Cards ---------- */
.st-form { display: grid; gap: var(--s-4); }

.st-card {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-5);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm), var(--shadow-inset);
}
.st-card__title {
  font-family: var(--font-display);
  font-size: var(--fs-18);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.st-card--danger {
  margin-top: var(--s-6);
  border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
}
/* Separated on purpose: "start over" must not sit shoulder to shoulder with "save". */
.st-card--danger .btn { justify-self: start; }
.st-danger__btn { color: var(--danger-text); }

.st-note {
  max-width: 62ch;
  color: var(--text-3);
  font-size: var(--fs-14);
  line-height: 1.6;
}
.st-card > .btn { justify-self: start; }

/* Telegram under the notification switch: by choice, a quiet second line, not a second card. */
.st-tg {
  display: grid;
  gap: var(--s-2);
  padding-top: var(--s-3);
  border-top: 1px solid var(--border);
}
.st-tg[hidden] { display: none; }
.st-tg .btn { justify-self: start; }

/* ---------- Identity from the college ---------- */
.st-id {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg);
}
.st-id__avatar {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: var(--r-full);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-size: var(--fs-18);
  font-weight: 800;
}
.st-id__body { min-width: 0; display: grid; gap: var(--s-1); }
.st-id__name {
  font-family: var(--font-display);
  font-size: var(--fs-16);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.st-id__meta { color: var(--text-2); font-size: var(--fs-12); overflow-wrap: anywhere; }

/* ---------- Editable fields ---------- */
.st-fields { display: grid; gap: var(--s-4); }
@media (min-width: 620px) {
  .st-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Группа шире пары имя/фамилия — ей целая строка. */
  .st-fields > .field:last-child { grid-column: 1 / -1; }
}

/* ---------- Machine ---------- */
.st-callout {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-4);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--fs-14);
  line-height: 1.6;
}
.st-callout svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--accent-text);
}
.st-callout > div { display: grid; gap: var(--s-3); justify-items: start; }
.st-callout strong { color: var(--text); }

/* ---------- Actions ---------- */
.st-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4);
}
/* На телефоне кнопка жила через два экрана прокрутки от полей: поменял имя
   наверху — листай вниз искать «Сохранить». Прилипает к низу, пока форма на
   экране; фон на всю ширину той же тенью с разлётом, что у вкладок конспекта. */
@media (max-width: 599px) {
  .st-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding: var(--s-3) 0 calc(var(--s-3) + env(safe-area-inset-bottom, 0px));
    background: var(--bg);
    box-shadow: 0 0 0 100vmax var(--bg);
    clip-path: inset(0 -100vmax -100vmax -100vmax);
    border-top: 1px solid var(--border);
  }
  .st-actions .btn { flex: 1 1 auto; }
}
.st-actions__link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--text-2);
  font-size: var(--fs-14);
  font-weight: 600;
}
.st-actions__link svg {
  width: 14px;
  height: 14px;
  transition: transform var(--dur-micro) var(--ease-out);
}
.st-actions__link:hover { color: var(--text); text-decoration: none; }
@media (pointer: coarse) {
  .st-actions__link { min-height: 44px; }
}
.st-actions__link:hover svg { transform: translateX(3px); color: var(--accent-text); }

@media (max-width: 519px) {
  .st-card { padding: var(--s-4); }
  .st-actions .btn { width: 100%; }
}

/* The panic call on a computer: the combination, «Поменять», and why a press was refused. */
.st-keys {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
}
.st-keys__label { color: var(--text-2); font-size: var(--fs-14); }
.st-keys__combo {
  padding: 4px 10px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-14);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.st-keys.is-recording .st-keys__combo { background: var(--accent-soft); color: var(--accent-text); }
.st-keys__hint { flex-basis: 100%; color: var(--text-3); font-size: var(--fs-12); }
.st-keys__hint:empty { display: none; }
.st-keys [hidden] { display: none; }
@media (pointer: coarse) and (max-width: 599px) { .st-keys { display: none; } }
