/* Lost Chat design system, after Daymohk (its docs/design.md: «Дизайн — единый источник правды»).
   Foundation (scales) → semantic roles → components. Palette values are inputs,
   paint() resolves the readable state pairs, and presets.css adds authored decoration.
   Loaded first, so every other stylesheet reads these names. Description: документы/дизайн/ДИЗАЙН-СИСТЕМА.md. */
:root {
  /* Corners: one multiplier over the Daymohk lengths (2/4/6/8/12/16/24/32 px at 1×).
     Circles, dots and avatars stay 50%, stadiums use --ds-radius-full. */
  --ds-radius-scale: 1;
  --ds-radius-xs: calc(.125rem * var(--ds-radius-scale));
  --ds-radius-sm: calc(.25rem * var(--ds-radius-scale));
  --ds-radius-md: calc(.375rem * var(--ds-radius-scale));
  --ds-radius-lg: calc(.5rem * var(--ds-radius-scale));
  --ds-radius-xl: calc(.75rem * var(--ds-radius-scale));
  --ds-radius-2xl: calc(1rem * var(--ds-radius-scale));
  --ds-radius-3xl: calc(1.5rem * var(--ds-radius-scale));
  --ds-radius-4xl: calc(2rem * var(--ds-radius-scale));
  /* Chips, badges, segments, pill buttons: a length, not 999px, so the scale reaches them (Daymohk 29.09). */
  --ds-radius-pill: calc(1.25rem * var(--ds-radius-scale));
  --ds-radius-control: calc(.75rem * var(--ds-radius-scale));
  --ds-radius-full: 9999px;

  /* Surface hierarchy. Tab rails add their inset and edge to the tab corner. */
  --ds-radius-card: var(--ds-radius-2xl);
  --ds-radius-inset: var(--ds-radius-control);
  --ds-radius-sheet: var(--ds-radius-3xl);
  --ds-radius-tab: var(--ds-radius-control);
  --ds-segment-pad: var(--ds-space-1);
  --ds-segment-gap: 3px;

  /* Type: the four Daymohk steps (label, body, title, display) with a micro step for meta and counters,
     a control step for buttons, the input step that keeps iOS from zooming, and two headings. */
  --ds-fs-micro: .6875rem;
  --ds-fs-label: .75rem;
  --ds-fs-body: .8125rem;
  --ds-fs-control: .875rem;
  --ds-fs-title: .9375rem;
  --ds-fs-input: 1rem;
  --ds-fs-display: 1.0625rem;
  --ds-fs-heading: 1.25rem;
  --ds-fs-hero: 1.5rem;
  --ds-fs-jumbo: 2rem;
  --ds-fs-sheet-title: var(--ds-fs-display);

  --ds-page-width: 760px;
  /* Touch: nothing pressable is smaller than 44 px; small icons get the area, not the look. */
  --ds-touch: 44px;
  --ds-icon: 20px;
  --ds-icon-sm: 16px;

  /* Spacing steps used by the shells. */
  --ds-space-1: 4px;
  --ds-space-2: 8px;
  --ds-space-3: 12px;
  --ds-space-4: 16px;
  --ds-space-5: 20px;
  --ds-space-6: 24px;
  --ds-sheet-inset: var(--ds-space-4);
  --ds-sheet-gap: var(--ds-space-3);

  /* State changes and new surfaces, not a delay before a click takes effect. */
  --ds-dur: .33s;
  --ds-dur-sheet: .33s;
  --ds-dur-press: .25s;
  /* Short feedback on direct manipulation (e.g. a pressed key or live audio level). */
  --ds-dur-fast: .16s;
  --ds-ease-out: cubic-bezier(.16, 1, .3, 1);
  --ds-ease-spring: cubic-bezier(.32, .72, 0, 1);
  /* The overshooting curve of Daymohk's switches and chips (glass-skin.css, --g-ease-pop). */
  --ds-ease-pop: cubic-bezier(.34, 1.56, .64, 1);
  --ds-press-scale: .97;

  /* States. */
  --ds-disabled-opacity: .5;
  --ds-focus-ring: 2px solid var(--ds-ink);
  --ds-focus-offset: 2px;
  --ds-scrim: rgb(9 9 11 / .7);
  --ds-veil-filter: blur(16px) saturate(118%);

  /* Danger as a fill: white words on it in every theme (Daymohk 08.10.2026). As text: --ds-red. */
  --ds-danger-rgb: 194 41 53;
  --ds-danger: rgb(var(--ds-danger-rgb));
  --ds-on-danger: #ffffff;

  /* Semantic roles. A surface is solid even with a wallpaper underneath it. */
  --ds-surface-canvas: var(--lc-bg, #101116);
  --ds-surface-raised: var(--lc-card, #202128);
  --ds-surface-inset: var(--lc-surface, var(--ds-surface-canvas));
  --ds-ink: var(--lc-text, #f4f2f7);
  --ds-ink-muted: var(--lc-muted, #a9a8b3);
  --ds-ink-accent: var(--lc-accent-ink, var(--ds-ink));
  --ds-edge: var(--lc-hairline, color-mix(in srgb, var(--ds-ink) 12%, transparent));
  --ds-control-line: var(--lc-control-line, color-mix(in srgb, var(--ds-ink) 44%, var(--ds-surface-inset)));
  --ds-control-hover: var(--lc-control-hover-solid, color-mix(in srgb, var(--ds-surface-inset) 94%, var(--ds-ink)));
  --ds-control-pressed: var(--lc-control-pressed, color-mix(in srgb, var(--ds-surface-inset) 97%, black));
  --ds-action-fill: var(--lc-action, var(--lc-button, #a78bfa));
  --ds-action-ink: var(--lc-on-button, #17131e);
  --ds-action-hover: var(--lc-action-hover, var(--ds-action-fill));
  --ds-action-pressed: var(--lc-action-pressed, var(--ds-action-fill));
  --ds-status-error: var(--lc-status-error, var(--ds-red, #ff828b));
  --ds-shadow-tone: #000000;
  --ds-shadow-card: inset 0 0 0 1px var(--ds-edge), 0 2px 6px color-mix(in srgb, var(--ds-shadow-tone) 20%, transparent);
  --ds-shadow-sheet: inset 0 0 0 1px var(--ds-edge), 0 4px 16px color-mix(in srgb, var(--ds-shadow-tone) 26%, transparent);
  --ds-safe-top: env(safe-area-inset-top, 0px);
  --ds-safe-bottom: env(safe-area-inset-bottom, 0px);
  --ds-safe-left: env(safe-area-inset-left, 0px);
  --ds-safe-right: env(safe-area-inset-right, 0px);
}
html[data-hub-theme="light"] { --ds-shadow-tone: #223049; }

/* Dark appearance uses tighter corners without changing any palette values. */
html[data-hub-theme="dark"] { --ds-radius-scale: .72; }

@media (prefers-reduced-motion: reduce) {
  :root { --ds-dur: .001s; --ds-dur-sheet: .001s; --ds-dur-fast: .001s; --ds-dur-press: .001s; --ds-press-scale: 1; }
}
html[data-hub-motion="reduced"] { --ds-dur: .001s; --ds-dur-sheet: .001s; --ds-dur-fast: .001s; --ds-dur-press: .001s; --ds-press-scale: 1; }

/* Shared buttons: state changes do not move, shrink, or affect the ink. The legacy
   .hub-action hook and the mode CTA keep their markup and behavior. */
:is(.ds-btn, .hub-action) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ds-space-2);
  box-sizing: border-box;
  min-width: var(--ds-touch);
  min-height: var(--ds-touch);
  padding: var(--ds-space-1) var(--ds-space-4);
  border: 1px solid var(--ds-btn-line, transparent);
  border-radius: var(--ds-radius-control);
  font: 700 var(--ds-fs-control)/1.2 var(--lc-font, system-ui, sans-serif);
  cursor: pointer;
  overflow-wrap: anywhere;
}
:is(.ds-btn, .hub-action, .find-go, .set-segment :where(button), .lc-modal-close) {
  background-color: var(--ds-btn-fill, var(--ds-surface-inset));
  color: var(--ds-btn-ink, var(--ds-ink));
  transition: background-color var(--ds-dur-fast) ease;
}
:is(.ds-btn--primary, .hub-action, .find-go) {
  --ds-btn-fill: var(--ds-action-fill);
  --ds-btn-ink: var(--ds-action-ink);
  --ds-btn-hover: var(--ds-action-hover);
  --ds-btn-pressed: var(--ds-action-pressed);
}
:is(.ds-btn--secondary, .hub-action.secondary, .find-go[data-locked="true"]) {
  --ds-btn-fill: var(--ds-surface-inset);
  --ds-btn-ink: var(--ds-ink);
  --ds-btn-hover: var(--ds-control-hover);
  --ds-btn-pressed: var(--ds-control-pressed);
  --ds-btn-line: var(--ds-edge);
}
.ds-btn--ghost { --ds-btn-fill: transparent; }
:is(.ds-btn--danger, .hub-action.is-danger) {
  --ds-btn-fill: var(--ds-danger);
  --ds-btn-ink: var(--ds-on-danger);
  --ds-btn-hover: color-mix(in srgb, var(--ds-danger) 94%, black);
  --ds-btn-pressed: color-mix(in srgb, var(--ds-danger) 97%, black);
  --ds-btn-line: transparent;
}
@media (hover: hover) {
  :is(.ds-btn, .hub-action, .find-go, .set-segment :where(button), .lc-modal-close):hover:where(:not(:disabled, [aria-disabled="true"])) {
    background-color: var(--ds-btn-hover, var(--ds-control-hover));
  }
}
/* The existing 18+ consent actions intentionally keep their look through a press. */
:is(.ds-btn, .hub-action, .find-go, .set-segment :where(button), .lc-modal-close):active:where(:not(:disabled, [aria-disabled="true"], .lc-rules-actions > .hub-action)) {
  background-color: var(--ds-btn-pressed, var(--ds-control-pressed));
}
:is(.ds-btn, .hub-action, .find-go, .set-segment :where(button), .lc-modal-close):is(:disabled, [aria-disabled="true"]) {
  opacity: var(--ds-disabled-opacity);
  cursor: not-allowed;
}
:is(.ds-btn, .hub-action, .find-go, .set-segment :where(button), .lc-modal-close):focus-visible {
  outline: var(--ds-focus-ring);
  outline-offset: var(--ds-focus-offset);
}
/* All dismiss actions use the plain, preset-independent X and a real hit area.
   Media may scroll or paint behind it, so only those viewers get a dark backing. */
.lc-modal-close {
  --ds-btn-fill: transparent;
  display: inline-grid;
  place-items: center;
  flex: none;
  box-sizing: border-box;
  inline-size: var(--ds-touch);
  block-size: var(--ds-touch);
  min-inline-size: var(--ds-touch);
  min-block-size: var(--ds-touch);
  padding: 0;
  border: 0;
  border-radius: 50%;
  box-shadow: none;
  cursor: pointer;
}
.lc-modal-close[hidden] { display: none; }
.lc-modal-close > svg.lc-icon {
  inline-size: var(--ds-icon-sm);
  block-size: var(--ds-icon-sm);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  scale: 1;
}
.lc-modal-close--media {
  --ds-btn-ink: #fff;
  --ds-btn-fill: rgb(12 12 15 / .88);
  --ds-btn-hover: #242429;
  --ds-btn-pressed: #17171b;
  --ds-focus-ring: 2px solid #fff;
}
.ds-btn--icon { width: var(--ds-touch); padding: 0; border-radius: 50%; }
.ds-btn--icon .lc-icon { width: var(--ds-icon); height: var(--ds-icon); }

/* View switches and native radio choices share a raised rail and the same selected state. */
:is(.lc-tabs, .lc-segmented):not([hidden]) {
  position: relative; display: flex; align-items: stretch; gap: var(--ds-segment-gap);
  --segment-radius: var(--lc-block-radius, var(--ds-radius-card));
  --segment-corner: min(var(--lc-seg-radius, var(--segment-radius)), max(0px, calc(var(--segment-radius) - var(--ds-segment-pad))));
  min-inline-size: 0; box-sizing: border-box; padding: var(--ds-segment-pad);
  border: 0;
  border-radius: var(--segment-radius);
  background: var(--ds-surface-raised);
}
.lc-tabs--card:not([hidden]) { box-shadow: var(--ds-shadow-card); }
.lc-segmented:not([hidden]) { overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: none; }
.lc-tabs--three:not([hidden]) { display: grid; }
.lc-tabs--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lc-tabs > .lc-tab, .lc-segmented > button {
  --ds-btn-hover: var(--ds-control-hover);
  --ds-btn-pressed: var(--ds-control-pressed);
  display: inline-flex; flex: 1 0 auto; align-items: center; justify-content: center; gap: 0;
  box-sizing: border-box; min-inline-size: var(--ds-touch); min-block-size: var(--ds-touch); padding: 4px 8px;
  border: 0; border-radius: var(--segment-corner);
  background: transparent; box-shadow: none; color: var(--ds-ink-muted); cursor: pointer;
  font: 650 var(--ds-fs-label)/1.2 var(--lc-font, system-ui, sans-serif);
  text-align: center; white-space: nowrap;
  transition: background-color var(--ds-dur) ease, color var(--ds-dur) ease;
}
.lc-segmented > button .lc-icon { inline-size: 16px; block-size: 16px; flex: none; }
.lc-segmented > button .lc-tab-label { margin-inline-start: 5px; min-inline-size: 0; }
.lc-segmented > button:not(:has(.lc-icon)) .lc-tab-label { margin-inline-start: 0; }
:is(.lc-tabs > .lc-tab, .lc-segmented > button):is([aria-pressed="true"], [aria-selected="true"], [aria-checked="true"], :has(> :where(input[type="radio"]):checked)) {
  --lc-segment-on: color-mix(in srgb, var(--ds-surface-raised) 84%, var(--lc-accent, #a78bfa));
  --ds-btn-hover: var(--lc-segment-on);
  --ds-btn-pressed: var(--lc-segment-on);
  background-color: var(--lc-segment-on); color: var(--ds-ink);
}
@media (hover: hover) {
  :is(.lc-tabs > .lc-tab, .lc-segmented > button):hover:not(:disabled) { background-color: var(--ds-btn-hover); }
}
:is(.lc-tabs > .lc-tab, .lc-segmented > button):is(:focus-visible, :has(> :where(input[type="radio"]):focus-visible)), [role="tabpanel"][tabindex]:focus-visible {
  outline: var(--ds-focus-ring); outline-offset: -3px;
}
/* Keep real radios (arrow keys, checked state, one tab stop per group) and the full hit area. */
.lc-tabs--radio > .lc-tab { position: relative; flex: 1 1 0; white-space: normal; overflow-wrap: anywhere; }
.lc-tabs--radio input[type="radio"] {
  position: absolute; inset: 0; inline-size: 100%; block-size: 100%; margin: 0; opacity: 0; cursor: inherit;
}
.lc-segmented:is([data-compact], [data-segment-labels="active"]) > button { flex-basis: var(--ds-touch); padding-inline: 3px; }
.lc-segmented:is([data-compact], [data-segment-labels="active"]) > button:is([aria-pressed="true"], [aria-selected="true"], [aria-checked="true"]) {
  flex-basis: auto; padding-inline: 7px;
}
.lc-segmented:is([data-compact], [data-segment-labels="active"]) > button:not(:is([aria-pressed="true"], [aria-selected="true"], [aria-checked="true"])):has(.lc-icon) > .lc-tab-label { display: none; }
/* Bounded rails (six settings tabs, four legal tabs): keep one row, let only
   the selected label wrap when there is room. At large text keep named icons rather than broken words. */
.lc-segmented[data-segment-fit]:not([hidden]) { container: lc-fit-tabs / inline-size; gap: 2px; padding-inline: 2px; }
.lc-segmented[data-segment-fit] > button { flex: 1 0 var(--ds-touch); padding-inline: 2px; }
.lc-segmented[data-segment-fit] > button[aria-selected="true"] {
  flex: 5 1 auto; flex-wrap: wrap; gap: 2px 5px; padding-inline: 4px; white-space: normal;
}
.lc-segmented[data-segment-fit] > button > .lc-tab-label { margin: 0; overflow-wrap: anywhere; }
@container lc-fit-tabs (max-width: 14rem) {
  .lc-segmented[data-segment-fit] > button[aria-selected="true"] { flex: 1 0 var(--ds-touch); padding-inline: 2px; }
  .lc-segmented[data-segment-fit] > button:has(.lc-icon) > .lc-tab-label { display: none; }
}
/* The own field and the search filter are the same three-cell rail, even at large text sizes. */
.lc-segmented.lc-gender-tabs:not([hidden]) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lc-segmented.lc-gender-tabs > button {
  min-inline-size: 0; padding-inline: var(--ds-space-1); flex-direction: column; gap: 3px;
  white-space: normal; overflow-wrap: anywhere;
}
.lc-segmented.lc-gender-tabs > button .lc-tab-label { margin-inline: 0; }

/* Flat inset input wells; the ring exists only while focused with a keyboard. */
.ds-field {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  min-height: var(--ds-touch);
  padding: var(--ds-space-2) var(--ds-space-3);
  border: 0;
  border-radius: var(--ds-radius-control);
  background: var(--ds-surface-inset);
  color: var(--ds-ink);
  font: 400 var(--ds-fs-input)/1.35 var(--lc-font, system-ui, sans-serif);
}
.ds-field::placeholder { color: var(--ds-ink-muted); opacity: 1; }
.ds-field:focus-visible { background-color: var(--ds-control-hover); outline: var(--ds-focus-ring); outline-offset: -2px; }
.ds-field[aria-invalid="true"] { box-shadow: inset 0 0 0 1px var(--ds-status-error); }

@media (forced-colors: active) {
  :root { --ds-edge: CanvasText; --ds-control-line: ButtonText; --ds-focus-ring: 2px solid Highlight; }
  :is(.ds-btn, .hub-action, .ds-field) { border: 1px solid ButtonText; }
  .ds-field[aria-invalid="true"] { border-style: dashed; }
  :is(.lc-tabs > .lc-tab, .lc-segmented > button):is([aria-pressed="true"], [aria-selected="true"], [aria-checked="true"], :has(> :where(input[type="radio"]):checked)) {
    forced-color-adjust: none; background-color: Highlight; border-color: Highlight; color: HighlightText;
  }
  :is(.lc-tabs > .lc-tab, .lc-segmented > button):is([aria-pressed="true"], [aria-selected="true"], [aria-checked="true"], :has(> :where(input[type="radio"]):checked)):is(:focus-visible, :has(> :where(input[type="radio"]):focus-visible)) { outline-color: HighlightText; }
}

/* One block instead of a stack of cards (Daymohk side menu, prayer block, grouped rows): the plate is
   .set-group with its card preset, inside it .ds-sect parts with a small capital title and a hairline
   between them. Rows of a part run to the edges of the plate like the rows of the settings. */
.ds-sect {
  position: relative;
  display: grid;
  gap: var(--ds-space-2);
  padding: var(--ds-space-4);
}
.ds-sect[hidden] { display: none; }
.ds-sect + .ds-sect::before {
  content: '';
  position: absolute;
  top: 0;
  right: var(--ds-space-4);
  left: var(--ds-space-4);
  height: 1px;
  background: var(--ds-edge);
  pointer-events: none;
}
.ds-sect--rows { padding-bottom: var(--ds-space-1); }
.ds-sect--rows > .set-rows { margin-inline: calc(-1 * var(--ds-space-4)); padding-bottom: 0; }
.ds-group-title {
  margin: 0;
  color: var(--ds-ink-muted);
  font: 700 var(--ds-fs-label)/1.3 var(--lc-font);
  letter-spacing: .05em;
  text-transform: uppercase;
}
.ds-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-2);
  min-height: 22px;
}
.ds-group-head .set-tag { margin-left: 0; }

/* A single quiet ornament for headings on both pages and sheets. */
.ds-group-ornament { display: flex; align-items: center; gap: var(--ds-space-2); min-inline-size: 0; margin: 0; }
.ds-group-ornament::before {
  content: ''; flex: none; inline-size: .38rem; block-size: .38rem; rotate: 45deg;
  border: 1px solid color-mix(in srgb, var(--ds-ink-muted) 58%, transparent);
  pointer-events: none;
}

/* The ornament line of Daymohk (.smk-orn): a hairline fading at the ends with a small diamond in the middle. */
.ds-orn {
  position: relative;
  height: 1px;
  margin: var(--ds-space-1) auto var(--ds-space-4);
  width: min(18rem, 72%);
  background: linear-gradient(90deg, transparent, var(--lc-hairline) 14%, var(--lc-hairline) 44%, transparent 47%, transparent 53%, var(--lc-hairline) 56%, var(--lc-hairline) 86%, transparent);
}
.ds-orn::after {
  content: '';
  position: absolute;
  top: -3px;
  left: calc(50% - 3px);
  width: 6px;
  height: 6px;
  background: var(--lc-hairline);
  rotate: 45deg;
}

/* A part that opens in place: the height follows the content through the grid, the chevron turns.
   .is-open on the part (or [aria-expanded="true"] on its head) shows the body. */
.ds-fold {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows var(--ds-dur) var(--ds-ease-out), opacity var(--ds-dur) ease;
}
.ds-fold > * { min-height: 0; overflow: hidden; }
.is-open > .ds-fold, [aria-expanded="true"] + .ds-fold { grid-template-rows: 1fr; opacity: 1; }
.ds-chev { transition: transform var(--ds-dur) var(--ds-ease-out); }
[aria-expanded="true"] > .ds-chev, .is-open > * > .ds-chev { transform: rotate(90deg); }

/* A floating card uses the same solid layer as a dialog. */
.ds-pop {
  border-radius: var(--ds-radius-sheet);
  background: var(--ds-surface-raised);
  box-shadow: var(--ds-shadow-sheet);
  color: var(--ds-ink);
}
/* Hide only scrollbar chrome: wheel, swipe, scrollIntoView and keyboard scrolling still work. */
:where(*) { scrollbar-width: none; }
::-webkit-scrollbar { display: none; }

/* Native timer and audio ranges: smaller paint, same 44px pointer/keyboard control. */
input.lc-range-compact {
  appearance: none; -webkit-appearance: none; background: transparent;
  min-block-size: var(--ds-touch); cursor: pointer;
}
input.lc-range-compact:focus-visible { outline: var(--ds-focus-ring); outline-offset: -2px; border-radius: var(--ds-radius-control); }
.lc-range-compact::-webkit-slider-runnable-track {
  height: 4px; border-radius: var(--ds-radius-full);
  background: linear-gradient(to right, var(--lc-accent) var(--lc-range-fill, 0%), var(--ds-surface-inset) var(--lc-range-fill, 0%));
}
.lc-range-compact::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none; box-sizing: border-box;
  width: 12.8px; height: 12.8px; margin-top: -4.4px;
  border-radius: 50%; background: var(--ds-ink);
}
.lc-range-compact::-moz-range-track { height: 4px; border-radius: var(--ds-radius-full); background: var(--ds-surface-inset); }
.lc-range-compact::-moz-range-progress { height: 4px; border-radius: var(--ds-radius-full); background: var(--lc-accent); }
.lc-range-compact::-moz-range-thumb {
  box-sizing: border-box; width: 12.8px; height: 12.8px; border: 0;
  border-radius: 50%; background: var(--ds-ink);
}
@media (forced-colors: active) {
  input.lc-range-compact { appearance: auto; -webkit-appearance: auto; }
}
