/* owned by the settings screen — prefix .st- (sheets render outside #screen, so rules are prefix-scoped) */

/* demo notice (shared notice row) */
.st-demo .notice { margin-top: 18px; }

/* ---------- sections ---------- */
.st-sec { margin-top: 40px; scroll-margin-top: calc(var(--safe-t) + 72px); border-radius: var(--r-m); }
.st-sec__title { font-size: 20px; font-weight: 650; letter-spacing: -0.025em; line-height: 1.15; overflow-wrap: anywhere; hyphens: manual; }
.st-lede { margin-top: 6px; font-size: var(--t-small); line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
.st-fine { padding: 14px 0; font-size: var(--t-small); line-height: 1.4; color: var(--faint); border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.st-sec.is-flash { animation: st-flash 1.6s var(--ease-out); }
@keyframes st-flash { 0%, 30% { box-shadow: 0 0 0 10px rgb(var(--accent-rgb) / 0.10); background: rgb(var(--accent-rgb) / 0.10); } 100% { box-shadow: 0 0 0 10px transparent; background: transparent; } }

/* ---------- rows (hairlines, no glass) ---------- */
.st-group { margin-top: 10px; border-top: 1px solid var(--line); }
.st-row {
  display: flex; align-items: center; gap: 14px;
  min-height: 56px; padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.st-row__icon { flex: none; display: grid; place-items: center; width: 20px; height: 20px; color: var(--muted); }
.st-row__icon svg { width: 20px; height: 20px; }
.st-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.st-row__title { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; overflow-wrap: anywhere; hyphens: manual; }
.st-row__sub { margin-top: 3px; font-size: var(--t-small); line-height: 1.35; color: var(--muted); overflow-wrap: break-word; hyphens: manual; text-wrap: pretty; }
.st-row__ctl { flex: none; display: flex; align-items: center; max-width: 100%; }

/* the control drops under the label only when both do not fit (Theme, Units in long languages) */
.st-row--wrap { flex-wrap: wrap; row-gap: 10px; }
.st-row--wrap > .st-row__main { flex: 1 0 auto; min-width: 72px; }
.st-row--wrap > .st-row__ctl { margin-left: auto; }

.st-row .segmented button { padding: 0 12px; }

/* rows whose control sits under the label (ring colours, app colour) */
.st-row--stack { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px 0 16px; }

/* selects (Language, Font): one width, so the two controls line up in rows that sit next to each other */
.st-select { width: 190px; min-width: 0; max-width: 100%; min-height: 40px; padding: 8px 34px 8px 14px; font-size: 14px; border-radius: var(--r-pill); }

/* action rows (buttons) */
.st-row--btn {
  width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit;
  text-align: left; font: inherit; cursor: pointer;
  border-radius: 0; position: relative;
  -webkit-tap-highlight-color: transparent;
}
.st-row--btn::after {
  content: ""; position: absolute; inset: 0 -6px; border-radius: var(--r-s); background: var(--press);
  opacity: 0; transition: opacity var(--dur-fast); pointer-events: none;
}
.st-row--btn:active::after { opacity: 1; }
@media (hover: hover) { .st-row--btn:hover::after { opacity: 0.55; } }
.st-row--btn:focus-visible { outline-offset: -2px; }
.st-row--btn:disabled { cursor: default; opacity: 0.5; }
.st-row__chev { flex: none; color: var(--faint); display: grid; place-items: center; }
.st-row__chev svg { width: 18px; height: 18px; transition: transform var(--dur-fast) var(--ease-out); }
@media (hover: hover) { .st-row--btn:hover .st-row__chev svg { transform: translateX(2px); } }

/* ---------- sections: two switches per row, "Bottom" and "On Today", in two columns headed by the title row ---------- */
.st-sec__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.st-places__head .st-sec__title { flex: 1; min-width: 0; }
.st-places__cols, .st-place__sw { flex: none; display: flex; }
.st-places__col, .st-place__cell { width: var(--st-col, 92px); }
.st-places__col {
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 1px;
  font-size: 12px; font-weight: 600; line-height: 1.2; letter-spacing: 0; color: var(--muted); text-align: center;
  white-space: nowrap;   /* one line each, so "Bottom" and "On Today" sit on the same baseline */
}
.st-place__cell { display: grid; place-items: center; }
.st-place { gap: 14px; min-height: 60px; }   /* the height of a row with its "Off" line: switching a section off never moves the list */
.st-place .st-row__title { overflow-wrap: break-word; }
.st-place .st-row__icon, .st-place .st-row__title { transition: color var(--dur) var(--ease-out); }
.st-place.is-off .st-row__icon, .st-place.is-off .st-row__title { color: var(--faint); }
.st-place__off { margin-top: 2px; color: var(--faint); }
.st-place__off[hidden] { display: none; }
@media (max-width: 400px) { .st-sec { --st-col: 76px; } .st-place { gap: 12px; } .st-places__col { font-size: 11px; letter-spacing: -0.025em; } }

/* ---------- ring colours: one row per part (custom) ---------- */
.st-parts[hidden] { display: none; }
.st-part { min-height: 50px; padding: 8px 0; }
.st-dot { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgb(var(--fg-rgb) / 0.18); }
.st-pick { display: flex; flex-direction: column; gap: 18px; padding: 4px 0 8px; }
.st-pick__grid { display: grid; grid-template-columns: repeat(6, 34px); justify-content: space-between; gap: 16px 0; }
.st-pick__any { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 15px; font-weight: 600; cursor: pointer; }
.st-pick__ring { position: relative; width: 34px; height: 34px; border-radius: 50%; overflow: hidden; flex: none;
  background: conic-gradient(#ff5b5b, #ffd66e, #43d6a3, #3fc6ff, #7b7bff, #e86bb6, #ff5b5b); box-shadow: inset 0 0 0 1px rgb(var(--fg-rgb) / 0.18); }
.st-pick__native { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; cursor: pointer; }
@media (max-width: 360px) { .st-pick__grid { grid-template-columns: repeat(4, 34px); } }

/* ---------- app colour ---------- */
.st-accents { display: flex; flex-wrap: wrap; gap: 14px; padding: 2px 4px; }
.st-swatch {
  width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--sw);
  box-shadow: 0 0 0 0 var(--bg), 0 0 0 0 var(--fg);
  transition: box-shadow var(--dur) var(--ease-out), transform var(--dur-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.st-swatch:active { transform: scale(0.92); }
.st-swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--fg); }
.st-swatch:focus-visible { outline: 2px solid var(--fg); outline-offset: 6px; }
/* ---------- fire: a live flame with the days in a row, three colour choices ---------- */
.st-row__head { display: flex; align-items: center; gap: 14px; }
.st-fire {
  flex: none; display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 12px 0 10px; border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--fire, #ff9f0a) 14%, transparent); color: var(--fire, #ff9f0a);
  font: 650 15px/1 var(--f-sans); font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
  transition: color var(--dur) var(--ease-out), background var(--dur) var(--ease-out);
}
.st-fire svg { width: 17px; height: 17px; }
.st-fire__pick { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; }
.st-fire__pick .st-accents { flex: none; }
.st-fire__name { font-size: var(--t-small); font-weight: 600; color: var(--muted); }
/* "Your colour" before one is picked: the rainbow of the colour picker */
.st-swatch.is-any { background: conic-gradient(#ff5b5b, #ffd66e, #43d6a3, #3fc6ff, #7b7bff, #e86bb6, #ff5b5b); }

/* ---------- the main action in a sheet: a filled pill in the app colour (like Start focus) ---------- */
.st-cta { width: 100%; min-height: 56px; gap: 10px; font-size: 16px; letter-spacing: -0.01em; }
.st-cta svg { width: 18px; height: 18px; }

/* ---------- habits ---------- */
.st-habit { display: flex; align-items: center; gap: 8px; min-height: 54px; border-bottom: 1px solid var(--line); }
.st-habit__name {
  flex: 1; min-width: 0; height: 44px; padding: 0; border: 0; background: none; outline: none;
  font: 600 15px var(--f-sans); letter-spacing: -0.015em; color: var(--fg);
  text-overflow: ellipsis;
}
.st-habit__name::placeholder { color: var(--faint); font-weight: 500; }
.st-habit__name:focus { box-shadow: 0 1.5px 0 var(--accent); }
.st-habit__tool {
  flex: none; width: 34px; height: 36px; border: 0; border-radius: 50%; background: none; color: var(--faint);
  display: grid; place-items: center; cursor: pointer;
  transition: color var(--dur-fast), background var(--dur-fast), opacity var(--dur-fast);
}
.st-habit__tool svg { width: 16px; height: 16px; }
.st-habit__up svg { transform: rotate(180deg); }
.st-habit__tool:disabled { opacity: 0.3; cursor: default; }
@media (hover: hover) { .st-habit__tool:not(:disabled):hover { color: var(--fg); background: var(--hover); } }
.st-habit { gap: 2px; }
.st-habit__name { margin-right: 6px; }
.st-habit--add .btn { flex: none; }

/* ---------- number fields ---------- */
.st-field { display: inline-flex; align-items: center; gap: 8px; cursor: text; }
.st-num {
  width: 96px; height: 40px; padding: 0 12px;
  border: 0; border-radius: var(--r-s);
  background: rgb(var(--fg-rgb) / 0.06); box-shadow: inset 0 0 0 1px var(--line);
  font: 600 15px var(--f-sans); letter-spacing: -0.015em; color: var(--fg);
  text-align: right; font-variant-numeric: tabular-nums;
  outline: none; -moz-appearance: textfield; appearance: textfield;
  transition: box-shadow var(--dur) var(--ease-out), background var(--dur);
}
.st-num::-webkit-outer-spin-button, .st-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.st-num:focus { box-shadow: inset 0 0 0 2px var(--accent); background: rgb(var(--fg-rgb) / 0.09); }
.st-num--time { width: 150px; text-align: center; padding: 0 10px; }
.st-num--time::-webkit-calendar-picker-indicator { filter: invert(var(--invert, 1)); opacity: 0.45; margin-left: 2px; cursor: pointer; }
.st-field__unit { min-width: 44px; font-size: var(--t-small); color: var(--muted); }
.st-num[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px var(--red); }
/* soft typo check under a number: "Check this number" / "Sure?" */
.st-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; font-size: var(--t-small); line-height: 1.3; color: var(--muted); }
.st-hint[hidden] { display: none; }
.st-num[aria-invalid="true"] ~ .st-hint, .st-row:has(.st-num[aria-invalid="true"]) .st-hint { color: var(--red); }
.st-hint__btn { min-height: 28px; padding: 0; border: 0; background: none; font: 600 var(--t-small) var(--f-sans); color: var(--fg); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- food goal: three plain choices ---------- */
.st-choices { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.st-choice {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 0;
  border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--muted); text-align: left;
  font: 600 15px/1.25 var(--f-sans); letter-spacing: -0.015em; cursor: pointer; overflow-wrap: break-word;
}
.st-choice:last-child { border-bottom: 0; }
.st-choice[aria-pressed="true"] { color: var(--fg); }
.st-choice__check { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--bg); background: var(--accent); opacity: 0; transform: scale(0.6); transition: opacity var(--dur-fast), transform var(--dur) var(--spring); }
.st-choice__check svg { width: 14px; height: 14px; }
.st-choice[aria-pressed="true"] .st-choice__check { opacity: 1; transform: none; }

/* ---------- AI prompt sheet ---------- */
.st-prompt { display: flex; flex-direction: column; gap: 16px; padding-top: 4px; }
.st-prompt__text { margin: 0; padding: 14px 16px; border-radius: var(--r-m); background: rgb(var(--fg-rgb) / 0.06); box-shadow: inset 0 0 0 1px var(--line);
  font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; -webkit-user-select: text; }
.st-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* ---------- restore sheet ---------- */
.st-restore { padding-top: 4px; }
.st-restore .st-group { margin-top: 0; }
.st-restore__head { margin-top: 24px; font-size: var(--t-small); font-weight: 600; color: var(--muted); letter-spacing: 0; }
.st-restore__head + .st-group, .st-restore__head + .st-fine { margin-top: 8px; }
.st-restore__head + .st-fine { border-top: 1px solid var(--line); }

/* ---------- demo and erase: quiet, at the very bottom ---------- */
.st-quiet { margin-top: 56px; padding-top: 6px; }
.st-quiet__links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.st-link {
  min-height: 40px; padding: 0; border: 0; background: none; cursor: pointer;
  font: 500 var(--t-small) var(--f-sans); color: var(--muted); text-align: left;
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px;
  transition: color var(--dur-fast), text-decoration-color var(--dur-fast);
}
@media (hover: hover) { .st-link:hover { color: var(--fg); text-decoration-color: currentColor; } }
.st-link--danger { color: color-mix(in srgb, var(--red) 55%, var(--muted)); }
@media (hover: hover) { .st-link--danger:hover { color: var(--red); } }
.st-quiet__ver { margin-top: 4px; font-size: 12px; color: var(--faint); }

/* ---------- confirm sheet (backup.js confirmAction) ---------- */
.st-confirm { display: flex; flex-direction: column; gap: 16px; padding-top: 4px; }
.st-confirm__body { font-size: 15px; line-height: 1.5; color: var(--muted); max-width: 48ch; overflow-wrap: anywhere; }
.st-confirm__actions { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.st-cbtn {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 20px; border: 0; border-radius: var(--r-pill);
  font: 600 15px/1.2 var(--f-sans); letter-spacing: -0.01em; cursor: pointer; text-align: center;
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast), background var(--dur);
  -webkit-tap-highlight-color: transparent;
}
.st-cbtn:active { transform: scale(0.97); }
.st-cbtn--primary { background: var(--fg); color: var(--bg); }
.st-cbtn--danger { background: var(--red); color: #fff; }
.st-cbtn--ghost { background: rgb(var(--fg-rgb) / 0.08); color: var(--fg); }
.st-cbtn--danger .hold__fill { background: rgb(0 0 0 / 0.32); }
.st-cbtn--danger.hold { background: color-mix(in srgb, var(--red) 88%, var(--bg)); }
@media (hover: hover) { .st-cbtn--primary:hover, .st-cbtn--danger:hover { opacity: 0.92; } .st-cbtn--ghost:hover { background: rgb(var(--fg-rgb) / 0.12); } }
@media (min-width: 720px) {
  .st-confirm__actions { flex-direction: row-reverse; }
  .st-confirm__actions .st-cbtn { flex: 1; }
}
/* Until the shared sheet rule wins over .glass { position: relative }, keep our sheets fixed. */
.sheet:has(.st-confirm), .sheet:has(.st-restore), .sheet:has(.st-pick), .sheet:has(.st-prompt) { position: fixed; }

/* ---------- phones ---------- */
@media (max-width: 400px) {
  .st-num:not(.st-num--time) { width: 76px; }
  .st-select { width: 160px; }
}
@media (prefers-reduced-motion: reduce) { .st-sec.is-flash { animation: none; } }
/* the keyboard focus ring (back after a sheet closes) stays inside its row */
.st-row--btn:focus-visible, .st-part:focus-visible, .st-row button:focus-visible { outline-offset: -2px; }

/* habit names wrap instead of being cut off */
textarea.st-habit__name { padding: 12px 0; resize: none; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.35; min-height: 0; display: block; font-family: inherit; }

/* the parts list when the ring has no parts */
.st-parts__none { padding: 12px 0 14px; }

/* switches in settings: the keyboard ring follows the track's round shape and stays inside it */
.st-sec .switch input:focus-visible ~ .switch__track { outline: 2px solid var(--fg); outline-offset: -2px; }
.st-swatch:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--bg), inset 0 0 0 4px var(--fg); }
.st-swatch[aria-pressed="true"]:focus-visible { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--fg), inset 0 0 0 2px var(--bg), inset 0 0 0 4px var(--fg); }
.st-confirm__actions .st-cta { min-height: 52px; font-size: 15px; }
.st-row--switch > .st-row__main { cursor: pointer; }
.st-row--stack:has(> .st-choices) { padding-bottom: 0; }
.st-fire svg { fill: currentColor; }
.st-fire__n { color: var(--fg); }   /* the number stays readable whatever the colour; the flame shows the colour */

/* keyboard ring inside the row (PLAN v4 1.10): 8px of inner room each side, the text and the line stay in place */
.st-row--btn { width: calc(100% + 16px); margin-inline: -8px; padding-inline: 8px; border-radius: 12px; border-bottom: 0; background: linear-gradient(var(--line), var(--line)) bottom center / calc(100% - 16px) 1px no-repeat; }
.st-row--btn::after { inset: 0 2px; }

/* Keyboard ring inside (PLAN v4 1.10): goal rows and the quiet links get a little inner room, a matching negative
   margin keeps their text where it was; the row line stays at the text's width */
.st-choice { width: calc(100% + 20px); margin-inline: -10px; padding-inline: 10px; border-radius: 12px; border-bottom: 0;
  background: linear-gradient(var(--line), var(--line)) bottom center / calc(100% - 20px) 1px no-repeat; }
.st-choice:last-child { background: none; }
.st-choice:focus-visible { outline-offset: -2px; }
.st-quiet__links { margin-inline: -8px; gap: 4px 4px; }
.st-link { padding-inline: 8px; border-radius: 10px; }
.st-link:focus-visible { outline-offset: -2px; }

/* Targets: the unit sits inside its field, so every field and toggle in the list ends at the same right edge
   (round 2: number boxes used to stop short of the time field and the kg/lb toggles) */
.st-field--unit { gap: 0; width: 150px; height: 40px; border-radius: var(--r-s);
  background: rgb(var(--fg-rgb) / 0.06); box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow var(--dur) var(--ease-out), background var(--dur); }
.st-field--unit .st-num, .st-field--unit .st-num:not(.st-num--time) { flex: 1 1 auto; width: auto; min-width: 0; height: 100%; padding: 0 6px 0 12px; background: none; box-shadow: none; }
.st-field--unit .st-num:focus { background: none; box-shadow: none; }
.st-field--unit:focus-within { box-shadow: inset 0 0 0 2px var(--accent); background: rgb(var(--fg-rgb) / 0.09); }
.st-field--unit:has(.st-num[aria-invalid="true"]) { box-shadow: inset 0 0 0 2px var(--red); }
.st-field--unit .st-field__unit { flex: none; min-width: 0; padding-right: 12px; }
/* 320: the two switch columns a little narrower, so a section's name ("Привычки", "Экранное время") keeps whole words */
@media (max-width: 340px) { .st-sec { --st-col: 64px; } .st-place { gap: 10px; } .st-places__col { font-size: 10.5px; } .st-place .st-row__title { overflow-wrap: normal; } }
@media (max-width: 340px) { .st-places__col { white-space: normal; line-height: 1.1; overflow-wrap: normal; } }   /* "На / Сегодня" stays inside its column at 320 */
/* the goals not picked stay readable (they were very dim); the picked one is marked by its tick and full colour */
.st-choice { color: rgb(var(--fg-rgb) / 0.72); }
.st-choice[aria-pressed="true"] { color: var(--fg); }

/* fire and water colour (v5): each choice is a pill with the flame / drop in that colour and its name, so the choice
   reads at a glance */
.st-cpick { display: flex; flex-wrap: wrap; gap: 8px; }
.st-cpick__opt { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 15px 0 11px; border: 0; border-radius: var(--r-pill);
  background: rgb(var(--fg-rgb) / 0.06); box-shadow: inset 0 0 0 1px var(--line); color: var(--fg); font: 600 14px/1.2 var(--f-sans); letter-spacing: -0.01em; cursor: pointer;
  transition: background var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast) var(--ease-out); }
.st-cpick__opt:active { transform: scale(0.96); }
.st-cpick__ic { display: grid; place-items: center; }
.st-cpick__ic svg { width: 18px; height: 18px; color: var(--c, var(--muted)); fill: var(--c, var(--muted)); }
.st-cpick__opt[aria-pressed="true"] { background: color-mix(in srgb, var(--c, var(--fg)) 16%, transparent); box-shadow: inset 0 0 0 2px var(--c, var(--fg)); }
.st-cpick__opt.is-any .st-cpick__ic { width: 18px; height: 18px; border-radius: 50%; background: conic-gradient(#ff5b5b, #ffd66e, #43d6a3, #3fc6ff, #7b7bff, #e86bb6, #ff5b5b); }
.st-cpick__opt.is-any .st-cpick__ic svg { display: none; }
.st-cpick__opt:focus-visible { outline-offset: -2px; }
.st-water-prev { padding: 0 10px; }
.st-water-prev svg { fill: color-mix(in srgb, currentColor 35%, transparent); }

/* Click sound picker (Settings › Sound): a tap plays the sound and picks it */
.st-snds { display: flex; flex-direction: column; gap: 6px; padding-bottom: 4px; }
.st-snd { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 10px 12px; border: 0; border-radius: var(--r-m, 16px); background: rgb(var(--fg-rgb, 255 255 255) / 0.05); color: inherit; font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background var(--dur-fast, .15s), box-shadow var(--dur-fast, .15s); }
.st-snd:focus-visible { outline: 2px solid var(--cta, var(--accent)); outline-offset: -2px; }
.st-snd__name { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.015em; overflow-wrap: anywhere; hyphens: manual; }
.st-snd__dot { flex: none; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line-strong, rgb(127 127 127 / .45)); display: grid; place-items: center; }
.st-snd[aria-checked="true"] { background: rgb(var(--cta-rgb) / 0.14); box-shadow: inset 0 0 0 1px rgb(var(--cta-rgb) / 0.5); }
.st-snd[aria-checked="true"] .st-snd__dot { background: rgb(var(--cta-rgb)); box-shadow: none; }
.st-snd[aria-checked="true"] .st-snd__dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }

/* ================= v6 ================= */
/* Language and Font: the chevron sits inside the field, 14px from its edge like the other fields' insides */
.st-selectbox { position: relative; display: inline-flex; max-width: 100%; }
.st-selectbox .st-select { -webkit-appearance: none; appearance: none; padding-right: 38px; text-overflow: ellipsis; cursor: pointer; }
.st-selectbox__chev { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; color: var(--muted); pointer-events: none; }
.st-selectbox__chev svg { width: 14px; height: 14px; }

/* Targets: time fields and number fields look the same — an even, solid fill (no see-through: it stays crisp on a
   tinted page too) and a thin edge */
.st-sec .st-num--time, .st-sec .st-field--unit {
  background: color-mix(in srgb, rgb(var(--fg-rgb)) 7%, rgb(var(--bg-rgb)));
  box-shadow: inset 0 0 0 1px rgb(var(--fg-rgb) / 0.14);
  color: var(--fg);
}
.st-sec .st-num--time { font: 600 15px var(--f-sans); letter-spacing: -0.015em; height: 40px; border-radius: var(--r-s); }
.st-sec .st-field--unit .st-num { background: none; }
.st-sec .st-num--time:focus-visible, .st-sec .st-field--unit:focus-within { box-shadow: inset 0 0 0 2px var(--accent); background: color-mix(in srgb, rgb(var(--fg-rgb)) 10%, rgb(var(--bg-rgb))); outline: none; }
.st-sec .st-field--unit:has(.st-num[aria-invalid="true"]) { box-shadow: inset 0 0 0 2px var(--red); }

/* Tint: the colour choice shows under the switch while it is on */
.st-tintpick { padding-top: 0; gap: 8px; }
.st-tintpick[hidden] { display: none; }
.st-cpick__dot { display: block; width: 16px; height: 16px; border-radius: 50%; background: var(--c, var(--accent)); box-shadow: inset 0 0 0 1px rgb(var(--fg-rgb) / 0.2); }
.st-cpick__opt.is-any .st-cpick__dot { display: none; }

/* Ring looks: one tile per look, the ring drawn as it would look; locked ones show a lock and the price */
.st-rings { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; }   /* wide enough for "приложения" in one piece (it ran out of the tile) */
.st-ring {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 10px 6px 10px;
  border: 0; border-radius: var(--r-m); background: rgb(var(--fg-rgb) / 0.04); box-shadow: inset 0 0 0 1px var(--line);
  color: var(--fg); font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast) var(--ease-out);
}
.st-ring:active { transform: scale(0.97); }
@media (hover: hover) { .st-ring:hover { background: rgb(var(--fg-rgb) / 0.07); } }
.st-ring[aria-pressed="true"] { background: rgb(var(--accent-rgb) / 0.12); box-shadow: inset 0 0 0 2px var(--accent); }
.st-ring:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.st-ring__art { display: grid; place-items: center; width: 64px; height: 64px; }
.st-ring__art .stone { width: 64px; height: 64px; }
.st-ring__name { font-size: 12px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; text-align: center; overflow-wrap: normal; word-break: normal; hyphens: manual; max-width: 100%; }
.st-ring__price { display: inline-flex; align-items: center; gap: 4px; min-height: 16px; font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-ring__price:empty { display: none; }
.st-ring__price svg { width: 12px; height: 12px; }
.st-ring.is-locked .st-ring__art { opacity: 0.85; }

/* Fire: the flame as it is now, the days in a row, and "Change" (the colours are in the sparks shop) */
.st-firerow--shop { gap: 12px; }
.st-fire--flame { gap: 5px; padding: 0 12px 0 9px; }
.st-fire--flame svg { fill: initial; }
.st-fire__art { display: grid; place-items: center; }
.st-fire__change { flex: none; }
.st-spark-prev { padding: 0 10px; color: var(--fire, var(--fg)); background: color-mix(in srgb, var(--fire, var(--fg)) 12%, transparent); }
.st-spark-prev svg { fill: currentColor; stroke: none; }
.st-cpick__ic svg { stroke: none; }
.st-cpick__opt[data-choice="default"] .st-cpick__ic svg { color: var(--fg); fill: var(--fg); }
@media (max-width: 360px) { .st-firerow--shop { flex-wrap: wrap; } .st-firerow--shop .st-row__main { flex-basis: 100%; } }

/* Click sound: a sound not bought yet shows a lock and its price in place of the round mark */
.st-snd__price { flex: none; display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-snd__price svg { width: 13px; height: 13px; }
.st-snd.is-locked .st-snd__name { color: rgb(var(--fg-rgb) / 0.78); }

/* Sections › "If there are many sections at the bottom": two choices, each with a tiny bar drawing and one line */
.st-overflow { margin-top: 18px; }
.st-overflow[hidden] { display: none; }
.st-ovf__head { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; overflow-wrap: anywhere; }
.st-ovf__list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.st-ovf {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 10px 14px; border: 0; border-radius: var(--r-m);
  background: rgb(var(--fg-rgb) / 0.04); box-shadow: inset 0 0 0 1px var(--line); color: var(--fg); font: inherit; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: background var(--dur-fast), box-shadow var(--dur-fast);
}
.st-ovf[aria-checked="true"] { background: rgb(var(--accent-rgb) / 0.10); box-shadow: inset 0 0 0 2px var(--accent); }
.st-ovf:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.st-ovf__art { flex: none; position: relative; display: flex; align-items: center; gap: 5px; width: 66px; height: 22px; padding: 0 7px; border-radius: 99px; overflow: hidden;
  background: rgb(var(--fg-rgb) / 0.08); box-shadow: inset 0 0 0 1px rgb(var(--fg-rgb) / 0.16); }
.st-ovf__art i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: rgb(var(--fg-rgb) / 0.55); }
.st-ovf__art b { flex: none; font: 800 10px/1 var(--f-sans); letter-spacing: -0.05em; color: var(--accent); margin-left: auto; }
.st-ovf__art--scroll { -webkit-mask: linear-gradient(90deg, #000 70%, transparent); mask: linear-gradient(90deg, #000 70%, transparent); }
.st-ovf__art--scroll i:first-child { background: var(--accent); }
.st-ovf__art--more i:first-child { background: var(--accent); }
.st-ovf__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.st-ovf__label { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.st-ovf__sub { font-size: var(--t-small); line-height: 1.35; color: var(--muted); overflow-wrap: anywhere; }
.st-ovf__dot { flex: none; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line-strong); display: grid; place-items: center; }
.st-ovf[aria-checked="true"] .st-ovf__dot { background: var(--accent); box-shadow: none; }
.st-ovf[aria-checked="true"] .st-ovf__dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.sheet:has(.st-snds) { position: fixed; }

/* the spark mark in Settings is the same glyph as in the corner and the balance */
.st-spark-glyph { display: inline-grid; place-items: center; font-size: 17px; line-height: 1; font-weight: 700; color: currentColor; }
.st-cpick__ic .st-spark-glyph { color: var(--c, var(--muted)); }

/* v6 (owner): bottom bar icon colours */
.st-baric { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.st-baric .segmented { width: 100%; }
.st-baric__one { display: flex; gap: 10px; }
.st-baric__pick { flex: 1 1 0; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 14px; border: 0; border-radius: 16px; font: inherit; font-weight: 600; color: var(--fg);
  background: rgb(var(--fg-rgb) / 0.06); box-shadow: inset 0 0 0 1px rgb(var(--fg-rgb) / 0.08); cursor: pointer; }
.st-baric__pick .st-dot { background: var(--sw); position: relative; }
.st-baric__pick[aria-checked="true"] { background: rgb(var(--accent-rgb) / 0.10); box-shadow: inset 0 0 0 2px var(--accent); }
.st-baric__pick:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.st-baric__tab .st-row__icon svg { color: inherit; }

/* v6 (owner): Goals — bigger words, and the fields are the see-through grey used everywhere (they were a solid dark box) */
#st-targets .st-num--time, #st-targets .st-field--unit {
  background: rgb(var(--fg-rgb) / 0.08); box-shadow: none; height: 44px; border-radius: 14px; }
#st-targets .st-num--time:focus-visible, #st-targets .st-field--unit:focus-within { background: rgb(var(--fg-rgb) / 0.11); box-shadow: inset 0 0 0 2px var(--accent); }
#st-targets .st-field--unit:has(.st-num[aria-invalid="true"]) { box-shadow: inset 0 0 0 2px var(--red); }
#st-targets .st-num, #st-targets .st-num--time { font-size: 17px; }
#st-targets .st-field__unit { font-size: 15px; }
#st-targets .st-row__title { font-size: 16px; }
#st-targets .st-row__sub { font-size: 14px; }
#st-targets .segmented button { font-size: 15px; min-height: 36px; }
@media (max-width: 360px) { #st-targets .segmented button { font-size: 14px; padding: 0 11px; } #st-targets .st-num--time, #st-targets .st-field--unit { width: 132px; } }
@media (max-width: 340px) { #st-targets .segmented button { font-size: 13.5px; padding: 0 8px; } }
.st-baric .segmented { display: flex; max-width: 100%; box-sizing: border-box; }
.st-baric .segmented button { flex: 1 1 0; min-width: 0; padding: 0 8px; white-space: normal; line-height: 1.2; overflow-wrap: anywhere; }
.st-baric { min-width: 0; width: 100%; }
.st-baric__one { flex-wrap: wrap; }
.st-baric__pick { min-width: 0; flex: 1 1 140px; }
.st-baric__pick > span:last-child { min-width: 0; overflow-wrap: anywhere; text-align: start; }

/* v6 (owner): the icon colour choice lives in Appearance, as one more row */
.st-iconrow .st-baric { margin-top: 0; }
.st-baric .st-row__sub { margin-top: -6px; }
/* v6 (owner): the glass sizes are as wide as their words — no empty stretch after "1 л" */
#st-targets .segmented { width: auto; max-width: 100%; }
#st-targets .segmented button { flex: 0 0 auto; }

/* v6 (owner): fire / water / sparks previews — bigger, and only the icon takes the colour (the chip stays plain grey) */
#st-appearance .st-fire { height: 44px; min-width: 44px; padding: 0 14px; gap: 6px; justify-content: center; border-radius: 22px;
  background: rgb(var(--fg-rgb) / 0.07); color: var(--fg); font-size: 18px; }
#st-appearance .st-fire svg { width: 26px; height: 26px; }
#st-appearance .st-water-prev svg { color: var(--fire); stroke: var(--fire); fill: color-mix(in srgb, var(--fire) 30%, transparent); }
#st-appearance .st-spark-prev { color: var(--fire, var(--fg)); background: rgb(var(--fg-rgb) / 0.07); }
#st-appearance .st-spark-prev .st-spark-glyph, #st-appearance .st-spark-prev svg { width: 24px; height: 24px; font-size: 24px; }
#st-appearance .st-fire--flame .st-fire__n { color: var(--fg); }
/* v6 (owner): Goals — every number and word in the middle of its field, and bigger */
#st-targets .st-field--unit { justify-content: center; gap: 6px; padding: 0 12px; cursor: text; }
#st-targets .st-field--unit .st-num, #st-targets .st-field--unit .st-num:not(.st-num--time) { flex: 0 1 auto; padding: 0; text-align: center; font-size: 19px; min-width: 1ch; max-width: 100%; }
#st-targets .st-field--unit .st-field__unit { padding-right: 0; font-size: 16px; }
#st-targets .st-num--time { justify-content: center; text-align: center; font-size: 19px; }
#st-targets .st-num--time .tp-field__time { text-align: center; flex: 0 1 auto; }

/* v7 (owner 2026-11-16): Goals in one column — every number in a column of one width (right-aligned, so the digits end
   together) and every unit in a slot of one width after it (left-aligned); the two times are fields of the same width,
   centred. --st-num-w / --st-unit-w are measured by settings.js (alignGoals) for the values and the language on screen. */
#st-targets .st-field--unit, #st-targets .st-num--time {
  box-sizing: border-box; font-size: 19px; width: max(150px, calc(var(--st-num-w, 4.2ch) + var(--st-unit-w, 48px) + 30px));
}
#st-targets .st-field--unit {
  display: grid; grid-template-columns: var(--st-num-w, 4.2ch) var(--st-unit-w, 48px); column-gap: 6px; justify-content: center; align-items: center;
}
#st-targets .st-field--unit .st-num, #st-targets .st-field--unit .st-num:not(.st-num--time) { width: 100%; min-width: 0; max-width: none; text-align: end; font-size: 19px; font-variant-numeric: tabular-nums; }
#st-targets .st-field--unit .st-field__unit { width: auto; min-width: 0; text-align: start; white-space: nowrap; }
#st-targets .st-num--time { font-variant-numeric: tabular-nums; width: var(--st-field-w, 150px); }
@media (max-width: 360px) { #st-targets .st-field--unit { width: max(132px, calc(var(--st-num-w, 4.2ch) + var(--st-unit-w, 48px) + 30px)); } #st-targets .st-num--time { width: var(--st-field-w, 132px); } }
