/* The Settings page (core/settings-page.js, design/v5/V5Settings.dc.html): a readable column of
   sections, each a small heading over a grouped card of rows; its own sidebar holds the way back and
   the sections. Also the switch, which Settings is the first to use. */

.set-page { flex: 1; min-height: 0; overflow: auto; }
.set-col { max-width: 600px; margin: 0 auto; padding: 56px 48px; }
.set-h1 { margin: 0; color: var(--fg-strong); font-size: 22px; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; }

.set-sec { margin-top: 24px; }
.set-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 8px; padding: 0 4px; }
.set-head h2 { margin: 0; color: var(--fg); font-size: 13px; font-weight: 600; }
.set-head span { color: var(--muted); font-size: 12px; }
.set-card { padding: 0 16px; border-radius: 14px; background: var(--card); }
.set-row { display: flex; align-items: center; gap: 16px; min-height: 48px; padding: 8px 0; border-top: 1px solid var(--sep); }
.set-row:first-child { border-top-color: transparent; }
.set-words { flex: 1; min-width: 0; }
.set-title { margin: 0; color: var(--fg); font-size: 13px; }
.set-sub { margin: 2px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.set-value { flex: none; color: var(--muted); font-size: 12px; white-space: nowrap; }
.set-value.late { color: var(--drift-text); }
.set-btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.set-btn {
  display: inline-flex;
  flex: none;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 14px;
  color: var(--fg);
  font: 500 12px var(--font-ui);
  text-decoration: none;
  white-space: nowrap;
}

/* the segmented control in a row: 96 per item, 30 tall */
.set-seg { flex: none; width: 192px; height: 30px; padding: 3px; border-radius: 999px; background: var(--fill); }
.set-seg > .pill { top: 3px; bottom: 3px; }
.set-seg > button { height: 100%; padding: 0 8px; border: 0; border-radius: 999px; color: var(--muted); font: 500 12px var(--font-ui); white-space: nowrap; }
.set-seg > button[aria-selected="true"] { color: var(--fg-strong); font-weight: 600; }

/* the switch */
.switch {
  position: relative;
  flex: none;
  width: 38px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: var(--switch-off);
  transition: background-color 200ms var(--ease);
}
.switch[aria-checked="true"] { background: var(--accent); }
.switch i { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 9px; background: var(--knob); box-shadow: var(--knob-drop); transition: transform 200ms var(--sp-smooth); }
.switch[aria-checked="true"] i { transform: translateX(16px); }
.switch:disabled { opacity: .35; }

/* its sidebar */
.set-side { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.set-side .tb-fill { flex: 1; }
.set-side-head { display: flex; align-items: center; gap: 4px; height: 32px; margin: 0 0 8px; padding: 0 4px; }
.set-side-head h2 { margin: 0; color: var(--fg-strong); font-size: 15px; font-weight: 600; }
.set-back { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 14px; color: var(--fg); }
.set-nav { display: flex; flex-direction: column; }
.set-cat {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  color: var(--fg);
  font: 400 13px var(--font-ui);
  text-align: left;
  white-space: nowrap;
}
.set-cat[aria-current="page"] { color: var(--fg-strong); }
.set-ic { display: inline-flex; color: var(--muted); }
.set-cat[aria-current="page"] .set-ic { color: var(--accent-text); }
/* Ava's mark stays her own blue */
.set-ic.ava,
.set-cat[aria-current="page"] .set-ic.ava { color: var(--ava); }
.set-foot { margin: 0; padding: 8px 10px 4px; color: var(--muted); font-size: 11px; }

@media (max-width: 700px) {
  .set-col { padding: 56px 16px; }
  .set-row { flex-wrap: wrap; }
}

/* a narrow window: the sections open over the page from the sidebar's capsule, so the page clears it */
@media (max-width: 700px) {
  .app[data-chrome="none"] .app-main { padding-top: 56px; }
}

/* Settings › Shortcuts (core/settings-keys.js): a shortcut's keys as a button, and Reset beside it */
.set-keys { display: flex; flex: none; align-items: center; gap: 8px; }
.set-key {
  min-width: 72px;
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  color: var(--fg-strong);
  font: 500 12px var(--font-ui);
  white-space: nowrap;
}
.set-key.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.set-key.none { color: var(--muted); }
/* listening for keys: the focus ring's accent, as the one place keys go */
.set-key.rec { box-shadow: inset 0 0 0 2px var(--accent); color: var(--fg); }
.set-reset { height: 28px; padding: 0 8px; border: 0; border-radius: 10px; color: var(--muted); font: 500 12px var(--font-ui); }
.set-reset:disabled { opacity: .35; }
/* a key that can't change (Ava's chat keys): its keys as words, centred where a shortcut's button shows
   them (an unseen Reset keeps the column) */
.set-fixed { min-width: 72px; padding: 0 12px; box-sizing: border-box; color: var(--fg-strong); font: 500 12px var(--font-mono); text-align: center; }
.set-reset.unseen { visibility: hidden; }
.set-err { margin: 4px 0 0; color: var(--task-text); font-size: 12px; line-height: 1.4; }

/* a page inside a section (Ava › Claude API, 6a-2; design/runs/6/AvaMemoryWork): it slides in from the
   side it lives on, 24 px and fading */
@keyframes set-fwd { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes set-bwd { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
.set-fwd { animation: set-fwd 300ms var(--sp-smooth) both; }
.set-bwd { animation: set-bwd 300ms var(--sp-smooth) both; }
@media (prefers-reduced-motion: reduce) {
  .set-fwd,
  .set-bwd { animation: none; }
}
.set-up { display: inline-flex; align-items: center; gap: 2px; height: 28px; margin: 0 0 8px -10px; padding: 0 10px 0 6px; border: 0; border-radius: 14px; color: var(--accent-text); font: 13px var(--font-ui); }
.set-up[hidden] { display: none; }
.set-meta { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
/* a row that opens a page: the whole row is the button */
.set-tw { margin: 0 -8px; padding: 0 8px; border-radius: 10px; }
.set-open { width: 100%; margin: 0; border-right: 0; border-bottom: 0; border-left: 0; background: transparent; color: inherit; font: inherit; text-align: left; }
.set-open .set-title,
.set-open .set-sub { display: block; }
.set-chev { display: inline-flex; flex: none; color: var(--faint); }
.set-tile { display: inline-grid; flex: none; place-items: center; width: 28px; height: 28px; margin-right: -4px; border-radius: 8px; background: var(--fill); color: var(--muted); }
/* the Claude API page: this month's spend */
.set-pad { padding: 16px; }
.set-spend { display: flex; align-items: baseline; gap: 8px; margin: 0; }
.set-big { color: var(--fg-strong); font-size: 34px; font-weight: 600; line-height: 1.1; }
.set-of { color: var(--muted); font-size: 13px; }
.set-meter { height: 6px; margin-top: 12px; overflow: hidden; border-radius: 3px; background: var(--fill); }
.set-meter i { display: block; width: 0; height: 100%; border-radius: 3px; background: var(--good); }
.set-state { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; font-size: 12px; }
.set-state.good { color: var(--good-text); }
.set-state.warn { color: var(--task-text); }
.set-state.drift { color: var(--drift-text); }
.set-rule { margin-top: 8px; }
.set-bars { display: flex; align-items: flex-end; gap: 6px; height: 104px; border-bottom: 1px solid var(--sep); }
.set-bar { display: flex; flex: 1; flex-direction: column-reverse; height: 100%; overflow: hidden; border-radius: 3px 3px 0 0; transition: opacity 120ms var(--ease); }
.set-bar i { display: block; flex: none; width: 100%; }
.set-bar.none::after { display: block; flex: none; height: 2px; background: var(--bar-zero); content: ""; }
@media (hover: hover) {
  .set-bars:hover .set-bar { opacity: .5; }
  .set-bars .set-bar:hover { opacity: 1; }
}
.set-axis { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: 11px; }
.set-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; color: var(--muted); font-size: 11px; }
.set-legend span { display: inline-flex; align-items: center; gap: 6px; }
.set-legend i { width: 8px; height: 8px; border-radius: 2px; }
.set-dot { flex: none; width: 10px; height: 10px; border-radius: 3px; }
.set-amt { width: 48px; flex: none; color: var(--fg-strong); font-size: 13px; text-align: right; }
/* Ava's memory (6b-1; design/runs/6/AvaMemoryWork): the topic rows, search, a topic's facts */
.set-tw + .set-tw .set-row,
.set-tw + .set-row,
.set-row + .set-tw .set-row { border-top-color: var(--sep); }
.set-n { flex: none; color: var(--muted); font-size: 12px; }
.set-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-muted { color: var(--muted); }
.set-search { display: flex; align-items: center; gap: 8px; height: 32px; margin: 0 0 8px; padding: 0 10px; box-sizing: border-box; border-radius: 10px; background: var(--fill); color: var(--muted); }
.set-search input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: none; background: transparent; color: var(--fg-strong); font: 13px var(--font-ui); }
.set-search input::placeholder { color: var(--placeholder); }
.set-search:focus-within { box-shadow: 0 0 0 2px var(--accent); }
/* a fact: its words, where it came from; edit and delete on hover */
.set-fact .acts { display: flex; gap: 2px; opacity: 0; transition: opacity 120ms var(--ease); }
.set-fact:hover .acts,
.set-fact:focus-within .acts { opacity: 1; }
@media (hover: none) {
  .set-fact .acts { opacity: 1; }
}
.set-icb { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 14px; color: var(--muted); }
.set-new { margin-left: 6px; padding: 1px 6px; border-radius: 6px; background: var(--good-soft); color: var(--good-text); font-size: 11px; font-weight: 500; }
.set-in { flex: 1; min-width: 0; height: 28px; padding: 0 10px; box-sizing: border-box; border: 1px solid var(--accent); border-radius: 10px; outline: none; background: transparent; box-shadow: 0 0 0 3px var(--accent-soft); color: var(--fg-strong); font: 13px var(--font-ui); }
/* (button.b's own transparent background would win over a class alone) */
button.set-pri { flex: none; height: 28px; padding: 0 12px; border: 0; border-radius: 14px; background: var(--pri); color: var(--pri-fg); font: 500 12px var(--font-ui); }
@media (hover: hover) {
  button.set-pri:hover { background: var(--pri-hover); }
}
.set-btn.danger { color: var(--drift-text); }
