/* Career OS Beta 1.0 — the B7.1 Opportunity View, built only from the
   design-system tokens (static/tokens.css is design-system/baseline/tokens.css,
   copied verbatim) and the baseline component patterns. Approved by the owner
   for these screens (handoff I-5). No new tokens; no inline styles (CSP). */

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--surface-page); color: var(--text-primary);
  font-family: var(--font-sans); font-size: 15px; line-height: 1.5;
  font-synthesis: none; min-height: 100vh; display: flex; flex-direction: column;
}
p { margin: 0; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Topbar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: 14px 22px; border-bottom: 1px solid var(--border-subtle); background: var(--surface-raised);
  position: sticky; top: 0; z-index: 10; }
.brand-name { font-family: var(--font-serif); font-weight: 600; font-size: 17px; white-space: nowrap;
  color: var(--text-primary); text-decoration: none; }
.nav { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.credits { font-size: 13.5px; color: var(--text-secondary); white-space: nowrap; padding: 0 var(--sp-1); }
.nav-btn { background: transparent; border: 1px solid transparent; color: var(--text-secondary);
  padding: 7px 12px; border-radius: var(--radius-control); cursor: pointer; font: inherit; font-size: 14px;
  min-height: 36px; white-space: nowrap; }
.nav-btn:hover { color: var(--text-primary); background: var(--surface-sunken); }
.nav-btn[aria-current="page"] { color: var(--text-primary); background: var(--surface-sunken); border-color: var(--border-subtle); }

/* Layout and type */
.view { width: 100%; max-width: var(--view-max); margin: 0 auto; padding: var(--sp-5) var(--sp-6) var(--sp-6);
  display: flex; flex-direction: column; gap: var(--sp-3); flex: 1; }
.page-title { font-family: var(--font-serif); font-size: 24px; line-height: 1.35; font-weight: 600; margin: 0;
  overflow-wrap: anywhere; }
.muted { color: var(--text-secondary); font-size: 13.5px; }
h3 { font-size: 15px; font-weight: 600; margin: 0; }
.flash { color: var(--text-primary); font-size: 14px; }
.empty { padding: var(--sp-4) 0; display: flex; flex-direction: column; gap: var(--sp-3); align-items: flex-start; }
.empty h2 { margin: 0; font-size: 17px; font-weight: 600; }
.empty p { color: var(--text-secondary); max-width: 520px; }
.back { align-self: flex-start; font-size: 14px; }

/* Buttons and links */
.btn { background: var(--surface-sunken); border: 1px solid var(--border-control); color: var(--text-primary);
  padding: 9px 16px; border-radius: var(--radius-control); cursor: pointer; font: inherit; font-size: 14px;
  font-weight: 500; min-height: 39px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--link); }
.btn.primary { background: var(--action-primary); border-color: var(--action-primary); color: var(--on-action-primary); font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: var(--action-primary-hover); border-color: var(--action-primary-hover); }
.btn.danger { border-color: var(--status-error); color: var(--status-error); }
a.btn { text-decoration: none; }
.btn.small { padding: 4px 12px; font-size: 13px; min-height: 32px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: cospin .9s linear infinite; flex: none; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--link); text-decoration: underline;
  text-underline-offset: 2px; cursor: pointer; text-align: left; min-height: 24px; }
.link:hover:not(:disabled) { text-decoration-thickness: 2px; }
.link:disabled { color: var(--text-secondary); text-decoration: none; cursor: not-allowed; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.req { color: var(--link); }
input, textarea, select { background: var(--surface-sunken); border: 1px solid var(--border-control);
  color: var(--text-primary); border-radius: var(--radius-control); padding: 10px 12px; font: inherit;
  font-size: 14px; width: 100%; }
textarea { resize: vertical; line-height: 1.45; }
input:focus-visible, textarea:focus-visible, select:focus-visible { border-color: var(--focus-ring); }
input[readonly], textarea[readonly] { opacity: .75; }
[aria-invalid="true"] { border-color: var(--status-error); }
.field-error { color: var(--status-error); font-size: 13px; }
.field-error::before { content: "! "; font-weight: 700; }
.field-hint { color: var(--text-secondary); font-size: 13px; }
.field-ok { color: var(--status-ready); font-size: 13px; }
.field-ok::before { content: "✓ "; font-weight: 700; }
.url-row { display: flex; gap: var(--sp-2); align-items: stretch; }
.url-row input { flex: 1; min-width: 0; }
.url-row .btn { white-space: nowrap; }
.note-warning { color: var(--status-warning); font-size: 13.5px; }
.note-warning::before { content: "◐ "; font-weight: 700; }
.note-error { color: var(--status-error); font-size: 14px; }
.note-error::before { content: "! "; font-weight: 700; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.grid2.one { grid-template-columns: minmax(0, 1fr); }
details > summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--text-primary); }
details > summary:hover { color: var(--link); }
.status-select { max-width: 240px; }

/* Validation indicator: glyph + word + color, never color alone */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
  padding: 2px 10px 2px 8px; border-radius: var(--radius-pill); line-height: 1.5; white-space: nowrap; }
.status::before { font-weight: 700; }
.status .spin { display: none; width: 11px; height: 11px; }
.status-error { color: var(--status-error); background: var(--status-error-bg); }
.status-error::before { content: "!"; }
.status-warning { color: var(--status-warning); background: var(--status-warning-bg); }
.status-warning::before { content: "◐"; }
.status-ready { color: var(--status-ready); background: var(--status-ready-bg); }
.status-ready::before { content: "●"; }
.status-complete { color: var(--status-complete); padding-left: 0; }
.status-complete::before { content: "✓"; }
.status-neutral, .status-skipped, .status-running { color: var(--text-secondary); padding-left: 0; font-weight: 500; }
.status-neutral::before { content: "○"; }
.status-skipped::before { content: "–"; }
.status-running .spin { display: inline-block; }

/* Section header and Opportunity Section */
.section-header { display: flex; align-items: center; gap: var(--sp-3); min-height: var(--target-comfort); }
.section-header .section-title { min-width: 0; }
.section-header .btn { flex: none; }
.section-num { flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 12.5px; font-weight: 700; color: var(--text-secondary); border: 1px solid var(--border-control); }
.section-title { font-size: 15px; font-weight: 600; line-height: 1.4; margin: 0; color: var(--text-primary); }
.spacer { flex: 1; }
.opp-section { border-radius: var(--radius); }
.opp-section[data-state="collapsed"] { padding: var(--sp-1) var(--sp-3); border-bottom: 1px solid var(--border-subtle); border-radius: 0; }
.opp-section[data-state="semi"] { background: var(--surface-raised); border: 1px solid var(--border-subtle); padding: var(--sp-2) var(--sp-4) var(--sp-4); }
.opp-section[data-state="expanded"] { background: var(--surface-raised); border: 1px solid var(--border-control);
  box-shadow: var(--shadow); padding: var(--sp-2) var(--sp-5) var(--sp-5); }
.opp-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); margin-top: var(--sp-2); align-items: start; }
.opp-panels > .span-all { grid-column: 1 / -1; }
.jd-body { display: flex; flex-direction: column; gap: var(--sp-4); margin-top: var(--sp-2); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); margin: 0; }
.facts dt { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.notice { border: 1px solid var(--border-control); border-radius: var(--radius-control); background: var(--surface-sunken);
  padding: var(--sp-3) var(--sp-4); display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; justify-content: space-between; }
.notice p { font-size: 14px; }

/* Disclosure panel */
.disclosure { background: var(--surface-sunken); border: 1px solid var(--border-control); border-radius: var(--radius-control); min-width: 0; }
.disclosure-head { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4); min-height: var(--target-comfort); }
.disclosure-label { font-weight: 600; font-size: 14px; }
.disclosure-body { padding: 0 var(--sp-4) var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); }

/* Loading */
.loading { display: flex; align-items: center; gap: var(--sp-3); color: var(--text-secondary); padding: var(--sp-2) 0; }
.spinner { width: 24px; height: 24px; border: 3px solid var(--border-subtle); border-top-color: var(--link);
  border-radius: 50%; animation: cospin .9s linear infinite; flex: none; }
@keyframes cospin { to { transform: rotate(360deg); } }

/* Opportunity rows (My Jobs) */
.opp-rows { list-style: none; padding: 0; margin: 0; }
.opp-row { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-3) 0; border-bottom: 1px solid var(--border-subtle);
  min-height: var(--target-comfort); margin: 0; }
.opp-row:last-child { border-bottom: 0; }
.opp-row-main { flex: 1; min-width: 0; }
.opp-row-title { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.opp-row-meta { display: block; font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.row-select { width: 180px; flex: none; padding: 7px 10px; }
.pager { border-top: 1px solid var(--border-subtle); padding-top: var(--sp-2); }

/* Analysis */
.fp-headline { font-size: 17px; font-weight: 600; line-height: 1.35; }
.problems { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.problems li { display: flex; flex-direction: column; gap: 2px; }
.problem-head { display: flex; gap: var(--sp-2); align-items: baseline; flex-wrap: wrap; }
.tag { display: inline-block; font-size: 12px; font-weight: 500; color: var(--text-secondary); border: 1px solid var(--border-control);
  border-radius: var(--radius-pill); padding: 0 8px; white-space: nowrap; }
.sub { font-size: 14px; color: var(--text-secondary); }
.divider { border-top: 1px solid var(--border-subtle); padding-top: var(--sp-3); }
.full-analysis { display: flex; flex-direction: column; gap: var(--sp-3); padding-top: var(--sp-2); }
.full-analysis h4 { margin: 0; font-size: 14px; font-weight: 600; }
.full-analysis p { font-size: 14px; color: var(--text-secondary); white-space: pre-line; }
.stack { display: flex; flex-direction: column; gap: var(--sp-2); }

/* Verdict (VerdictCard content, no nested card surface inside the Output panel) */
.verdict-eyebrow { font-size: 12.5px; color: var(--text-secondary); }
.verdict-headline { font-family: var(--font-serif); font-size: 21px; font-weight: 600; line-height: 1.35; margin: 0; }
.verdict-support { font-size: 15px; line-height: 1.6; color: var(--text-secondary); max-width: 62ch; }
.why-label { font-weight: 700; color: var(--text-primary); }
.perspectives { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--sp-4); }
.persp-title { font-size: 12.5px; font-weight: 700; color: var(--text-secondary); margin: 0 0 var(--sp-1); }
.persp-headline { font-family: var(--font-serif); font-size: 18px; font-weight: 600; line-height: 1.35; }
.persp-factors { font-size: 13px; color: var(--text-secondary); }
.persp-list { margin: var(--sp-1) 0 0; padding-left: 1.1em; font-size: 14px; }
.invest-list { margin: var(--sp-1) 0 0; padding-left: 1.1em; font-size: 14px; }
.stats { display: flex; flex-wrap: wrap; gap: var(--sp-4); font-size: 14px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.stats b { color: var(--text-primary); font-weight: 800; font-size: 17px; margin-left: 4px; }
/* Beta 1.1: fit basis, score legend, per-point "Why" disclosure */
.basis-list, .score-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-1); font-size: 14px; }
.basis-list span[aria-hidden] { display: inline-block; width: 1.2em; color: var(--text-secondary); }
.score-legend { color: var(--text-secondary); font-size: 13px; }
.score-legend strong { color: var(--text-primary); font-weight: 600; }
.problem-why > summary { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.run-meta { font-size: 11.5px; letter-spacing: .2px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
pre { white-space: pre-wrap; font: inherit; font-size: 13px; margin: 0; color: var(--text-primary); background: var(--surface-page);
  padding: var(--sp-3); border-radius: var(--radius-control); max-height: 220px; overflow: auto; }
/* Original job description reading area (B7.1): bounded, scrolls inside. */
pre.jd-view { font-size: 14.5px; line-height: 1.6; padding: var(--sp-3) var(--sp-4); min-height: 240px; max-height: 400px;
  overflow-y: auto; overflow-wrap: anywhere; border: 1px solid var(--border-subtle); }
.upload-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.upload-btn { display: inline-flex; align-items: center; background: var(--surface-sunken); border: 1px solid var(--border-control);
  color: var(--text-primary); padding: 7px 14px; border-radius: var(--radius-control); cursor: pointer; font-size: 13px; font-weight: 500; min-height: 32px; }
.upload-btn:hover { border-color: var(--link); }
.upload-btn:focus-within { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.upload-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-status { font-size: 12.5px; color: var(--text-secondary); }
.upload-status.ok { color: var(--status-ready); }
.upload-status.err { color: var(--status-error); }

/* Save card (B9): inline, after the result */
.save-card { border: 1px solid var(--border-control); border-radius: var(--radius-control); background: var(--surface-raised);
  padding: var(--sp-3) var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); }
.save-card h3 { font-size: 15px; }

/* Dialog */
dialog { background: var(--surface-raised); color: var(--text-primary); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); padding: var(--sp-5); width: min(440px, 92vw); }
dialog::backdrop { background: var(--backdrop); }
dialog h2 { font-size: 17px; font-weight: 600; margin: 0 0 var(--sp-2); }
dialog form { display: flex; flex-direction: column; gap: var(--sp-3); margin: 0; }
dialog .actions { margin-top: var(--sp-2); }

.foot { margin-top: auto; padding: 10px var(--sp-6); border-top: 1px solid var(--border-subtle); display: flex; gap: 12px;
  align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--text-secondary); }

/* Mobile (under breakpoint-md): stack, keep the hierarchy */
@media (max-width: 820px) {
  .topbar { padding: 10px var(--sp-4); gap: var(--sp-2); flex-wrap: wrap; }
  .nav { width: 100%; justify-content: space-between; }
  .nav-btn { padding: 7px 8px; }
  .topbar .btn { padding: 7px 10px; font-size: 13px; }
  .view { padding: var(--sp-4) var(--sp-4) var(--sp-6); }
  .section-header { gap: var(--sp-2); }
  .opp-section[data-state="expanded"] { padding: var(--sp-2) var(--sp-3) var(--sp-4); }
  .opp-section[data-state="semi"] { padding: var(--sp-2) var(--sp-3) var(--sp-3); }
  .opp-panels, .grid2, .facts { grid-template-columns: minmax(0, 1fr); }
  .url-row { flex-direction: column; }
  .disclosure-body { padding: 0 var(--sp-3) var(--sp-3); }
  .opp-row { flex-wrap: wrap; row-gap: var(--sp-2); }
  .row-select { width: 100%; }
  .verdict-headline { font-size: 20px; }
  pre.jd-view { min-height: 160px; max-height: 320px; padding: var(--sp-3); }
  .foot { padding: 10px var(--sp-4); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.field-hint.prefill strong { color: var(--text-primary); font-weight: 600; }
.check-field { flex-direction: row; align-items: flex-start; gap: var(--sp-2); }
.check-field input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--action-primary); }
.next-features { margin-top: var(--sp-6); padding-top: var(--sp-4); border-top: 1px solid var(--border-subtle); }
.next-features .section-title { color: var(--text-secondary); font-size: 14px; }
.dev-rows { list-style: none; margin: var(--sp-2) 0 0; padding: 0; }
.dev-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--sp-2) var(--sp-4); padding: var(--sp-2) 0; border-bottom: 1px solid var(--border-subtle); }
.dev-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 260px; }
.dev-name { font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.dev-name .status { margin-left: var(--sp-1); font-size: 12px; }
.dev-desc { font-size: 13px; color: var(--text-secondary); }
.dev-vote { display: flex; align-items: center; gap: var(--sp-2); flex: none; }
.dev-vote .muted { font-size: 13px; }
.vote-btn[aria-pressed="true"] { border-color: var(--link); color: var(--text-primary); }
.dev-err { flex-basis: 100%; margin: 0; }
