/* ---------------------------------------------------------------------------
   Peltify — Settings.

   Owned by src/ui/settings.js. REBUILT 2026-08-27: Instagram's web settings
   shape. A ~300px column of grouped rows on the left inside the surface, one
   pane at a time on the right at a ~640px measure. White cards on 1px
   hairlines, 16px radius, bold section titles, plain grey sentences.

   No gradients, no pills, no status chips in headers — those are the three
   things Nick named ("the gradient boxed in pill headers are really messing
   with me a lot"), so none of them has a rule in this file.

   Everything is namespaced `.stg-*`. The old `.set-*` / `.use-*` rules in
   app.css belong to the page this replaced and are no longer referenced.
   --------------------------------------------------------------------------- */

.stg {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: clamp(20px, 3vw, 44px);
  align-items: start;
}

/* ---- the left column ---- */

.stg-nav { position: sticky; top: 12px; min-width: 0; }

.stg-nav-h {
  margin: 0 0 16px;
  padding: 0 10px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.stg-search {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  padding: 0 12px;
  height: 40px;
  border-radius: var(--r-md);
  background: var(--paper-deep);
  color: var(--ink-faint);
}
.stg-search-i {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  color: var(--ink);
  font: 400 14.5px var(--font-sans);
}
.stg-search-i::placeholder { color: var(--ink-faint); }
.stg-search:focus-within { outline: 2px solid var(--violet); outline-offset: 2px; }

.stg-navlist { display: block; }

.stg-group {
  margin: 18px 0 4px;
  padding: 0 10px;
  color: var(--ink-faint);
  font-size: 12.5px;
  font-weight: 700;
}
.stg-group:first-child { margin-top: 0; }

.stg-navrow {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 500;
  text-align: left;
  transition: background var(--fast) var(--ease);
}
.stg-navrow svg { color: var(--ink); }
.stg-navrow:hover { background: rgba(36, 20, 46, 0.05); }
.stg-navrow.is-on { background: var(--paper-deep); font-weight: 700; }

.stg-empty {
  margin: 8px 0 0;
  padding: 0 10px;
  color: var(--ink-soft);
  font-size: 13.5px;
}

/* ---- the pane ---- */

.stg-pane { min-width: 0; max-width: 640px; display: grid; gap: 16px; }

.stg-pane-h { display: flex; align-items: center; gap: 8px; }
/* PREVIEW, BESIDE THE HEADING (2026-08-30, public-profile entries 1–2). Quiet
   and to the right, so the heading is still the first thing read. */
.stg-pane-act { margin-left: auto; height: 34px; padding: 0 14px; border: 1px solid var(--line-strong);
                border-radius: var(--r-pill); background: var(--white); font: inherit; font-size: 13px;
                font-weight: 700; color: var(--ink); cursor: pointer; }
.stg-pane-act:hover { border-color: var(--ink); background: var(--paper); }
.stg-pane-h h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* The back arrow belongs to the narrow layout only; there is nothing to go
   back to when the list is on screen beside the pane. */
.stg-back { display: none; }

.stg-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--white);
  padding: 4px 20px;
}
.stg-card > * + * { border-top: 1px solid var(--line-soft); }

.stg-sub {
  margin: 0;
  padding: 16px 0 8px;
  font-size: 14px;
  font-weight: 800;
}

.stg-p {
  margin: 0;
  padding: 16px 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}
/* Two sentences of the same explanation are one block, not two rows. */
.stg-card > .stg-p + .stg-p { border-top: 0; padding-top: 0; }

/* ---- a fact row ---- */

.stg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  flex-wrap: wrap;
}
.stg-row-c { flex: 1 1 220px; min-width: 0; display: grid; gap: 2px; }
.stg-k { color: var(--ink-soft); font-size: 13px; }
.stg-v { font-size: 15px; font-weight: 600; word-break: break-word; }
.stg-v.is-out { color: var(--coral-dark); }
.stg-v-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stg-note {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
  max-width: 56ch;
}
.stg-act { flex: none; }

/* Verified is a WORD, not a badge. It appears only over an address a code
   actually came back for. */
.stg-verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ok);
  font-size: 12.5px;
  font-weight: 700;
}

/* ---- the username and its immutable tail ---- */

.stg-handle { display: inline-flex; align-items: baseline; }
.stg-tail { color: var(--ink-faint); font-weight: 600; }

.stg-handle-field {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 12px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--white);
}
.stg-handle-field:focus-within { outline: 2px solid var(--violet); outline-offset: 1px; border-color: transparent; }
.stg-at { color: var(--ink-faint); font-weight: 600; }
.stg-handle-field .stg-input-h {
  flex: 1 1 auto;
  min-width: 0;
  height: auto;
  padding: 0 2px;
  border: 0;
  background: none;
  outline: none;
}
.stg-handle-field .stg-tail { flex: none; padding-left: 2px; }

/* ---- inline editors ---- */

.stg-edit { display: grid; gap: 10px; padding: 16px 0; }
.stg-edit .stg-k { font-weight: 600; color: var(--ink); }
.stg-edit .stg-note { margin: 0; }
.stg-edit-act { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.stg-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--white);
  color: var(--ink);
  font: 400 15px var(--font-sans);
}
.stg-input:focus { outline: 2px solid var(--violet); outline-offset: 1px; border-color: transparent; }

.stg-avail { margin: 0; min-height: 1em; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.stg-avail.ok { color: var(--ok); }
.stg-avail.warn { color: var(--coral-dark); }

/* ---- toggles ---- */

.stg-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
}
.stg-toggle.is-off { opacity: 0.5; }
.stg-toggle-c { flex: 1 1 auto; min-width: 0; display: grid; gap: 3px; }
.stg-toggle-c b { font-size: 14.5px; font-weight: 600; }
.stg-toggle-c span { font-size: 13px; color: var(--ink-soft); line-height: 1.55; max-width: 52ch; }

/* ---- the Public profile pane ----

   The editor is drawn by src/ui/profile.js and dressed by styles/profile.css,
   which was restyled on 2026-08-27 to this file's card recipe rather than
   being overridden from here. All this wrapper does is stop the pane adding a
   second box around a thing that is already a stack of cards. */

.stg-profile { display: block; min-width: 0; }
.stg-profile > .ep { width: 100%; }

/* ---- usage meters ----

   A SINGLE RATIO AGAINST A LIMIT IS A METER. The bar is WHAT IS LEFT, so it
   depletes; the track under it is a lighter step of the same violet rather
   than grey, because grey would read as a different quantity. Amber under a
   quarter, red under a tenth. The figure is in ink — text never wears the
   data colour. */

.stg-meter { padding: 16px 0; display: grid; gap: 8px; }

.stg-meter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}
.stg-meter-l { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.stg-meter-v { font-size: 14.5px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.stg-meter-track {
  height: 8px;
  border-radius: 4px;
  background: var(--violet-wash-strong);
  overflow: hidden;
}

.stg-meter-fill {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: 4px;
  background: var(--violet);
  transition: width var(--med) var(--ease), background var(--fast) var(--ease);
}
.stg-meter-fill.is-warn { background: var(--warn); }
.stg-meter-fill.is-danger { background: var(--coral-dark); }

.stg-meter-sub { margin: 0; font-size: 12.5px; color: var(--ink-faint); }
.stg-meter-note { margin: 0; padding: 16px 0; }

/* ---- the anonymous browser ---- */

.stg-anon {
  display: block;
  padding: 20px 0 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.stg-card > .stg-anon + .stg-p { border-top: 0; padding-top: 8px; }
.stg-card > .stg-p + .stg-edit-act { border-top: 0; padding: 0 0 20px; }

/* ---- links ---- */

.stg-links { display: grid; }
.stg-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
}
.stg-link + .stg-link { border-top: 1px solid var(--line-soft); }
.stg-link svg { color: var(--ink-faint); }
.stg-link:hover { color: var(--violet); }
.stg-link:hover svg { color: var(--violet); }

/* ---- the one-line report of what just happened ---- */

.stg-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  background: var(--paper-deep);
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.5;
}
.stg-notice.ok { background: var(--ok-wash); color: var(--ok); }
.stg-notice.warn { background: var(--warn-wash); color: var(--warn); }

/* ---- the delete button ---- */

.btn-danger {
  background: var(--coral-dark);
  color: var(--white);
  border-color: transparent;
}
.btn-danger:hover:not(:disabled) { background: var(--coral); }

/* ---- narrow: the list IS the first screen ---- */

@media (max-width: 720px) {
  .stg { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .stg-nav { position: static; }
  .stg-pane { max-width: none; }

  .stg .stg-pane { display: none; }
  .stg.is-pane .stg-nav { display: none; }
  .stg.is-pane .stg-pane { display: grid; }

  .stg-back {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-left: -6px;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--ink);
  }
  .stg-back svg { transform: rotate(180deg); }
  .stg-back:hover { background: var(--paper-deep); }

  .stg-card { padding-left: 16px; padding-right: 16px; }
}

/* REVERTED 2026-08-28 on Nick's instruction ("I LIKED THE OLD SETTINGS UI").
   The app-wide radius scale went boxy the same day; Settings and the profile
   editor keep the shape they had by restoring the old scale inside their own
   roots. Everything else on the page stays boxy. */
.stg, .ep, .pe {
  --r-sm: 10px; --r-md: 16px; --r-lg: 22px; --r-xl: 30px;
}

/* [ANON-1] 2026-09-01 — a pane behind sign-in wears a lock and says so. */
.stg-navrow.is-locked { color: var(--ink-3, #7a6f86); }
.stg-navrow.is-locked svg { color: var(--ink-3, #7a6f86); }
.stg-navrow .stg-navnote { margin-left: auto; font-size: 11px; font-weight: 600; letter-spacing: .02em;
  text-transform: uppercase; color: var(--violet, #7c3aed); }

/* Shared cards: search + sort (pelt-card Q9; HANDOFF-12 audit 2026-09-08) */
.stg-cards-tools { display: flex; gap: 8px; align-items: center; margin: 4px 0 10px; }
.stg-cards-tools .stg-search-i { flex: 1 1 auto; min-width: 0; }

/* 23.1 — a shared card IS the DM pelt card, one per row, with its two buttons
   on the card itself. The look comes from `.dm-card` (social.css); this only
   stacks them and puts the actions under the head. */
.stg-shared { margin: 0 0 10px; }
.stg-shared:last-child { margin-bottom: 0; }
.stg-shared .stg-cardact { margin-top: 10px; justify-content: flex-end; }
.stg-cards-sort { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-box); background: var(--white); font: inherit; font-size: 13px; color: var(--ink); }

/* 13.12 — Appearance: three choices, not a switch (design-language SPEC
   2026-09-08, answer 32). A radio group, because "Follow system" is a real
   third state and a two-state switch cannot say it. */
.stg-choices { display: grid; gap: 2px; }
.stg-choice {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; border: 0; border-radius: var(--r-box);
  background: none; color: var(--ink); text-align: left; cursor: pointer;
}
.stg-choice:hover { background: var(--violet-wash); }
.stg-choice.is-on { background: var(--violet-wash); }
.stg-choice-c { flex: 1 1 auto; display: grid; gap: 2px; min-width: 0; }
.stg-choice-c b { font-weight: 700; }
.stg-choice-c span { font-size: 12.5px; color: var(--ink-soft); }
.stg-choice-mark { flex: none; width: 16px; color: var(--violet); display: inline-flex; }

/* 13.13 — the Plan pane (monetisation SPEC 2026-09-08). Two rows, the money
   from the server, the card from Stripe. */
.stg-plan { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.stg-plan:last-child { border-bottom: 0; }
.stg-plan-c { flex: 1 1 auto; display: grid; gap: 2px; min-width: 0; }
.stg-plan-c b { font-family: var(--font-serif); font-size: 17px; }
.stg-plan-price { font-weight: 700; color: var(--ink); }
.stg-plan-c span { font-size: 13px; color: var(--ink-soft); }
.stg-plan-lim { font-size: 12.5px; color: var(--ink-faint); }
.stg-plan-now { font-size: 12.5px; color: var(--violet); font-weight: 700; white-space: nowrap; }

/* 27.7 — the Plus card's two prices, yearly preselected. */
.stg-plan-int { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.stg-plan-opt { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px;
  border: 1px solid var(--line); border-radius: var(--r-box); font-size: 13px; cursor: pointer; }
.stg-plan-opt.is-on { border-color: var(--violet); color: var(--ink); }
.stg-plan-opt input { margin: 0; accent-color: var(--violet); }


/* ===========================================================================
   28.6 — THE PRICING SHEET (src/ui/pricing.js): the media sheet's dark blurred
   overlay, Free and Plus side by side, a Monthly / Yearly toggle, one Upgrade.
   =========================================================================== */
.pr-scrim { background: radial-gradient(1200px 700px at 70% 10%, rgba(134, 64, 230, .45), transparent 60%), radial-gradient(900px 600px at 10% 90%, rgba(40, 120, 110, .35), transparent 60%), #0b0709; padding: 16px; overflow: auto; }
.pr-panel { position: relative; width: min(860px, 100%); margin: auto; padding: 48px 40px 32px; color: #fff; background: transparent; border: 0; box-shadow: none; display: grid; gap: 22px; }
.pr-close { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .1); color: #fff; cursor: pointer; }
.pr-close:hover { background: rgba(255, 255, 255, .2); }
.pr-wait { color: rgba(255, 255, 255, .8); text-align: center; }
.pr-head { display: grid; gap: 8px; justify-items: center; text-align: center; }
.pr-kicker { font-size: 12px; font-weight: 700; letter-spacing: .28em; text-transform: uppercase; color: #b88bff; }
.pr-title { margin: 0; font-size: clamp(26px, 4vw, 38px); font-weight: 600; letter-spacing: -.01em; line-height: 1.15; }
.pr-toggle { display: inline-flex; margin-top: 8px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .1); }
.pr-int { display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; border: 0; border-radius: 999px; background: none; color: rgba(255, 255, 255, .8); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.pr-int[aria-checked="true"] { background: #fff; color: #1a1020; }
.pr-save { padding: 2px 8px; border-radius: 999px; background: #8b3dff; color: #fff; font-size: 11.5px; font-weight: 700; }
.pr-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.pr-card { display: grid; align-content: start; gap: 10px; padding: 24px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06); backdrop-filter: blur(12px); }
.pr-card.is-top { border-color: rgba(184, 139, 255, .7); background: linear-gradient(160deg, rgba(139, 61, 255, .35), rgba(255, 255, 255, .06) 60%); box-shadow: 0 30px 60px -30px rgba(139, 61, 255, .8); }
.pr-name { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 18px; font-weight: 700; }
.pr-now { padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .16); font-size: 11.5px; font-weight: 600; }
.pr-price { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.01em; }
.pr-blurb { margin: 0; color: rgba(255, 255, 255, .75); font-size: 14px; }
.pr-lines { margin: 4px 0 8px; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 14.5px; }
.pr-lines li { display: flex; gap: 10px; align-items: flex-start; }
.pr-lines li svg { flex: none; margin-top: 3px; color: #b88bff; }
.pr-buy { margin-top: auto; padding: 13px 18px; border: 0; border-radius: 10px; background: #fff; color: #1a1020; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.pr-buy:hover:not(:disabled) { background: #efe6ff; }
.pr-buy:disabled { opacity: .6; cursor: default; }
.pr-note, .pr-said { margin: 0; color: #ffb4a6; font-size: 13.5px; }
.pr-said { text-align: center; }
.pr-foot { margin: 0; text-align: center; color: rgba(255, 255, 255, .6); font-size: 12.5px; }
@media (max-width: 640px) {
  .pr-panel { padding: 44px 4px 24px; }
  .pr-cards { grid-template-columns: minmax(0, 1fr); }
  .pr-card.is-top { order: -1; }
}

/* 28.6 — the inline stop card's lines */
.ch-stop-h { font-variant-numeric: tabular-nums; }
.ch-stop-plus:empty { display: none; }

/* 2026-09-14 — the plan pane is one card. 2026-09-15 — in two halves. */
.stg-plan-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.stg-plan-l { display: grid; gap: 4px; min-width: 0; flex: 1 1 auto; }
.stg-plan-r { flex: none; display: grid; gap: 8px; justify-items: end; text-align: right; }
.stg-plan-k { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }
.stg-plan-name { font-family: var(--font-serif); font-size: 26px; line-height: 1.1; }
.stg-plan-sub { font-size: 14px; color: var(--ink-soft); }
.stg-plan-lines { list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line-soft); display: grid; gap: 6px; }
.stg-plan-lines li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink); }
.stg-plan-lines svg { flex: none; color: var(--violet); }
.stg-plan-price { font-size: 20px; font-weight: 700; color: var(--ink); }
.stg-plan-from { font-size: 12.5px; color: var(--ink-faint); }
@media (max-width: 720px) {
  .stg-plan-hero { flex-direction: column; }
  .stg-plan-r { justify-items: start; text-align: left; width: 100%; }
}
.stg-inv-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.stg-inv-h b { font-size: 15px; }
.stg-inv { width: 100%; border-collapse: collapse; font-size: 14px; }
.stg-inv td { padding: 10px 0; border-top: 1px solid var(--line-soft); }
.stg-inv-s { color: var(--ink-faint); text-transform: capitalize; }
.stg-inv-a { text-align: right; }
.stg-inv-a a { color: var(--ink); font-weight: 600; }
.pr-lines li.pr-extra { color: #6ee7a0; }
.pr-lines li.pr-extra svg { color: #6ee7a0; }
.stg-plan-hero { animation: stg-rise .35s ease both; }
@keyframes stg-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 2026-09-15 — Settings › Admin (src/ui/settings.js paneAdmin) */
.stg-h { margin: 0 0 10px; font-size: 15px; font-weight: 600; color: var(--ink); }
.stg-note.is-ok { color: var(--ink-soft); }
.stg-note.is-warn { color: var(--coral-dark, #bf3e2f); }
.stg-admin-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.stg-admin-row:first-of-type { border-top: 0; }
.stg-admin-who { flex: 1 1 260px; min-width: 0; }
.stg-admin-meta { color: var(--ink-soft); font-size: 13px; overflow-wrap: anywhere; }
.stg-admin-row .stg-edit-act { flex: none; margin: 0; }
.stg-admin-log { font-size: 12.5px; color: var(--ink-soft); overflow-wrap: anywhere; }
