/* Dashboard (app.html): gate, shell (sidebar / top tabs), and the six views. On top of tokens.css + ui.css. */

:root {
  --sidebar-w: 248px;
  --content-w: 760px;
  --content-wide: 1040px;
  --bar-bg: rgba(245, 245, 247, 0.84);
  --q-fill: rgba(118, 118, 128, 0.08);
  --q-fill-hover: rgba(118, 118, 128, 0.13);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bar-bg: rgba(0, 0, 0, 0.8);
    --q-fill: rgba(118, 118, 128, 0.2);
    --q-fill-hover: rgba(118, 118, 128, 0.28);
  }
}

body.app { background: var(--bg-grouped); min-height: 100dvh; }

/* Boot (only visible if loading is slow) */
.boot { position: fixed; inset: 0; display: grid; place-items: center; }
.boot img { width: 44px; height: 44px; border-radius: 10px; opacity: 0; animation: boot-in 300ms var(--ease) 500ms forwards; }
@keyframes boot-in { to { opacity: 1; } }

.link-btn { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; border-radius: 2px; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-btn:disabled { opacity: 0.5; }

/* ================================================================= Gate */
.gate {
  min-height: 100dvh; display: grid; place-items: center; align-content: center; gap: var(--s6);
  padding: calc(var(--s12) + var(--safe-t)) max(var(--s5), var(--safe-r)) calc(var(--s12) + var(--safe-b)) max(var(--s5), var(--safe-l));
}
.gate-card { width: 100%; max-width: 440px; padding: var(--s10) var(--s10) var(--s8); border-radius: 20px; background: var(--surface); }
@media (prefers-color-scheme: dark) { .gate-card { box-shadow: 0 0 0 1px var(--hairline); } }
.gate-logo { width: 52px; height: 52px; border-radius: 12px; margin-bottom: var(--s6); }
@media (prefers-color-scheme: dark) { .gate-logo { box-shadow: 0 0 0 1px var(--hairline-strong); } }
.gate-step { display: grid; gap: var(--s5); }
.gate-head { display: grid; gap: var(--s2); }
.gate-head h1:focus { outline: none; }
.gate-lede { font: var(--t-body); color: var(--text-2); }
.gate-foot { font: var(--t-subhead); color: var(--text-2); }
.gate-back { justify-self: start; margin: calc(-1 * var(--s2)) 0 0 calc(-1 * var(--s3)); color: var(--text-2); }
.gate-about { font: var(--t-subhead); color: var(--text-2); text-decoration: none; padding: var(--s2); border-radius: 6px; }
.gate-about:hover { color: var(--text); }
@media (max-width: 480px) {
  .gate { align-content: start; padding-top: calc(var(--s8) + var(--safe-t)); }
  .gate-card { padding: var(--s8) var(--s6) var(--s6); }
}

.profile-list { border: 1px solid var(--hairline); border-radius: var(--r-lg); background: var(--surface); }
@media (prefers-color-scheme: dark) { .profile-list { background: var(--surface-2); border-color: transparent; } }
.profile-row { cursor: pointer; min-height: 60px; gap: var(--s3); }
.profile-row:hover { background: var(--row-hover); }
.profile-row input { position: absolute; opacity: 0; pointer-events: none; }
.profile-row .row-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radio-mark {
  display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--hairline-strong); color: transparent;
}
.radio-mark svg { width: 12px; height: 12px; }
.profile-row input:checked ~ .radio-mark { background: var(--accent); box-shadow: none; color: #fff; }
@media (prefers-color-scheme: dark) { .profile-row input:checked ~ .radio-mark { color: #000; } }
.profile-row:has(input:focus-visible) { outline: 2px solid var(--ring); outline-offset: -2px; border-radius: inherit; }
.profile-row:first-child { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.profile-row:last-child { border-radius: 0 0 var(--r-lg) var(--r-lg); }
.profile-row:only-child { border-radius: var(--r-lg); }

.avatar {
  display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%;
  background: var(--fill-strong); color: var(--text); font: 600 12px/1 var(--font); letter-spacing: 0.02em;
}

/* ================================================================= Shell */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100dvh; }
/* Sidebar surface runs the full height while its contents stay put */
.shell::before {
  content: ""; position: fixed; z-index: 0; inset: 0 auto 0 0; width: var(--sidebar-w);
  background: var(--surface); box-shadow: inset -1px 0 0 var(--hairline); pointer-events: none;
}

.sidebar {
  position: sticky; top: 0; height: 100dvh; overflow-y: auto;
  display: flex; flex-direction: column; gap: var(--s1);
  padding: calc(var(--s4) + var(--safe-t)) var(--s3) calc(var(--s3) + var(--safe-b)) max(var(--s3), var(--safe-l));
  z-index: 1;
}
.brand { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; font: 600 16px/1 var(--font); letter-spacing: -0.01em; color: var(--text); text-decoration: none; border-radius: 8px; }
.sidebar .brand { min-height: 44px; padding: 0 var(--s2); margin-bottom: var(--s4); }

.side-nav { display: grid; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px;
  border-radius: 8px; color: var(--text); text-decoration: none; font: 500 14px/1.2 var(--font);
  transition: background-color var(--dur) var(--ease);
}
.side-nav a svg { width: 20px; height: 20px; color: var(--text-2); flex: none; }
.side-nav a:hover { background: var(--row-hover); }
.side-nav a[aria-current="page"] { background: var(--fill); font-weight: 600; }
.side-nav a[aria-current="page"] svg { color: var(--accent); }
.side-nav a:focus-visible { outline-offset: -2px; }
.nav-label { flex: 1; min-width: 0; }
.nav-count { font: 500 12px/1 var(--font); font-variant-numeric: tabular-nums; color: var(--text-2); }
.nav-count.attention {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--fill-strong); color: var(--text); font-weight: 600;
}
@media (pointer: coarse) { .side-nav a { min-height: var(--tap); } }

.side-foot { margin-top: auto; display: grid; gap: var(--s1); padding-top: var(--s3); box-shadow: inset 0 1px 0 var(--hairline); }
.ext-status {
  display: flex; align-items: center; gap: var(--s2); min-height: 32px; padding: 0 10px; border-radius: 8px;
  font: var(--t-footnote); color: var(--text-2); text-decoration: none;
}
.ext-status:hover { background: var(--row-hover); color: var(--text); }
.ext-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.ext-status.on .ext-dot { background: var(--accent); }
.profile-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: var(--s2) 10px;
  border: 0; border-radius: 10px; background: transparent; text-align: left; color: var(--text);
}
.profile-btn:hover, .profile-btn[aria-expanded="true"] { background: var(--row-hover); }
.profile-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.profile-name { font: 600 14px/1.2 var(--font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-txt small { font: var(--t-footnote); color: var(--text-2); }
.profile-chev svg { width: 16px; height: 16px; color: var(--text-2); }

.topbar { display: none; }

.view { min-width: 0; padding: var(--s10) var(--s12) var(--s24); outline: none; container-type: inline-size; }
.page { max-width: var(--content-w); }
.page-wide { max-width: var(--content-wide); }
.page-head { display: grid; gap: var(--s2); margin-bottom: var(--s8); }
.page-head h1:focus { outline: none; }
.page-lede { font: var(--t-body); color: var(--text-2); max-width: 40em; }

@media (max-width: 1100px) { .view { padding: var(--s8) var(--s8) var(--s24); } }

@media (max-width: 899px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .shell::before, .sidebar { display: none; }
  .topbar {
    display: block; position: sticky; top: 0; z-index: 40;
    padding: var(--safe-t) var(--safe-r) 0 var(--safe-l);
    background: var(--bar-bg);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    box-shadow: inset 0 -0.5px 0 var(--hairline-strong);
  }
  .topbar-row { display: flex; align-items: center; justify-content: space-between; height: 52px; padding: 0 var(--s2) 0 var(--s5); }
  .avatar-btn { display: grid; place-items: center; width: var(--tap); height: var(--tap); padding: 0; border: 0; border-radius: 50%; background: transparent; }
  .avatar-btn .avatar { width: 32px; height: 32px; }
  .avatar-btn:hover .avatar, .avatar-btn[aria-expanded="true"] .avatar { background: var(--fill-strong); box-shadow: 0 0 0 2px var(--hairline-strong); }
  .tabs {
    display: flex; gap: var(--s1); overflow-x: auto; padding: 0 var(--s4) var(--s1);
    scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-padding: 0 var(--s4);
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a {
    position: relative; isolation: isolate; flex: none; display: inline-flex; align-items: center; gap: 6px;
    height: var(--tap); padding: 0 14px; color: var(--text-2); text-decoration: none; font: 500 14px/1 var(--font);
    border-radius: 18px;
  }
  .tabs a::before { content: ""; position: absolute; inset: 5px 0; z-index: -1; border-radius: 17px; background: transparent; transition: background-color var(--dur) var(--ease); }
  .tabs a:hover::before { background: var(--fill); }
  .tabs a[aria-current="page"] { color: var(--on-primary); font-weight: 600; }
  .tabs a[aria-current="page"]::before { background: var(--primary); }
  .tabs a:focus-visible { outline-offset: -3px; }
  .tab-count { font: 600 11px/1 var(--font); font-variant-numeric: tabular-nums; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-grid; place-items: center; background: var(--fill-strong); color: var(--text); }
  .tabs a[aria-current="page"] .tab-count { background: rgba(255, 255, 255, 0.22); color: var(--on-primary); }
  .view { padding: var(--s6) max(var(--s5), var(--safe-r)) calc(var(--s24) + var(--safe-b)) max(var(--s5), var(--safe-l)); }
  .page-head { margin-bottom: var(--s6); }
  .page-head .t-largetitle { font-size: 30px; }
}
@media (max-width: 899px) and (prefers-color-scheme: dark) {
  .tabs a[aria-current="page"] .tab-count { background: rgba(0, 0, 0, 0.14); }
}

/* Shared bits */
.callout + .callout, .details-notices > * + * { margin-top: var(--s3); }
.callout-body { flex: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s4); }
.callout-body > span { flex: 1 1 260px; }
.callout .btn-sm { background: var(--surface); }
.callout .btn-sm:hover { background: var(--surface-2); }
@media (prefers-color-scheme: dark) { .callout .btn-sm { background: var(--fill-strong); } }
.row-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--fill); flex: none; }
.row-icon svg { width: 18px; height: 18px; color: var(--text-2); }
.row-ext { width: 16px; height: 16px; color: var(--text-3); }
.empty-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--fill); margin-bottom: var(--s1); }
.empty-icon svg { width: 22px; height: 22px; color: var(--text-2); }
.empty.compact { padding: var(--s8) var(--s6); }
.empty.compact h3 { font: var(--t-headline); }

.progress-block, .details-head { display: grid; gap: var(--s2); margin-bottom: var(--s6); }
.progress-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); min-height: 36px; flex-wrap: wrap; }
.progress-block .progress-row { min-height: 0; }
.progress-label { font: var(--t-headline); font-variant-numeric: tabular-nums; }

/* ================================================================= Get started */
.checklist { counter-reset: none; }
.check-row { min-height: 72px; gap: var(--s4); padding: var(--s4) var(--s4); }
.check-row .row-title { font: var(--t-headline); }
.check-row .row-sub { margin-top: 2px; }
.check-item.is-done .row-title { color: var(--text); }
.mark-n { font: 600 12px/1 var(--font); color: var(--text-2); font-variant-numeric: tabular-nums; }
.check-row .mark { width: 28px; height: 28px; }
.check-row .mark svg { width: 15px; height: 15px; }
.check-more { padding: 0 var(--s4) var(--s5) calc(var(--s4) + 28px + var(--s4)); }
.howto { display: grid; gap: var(--s2); counter-reset: howto; }
.howto li { position: relative; padding-left: 28px; font: var(--t-callout); color: var(--text-2); counter-increment: howto; }
.howto li::before {
  content: counter(howto); position: absolute; left: 0; top: 1px; display: grid; place-items: center;
  width: 20px; height: 20px; border-radius: 50%; background: var(--fill); color: var(--text); font: 600 11px/1 var(--font);
}
.howto b { color: var(--text); font-weight: 600; }
.start-done { margin-top: var(--s4); }
.start-more { margin-top: var(--s10); }
.start-more .row { min-height: 64px; }
@container (max-width: 520px) {
  .check-row { flex-wrap: wrap; row-gap: var(--s3); }
  .check-row .row-main { flex-basis: calc(100% - 28px - var(--s4)); }
  .check-row .row-trail { margin-left: calc(28px + var(--s4)); }
  .check-row .row-trail .btn-plain { margin-left: calc(28px + var(--s4) - var(--s3)); margin-top: calc(-1 * var(--s2)); }
  .check-row .row-trail:has(.btn-plain) { margin-left: 0; }
  .check-more { padding-left: var(--s4); }
}

/* ================================================================= Your details */
.prefill-card { display: flex; align-items: flex-start; gap: var(--s4); margin-bottom: var(--s8); }
.prefill-card .spinner { margin-top: 2px; }
.prefill-title { font: var(--t-headline); }
.prefill-sub { margin-top: 2px; font: var(--t-callout); color: var(--text-2); }
.details-notices { margin-bottom: var(--s8); }
.details-notices:empty, .details-notices:not(:has(> :not([hidden]))) { display: none; }
.next-missing { color: var(--text); gap: 6px; margin-right: calc(-1 * var(--s3)); }
.next-missing svg { width: 15px; height: 15px; color: var(--text-2); }
.all-set { display: inline-flex; align-items: center; gap: 6px; font: var(--t-subhead); color: var(--accent); }
.all-set svg { width: 14px; height: 14px; }

.q-row {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: center; gap: var(--s2) var(--s5);
  min-height: 60px; padding: 10px var(--s3) 10px var(--s4);
}
.q-text { display: grid; gap: 3px; min-width: 0; }
.q-label { font: var(--t-body); color: var(--text); }
.q-status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.q-status:not(:has(.q-meta > *)):not(:has(.saved.on)) { display: none; }
.q-meta { display: flex; flex-wrap: wrap; gap: var(--s2); }
.q-meta:empty { display: none; }
.q-status .saved:not(.on) { display: none; }
.q-flag { display: inline-flex; align-items: center; gap: 6px; font: 500 12px/1.2 var(--font); color: var(--warning); }
.q-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--warning); }
.q-src { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); font: 600 11px/1 var(--font); letter-spacing: 0.01em; }
.q-opt, .q-skip { font: 400 12px/1.2 var(--font); color: var(--text-2); }
.q-askagain { font: 500 12px/1.2 var(--font); padding: 2px 0; }
@media (pointer: coarse) { .q-askagain { padding: 8px 0; margin: -6px 0; } }
.q-control { min-width: 0; }
.q-row .input, .q-row .select select {
  min-height: 40px; border: 0; border-radius: 8px; background: var(--q-fill); font-size: 15px;
}
.q-row .input:hover, .q-row .select select:hover { background: var(--q-fill-hover); }
.q-row .input:focus, .q-row .select select:focus { background: var(--surface); box-shadow: 0 0 0 2px var(--ring); }
.q-row.is-missing .input::placeholder { color: var(--text-3); }
.q-row .segmented label { min-height: 36px; font-size: 14px; }
.q-row .select select:has(option[value=""]:checked) { color: var(--text-3); }
@container (max-width: 600px) {
  .q-row { grid-template-columns: minmax(0, 1fr); padding: var(--s3) var(--s3) var(--s3) var(--s4); }
  .q-text { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--s2); }
  .q-row .input, .q-row .select select { min-height: var(--tap); font-size: 16px; }
  .q-row .segmented label { min-height: 36px; min-width: 0; padding: 0 var(--s2); }
}

/* Work history and education (details-history.js) */
.h-titlebar { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); }
.h-items > li { position: relative; }
.h-items > li + li::before {
  content: ""; position: absolute; top: 0; left: var(--s4); right: 0; height: 1px;
  background: var(--hairline); transform: scaleY(0.5); transform-origin: top;
}
@media (max-resolution: 1dppx) { .h-items > li + li::before { transform: none; } }
.h-row { min-height: 64px; padding: var(--s3) var(--s3) var(--s3) var(--s4); }
.h-row .row-main { gap: 3px; }
.h-title { font: var(--t-headline); color: var(--text); }
.h-title.is-untitled { color: var(--text-2); }
.h-sub { font: var(--t-subhead); color: var(--text-2); }
.h-chev { width: 16px; height: 16px; color: var(--text-3); transition: transform var(--dur) var(--ease); }
.h-item.is-open .h-chev { transform: rotate(180deg); }
.h-src-inline { display: none; justify-self: start; margin-top: 3px; }
@container (max-width: 600px) {
  .h-row .h-src { display: none; }
  .h-row .h-src-inline:not([hidden]) { display: inline-flex; }
}
.h-editor { padding: 0 var(--s4) var(--s4); }
.h-item, .acct { scroll-margin: var(--s4) 0; }
@media (max-width: 899px) { .h-item, .acct { scroll-margin-top: calc(108px + var(--safe-t)); } } /* below the sticky top bar */
.h-empty { padding: var(--s4); font: var(--t-callout); color: var(--text-2); }
.h-move { display: flex; gap: 2px; margin-left: calc(-1 * var(--s2)); }
.h-move .icon-btn:disabled { opacity: 0.3; pointer-events: none; }
.h-group > .group-foot { margin-top: 2px; }

/* Add rows at the end of a list (“Add job”, “Add an account”) */
button.row.add-row { gap: var(--s3); min-height: 52px; color: var(--accent); font: 500 15px/1.35 var(--font); }
.add-row svg { width: 18px; height: 18px; flex: none; }

/* Inline editors (work/education entries, job site accounts) */
.ed-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.ed-field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.ed-field.wide, .ed-toggle.wide { grid-column: 1 / -1; }
.ed-label { font: 500 13px/1.3 var(--font); color: var(--text-2); }
.ed-opt { font-weight: 400; color: var(--text-3); }
.ed-input { min-height: 40px; border: 0; border-radius: 8px; background: var(--q-fill); font-size: 15px; }
textarea.ed-input { min-height: 88px; padding: 10px var(--s3); }
.ed-input:hover { background: var(--q-fill-hover); }
.ed-input:focus { background: var(--surface); box-shadow: 0 0 0 2px var(--ring); }
.ed-input[aria-invalid="true"] { box-shadow: 0 0 0 2px var(--danger); }
.ed-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  min-height: var(--tap); font: var(--t-body); color: var(--text); cursor: pointer;
}
.ed-hint { display: flex; align-items: flex-start; gap: 6px; font: var(--t-footnote); color: var(--warning); }
.ed-hint svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.ed-note { font: var(--t-footnote); color: var(--text-2); }
.ed-actions {
  display: flex; align-items: center; gap: var(--s2); margin-top: var(--s4); padding-top: var(--s3);
  box-shadow: inset 0 1px 0 var(--hairline);
}
.ed-spacer { flex: 1; }
.ed-actions .saved:not(.on) { display: none; }
@container (max-width: 600px) {
  .ed-fields { grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
  .ed-input { min-height: var(--tap); font-size: 16px; }
}

/* ================================================================= Learned answers */
.toolbar { display: flex; align-items: center; gap: var(--s4); margin-bottom: var(--s4); }
.toolbar-search { flex: 1; max-width: 360px; }
.toolbar-search .input { min-height: 40px; border: 0; background: var(--fill); font-size: 15px; }
.toolbar-search .input:focus { background: var(--surface); box-shadow: 0 0 0 2px var(--ring); }
.toolbar-search .input::-webkit-search-cancel-button { cursor: pointer; }
.toolbar-count { margin-left: auto; font: var(--t-subhead); color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
@container (max-width: 600px) {
  .toolbar-search { max-width: none; }
  .toolbar-search .input { min-height: var(--tap); font-size: 16px; }
}

.learned-list { list-style: none; }
.l-row { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3) var(--s2) var(--s3) var(--s4); }
.l-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.l-top { display: flex; align-items: baseline; gap: var(--s3); }
.l-q { flex: 1; min-width: 0; font: var(--t-subhead); color: var(--text-2); }
.l-skip { flex: none; height: 18px; padding: 0 6px; border-radius: 5px; display: inline-grid; place-items: center; background: var(--fill); color: var(--text-2); font: 500 11px/1 var(--font); }
.l-date { font: var(--t-footnote); color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.l-value {
  display: block; width: calc(100% + 16px); margin: 0 -8px; padding: 6px 8px; min-height: 34px;
  border: 0; border-radius: 8px; background: transparent; color: var(--text);
  font: var(--t-body); resize: none; overflow: hidden;
  transition: background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.l-value:hover { background: var(--q-fill); }
.l-value:focus { outline: none; background: var(--surface); box-shadow: 0 0 0 2px var(--ring); }
.l-top .saved:not(.on) { display: none; }
.l-trail { display: flex; align-items: center; padding-top: 6px; }

/* ================================================================= Applications */
.filter-bar { margin-bottom: var(--s4); overflow-x: auto; scrollbar-width: none; margin-left: -2px; padding: 2px; }
.filter-bar::-webkit-scrollbar { display: none; }
.segmented.scope { grid-auto-columns: auto; }
.segmented.scope label { gap: 6px; padding: 0 var(--s3); }
.seg-count { font: 500 12px/1 var(--font); color: var(--text-2); font-variant-numeric: tabular-nums; }

.apps { container-type: inline-size; }
.app-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 136px 96px minmax(0, 228px) 36px; align-items: center; gap: var(--s4);
  min-height: 72px; padding: var(--s3) var(--s2) var(--s3) var(--s4);
}
.app-cols { min-height: 40px; padding-top: 0; padding-bottom: 0; font: 600 12px/1 var(--font); color: var(--text-2); }
.app-main { min-width: 0; display: grid; gap: 3px; }
.app-role { font: var(--t-headline); color: var(--text); text-decoration: none; border-radius: 4px; justify-self: start; max-width: 100%; }
a.app-role:hover { text-decoration: underline; text-underline-offset: 3px; }
.app-sub { font: var(--t-subhead); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-date { font: var(--t-subhead); color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.app-date-label { display: none; }
.app-docs { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.app-none { font: var(--t-subhead); color: var(--text-2); }
.app-more { justify-self: end; }

.status-btn { border: 0; cursor: pointer; height: 28px; padding: 0 8px 0 10px; gap: 6px; transition: filter var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.status-btn:hover { filter: brightness(0.96); }
@media (prefers-color-scheme: dark) { .status-btn:hover { filter: brightness(1.15); } }
.status-chev { width: 11px; height: 11px; opacity: 0.7; margin-left: -1px; }
.pill.solid .status-chev { opacity: 0.9; }
@media (pointer: coarse) { .status-btn { height: 36px; padding: 0 10px 0 12px; } }

@container (max-width: 760px) {
  .app-cols { display: none; }
  .app-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "main more" "meta meta" "docs docs";
    row-gap: var(--s3); padding: var(--s4) var(--s2) var(--s4) var(--s4);
  }
  .app-main { grid-area: main; }
  .app-more { grid-area: more; align-self: start; margin-top: -6px; }
  .app-status { grid-area: meta; display: flex; align-items: center; gap: var(--s3); }
  .app-date { grid-area: meta; justify-self: end; align-self: center; margin-right: var(--s2); }
  .app-date-label { display: inline; }
  .app-docs { grid-area: docs; }
  .app-docs:has(.app-none) { display: none; }
}

.apps-empty { justify-items: start; max-width: var(--content-w); }
.apps-empty-art { display: grid; gap: 6px; width: min(280px, 100%); padding: var(--s3); margin-bottom: var(--s3); border-radius: 12px; background: var(--bg-grouped); }
@media (prefers-color-scheme: dark) { .apps-empty-art { background: var(--surface-2); } }
.ae-row { display: flex; align-items: center; gap: var(--s2); height: 36px; padding: 0 10px; border-radius: 8px; background: var(--surface); }
@media (prefers-color-scheme: dark) { .ae-row { background: var(--fill); } }
.ae-row i { width: 16px; height: 16px; border-radius: 4px; background: var(--fill-strong); }
.ae-row b { flex: 1; height: 8px; border-radius: 4px; background: var(--fill-strong); max-width: 50%; }
.ae-row em { margin-left: auto; padding: 4px 8px; border-radius: 10px; background: var(--fill); color: var(--text-2); font: 600 11px/1 var(--font); font-style: normal; }
.ae-row:first-child em { background: var(--accent-soft); color: var(--accent); }

/* ================================================================= Job site accounts */
.list.accounts > * + *::before { left: calc(var(--s4) + 32px + var(--s3)); }
.acct-row {
  position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr) minmax(0, 256px) 36px;
  grid-template-areas: "mono main pass more"; align-items: center; gap: var(--s3);
  min-height: 64px; padding: var(--s3) var(--s2) var(--s3) var(--s4);
}
.acct-mono {
  grid-area: mono; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  background: var(--fill); color: var(--text-2); font: 600 14px/1 var(--font);
}
.acct-main { grid-area: main; min-width: 0; }
.acct-open {
  display: grid; gap: 3px; width: 100%; padding: 0; border: 0; background: none; text-align: left;
  color: inherit; font: inherit; -webkit-tap-highlight-color: transparent;
}
/* The whole row opens the editor; the password and menu buttons sit above it. */
.acct-open::after { content: ""; position: absolute; inset: 0; }
.acct-open:focus-visible { outline: none; }
.acct-open:focus-visible::after { outline: 2px solid var(--ring); outline-offset: -2px; border-radius: inherit; }
@media (hover: hover) { .acct-row:has(.acct-open:hover) { background: var(--row-hover); } }
.acct-row:has(.acct-open:active) { background: var(--row-active); }
.acct-site { font: var(--t-headline); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-user { font: var(--t-subhead); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-pass {
  grid-area: pass; position: relative; z-index: 1; display: flex; align-items: center; gap: 2px; min-width: 0;
  padding: 2px 2px 2px var(--s3); border-radius: 10px; background: var(--fill);
}
.acct-pw { flex: 1; min-width: 0; font: 500 14px/1.3 var(--mono); color: var(--text); letter-spacing: 0.08em; overflow-wrap: anywhere; }
.acct-pw.shown { letter-spacing: 0; user-select: all; -webkit-user-select: all; }
@media (hover: hover) {
  .acct-pass .icon-btn:hover { background: var(--surface); }
}
@media (hover: hover) and (prefers-color-scheme: dark) { .acct-pass .icon-btn:hover { background: var(--fill-strong); } }
@media (hover: none) { .acct-pass .icon-btn:hover { background: transparent; } }
.acct-actions { grid-area: more; position: relative; z-index: 1; justify-self: end; }
.acct-editor { padding: 0 var(--s4) var(--s4) calc(var(--s4) + 32px + var(--s3)); }
.acct-new .acct-editor { padding: var(--s4); }
.acct-editor-title { font: var(--t-headline); margin-bottom: var(--s4); }
.acct-editor .input-wrap .ed-input { padding-right: 48px; }
.acct-editor .field-error { margin-top: var(--s3); }
.acct-meta { margin-top: var(--s3); font: var(--t-footnote); color: var(--text-2); }
.accounts .add-row svg { margin: 0 7px; }
@container (max-width: 600px) {
  .acct-row {
    grid-template-columns: 32px minmax(0, 1fr) auto; grid-template-areas: "mono main more" ". pass pass";
    row-gap: var(--s2); align-items: center;
  }
  .acct-site, .acct-user { white-space: normal; overflow-wrap: anywhere; }
  .acct-editor { padding-left: var(--s4); }
}

/* ================================================================= Extension */
.ext-card { display: flex; align-items: center; gap: var(--s5); margin-bottom: var(--s10); }
.ext-icon { width: 56px; height: 56px; border-radius: 13px; flex: none; }
@media (prefers-color-scheme: dark) { .ext-icon { box-shadow: 0 0 0 1px var(--hairline-strong); } }
.ext-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ext-name { font: var(--t-footnote); color: var(--text-2); }
.ext-state { display: flex; align-items: center; gap: var(--s2); font: var(--t-title3); }
.ext-sub { font: var(--t-callout); color: var(--text-2); }
.ext-mark { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--fill); flex: none; }
.ext-mark svg { width: 13px; height: 13px; color: var(--text-2); }
.ext-mark .spinner { width: 14px; height: 14px; }
.ext-mark.on { background: var(--accent); }
.ext-mark.on svg { color: #fff; }
@media (prefers-color-scheme: dark) { .ext-mark.on svg { color: #000; } }
.ext-mark.warn { background: transparent; }
.ext-mark.warn svg { width: 20px; height: 20px; color: var(--warning); }
.ext-actions { flex: none; }
@container (max-width: 560px) {
  .ext-card { flex-wrap: wrap; align-items: flex-start; }
  .ext-text { flex-basis: calc(100% - 56px - var(--s5)); }
  .ext-actions { flex-basis: 100%; }
  .ext-actions .btn { width: 100%; }
}

.steps-list { list-style: none; }
.step-row {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) 208px; gap: var(--s4); align-items: center;
  padding: var(--s5) var(--s5) var(--s5) var(--s4);
}
.list > .step-row + .step-row::before { left: calc(var(--s4) + 28px + var(--s4)); }
.step-num {
  align-self: start; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--fill); font: 600 13px/1 var(--font); font-variant-numeric: tabular-nums;
}
.step-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; align-self: start; padding-top: 3px; min-width: 0; }
.step-title { font: var(--t-headline); }
.step-text { font: var(--t-callout); color: var(--text-2); max-width: 34em; }
.copy-field {
  display: inline-flex; align-items: center; justify-self: start; gap: var(--s1); max-width: 100%; margin-top: var(--s2);
  padding: 2px 2px 2px var(--s3); border-radius: 10px; background: var(--fill);
}
.copy-text { min-width: 0; font: 500 14px/1.3 var(--mono); user-select: all; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.copy-btn { gap: 6px; padding: 0 10px; }
.copy-btn:hover { background: var(--surface); }
@media (prefers-color-scheme: dark) { .copy-btn:hover { background: var(--fill-strong); } }
.copy-btn svg { width: 15px; height: 15px; }
.step-live { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s2); flex-wrap: wrap; }
.live { display: inline-flex; align-items: center; gap: var(--s2); font: var(--t-callout); color: var(--text-2); }
.live.on { color: var(--accent); font-weight: 600; }
.live.on svg { width: 15px; height: 15px; }

.step-art { align-self: stretch; }
.art {
  height: 100%; min-height: 104px; border-radius: 12px; background: var(--bg-grouped);
  display: flex; align-items: center; justify-content: center; gap: var(--s3); padding: var(--s3);
  font: 500 12px/1.2 var(--font); color: var(--text);
}
@media (prefers-color-scheme: dark) { .art { background: var(--surface-2); } }
.art img { width: 22px; height: 22px; border-radius: 5px; }
.art-file { display: grid; justify-items: center; gap: 6px; }
.art-file svg { width: 30px; height: 30px; color: var(--text-2); }
.art-file small { font: 500 11px/1 var(--font); color: var(--text-2); }
.art-arrow { width: 16px; height: 16px; color: var(--text-3); }
.art-bar {
  display: flex; align-items: center; gap: 2px; width: 100%; height: 32px; padding: 0 10px; border-radius: 16px;
  background: var(--surface); box-shadow: 0 0 0 1px var(--hairline); font: 400 12px/1 var(--font); color: var(--text);
}
@media (prefers-color-scheme: dark) { .art-bar { background: var(--fill); box-shadow: none; } }
.art-caret { order: 2; width: 1px; height: 14px; background: var(--accent); margin-left: 1px; }
.art-dev { justify-content: space-between; padding: 0 var(--s4); }
.art-dev .switch { transform: scale(0.8); transform-origin: right center; pointer-events: none; }
.art-dev .switch input { cursor: default; }
.art-load { flex-wrap: wrap; gap: 6px; }
.art-btn { padding: 7px 10px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--hairline-strong); font: 500 11px/1 var(--font); color: var(--text-2); background: var(--surface); }
@media (prefers-color-scheme: dark) { .art-btn { background: transparent; } }
.art-btn.on { position: relative; padding: 9px 14px; font-size: 12px; box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--text); }
.art-cursor {
  position: absolute; right: -10px; bottom: -14px; width: 18px; height: 18px; background: var(--text);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 3l10 7-4.5.8 2.6 4.9-1.9 1-2.6-4.9L5 15z' fill='black' stroke='white' stroke-width='1' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 3l10 7-4.5.8 2.6 4.9-1.9 1-2.6-4.9L5 15z' fill='black'/%3E%3C/svg%3E") center / contain no-repeat;
}
.art-pin-row {
  display: flex; align-items: center; gap: var(--s2); width: 100%; height: 40px; padding: 0 10px; border-radius: 10px;
  background: var(--surface); box-shadow: var(--shadow-pop);
}
.art-pin-row span { flex: 1; }
.art-pin-icon { width: 16px; height: 16px; color: var(--accent); }
.art-done { position: relative; }
.art-done img { width: 40px; height: 40px; border-radius: 10px; }
.art-done-dot { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: 6px 0 0 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2.5px var(--bg-grouped); }
@media (prefers-color-scheme: dark) { .art-done-dot { box-shadow: 0 0 0 2.5px var(--surface-2); } }
@container (max-width: 600px) {
  .step-row { grid-template-columns: 28px minmax(0, 1fr); padding: var(--s4) var(--s4) var(--s5) var(--s4); }
  .step-art { grid-column: 2; }
  .art { min-height: 80px; }
  .step-row:has(.copy-field) .step-art { display: none; }
}

.steps-details > summary { list-style: none; cursor: pointer; border-radius: 8px; }
.steps-details > summary::-webkit-details-marker { display: none; }
.steps-details > summary .group-title { display: inline-flex; align-items: center; gap: var(--s2); }
.steps-details > summary .group-title::after {
  content: ""; width: 7px; height: 7px; margin-left: 2px; border-right: 1.6px solid var(--text-2); border-bottom: 1.6px solid var(--text-2);
  transform: rotate(-45deg); transition: transform var(--dur) var(--ease);
}
.steps-details[open] > summary .group-title::after { transform: rotate(45deg) translateY(-2px); }
.steps-details > summary { min-height: var(--tap); display: grid; align-content: center; }
.steps-details[open] > summary { margin-bottom: var(--s2); }
.steps-details:not([open]) .group-note { display: none; }
.help { margin-top: var(--s8); }
.help summary {
  display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--tap); padding: 0 var(--s4);
  font: var(--t-headline); color: var(--text); cursor: pointer; list-style: none; border-radius: 6px;
}
.help summary::-webkit-details-marker { display: none; }
.help summary::after {
  content: ""; width: 7px; height: 7px; border-right: 1.6px solid var(--text-2); border-bottom: 1.6px solid var(--text-2);
  transform: rotate(-45deg); transition: transform var(--dur) var(--ease); margin-left: 2px;
}
.help[open] summary::after { transform: rotate(45deg) translateY(-2px); }
.help-list { display: grid; gap: var(--s2); padding: var(--s1) 0 0 var(--s4); }
.steps-details:not([open]) + .help { margin-top: 0; }
.help-list li { position: relative; padding-left: var(--s5); font: var(--t-callout); color: var(--text-2); max-width: 40em; }
.help-list li::before { content: ""; position: absolute; left: 4px; top: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--text-3); }
