/* ============================================================
   ui-app.css — signed-in app surface ("Paper & Ink"): shared app
   atoms (buttons, pills, score, cards, menus, tooltip) and the
   Matches dashboard (composer host, onboarding, 7-step progress,
   rows, prep index, phone tab bar). Detail / review / outcomes live
   in ui-app-detail.css. Tokens: ui-tokens.css (--ui-*).
   The app has NO private header: the shared site header stays.
   ============================================================ */

.ap-hidden { display: none !important; }
.ap-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body.in-app, body.is-guest-result { background: var(--ui-paper); }
body.in-app #onboarding { display: none; }
body.is-guest-result #site-footer, body.is-guest-result .site-footer,
body.is-guest-result .ui-footer, body.is-guest-result .ui-app-footer { display: none; }
/* Guest-Result board: the header keeps Apps + Sign in; "Try free" is moot here. */
body.is-guest-result .ui-try { display: none; }

.ap-wrap { width: 100%; max-width: calc(var(--ui-container, 1200px) + 2 * var(--ui-gutter, 32px)); margin: 0 auto; padding: 0 var(--ui-gutter, 32px); box-sizing: border-box; }
.ap-view, #workspace, #appBand { font-family: var(--ui-sans); color: var(--ui-ink); }
#workspace.active { display: block; }
#workspace > main { max-width: calc(var(--ui-container, 1200px) + 2 * var(--ui-gutter, 32px)); margin: 0 auto; padding: 0 var(--ui-gutter, 32px) 48px; box-sizing: border-box; display: flex; flex-direction: column; gap: 16px; }
.ap-page { padding-top: 32px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 16px; }
.ap-page.is-narrow { max-width: calc(760px + 2 * var(--ui-gutter, 32px)); }

/* ── Type ── */
.ap-display { font-family: var(--ui-serif); font-weight: 400; font-size: clamp(36px, 5vw, 56px); line-height: 1.05; letter-spacing: var(--ui-tracking-display); margin: 0; color: var(--ui-ink); text-wrap: balance; }
.ap-display em, .ap-h2 em { font-style: italic; color: var(--ui-accent); }
.ap-h1 { font-family: var(--ui-serif); font-weight: 400; font-size: 36px; line-height: 1.1; margin: 0; }
.ap-h2 { font-size: 18px; font-weight: 600; margin: 0; line-height: 1.3; }
.ap-h2.is-serif { font-family: var(--ui-serif); font-weight: 400; font-size: 30px; line-height: 1.15; }
.ap-h3 { font-size: 17px; font-weight: 600; margin: 0 0 12px; }
.ap-lead { font-size: 17px; line-height: 1.55; color: var(--ui-ink-2); margin: 0 auto; max-width: 600px; text-align: center; }
.ap-lead.is-left { margin: 0; text-align: left; }
.ap-body { font-size: 15px; line-height: 1.6; color: var(--ui-ink-2); margin: 8px 0 0; }
.ap-muted { color: var(--ui-ink-3); font-size: 13px; }
.ap-note { font-size: 13px; color: var(--ui-ink-3); margin: 12px 0 0; line-height: 1.5; }
.ap-mono { font-family: var(--ui-mono); font-size: 12px; letter-spacing: var(--ui-tracking-label); text-transform: uppercase; color: var(--ui-ink-3); }
.ap-eyebrow { font-family: var(--ui-mono); font-size: 12px; font-weight: 400; letter-spacing: var(--ui-tracking-label); text-transform: uppercase; color: var(--ui-accent-ink); margin: 0; }
.ap-eyebrow.is-muted { color: var(--ui-ink-3); }
.ap-eyebrow.is-center { text-align: center; }
.ap-eyebrow.is-band { color: var(--ui-band-muted); }
.ap-view a:not(.ap-btn):not(.ap-row-title), #workspace a:not(.ap-btn):not(.ap-row-title) { color: var(--ui-accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ── Cards ── */
.ap-card { background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-card); box-shadow: var(--ui-shadow-card); box-sizing: border-box; }
.ap-pad { padding: 24px 28px; }
.ap-card.is-sunken { background: var(--ui-sunken); border-color: transparent; box-shadow: none; }
.ap-emptycard { padding: 40px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; color: var(--ui-ink-2); }

/* ── Buttons ── */
.ap-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--ui-control-h, 44px); padding: 0 18px; border-radius: var(--ui-radius-control, 10px);
  font: 500 15px var(--ui-sans); cursor: pointer; white-space: nowrap; text-decoration: none;
  border: 1px solid transparent; box-sizing: border-box; transition: background .15s, border-color .15s;
}
.ap-btn-sm { height: var(--ui-control-h-sm, 36px); padding: 0 14px; font-size: 14px; }
.ap-btn-block { width: 100%; }
.ap-btn-primary { background: var(--ui-accent); color: var(--ui-on-accent); }
.ap-btn-primary:hover:not(:disabled) { background: var(--ui-accent-hover); }
.ap-btn-secondary { background: var(--ui-surface); color: var(--ui-ink); border-color: var(--ui-line-strong); }
.ap-btn-secondary:hover:not(:disabled) { border-color: var(--ui-ink-3); }
.ap-btn-ghost { background: transparent; color: var(--ui-ink-2); }
.ap-btn-ghost:hover:not(:disabled) { background: var(--ui-sunken); }
.ap-btn-light { background: #FFFFFF; color: #14201B; }
.ap-btn-danger { background: var(--ui-surface); color: var(--ui-red); border-color: var(--ui-line-strong); }
.ap-btn-danger:hover { border-color: var(--ui-red); }
.ap-btn-locked { background: var(--ui-sunken); color: var(--ui-ink-2); border-color: transparent; }
.ap-btn:disabled { cursor: not-allowed; opacity: .7; }
.ap-btn.is-busy { opacity: .65; cursor: progress; }
.ap-btn:focus-visible, .ap-iconbtn:focus-visible, .ap-seg:focus-visible, .ap-linkbtn:focus-visible, .ap-tab:focus-visible, .ap-row-title:focus-visible, .ap-file:focus-visible, .ap-chipmore:focus-visible, .ap-mini-btn:focus-visible, .ap-tipbtn:focus-visible {
  outline: none; box-shadow: 0 0 0 3px var(--ui-accent-soft), 0 0 0 1px var(--ui-accent);
}
.ap-btnrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ap-iconbtn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--ui-ink-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.ap-iconbtn:hover { background: var(--ui-sunken); }
.ap-linkbtn { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--ui-ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ap-linkbtn.is-accent { color: var(--ui-accent); }

/* ── Spinner ── */
.ap-spin { display: inline-block; border-radius: 999px; border: 2px solid var(--ui-line-strong); border-top-color: var(--ui-accent); animation: ap-spin .8s linear infinite; box-sizing: border-box; flex: 0 0 auto; }
@keyframes ap-spin { to { transform: rotate(360deg); } }

/* ── Status pill: the five canonical states ── */
.ap-pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font: 500 12px var(--ui-sans); white-space: nowrap; }
.ap-pill-s { display: none; }
.ap-pill-dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.ap-pill .ap-spin { width: 12px !important; height: 12px !important; border-width: 1.5px; }
.ap-pill.is-tailoring { background: var(--ui-sunken); color: var(--ui-ink-2); }
.ap-pill.is-review { background: var(--ui-amber-soft); color: var(--ui-amber); }
.ap-pill.is-ready { background: var(--ui-accent-soft); color: var(--ui-accent-ink); }
.ap-pill.is-downloaded { background: var(--ui-sunken); color: var(--ui-ink-3); }
.ap-pill.is-notfit { background: var(--ui-red-soft); color: var(--ui-red); }

/* ── Score: ONE component (label + number + before→after bar + caption) ── */
.ap-score { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ap-score-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ui-ink-2); }
.ap-score-label.is-mono { font-family: var(--ui-mono); font-size: 12px; letter-spacing: var(--ui-tracking-label); text-transform: uppercase; color: var(--ui-ink-3); }
.ap-score-num { display: flex; align-items: baseline; gap: 4px; }
.ap-score-num strong { font-size: 32px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; color: var(--ui-ink); }
.ap-score-num span { font-size: 14px; color: var(--ui-ink-3); }
.ap-score-cap { font-size: 13px; color: var(--ui-ink-3); font-variant-numeric: tabular-nums; }
.ap-bar { position: relative; height: 8px; border-radius: 999px; background: var(--ui-sunken); overflow: hidden; }
.ap-bar span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; }
.ap-bar-after { background: var(--ui-accent); }
.ap-bar-before { background: var(--ui-score-before); }
.ap-bar.is-red .ap-bar-after { background: var(--ui-red); }
.ap-score.is-lg { width: 300px; }
.ap-score.is-row { gap: 8px; }
.ap-score.is-row .ap-bar { height: 6px; }
.ap-score-pair { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ui-ink-2); font-variant-numeric: tabular-nums; }
.ap-score-pair strong { color: var(--ui-ink); font-weight: 600; }
.ap-score-pair svg { color: var(--ui-ink-3); }
.ap-score-big, .ap-score-from { display: none; }

/* Estimate tooltip (shown ONCE per score) */
.ap-tipwrap { position: relative; display: inline-flex; }
.ap-tipbtn { width: 20px; height: 20px; padding: 0; border: 0; border-radius: 999px; background: none; color: var(--ui-ink-3); cursor: help; display: inline-flex; align-items: center; justify-content: center; }
.ap-tip { position: absolute; z-index: 30; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: 260px; padding: 10px 12px; border-radius: 10px; background: var(--ui-toast-bg); color: var(--ui-toast-text); font: 400 13px/1.45 var(--ui-sans); letter-spacing: 0; text-transform: none; box-shadow: var(--ui-shadow-overlay); opacity: 0; visibility: hidden; transition: opacity .12s; pointer-events: none; }
.ap-tipwrap:hover .ap-tip, .ap-tipbtn:focus-visible + .ap-tip { opacity: 1; visibility: visible; }

/* ── Logo tile ── */
.ap-logo { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 10px; background: var(--ui-sunken); color: var(--ui-ink-2); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.ap-logo.is-lg { flex-basis: 56px; width: 56px; height: 56px; font-size: 17px; border-radius: 12px; }

/* ── Overflow menu ── */
.ap-menu-wrap { position: relative; display: inline-flex; }
.ap-menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 220px; padding: 6px; border-radius: var(--ui-radius-menu, 14px); background: var(--ui-surface); border: 1px solid var(--ui-line); box-shadow: var(--ui-shadow-overlay); }
.ap-menu-wrap.is-open .ap-menu { display: block; }
.ap-menu-item { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-radius: 8px; background: none; color: var(--ui-ink); font: 14px var(--ui-sans); cursor: pointer; }
.ap-menu-item:hover, .ap-menu-item:focus-visible { background: var(--ui-sunken); outline: none; }
.ap-menu-item.is-danger { color: var(--ui-red); }
.ap-menu-div { height: 1px; background: var(--ui-line); margin: 6px 4px; }

/* ── Composer host / greeting ── */
.ap-band { padding: 32px 0 0; }
.ap-band > .ap-wrap { display: flex; flex-direction: column; gap: 24px; }
.ap-greet { display: flex; flex-direction: column; gap: 14px; }
.ap-greet.is-onboarding { text-align: center; align-items: center; padding: 40px 0 12px; }
.ap-greet.is-onboarding .ap-display { max-width: 980px; }
.ap-greet.is-slim { display: none; }
.ap-greet.is-onboarding + .ap-cmp-host { max-width: 1040px; margin: 0 auto; width: 100%; }
.ap-cmp-host { width: 100%; }

/* ── 7-step progress (App-Tailoring) ── */
#apProgress[hidden] { display: none; }
/* App-Tailoring board: ~32 px of paper between the composer band and the card. */
#workspace > main > #apProgress:not([hidden]) { margin-top: 32px; }
.ap-progress-now { display: none; margin: 0; font-size: 14px; color: var(--ui-ink-2); }
.ap-progress { display: grid; grid-template-columns: minmax(0, 1fr) 420px; overflow: hidden; }
.ap-progress-main { padding: 32px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ap-progress-top { display: flex; align-items: center; gap: 12px; }
.ap-progress-title { font-family: var(--ui-serif); font-weight: 400; font-size: 36px; line-height: 1.1; margin: 0; overflow-wrap: anywhere; }
.ap-progress-sub { margin: 0; color: var(--ui-ink-2); font-size: 15px; }
.ap-progress-bar { height: 8px; border-radius: 999px; background: var(--ui-sunken); overflow: hidden; margin: 6px 0 10px; }
.ap-progress-bar span { display: block; height: 100%; background: var(--ui-accent); border-radius: inherit; transition: width .5s ease; }
.ap-progress-bar.is-thin { height: 6px; margin: 10px 0; }
.ap-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ap-step { display: flex; align-items: center; gap: 14px; padding: 10px 14px; margin: 0 -14px; border-radius: 10px; font-size: 15px; color: var(--ui-ink-2); }
.ap-step.is-done { color: var(--ui-ink); }
.ap-step.is-current { background: var(--ui-accent-soft); color: var(--ui-accent-ink); font-weight: 600; }
.ap-step-mark { flex: 0 0 24px; width: 24px; height: 24px; border-radius: 999px; border: 1.5px solid var(--ui-line-strong); display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }
.ap-step-mark.is-done { background: var(--ui-accent); border-color: var(--ui-accent); color: var(--ui-on-accent); }
.ap-step-mark.is-current { border: 0; }
.ap-step-label { flex: 1 1 auto; min-width: 0; }
.ap-step-fact { font-family: var(--ui-mono); font-size: 12px; color: var(--ui-ink-3); white-space: nowrap; }
.ap-step.is-current .ap-step-fact { color: var(--ui-accent-ink); }
.ap-progress-side { background: var(--ui-paper); border-left: 1px solid var(--ui-line); padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.ap-facts { margin: 0; display: flex; flex-direction: column; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--ui-line); }
.ap-facts div { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.ap-facts dt { color: var(--ui-ink-2); }
.ap-facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.ap-shieldnote { display: flex; align-items: flex-start; gap: 10px; margin: 0; font-size: 13px; line-height: 1.5; color: var(--ui-ink-2); }
.ap-shieldnote svg { color: var(--ui-accent); flex: 0 0 auto; margin-top: 2px; }

/* ── Matches list head ── */
.ap-listhead { display: flex; align-items: center; gap: 16px 20px; flex-wrap: wrap; padding-top: 20px; }
.ap-listmeta { font-size: 13px; color: var(--ui-ink-3); }
.ap-segs { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 10px; background: var(--ui-sunken); }
.ap-seg { height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ui-ink-2); font: 500 13px var(--ui-sans); cursor: pointer; white-space: nowrap; }
.ap-seg[aria-pressed="true"] { background: var(--ui-surface); color: var(--ui-ink); box-shadow: var(--ui-shadow-segment); }
.ap-search { margin-left: auto; position: relative; width: 260px; max-width: 100%; }
.ap-search svg { position: absolute; left: 12px; top: 12px; color: var(--ui-ink-3); }
.ap-search input { width: 100%; height: 40px; box-sizing: border-box; padding: 0 12px 0 36px; border-radius: 10px; border: 1px solid var(--ui-line-strong); background: var(--ui-surface); color: var(--ui-ink); font: 14px var(--ui-sans); }
.ap-search input:focus { outline: none; border-color: var(--ui-accent); box-shadow: var(--ui-focus-ring); }
.ap-listnote { font-size: 13px; color: var(--ui-ink-2); margin: 4px 0 0; }

/* ── Rows (always rows) ── */
.ap-rows { padding: 0; overflow: visible; }
.ap-rows[hidden] { display: none; }
.ap-rows-head, .ap-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 110px 170px 200px 156px 36px; gap: 16px; align-items: center; padding: 14px 20px; }
.ap-rows-head { padding: 10px 20px; border-bottom: 1px solid var(--ui-line); font-family: var(--ui-mono); font-size: 12px; letter-spacing: var(--ui-tracking-label); text-transform: uppercase; color: var(--ui-ink-3); }
.ap-row { border-bottom: 1px solid var(--ui-line); cursor: pointer; }
.ap-row:last-child { border-bottom: 0; border-radius: 0 0 var(--ui-radius-card) var(--ui-radius-card); }
.ap-row:hover { background: color-mix(in srgb, var(--ui-sunken) 45%, transparent); }
.ap-row[hidden] { display: none; }
.ap-row-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ap-row-title { font-size: 15px; font-weight: 600; color: var(--ui-ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 4px; }
.ap-row-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.ap-row-co { font-size: 13px; color: var(--ui-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-row-when-m { display: none; }
.ap-row-when { font-size: 14px; color: var(--ui-ink-2); }
.ap-row-act .ap-btn { width: 100%; }
.ap-row-more { display: flex; justify-content: flex-end; }
.ap-row.is-tailoring { cursor: default; }
.ap-row.is-tailoring .ap-row-title { font-weight: 600; }
.ap-row-progress, .ap-row.is-tailoring .ap-row-score { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ap-mini-track { height: 6px; border-radius: 999px; background: var(--ui-sunken); overflow: hidden; }
.ap-mini-fill { height: 100%; width: 4%; border-radius: inherit; background: var(--ui-line-strong); transition: width .5s ease; }
.ap-row-steplabel { font-size: 12px; color: var(--ui-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-row [id$="-score"] { display: none; }
.ap-rows-empty { padding: 32px 20px; text-align: center; color: var(--ui-ink-3); font-size: 14px; }
.ap-row.is-simple { grid-template-columns: 44px minmax(0, 1fr) 150px; }
/* failed run (app-tailor writes .m-info / .error-text into the node) */
.ap-row.is-error { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; cursor: default; }
.ap-row.is-error .m-info { flex: 1 1 240px; min-width: 0; }
.ap-row.is-error .m-titles { display: flex; flex-direction: column; gap: 2px; }
.ap-row.is-error .m-role { font-weight: 600; font-size: 15px; }
.ap-row.is-error .m-company { font-size: 13px; color: var(--ui-ink-3); }
.ap-row.is-error .error-text { flex: 2 1 300px; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ui-ink-2); min-width: 0; overflow-wrap: anywhere; }
.ap-row.is-error .error-text::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: var(--ui-red); flex: 0 0 auto; }

/* ── First match: how it works (App-Onboarding) ── */
.ap-how { max-width: 1040px; margin: 24px auto 0; width: 100%; }
.ap-howsteps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ap-howstep { display: flex; gap: 14px; padding-top: 20px; border-top: 1px solid var(--ui-line-strong); }
.ap-howstep-n { font-family: var(--ui-serif); font-size: 34px; line-height: .9; color: var(--ui-accent); flex: 0 0 22px; }
.ap-howstep h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.ap-howstep p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ui-ink-2); }

/* ── Phone navigation: the shared partials tab bar (.ui-tabbar). In the match
   detail the sticky download bar takes its place (Mobile-Result board). ── */
@media (max-width: 720px) {
  html.ui-has-tabbar body.is-user[data-app-view="detail"] .ui-tabbar,
  body.is-guest-result .ui-tabbar { display: none; }
  html.ui-has-tabbar body.is-user[data-app-view="detail"] { padding-bottom: 0; }
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .ap-rows-head, .ap-row { grid-template-columns: 44px minmax(0, 1fr) 150px 170px 120px 36px; }
  .ap-rows-head span:nth-child(3), .ap-row-when { display: none; }
  .ap-progress { grid-template-columns: minmax(0, 1fr); }
  .ap-progress-side { border-left: 0; border-top: 1px solid var(--ui-line); }
}
@media (max-width: 720px) {
  #workspace > main { padding: 0 var(--ui-gutter, 16px) 32px; gap: 12px; }
  .ap-band { padding-top: 20px; }
  .ap-band > .ap-wrap { gap: 16px; }
  .ap-greet.is-slim { display: flex; }
  .ap-greet.is-onboarding { padding: 16px 0 0; text-align: left; align-items: flex-start; }
  .ap-greet .ap-display { font-size: 32px; }
  .ap-lead { font-size: 15px; text-align: left; margin: 0; }
  .ap-h1 { font-size: 28px; }
  .ap-listhead { gap: 10px; padding-top: 8px; }
  .ap-listhead .ap-h1 { flex: 1 1 auto; }
  .ap-segs { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .ap-search { order: 4; width: 100%; margin-left: 0; }
  .ap-rows { background: transparent; border: 0; box-shadow: none; display: flex; flex-direction: column; gap: 12px; }
  .ap-rows-head { display: none; }
  /* Mobile-Dashboard card: short pill beside the title, full-width primary
     CTA with the "⋯" at the end of the same row. */
  .ap-row, .ap-row:last-child {
    grid-template-columns: 40px minmax(0, 1fr) auto 44px; grid-template-areas: "logo main status status" "score score score score" "act act act more";
    gap: 12px; padding: 16px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-card); background: var(--ui-surface); box-shadow: var(--ui-shadow-card);
  }
  .ap-row > .ap-logo { grid-area: logo; }
  .ap-row-main { grid-area: main; }
  .ap-row-status { grid-area: status; align-self: start; }
  .ap-row-score { grid-area: score; }
  .ap-row-act { grid-area: act; }
  .ap-row-more { grid-area: more; }
  .ap-row-title { white-space: normal; }
  .ap-row-when-m { display: inline; }
  .ap-row-act .ap-btn { height: 44px; font-size: 15px; }
  .ap-row-more .ap-iconbtn { width: 44px; height: 44px; border-color: var(--ui-line-strong); }
  .ap-row.is-review .ap-row-act .ap-btn { background: var(--ui-accent); color: var(--ui-on-accent); border-color: transparent; }
  .ap-row.is-downloaded .ap-row-act, .ap-row.is-notfit .ap-row-act { display: none; }
  .ap-row.is-downloaded, .ap-row.is-notfit { grid-template-areas: "logo main status status" "score score score more"; }
  .ap-row.is-tailoring { grid-template-areas: "logo main status status" "score score score score"; }
  .ap-row .ap-pill-l { display: none; }
  .ap-row .ap-pill-s { display: inline; }
  .ap-row.is-tailoring .ap-row-act, .ap-row.is-tailoring .ap-row-more { display: none; }
  .ap-score.is-row { flex-direction: row; align-items: center; gap: 12px; }
  .ap-score.is-row .ap-bar { flex: 1 1 auto; }
  .ap-score.is-row .ap-score-pair { display: contents; }
  .ap-score.is-row .ap-score-pair > .ap-score-b, .ap-score.is-row .ap-score-pair > svg, .ap-score.is-row .ap-score-pair > strong { display: none; }
  .ap-score.is-row .ap-score-big { display: block; order: -1; font-size: 22px; font-weight: 600; color: var(--ui-ink); }
  .ap-score.is-row .ap-score-from { display: block; order: 2; font-size: 13px; color: var(--ui-ink-3); white-space: nowrap; }
  .ap-row.is-simple { grid-template-columns: 40px minmax(0, 1fr) auto 44px; grid-template-areas: "logo main main main" "act act act act"; }
  .ap-row.is-error { display: flex; }
  .ap-progress-main, .ap-progress-side { padding: 20px; }
  .ap-progress-title { font-size: 28px; }
  .ap-step-fact { display: none; }
  .ap-howsteps { grid-template-columns: minmax(0, 1fr); }
  .ap-pad { padding: 20px; }
  .ap-emptycard { padding: 28px 20px; }
}
/* Phones: compact "Tailoring" card — pill, title, bar and the current step —
   instead of the seven-step wall (Mobile-Dashboard board). */
@media (max-width: 600px) {
  #workspace > main > #apProgress:not([hidden]) { margin-top: 24px; }
  .ap-progress-main { padding: 16px; gap: 10px; }
  .ap-progress-title { font-size: 22px; }
  .ap-progress-top .ap-mono, .ap-progress-sub, .ap-steps, .ap-progress-side { display: none; }
  .ap-progress-bar { margin: 2px 0 0; }
  .ap-progress-now { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .ap-spin { animation-duration: 2.4s; }
  .ap-progress-bar span, .ap-mini-fill { transition: none; }
}
