/* css/screens.css — per-screen families: auth, wizard, review + file tree,
   project progress, settings, admin. */

.bit-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin: -8px 0 var(--s-2) -6px;
  padding: 0 6px;
  color: var(--ink-muted);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--r-md);
}
.bit-back:active { background: var(--bg-2); }

/* ── Auth (auth-ui.md, verbatim classes) ───────────────────────────────────── */
.bit-auth { max-width: 400px; margin: 4vh auto 0; }
.bit-auth__brand { display: flex; flex-direction: column; align-items: center; gap: var(--s-3); margin-bottom: var(--s-5); }
.bit-auth__logo svg { width: 56px; height: 56px; color: var(--accent); }
.bit-auth__brand h1 { font-size: 24px; font-weight: 750; }
.bit-auth__card {
  padding: var(--s-5);
  border-radius: var(--r-lg);
  border: 1px solid var(--card-border);
  background: var(--bg-1);
  box-shadow: var(--sh-2);
}
.bit-auth__mode { display: flex; justify-content: center; margin-bottom: var(--s-4); }
.bit-auth__submit { width: 100%; margin-top: var(--s-2); }
.bit-auth__welcome { display: flex; align-items: center; justify-content: center; min-height: 44px; margin-top: var(--s-4); color: var(--ink-muted); font-size: 14px; }
@media (display-mode: standalone) { .welcome-link { display: none; } }

.auth-oauth-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 44px;
  background: var(--bg-1); color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 11px 16px; font-size: 15px; font-weight: 600;
  cursor: pointer; margin-bottom: 10px;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.auth-oauth-btn:active:not(:disabled) { transform: translateY(1px); }
.auth-oauth-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.auth-oauth-logo { width: 18px; height: 18px; flex-shrink: 0; }
@media (hover: hover) {
  .auth-oauth-btn:hover:not(:disabled) { background: var(--bg-2); border-color: var(--line-strong); }
}
.auth-divider { display: flex; align-items: center; text-align: center; margin: 18px 0 16px; color: var(--ink-muted); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.auth-divider span { padding: 0 12px; }

/* ── Wizard ────────────────────────────────────────────────────────────────── */
.bit-stepper { display: flex; gap: var(--s-2); list-style: none; margin: 0 0 var(--s-5); padding: 0; overflow-x: auto; scrollbar-width: none; }
.bit-stepper__item { flex: 1 1 0; min-width: 0; }
.bit-stepper__item > a, .bit-stepper__item > span {
  display: flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 10px;
  border-bottom: 3px solid var(--line);
  color: var(--ink-faint); font-weight: 600; font-size: 14px; text-decoration: none;
}
.bit-stepper__item > a { color: var(--ink-muted); }
.bit-stepper__item > a:active { background: var(--bg-2); }
.bit-stepper__item.is-now > span { color: var(--ink); border-bottom-color: var(--accent); }
.bit-stepper__num {
  display: inline-grid; place-items: center; flex: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg-2); font-size: 12px;
}
.bit-stepper__item.is-now .bit-stepper__num { background: var(--accent-fill); color: var(--on-accent); }
.bit-stepper__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bit-wz__form { max-width: 620px; }
.bit-wz__group { margin-bottom: var(--s-6); }
.bit-wz__group-title { display: flex; align-items: center; gap: var(--s-2); font-size: 17px; font-weight: 700; margin-bottom: var(--s-3); }
.bit-wz__none { color: var(--ink-muted); }
.bit-wz__foot {
  display: flex; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap;
  margin-top: var(--s-6); padding-top: var(--s-4); border-top: 1px solid var(--line);
}

/* Review */
.bit-review { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.bit-review__card { padding: var(--s-4); border-radius: var(--r-lg); border: 1px solid var(--card-border); background: var(--bg-1); min-width: 0; }
.bit-review__card--wide { grid-column: 1 / -1; }
.bit-review__card header { display: flex; align-items: center; justify-content: space-between; margin: -6px 0 var(--s-2); }
.bit-review__card h2 { font-size: 15px; font-weight: 700; }
.bit-review__card dl { margin: 0; display: grid; gap: var(--s-2); }
.bit-review__kv { display: grid; grid-template-columns: 96px 1fr; gap: var(--s-3); }
.bit-review__kv dt { color: var(--ink-muted); font-size: 13.5px; }
.bit-review__kv dd { margin: 0; display: flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.bit-review__kv dd .bit-sprite { color: var(--accent-ink); }
.bit-review__addons { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); column-gap: var(--s-4); }
.bit-review__none { margin: 0; color: var(--ink-muted); }

/* File tree */
.bit-tree { border-radius: var(--r-lg); border: 1px solid var(--card-border); background: var(--bg-1); overflow: hidden; }
.bit-tree--loading { padding: var(--s-4); }
.bit-tree__head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2) var(--s-3); padding: var(--s-2) var(--s-4); border-bottom: 1px solid var(--line); }
.bit-tree__title { font-weight: 700; }
.bit-tree__tools { margin-left: auto; display: flex; gap: 4px; }
.bit-tree__body { padding: var(--s-2) var(--s-2) var(--s-3); font-family: var(--font-mono); font-size: 13px; max-height: 560px; overflow: auto; overscroll-behavior: contain; }
.bit-tree__list { list-style: none; margin: 0; padding: 0 0 0 18px; }
.bit-tree__body > .bit-tree__list { padding-left: 0; }
.bit-tree__summary {
  display: flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 8px; border-radius: var(--r-sm);
  cursor: pointer; list-style: none; color: var(--ink);
}
.bit-tree__summary::-webkit-details-marker { display: none; }
.bit-tree__summary:active { background: var(--bg-2); }
.bit-tree__summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.bit-tree__caret { width: 14px; height: 14px; color: var(--ink-faint); transition: transform 0.15s; }
details[open] > .bit-tree__summary .bit-tree__caret { transform: rotate(90deg); }
.bit-tree__icon { width: 16px; height: 16px; color: var(--ink-muted); }
.bit-tree__summary .bit-tree__icon { color: var(--accent-ink); }
.bit-tree__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bit-tree__count { margin-left: auto; color: var(--ink-faint); font-size: 12px; }
.bit-tree__file { display: flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 8px 0 30px; color: var(--ink-muted); }
.bit-tree__size { margin-left: auto; padding-left: var(--s-3); color: var(--ink-faint); font-size: 12px; white-space: nowrap; }
@media (hover: hover) { .bit-tree__summary:hover { background: var(--bg-2); } }

/* ── Project progress ──────────────────────────────────────────────────────── */
.bit-pj__head { margin-bottom: var(--s-2); }
[data-view="project"] .bit-pcard__chips { margin: var(--s-3) 0 var(--s-5); }
[data-view="project"] .bit-section > h2 { font-size: 17px; font-weight: 700; margin-bottom: var(--s-3); }
.bit-steps { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); list-style: none; margin: 0 0 var(--s-4); padding: 0; }
.bit-steps__item { display: flex; align-items: center; gap: 8px; color: var(--ink-faint); font-weight: 600; font-size: 14px; }
.bit-steps__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.bit-steps__item.is-done { color: var(--ink-muted); }
.bit-steps__item.is-done .bit-steps__dot { background: var(--ok); }
.bit-steps__item.is-now { color: var(--ink); }
.bit-steps__item.is-now .bit-steps__dot { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-quiet); }
.bit-steps__item.is-failed { color: var(--rust); }
.bit-steps__item.is-failed .bit-steps__dot { background: var(--rust); }

.bit-timeline { list-style: none; margin: 0; padding: 0; }
.bit-timeline__empty { color: var(--ink-muted); }
.bit-tl { position: relative; display: flex; gap: var(--s-3); padding-bottom: var(--s-4); animation: fadeUp 200ms var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
.bit-tl:not(:last-child)::before { content: ""; position: absolute; left: 11px; top: 26px; bottom: 2px; width: 2px; background: var(--line); }
.bit-tl__dot { flex: none; display: grid; place-items: center; width: 24px; height: 24px; color: var(--ok); }
.bit-tl__dot svg { width: 22px; height: 22px; }
.bit-tl--warn .bit-tl__dot { color: var(--warn); }
.bit-tl--error .bit-tl__dot { color: var(--rust); }
.bit-tl--live .bit-tl__dot { color: var(--accent-ink); }
.bit-tl__body { flex: 1; min-width: 0; padding: 2px 0 0; }
.bit-tl__meta { display: flex; gap: var(--s-3); align-items: baseline; font-size: 12.5px; color: var(--ink-faint); }
.bit-tl__step { font-family: var(--font-mono); color: var(--ink-muted); }
.bit-tl__msg { margin: 2px 0 0; overflow-wrap: anywhere; }
.bit-tl--warn .bit-tl__msg { color: var(--warn); }
.bit-tl--error .bit-tl__msg { color: var(--rust); }

.bit-next { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); }
.bit-next__item { display: flex; gap: var(--s-3); padding: var(--s-4); border-radius: var(--r-lg); border: 1px solid var(--card-border); background: var(--bg-1); }
.bit-next__num { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-quiet); color: var(--accent-ink); font-weight: 700; font-size: 14px; }
.bit-next__body { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-2); justify-items: start; }
.bit-next__label { font-weight: 700; }
.bit-next__text { margin: 0; color: var(--ink-muted); }
.bit-cmd { display: flex; align-items: center; gap: var(--s-2); width: 100%; padding: 2px 2px 2px 12px; border-radius: var(--r-md); background: var(--well); border: 1px solid var(--line); }
.bit-cmd code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; padding: 8px 0; scrollbar-width: thin; }

/* ── Settings ──────────────────────────────────────────────────────────────── */
.bit-set { margin-bottom: var(--s-5); max-width: 720px; }
.bit-set__title { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); margin: 0 0 var(--s-2) 4px; }
.bit-set__card { border-radius: var(--r-lg); border: 1px solid var(--card-border); background: var(--bg-1); padding: 0 var(--s-4); }
.bit-set__card > .bit-skel-list, .bit-set__card > .bit-state { padding: var(--s-4) 0; }
.bit-set__row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s-3); min-height: 56px; padding: var(--s-2) 0; }
.bit-set__row + .bit-set__row { border-top: 1px solid var(--line); }
.bit-set__label { display: grid; font-weight: 600; }
.bit-set__sub { color: var(--ink-muted); font-weight: 400; font-size: 13px; }
.bit-set__value { color: var(--ink-muted); overflow-wrap: anywhere; min-width: 0; }
.bit-set__link { color: var(--ink); text-decoration: none; }
.bit-set__link svg { width: 18px; height: 18px; color: var(--ink-faint); }
.bit-set__link:active { background: var(--bg-2); }
.bit-set__actions { justify-content: flex-start; }
.bit-set__inset { margin: 0 0 var(--s-2); }
.bit-scopes { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── Admin catalog ─────────────────────────────────────────────────────────── */
.bit-adm__list { display: grid; gap: var(--s-3); }
[data-view="admin-catalog"] .bit-section { margin-top: var(--s-5); }
[data-view="admin-catalog"] .bit-section > h2 { font-size: 17px; font-weight: 700; margin-bottom: var(--s-3); }
.bit-adm__ctl { display: flex; justify-content: flex-start; }
