/* Profile (№ 05) — Atelier S7 + DESIGN.md amendments.
   Shared atoms (page-head, seg, fld, chips/chip, btn, label, fine) come from components.css; this file only
   lays out the screen and draws its own pieces: the monogram, the plan block, section heads, the paper
   swatches of the theme row, fine print. Every colour is R = G = B. */

.scr-profile {
  --pf-gap: var(--sec-gap, 40px);   /* between sections */
  --pf-caps: var(--fw-medium, 500) var(--fs-micro, 11px)/var(--lh-caps, 1.2) var(--sans);
  padding-bottom: var(--sp-2, 8px);
}

/* ---------- identity: a double-ruled monogram + the name -------------------- */

.scr-profile .pf-id {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; column-gap: 18px;
  margin: 18px var(--gutter) 0;
  padding: 18px 0;
  border-top: var(--hair) solid var(--rule);
}
.scr-profile .pf-mono {
  position: relative;
  display: grid; place-items: center;
  width: 64px; height: 64px;
  border: var(--stroke, 1px) solid var(--ink);
  color: var(--ink);
}
.scr-profile .pf-mono::after {          /* inner rule: the masthead's double line, drawn as a seal */
  content: ""; position: absolute; inset: 3px;
  border: var(--hair) solid var(--ink);
  pointer-events: none;
}
.scr-profile .pf-mono span {
  font: var(--fw-serif-title, 340) 34px/1 var(--serif);
  font-variant-numeric: lining-nums;
  transform: translateY(1px);       /* optical centre of a capital */
}
.scr-profile .pf-mono svg { width: 26px; height: 26px; }
.scr-profile .pf-id__name {
  font: italic var(--fw-serif-title, 340) 30px/1.08 var(--serif);
  letter-spacing: -.015em;
  overflow-wrap: break-word;        /* only a word wider than the line breaks — with a Russian hyphen (lang="ru") */
  -webkit-hyphens: auto; hyphens: auto;
}
.scr-profile .pf-id__name--long { font-size: 24px; line-height: 1.12; }    /* > 18 letters; JS clips at 40 */
.scr-profile .pf-id__name--sys {     /* a script the fonts do not carry: upright grotesque, never a faux italic */
  font: var(--fw-regular, 400) 24px/1.2 var(--sans);
  letter-spacing: 0;
}
.scr-profile .pf-id__meta {
  margin-top: 9px;
  font: var(--pf-caps); letter-spacing: var(--tr-caps, .1em); text-transform: uppercase;
  color: var(--ink-3);
}
.scr-profile .pf-id__meta:empty { display: none; }

/* ---------- plan ------------------------------------------------------------ */

.scr-profile .pf-plan {
  margin: 0 var(--gutter);
  padding: 18px 0 20px;
  border-top: var(--hair) solid var(--rule-2);
  border-bottom: var(--hair) solid var(--rule-2);
}
.scr-profile .pf-plan--premium {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; column-gap: 16px;
}
.scr-profile .pf-plan__t {
  font: var(--fw-serif-title, 340) var(--fs-title-s, 28px)/1.05 var(--serif);
  letter-spacing: var(--tr-title, -.02em);
}
.scr-profile .pf-plan__t em { font-style: italic; }
.scr-profile .pf-plan__s {
  margin-top: 8px;
  font: var(--fw-regular, 400) var(--fs-body-s, 14px)/1.4 var(--sans);
  color: var(--ink-2);
}
.scr-profile .pf-plan__s + .pf-plan__s { margin-top: 2px; }
.scr-profile .pf-plan__s--quiet { color: var(--ink-3); }
.scr-profile .pf-plan__row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 8px;
}
.scr-profile .pf-plan__row .pf-plan__s { margin-top: 0; }
.scr-profile .pf-plan__cta { flex: none; }
.scr-profile .pf-plan__cta .pf-star { width: 12px; height: 12px; }
.scr-profile .pf-plan__price { font-variant-numeric: lining-nums tabular-nums; }

.scr-profile .pf-plan__days {
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  padding-bottom: 1px;
}
.scr-profile .pf-plan__num {
  font: var(--fw-serif-display, 300) 56px/.78 var(--serif);
  letter-spacing: -.04em; padding-right: .04em;   /* the last glyph's tracking: ink ends on the gutter */
  font-variant-numeric: lining-nums proportional-nums;
}
.scr-profile .pf-plan__unit {
  font: var(--pf-caps); letter-spacing: var(--tr-caps, .1em); text-transform: uppercase;
  color: var(--ink-3);
}
.scr-profile .pf-plan__note {          /* how to stop the subscription — the bot's own sentence (app/bot.py) */
  grid-column: 1 / -1;
  max-width: 38em;
  margin-top: 14px;
  font: var(--fw-regular, 400) var(--fs-note, 13px)/1.5 var(--sans);
  color: var(--ink-3);
}

/* ---------- sections -------------------------------------------------------- */

.scr-profile .pf-sec { margin: var(--pf-gap) var(--gutter) 0; }
.scr-profile .pf-sec__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding-bottom: 10px;
  border-bottom: var(--hair) solid var(--rule);
}
.scr-profile .pf-sec__meta { color: var(--ink-3); transition: color var(--d-row, 160ms) var(--e-std); }
.scr-profile .pf-sec__meta.is-dirty { color: var(--ink); }

/* ---------- questionnaire --------------------------------------------------- */

.scr-profile .pf-form .pf-fld { padding-top: 22px; }
.scr-profile .pf-seg { margin-top: 12px; }
.scr-profile .pf-age .fld__box { cursor: text; }

.scr-profile .pf-fld__row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
}
.scr-profile .pf-count { white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }
.scr-profile .pf-chips { margin-top: 14px; }

.scr-profile .pf-save { margin-top: 30px; }

/* ---------- theme: «ТЕМА — БЕЛАЯ / ЧЁРНАЯ» ------------------------------------
   An ordinary .seg (the fill is the choice, as in «Пол»); each paper is only a 12 px
   swatch before its word — white and black whatever the theme, so literals here. */

.scr-profile .pf-look {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: var(--pf-gap) var(--gutter) 0;
  padding-top: 16px;
  border-top: var(--hair) solid var(--rule);
}
.scr-profile .pf-look__t { flex: none; }
.scr-profile .pf-look__seg { flex: 0 1 236px; min-width: 0; }
.scr-profile .pf-sw {
  flex: none;
  width: 12px; height: 12px; margin-right: 8px;
  border: var(--stroke, 1px) solid currentColor;
}
.scr-profile .pf-sw--light { background: #FFFFFF; }
.scr-profile .pf-sw--dark { background: #000000; }

/* ---------- fine print ------------------------------------------------------ */

.scr-profile .pf-fine {             /* + .fine: 13 px sentence case, ink-3 */
  margin: var(--pf-gap) var(--gutter) 0;
  padding-top: 16px;
  border-top: var(--hair) solid var(--rule-2);
  line-height: 1.55;
}
.scr-profile .pf-fine p { max-width: 38em; }   /* ≈ 65 characters a line in the 640 px desktop column */
.scr-profile .pf-fine p + p { margin-top: 12px; }
.scr-profile .pf-fine b { font-weight: var(--fw-medium, 500); color: var(--ink-2); }
.scr-profile .pf-nobr { white-space: nowrap; }

/* ---------- DEV (only outside Telegram) ------------------------------------- */

.scr-profile .pf-dev { margin: 14px var(--gutter) 0; }

/* ---------- narrow phones --------------------------------------------------- */

@media (max-width: 374.98px) {
  .scr-profile .pf-id { grid-template-columns: 56px minmax(0, 1fr); column-gap: 16px; }
  .scr-profile .pf-mono { width: 56px; height: 56px; }
  .scr-profile .pf-mono span { font-size: 30px; }
  .scr-profile .pf-id__name { font-size: 27px; }
  .scr-profile .pf-id__name--long { font-size: 22px; font-weight: var(--fw-serif-text, 400); }
  .scr-profile .pf-id__name--sys { font-size: 22px; }
  .scr-profile .pf-plan__t { font-size: 26px; }
  /* «базовый анализ и советы» (170 px) stays on one line beside «PREMIUM · 250 ★» in 320 px */
  .scr-profile .pf-plan__row { gap: 8px; }
  .scr-profile .pf-plan__cta { padding-inline: 10px; }
  .scr-profile .pf-plan__num { font-size: 50px; }
}
