/* Профиль, Настройки, Подключения (mock 2): a page of settings — the name of the page (24 px), parts with a heading
   (15 px, 600), rows «what · its control» over a thin line, switches. Every rule of these pages lives here. */
.settings { max-width: calc(720px * var(--z, 1)); padding: 6px 20px 24px; display: flex; flex-direction: column; gap: 22px; }
.settings section { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; border-top: 0; padding: 0; }
.settings-head { display: flex; align-items: center; gap: 12px; margin: 0; }
.settings-head .avatar { width: 40px; height: 40px; font-size: var(--fs-read); }
.settings-head h1, .settings h1 { margin: 0; font-size: var(--fs-title-l); font-weight: 600; letter-spacing: -.012em; }
.settings h2 { margin: 0 0 2px; color: var(--text); font-size: var(--fs-read); font-weight: 600; text-transform: none; }
/* «Назад» stays for the phone dock's sake only: on a computer the menu is there */
/* «Назад» lives in the top line on the right, for the phone only: on a computer the menu is there */
@media (min-width: 861px) { #actions .back-btn { display: none; } }
#actions .back-btn { height: 32px; padding: 0 10px 0 8px; gap: 6px; }
.settings .note { color: var(--text-3); font-size: var(--fs-caption); line-height: 1.45; }
.settings section > .note { max-width: 60ch; margin-bottom: 6px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; min-height: 44px; padding: 6px 0; border-bottom: 1px solid var(--border-soft); }
.set-row b { font-weight: 500; }
/* the text of a row gives way to its control, but never narrower than ~9 words' worth: then the control goes under it */
.set-row { flex-wrap: wrap; }
.set-row > div:first-child { flex: 1 1 0; min-width: min(100%, 9em); }
.set-row > .seg, .set-row > .btn, .set-row > .switch { flex: none; }
.set-row .set-act { margin-top: 0; flex: none; }
/* buttons of a row are small (mock 2 .btn.sm: 30 px) */
.settings .set-row .btn, .settings .set-act .btn { height: 30px; padding: 0 12px; }
/* a value that a tap copies: a round plate with the copy icon (mock 2) */
.set-plate { display: inline-flex; align-items: center; gap: 6px; flex: none; max-width: 100%; height: 26px; padding: 0 10px; border: 0; border-radius: var(--r-full); background: var(--hover); color: var(--text-2); font: inherit; font-size: var(--fs-body); cursor: pointer; }
.set-plate > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-plate:active { background: var(--press); }
@media (max-width: 860px) {
  .settings { padding: 6px 16px 40px; }
  .settings .set-row { flex-wrap: wrap; }
  .settings .token-box, .settings code { overflow-wrap: anywhere; }
}
/* a choice of a few: round buttons on one ground, the chosen one raised (mock 2 .seg) */
.seg { display: inline-flex; flex: none; gap: 2px; padding: 2px; border: 0; border-radius: var(--r-full); background: var(--hover); white-space: nowrap; overflow: visible; }
.seg button { height: 32px; min-width: 32px; padding: 0 12px; border: 0; border-radius: var(--r-full); background: transparent; color: var(--text-3); font: inherit; font-weight: 500; cursor: pointer; }
.seg button + button { border-left: 0; }
.seg button.on, .seg button[aria-pressed="true"] { background: var(--elev); color: var(--text); box-shadow: 0 0 0 1px var(--border-soft); font-weight: 500; }
@media (hover: hover) { .seg button:not(.on):hover { color: var(--text); } }
.seg-fill { display: flex; width: 100%; }
.seg-fill button { flex: 1 1 0; min-width: 0; padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* a computer: these pages are as wide as the agent's chat card — the rest of the frame stays empty (Vlad, 12.11.2026) */
@media (min-width: 861px) {
  /* the empty frame beside it shrinks first when the window is narrow or zoomed — the page keeps its own width */
  .main:has(#content > .settings) { margin-right: clamp(0px, calc(100vw - 1300px), 328px); }
}
/* the dictation dictionary: one term a line; no frame around the text (a soft ground instead) */
.set-terms { display: block; width: 100%; box-sizing: border-box; min-height: 120px; max-height: 320px; padding: 10px 12px; resize: vertical; field-sizing: content;
  border: 0; border-radius: var(--r-md); background: var(--hover); color: var(--text); font: inherit; font-size: var(--fs-body); line-height: 1.5; outline: none; }
.set-terms:focus { background: var(--active); }
.set-terms::placeholder { color: var(--text-4); }
/* «Подключения» of an admin (Vlad, 14.11.2026): the AI services and the speech model of the app */
.set-box, .set-speech { display: flex; flex-direction: column; width: 100%; }
.set-sub { margin: 14px 0 2px; color: var(--text-3); font-size: var(--fs-caption); font-weight: 500; }
.set-sub:first-child { margin-top: 0; }
.set-row .set-act { display: flex; gap: 6px; }
/* a key is entered on a soft ground, no frame (like the dictionary) */
.set-keyform { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; padding: 6px 0 10px; border-bottom: 1px solid var(--border-soft); }
.set-keyform .note { flex-basis: 100%; }
.set-key { flex: 1 1 14em; min-width: 0; height: 30px; padding: 0 12px; border: 0; border-radius: var(--r-full); background: var(--hover); color: var(--text); font: inherit; font-size: var(--fs-body); outline: none; }
.set-key:focus { background: var(--active); }
.set-key::placeholder { color: var(--text-4); }
.settings .set-keyform .btn { height: 30px; padding: 0 12px; }
/* a model to choose: the whole row is the choice; the round mark on the right */
.set-model { cursor: pointer; }
.set-model input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.set-more { display: flex; flex-direction: column; width: 100%; }
.settings .set-more-btn { height: 30px; margin-top: 6px; padding: 0 12px; }
/* the languages: one line of pills; on a phone it scrolls sideways instead of wrapping */
.set-langs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.set-langs::-webkit-scrollbar { display: none; }
.set-langs button { flex: none; }
.set-prompt { min-height: 64px; }
/* the test's result: the heard text on a soft ground, the time under it */
.set-test { width: 100%; box-sizing: border-box; margin-top: 8px; padding: 10px 12px; border-radius: var(--r-md); background: var(--hover); }
.set-test-t { font-size: var(--fs-body); line-height: 1.5; }
.set-test-t i { color: var(--text-3); font-style: normal; }
/* what a provider refused: its own words, in the warning colour */
.settings .note.set-warn { color: var(--orange); overflow-wrap: anywhere; }
/* a phone: the key takes the whole line, «Сохранить» and «Отмена» under it */
@media (max-width: 860px) { .set-key { flex-basis: 100%; } }
