/* Профиль, настройки и помощь (этап 21.2): меню профиля в шапке, экран «Профиль» на телефоне, экран «Настройки»,
   страница «Помощь и документация». Разметку рисуют settings.js и help.js; цвета из переменных index.html. */

/* матовое стекло (решение T 20.10: как на лендинге, «Liquid Glass») */
.ax-glass { background: color-mix(in srgb, var(--panel) 62%, transparent); -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6);
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.22); }
.ax-card { background: color-mix(in srgb, var(--panel) 84%, transparent); -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid color-mix(in srgb, var(--ink) 9%, transparent); border-radius: 10px; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.ax-ic { flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* меню профиля */
.ax-pm { position: relative; display: inline-flex; }
.ax-pm-btn { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--soft); color: var(--ink2); display: inline-grid; place-items: center; cursor: pointer; padding: 0; }
.ax-pm-btn[aria-expanded="true"] { box-shadow: 0 0 0 3px var(--accent-soft); color: var(--ink); }
.ax-pm-menu { position: absolute; right: 0; top: 44px; z-index: 40; width: 300px; border-radius: 10px; padding: 4px 0; overflow: hidden; text-align: left; white-space: normal; }
.ax-pm-head { display: flex; gap: 12px; align-items: center; padding: 12px 16px 14px; border-bottom: 1px solid var(--line2); color: var(--ink2); }
.ax-pm-head b { display: block; font-size: 15px; font-weight: 600; color: var(--ink); }
.ax-pm-head span { font-size: 13px; color: var(--muted); }
.ax-mi { display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; padding: 9px 16px; font: inherit; font-size: 14px; color: var(--ink);
  text-decoration: none; background: transparent; border: 0; cursor: pointer; text-align: left; }
.ax-mi:hover, .ax-mi:focus-visible { background: color-mix(in srgb, var(--ink) 6%, transparent); outline: none; }
.ax-mi .ax-ic { color: var(--ink2); }
.ax-mi .v { margin-left: auto; font-size: 12px; color: var(--muted); }
.ax-sep { height: 1px; background: var(--line2); margin: 6px 0; }
/* переключатель темы иконками (как прежний .thm в меню «…») */
.ax-thm { margin-left: auto; display: inline-flex; gap: 2px; padding: 2px; border-radius: 9px; background: var(--bg); border: 1px solid var(--line2); }
.ax-thm button { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 26px; padding: 0; border: 0; border-radius: 7px;
  background: transparent; color: var(--muted); cursor: pointer; transition: color .15s, background-color .15s; }
.ax-thm button:hover { color: var(--ink); }
.ax-thm button[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--line); }
.ax-thm button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ax-card .ax-thm, .ax-row-l .ax-thm { flex: 0 0 auto; }
.ax-card > div > .ax-thm { margin-left: 0; }
@media (max-width: 759px) { .ax-thm button { width: 44px; height: 34px; } }

/* экран «Настройки» */
.ax-st { max-width: 1120px; margin: 0 auto; padding: 8px 0 48px; box-sizing: border-box; }
.ax-st-h { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; color: var(--ink); }
.ax-st-h h1 { margin: 0; font-size: 24px; font-weight: 600; }
.ax-st-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }
.ax-nav { border-radius: 10px; padding: 6px; position: sticky; top: 84px; }
.ax-nav-g { font-size: 11px; color: var(--muted); padding: 12px 12px 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.ax-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 6px; font-size: 14px; color: var(--ink2); text-decoration: none; }
.ax-nav a:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.ax-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.ax-nav a .v { margin-left: auto; font-size: 12px; color: var(--muted2); font-weight: 400; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ax-pane { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ax-card h2 { margin: 0; font-size: 16px; font-weight: 600; color: var(--ink); }
.ax-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.ax-card form { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.ax-row { display: flex; gap: 10px; flex-wrap: wrap; }
.ax-row > label { flex: 1 1 180px; }
.ax-row-btn { align-items: flex-end; }
.ax-row-btn > .ax-btn { flex: 0 0 auto; align-self: flex-end; padding: 11px 18px; }
/* этап 30: пустые строки сообщений под историей 1R и переключателем не держат место */
[data-msg-hist]:empty, [data-msg-mode]:empty, .ax-row-btn + [data-msg]:empty { min-height: 0; }
.ax-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.ax-card input:not([type="checkbox"]), .ax-card select, .ax-card textarea { font: inherit; font-size: 15px; font-weight: 400; padding: 9px 12px; border: 1px solid var(--ctl); border-radius: 6px;
  background: var(--panel); color: var(--ink); width: 100%; box-sizing: border-box; }
.ax-card input:focus-visible, .ax-card select:focus-visible, .ax-card textarea:focus-visible, .ax-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ax-btn { font: inherit; font-size: 14px; font-weight: 600; padding: 9px 16px; border: 0; border-radius: 6px; background: var(--accent); color: var(--on-accent);
  cursor: pointer; align-self: flex-start; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.ax-btn.sec { background: var(--soft); color: var(--ink); border: 1px solid var(--ctl); }
.ax-btn.danger { background: transparent; color: var(--neg); border: 1px solid color-mix(in srgb, var(--neg) 35%, transparent); }
.ax-btn:disabled { opacity: 0.6; cursor: default; }
.ax-msg { min-height: 18px; font-size: 13px; color: var(--muted); white-space: pre-line; }
.ax-msg.ok { color: var(--pos); } .ax-msg.bad { color: var(--neg); }
.ax-sw { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line2); font-size: 14px; color: var(--ink); font-weight: 400 !important;
  flex-direction: row !important; cursor: pointer; }
.ax-sw:first-of-type { border-top: 0; }
.ax-sw input { appearance: none; -webkit-appearance: none; margin: 0 0 0 auto; flex: 0 0 auto; width: 36px; height: 20px; border-radius: 10px; background: var(--ctl);
  position: relative; cursor: pointer; transition: background 0.15s; }
.ax-sw input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: left 0.15s; }
.ax-sw input:checked { background: var(--accent); }
.ax-sw input:checked::after { left: 18px; }
.ax-sw input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ax-list { display: flex; flex-direction: column; }
.ax-li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line2); font-size: 14px; color: var(--ink); flex-wrap: wrap; }
.ax-li:first-child { border-top: 0; }
.ax-li .v { margin-left: auto; color: var(--muted); font-size: 13px; }
.ax-chip { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--soft); color: var(--muted); }
.ax-chip.ok { color: var(--pos); } .ax-chip.bad { color: var(--neg); }
.ax-note { font-size: 12px; color: var(--muted); width: 100%; }
.ax-link { color: var(--accent-text); background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: none; }
.ax-back { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-text); text-decoration: none; font-size: 15px; margin: 0 0 12px; }
code.ax-code { font-size: 13px; background: var(--soft); padding: 1px 6px; border-radius: 4px; color: var(--ink); }

/* телефон: «Профиль» и список разделов (решение T 20.10: шрифты мельче) */
.ax-me { display: flex; flex-direction: column; gap: 0; }
.ax-me-card { display: flex; flex-direction: row; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 10px; text-decoration: none; color: var(--ink2); }
.ax-me-card b { display: block; font-weight: 600; font-size: 15px; color: var(--ink); }
.ax-me-card span { font-size: 12px; color: var(--muted); }
.ax-grp-t { font-size: 11px; color: var(--muted); margin: 16px 4px 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.ax-grp { border-radius: 10px; overflow: hidden; margin-top: 10px; }
.ax-grp-t + .ax-grp { margin-top: 0; }
.ax-row-l { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px 0 14px; border-top: 1px solid var(--line2); font-size: 14.5px; color: var(--ink);
  text-decoration: none; background: transparent; width: 100%; box-sizing: border-box; font-family: inherit; border-left: 0; border-right: 0; border-bottom: 0; cursor: pointer; text-align: left; }
.ax-row-l:first-child { border-top: 0; }
.ax-row-l .ax-ic { color: var(--ink2); }
.ax-row-l .v { margin-left: auto; font-size: 13px; color: var(--muted); }
.ax-row-l .ch { color: var(--muted2); margin-left: 6px; }
.ax-row-l .v + .ch { margin-left: 6px; }
@media (max-width: 759px) {
  .ax-st { padding: 0 0 32px; }
  .ax-st-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .ax-st-h h1 { font-size: 20px; }
  .ax-card { padding: 14px 16px; }
  .ax-card h2 { font-size: 15px; }
  .ax-sw, .ax-li { font-size: 13.5px; }
}

/* помощь и документация */
.ax-help { max-width: 760px; margin: 0 auto; padding: 8px 0 48px; display: flex; flex-direction: column; gap: 14px; }
.ax-help details { border-top: 1px solid var(--line2); padding: 10px 0; }
.ax-help details:first-of-type { border-top: 0; }
.ax-help summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink); }
.ax-help details p { margin-top: 8px; }
@media (max-width: 759px) { .ax-help .ax-st-h { display: none; } }  /* на телефоне заголовок уже в шапке экрана */

.ax-card textarea { resize: vertical; min-height: 110px; line-height: 1.4; }  /* «Сообщить о проблеме» (MVP 27.10) */
