:root {
  --ink: #20231f;
  --muted: #6d7169;
  --paper: #f5f3ed;
  --surface: #fffefb;
  --line: #deddd6;
  --accent: #e45935;
  --accent-dark: #bd3d1f;
  --green: #1d7455;
  --amber: #9b6414;
  --red: #a33d35;
  --blue: #3f6398;
  --shadow: 0 18px 50px rgba(40, 37, 29, .09);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 72px;
  display: grid;
  grid-template-columns: 270px 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 0 28px 0 22px;
  color: #f7f4eb;
  background: #20231f;
  border-bottom: 1px solid #363a34;
}
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; letter-spacing: .08em; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #777d70; border-radius: 50%; color: #20231f; background: #d9e4a8; font: 800 18px/1 Georgia, serif; }
.brand strong { display: block; font-size: 14px; }
.brand small { display: block; margin-top: 2px; color: #aeb3aa; font-size: 10px; letter-spacing: .04em; }
.topbar-state { justify-self: center; display: flex; align-items: center; gap: 8px; color: #c7cbc3; font-size: 13px; }
.safe-dot { width: 8px; height: 8px; border-radius: 50%; background: #91bd70; box-shadow: 0 0 0 4px rgba(145,189,112,.12); }
.user-controls { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.actor { min-width: 0; display: grid; gap: 1px; padding: 7px 12px; border: 1px solid #484d46; border-radius: 12px; color: #dfe1dc; font-size: 12px; }
.actor strong { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actor span { color: #9fa59b; font-size: 9px; }
.topbar-button { padding: 7px 9px; border: 0; border-radius: 9px; color: #cfd3cb; background: transparent; font-size: 11px; cursor: pointer; }
.topbar-button:hover { color: #fff; background: #343832; }

.shell { min-height: calc(100vh - 72px); display: grid; grid-template-columns: 292px minmax(0,1fr); }
.sidebar { position: sticky; top: 72px; height: calc(100vh - 72px); padding: 25px 18px; overflow: auto; background: #ebe9e2; border-right: 1px solid var(--line); }
.sidebar-title { display: flex; align-items: center; justify-content: space-between; padding: 0 5px 14px; font-weight: 750; }
.sidebar-home { padding: 0; border: 0; font-weight: 800; background: transparent; cursor: pointer; }
.sidebar-home:hover { color: var(--accent-dark); }
.count { min-width: 24px; padding: 3px 8px; border-radius: 99px; text-align: center; color: var(--muted); background: #dcd9cf; font-size: 12px; }
.search input { width: 100%; padding: 11px 13px; border: 1px solid #d4d1c6; border-radius: 11px; outline: none; background: rgba(255,255,255,.62); }
.search input:focus { border-color: #8d9188; box-shadow: 0 0 0 3px rgba(50,55,49,.08); }
.article-list { display: grid; gap: 7px; margin-top: 15px; }
.article-item { width: 100%; display: grid; gap: 5px; padding: 13px 14px; border: 1px solid transparent; border-radius: 12px; text-align: left; background: transparent; cursor: pointer; }
.article-item:hover { background: rgba(255,255,255,.55); }
.article-item.active { border-color: #d3d0c6; background: var(--surface); box-shadow: 0 7px 22px rgba(40,37,29,.06); }
.article-id { font-weight: 750; }
.article-stage { color: var(--muted); font-size: 12px; line-height: 1.35; }
.article-owner { overflow: hidden; color: #52624f; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.article-owner.unassigned { color: var(--amber); }
.article-numbers { display: flex; gap: 10px; color: #888b84; font-size: 11px; }

.main { min-width: 0; padding: 38px clamp(24px,4vw,64px) 80px; }
.welcome { width: min(1320px,100%); min-height: 68vh; margin: 0 auto; }
.welcome-art { width: 150px; height: 194px; display: grid; place-items: center; margin-bottom: 24px; border-radius: 80px 80px 22px 22px; color: #20231f; background: #d9e4a8; box-shadow: 22px 20px 0 #e8b7a6, var(--shadow); transform: rotate(-3deg); }
.welcome-art span { font: 800 64px/1 Georgia, serif; transform: rotate(3deg); }
.eyebrow { margin: 0 0 9px; color: var(--accent-dark); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.welcome h1, .workspace h1 { margin: 0; font: 600 clamp(30px,4vw,54px)/1.04 Georgia, "Times New Roman", serif; letter-spacing: -.025em; }
.welcome > p:last-child { max-width: 530px; margin: 18px auto 0; color: var(--muted); line-height: 1.6; }
.portfolio-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.portfolio-head > div > p:last-child { max-width: 720px; margin: 13px 0 0; color: var(--muted); line-height: 1.55; }
.portfolio-head-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 9px; }
.portfolio-summary { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin: 30px 0 20px; }
.portfolio-summary article { display: grid; gap: 4px; padding: 17px 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: 0 7px 22px rgba(40,37,29,.035); }
.portfolio-summary strong { font: 650 28px/1 Georgia,serif; }
.portfolio-summary span { color: var(--muted); font-size: 11px; }
.portfolio-filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px 24px; margin: 0 0 18px; }
.portfolio-filter-group { min-width: 0; display: grid; gap: 7px; }
.portfolio-filter-group > span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.portfolio-toolbar { display: flex; gap: 7px; margin: 0; overflow-x: auto; }
.portfolio-filter { min-height: 36px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: transparent; white-space: nowrap; cursor: pointer; }
.portfolio-filter.active { border-color: var(--ink); color: #fff; background: var(--ink); }
.portfolio-list { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 13px; }
.portfolio-card { min-width: 0; display: grid; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; text-align: left; background: var(--surface); box-shadow: 0 8px 24px rgba(40,37,29,.045); transition: transform .15s,box-shadow .15s; }
.portfolio-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(40,37,29,.08); }
.portfolio-card.priority-high { border-left: 4px solid var(--accent); }
.portfolio-card.priority-medium { border-left: 4px solid #d6a140; }
.portfolio-card.priority-low { border-left: 4px solid #9eb48d; }
.portfolio-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.portfolio-card-open { width: 100%; display: grid; gap: 10px; padding: 18px; border: 0; text-align: left; background: transparent; cursor: pointer; }
.portfolio-card-open:focus-visible { outline: 3px solid rgba(228,89,53,.28); outline-offset: -3px; }
.portfolio-action { min-height: 38px; font: 600 19px/1.25 Georgia,serif; }
.portfolio-card-meta { display: flex; flex-wrap: wrap; gap: 7px 12px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.portfolio-due { color: var(--accent-dark); font-weight: 800; }
.portfolio-owner-row { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; border-top: 1px solid #ebe9e1; background: #faf9f5; }
.owner-chip { min-width: 0; display: flex; align-items: center; gap: 8px; }
.owner-chip > span:last-child { min-width: 0; display: grid; gap: 1px; }
.owner-chip strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.owner-chip small { color: var(--muted); font-size: 8px; }
.owner-chip.unassigned strong { color: var(--amber); }
.owner-avatar { width: 29px; height: 29px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #59665a; font-size: 9px; font-weight: 850; }
.owner-chip.unassigned .owner-avatar { color: #7b6032; background: #eee2c7; }
.owner-action { flex: 0 0 auto; padding: 6px 8px; border: 1px solid #ccc9bf; border-radius: 8px; color: #464b44; background: #fff; font-size: 9px; font-weight: 800; cursor: pointer; }
.owner-action:hover { border-color: #8e9289; }
#portfolio-more { margin: 18px auto 0; }
.timeline-kind { margin-bottom: 5px; color: var(--accent-dark); font-size: 9px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.history-more { width: 100%; margin-top: 9px; }

.workspace { max-width: 1500px; margin: 0 auto; }
.workspace-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.workspace-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.workspace h1 { font-size: clamp(32px,4vw,50px); }
.muted { margin: 10px 0 0; color: var(--muted); }
.responsibility-card { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 20px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.55); }
.responsibility-card > div:first-child { min-width: 0; display: grid; gap: 6px; }
.responsibility-card .eyebrow { margin: 0; }
.responsibility-meta { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.4; }
.responsibility-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }
.responsibility-view-only { color: var(--amber); font-size: 10px; font-weight: 750; }
.status-pill, .badge { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 9px; border-radius: 99px; font-size: 11px; font-weight: 750; line-height: 1.15; }
.status-pill { color: #fff; background: var(--ink); }
.button { min-height: 42px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 11px; font-weight: 700; background: var(--surface); cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; }
.button:hover:not(:disabled):not([aria-disabled="true"]) { transform: translateY(-1px); box-shadow: 0 7px 18px rgba(40,37,29,.09); }
.button:disabled { color: #aaa9a4; background: #efeee9; cursor: not-allowed; }
.button[aria-disabled="true"] { color: #77746d; background: #efeee9; cursor: help; }
.button.primary { border-color: var(--accent); color: #fff; background: var(--accent); }
.button.primary:hover:not(:disabled):not([aria-disabled="true"]) { background: var(--accent-dark); }
.button.wide { width: 100%; }
.button.subtle { border-color: #c9c7be; color: #3d433c; background: #f1f0ea; }
.button small { display: block; margin-top: 3px; color: inherit; font-size: 10px; font-weight: 500; opacity: .72; }

.progress { display: grid; grid-template-columns: repeat(6,1fr); gap: 0; margin: 34px 0 30px; padding: 0; list-style: none; counter-reset: steps; }
.progress li { position: relative; padding-top: 25px; color: #8b8e87; font-size: 11px; text-align: center; }
.progress li::before { content: ""; position: absolute; z-index: 1; top: 5px; left: calc(50% - 6px); width: 12px; height: 12px; border: 3px solid var(--paper); border-radius: 50%; background: #c9c8c1; }
.progress li::after { content: ""; position: absolute; top: 10px; left: -50%; width: 100%; height: 2px; background: #d4d2ca; }
.progress li:first-child::after { display: none; }
.progress li.done { color: var(--ink); font-weight: 700; }
.progress li.done::before, .progress li.done::after { background: var(--green); }
.progress li.current { color: var(--ink); font-weight: 800; }
.progress li.current::before { width: 16px; height: 16px; top: 3px; left: calc(50% - 8px); border: 4px solid var(--paper); background: var(--accent); box-shadow: 0 0 0 2px rgba(228,89,53,.22); }
.progress li.current::after { background: linear-gradient(90deg,var(--green),#d4d2ca); }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 4px 0 20px; }
.section-heading.compact { align-items: center; margin: 0 0 12px; }
.section-heading h2 { margin: 0; font: 600 28px/1.15 Georgia, serif; }
.section-heading p:not(.eyebrow) { max-width: 640px; margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

.jobs-section { margin: -4px 0 26px; padding: 17px 18px; border: 1px solid #d5d8cb; border-radius: 16px; background: #f0f3e7; }
.jobs-section .section-heading h2 { font-size: 22px; }
.job-list { display: grid; gap: 9px; }
.job-card { display: grid; grid-template-columns: minmax(190px,1fr) minmax(150px,2fr) auto; align-items: center; gap: 14px; padding: 12px 13px; border: 1px solid rgba(94,100,83,.18); border-radius: 12px; background: rgba(255,255,255,.72); }
.job-main { min-width: 0; }
.job-main strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.job-main small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.job-progress { min-width: 0; }
.job-progress-row { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.progress-track { width: 100%; height: 7px; display: block; overflow: hidden; border: 0; border-radius: 99px; appearance: none; background: #dfe2d5; }
.progress-track::-webkit-progress-bar { border-radius: 99px; background: #dfe2d5; }
.progress-track::-webkit-progress-value { min-width: 8px; border-radius: 99px; background: var(--green); transition: width .35s ease; }
.progress-track::-moz-progress-bar { min-width: 8px; border-radius: 99px; background: var(--green); }
.progress-track:not([value]), .progress-track:not([value])::-webkit-progress-bar { background: linear-gradient(90deg,#dfe2d5 0%,#9eb58c 45%,#dfe2d5 90%); background-size: 220% 100%; animation: job-scan 1.5s linear infinite; }
@keyframes job-scan { to { background-position: -220% 0; } }
.job-card.failed { border-color: #e0bab5; background: #fff7f5; }
.job-card.failed .progress-track::-webkit-progress-value { background: var(--red); }
.job-card.failed .progress-track::-moz-progress-bar { background: var(--red); }
.job-card.cancelled { opacity: .66; }
.job-error { margin: 5px 0 0; color: var(--red); font-size: 10px; line-height: 1.4; }
.job-detail { margin: 5px 0 0; color: var(--green); font-size: 10px; line-height: 1.4; }
.job-cancel { min-height: 34px; padding: 6px 10px; font-size: 11px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 6px; overflow-x: auto; }
.tab { padding: 13px 10px 12px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; white-space: nowrap; cursor: pointer; }
.tab.active { border-color: var(--accent); color: var(--ink); font-weight: 750; }
.tab span { color: #969991; font-size: 11px; }
.filter { display: flex; align-items: center; gap: 8px; padding-bottom: 9px; color: var(--muted); font-size: 12px; }
.filter select { padding: 7px 30px 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }

.candidate-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(255px,1fr)); gap: 24px; align-items: start; }
.hypothesis-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 18px; align-items: stretch; }
.hypothesis-card { min-width: 0; display: flex; flex-direction: column; padding: 19px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 7px 22px rgba(40,37,29,.04); }
.hypothesis-card.active-job { border-color: #aeb99b; box-shadow: inset 0 0 0 1px #cbd4bd; }
.hypothesis-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.hypothesis-origin { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 5px; }
.hypothesis-number { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--ink); font: 700 13px/1 Georgia, serif; }
.hypothesis-card h3 { margin: 0; font: 600 22px/1.18 Georgia, serif; }
.hypothesis-copy { margin: 10px 0 10px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.hypothesis-effect { flex: 1; margin: 0 0 14px; color: #3f5c48; font-size: 11px; line-height: 1.45; }
.hypothesis-risk { margin: 0 0 14px; padding: 9px 10px; border-radius: 9px; color: #6f5225; background: #fbf2df; font-size: 11px; line-height: 1.45; }
.hypothesis-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.hypothesis-card .button { width: 100%; }
.hypothesis-actions { display: grid; gap: 8px; margin-top: auto; }
.empty-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; margin-top: 15px; }
.candidate-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: 0 7px 22px rgba(40,37,29,.045); }
.image-wrap { position: relative; aspect-ratio: 3/4; overflow: hidden; background: #dddcd5; cursor: zoom-in; }
.image-wrap img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .35s; }
.candidate-card:hover .image-wrap img { transform: scale(1.018); }
.image-label { position: absolute; top: 11px; left: 11px; padding: 5px 9px; border-radius: 99px; color: #fff; background: rgba(25,28,25,.82); backdrop-filter: blur(7px); font-size: 11px; font-weight: 750; }
.card-body { padding: 15px 15px 16px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 11px; }
.badge.ai { color: #334f77; background: #e6edf7; }
.badge.manual { color: #6b4a14; background: #f6e7bb; }
.badge.pass { color: #155b42; background: #dff0e7; }
.badge.warn { color: #7e4d0a; background: #f7e8ca; }
.badge.fail { color: #8d342d; background: #f5dedb; }
.badge.decision { color: #5b436b; background: #eee4f1; }
.badge.lineage { color: #4f5c43; background: #e8eddf; }
.badge.job { color: #264e58; background: #dfeff0; }
.card-body h3 { margin: 0; font-size: 16px; line-height: 1.25; }
.card-copy { min-height: 38px; margin: 8px 0 10px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.issue { margin: 9px 0; padding: 9px 10px; border-left: 3px solid #d59e45; color: #684a1c; background: #fbf2df; font-size: 11px; line-height: 1.45; }
.card-meta { display: flex; justify-content: space-between; gap: 8px; margin: 11px 0; color: #8a8d86; font-size: 11px; }
.card-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.card-actions .button { min-height: 38px; padding: 8px 10px; font-size: 12px; }
.adopt-button { margin-top: 8px; }
.revoke-selection-button { margin-top: 8px; color: #862e28; }
.selection-undo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #e6c999;
  border-radius: 16px;
  background: #fff8ed;
}
.selection-undo-banner p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.selection-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.details { margin-top: 12px; border-top: 1px solid #eceae3; }
.details summary { padding-top: 11px; color: var(--muted); font-size: 11px; cursor: pointer; }
.details p { max-height: 140px; overflow: auto; margin: 8px 0 0; color: #676a64; font-size: 11px; line-height: 1.5; white-space: pre-wrap; }

.next-step-card, .ready-file-card, .test-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 26px;
  padding: 24px 26px;
  border: 1px solid #d4d9c8;
  border-radius: 18px;
  background: linear-gradient(120deg,#f1f4e9,#fffefb 72%);
  box-shadow: 0 9px 28px rgba(40,37,29,.05);
}
.next-step-card h2, .ready-file-card h2, .test-hero h2 { margin: 0; font: 600 27px/1.18 Georgia, serif; }
.next-step-card p:not(.eyebrow), .ready-file-card p:not(.eyebrow), .test-hero p:not(.eyebrow) { max-width: 760px; margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.next-step-card .button, .ready-file-card .button { flex: 0 0 auto; }
.compact-empty { padding: 44px 22px; }
.final-section { margin-top: 28px; padding-top: 25px; border-top: 1px solid var(--line); }
.protection-card { display: grid; grid-template-columns: minmax(240px,.8fr) minmax(300px,1.2fr); gap: 24px; align-items: center; padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.protection-card.verified { border-color: #b8d6c7; background: #f7fcf9; }
.protection-card.rejected, .protection-card.invalid { border-color: #e0bab5; background: #fff8f6; }
.protection-copy h3 { margin: 0; font: 600 23px/1.2 Georgia, serif; }
.protection-copy > p { color: var(--muted); font-size: 12px; line-height: 1.55; }
.protection-preview { position: relative; min-height: 260px; aspect-ratio: 3/4; overflow: hidden; border-radius: 14px; background: #deddd7; cursor: zoom-in; }
.protection-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.protection-mask { z-index: 1; opacity: .43; filter: sepia(1) saturate(8) hue-rotate(88deg) brightness(1.05); mix-blend-mode: multiply; pointer-events: none; }
.protection-legend { position: absolute; z-index: 2; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 99px; color: #fff; background: rgba(22,83,59,.88); font-size: 10px; font-weight: 750; }
.protection-legend i { width: 9px; height: 9px; border-radius: 50%; background: #70d09f; }
.lock-editor-dialog { width: min(900px,calc(100vw - 28px)); }
.lock-editor-stage { position: relative; display: grid; place-items: center; max-height: min(66vh,760px); overflow: auto; border: 1px solid var(--line); border-radius: 15px; background: #d9d8d1; }
.lock-editor-stage canvas { width: min(100%,620px); height: auto; display: block; cursor: crosshair; touch-action: none; }
.lock-editor-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); background: rgba(245,243,237,.88); }
.lock-editor-controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 11px 0 2px; }
.lock-editor-controls .button { min-height: 36px; padding: 7px 11px; font-size: 11px; }
.image-placeholder { min-height: 130px; display: grid; place-items: center; padding: 20px; color: var(--muted); background: #e8e6df; font-size: 11px; text-align: center; }
.image-wrap > .image-placeholder { height: 100%; }
.final-strip { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,210px)); gap: 12px; margin-bottom: 20px; }
.final-tile { min-width: 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; text-align: left; background: var(--surface); cursor: pointer; }
.final-tile.active { border-color: var(--ink); box-shadow: 0 0 0 2px rgba(32,35,31,.1); }
.final-tile img { width: 100%; aspect-ratio: 3/4; display: block; object-fit: cover; }
.final-tile > span:last-child { display: grid; gap: 3px; padding: 10px 11px; }
.final-tile strong { font-size: 12px; }
.final-tile small { font-size: 10px; }
.pass-text { color: var(--green); }
.fail-text { color: var(--red); }
.comparison-shell { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 9px 28px rgba(40,37,29,.05); scroll-margin-top: 95px; }
.comparison-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; background: var(--line); }
.comparison-image { min-width: 0; margin: 0; background: var(--surface); }
.comparison-image button { width: 100%; display: block; padding: 0; border: 0; background: #deddd6; cursor: zoom-in; }
.comparison-image img { width: 100%; aspect-ratio: 3/4; display: block; object-fit: contain; }
.comparison-image .image-placeholder { aspect-ratio: 3/4; }
.comparison-image figcaption { display: grid; gap: 4px; padding: 12px 13px; }
.comparison-image figcaption strong { font-size: 12px; }
.comparison-image figcaption span { color: var(--muted); font-size: 10px; line-height: 1.4; }
.audit-panel { padding: 21px; border-top: 1px solid var(--line); }
.audit-panel.passed { background: #f6fbf8; }
.audit-panel.blocked { background: #fff8f6; }
.audit-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.audit-head h3 { margin: 0; font: 600 23px/1.2 Georgia, serif; }
.audit-score { padding: 7px 10px; border-radius: 99px; color: var(--muted); background: rgba(255,255,255,.7); font-size: 10px; white-space: nowrap; }
.audit-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin: 18px 0; padding: 0; list-style: none; }
.audit-list li { display: flex; align-items: flex-start; gap: 8px; color: #565a53; font-size: 11px; line-height: 1.45; }
.audit-list li > span { width: 18px; height: 18px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; font-weight: 850; }
.audit-list li.pass > span { color: #fff; background: var(--green); }
.audit-list li.fail > span { color: #fff; background: var(--red); }
.audit-list li.pending > span { color: #6f572f; background: #f0dfbd; }
.dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 17px; }
.dialog-actions.two { display: grid; grid-template-columns: 1fr 1fr; }
.ready-mark { color: var(--green); font-size: 12px; font-weight: 750; }
.ready-file-card { margin-top: 24px; border-color: #b8d6c7; background: linear-gradient(120deg,#eaf6ef,#fffefb 76%); }
.button.danger { border-color: #d4a09a; color: #862e28; background: #fff4f2; }
.confirm-check { display: grid; grid-template-columns: auto 1fr; gap: 11px; margin: 18px 0 22px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 12px; line-height: 1.5; background: #f7f5ef; }
.confirm-check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--green); }

.test-ready-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.test-preview-card { position: relative; padding: 25px; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.test-preview-card.challenger { border-color: #b8d6c7; background: #f6fbf8; }
.test-preview-card h3 { margin: 8px 0 5px; font: 600 24px/1.2 Georgia, serif; }
.test-preview-card p { color: var(--muted); font-size: 12px; line-height: 1.5; }
.test-letter { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--ink); font-weight: 850; }
.test-hero { border-color: var(--line); background: var(--surface); }
.test-hero.completed { border-color: #b8d6c7; background: #f6fbf8; }
.test-details-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 22px; }
.test-detail-card { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.test-detail-card.wide-card { grid-column: span 2; }
.test-detail-card > span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.test-detail-card strong { max-width: 100%; overflow-wrap: anywhere; font-size: 13px; }
.test-detail-card .button { min-height: 34px; padding: 7px 10px; font-size: 10px; }
.manual-instructions { padding: 23px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.manual-instructions ol { display: grid; gap: 12px; margin: 18px 0 0; padding: 0; list-style: none; }
.manual-instructions li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.manual-instructions li > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--ink); font-size: 11px; font-weight: 800; }
.manual-instructions li strong { font-size: 12px; }
.manual-instructions li p { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.info-card { margin-top: 16px; padding: 19px 21px; border: 1px solid #ced7df; border-radius: 14px; background: #f3f7fa; }
.info-card.success { border-color: #b8d6c7; background: #f1faf5; }
.info-card.warning { border-color: #e4c696; background: #fff8e9; }
.info-card h3 { margin: 0; font: 600 21px/1.2 Georgia, serif; }
.info-card p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.manual-boundary { margin: 18px 0 0; padding: 12px 14px; border-left: 3px solid var(--green); color: var(--muted); background: #f3f4ef; font-size: 11px; line-height: 1.5; }

.result-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 15px; padding: 24px 26px; border: 1px solid #cbd7ce; border-radius: 18px; background: linear-gradient(135deg,#f8fcf9,#eef5f0); }
.result-hero h2 { margin: 0; font: 600 31px/1.1 Georgia, serif; }
.result-hero p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.result-identity-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin-bottom: 15px; }
.result-identity-grid article { min-width: 0; display: grid; gap: 7px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.result-identity-grid article.wide { grid-column: span 2; }
.result-identity-grid span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.result-identity-grid strong { overflow-wrap: anywhere; font-size: 12px; line-height: 1.35; }
.result-identity-grid em { color: #999b95; font-style: normal; font-weight: 500; }
.result-arms { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 17px; }
.result-arm { min-width: 0; display: grid; grid-template-columns: 112px 1fr; align-items: center; gap: 16px; padding: 13px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.result-arm.challenger { border-color: #b8d6c7; background: #f7fbf8; }
.result-arm-image { position: relative; aspect-ratio: 3/4; display: grid; place-items: center; overflow: hidden; border-radius: 10px; color: var(--muted); background: #ebeae4; font-size: 9px; text-align: center; cursor: default; }
.result-arm-image[data-image-url] { cursor: zoom-in; }
.result-arm-image img { width: 100%; height: 100%; display: block; object-fit: cover; }
.result-arm-image b { position: absolute; top: 7px; left: 7px; width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: rgba(32,35,31,.9); font-size: 12px; }
.result-arm h3 { margin: 0 0 5px; font: 600 23px/1.15 Georgia, serif; }
.result-arm p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.result-evidence-caveat { margin: -2px 0 17px; padding: 12px 14px; border-left: 3px solid var(--amber); color: #665b47; background: #fff7e7; font-size: 10px; line-height: 1.55; }
.result-upload-card { display: grid; grid-template-columns: minmax(220px,1fr) minmax(300px,1.2fr); gap: 18px 30px; margin-bottom: 20px; padding: 22px 24px; border: 1px solid #d9c8a7; border-radius: 17px; background: #fffaf0; }
.result-upload-card.locked { border-color: var(--line); background: #f3f2ed; }
.result-upload-card h2 { margin: 0; font: 600 25px/1.15 Georgia, serif; }
.result-upload-card > div > p:not(.eyebrow) { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.result-upload-form { align-self: center; display: grid; grid-template-columns: minmax(200px,1fr) auto; gap: 9px; }
.result-file-picker { position: relative; min-width: 0; display: flex; align-items: center; padding: 10px 12px; border: 1px dashed #b7a984; border-radius: 11px; background: rgba(255,255,255,.7); cursor: pointer; }
.result-file-picker input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.result-file-picker:has(input:disabled) { opacity: .6; cursor: not-allowed; }
.result-file-picker span { min-width: 0; display: grid; }
.result-file-picker strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.result-file-picker small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.telegram-notice { grid-column: 1 / -1; margin: 0; padding: 10px 12px; border-left: 3px solid var(--blue); color: var(--muted); background: #f2f6fa; font-size: 10px; line-height: 1.5; }
.result-processing { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 11px; padding: 11px 13px; border: 1px solid #cdd8bf; border-radius: 11px; background: #f2f7ea; }
.result-processing.failed { border-color: #e0bab5; background: #fff5f3; }
.result-processing strong { display: block; font-size: 11px; }
.result-processing p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.processing-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(29,116,85,.1); animation: processing-pulse 1.3s ease-in-out infinite; }
.result-processing.failed .processing-dot { background: var(--red); animation: none; }
@keyframes processing-pulse { 50% { transform: scale(.7); opacity: .55; } }
.result-imports-layout { display: grid; grid-template-columns: minmax(250px,310px) minmax(0,1fr); gap: 16px; align-items: start; }
.result-import-list { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #ebe9e2; }
.result-list-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 17px 12px; }
.result-list-head h2 { margin: 0; font: 600 22px/1.15 Georgia, serif; }
.result-import-item { width: 100%; display: grid; gap: 8px; padding: 13px 16px; border: 0; border-top: 1px solid #d7d4ca; text-align: left; background: transparent; cursor: pointer; }
.result-import-item:hover { background: rgba(255,255,255,.48); }
.result-import-item.active { background: var(--surface); box-shadow: inset 3px 0 var(--accent); }
.result-import-item-top, .result-import-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.result-import-item-top strong { min-width: 0; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.result-import-item time, .result-import-item small { color: var(--muted); font-size: 9px; line-height: 1.35; }
.result-list-empty { padding: 30px 17px; border-top: 1px solid #d7d4ca; }
.result-list-empty strong { font-size: 12px; }
.result-list-empty p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.result-import-detail { min-width: 0; display: grid; gap: 14px; }
.result-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 19px 21px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.result-detail-head h2 { margin: 0; overflow-wrap: anywhere; font: 600 25px/1.15 Georgia, serif; }
.result-detail-head p:not(.eyebrow) { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.import-status { display: inline-flex; align-items: center; min-height: 23px; padding: 4px 8px; border-radius: 99px; color: #665322; background: #f3e5bf; font-size: 9px; font-weight: 800; white-space: nowrap; }
.import-status.preview, .import-status.accepted { color: #235c45; background: #dfeee5; }
.import-status.failed, .import-status.rejected, .import-status.rejected_by_operator { color: #862e28; background: #f4deda; }
.import-status.parsing, .import-status.queued, .import-status.upload_queued, .import-status.received { color: #355981; background: #dfe8f2; }
.binding-card, .official-verdict-card, .local-metrics-card, .decision-cta, .human-decision-card { min-width: 0; padding: 19px 21px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.result-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.result-section-head h3, .binding-card h3, .decision-cta h3, .human-decision-card h3 { margin: 0; font: 600 23px/1.15 Georgia, serif; }
.binding-summary { padding: 5px 8px; border-radius: 99px; color: #665322; background: #f3e5bf; font-size: 9px; font-weight: 800; white-space: nowrap; }
.binding-summary.pass { color: #235c45; background: #dfeee5; }
.binding-summary.fail { color: #862e28; background: #f4deda; }
.binding-list { display: grid; gap: 0; margin: 14px 0 0; padding: 0; list-style: none; }
.binding-list li { display: grid; grid-template-columns: 25px 1fr; gap: 9px; padding: 9px 0; border-top: 1px solid #eeece5; }
.binding-icon { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; color: #6a5420; background: #f1e4bd; font-size: 10px; font-weight: 900; }
.binding-list li.pass .binding-icon { color: #fff; background: var(--green); }
.binding-list li.fail .binding-icon { color: #fff; background: var(--red); }
.binding-list strong { display: block; font-size: 11px; }
.binding-list p { margin: 3px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.result-warnings { margin-top: 13px; padding: 11px 13px; border-radius: 10px; color: #77342e; background: #fff0ed; font-size: 10px; }
.result-warnings ul { display: grid; gap: 4px; margin: 7px 0 0; padding-left: 18px; }
.report-analysis { display: grid; gap: 14px; }
.official-verdict-card { border-color: #c8d7e5; background: #f3f7fb; }
.official-verdict-card h3 { margin: 0; font: 600 29px/1.15 Georgia, serif; }
.official-verdict-card p:not(.eyebrow), .local-metrics-card > p { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.metrics-scroll { margin-top: 14px; overflow-x: auto; }
.metrics-table { width: 100%; min-width: 580px; border-collapse: collapse; font-size: 10px; }
.metrics-table th, .metrics-table td { padding: 9px 10px; border-bottom: 1px solid #e9e7df; text-align: right; white-space: nowrap; }
.metrics-table th:first-child { text-align: left; }
.metrics-table thead th { color: var(--muted); font-size: 8px; letter-spacing: .06em; text-transform: uppercase; }
.metrics-table .rate-row { background: #faf9f5; }
.decision-cta { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-color: #e5b7aa; background: #fff8f5; }
.decision-cta p:not(.eyebrow) { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.human-decision-card { border-color: #b8d6c7; background: #f5fbf7; }
.human-decision-card.no_decision { border-color: #d9c8a7; background: #fffaf0; }
.human-decision-card dl { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin: 15px 0 0; }
.human-decision-card dl div { padding: 10px; border-radius: 10px; background: rgba(255,255,255,.68); }
.human-decision-card dt { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.human-decision-card dd { margin: 5px 0 0; font-size: 10px; line-height: 1.4; }
.human-decision-card blockquote { margin: 13px 0 0; padding: 11px 13px; border-left: 3px solid var(--ink); color: var(--muted); background: rgba(255,255,255,.55); font-size: 10px; line-height: 1.5; }
.apply-pending { margin-top: 14px; padding: 14px; border: 1px solid #d8bd83; border-radius: 11px; background: #fff4d9; }
.apply-pending strong { display: block; font-size: 12px; }
.apply-pending p { margin: 5px 0; color: #655b46; font-size: 10px; line-height: 1.5; }
.apply-pending span, .decision-learning { color: var(--muted); font-size: 9px; line-height: 1.45; }
.apply-pending .button { margin: 8px 0; }
.apply-pending.verified { border-color: #a9cfbc; background: #eaf6ef; }
.decision-learning { margin: 14px 0 0; }
.result-empty { min-height: 330px; display: grid; place-content: center; }
.result-outcomes, .result-reasons { margin: 0 0 18px; padding: 0; border: 0; }
.result-outcomes legend, .result-reasons legend { margin-bottom: 9px; color: #4d514b; font-size: 12px; font-weight: 800; }
.result-outcomes { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.result-outcomes legend { grid-column: 1 / -1; }
.result-outcomes label, .result-reasons label { position: relative; display: block; }
.result-outcomes input, .result-reasons input { position: absolute; opacity: 0; }
.result-outcomes span, .result-reasons span { min-height: 76px; display: flex; flex-direction: column; justify-content: center; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fbfaf6; cursor: pointer; }
.result-outcomes input:checked + span, .result-reasons input:checked + span { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: #f1f3eb; }
.result-reasons input:disabled + span { color: #a3a39d; background: #efeee9; cursor: not-allowed; }
.result-outcomes strong, .result-reasons strong { font-size: 11px; line-height: 1.3; }
.result-outcomes small, .result-reasons small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.result-reasons > div { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.result-reasons span { min-height: 50px; }

.empty { padding: 80px 24px; border: 1px dashed #cac7bd; border-radius: 18px; text-align: center; background: rgba(255,255,255,.35); }
.empty h2 { margin: 0; font: 600 26px/1.2 Georgia, serif; }
.empty p { max-width: 520px; margin: 11px auto 18px; color: var(--muted); line-height: 1.55; }
.timeline { position: relative; max-width: 850px; margin: 10px 0 0 8px; }
.timeline::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: 7px; width: 1px; background: #ceccc3; }
.timeline-item { position: relative; padding: 0 0 24px 34px; }
.timeline-item::before { content: ""; position: absolute; top: 5px; left: 1px; width: 13px; height: 13px; border: 3px solid var(--paper); border-radius: 50%; background: var(--accent); }
.timeline-item strong { display: block; font-size: 14px; }
.timeline-item p { margin: 5px 0; color: var(--muted); line-height: 1.45; }
.timeline-item time { color: #969991; font-size: 11px; }

.dialog { width: min(620px,calc(100vw - 28px)); max-height: calc(100vh - 28px); padding: 0; overflow: auto; border: 0; border-radius: 20px; color: var(--ink); background: var(--surface); box-shadow: 0 30px 90px rgba(20,22,19,.3); }
.dialog::backdrop, .image-dialog::backdrop { background: rgba(25,28,25,.72); backdrop-filter: blur(5px); }
.dialog form { position: relative; padding: 32px; }
.dialog h2 { margin: 0 0 22px; font: 600 30px/1.15 Georgia, serif; }
.dialog-intro { margin: -10px 0 20px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.dialog-close, .image-close { position: absolute; z-index: 3; top: 14px; right: 14px; width: 36px; height: 36px; border: 0; border-radius: 50%; font-size: 24px; line-height: 1; background: #eceae3; cursor: pointer; }
.auth-dialog { width: min(460px,calc(100vw - 28px)); }
.auth-dialog::backdrop { background: #20231f; backdrop-filter: none; }
.auth-dialog form { padding: 40px; }
.auth-mark { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 24px; border-radius: 50%; color: #20231f; background: #d9e4a8; font: 800 21px/1 Georgia,serif; }
.assignment-dialog { width: min(540px,calc(100vw - 28px)); }
.article-onboard-dialog { width: min(580px,calc(100vw - 28px)); }
.onboard-steps { display: grid; gap: 11px; margin: 0 0 20px; padding: 0; list-style: none; }
.onboard-steps li { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid #e4e2da; border-radius: 11px; background: #faf9f5; }
.onboard-steps li > span { width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--ink); font-size: 11px; font-weight: 850; }
.onboard-steps li > div { min-width: 0; display: grid; gap: 2px; }
.onboard-steps strong { font-size: 12px; }
.onboard-steps small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.onboard-safety { display: flex; align-items: flex-start; gap: 9px; margin: 16px 0; padding: 10px 11px; border-radius: 10px; color: #456047; background: #edf3e8; font-size: 10px; line-height: 1.45; }
.onboard-safety .safe-dot { flex: 0 0 auto; margin-top: 3px; }
.onboard-progress { min-height: 390px; display: grid; place-content: center; justify-items: center; padding: 45px 32px 36px; text-align: center; }
.onboard-progress .eyebrow { margin-top: 20px; }
.onboard-progress h2 { margin-bottom: 12px; }
.onboard-progress > p:not(.eyebrow) { max-width: 420px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.onboard-spinner { width: 46px; height: 46px; border: 4px solid #dfe4d7; border-top-color: var(--green); border-radius: 50%; animation: onboard-spin .9s linear infinite; }
.onboard-progress-track { width: min(360px,100%); height: 7px; margin: 24px 0 20px; overflow: hidden; border-radius: 99px; background: #e3e2dc; }
.onboard-progress-track span { width: 42%; height: 100%; display: block; border-radius: inherit; background: var(--green); animation: onboard-scan 1.6s ease-in-out infinite alternate; }
@keyframes onboard-spin { to { transform: rotate(360deg); } }
@keyframes onboard-scan { from { transform: translateX(-40%); } to { transform: translateX(180%); } }
.team-dialog { width: min(860px,calc(100vw - 28px)); }
.dialog-scroll { position: relative; padding: 32px; }
.team-list { display: grid; gap: 8px; }
.team-user { min-width: 0; display: grid; grid-template-columns: auto minmax(130px,1fr) minmax(120px,160px) auto auto; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbfaf6; }
.team-user.inactive { opacity: .64; }
.team-user-identity { min-width: 0; display: grid; gap: 2px; }
.team-user-identity strong, .team-user-identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-user-identity strong { font-size: 12px; }
.team-user-identity small { color: var(--muted); font-size: 9px; }
.team-user select { min-width: 0; padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 10px; }
.team-active { white-space: nowrap; color: var(--muted); font-size: 9px; }
.team-user .button { min-height: 34px; padding: 7px 9px; font-size: 9px; }
.team-dialog .team-user-form { display: block; padding: 0; }
.team-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.team-activity { display: grid; gap: 0; max-height: 280px; overflow: auto; }
.team-activity-item { padding: 10px 2px; border-bottom: 1px solid #ebe9e1; }
.team-activity-item strong { display: block; font-size: 11px; }
.team-activity-item p { margin: 3px 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.team-activity-item time { color: #92958e; font-size: 8px; }
.compact-loading { min-height: 90px; }
.decision-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 0 0 20px; padding: 0; border: 0; }
.decision-grid label { position: relative; }
.decision-grid input { position: absolute; opacity: 0; }
.decision-grid span { min-height: 72px; display: flex; flex-direction: column; justify-content: center; padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.decision-grid input:checked + span { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.decision-grid input:disabled + span { color: #aaa9a4; background: #f0efeb; cursor: not-allowed; }
.decision-grid small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.field { display: grid; gap: 7px; margin: 14px 0; color: #4d514b; font-size: 12px; font-weight: 700; }
.field small { color: var(--muted); font-weight: 400; }
.field input, .field textarea, .field select { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; outline: none; color: var(--ink); background: #fbfaf6; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: #868a81; box-shadow: 0 0 0 3px rgba(50,55,49,.07); }
.form-warning { padding: 10px 12px; border-radius: 9px; color: #7e312b; background: #f5dedb; font-size: 12px; line-height: 1.45; }
.form-hint { margin: 17px 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.section-divider { display: flex; align-items: center; gap: 10px; margin: 22px 0 11px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.section-divider::before, .section-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.review-ai-actions > p { margin: 0 0 12px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.review-action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.review-action-grid + .button { margin-top: 9px; }
.review-ai-actions .button + .button.wide { margin-top: 9px; }
.dropzone { position: relative; min-height: 150px; display: grid; place-content: center; justify-items: center; padding: 18px; overflow: hidden; border: 1px dashed #aaa99f; border-radius: 14px; text-align: center; background: #f4f2eb; }
.dropzone input { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone strong { font-size: 13px; }
.dropzone span { margin-top: 5px; color: var(--muted); font-size: 11px; }
.upload-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.image-dialog { width: min(940px,calc(100vw - 30px)); max-height: calc(100vh - 30px); padding: 0; overflow: hidden; border: 0; border-radius: 16px; background: #161815; }
.image-dialog img { width: 100%; max-height: calc(100vh - 30px); display: block; object-fit: contain; }
.image-dialog .image-close { color: #fff; background: rgba(0,0,0,.55); }
.toast { position: fixed; z-index: 50; right: 24px; bottom: 24px; max-width: min(420px,calc(100vw - 48px)); padding: 13px 16px; border-radius: 11px; color: #fff; background: #242822; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: none; }
.toast.error { background: #8f342e; }
.loading { min-height: 300px; display: grid; place-items: center; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr auto; padding: 0 16px; }
  .topbar-state { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 14px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-title, .search { display: none; }
  .article-list { display: flex; margin: 0; overflow-x: auto; }
  .article-item { min-width: 180px; }
  .main { padding: 28px 18px 60px; }
  .portfolio-summary { grid-template-columns: repeat(2,1fr); }
  .portfolio-filters { display: grid; grid-template-columns: 1fr; }
  .portfolio-filter-group { width: 100%; }
  .portfolio-toolbar { width: 100%; }
  .workspace-head { align-items: flex-start; flex-direction: column; }
  .workspace-actions { width: 100%; justify-content: flex-start; }
  .responsibility-card { align-items: flex-start; flex-direction: column; }
  .responsibility-actions { width: 100%; justify-content: space-between; }
  .team-user { grid-template-columns: auto minmax(120px,1fr) minmax(115px,150px) auto; }
  .team-active { grid-column: 2; }
  .team-user .button { grid-column: 4; grid-row: 1 / span 2; }
  .job-card { grid-template-columns: minmax(150px,1fr) minmax(130px,2fr) auto; }
  .progress { grid-template-columns: repeat(3,1fr); row-gap: 12px; }
  .progress li:nth-child(4)::after { display: none; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .tabs { width: 100%; min-width: 0; max-width: 100%; }
  .filter { align-self: flex-end; margin-top: 0; }
  .protection-card { grid-template-columns: 1fr 1fr; }
  .comparison-grid { overflow-x: auto; grid-template-columns: repeat(3,minmax(250px,1fr)); }
  .test-details-grid { grid-template-columns: 1fr 1fr; }
  .result-identity-grid { grid-template-columns: 1fr 1fr; }
  .result-upload-card { grid-template-columns: 1fr; }
  .result-imports-layout { grid-template-columns: 1fr; }
  .result-import-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); }
  .result-list-head { grid-column: 1 / -1; }
  .result-import-item { border-left: 1px solid #d7d4ca; }
}

@media (max-width: 560px) {
  .topbar { height: 64px; }
  .brand > span:last-child { display: none; }
  .user-controls { gap: 3px; }
  .topbar-button { padding: 6px 5px; font-size: 9px; }
  .actor { max-width: 92px; padding: 6px 8px; }
  .actor strong { max-width: 74px; }
  .sidebar { top: 64px; }
  .portfolio-head { align-items: stretch; flex-direction: column; }
  .portfolio-head-actions { width: 100%; display: grid; grid-template-columns: 1fr; }
  .portfolio-head .button { width: 100%; }
  .portfolio-summary { grid-template-columns: 1fr 1fr; gap: 8px; }
  .portfolio-summary article { padding: 14px; }
  .portfolio-list { grid-template-columns: 1fr; }
  .portfolio-owner-row { align-items: flex-start; }
  .candidate-grid { grid-template-columns: 1fr; }
  .filter { display: none; }
  .workspace-head .button { width: 100%; }
  .workspace-actions { display: grid; grid-template-columns: 1fr; }
  .responsibility-actions { align-items: stretch; flex-direction: column; }
  .responsibility-actions .button { width: 100%; }
  .section-heading { align-items: stretch; flex-direction: column; gap: 12px; }
  .section-heading .button { width: 100%; }
  .selection-actions { align-items: stretch; flex-direction: column; }
  .selection-undo-banner { align-items: stretch; flex-direction: column; }
  .selection-undo-banner .button { width: 100%; }
  .job-card { grid-template-columns: 1fr auto; gap: 9px; }
  .job-progress { grid-column: 1 / -1; grid-row: 2; }
  .hypothesis-grid { grid-template-columns: 1fr; }
  .progress { display: none; }
  .toolbar { margin-top: 24px; }
  .decision-grid { grid-template-columns: 1fr; }
  .review-action-grid { grid-template-columns: 1fr; }
  .dialog form { padding: 27px 20px 22px; }
  .auth-dialog form { padding: 30px 22px; }
  .dialog-scroll { padding: 27px 20px 22px; }
  .onboard-progress { min-height: 360px; padding: 36px 20px 26px; }
  .team-form-grid { grid-template-columns: 1fr; }
  .team-user { grid-template-columns: auto minmax(0,1fr) auto; }
  .team-user select { grid-column: 2 / -1; width: 100%; }
  .team-active { grid-column: 2; }
  .team-user .button { grid-column: 3; grid-row: 1; }
  .next-step-card, .ready-file-card, .test-hero { align-items: stretch; flex-direction: column; padding: 20px; }
  .next-step-card .button, .ready-file-card .button { width: 100%; }
  .protection-card { grid-template-columns: 1fr; padding: 15px; }
  .protection-preview { min-height: 220px; }
  .final-strip { display: flex; overflow-x: auto; }
  .final-tile { min-width: 150px; }
  .comparison-grid { grid-template-columns: repeat(3,minmax(215px,1fr)); }
  .audit-head { flex-direction: column; }
  .audit-list { grid-template-columns: 1fr; }
  .dialog-actions, .dialog-actions.two { display: grid; grid-template-columns: 1fr; }
  .dialog-actions .button { width: 100%; }
  .test-ready-grid, .test-details-grid { grid-template-columns: 1fr; }
  .test-detail-card.wide-card { grid-column: auto; }
  .result-hero, .decision-cta { align-items: stretch; flex-direction: column; }
  .result-identity-grid, .result-arms { grid-template-columns: 1fr; }
  .result-identity-grid article.wide { grid-column: auto; }
  .result-arm { grid-template-columns: 88px 1fr; }
  .result-upload-card { padding: 18px; }
  .result-upload-form { grid-template-columns: 1fr; }
  .result-upload-form .button, .decision-cta .button { width: 100%; }
  .result-import-list { display: block; }
  .result-detail-head { align-items: stretch; flex-direction: column; }
  .result-outcomes, .result-reasons > div { grid-template-columns: 1fr; }
  .human-decision-card dl { grid-template-columns: 1fr; }
}
