/* The Settings page (/settings): Accounts, Usage & billing, Team, General. Built on /brand.css and /app.css (the shell, ax-*).
   Colour: green = ready, amber = out of credit / needs you. Nothing else is coloured. */
[hidden] { display: none !important; }
.st-tabs { margin: -8px 0 24px; }
.st-panel > * + * { margin-top: 12px; }
.st-head p { margin: 0 0 4px; color: var(--muted); font-size: 13.5px; }
.tm > .st-head { margin-bottom: 16px; }
.st-wait { color: var(--faint); font-size: 13px; }
.st-err { color: var(--amber); font-size: 13.5px; }
.st-note { margin: 10px 0 0; color: var(--faint); font-size: 12.5px; }

/* ---------- accounts: one card per tool, one row per account (email, state, 5-hour and weekly usage) */
#settings { max-width: 920px; }
/* the accounts column reads best narrower (Linear/Vercel settings): every right-side control on one edge, 18px in */
#settings .st-panel { max-width: 880px; }
#settings .st-panel:not(:has(.st-tool)) { max-width: 640px; }
.st-tools { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.st-accounts-head, .st-accounts-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.st-accounts-head { justify-content: space-between; }
.st-accounts-head h2 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.st-accounts-actions > .ax-btn { min-height: 40px; }
.st-tool { overflow: visible; }
.st-t3-account { margin-block: 12px; }
.st-t3-account .st-note { margin: 0; padding: 0 18px 12px; }
.st-tool .ax-card-h { padding: 10px 18px 10px 18px; min-height: 50px; }
.st-tool h3 { display: flex; align-items: center; gap: 8px; }
.st-tool h3 .n { font: 400 12px var(--mono); color: var(--faint); }
.st-tool .ax-card-h .ax-btn { color: var(--muted); }
.st-tool .ax-card-h .ax-btn:hover { color: var(--text); }
.st-acc { display: grid; grid-template-columns: 7px minmax(0, 1fr) minmax(0, 290px) 30px; column-gap: 14px; align-items: start;
  padding: 14px 18px 14px 18px; border-bottom: 1px solid var(--line); }
.st-rows > .st-acc:last-child { border-bottom: 0; }
.st-acc > .ax-dot { align-self: start; margin-top: 7px; }
.st-acc .t { min-width: 0; }
.st-acc .t b { display: block; font-weight: 500; font-size: 13.5px; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-acc .meta { display: block; color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.st-acc .meta span + span::before, .st-gen .meta span + span::before { content: "\00b7"; margin: 0 6px; color: var(--faint); }
.st-acc .meta .warn { color: var(--amber); }
.st-acc .meta span { white-space: nowrap; }
.st-acc .st-more { grid-column: 4; justify-self: end; align-self: start; margin-top: -5px; }
/* usage: label, a 4px bar, "42% · resets 14:00". White fill; amber at 80% and over; muted when the values are old */
.st-use { min-width: 0; }
.st-use .w { display: grid; grid-template-columns: 50px minmax(48px, 1fr) auto; align-items: center; column-gap: 10px; font-size: 12px; line-height: 18px; }
.st-use .w + .w { margin-top: 4px; }
.st-use .l { color: var(--faint); }
.st-use .v { color: var(--muted); white-space: nowrap; text-align: right; width: 132px; }
.st-use .v b { font-weight: 400; font-size: 11.5px; color: var(--text); }
.st-use .rs { color: var(--faint); }
.st-use-na { margin: 0; color: var(--faint); font-size: 12px; line-height: 18px; }
.st-use .w + .st-use-na { margin-top: 4px; }
.st-use.stale .st-bar i { background: var(--ghost, #3a413d); }
.st-use.stale .v b { color: var(--muted); }
.st-bar { display: block; height: 4px; border-radius: 2px; background: rgba(255,255,255,.08); overflow: hidden; }
.st-bar i { display: block; height: 100%; border-radius: 2px; background: var(--text); }
.st-bar.warn i { background: var(--amber); }
.st-on { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--muted); font-size: 12.5px; }
.st-more { position: relative; flex: none; }
.st-menu { position: absolute; right: 0; top: 34px; z-index: 10; min-width: 140px; padding: 5px; border-radius: 10px; border: 1px solid var(--line2);
  background: #0d1110; box-shadow: 0 16px 40px -12px rgba(0,0,0,.8); }
.st-menu .ax-btn { width: 100%; justify-content: flex-start; height: 32px; border: 0; background: none; color: var(--muted); font-weight: 400; }
.st-menu .ax-btn:hover { background: rgba(255,255,255,.06); color: var(--text); }
.st-menu .ax-btn.danger { color: var(--muted); }
.st-menu .ax-btn.danger:hover { color: var(--text); }

.st-switches, .st-gen { overflow: hidden; }
.st-rest-h { padding: 12px 18px; font: 600 14.5px var(--sans); letter-spacing: -0.01em; border-bottom: 1px solid var(--line); }
/* a signed-out account: its own "Sign in again" in the usage column; armed inline confirms are amber (needs you) */
.st-acc .st-again { grid-column: 3; justify-self: end; align-self: start; margin-top: -5px; }
.st-menu .ax-btn.arm, .st-menu .ax-btn.arm:hover, .tm .mr .ax-btn.arm { color: var(--amber); }
/* rename in place */
.st-ren { display: flex; gap: 8px; align-items: center; flex: 1 1 100%; min-width: 0; margin: -5px 0 2px; }
.st-ren .b-input { flex: 1; min-width: 0; min-height: 30px; height: 30px; padding: 0 10px; font-size: 13.5px; }

/* settings rows and the switch */
.st-set { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.st-set:last-child { border-bottom: 0; }
.st-set .t { flex: 1; min-width: 0; }
.st-set .t b { display: block; font-weight: 500; font-size: 13.5px; }
.st-set .t small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.st-set .t small .nw { white-space: nowrap; }
.st-sw { position: relative; flex: none; width: 36px; height: 20px; padding: 0; border-radius: 999px; border: 1px solid var(--line3);
  background: rgba(255,255,255,.05); cursor: pointer; transition: background .15s, border-color .15s; }
.st-sw i { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.st-sw[aria-checked="true"] { background: var(--text); border-color: var(--text); }
.st-sw[aria-checked="true"] i { transform: translateX(16px); background: #070908; }
.st-sw:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.st-sw:disabled { opacity: .6; cursor: default; }

/* ---------- usage and plans */
.us { position: relative; padding: 22px 24px; }
.us-top small { display: block; color: var(--muted); font-size: 12.5px; }
.us-top b { display: block; margin-top: 4px; font-size: 26px; font-weight: 500; letter-spacing: -0.02em; color: var(--text); }
.us-top b span { font-size: 13px; color: var(--muted); letter-spacing: 0; }
.us-graph { --plot-height: 144px; display: grid; grid-template: var(--plot-height) auto / max-content minmax(0, 1fr);
  column-gap: 12px; margin: 32px 0 0; }
.us-axis { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; grid-area: 1 / 1;
  height: calc(100% + 1.4em); transform: translateY(-.7em); color: var(--muted); font: 11px/1.4 var(--mono); }
.us-grid { position: relative; grid-area: 1 / 2; border-block: 1px solid var(--line2); }
.us-grid::before { content: ""; position: absolute; inset: 50% 0 auto; border-top: 1px solid var(--line); }
.us-columns { grid-area: 1 / 2 / span 2; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin: 0; }
.us-column { display: flex; flex-direction: column-reverse; justify-content: flex-end; text-align: center; }
.us-column dt { margin-top: 8px; color: var(--muted); font-size: 12.5px; }
.us-column dd { position: relative; height: var(--plot-height); margin: 0; }
.us-column dd::before { content: ""; position: absolute; bottom: 1px; left: 50%; transform: translateX(-50%);
  width: clamp(36px, 50%, 110px); height: var(--bar-height); background: var(--faint); border-radius: 3px 3px 0 0; }
.us-column.used dd::before { background: var(--text); }
.us-column.used.warn dd::before { background: var(--amber); }
.us-column dd span { position: absolute; bottom: calc(var(--bar-height) + 4px); inset-inline: 0; font-size: 12px; color: var(--text); }
.us-dl { display: flex; gap: 40px; flex-wrap: wrap; margin: 20px 0 0; }
.us-dl dt { color: var(--muted); font-size: 12.5px; }
.us-dl dd { margin: 3px 0 0; font-size: 14px; color: var(--text); }
.us-foot { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.us-foot .nw { white-space: nowrap; }
.us-act { position: absolute; top: 20px; right: 22px; }
.us-plans { margin-top: 28px !important; }
.us-plans h3 { margin: 0 0 12px; font: 600 15px var(--sans); letter-spacing: -0.01em; }
.us-prow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.us-plan { padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.us-plan h4 { margin: 0 0 3px; font-size: 15px; font-weight: 600; }
.us-plan .pr { font-size: 22px; letter-spacing: -0.02em; }
.us-plan .pr small { font: 12.5px var(--sans); color: var(--muted); }
.us-plan .hrs { color: var(--muted); font-size: 12.5px; }
.us-plan-details { display: grid; gap: 8px; margin: 12px 0; padding-top: 12px; border-top: 1px solid var(--line); }
.us-plan-details > div { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; font-size: 12px; }
.us-plan-details dt { color: var(--muted); }
.us-plan-details dd { margin: 0; text-align: end; }
.us-plan .ax-btn, .us-plan .cur-l { margin-top: auto; align-self: flex-start; }
.us-plan .hrs + .ax-btn, .us-plan .hrs + .cur-l { margin-top: 10px; }
.us-plan .cur-l { font-size: 12.5px; line-height: 30px; }
.us-plan.cur { border-color: var(--line3); }

/* ---------- team (kit teammates) */
.tm .inv { display: flex; gap: 8px; margin-top: 4px; }
.tm .inv .b-input { flex: 1; min-width: 0; min-height: 40px; font-size: 14px; }
.tm .inv .ax-btn { height: 40px; }
.inv-link { margin-top: 12px; padding: 14px 16px; }
.kr-key { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 12px; border-radius: 10px; border: 1px solid var(--line2); background: #070908; }
.kr-key code { flex: 1; min-width: 0; font: 12.5px/1.5 var(--mono); color: var(--text); overflow-wrap: anywhere; }
.kr-warn { display: flex; gap: 10px; align-items: baseline; margin: 10px 0 0; color: var(--muted); font-size: 12.5px; }
.tm .mem { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); overflow: hidden; }
.tm .mr { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); }
.tm .mr:last-child { border-bottom: 0; }
.tm .av { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--raised);
  border: 1px solid var(--line2); font: 600 10.5px var(--mono); color: var(--muted); }
.tm .av.dash { border-style: dashed; background: transparent; color: var(--faint); }
.tm .mr .t { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm .mr.pend .t { color: var(--muted); font-weight: 400; }
.tm .mr .t .you { color: var(--faint); font-weight: 400; }
.tm .mr .t small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; white-space: normal; }
.tm .mr .role { color: var(--muted); font-size: 12.5px; line-height: 20px; padding-right: 11px; }
.tm .mr.own { align-items: center; }
.tm .mr .t small .nw { white-space: nowrap; }

@media (max-width: 860px) {
  .st-tabs { margin: -4px -16px 18px; padding: 0 8px; }
  .us { padding: 18px; }
  .us-prow { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .st-tabs { gap: 0; }
  .st-tabs a { padding-left: 8px; padding-right: 8px; font-size: 13px; }
  .st-set { align-items: flex-start; }
  .st-set .st-sw { margin-top: 2px; }
  .tm .mr .ax-btn { padding: 0 8px; }
  .tm .mr .role { padding-right: 8px; }
}
/* small phones: a teammate's action goes under its name, so the name and the meta get the full width */
@media (max-width: 400px) {
  .tm .mr { flex-wrap: wrap; row-gap: 2px; }
  .tm .mr:has(> .ax-btn) .t { flex: 1 1 calc(100% - 42px); }
  .tm .mr > .ax-btn { margin-left: 34px; height: 26px; }
}
/* advanced: API keys link, a model API key (provider select, key, name) */
.st-adv { overflow: hidden; }
.st-mkey-w { padding: 0 18px 18px; }
.st-adv .st-set:has(+ .st-mkey-w:not([hidden])) { border-bottom: 0; padding-bottom: 12px; }
.st-mkey .acts { display: flex; gap: 6px; }
.st-mkey .acts .ax-btn { height: 38px; }
.st-mkey { grid-template-columns: 180px 1.4fr 1fr auto; }
.st-mkey input.mono::placeholder { font-family: var(--sans); }
.st-selw { position: relative; display: block; }
.st-selw::after { content: ""; position: absolute; right: 12px; top: 50%; width: 5px; height: 5px; pointer-events: none;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: translateY(-70%) rotate(45deg); }
.st-sel { appearance: none; -webkit-appearance: none; width: 100%; min-height: 38px; padding-right: 30px; font-size: 13.5px; cursor: pointer; }
.st-sel:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.st-sel option { background: #0d1110; color: var(--text); }
.st-gen .meta span { white-space: nowrap; }

/* tablets and phones: the usage goes under the email, full width */
@media (max-width: 720px) {
  .st-acc { grid-template-columns: 7px minmax(0, 1fr) 30px; row-gap: 10px; padding: 14px 8px 14px 16px; }
  .st-acc .st-use { grid-column: 2 / 4; grid-row: 2; padding-right: 10px; }
  .st-acc .st-more { grid-column: 3; grid-row: 1; }
  .st-acc .st-again { grid-column: 2; grid-row: 2; justify-self: start; margin-top: 0; }
  .st-tool .ax-card-h { padding-left: 16px; padding-right: 16px; }
  .st-acc { padding-right: 16px; }
  .st-acc.renaming .t { grid-column: 2 / -1; }
  .st-rest-h { padding-left: 16px; padding-right: 16px; }
  .st-tool .ax-card-h .ax-btn { min-height: 40px; }
}
/* phones: renaming, the field gets its own full-width row, Save and Cancel under it */
@media (max-width: 480px) {
  .st-ren { flex-wrap: wrap; }
  .st-ren .b-input { flex: 1 1 100%; }
}
@media (max-width: 560px) {
  .us-act { position: static; margin-top: 16px; }
  .us-dl { gap: 24px; }
  .us-top b { font-size: 22px; }
  .us-graph { --plot-height: 120px; }
  .st-mkey { grid-template-columns: 1fr; }
  .st-mkey-w { padding: 0 16px 16px; }
  .st-gen .meta span { display: block; }
  .st-gen .meta span + span::before { content: none; }
}
@media (max-width: 400px) {
  /* five tabs inside the 16px gutter at 320 (the row scrolls rather than touch the edge if a label grows) */
  .st-tabs { padding: 0 10px; scroll-padding: 0 16px; }
  .st-tabs a { flex: none; padding-left: 6px; padding-right: 6px; }
  .st-tabs .on::after { left: 6px; right: 6px; }
  /* small phones: label and value on one line, the bar under them at full width */
  .st-use .w { grid-template-columns: auto auto; row-gap: 5px; }
  .st-use .w + .w { margin-top: 10px; }
  .st-use .st-bar { grid-column: 1 / -1; grid-row: 2; }
  .st-use .v { width: auto; }
  .st-acc .meta span { display: block; }
  .st-acc .meta span + span::before { content: none; }
}
