/* settings.css — B13. Settings (Apple Settings style: one list of groups, each a clean page; search at the top) + AI usage.
   Theme tokens only (API.md § Theme): no colour is written here. */

/* text size, per device (Settings → You & the app → Text size); body zoom keeps the layout fluid */
:root[data-tsize="s"] body { zoom: .94; }
:root[data-tsize="l"] body { zoom: 1.08; }
:root[data-tsize="xl"] body { zoom: 1.16; }

.set-wrap { display: flex; flex-direction: column; gap: 16px; max-width: 1180px; }
.set-split { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 22px; align-items: start; }
.set-split > .set-nav { position: sticky; top: 12px; }
@media (max-width: 1023px) { .set-split { display: block; } .set-split > .set-nav.desk { display: none; } }
.set-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* search */
.set-search { position: relative; display: flex; align-items: center; }
.set-search input { width: 100%; min-height: 46px; padding: 10px 40px 10px 42px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--glass-in); color: var(--text); font: inherit; font-size: 16px; }
.set-search input::placeholder { color: var(--faint); }
.set-search input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.set-search .si { position: absolute; left: 14px; color: var(--muted); pointer-events: none; display: flex; }
.set-search .sx { position: absolute; right: 6px; width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; }

/* the "you" card at the top of the home */
.set-me { display: flex; flex-direction: row; align-items: center; gap: 14px; padding: 16px; }
.set-me .set-av { width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 22px; background: var(--av-1); color: var(--av-ink); flex: none; }
.set-me b { font-size: 18px; color: var(--text-strong); letter-spacing: -.01em; }
.set-me .note { display: block; margin-top: 2px; }

/* grouped lists */
.set-group { padding: 4px 0; gap: 0; overflow: hidden; }
.set-group > .set-gh { padding: 12px 16px 4px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.set-group > .set-gf { padding: 6px 16px 12px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.srow { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 14px 8px 16px; border: 0; background: transparent; color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer; position: relative; transition: background-color 120ms ease; }
.srow + .srow::before { content: ''; position: absolute; top: 0; left: 58px; right: 0; height: 1px; background: var(--sep); }
.srow.noi + .srow::before, .srow + .srow.noi::before { left: 16px; }
.srow:active { background: var(--glass-press); }
@media (hover: hover) and (pointer: fine) { .srow:hover { background: var(--glass-hover); } }
.srow.on { background: var(--glass-press); }
.srow:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: 12px; }
.srow .sic { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex: none; }
.srow .stx { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.srow .stx b { font-weight: 600; font-size: 15px; line-height: 1.3; color: var(--text-strong); }
.srow .stx small { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.srow .sval { flex: 0 0 auto; /* B13b: a short value ("On", "US$ 100") never shrinks to "O.."; long ones still stop at the max-width */ max-width: 46%; color: var(--muted); font-size: 14px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow .sval.on { color: var(--ok); font-weight: 600; }
.srow .schev { color: var(--faint); display: flex; flex: none; }
.stag { flex: none; display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; line-height: 1.3; }
@media (max-width: 520px) { .srow .sval { max-width: 40%; } .srow .stag { display: none; } .ai-frow .stag { white-space: normal; max-width: 46%; text-align: right; } }
.set-nav .srow .sval { display: none; }
.srow .sval.stl { display: none; font-size: 12.5px; }
@media (max-width: 520px) { .srow .sval.stl { display: block; } }

/* the icon tiles (soft tone background + its text colour) */
.sic.t-you { background: var(--purple-bg); color: var(--purple); }
.sic.t-business { background: var(--accent-bg); color: var(--accent); }
.sic.t-team { background: var(--info-bg); color: var(--info); }
.sic.t-notifications { background: var(--bad-bg); color: var(--bad); }
.sic.t-messages { background: var(--ok-bg); color: var(--ok); }
.sic.t-ai { background: var(--accent-bg-2); color: var(--accent-2); }
.sic.t-connections { background: var(--cyan-bg); color: var(--cyan); }
.sic.t-data { background: var(--warn-bg); color: var(--warn); }
.sic.t-about { background: var(--glass-2); color: var(--muted); }
.stag.tn-ok { background: var(--ok-bg); color: var(--ok); }
.stag.tn-info { background: var(--info-bg); color: var(--info); }
.stag.tn-warn { background: var(--warn-bg); color: var(--warn); }
.stag.tn-bad { background: var(--bad-bg); color: var(--bad); }
.stag.tn-purple { background: var(--purple-bg); color: var(--purple); }
.stag.tn-cyan { background: var(--cyan-bg); color: var(--cyan); }
.stag.tn-muted { background: var(--glass-2); color: var(--muted); }

/* the page header strip (source of the values + Check again) */
.set-src { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.set-src .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok-dot); flex: none; }
.set-src .dot.demo { background: var(--purple-dot); }
.set-src .dot.old { background: var(--warn-dot); }
.set-demo { padding: 10px 14px; border-radius: 14px; background: var(--purple-bg); color: var(--text); font-size: 13.5px; line-height: 1.5; }
.set-off { padding: 10px 14px; border-radius: 14px; background: var(--warn-bg); color: var(--text); font-size: 13.5px; line-height: 1.5; border: 1px solid var(--warn-line); }

/* the change sheet: current value, editor, old → new, the facts */
.set-sheet { display: flex; flex-direction: column; gap: 14px; }
.set-cur { display: flex; flex-direction: column; gap: 2px; }
.set-cur .v { font-size: 20px; font-weight: 700; color: var(--text-strong); letter-spacing: -.01em; overflow-wrap: anywhere; }
.set-diff { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; background: var(--accent-bg); border: 1px solid var(--accent-line); font-size: 15px; }
.set-diff .o { color: var(--muted); text-decoration: line-through; overflow-wrap: anywhere; }
.set-diff b { color: var(--text-strong); overflow-wrap: anywhere; }
.set-radio { display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; background: var(--glass-2); box-shadow: var(--edge); }
.set-radio button { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 14px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 15px; text-align: left; position: relative; }
.set-radio button + button::before { content: ''; position: absolute; top: 0; left: 14px; right: 0; height: 1px; background: var(--sep); }
.set-radio button .ck { margin-left: auto; color: var(--accent); display: flex; opacity: 0; }
.set-radio button[aria-pressed="true"] .ck { opacity: 1; }
.set-radio button[aria-pressed="true"] { font-weight: 600; }
.set-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; }
.set-facts span { color: var(--muted); }
.set-facts b { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.set-acts { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.set-acts .btn { min-height: 46px; }
.set-hist { display: flex; flex-direction: column; gap: 6px; }
.set-hist .row { display: flex; gap: 10px; align-items: center; }
.set-hist .row.undone { opacity: .55; }

/* AI usage */
.ai-hero .ai-big { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ai-hero .ai-big .v { font-size: clamp(34px, 7vw, 46px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; color: var(--hero-text); }
.ai-hero .ai-big .of { color: var(--hero-muted); font-size: 16px; font-weight: 600; }
.ai-hero .ai-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--hero-muted); font-size: 13.5px; }
.ai-hero .ai-tag { display: inline-flex; padding: 4px 10px; border-radius: 999px; background: var(--hero-glass); color: var(--hero-text); font-size: 12.5px; font-weight: 700; }
.ai-hero .bar { height: 10px; border-radius: 999px; background: var(--hero-track); overflow: hidden; margin: 12px 0 10px; }
.ai-hero .bar > i { display: block; height: 100%; border-radius: 999px; background: var(--hero-fill); }
.ai-feat { display: flex; flex-direction: column; gap: 0; }
.ai-frow { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 8px 0; position: relative; }
.ai-frow + .ai-frow::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--sep); }
.ai-frow .stx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ai-frow .stx b { font-size: 15px; color: var(--text-strong); font-weight: 600; }
.ai-frow .stx small { color: var(--muted); font-size: 12.5px; }
.ai-chart { width: 100%; height: 170px; display: block; }
.ai-chart .gl-line { stroke: var(--ch-grid); stroke-width: 1; }
.ai-chart .ax { fill: var(--ch-axis); font-size: 11px; }
.ai-chart .bar-m { fill: var(--ch-1); }
.ai-chart .bar-m.sel { fill: var(--accent-2); }
.ai-chart .hit { fill: transparent; cursor: pointer; }
.ai-tip { min-height: 20px; font-size: 13px; color: var(--muted); }
.ai-tip b { color: var(--text-strong); }
.ai-hbars { display: flex; flex-direction: column; gap: 10px; }
.ai-hb { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; font-size: 14px; }
.ai-hb .tr { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--ch-track); overflow: hidden; }
.ai-hb .tr > i { display: block; height: 100%; border-radius: 4px; background: var(--ch-1); }
.ai-hb .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.ai-hb .r { color: var(--text-strong); font-weight: 600; font-variant-numeric: tabular-nums; }
.ai-tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ai-tbl td, .ai-tbl th { padding: 6px 4px; border-bottom: 1px solid var(--sep); text-align: left; }
.ai-tbl td:last-child, .ai-tbl th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.ai-tbl th { color: var(--muted); font-weight: 600; }
.ai-key { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--muted); line-height: 1.5; }

@media (prefers-reduced-motion: reduce) { .srow { transition: none; } }
.set-bin-i { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none; background: var(--accent-bg); color: var(--accent); }
