:root{--ink:#102235;--muted:#657484;--line:#d9e1e8;--paper:#fff;--bg:#eef3f6;--navy:#0b1f33;--accent:#12a487;--accent-dark:#087c68;--amber:#d68b1f;--red:#d04a5a;--shadow:0 18px 50px rgba(16,34,53,.10)}
*{box-sizing:border-box}html{font-size:16px}body{margin:0;background:var(--bg);color:var(--ink);font:1rem/1.55 Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif}.topbar{height:68px;background:var(--navy);color:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 max(1rem,calc((100% - 1120px)/2));box-shadow:0 5px 20px rgba(4,15,28,.18)}.brand{display:flex;align-items:center;gap:.7rem;color:#fff;text-decoration:none;font-weight:750;letter-spacing:.01em}.brand-mark{display:grid;place-items:center;width:34px;height:34px;border:1px solid rgba(255,255,255,.25);border-radius:9px;background:var(--accent);font-size:.79rem}.topbar nav{display:flex;gap:.4rem}.topbar nav a{color:#d9e4ec;text-decoration:none;padding:.55rem .7rem;border-radius:7px;font-size:.9rem}.topbar nav a:hover{background:rgba(255,255,255,.08);color:#fff}.shell{width:min(1120px,calc(100% - 2rem));margin:0 auto;padding:3rem 0 5rem}.workspace-head,.report-head,.preview-head,.page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:2rem;margin-bottom:1.6rem}.eyebrow{margin:0 0 .4rem;color:var(--accent-dark);font-size:.73rem;font-weight:800;letter-spacing:.14em}h1{font-size:clamp(1.8rem,4vw,3rem);line-height:1.08;letter-spacing:-.04em;margin:0;max-width:760px}h2{font-size:1rem;margin:0 0 1rem}p{margin:.35rem 0}.truth-badge{display:flex;align-items:center;gap:.8rem;background:#daf4ed;border:1px solid #a8ddcf;padding:.8rem 1rem;border-radius:10px;min-width:260px}.truth-badge>span{display:grid;place-items:center;background:var(--accent);color:white;width:30px;height:30px;border-radius:50%}.truth-badge strong,.truth-badge small{display:block}.truth-badge small{color:#466f65}.job-form,.card,.recommendation,.history-row,.empty{background:var(--paper);border:1px solid var(--line);border-radius:14px;box-shadow:0 2px 4px rgba(16,34,53,.025)}.job-form{padding:1.5rem}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:1rem}label{display:block;font-weight:700;font-size:.89rem;margin-bottom:1rem}label small{color:var(--muted);font-weight:500}input,textarea{display:block;width:100%;margin-top:.45rem;border:1px solid #bdc9d3;border-radius:9px;background:#fbfcfd;color:var(--ink);font:inherit;padding:.76rem .85rem;outline:none}textarea{min-height:330px;resize:vertical;line-height:1.5}input:focus,textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(18,164,135,.14);background:#fff}.form-foot{display:flex;align-items:center;justify-content:space-between;gap:1.2rem;color:var(--muted);font-size:.82rem}.button,button{display:inline-flex;align-items:center;justify-content:center;min-height:44px;border-radius:8px;border:0;padding:.7rem 1.05rem;font:inherit;font-weight:750;text-decoration:none;cursor:pointer}.primary{background:var(--accent);color:white}.primary:hover{background:var(--accent-dark)}.primary:disabled{opacity:.65;cursor:wait}.secondary{background:#fff;color:var(--ink);border:1px solid #b8c5cf}.alert,.warnings{margin:1rem 0;padding:1rem;border:1px solid #efb4bb;background:#fff0f2;color:#8d2633;border-radius:10px}.score{min-width:150px;border:1px solid var(--line);border-top:4px solid var(--accent);border-radius:10px;background:#fff;padding:.8rem 1rem}.score small,.score strong,.score span{display:block}.score strong{font-size:1.45rem}.score span{font-size:.72rem;color:var(--muted);font-weight:750}.score-medium{border-top-color:var(--amber)}.score-low{border-top-color:var(--red)}.match-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:1rem}.card{padding:1.2rem;min-height:170px}.dot{display:inline-block;width:9px;height:9px;border-radius:50%;margin-right:.5rem}.good{background:var(--accent)}.partial{background:var(--amber)}.missing{background:var(--red)}.chips{display:flex;flex-wrap:wrap;gap:.5rem}.chips span,.pill{background:#edf2f5;border:1px solid #d9e2e8;padding:.34rem .58rem;border-radius:99px;font-size:.78rem}.chips em{font-size:.85rem;color:var(--muted)}.recommendation{margin-top:1rem;padding:1.2rem}.actions{display:flex;justify-content:flex-end;gap:.7rem;margin-top:1.4rem}.actions form{margin:0}.preview-head p,.report-head>div>p,.page-head p{color:var(--muted)}.paper-frame{background:#cfd8df;padding:2.5rem;overflow:auto;border-radius:12px;box-shadow:inset 0 1px 8px rgba(16,34,53,.12)}.warnings{color:#765313;background:#fff8e7;border-color:#ecd394}.warnings summary{cursor:pointer;font-weight:750}.history-list{display:grid;gap:.75rem}.history-row{padding:1rem 1.2rem;display:grid;grid-template-columns:1.3fr 1fr auto;gap:1rem;align-items:center}.history-row>div:first-child strong,.history-row>div:first-child span{display:block}.history-row>div:first-child span{color:var(--muted)}.history-meta{display:flex;gap:.6rem;align-items:center;flex-wrap:wrap;font-size:.82rem;color:var(--muted)}.row-actions{display:flex;gap:.7rem}.row-actions a{color:var(--accent-dark);font-weight:700;text-decoration:none}.empty{text-align:center;padding:4rem 1rem}.empty p{color:var(--muted);margin-bottom:1rem}
.password-form{max-width:620px}.password-success{max-width:720px;margin:2rem auto}.password-success h1{margin-inline:auto}.password-success p:not(.eyebrow){max-width:560px;margin:1rem auto 1.4rem}
.reference-upload{margin-bottom:1.5rem}.reference-table{display:grid;gap:.65rem}.reference-row{display:grid;grid-template-columns:1.4fr 1fr auto auto;gap:1rem;align-items:center;background:#fff;border:1px solid var(--line);border-radius:10px;padding:.9rem 1rem}.status-ready{color:var(--accent-dark);font-weight:750}.status-error{color:var(--red);font-weight:750}.reference-row form{margin:0}.reference-row button{min-height:36px;padding:.4rem .7rem}.file-input{padding:.55rem;background:#fff}
.url-field{display:grid;grid-template-columns:1fr auto;gap:.65rem;align-items:end}.url-field input{margin-top:.45rem}.url-field button{white-space:nowrap}.fetch-status{min-height:1.5rem;margin:-.55rem 0 .55rem;color:var(--muted);font-size:.85rem}.fetch-status.error{color:#8d2633}.fetch-status.success{color:var(--accent-dark)}.source-link{display:inline-block!important;margin-top:.25rem;color:var(--accent-dark)!important;font-size:.78rem;font-weight:700;text-decoration:none}
.danger{background:#fff0f2;color:#8d2633;border:1px solid #efb4bb}.link-danger{min-height:0;padding:0;background:none;color:#8d2633;font-size:inherit}.row-actions form{margin:0}.resume-edit-form textarea{min-height:120px}.resume-edit-form fieldset{margin:1rem 0;padding:1rem;border:1px solid var(--line);border-radius:10px}.resume-edit-form legend{font-weight:750}.resume-edit-form legend small{color:var(--muted);font-weight:500}.reset-form{margin-top:1rem}
.skill-group{margin:1.6rem 0}.skill-table{display:grid;gap:.55rem}.skill-row{display:grid;grid-template-columns:minmax(180px,1.5fr) auto auto auto auto auto minmax(190px,auto);gap:.8rem;align-items:center;background:#fff;border:1px solid var(--line);border-radius:10px;padding:.8rem 1rem;font-size:.82rem}.skill-row>div:first-child strong,.skill-row>div:first-child small{display:block}.skill-row small{color:var(--muted)}.skill-row.disabled{opacity:.55}.skill-row.learning{border-left:4px solid var(--amber)}.skill-divider{font-size:.72rem;font-weight:800;letter-spacing:.12em;color:var(--accent-dark)}.skill-divider.learning{color:#956112;margin-top:1.3rem}.skill-row a{color:var(--accent-dark);font-weight:700;text-decoration:none}.chips span small{display:block;color:var(--muted);margin-top:.2rem}.compact{min-height:90px}.check-row{display:flex;gap:1.5rem}.check-row label{display:flex;align-items:center;gap:.45rem}.check-row input,.evidence-form input[type=checkbox],.job-form fieldset input[type=checkbox]{width:auto;margin:0}select{display:block;width:100%;margin-top:.45rem;border:1px solid #bdc9d3;border-radius:9px;background:#fbfcfd;color:var(--ink);font:inherit;padding:.76rem .85rem}.job-form fieldset{margin:1rem 0;padding:1rem;border:1px solid var(--line);border-radius:10px}.evidence-form{margin-top:1.4rem}.reference-row code{overflow-wrap:anywhere}
@media(max-width:760px){.shell{width:min(100% - 1.2rem,1120px);padding:1.5rem 0 3rem}.topbar{padding:0 .8rem;height:auto;min-height:68px}.topbar nav{flex-wrap:wrap;justify-content:flex-end}.workspace-head,.report-head,.preview-head,.page-head{display:block}.truth-badge,.score{margin-top:1rem;width:100%}.form-grid,.match-grid{grid-template-columns:1fr}.job-form{padding:1rem}textarea{min-height:260px}.url-field{grid-template-columns:1fr}.url-field button{width:100%}.form-foot{display:block}.form-foot button{width:100%;margin-top:1rem}.actions{display:grid;grid-template-columns:1fr 1fr}.actions form,.actions button,.actions .button{width:100%}.preview-head .actions{display:grid;margin-bottom:1rem}.paper-frame{padding:.5rem}.history-row,.reference-row{grid-template-columns:1fr}.row-actions{border-top:1px solid var(--line);padding-top:.7rem}}
@media(max-width:900px){.skill-row{grid-template-columns:1fr 1fr}.skill-row .row-actions{grid-column:1/-1}}
.photo-panel{display:grid;grid-template-columns:180px 1fr;gap:1.5rem;align-items:start}.photo-preview{width:160px;height:160px;border-radius:50%;overflow:hidden;display:grid;place-items:center;background:#dbe4ea;color:var(--muted);border:5px solid #fff;box-shadow:var(--shadow)}.photo-preview img{width:100%;height:100%;object-fit:cover;object-position:50% 50%}.photo-panel>form:last-child{grid-column:2}.toggle-label{display:flex;align-items:center;gap:.55rem;min-height:44px}.toggle-label input{width:auto;margin:0}.toggle-label small{display:block}
@media(max-width:760px){.photo-panel{grid-template-columns:1fr}.photo-panel>form:last-child{grid-column:auto}.photo-preview{margin:0 auto}}
.quick-photo-dialog{width:min(460px,calc(100% - 2rem));border:1px solid var(--line);border-radius:14px;padding:1.4rem;box-shadow:0 24px 80px rgba(4,15,28,.3);color:var(--ink)}.quick-photo-dialog::backdrop{background:rgba(8,23,38,.6)}.quick-photo-dialog h2{font-size:1.35rem;margin:.2rem 0}.dialog-hint{color:var(--muted);margin-bottom:.8rem}.dialog-close{position:absolute;right:.7rem;top:.55rem;min-height:34px;padding:.1rem .65rem;background:transparent;color:var(--muted);font-size:1.4rem}.dialog-actions{display:flex;flex-wrap:wrap;gap:.6rem;margin-top:1rem}.dialog-actions form{margin:0}.quick-photo-status{min-height:1.4rem;color:var(--accent-dark);font-size:.88rem}.quick-photo-status.error{color:#8d2633}
.paper-frame .portrait-control{position:relative;padding:0;color:#fff;font:inherit;appearance:none;cursor:pointer;transition:filter .16s ease,box-shadow .16s ease}.paper-frame .portrait-control:hover,.paper-frame .portrait-control:focus-visible,.paper-frame .portrait-control.dragover{filter:brightness(.82);box-shadow:0 0 0 1.5mm var(--accent)}.paper-frame .portrait-control .portrait-edit{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(6,20,34,.35);opacity:0;transition:opacity .16s ease}.paper-frame .portrait-control:hover .portrait-edit,.paper-frame .portrait-control:focus-visible .portrait-edit,.paper-frame .portrait-control.dragover .portrait-edit{opacity:1}.paper-frame .portrait-control .portrait-edit svg{width:8mm;height:8mm;fill:#fff;filter:drop-shadow(0 1px 2px rgba(0,0,0,.4))}
.visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important;opacity:0!important;pointer-events:none}
.quick-photo-toast{position:fixed;top:1.5rem;right:1.5rem;z-index:99999;max-width:440px;padding:.9rem 1.25rem;border-radius:10px;box-shadow:0 12px 36px rgba(0,0,0,.25);font-size:.92rem;line-height:1.4;font-weight:600;display:flex;align-items:center;gap:.75rem}
.quick-photo-toast.error{background:#fef2f2;color:#991b1b;border:1px solid #f87171}
.quick-photo-toast.success{background:#f0fdf4;color:#166534;border:1px solid #86efac}
.quick-photo-toast.info{background:#eff6ff;color:#1e40af;border:1px solid #93c5fd}
.crop-dialog{width:min(420px,calc(100% - 2rem))}
.crop-viewport-wrapper{display:flex;justify-content:center;align-items:center;margin:1.2rem 0}
.crop-viewport{position:relative;width:240px;height:240px;border-radius:50%;overflow:hidden;cursor:grab;user-select:none;touch-action:none;background:#0f172a;box-shadow:inset 0 0 0 2px rgba(255,255,255,.4),0 8px 24px rgba(0,0,0,.25)}
.crop-viewport:active{cursor:grabbing}
.crop-viewport img{position:absolute;top:0;left:0;transform-origin:0 0;pointer-events:none;max-width:none;max-height:none}
.crop-circle-mask{position:absolute;inset:0;border-radius:50%;border:2px solid rgba(255,255,255,.6);pointer-events:none}
.crop-controls{display:flex;align-items:center;gap:1rem;margin:1rem 0}
.crop-controls label{font-size:.9rem;font-weight:600;white-space:nowrap;margin-bottom:0}
.crop-controls input[type=range]{flex:1;margin-top:0}
.badge{display:inline-block;padding:.2rem .55rem;border-radius:6px;font-size:.78rem;font-weight:700}
.badge-active{background:#daf4ed;color:#087c68}
.badge-inactive{background:#f1f5f9;color:#64748b}


/* AI Provider and Model Selection */
.provider-select {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background-color: #fff;
  color: #1e293b;
  width: 100%;
}
.provider-grid {
  margin-bottom: 1rem;
}
.field-hint {
  display: block;
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 0.35rem;
}

/* Provider badges and alerts */
.provider-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.provider-badge {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-weight: 600;
}
.fallback-badge {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-weight: 700;
}
.fallback-alert {
  background: #fffbeb;
  border: 1px solid #f59e0b;
  color: #92400e;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

/* Page Fit Diff Viewer */
.pre-fit-diff {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}
.pre-fit-diff summary {
  font-weight: 600;
  cursor: pointer;
  color: #2563eb;
}
.diff-content-wrapper {
  margin-top: 0.75rem;
  font-size: 0.88rem;
  line-height: 1.5;
}
.diff-notice {
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 0.75rem;
}
.diff-group {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed #e2e8f0;
}
.diff-text-compare {
  margin: 0.25rem 0;
}
.diff-label {
  font-weight: 600;
  color: #475569;
}
.diff-list {
  margin: 0.35rem 0 0 1.2rem;
  padding: 0;
}
.diff-list li {
  margin-bottom: 0.25rem;
}
del {
  color: #b91c1c;
  text-decoration: line-through;
}
ins {
  color: #15803d;
  text-decoration: none;
  font-weight: 500;
}

/* Compare View */
.compare-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.compare-column {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.25rem;
}
.compare-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}
.provider-pill {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}
.provider-pill.ollama {
  background: #e0f2fe;
  color: #0369a1;
}
.provider-pill.gemini {
  background: #ede9fe;
  color: #6d28d9;
}
.latency-badge {
  font-size: 0.8rem;
  font-weight: 600;
  background: #f1f5f9;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}
.error-badge {
  background: #fee2e2;
  color: #b91c1c;
}
.compare-section {
  margin-bottom: 1.2rem;
}
.compare-section h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: #64748b;
  margin: 0 0 0.35rem;
  letter-spacing: 0.04em;
}
.provider-error-box {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #9f1239;
  padding: 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

/* Diagnostics Table */
.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.health-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.75rem 1rem;
}
.health-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}
.status-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
}
.status-ok {
  background: #dcfce7;
  color: #15803d;
}
.status-unconfigured {
  background: #fef3c7;
  color: #b45309;
}
.status-error {
  background: #fee2e2;
  color: #b91c1c;
}
.table-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.table-responsive {
  overflow-x: auto;
}
.diag-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.diag-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  color: #475569;
}
.diag-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}
.status-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}
.tag-success {
  background: #dcfce7;
  color: #166534;
}
.tag-fallback {
  background: #fef3c7;
  color: #92400e;
}
.tag-error {
  background: #fee2e2;
  color: #991b1b;
}
.text-muted {
  color: #94a3b8;
}

/* Background Task Progress UI */
.task-progress-card {
  padding: 2rem;
  margin-top: 1.5rem;
}
.task-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.task-stage-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
}
.live-pulse {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(18, 164, 135, 0.7);
  animation: pulse-ring 1.8s infinite cubic-bezier(0.66, 0, 0, 1);
}
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(18, 164, 135, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(18, 164, 135, 0); }
  100% { box-shadow: 0 0 0 0 rgba(18, 164, 135, 0); }
}
.task-timer-meta {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}
.progress-track {
  width: 100%;
  height: 14px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
  margin: 1rem 0 1.5rem;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #2dd4bf);
  border-radius: 99px;
  transition: width 0.4s ease, background 0.3s ease;
}
.task-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}
.task-info-note small {
  color: var(--muted);
  line-height: 1.4;
}
.task-id-badge code {
  background: #f1f5f9;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.82rem;
}

.score-unreliable {
  border-top-color: #d97706 !important;
  background: #fffbeb !important;
}
.score strong.score-unreliable {
  color: #b45309 !important;
  font-size: 1.05rem !important;
  line-height: 1.25 !important;
}
.chips span.chip-item {
  display: inline-flex;
  flex-direction: column;
  gap: 0.25rem;
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  background: #f5f8fa;
  border: 1px solid #d9e3ea;
  margin-bottom: 0.35rem;
}
.chips span.chip-item strong {
  font-size: 0.86rem;
  color: var(--ink);
  font-weight: 700;
}
.chips span.chip-item small {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.35;
}
.chips span.chip-item small.evidence-note {
  color: #076e5d;
  font-weight: 600;
}
.chips span.chip-item small.gap-note {
  color: #b33948;
  font-weight: 600;
}
.requirements-table {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.requirement-row {
  padding: 0.85rem 1.1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.requirement-row.req-status-strong {
  border-left: 5px solid var(--accent);
}
.requirement-row.req-status-partial {
  border-left: 5px solid var(--amber);
}
.requirement-row.req-status-missing {
  border-left: 5px solid var(--red);
}
.requirement-row .req-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.badge.priority-badge {
  font-size: 0.68rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-weight: 750;
  letter-spacing: 0.04em;
}
.badge.priority-badge.mandatory {
  background: #fee2e2;
  color: #991b1b;
}
.badge.priority-badge.preferred {
  background: #fef3c7;
  color: #92400e;
}
.badge.status-badge.status-strong {
  background: #d1fae5;
  color: #065f46;
  font-size: 0.68rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}
.badge.status-badge.status-partial {
  background: #fef3c7;
  color: #92400e;
  font-size: 0.68rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}
.badge.status-badge.status-missing {
  background: #fee2e2;
  color: #991b1b;
  font-size: 0.68rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}
.req-quote small {
  color: #475569;
  background: #f8fafc;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  display: inline-block;
}
.req-evidence small {
  color: #065f46;
}
.req-reason small {
  color: #b91c1c;
}

/* Navigation must reflow when users enlarge text, including desktop widths. */
.topbar{height:auto;min-height:68px;flex-wrap:wrap;gap:.5rem;padding-top:.4rem;padding-bottom:.4rem}
.topbar nav{flex-wrap:wrap;min-width:0;max-width:100%;justify-content:flex-end}
.topbar nav a{overflow-wrap:anywhere}

.primary{background:var(--accent-dark);color:#fff}

.shell,.card,.requirement-row,.chip-item,fieldset{min-width:0;overflow-wrap:anywhere}

.login-panel{max-width:440px;margin:7vh auto;padding:24px}.login-panel label{display:block;margin:18px 0}.login-panel input{width:100%}.demo-marker{font-size:12px;opacity:.7}.fallback-settings{margin:16px 0;padding:16px;border:1px solid #d8dee6;border-radius:12px}.fallback-settings input[type=checkbox]{width:auto}.topbar form{margin:0}

.preview-head{flex-wrap:wrap}
.preview-head>.actions{flex-wrap:wrap;margin-top:0}
.preview-head>.actions .button,.preview-head>.actions button{white-space:nowrap}
.preview-controls{display:flex;flex-wrap:wrap;align-items:center;gap:.65rem;margin:1rem 0}
.preview-controls small{color:var(--muted)}
.paginated-preview{width:100%;max-width:210mm;margin:auto}
.preview-enlarged .paginated-preview{width:210mm;max-width:none}
.preview-page{position:relative;width:100%;aspect-ratio:210/297;background:#fff;margin:0 auto 24px;box-shadow:var(--shadow)}
.page-image{display:block;width:100%;height:100%}
.page-link{position:absolute;display:block}
.page-link:focus-visible{outline:2px solid var(--accent)}
/* The portrait is already painted into the PDF page. Keep only its hit target;
   browser text inflation and fixed-mm borders must not redraw it at another scale. */
.preview-page .portrait{overflow:hidden;border-radius:50%;display:flex;align-items:center;justify-content:center;background:transparent;border:0;min-height:0;min-width:0;color:white}
.preview-page .portrait img,.preview-page .portrait>span:first-child{opacity:0}
.paper-frame .preview-page .portrait-control .portrait-edit svg{width:32%;height:32%}

/* Review quality, qualification match and document readiness are independent. */
.preview-head>div,.report-head>div{min-width:0;max-width:100%}
.preview-head>div:first-child{flex:1 1 320px}
.preview-head>.actions{flex:0 1 100%;min-width:0}
.review-statuses,.review-statuses p,.provider-meta,.provider-meta .badge,.score,.score strong,.badge,.requirement-row{min-width:0;max-width:100%;overflow-wrap:anywhere;white-space:normal}
.review-statuses{margin:.75rem 0;line-height:1.5}
.provider-meta{display:flex;flex-wrap:wrap;gap:.4rem}
.score{flex:0 1 260px}
.preview-head>.actions .button,.preview-head>.actions button{white-space:normal;text-align:center}
.requirement-components{display:grid;gap:.5rem;margin:.6rem 0;padding-left:1.2rem}
@media(max-width:760px){.review-statuses{width:100%}.preview-head>.actions{grid-template-columns:repeat(2,minmax(0,1fr))}}
