/* ============================================================
   跨境视界 · 亚马逊视觉工作站
   Visual language: quiet workspace / Apple-neutral surfaces, clear type, blue accents.
   Sections: tokens / base / shell / nav / typography / forms /
             components / stages / auth / dialogs / responsive.
   ============================================================ */

:root {
  --paper: #F5F6F8;
  --paper-2: #FFFFFF;
  --paper-3: #F0F1F5;
  --ink: #252735;
  --ink-2: #4C5061;
  --muted: #626778;
  --subtle: #727789;
  --rule: #E2E4EC;
  --rule-strong: #C5C9D6;
  --red: #7357D8;
  --red-dark: #6046BE;
  --red-soft: #F0EBFC;
  --danger: #B33D45;
  --green: #27704F;
  --green-soft: #EAF5EE;
  --amber: #8A621D;
  --amber-soft: #FAF3E4;
  --rail: #FAFAFC;
  --rail-2: #F0EBFC;
  --rail-3: #ECEEF4;
  --rail-text: #353847;
  --rail-muted: #727789;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "HarmonyOS Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --serif: var(--sans);
  --mono: "SF Mono", "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;
  --sidebar: 244px;
  --topbar: 64px;
  --content: 1240px;
  --radius: 10px;
  color-scheme: light;
}

/* Saved-project progress: task coverage remains separate from stage confirmation. */
.project-summary-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:14px}
.project-summary-heading h2{font-size:18px;margin:0}
.project-progress-stats{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}
.project-progress-stat{padding:13px 14px;border:1px solid var(--rule);border-radius:10px;background:var(--paper)}
.project-progress-stat strong{display:block;font-size:25px;font-weight:650;line-height:1.25;font-variant-numeric:tabular-nums}
.project-progress-stat span{font-size:12px;color:var(--muted)}
.project-progress-coverage{grid-column:1/-1;font-size:13px;margin:0;color:var(--ink-2)}
.project-name-check{border-top:1px solid var(--rule);margin-top:18px;padding-top:14px}
.project-name-actions,.project-purpose-controls{display:flex;gap:9px;align-items:center;flex-wrap:wrap}
.project-name-actions input{flex:1;min-width:200px}
.project-overview-projects,.project-usage-details{border-top:1px solid var(--rule);margin-top:16px;padding-top:12px}
.project-overview-projects>summary,.project-usage-details>summary{cursor:pointer;font-size:13px;font-weight:600}
.project-overview-list{display:grid;gap:7px;margin-top:12px}
.project-overview-row{display:grid;grid-template-columns:minmax(140px,1fr) minmax(190px,1fr);gap:3px 15px;padding:11px 12px;border-radius:8px;background:var(--paper)}
.project-overview-row button{text-align:left;white-space:normal}.project-overview-row small{grid-column:1/-1}
#project-usage-body{padding-top:12px}.project-purpose-controls label{font-size:13px}.project-purpose-controls select{min-width:130px}
@media(max-width:760px){.project-progress-stats{grid-template-columns:repeat(3,minmax(0,1fr))}.project-progress-stat{padding:10px}.project-overview-row{grid-template-columns:1fr}.project-name-actions{align-items:stretch}}

* { box-sizing: border-box; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.7 var(--sans);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--red); color: #FFF8EA; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
.sidebar button:focus-visible, .sidebar a:focus-visible, .sidebar select:focus-visible {
  outline-color: var(--paper);
}
.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;
}
.hidden { display: none !important; }
h1, h2, h3, h4, h5, p { margin-top: 0; }
h1, h2, h3, h4, h5 { font-weight: 600; letter-spacing: .01em; }
p { margin-bottom: 0; }
pre { font-family: var(--mono); }

/* ---------- shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 20;
  width: var(--sidebar);
  display: flex; flex-direction: column;
  padding: 26px 20px 16px;
  background: var(--rail);
  color: var(--rail-text);
  overflow: hidden;
  scrollbar-width: thin;
  scrollbar-color: #3A362E transparent;
}
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: #3A362E; }
.main { margin-left: var(--sidebar); width: calc(100% - var(--sidebar)); min-width: 0; }

/* ---------- brand / job ticket ---------- */
.brand { display: flex; align-items: flex-start; gap: 12px; color: var(--rail-text); padding: 0 3px; }
.brand-mark {
  position: relative; flex: none;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid #4B463C;
  color: #C9BFA9;
}
.brand-mark svg { display: none; }
.brand-mark::after {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  background: var(--red);
}
.brand-text { min-width: 0; font-family: var(--serif); font-size: 19px; font-weight: 600; line-height: 1.3; letter-spacing: .06em; padding-top: 1px; }
.brand-text small {
  display: block; margin-top: 4px;
  font: 8.5px/1.5 var(--mono); font-weight: 400;
  letter-spacing: .17em; text-transform: uppercase; color: var(--rail-muted);
}
.project-picker { margin-top: 32px; padding: 0 3px; }
.project-picker label, .nav-label {
  font: 9px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--rail-muted);
}
.picker-row { display: flex; gap: 6px; margin-top: 9px; }
.picker-row select {
  flex: 1; width: 100%; min-width: 0; height: 42px;
  background: var(--rail-2); border: 1px solid #3B372F;
  color: var(--rail-text); font-family: var(--sans); font-size: 12px;
  padding: 0 30px 0 11px; border-radius: 0;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #8F8676 50%), linear-gradient(135deg, #8F8676 50%, transparent 50%);
  background-position: calc(100% - 15px) 18px, calc(100% - 10px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.picker-row select:focus-visible { outline-color: var(--paper); }
.icon-button {
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; padding: 0;
  border: 1px solid #3B372F; border-radius: 0;
  background: transparent; color: #CFC6B4;
  font-size: 20px; font-weight: 300; line-height: 1;
  transition: border-color .16s, color .16s, background .16s;
}
.picker-row .icon-button { width: 42px; height: 42px; }
.icon-button:hover { border-color: #6B6355; color: #FFF9EB; background: #23211D; }
.import-entry {
  display: inline-block; align-self: flex-start; margin: 11px 3px 0; padding: 0 0 2px; min-height: 0; height: auto;
  border: 0; border-bottom: 1px solid #474238; border-radius: 0;
  background: transparent; color: #8E8576;
  font-size: 10.5px; text-align: left;
}
.import-entry:hover { color: #D9D1C0; border-bottom-color: #6B6355; background: transparent; }

/* ---------- stage nav ---------- */
.nav-label { display: flex; justify-content: space-between; align-items: baseline; margin: 24px 4px 2px; }
.nav-label span { color: #756D5F; letter-spacing: .06em; }
#stage-nav { flex: 1; min-height: 0; overflow-y: auto; padding-right: 3px; scrollbar-width: thin; scrollbar-color: #3A362E transparent; }
#stage-nav::-webkit-scrollbar { width: 4px; }
#stage-nav::-webkit-scrollbar-thumb { background: #3A362E; }
.nav-group { padding-top: 13px; }
.nav-group:first-child { padding-top: 8px; }
.nav-group-name {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 0 4px 5px; padding: 0;
  font: 8.5px/1.5 var(--mono); letter-spacing: .12em;
  color: #7E7668; text-transform: uppercase;
}
.nav-group-name span:last-child { color: #625B4F; letter-spacing: .04em; }
.stage-link {
  position: relative; display: flex; width: 100%; align-items: center; gap: 10px;
  min-height: 32px; padding: 3px 8px 3px 4px;
  border: 0; border-radius: 0; background: transparent;
  color: #BDB5A6; text-align: left; font-size: 12.5px;
}
.stage-link:hover { background: #201E1A; color: #EDE6D8; }
.stage-number {
  width: 28px; flex: none; text-align: right;
  font-family: var(--serif); font-size: 16px; line-height: 1;
  color: #756D5F; font-variant-numeric: tabular-nums;
}
.stage-link > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-indicator { margin-left: auto; width: 5px; height: 5px; flex: none; border-radius: 50%; background: #4A453C; }
.stage-indicator.confirmed { background: #5C7A62; }
.stage-indicator.needs_review { background: var(--amber); }
.stage-link.active { background: var(--rail-2); color: #FFF9EB; font-weight: 600; }
.stage-link.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--red); }
.stage-link.active .stage-number { font-size: 22px; color: var(--red); font-weight: 600; }
.stage-link.active .stage-indicator { background: var(--red); }
.stage-link:disabled { opacity: .35; }

/* ---------- account (inside rail) ---------- */
.account-panel {
  margin-top: 12px; padding: 10px 3px 0;
  border-top: 1px solid #302D27;
  min-width: 0;
}
.account-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
#account-username { font-size: 10.5px; color: #AFA696; display: block; width: 100%; overflow-wrap: anywhere; }
.account-panel .text-button { padding: 0; font-size: 9.5px; color: #8E8576; }
.account-panel .text-button:hover { color: #E7DFD0; }
.account-panel > p { margin: 5px 0 0; font-size: 9.5px; line-height: 1.65; color: #8C8373; overflow-wrap: anywhere; }
.account-panel > p:empty { display: none; }
.account-panel #account-message { color: #C89A62; }
.account-panel .review-delete-confirm {
  margin-top: 12px; padding: 12px; border: 1px solid #4B4235;
  background: #24211B; color: #D7CBB5; font-size: 10px; line-height: 1.75;
}
.account-panel .review-delete-confirm p { margin: 0 0 9px; }
.account-panel .review-delete-confirm .button { width: 100%; margin: 4px 0 0; font-size: 10px; min-height: 32px; padding: 0 8px; white-space: normal; }
.account-panel .review-delete-confirm .button.secondary { border-color: #5B5346; color: #D7CBB5; }
.account-panel .review-delete-confirm .button.quiet { color: #9E9585; }
.sidebar-foot {
  display: flex; align-items: center; gap: 7px;
  margin-top: 14px; padding: 13px 3px 2px;
  border-top: 1px solid #302D27;
  font: 8.5px/1.5 var(--mono); letter-spacing: .1em;
  color: #756D5F; text-transform: uppercase;
}
.small-dot { width: 4px; height: 4px; border-radius: 50%; background: #5C7A62; }

/* ---------- topbar / content ---------- */
.topbar {
  position: sticky; top: 0; z-index: 12;
  height: var(--topbar); padding: 0 48px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.breadcrumb {
  display: flex; align-items: center; gap: 11px; min-width: 0;
  font: 10px/1.4 var(--mono); letter-spacing: .05em; color: var(--subtle);
}
.breadcrumb > span[aria-hidden] { color: #B3A996; }
.breadcrumb strong { font-weight: 400; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.save-status {
  display: flex; align-items: center; gap: 7px;
  font: 9.5px/1.4 var(--mono); letter-spacing: .07em;
  color: var(--subtle); white-space: nowrap;
}
.save-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #9AA790; }
.save-status[data-state="saving"]::before { background: var(--amber); }
.save-status[data-state="error"]::before, .save-status[data-state="conflict"]::before { background: var(--red); }
.save-status[data-state="error"], .save-status[data-state="conflict"] { color: var(--red); }

.workspace { max-width: var(--content); margin: 0 auto; padding: 42px 56px 136px; }
.page-heading {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 30px;
  padding-bottom: 28px; border-bottom: 1px solid var(--rule);
}
.eyebrow {
  margin: 0 0 13px;
  font: 9.5px/1.5 var(--mono); letter-spacing: .13em; text-transform: uppercase;
  color: var(--red);
}
.page-heading h1 {
  margin: 0;
  font-family: var(--serif); font-size: clamp(32px, 3.2vw, 42px);
  line-height: 1.24; font-weight: 600; letter-spacing: .02em;
}
.page-description {
  margin: 13px 0 0; max-width: 660px;
  font-size: 13.5px; line-height: 1.85; color: #655E51;
}
.status-badge {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  margin-top: 8px; padding: 6px 11px;
  border: 1px solid var(--rule-strong); border-radius: 0;
  background: transparent; color: #6D6556;
  font: 9.5px/1 var(--mono); letter-spacing: .13em; text-transform: uppercase;
  white-space: nowrap;
}
.status-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--amber); }
.status-badge.confirmed { color: var(--green); border-color: #A9BEAC; }
.status-badge.confirmed::before { background: var(--green); }
.status-badge.needs_review { color: var(--amber); border-color: #D3BE9A; }
.status-badge.needs_review::before { background: var(--amber); }

#stage-content { padding-top: 2px; }
#stage-content > .panel:first-child { border-top: 0; padding-top: 32px; }
#stage-content > .panel + .panel { border-top: 1px solid var(--rule); padding-top: 30px; }

/* ---------- buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 0 16px;
  border: 1px solid transparent; border-radius: var(--radius);
  background: transparent; color: var(--ink);
  font-size: 12px; letter-spacing: .02em; line-height: 1.2;
  transition: background .16s, border-color .16s, color .16s;
}
.button.primary { background: var(--ink); border-color: var(--ink); color: var(--paper-2); }
.button.primary:hover:not(:disabled) { background: #2C2821; border-color: #2C2821; }
.button.secondary { border-color: var(--rule-strong); color: var(--ink-2); }
.button.secondary:hover:not(:disabled) { background: var(--paper-3); }
.button.quiet { color: var(--muted); }
.button.quiet:hover:not(:disabled) { border-color: var(--rule-strong); color: var(--ink); }
.import-entry.button { min-height: 0; height: auto; padding: 0 0 2px; border: 0; border-bottom: 1px solid #474238; border-radius: 0; background: transparent; color: #8E8576; font-size: 10.5px; }
.import-entry.button:hover { background: transparent; color: #D9D1C0; border-bottom-color: #6B6355; }
.button.danger-text { color: var(--red); }
#confirm-stage { background: var(--red); border-color: var(--red); color: #FFF8EA; }
#confirm-stage:hover:not(:disabled) { background: var(--red-dark); border-color: var(--red-dark); }
.text-button {
  border: 0; border-radius: 0; background: transparent; color: var(--muted);
  padding: 4px 0; font-size: 11px; text-align: left;
}
.text-button:hover:not(:disabled) { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.danger-text { color: var(--red) !important; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- forms ---------- */
label { display: block; font-size: 11.5px; line-height: 1.6; color: #5A5347; margin-bottom: 7px; }
label > .optional-label, .optional-label { margin-left: 6px; color: var(--subtle); font-size: 10px; font-weight: 400; }
.required { color: var(--red); font-family: var(--mono); font-size: 10px; }
input, textarea, select {
  width: 100%; min-width: 0;
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--paper-2); color: var(--ink);
  padding: 10px 12px; min-height: 44px;
  font-family: var(--sans); font-size: 13.5px; line-height: 1.65;
  transition: border-color .16s, box-shadow .16s;
}
input:hover, textarea:hover, select:hover { border-color: #C6BBA6; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23, 22, 19, .08);
}
input[readonly], textarea[readonly] { background: var(--paper-3); color: var(--ink-2); }
textarea { min-height: 108px; resize: vertical; line-height: 1.8; }
input::placeholder, textarea::placeholder { color: #A69C89; font-size: 12.5px; }
select {
  appearance: none; padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, #756D5F 50%), linear-gradient(135deg, #756D5F 50%, transparent 50%);
  background-position: calc(100% - 15px) center, calc(100% - 10px) center;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
input[type="file"] { padding: 11px; min-height: 48px; background: var(--paper-2); border-style: dashed; font-size: 12.5px; }
input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 6px 10px; border: 1px solid var(--rule-strong);
  border-radius: var(--radius); background: var(--paper); color: var(--ink-2);
  font: 11px var(--sans); cursor: pointer;
}
input[type="checkbox"], input[type="radio"] {
  width: 18px; height: 18px; min-height: 0; flex: none;
  appearance: none; display: inline-grid; place-content: center;
  border: 1px solid var(--rule-strong); border-radius: 1px;
  background: var(--paper-2); padding: 0; cursor: pointer;
}
input[type="checkbox"]:checked, input[type="radio"]:checked {
  background-color: var(--ink); border-color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8' viewBox='0 0 10 8'%3E%3Cpath d='M1 4l2.5 2.5L9 1' fill='none' stroke='%23FBF7ED' stroke-width='1.7' stroke-linecap='square'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center;
}
input[type="radio"]:checked { border-radius: 50%; background-image: none; }
.field-hint { margin: 6px 0 0; font-size: 10.5px; line-height: 1.65; color: var(--subtle); }
.field-error { margin: 7px 0 0; font-size: 10.5px; line-height: 1.65; color: var(--red); }
.field-error:empty { display: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 26px; }
.form-field { min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.form-field input, .form-field textarea, .form-field select { width: 100%; }
.form-field .field-hint { margin-top: 5px; }
.form-field [aria-invalid="true"] { border-color: var(--red); background: #FFF9F4; }
.field { min-width: 0; }
.review-confirm-label {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 12px; line-height: 1.8; color: var(--ink-2); cursor: pointer;
  margin: 14px 0 6px;
}
.review-confirm-label input { margin-top: 4px; }
.review-confirm-label span { min-width: 0; }

fieldset { min-width: 0; margin: 18px 0 0; padding: 14px 16px; border: 1px solid var(--rule); background: rgba(251, 247, 237, .45); }
legend { padding: 0 7px; font-size: 11.5px; color: var(--ink-2); }
fieldset .field-hint { margin-top: 0; margin-bottom: 8px; }

/* ---------- file drop / multi-file lists ---------- */
.file-drop {
  position: relative; padding: 22px 18px;
  border: 1px dashed var(--rule-strong);
  background: var(--paper-2);
  text-align: center;
  transition: border-color .16s, background .16s;
}
.file-drop:hover, .file-drop.is-dragover { border-color: var(--ink); background: var(--paper-3); }
.file-drop:focus-within { outline: 2px solid var(--ink); outline-offset: 3px; }
.file-drop input[type="file"] {
  position: absolute; inset: 0; z-index: 2;
  width: 100%; height: 100%; min-height: 0;
  padding: 0; border: 0; opacity: 0; cursor: pointer;
}
.file-drop-copy { position: relative; z-index: 1; pointer-events: none; }
.file-drop-title { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.file-drop-note { margin: 5px 0 0; font-size: 10.5px; line-height: 1.7; color: var(--subtle); }
.file-drop.is-dragover .file-drop-title { color: var(--red); }
.file-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 12px; }
.file-actions .button { min-height: 38px; }
.file-list { list-style: none; margin: 9px 0 0; padding: 0; display: grid; }
.file-list li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-top: 1px solid var(--rule); font-size: 10.5px; line-height: 1.6; color: var(--ink-2); }
.file-list li span:first-child { min-width: 0; overflow-wrap: anywhere; }
.file-list li span:last-child { flex: none; font-family: var(--mono); color: var(--subtle); }
[id^="collection-clear-"], #acceptance-upload-clear { margin-top: 4px; font-size: 10px; color: var(--muted); }

/* ---------- section / panel ---------- */
.panel {
  margin: 0 0 28px; padding: 0;
  border: 0; border-radius: 0; background: transparent;
}
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 9px; }
.panel-heading h2, .panel > h2 { margin: 0; font-size: 19px; line-height: 1.4; font-weight: 600; }
.panel-heading p, .panel-description { margin: 6px 0 0; max-width: 720px; font-size: 11.5px; line-height: 1.75; color: var(--subtle); }
.subtle-tag { flex: none; font: 9px/1.5 var(--mono); letter-spacing: .1em; color: #9B9280; text-transform: uppercase; white-space: nowrap; }
.section-number { display: inline-grid; place-items: center; min-width: 24px; height: 20px; padding: 0 6px; border: 1px solid var(--rule); color: var(--subtle); font: 9px var(--mono); }
.panel h3 { font-size: 15px; line-height: 1.6; margin: 0 0 7px; }
.panel h4 { font-size: 13.5px; margin: 0 0 6px; }

/* card-like panels */
.panel.project-identity, .panel.product-scope-panel, .panel.collection-entry,
.panel.review-card, .panel.analysis-record, .panel.classification-card,
.panel.sequence-task-card, .panel.material-task-card, .panel.direction-task-card,
.panel.production-task-card, .panel.acceptance-result,
.source-card, .asset-card, .analysis-preview, .sequence-preview,
.research-record, .direction-item, .sequence-route, .production-replacement,
.acceptance-effect {
  padding: 22px 24px;
  border: 1px solid var(--rule);
  background: var(--paper-2);
  margin-bottom: 18px;
}
.panel.project-identity { border-top: 1px solid var(--rule); }
.panel.project-identity .panel-heading { margin-bottom: 10px; }
.project-name-wrap { max-width: 640px; }
#project-name { font-family: var(--serif); font-size: 21px; line-height: 1.4; padding: 12px 14px; min-height: 50px; }
.product-scope-panel .panel-heading { margin-bottom: 20px; }

/* ---------- metrics / progress ---------- */
.metric-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 22px 0 24px;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.metric { padding: 14px 18px; border-left: 1px solid var(--rule); }
.metric:first-child { border-left: 0; padding-left: 0; }
.metric-label { font: 9px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #9B9280; }
.metric-value { margin-top: 5px; font-family: var(--serif); font-size: 30px; line-height: 1.25; font-variant-numeric: tabular-nums; }
.metric-value small { margin-left: 4px; font: 10px var(--sans); color: var(--subtle); }
.progress-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 4px 0 10px; }
.progress-top p { margin: 0; font-size: 11px; color: var(--subtle); }
.progress-track { height: 2px; background: var(--rule); overflow: hidden; margin-bottom: 20px; }
.progress-fill { height: 100%; background: var(--red); transition: width .2s; }
.progress-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.progress-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--rule); font-size: 11px; color: var(--ink-2); }
.progress-item .order { font: 10px var(--mono); color: var(--subtle); }
.progress-item .progress-state { margin-left: auto; font-size: 10px; color: var(--subtle); }
.progress-state.confirmed { color: var(--green); }
.progress-state.needs_review { color: var(--amber); }

/* ---------- overview / notes / activity / footer ---------- */
.overview-details { border: 0 !important; border-top: 1px solid var(--rule) !important; background: transparent !important; padding: 0 !important; margin: 0 0 26px !important; }
.overview-details > summary { padding: 15px 0; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.overview-details > summary > span { float: right; font-size: 10.5px; color: var(--subtle); }
.overview-body { padding: 4px 0 18px; }
.project-validation {
  margin: 0 0 20px; padding: 13px 16px;
  border: 1px solid #D8B9A7; border-left: 2px solid var(--red);
  background: #FBF1E9; color: #7C3B2A; font-size: 12px;
}
.project-validation p { margin: 0 0 6px; font-weight: 600; }
.project-validation ul { margin: 0; padding-left: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 16px; }
.validation-link { border: 0; background: transparent; color: var(--red); font-size: 11px; padding: 0; text-align: left; text-decoration: underline; text-underline-offset: 2px; }

.notes-panel { margin-top: 30px; padding-top: 28px; border-top: 1px solid var(--rule); }
.notes-panel .panel-heading { margin-bottom: 14px; }
.notes-panel textarea { min-height: 120px; }

.activity { margin-top: 0; padding: 0 !important; border: 0 !important; border-top: 1px solid var(--rule) !important; background: transparent !important; }
.activity summary { display: flex; justify-content: space-between; gap: 12px; padding: 15px 0; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.activity summary span { font-size: 10px; color: var(--subtle); }
.activity ol { margin: 0; padding: 0 0 8px; list-style: none; max-height: 280px; overflow: auto; }
.activity li { display: flex; gap: 14px; padding: 8px 0; border-top: 1px solid var(--rule); font-size: 11px; color: var(--ink-2); }
.activity time { flex: none; width: 132px; font: 9.5px/1.7 var(--mono); color: var(--subtle); }
.activity li span { min-width: 0; overflow-wrap: anywhere; }

.step-footer {
  position: fixed; left: var(--sidebar); right: 0; bottom: 0; z-index: 14;
  min-height: 68px; padding: 12px 48px;
  display: flex; align-items: center; gap: 12px;
  background: var(--paper);
  border-top: 1px solid var(--rule);
}
.footer-hint { flex: 1; min-width: 0; font-size: 10.5px; line-height: 1.6; color: var(--subtle); }
.footer-hint:empty { display: none; }
.step-footer .button { flex: none; }
.workspace-foot { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-top: 22px; font: 9.5px/1.7 var(--mono); color: var(--subtle); }
.project-export-actions { display: flex; flex-wrap: wrap; gap: 16px; }
.transfer-scope { margin: 22px 0 0; font-size: 10.5px; line-height: 1.8; color: var(--subtle); overflow-wrap: anywhere; }

/* ---------- notices / recovery ---------- */
.message, .recovery {
  max-width: var(--content); margin: 18px auto 0; padding: 13px 16px;
  border: 1px solid #D8B9A7; border-left: 2px solid var(--red);
  background: #FBF1E9; color: #7C3B2A; font-size: 12px; line-height: 1.8;
}
.message { margin-left: 56px; margin-right: 56px; }
.recovery p { margin: 0 0 9px; }
.recovery .button-row { margin-top: 4px; }
.review-delete-confirm {
  margin-top: 14px; padding: 14px 16px;
  border: 1px solid #D8B9A7; border-left: 2px solid var(--red);
  background: #FBF1E9; color: #7C3B2A;
  font-size: 11.5px; line-height: 1.8;
}
.review-delete-confirm p { margin: 0 0 10px; }
.review-delete-confirm .button { margin: 3px 8px 0 0; }

/* ---------- auth / login ---------- */
.auth-screen {
  display: grid; grid-template-columns: 1.12fr .88fr;
  min-height: 100vh; background: var(--paper);
}
.auth-poster {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  padding: 44px 52px 38px;
  background: var(--rail); color: var(--rail-text);
}
.auth-poster::after { content: ""; position: absolute; inset: 18px; border: 1px solid rgba(241, 235, 221, .09); pointer-events: none; }
.poster-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.poster-mark { position: relative; width: 38px; height: 38px; border: 1px solid #4B463C; display: grid; place-items: center; }
.poster-mark::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.poster-meta { font: 8.5px/1.5 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--rail-muted); }
.poster-main { position: relative; z-index: 1; margin-top: auto; padding-top: 56px; }
.poster-kicker { margin: 0 0 26px; font: 9px/1.4 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: #A29886; }
.poster-kicker span { color: var(--red); }
.poster-title {
  margin: 0; font-family: var(--serif); font-weight: 600;
  font-size: clamp(58px, 7.2vw, 104px); line-height: 1.06; letter-spacing: .09em;
  color: #F6F0E3;
}
.poster-title em { font-style: normal; color: var(--red); }
.poster-manifesto { margin: 34px 0 0; font-family: var(--serif); font-size: 20px; line-height: 1.8; letter-spacing: .04em; color: #CFC6B4; }
.poster-rule { height: 1px; background: #3A362E; margin: 44px 0 20px; }
.poster-index { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.poster-index div { border-top: 1px solid #3A362E; padding-top: 9px; }
.poster-index b { display: block; font: 8.5px/1.4 var(--mono); letter-spacing: .12em; color: #7E7668; font-weight: 400; }
.poster-index span { display: block; margin-top: 4px; font-size: 11.5px; color: #BDB4A4; letter-spacing: .02em; }
.poster-foot { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 28px; font: 8.5px/1.5 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #6F6759; }
.poster-foot span:last-child { display: flex; align-items: center; gap: 7px; }
.poster-foot i { width: 4px; height: 4px; border-radius: 50%; background: #5C7A62; }

.auth-panel { display: flex; align-items: center; justify-content: center; padding: 52px 56px; min-width: 0; }
.auth-card { width: 100%; max-width: 380px; min-width: 0; }
.auth-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 44px; font: 8.5px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #9B9280; }
.auth-card h1 { margin: 0; font-family: var(--serif); font-size: 34px; line-height: 1.3; font-weight: 600; letter-spacing: .04em; }
.auth-description { margin: 10px 0 0; font-size: 12.5px; line-height: 1.8; color: #756D5F; }
#auth-message { margin: 16px 0 0; font-size: 11.5px; line-height: 1.8; color: var(--amber); white-space: pre-wrap; overflow-wrap: anywhere; }
#auth-message:empty { display: none; }
.auth-form { margin-top: 30px; }
.auth-form label { margin-top: 18px; }
.auth-form label:first-child { margin-top: 0; }
.auth-form input { height: 46px; font-size: 14px; }
.auth-form .field-hint { margin-top: 6px; }
.auth-form .button { width: 100%; margin-top: 22px; min-height: 46px; }
.auth-feishu { margin-top: 26px; }
.feishu-intro p { margin: 0 0 14px; font-size: 12px; line-height: 1.8; color: var(--ink-2); }
.feishu-qr-wrap { padding: 14px; border: 1px solid var(--rule); background: rgba(251, 247, 237, .55); display: grid; place-items: center; }
.feishu-qr { display: block; width: 200px; height: 200px; max-width: 100%; margin: 0 auto; background: #fff; }
.feishu-qr:not([src]) { display: none; }
.auth-feishu #feishu-login-message { margin: 12px 0 0; min-height: 17px; font-size: 10.5px; line-height: 1.7; color: var(--subtle); }
.auth-feishu .button { width: 100%; margin-top: 12px; }
#auth-switch-open { display: block; margin-top: 22px; font-size: 10.5px; }
.auth-card .review-delete-confirm { margin-top: 18px; }
.auth-card .review-delete-confirm .button { width: 100%; margin: 4px 0 0; font-size: 11px; }
.auth-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 34px; padding-top: 16px; border-top: 1px solid var(--rule); font: 8.5px/1.7 var(--mono); letter-spacing: .06em; color: #9B9280; }

/* ---------- empty state ---------- */
.empty-state { max-width: 640px; margin: 12vh auto 80px; padding: 0 56px; }
.empty-symbol { display: block; margin-bottom: 26px; color: var(--red); }
.empty-kicker { margin: 0 0 16px; font: 9px/1.4 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--subtle); }
.empty-state h1 { margin: 0; font-family: var(--serif); font-size: clamp(34px, 4vw, 48px); line-height: 1.3; font-weight: 600; letter-spacing: .02em; }
.empty-state p { margin: 14px 0 0; max-width: 480px; font-size: 13.5px; line-height: 1.85; color: #655E51; }
.empty-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.empty-state .empty-note { margin-top: 22px; font-size: 10.5px; line-height: 1.7; color: var(--subtle); }

/* ---------- collection / sources / assets ---------- */
.collection-entry { padding: 24px 26px; }
.collection-entry .panel-heading { margin-bottom: 18px; }
.collection-tabs { display: flex; gap: 2px; margin: 0 0 24px; border-bottom: 1px solid var(--rule); overflow-x: auto; scrollbar-width: none; }
.collection-tabs::-webkit-scrollbar { display: none; }
.collection-tab {
  flex: none; padding: 11px 14px; border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--muted);
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.collection-tab:hover { color: var(--ink); background: var(--paper-3); }
.collection-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--red); }
.collection-tab-panel h3 { margin: 0 0 6px; font-size: 16px; }
.collection-description { margin: 0 0 16px; max-width: 760px; font-size: 11.5px; line-height: 1.8; color: var(--subtle); }
.collection-tab-panel > label { margin-top: 15px; }
.collection-tab-panel > .button { margin-top: 18px; }
.collection-tab-panel > select { max-width: 320px; }
.collection-tab-panel input[type="file"] { margin-top: 2px; }
.collection-feedback {
  margin: 18px 0 0; padding: 12px 15px;
  border: 1px solid #D8B9A7; border-left: 2px solid var(--red);
  background: #FBF1E9; color: #7C3B2A; font-size: 11.5px; line-height: 1.8;
}
.collection-feedback.success { border-color: #A9BEAC; border-left-color: var(--green); background: var(--green-soft); color: #2C4D3A; }
.collection-feedback.processing { border-color: var(--rule-strong); border-left-color: var(--amber); background: var(--amber-soft); color: #6E4C18; }
.collection-feedback > .button { margin-top: 9px; }
.collection-alternatives { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 8px; color: var(--amber); font-size: 10.5px; }
.collection-alternatives .text-button { color: var(--amber); }
.collection-empty { margin: 12px 0; font-size: 12px; line-height: 1.8; color: var(--subtle); }
.source-list { display: grid; gap: 14px; }
.source-card { margin-bottom: 0; }
.source-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.source-card-heading h2, .source-card-heading h3, .source-card-heading h4 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.source-card-heading h2 { font-size: 17px; }
.source-card-heading h3 { font-size: 15px; }
.source-card-heading h4 { font-size: 14px; }
.source-state {
  flex: none; padding: 3px 7px; border: 1px solid var(--rule-strong);
  font: 8.5px/1.4 var(--mono); letter-spacing: .08em; color: var(--subtle);
  white-space: nowrap;
}
.source-meta, .source-origin { margin: 7px 0 0; font-size: 10.5px; line-height: 1.7; color: var(--subtle); overflow-wrap: anywhere; }
.source-origin { color: #7C6A4D; }
.source-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.source-link { font-size: 10.5px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #C0B5A1; overflow-wrap: anywhere; }
.source-link:hover { color: var(--red); text-decoration-color: var(--red); }
.source-notice {
  margin: 10px 0 0; padding: 8px 11px;
  border-left: 2px solid var(--rule-strong); background: var(--paper-3);
  font-size: 10.5px; line-height: 1.75; color: #6E5C40;
}
.source-notice:empty { display: none; }
.source-body { margin-top: 10px; border-top: 1px solid var(--rule); padding-top: 8px; }
.source-body summary { padding: 5px 0; font-size: 10.5px; color: var(--muted); cursor: pointer; }
.source-body pre { margin: 8px 0 0; max-height: 320px; overflow: auto; padding: 12px; background: var(--paper-3); font-size: 11.5px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.page-read-state { margin: 9px 0 0; font-size: 10px; line-height: 1.7; color: var(--subtle); }
.search-snippet, .research-notes { margin: 12px 0 0; padding: 11px 13px; border: 1px solid var(--rule); border-left: 2px solid var(--amber); background: var(--amber-soft); }
.search-snippet h4, .research-notes h4 { margin: 0 0 5px; font-size: 10.5px; color: #6E4C18; }
.search-snippet p, .research-notes p { margin: 0; font-size: 11px; line-height: 1.8; color: #6B5A3E; white-space: pre-wrap; overflow-wrap: anywhere; }

.asset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.asset-card { padding: 12px; margin-bottom: 0; display: flex; flex-direction: column; gap: 10px; }
.asset-thumbnail { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--paper-3); display: block; }
.asset-thumbnail-error { display: grid; place-items: center; min-height: 120px; margin: 0; background: var(--paper-3); color: var(--subtle); font-size: 10.5px; text-align: center; padding: 12px; }
.asset-card-body { min-width: 0; }
.asset-card-body h3 { margin: 0 0 5px; font-size: 12.5px; line-height: 1.6; overflow-wrap: anywhere; }
.asset-card-body label { margin-top: 10px; font-size: 10px; }
.asset-card-body select { font-size: 11.5px; min-height: 36px; padding: 6px 28px 6px 9px; }
.asset-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; }
.asset-actions .text-button { font-size: 10px; color: var(--red); }
.asset-delete-confirm { margin: 8px -4px -4px; padding: 11px; border: 1px solid #D8B9A7; border-left: 2px solid var(--red); background: #FBF1E9; color: #7C3B2A; font-size: 10.5px; line-height: 1.8; }
.asset-delete-title { font-weight: 600; }
.asset-delete-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.asset-delete-actions .button { min-height: 30px; font-size: 10px; padding: 0 9px; }
.asset-undo-list { display: grid; gap: 8px; margin-bottom: 12px; }
.asset-undo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--rule); background: var(--paper-3); font-size: 10.5px; color: var(--ink-2); }

/* ---------- research ---------- */
.research-service { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 14px 0 18px; padding: 11px 14px; border: 1px solid var(--rule); border-left: 2px solid var(--rule-strong); background: var(--paper-3); }
.research-status { margin: 0; font-size: 10.5px; line-height: 1.7; color: var(--amber); }
.research-status.configured { color: var(--green); }
.research-service .button { flex: none; min-height: 32px; font-size: 10px; }
.research-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.research-scope { padding: 0; }
.research-scope summary { padding: 15px 0; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.research-scope p { margin: 0 0 12px; font-size: 11px; line-height: 1.8; color: var(--subtle); }
.research-record { margin-bottom: 14px; }
.research-record h3 { margin: 0; font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.research-record .source-meta { margin-top: 4px; }
.research-urls { margin-top: 8px; }
.research-urls summary { font-size: 10.5px; color: var(--muted); cursor: pointer; }
.research-urls ul { margin: 7px 0 0; padding-left: 18px; font-size: 10.5px; overflow-wrap: anywhere; }
.research-candidates { margin-top: 12px; }
.research-candidate { padding: 11px 0; border-top: 1px solid var(--rule); }
.research-candidate h4 { margin: 0 0 3px; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.research-candidate p { margin: 6px 0 4px; font-size: 11px; line-height: 1.8; color: var(--ink-2); }
.candidate-state { display: block; margin: 3px 0; font: 9px/1.5 var(--mono); color: var(--amber); }
.research-candidate .text-button { font-size: 10px; }

/* ---------- review ---------- */
.review-intro { margin-bottom: 18px; }
.review-card { padding: 24px 26px; }
.review-card .source-card-heading h2 { font-size: 17px; line-height: 1.55; }
.review-fields { margin-top: 18px; }
.review-fields input, .review-fields select, .review-fields textarea { min-height: 44px; }
.review-fields textarea { min-height: 100px; }
.review-body-editor { margin-top: 16px; padding: 0 14px; border: 1px solid var(--rule); background: rgba(251, 247, 237, .5); }
.review-body-editor summary { padding: 11px 0; font-size: 11.5px; color: var(--ink-2); cursor: pointer; }
.review-body-editor label { margin: 3px 0 7px; }
.review-body-editor textarea { min-height: 160px; margin-bottom: 12px; }
.review-card-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; }
.review-card-actions .button { min-height: 34px; font-size: 11px; }
.review-latest summary { font-size: 10.5px; color: var(--amber); cursor: pointer; }
.review-latest pre, .review-orphaned-drafts pre { margin: 8px 0 0; padding: 11px; background: var(--paper-3); font-size: 11px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto; }
.review-recovery { background: var(--amber-soft); border-color: #D3BE9A; border-left-color: var(--amber); }
.review-recovery > p { margin: 0 0 10px; font-size: 11.5px; color: #6E4C18; }
.review-deleted-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid var(--rule); }

/* ---------- analysis ---------- */
.analysis-service { margin-bottom: 4px; }
.analysis-record-section > .panel-heading { margin: 28px 0 12px; }
.analysis-record-section > .panel-heading h2 { font-size: 20px; }
.analysis-record { padding: 22px 24px; }
.analysis-images { margin-top: 16px; border-top: 1px solid var(--rule); padding-top: 10px; }
.analysis-images summary, .analysis-composer > summary, .analysis-candidate-details > summary { padding: 8px 0; font-size: 11.5px; color: var(--ink-2); cursor: pointer; }
.analysis-image-row { display: flex; align-items: flex-start; gap: 9px; margin: 8px 0; font-size: 10.5px; line-height: 1.7; color: var(--ink-2); }
.analysis-image-row input { margin-top: 3px; }
.analysis-image-row span { overflow-wrap: anywhere; }
.analysis-editor { margin-top: 14px; }
.analysis-editor textarea { min-height: 92px; }
.analysis-candidate-details { margin-top: 12px; }
.analysis-source-picker { margin-top: 16px; }
.analysis-source-row { display: flex; align-items: flex-start; gap: 9px; padding: 7px 0; border-top: 1px solid var(--rule); }
.analysis-source-row:first-of-type { border-top: 0; }
.analysis-source-row label { display: flex; align-items: flex-start; gap: 9px; margin: 0; font-size: 10.5px; line-height: 1.7; color: var(--ink-2); cursor: pointer; flex: 1; }
.analysis-source-row input { margin-top: 3px; }
.analysis-source-row span { overflow-wrap: anywhere; }
.analysis-preview { padding: 20px 22px; }
.analysis-preview h3 { margin: 0 0 4px; font-size: 14px; }
.analysis-preview-output { margin-top: 12px; border-top: 1px solid var(--rule); padding-top: 9px; }
.analysis-preview-output summary { font-size: 10.5px; color: var(--muted); cursor: pointer; }
.analysis-preview-output h4 { margin: 14px 0 5px; font-size: 11px; color: var(--red); }
.analysis-preview-item { padding: 9px 0; border-top: 1px solid var(--rule); }
.analysis-preview-item p { margin: 4px 0; font-size: 10.5px; line-height: 1.8; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.analysis-finding { padding: 10px 0; border-top: 1px solid var(--rule); }
.analysis-finding h4 { margin: 0 0 4px; font-size: 12px; }
.analysis-finding p { margin: 4px 0; font-size: 10.5px; line-height: 1.8; color: var(--ink-2); }

/* ---------- classification ---------- */
.classification-group { margin: 28px 0 0; }
.classification-group > .panel-heading { margin-bottom: 12px; }
.classification-group > .panel-heading h2 { font-size: 20px; }
.classification-card { padding: 22px 24px; }
.classification-fab { margin: 12px 0; padding-left: 12px; border-left: 2px solid var(--rule); }
.classification-fab p { margin: 4px 0; font-size: 11.5px; line-height: 1.8; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.classification-sources { margin: 10px 0; }
.classification-sources p { margin: 4px 0; font-size: 10.5px; line-height: 1.7; overflow-wrap: anywhere; }
.classification-dimensions { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--rule); gap: 18px 22px; }
.classification-dimensions .form-field > label:not(:first-child) { margin-top: 11px; }
.classification-card > label { margin-top: 14px; }
.classification-card > textarea { min-height: 88px; }
.classification-card-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.classification-card-actions .button { min-height: 34px; font-size: 11px; }
.classification-exercise { margin-top: 26px; padding: 0; }
.classification-exercise > summary { padding: 15px 0; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.classification-weight-group { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--rule); }
.classification-weight-group h3 { margin: 0 0 12px; font-size: 12.5px; }
.classification-weight-inputs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.classification-weight-inputs label { font-size: 10.5px; line-height: 1.6; }
.classification-weight-inputs input { min-height: 38px; padding: 6px 9px; }
.classification-comparison { list-style: none; margin: 14px 0 0; padding: 0; }
.classification-comparison li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--rule); font-size: 10.5px; }
.classification-score-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--rule); font-size: 10.5px; }

/* ---------- sequence ---------- */
.sequence-tier-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 4px 17px; align-items: center; padding: 11px 0; border-top: 1px solid var(--rule); }
.sequence-tier-row label { margin: 0; font-size: 11.5px; overflow-wrap: anywhere; }
.sequence-tier-row select { font-size: 11.5px; min-height: 36px; padding: 6px 28px 6px 9px; }
.sequence-tier-row > .source-meta { grid-column: 1 / -1; margin: 0; }
.sequence-task-section > .panel-heading { margin: 28px 0 13px; }
.sequence-task-section > .panel-heading h2 { font-size: 20px; }
.sequence-task-card { padding: 22px 24px; }
.sequence-task-card > label { margin-top: 15px; }
.sequence-task-card textarea { min-height: 88px; }
.sequence-task-card .analysis-source-picker { margin-top: 14px; }
.sequence-task-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 15px; }
.sequence-task-actions .button { min-height: 32px; font-size: 10.5px; }
.sequence-task-actions .danger-text { margin-left: auto; }
.sequence-edit-details, .sequence-read-only { margin-top: 14px; border-top: 1px solid var(--rule); padding-top: 8px; }
.sequence-edit-details summary, .sequence-read-only summary { padding: 5px 0; font-size: 11px; color: var(--muted); cursor: pointer; }
.sequence-read-only { background: var(--paper-3); border: 1px solid var(--rule); padding: 10px 13px; }
.sequence-old-content p, .sequence-read-only p { margin: 4px 0; font-size: 10.5px; line-height: 1.7; }
.sequence-preview { padding: 20px 22px; }
.sequence-route { padding: 16px 18px; }
.sequence-route h4 { margin: 0 0 6px; font-size: 13px; }
.sequence-route-task { padding: 10px 0; border-top: 1px solid var(--rule); }
.sequence-route-task h5 { margin: 0 0 4px; font-size: 11px; color: var(--red); }
.sequence-route-task p { margin: 3px 0; font-size: 10.5px; line-height: 1.7; color: var(--ink-2); }
.sequence-coverage p { margin: 4px 0; font-size: 11px; line-height: 1.7; color: var(--ink-2); }
.sequence-impact { margin-top: 12px; padding: 12px 14px; border-left: 2px solid var(--amber); background: var(--amber-soft); }
.sequence-impact h3 { margin: 0 0 6px; font-size: 13px; }
.sequence-impact p { margin: 4px 0; font-size: 10.5px; line-height: 1.75; color: #6E4C18; }
.sequence-archive-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--rule); }

/* ---------- materials / tasks ---------- */
.material-task-card { padding: 22px 24px; }
.material-task-card h3 { font-size: 18px; margin: 0; }
.material-task-text { margin: 10px 0; font-size: 11.5px; line-height: 1.8; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.material-task-card > label:not(.review-confirm-label) { margin-top: 15px; }
.material-task-card > textarea { min-height: 92px; }
.material-candidate-list { margin: 14px 0; padding: 11px 13px; background: var(--paper-3); border-left: 2px solid var(--rule-strong); }
.material-candidate-list h4 { margin: 0 0 6px; font-size: 11px; }
.material-candidate-list p { margin: 5px 0; font-size: 10.5px; line-height: 1.75; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.material-asset-picker { margin: 16px 0; }
.material-asset-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 13px 0; border-top: 1px solid var(--rule); }
.material-asset-visual { min-width: 0; }
.material-asset-visual img { width: 96px; height: 96px; object-fit: contain; background: var(--paper-3); display: block; }
.material-asset-info { min-width: 0; }
.material-asset-info label { display: flex; align-items: flex-start; gap: 9px; font-size: 11px; line-height: 1.7; cursor: pointer; }
.material-asset-info label span, .material-asset-info .source-meta { overflow-wrap: anywhere; }
.material-asset-info input { margin-top: 3px; }
.material-asset-info a { font-size: 10px; }
.material-task-card .review-confirm-label { font-size: 11px; }
.material-task-card > .button, .material-asset-picker > .button, #material-recovery > .button { min-height: 32px; font-size: 10.5px; margin: 5px 8px 5px 0; white-space: normal; }

/* ---------- directions ---------- */
.direction-task-card { padding: 22px 24px; }
.direction-task-card > h3 { margin: 0 0 6px; font-size: 18px; }
.direction-task-card > h4 { margin: 22px 0 9px; font-size: 14px; }
.direction-task-card > .button-row { margin: 14px 0; }
.direction-task-card > .button-row .button { min-height: 32px; font-size: 10.5px; white-space: normal; }
.direction-item { padding: 18px 20px; }
.direction-editor { margin-top: 14px; }
.direction-editor textarea { min-height: 88px; }
.direction-bound-assets { margin-top: 12px; }
.direction-bound-asset { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--rule); }
.direction-bound-asset img { width: 82px; height: 82px; object-fit: contain; background: var(--paper-3); flex: none; }
.direction-bound-asset > div { min-width: 0; }
.direction-preview-section { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule); }
.direction-preview-section > summary { font-size: 11px; color: var(--muted); cursor: pointer; }
.direction-preview { padding: 16px 18px; margin: 12px 0; border: 1px solid var(--rule); background: var(--paper-3); }
.direction-preview h4 { margin: 0 0 6px; font-size: 12px; }
.direction-preview-option { padding: 10px 0; border-top: 1px solid var(--rule); }
.direction-preview-option p { margin: 3px 0; font-size: 10.5px; line-height: 1.7; }

/* ---------- production ---------- */
.production-task-card { padding: 22px 24px; }
.production-task-card h3 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.production-task-card > .source-meta { margin-top: 4px; }
.production-task-card > label { margin: 16px 0 7px; }
.production-task-card > textarea { min-height: 360px; font-family: var(--mono); font-size: 12px; line-height: 1.85; }
.production-task-card > .button-row { margin: 14px 0; }
.production-task-card .button-row .button, .production-replacement .button, #production-recovery .button { min-height: 32px; font-size: 10.5px; white-space: normal; }
.production-task-checks { margin: 10px 0; }
.production-task-checks .source-notice { margin: 6px 0; }
.production-replacement { padding: 18px 20px; }
.production-replacement > h4 { margin: 0 0 8px; font-size: 14px; }
.production-replacement > p { font-size: 11px; line-height: 1.8; overflow-wrap: anywhere; }
.production-replacement pre { margin: 9px 0; padding: 11px; background: var(--paper-3); font-size: 11px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; }

/* ---------- acceptance ---------- */
.acceptance-task-group > h3 { margin: 28px 0 12px; font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; }
.acceptance-result { padding: 22px 24px; }
.acceptance-result h4 { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.acceptance-result-image { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: 14px 0; }
.acceptance-result-image img { max-width: 100%; max-height: 420px; object-fit: contain; background: var(--paper-3); }
.acceptance-result-image a { font-size: 10px; }
.acceptance-result textarea, .acceptance-effect textarea { width: 100%; min-height: 96px; }
.acceptance-result-checks { margin: 10px 0; }
.acceptance-result-errors { margin-top: 10px; }
.acceptance-result-errors p { margin: 5px 0; font-size: 10.5px; line-height: 1.7; color: var(--red); }
.acceptance-upload { padding: 20px 22px; border: 1px solid var(--rule); background: var(--paper-2); margin-bottom: 20px; }
.acceptance-upload h3 { margin: 0 0 12px; font-size: 16px; }
.acceptance-upload > label, .acceptance-result > label:not(.review-confirm-label) { margin-top: 14px; }
.acceptance-effect { padding: 20px 22px; }

/* ---------- dialogs ---------- */
dialog {
  width: min(520px, calc(100% - 32px)); max-height: 88vh; overflow: auto;
  padding: 30px; border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: var(--paper-2); color: var(--ink);
  box-shadow: 0 24px 80px rgba(23, 22, 19, .22);
}
dialog::backdrop { background: rgba(23, 22, 19, .45); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.dialog-heading h2 { margin: 0; font-family: var(--serif); font-size: 26px; line-height: 1.3; font-weight: 600; }
.dialog-heading .icon-button { width: 32px; height: 32px; border-color: var(--rule); color: var(--muted); font-size: 18px; }
.dialog-description { margin: 10px 0 22px; font-size: 11.5px; line-height: 1.8; color: var(--subtle); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; }
.dialog-actions .button { min-width: 96px; }
#permission-dialog { width: min(1100px, 94vw); }
.permission-dialog h2 { margin: 0 0 8px; font-family: var(--serif); font-size: 28px; }
.permission-dialog > p { font-size: 11.5px; line-height: 1.8; color: var(--subtle); margin: 0 0 10px; }
.permission-table-scroll { overflow: auto; margin-top: 14px; border-top: 1px solid var(--rule); }
.permission-dialog table { width: 100%; border-collapse: collapse; text-align: left; }
.permission-dialog th { padding: 10px 12px; border-bottom: 1px solid var(--rule-strong); font: 9px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--subtle); }
.permission-dialog td { padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; font-size: 11px; overflow-wrap: anywhere; }
.permission-dialog td button, .permission-dialog td select { margin: 2px 3px 2px 0; min-height: 30px; font-size: 10px; }
.permission-dialog input { flex: 1; min-width: 140px; }
#permission-directory-area { margin: 12px 0; }
#permission-add-form { margin-top: 14px; }
#permission-message { min-height: 18px; }

/* ---------- mobile stage select ---------- */
.mobile-stage { display: none; }

/* ---------- stage placeholder ---------- */
.stage-placeholder { padding: 30px 0; text-align: center; }
.placeholder-symbol { width: 42px; height: 42px; margin: 0 auto 12px; display: grid; place-items: center; border: 1px solid var(--rule); color: var(--subtle); }
.stage-placeholder h3 { margin: 0; font-size: 13px; }
.stage-placeholder p { max-width: 460px; margin: 8px auto 0; font-size: 11px; line-height: 1.8; color: var(--subtle); }

/* ---------- misc ---------- */
.build-notice { display: flex; gap: 11px; padding: 11px 14px; margin-bottom: 18px; border: 1px solid var(--rule); border-left: 2px solid var(--rule-strong); background: var(--paper-3); }
.build-notice p { margin: 0; font-size: 10.5px; line-height: 1.7; color: var(--ink-2); }
.build-notice strong { display: block; margin-bottom: 2px; font-size: 10.5px; }
.notice-icon { width: 16px; height: 16px; flex: none; display: grid; place-items: center; border: 1px solid var(--rule-strong); border-radius: 50%; font: 10px/1 var(--serif); color: var(--ink-2); margin-top: 2px; }
.sequence-read-only .sequence-old-content { font-size: 10.5px; color: var(--ink-2); }
.transfer-scope { max-width: 900px; }
.permission-dialog .button-row { margin: 8px 0; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  :root { --sidebar: 228px; }
  .workspace { padding: 38px 38px 132px; }
  .topbar { padding: 0 38px; }
  .step-footer { padding-left: 38px; padding-right: 38px; }
  .message, .recovery { margin-left: 38px; margin-right: 38px; }
  .auth-poster { padding: 34px 38px 30px; }
  .auth-panel { padding: 42px 38px; }
  .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .page-heading { gap: 20px; }
  .status-badge { margin-top: 2px; }
  .auth-screen { grid-template-columns: 1fr 1fr; }
  .auth-poster { padding: 28px 30px 26px; }
  .poster-index { grid-template-columns: repeat(2, 1fr); }
  .poster-title { font-size: 56px; }
  .poster-manifesto { font-size: 17px; margin-top: 24px; }
  .auth-panel { padding: 36px 30px; }
  .auth-meta { margin-bottom: 32px; }
}

@media (max-width: 820px) {
  :root { --sidebar: 0px; --topbar: 52px; }
  .app-shell { display: block; }
  .sidebar {
    position: static; width: 100%; height: auto; overflow: visible;
    padding: 15px 18px 14px;
    flex-direction: column; overflow: visible;
  }
  .sidebar { padding: 12px 16px 10px; }
  .brand { align-items: center; gap: 10px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-text { font-size: 17px; }
  .brand-text small { display: none; }
  .project-picker { margin-top: 10px; }
  .project-picker label { display: none; }
  .picker-row { margin-top: 0; }
  .import-entry { display: none; }
  .nav-label, #stage-nav, .sidebar-foot { display: none; }
  .account-panel { margin-top: 7px; padding-top: 7px; }
  #account-username { width: auto; font-size: 9px; }
  #account-usage, .account-panel #auth-refresh-usage { display: none; }
  .account-panel .text-button { font-size: 9px; }
  .account-panel > p { font-size: 9px; margin-top: 3px; }
  .account-panel .review-delete-confirm { font-size: 10px; }
  .main { margin-left: 0; width: 100%; }
  .topbar { height: 52px; padding: 0 20px; gap: 12px; }
  .breadcrumb { font-size: 9px; gap: 7px; }
  .save-status { font-size: 8.5px; }
  .mobile-stage { display: flex; align-items: center; gap: 10px; padding: 9px 20px; border-bottom: 1px solid var(--rule); background: rgba(242, 237, 225, .96); }
  .mobile-stage label { margin: 0; flex: none; font: 8.5px/1 var(--mono); letter-spacing: .1em; color: var(--subtle); text-transform: uppercase; }
  .mobile-stage select { flex: 1; min-width: 0; height: 34px; min-height: 34px; padding: 0 28px 0 9px; font-size: 11.5px; background-color: var(--paper-2); }
  .workspace { padding: 26px 20px 148px; }
  .page-heading { flex-direction: column; gap: 14px; padding-bottom: 20px; }
  .page-heading h1 { font-size: 32px; }
  .panel-heading { gap: 10px; }
  .panel-heading .subtle-tag { display: none; }
  .panel-heading h2, .panel > h2 { font-size: 18px; }
  .page-description { font-size: 12.5px; }
  .eyebrow { font-size: 8.5px; margin-bottom: 10px; }
  .status-badge { margin-top: 0; }
  #stage-content > .panel:first-child { padding-top: 24px; }
  #stage-content > .panel + .panel { padding-top: 24px; }
  .panel { margin-bottom: 24px; }
  .panel.project-identity, .panel.product-scope-panel, .panel.collection-entry,
  .panel.review-card, .panel.analysis-record, .panel.classification-card,
  .panel.sequence-task-card, .panel.material-task-card, .panel.direction-task-card,
  .panel.production-task-card, .panel.acceptance-result,
  .source-card, .asset-card, .analysis-preview, .sequence-preview,
  .research-record, .direction-item, .sequence-route, .production-replacement,
  .acceptance-effect { padding: 18px; }
  .form-grid, .classification-dimensions { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { padding: 12px 14px; }
  .metric:nth-child(3) { border-left: 0; padding-left: 0; }
  .metric:nth-child(3), .metric:nth-child(4) { border-top: 1px solid var(--rule); }
  .metric-value { font-size: 25px; }
  .progress-list { grid-template-columns: 1fr; }
  .project-validation ul { grid-template-columns: 1fr; }
  .asset-grid { grid-template-columns: 1fr; }
  .collection-tabs { gap: 0; margin-bottom: 18px; }
  .collection-tab { padding: 10px 11px; font-size: 11.5px; }
  .collection-entry { padding: 18px; }
  .collection-tab-panel > select { max-width: none; width: 100%; }
  .source-card { padding: 16px; }
  .source-card-heading { flex-wrap: wrap; gap: 8px; }
  .source-card-heading h2, .source-card-heading h3 { font-size: 14px; }
  .review-card { padding: 18px; }
  .review-card-actions { align-items: flex-start; flex-direction: column; }
  .classification-weight-inputs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sequence-tier-row { grid-template-columns: minmax(0, 1fr) 118px; gap: 6px 10px; }
  .material-asset-row { grid-template-columns: 70px minmax(0, 1fr); gap: 10px; }
  .material-asset-visual img { width: 70px; height: 70px; }
  .direction-bound-asset img { width: 64px; height: 64px; }
  .production-task-card > textarea { min-height: 300px; }
  .step-footer {
    left: 0; min-height: 64px; padding: 10px 16px;
    flex-wrap: wrap; gap: 8px;
  }
  .footer-hint { order: 3; flex-basis: 100%; font-size: 9px; line-height: 1.5; }
  .step-footer .button { min-height: 38px; font-size: 11px; padding: 0 12px; }
  .step-footer #confirm-stage { margin-left: auto; }
  .activity summary span { display: none; }
  .activity li { flex-direction: column; gap: 2px; }
  .activity time { width: auto; }
  .workspace-foot { flex-direction: column; align-items: flex-start; gap: 8px; }
  .transfer-scope { font-size: 10px; }
  .message, .recovery { margin: 14px 20px 0; }
  .auth-screen { display: block; min-height: 100vh; }
  .auth-poster { min-height: 42vh; padding: 24px 24px 26px; }
  .poster-main { padding-top: 32px; }
  .poster-kicker { margin-bottom: 18px; font-size: 8px; }
  .poster-title { font-size: 50px; letter-spacing: .06em; }
  .poster-manifesto { margin-top: 18px; font-size: 16px; }
  .poster-rule, .poster-index { display: none; }
  .poster-foot { margin-top: 18px; font-size: 8px; }
  .auth-panel { padding: 34px 22px 44px; align-items: flex-start; }
  .auth-card { max-width: none; }
  .auth-meta { margin-bottom: 28px; }
  .auth-card h1 { font-size: 30px; }
  .auth-foot { flex-direction: column; gap: 3px; }
  .empty-state { margin: 8vh auto 60px; padding: 0 22px; }
  .empty-state h1 { font-size: 32px; }
  .empty-actions { flex-direction: column; align-items: stretch; }
  .empty-actions .button { width: 100%; }
  .dialog-actions { flex-wrap: wrap; }
  .dialog-actions .button { flex: 1; min-width: 0; }
  #permission-dialog { padding: 20px; }
  .permission-dialog .button-row { align-items: stretch; flex-direction: column; }
}

@media (max-width: 560px) {
  .poster-title { font-size: 44px; }
  .poster-manifesto { font-size: 15px; }
  .auth-card h1 { font-size: 27px; }
  .material-asset-row { grid-template-columns: 1fr; }
  .material-asset-visual img { width: 100%; height: 150px; }
  .direction-bound-asset { align-items: flex-start; flex-direction: column; }
  .asset-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .classification-weight-inputs { grid-template-columns: 1fr 1fr; }
  .activity li { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}


/* ---------- clear workspace surfaces and readable shared controls ---------- */
.sidebar { padding: 22px 16px 16px; border-right: 1px solid var(--rule); }
.sidebar, #stage-nav { scrollbar-color: var(--rule-strong) transparent; }
.sidebar::-webkit-scrollbar-thumb, #stage-nav::-webkit-scrollbar-thumb { background: var(--rule-strong); }
.sidebar button:focus-visible, .sidebar a:focus-visible, .sidebar select:focus-visible,
.picker-row select:focus-visible { outline-color: var(--red); }
.brand-mark, .poster-mark { border-color: var(--rule); border-radius: 10px; background: var(--paper-2); }
.brand-text { font-size: 18px; letter-spacing: 0; }
.brand-text small { font: 10px/1.5 var(--sans); letter-spacing: .03em; }
.project-picker { margin-top: 24px; }
.project-picker label, .nav-label, .nav-group-name { font-family: var(--sans); font-size: 11px; letter-spacing: .02em; color: var(--muted); }
.picker-row select { background-color: var(--paper-2); border-color: var(--rule); border-radius: 8px; font-size: 13px; }
.icon-button { border-color: var(--rule); border-radius: 8px; color: var(--muted); }
.icon-button:hover { border-color: var(--rule-strong); background: var(--paper-3); color: var(--ink); }
.import-entry, .import-entry.button { border-color: var(--rule-strong); color: var(--muted); font-size: 12px; }
.import-entry:hover, .import-entry.button:hover { color: var(--red); border-color: var(--red); }
.nav-label span, .nav-group-name span:last-child { color: var(--subtle); }
.stage-link { min-height: 39px; padding: 7px 10px; gap: 9px; border-radius: 8px; font-size: 13px; color: var(--ink-2); }
.stage-link:hover { background: var(--paper-3); color: var(--ink); }
.stage-number { width: 24px; font: 12px/1 var(--sans); color: var(--subtle); }
.stage-indicator { background: var(--rule-strong); }
.stage-link.active { background: var(--red-soft); color: var(--red-dark); }
.stage-link.active::before { top: 10px; bottom: 10px; width: 3px; border-radius: 3px; }
.stage-link.active .stage-number { font-size: 13px; }
.account-panel, .sidebar-foot { border-color: var(--rule); }
#account-username, .account-panel .text-button, .account-panel > p, .sidebar-foot { color: var(--muted); font-size: 11px; }
.account-panel .text-button:hover { color: var(--red); }
.account-panel #account-message { color: var(--amber); }
.account-panel .review-delete-confirm { background: var(--amber-soft); border-color: var(--rule-strong); color: var(--ink-2); font-size: 12px; }
.account-panel .review-delete-confirm .button.secondary { border-color: var(--rule-strong); color: var(--ink-2); }
.account-panel .review-delete-confirm .button.quiet { color: var(--muted); }
.topbar, .step-footer { background: var(--paper-2); }
.topbar { padding: 0 32px; }
.workspace { padding: 20px 32px 140px; }
.breadcrumb, .save-status, .workspace-foot { font-family: var(--sans); font-size: 12px; letter-spacing: 0; }
.breadcrumb > span[aria-hidden] { color: var(--rule-strong); }
.page-heading { gap: 12px; padding-bottom: 12px; margin-bottom: 12px; }
.page-heading h1 { font-size: clamp(26px, 2.4vw, 32px); line-height: 1.3; letter-spacing: -.02em; }
.page-description { margin-top: 6px; font-size: 14px; line-height: 1.65; color: var(--muted); }
.workspace p, .workspace li { font-size: 14px; }
.workspace summary { font-size: 14px; line-height: 1.7; }
.workspace .button { font-size: 14px; min-height: 40px; }
.eyebrow { font: 11px/1.4 var(--sans); letter-spacing: .03em; margin-bottom: 4px; }
.status-badge { border-radius: 20px; background: var(--paper-2); color: var(--muted); font: 12px/1.2 var(--sans); letter-spacing: 0; }
.button { font-size: 14px; min-height: 42px; padding: 9px 16px; line-height: 1.4; }
.button.primary { background: var(--red); border-color: var(--red); color: #FFF; }
.button.primary:hover:not(:disabled) { background: var(--red-dark); border-color: var(--red-dark); }
.button.secondary { background: var(--paper-2); }
.text-button { font-size: 13px; }
label, legend { font-size: 14px; color: var(--ink-2); }
input, textarea, select { font-size: 15px; }
input::placeholder, textarea::placeholder { color: var(--subtle); font-size: 14px; }
input:hover, textarea:hover, select:hover { border-color: var(--rule-strong); }
input:focus, textarea:focus, select:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgb(115 87 216 / 10%); }
input[type="checkbox"]:checked, input[type="radio"]:checked { background-color: var(--red); border-color: var(--red); }
fieldset { background: var(--paper-3); border-radius: var(--radius); }
.field-hint, .field-error, .optional-label, label > .optional-label { font-size: 12px; }
.field-error, .danger-text, .save-status[data-state="error"], .save-status[data-state="conflict"] { color: var(--danger) !important; }
.save-status[data-state="error"]::before, .save-status[data-state="conflict"]::before { background: var(--danger); }
.form-field [aria-invalid="true"] { border-color: var(--danger); background: #FFF7F8; }
.panel-heading h2, .panel > h2 { font-size: 20px; }
.panel-heading p, .panel-description, .collection-description, .source-meta, .source-origin,
.material-task-text, .research-status, .source-notice, .review-confirm-label,
.dialog-description, .permission-dialog > p, .footer-hint, .transfer-scope,
.progress-top p, .progress-item, .file-drop-note, .file-list li, .build-notice p { font-size: 13px; }
.panel.project-identity, .panel.product-scope-panel, .panel.collection-entry,
.panel.review-card, .panel.analysis-record, .panel.classification-card,
.panel.sequence-task-card, .panel.material-task-card, .panel.direction-task-card,
.panel.production-task-card, .panel.acceptance-result,
.source-card, .asset-card, .analysis-preview, .sequence-preview,
.research-record, .direction-item, .sequence-route, .production-replacement,
.acceptance-effect, .acceptance-upload, .file-drop { border-radius: var(--radius); }
.metric-label, .subtle-tag, .section-number { font-family: var(--sans); font-size: 11px; letter-spacing: 0; color: var(--muted); }
.step-footer { padding-left: 32px; padding-right: 32px; box-shadow: 0 -4px 18px rgb(37 39 53 / 3%); }
.message, .recovery { margin-left: 32px; margin-right: 32px; }
.auth-poster { background: var(--red-soft); color: var(--ink); }
.auth-poster::after { border-color: rgb(115 87 216 / 9%); border-radius: 14px; }
.poster-title { color: var(--ink); letter-spacing: -.03em; }
.poster-manifesto, .poster-kicker, .poster-index span { color: var(--ink-2); }
.poster-rule { background: var(--rule-strong); }
.poster-index div { border-color: var(--rule-strong); }
.poster-index b, .poster-foot, .auth-meta, .auth-foot, .auth-description, .empty-state p { color: var(--muted); }
.auth-description, .feishu-intro p { font-size: 14px; }
.dialog-heading .icon-button:hover { background: var(--paper-3); color: var(--ink); }
.permission-dialog th { font: 12px/1.5 var(--sans); letter-spacing: 0; }
.permission-dialog td { font-size: 13px; }
.permission-dialog td button, .permission-dialog td select { font-size: 12px; min-height: 36px; }
[hidden] { display: none !important; }

/* ---------- direction focus: keep the current image and next action visible ---------- */
.direction-focus-bar {
  position: sticky; top: var(--topbar); z-index: 11;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 0 0 20px; padding: 14px 18px;
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--paper-2); box-shadow: 0 5px 16px rgb(37 39 53 / 4%);
}
.direction-focus-title { min-width: 0; display: grid; gap: 3px; line-height: 1.45; }
#direction-focus-position { color: var(--red); font-size: 12px; font-weight: 600; }
#direction-focus-task { font-size: 16px; overflow-wrap: anywhere; }
.direction-focus-actions { display: flex; gap: 8px; flex: none; }
.direction-focus-actions .button { font-size: 13px; padding: 8px 12px; min-height: 38px; }
#direction-overall-progress { margin: 0 0 18px; }
#direction-overall-progress p { font-size: 13px; line-height: 1.7; color: var(--muted); }
.direction-workspace { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 20px; align-items: start; }
.direction-directory {
  position: sticky; top: calc(var(--topbar) + 108px);
  max-height: calc(100vh - var(--topbar) - 200px); overflow-y: auto;
  padding: 12px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper-2);
  scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent;
}
.direction-directory-heading { margin: 2px 4px 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.direction-directory-row { display: flex; align-items: center; gap: 6px; margin-top: 5px; min-width: 0; }
.direction-directory-row > input[type="checkbox"] { width: 17px; height: 17px; margin: 0; }
.direction-task-link {
  flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 8px; border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--ink-2); text-align: left; line-height: 1.5;
}
.direction-task-link:hover { background: var(--paper-3); }
.direction-task-link[aria-current="true"] { border-color: #DDD3F7; background: var(--red-soft); color: var(--red-dark); }
.direction-directory-number { flex: none; min-width: 19px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.direction-directory-copy { min-width: 0; display: grid; gap: 3px; }
.direction-directory-copy strong { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.direction-directory-copy small { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
#direction-task-list { min-width: 0; }
.direction-task-card { scroll-margin-top: calc(var(--topbar) + 120px); }
.direction-task-card > h3 { font-size: 21px; line-height: 1.5; overflow-wrap: anywhere; }
.direction-task-card > h4 { margin: 24px 0 12px; font-size: 16px; }
.direction-task-brief { padding: 14px 16px; margin: 14px 0 20px; border-radius: 8px; background: var(--paper); color: var(--ink-2); }
.direction-task-brief p { margin: 4px 0; font-size: 14px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.direction-core-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.direction-core-fields > *, .direction-option-core > * { min-width: 0; }
.direction-core-fields textarea { min-height: 150px; }
.direction-extra, .direction-history, .direction-service-details { margin: 18px 0; border-top: 1px solid var(--rule); }
.direction-extra > summary, .direction-history > summary, .direction-service-details > summary,
.direction-item > summary { padding: 12px 0; cursor: pointer; color: var(--muted); font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.direction-extra[open] > summary, .direction-history[open] > summary,
.direction-service-details[open] > summary { color: var(--ink); }
.direction-extra > .form-grid { margin-top: 6px; }
.direction-batch-panel { padding: 18px 20px; margin: 0 0 24px; background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); }
.direction-batch-panel .panel-heading { margin-bottom: 12px; }
.direction-batch-panel .button-row { margin: 12px 0; }
.direction-batch-panel .button { white-space: normal; }
#direction-batch-progress { display: block; width: 100%; height: 8px; margin: 14px 0 8px; border: 0; border-radius: 8px; accent-color: var(--red); }
#direction-batch-progress::-webkit-progress-bar { background: var(--paper-3); border-radius: 8px; }
#direction-batch-progress::-webkit-progress-value { background: var(--red); border-radius: 8px; }
#direction-batch-progress::-moz-progress-bar { background: var(--red); border-radius: 8px; }
#direction-batch-status { font-size: 13px; line-height: 1.7; color: var(--ink-2); overflow-wrap: anywhere; }
.direction-batch-panel details { margin-top: 10px; color: var(--muted); font-size: 13px; }
.direction-batch-panel summary { cursor: pointer; }
.direction-batch-panel ul { padding-left: 20px; margin: 10px 0 0; }
.direction-batch-panel li { margin: 6px 0; overflow-wrap: anywhere; }
.direction-preview { padding: 16px; background: var(--paper); border-radius: 8px; }
.direction-preview-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.direction-preview-option { min-width: 0; padding: 16px; background: var(--paper-2); border: 1px solid var(--rule); border-radius: 8px; }
.direction-preview-option h4, .direction-preview h4 { font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.direction-preview-option p { font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; white-space: pre-wrap; }
.direction-option-core { display: grid; gap: 12px; margin: 12px 0; }
.direction-option-core strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: 13px; }
.direction-preview-option .button { margin-top: 12px; width: 100%; }
.direction-item { padding: 14px 16px; border-radius: 8px; }
.direction-item-summary { font-size: 14px; color: var(--ink-2); line-height: 1.8; overflow-wrap: anywhere; }
.direction-item-summary p { margin: 5px 0; white-space: pre-wrap; }
.direction-item .direction-editor { margin-top: 12px; }
.direction-task-card > .button-row .button, .direction-item .button { min-height: 40px; font-size: 13px; }
.direction-task-card .source-meta, .direction-task-card .field-hint,
.direction-preview-section > summary { font-size: 12px; }

@media (max-width: 1180px) and (min-width: 821px) {
  .workspace { padding: 28px 28px 140px; }
  .topbar { padding: 0 28px; }
  .step-footer { padding-left: 28px; padding-right: 28px; }
  .direction-workspace { grid-template-columns: 176px minmax(0, 1fr); gap: 16px; }
  .direction-directory { padding: 10px; }
  .panel.direction-task-card { padding: 20px; }
}
@media (max-width: 980px) {
  .direction-core-fields { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .sidebar { padding: 12px 16px 10px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .project-picker { margin-top: 10px; }
  .brand-text { font-size: 17px; }
  #account-username, .account-panel .text-button, .account-panel > p { font-size: 11px; }
  .topbar { padding: 0 20px; }
  .breadcrumb, .save-status { font-size: 11px; }
  .mobile-stage { background: var(--paper-2); }
  .mobile-stage label { font: 11px/1.4 var(--sans); letter-spacing: 0; }
  .mobile-stage select { font-size: 13px; height: 38px; min-height: 38px; }
  .workspace { padding: 24px 20px 156px; }
  .page-heading h1 { font-size: 29px; }
  .page-description { font-size: 14px; }
  .direction-workspace { grid-template-columns: 1fr; gap: 18px; }
  .direction-directory { position: static; max-height: none; overflow: visible; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; padding: 12px; }
  .direction-directory-heading { grid-column: 1 / -1; margin-bottom: 4px; }
  .direction-directory-row { margin: 0; }
  .direction-task-link { padding: 8px 5px; gap: 5px; }
  .direction-directory-number { min-width: 15px; }
  .direction-directory-copy strong { font-size: 12px; }
  .direction-directory-copy small { font-size: 11px; }
  .direction-focus-bar { gap: 12px; padding: 12px 14px; margin-bottom: 16px; }
  #direction-focus-task { font-size: 15px; }
  .direction-focus-actions { gap: 6px; }
  .direction-focus-actions .button { min-height: 40px; padding: 8px 10px; font-size: 12px; }
  .direction-preview-options { grid-template-columns: 1fr; }
  .panel.direction-task-card, .direction-batch-panel { padding: 18px; }
  .direction-task-card > h3 { font-size: 19px; }
  .direction-task-brief { padding: 12px; }
  .direction-preview, .direction-preview-option { padding: 14px; }
  .step-footer { padding: 10px 16px; }
  .step-footer .button { font-size: 12px; }
  .footer-hint { font-size: 11px; }
  .message, .recovery { margin: 14px 20px 0; }
}
@media (max-width: 560px) {
  input, textarea, select { font-size: 16px; }
  .direction-focus-bar { align-items: stretch; flex-direction: column; gap: 9px; }
  .direction-focus-title { grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 8px; }
  #direction-focus-position { font-size: 12px; white-space: nowrap; }
  #direction-focus-task { font-size: 14px; line-height: 1.5; }
  .direction-focus-actions { justify-content: space-between; }
  .direction-focus-actions .button { flex: 1; }
  .direction-task-card { scroll-margin-top: calc(var(--topbar) + 170px); }
  .direction-batch-panel .button-row { align-items: stretch; }
  .direction-batch-panel .button-row .button { flex: 1 1 130px; }
  .direction-directory { gap: 4px 8px; }
  .direction-directory-row { gap: 4px; }
  .direction-directory-copy strong { line-height: 1.5; }
  .direction-core-fields textarea { min-height: 130px; }
}


/* ---------- directions first screen: compact setup, persistent image context ---------- */
.workspace[data-stage="directions"] { padding-top: 20px; }
.workspace[data-stage="directions"] .page-heading { padding-bottom: 12px; margin-bottom: 12px; gap: 12px; }
.workspace[data-stage="directions"] .eyebrow { font-size: 11px; line-height: 1.4; margin-bottom: 4px; }
.workspace[data-stage="directions"] .page-heading h1 { font-size: 28px; line-height: 1.3; }
.workspace[data-stage="directions"] .page-description { margin-top: 5px; font-size: 13px; line-height: 1.5; }
.direction-intro { margin: 0 0 8px; }
.direction-intro .direction-service-details { margin: 0; border: 0; }
.direction-intro .direction-service-details > summary { padding: 2px 0; font-size: 12px; line-height: 1.5; }
.direction-intro .direction-service-details[open] { padding-bottom: 8px; }
#direction-batch-panel { padding: 12px 14px; margin-bottom: 12px; }
#direction-batch-panel > .source-card-heading, #direction-batch-panel > .panel-heading { margin: 0; align-items: center; gap: 8px; }
#direction-batch-panel h3 { margin: 0; font-size: 15px; line-height: 1.5; }
#direction-batch-selected { margin: 0; font-size: 12px; line-height: 1.5; }
#direction-batch-panel .button-row { margin: 6px 0; gap: 6px; }
#direction-batch-panel .button { min-height: 34px; padding: 6px 10px; font-size: 12px; }
#direction-batch-panel > .field-hint { margin: 4px 0 0; font-size: 12px; line-height: 1.5; }
#direction-batch-status:empty { display: none; }
#direction-batch-panel > details { margin: 4px 0 0; border: 0; }
#direction-batch-panel > details > summary { padding: 2px 0; font-size: 12px; line-height: 1.5; }
#direction-batch-progress { margin: 8px 0 4px; height: 6px; }
.direction-focus-bar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  gap: 4px 14px; padding: 10px 14px; margin-bottom: 12px;
  scroll-margin-top: var(--topbar);
}
.direction-focus-title { grid-column: 1; grid-row: 1; gap: 2px; }
.direction-focus-actions { grid-column: 2; grid-row: 1; }
#direction-overall-progress { grid-column: 1 / -1; grid-row: 2; margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
#direction-current-progress { grid-column: 1 / -1; grid-row: 3; margin: 0; padding-top: 3px; font-size: 12px; line-height: 1.5; color: var(--red-dark); }
.direction-directory { top: calc(var(--topbar) + 96px); max-height: calc(100vh - var(--topbar) - 178px); padding: 8px; }
.direction-directory-heading { margin: 0 3px 5px; font-size: 12px; line-height: 1.5; }
.direction-directory-row { gap: 5px; margin-top: 2px; }
.direction-task-link { padding: 4px 5px; gap: 5px; line-height: 1.35; }
.direction-directory-number { min-width: 17px; font-size: 11px; line-height: 1.45; }
.direction-directory-copy { gap: 2px; }
.direction-directory-copy strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 12px; line-height: 1.35; }
.direction-directory-copy small { font-size: 10.5px; line-height: 1.35; }
.workspace pre { min-width: 0; max-width: 100%; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
@media (max-width: 820px) {
  .workspace[data-stage="directions"] { padding-top: 16px; }
  .workspace[data-stage="directions"] .page-heading { flex-direction: row; align-items: flex-start; }
  .workspace[data-stage="directions"] .page-heading h1 { font-size: 25px; }
  .workspace[data-stage="directions"] .status-badge { font-size: 11px; padding: 5px 8px; }
  .direction-directory { position: static; max-height: none; padding: 10px; }
  .direction-focus-title { display: grid; grid-template-columns: 1fr; }
  .direction-focus-bar { gap: 4px 10px; }
  .direction-focus-actions .button { padding: 6px 9px; min-height: 36px; }
  #direction-focus-task { font-size: 14px; }
  #direction-batch-panel .button-row .button { flex: 0 1 auto; }
}
@media (max-width: 560px) {
  .direction-focus-bar { grid-template-columns: minmax(0, 1fr); }
  .direction-focus-title { grid-column: 1; grid-row: 1; grid-template-columns: auto minmax(0, 1fr); gap: 6px; }
  .direction-focus-actions { grid-column: 1; grid-row: 3; gap: 6px; }
  #direction-overall-progress { grid-column: 1; grid-row: 2; }
  #direction-current-progress { grid-column: 1; grid-row: 4; }
  #direction-focus-position { font-size: 11px; }
  #direction-batch-panel { padding: 10px 12px; }
  #direction-batch-panel .button-row { gap: 5px; }
  #direction-batch-panel .button { padding: 6px 8px; }
  #direction-batch-panel .button-row .button { flex: 1 1 auto; }
}


/* ---------- all stages: content first, optional editing in compact disclosures ---------- */
.workspace:not([data-stage="directions"]) #stage-content > .panel:first-child { padding-top: 12px; }
.workspace:not([data-stage="directions"]) #stage-content > .panel + .panel { padding-top: 18px; }
.workspace:not([data-stage="directions"]) .panel { margin-bottom: 18px; }
.workspace:not([data-stage="directions"]) .panel-heading { margin-bottom: 8px; gap: 12px; }
.workspace:not([data-stage="directions"]) .panel-heading h2,
.workspace:not([data-stage="directions"]) .panel > h2 { font-size: 18px; line-height: 1.45; }
.workspace:not([data-stage="directions"]) .collection-description { margin-bottom: 10px; font-size: 13px; line-height: 1.65; }
.workspace:not([data-stage="directions"]) :is(.project-identity, .product-scope-panel, .collection-entry,
.review-card, .analysis-record, .classification-card, .sequence-task-card, .material-task-card,
.production-task-card, .acceptance-result, .acceptance-upload, .source-card) { padding: 16px 18px; }
.workspace:not([data-stage="directions"]) :is(.analysis-record-section, .classification-group, .sequence-task-section) > .panel-heading h2 { font-size: 18px; }
.clarity-details, .task-flow-details, details.notes-panel { margin: 10px 0; padding: 0; border: 0; border-top: 1px solid var(--rule); border-radius: 0; background: transparent; }
.workspace :is(.clarity-details, .task-flow-details, details.notes-panel) > summary { padding: 9px 0; font-size: 13px; line-height: 1.6; font-weight: 500; color: var(--ink-2); cursor: pointer; overflow-wrap: anywhere; }
.workspace :is(.clarity-details, .task-flow-details, details.notes-panel)[open] > summary { color: var(--red-dark); }
.workspace :is(.clarity-details, .task-flow-details, details.notes-panel) > :not(summary) { margin-top: 8px; }
.workspace .clarity-details .clarity-details { margin: 8px 0; }
.workspace .clarity-details > summary:focus-visible,
.workspace .task-flow-details > summary:focus-visible { outline-color: var(--red); }
.project-extra { grid-column: 1 / -1; }
.project-extra > .form-grid { padding: 2px 0 8px; }
.clarity-summary { margin: 8px 0; color: var(--ink-2); line-height: 1.75; overflow-wrap: anywhere; white-space: pre-wrap; }
.clarity-summary:empty { display: none; }
.clarity-summary p { margin: 5px 0; }
.clarity-fab { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 10px 0; }
.workspace .clarity-fab > p { min-width: 0; margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--paper); color: var(--ink-2); font-size: 13px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.clarity-fab > p:nth-child(n+4), .clarity-fab > .source-notice { grid-column: 1 / -1; }
.classification-fab.clarity-fab { padding-left: 0; border-left: 0; }
.workspace .clarity-fab > .source-notice { background: var(--amber-soft); color: var(--amber); }
.clarity-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.clarity-toolbar > :is(h2, h3, h4) { flex: 1; min-width: 0; margin: 0; overflow-wrap: anywhere; }
.clarity-toolbar .review-confirm-label { flex: 1 1 240px; margin: 4px 0; }
.clarity-toolbar .source-state, .clarity-toolbar .subtle-tag { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.clarity-source-card .source-card-heading { margin-bottom: 6px; }
.clarity-source-card .source-meta { margin-top: 4px; font-size: 12px; }
.clarity-source-card .clarity-details { margin-bottom: 0; }
.workspace .panel-heading .subtle-tag { display: inline-block; font-size: 12px; white-space: normal; text-align: right; }
.workspace details.notes-panel { margin-top: 22px; padding-top: 0; }
#stage-notes-summary { font-size: 13px; }
.workspace details.notes-panel textarea { min-height: 100px; margin-bottom: 8px; }
.workspace :is(pre, .source-meta, .source-origin, .source-state, .source-notice, .field-error, .collection-feedback) { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.workspace pre { white-space: pre-wrap; word-break: break-word; }
.workspace :is(.field-error, .collection-feedback.error, .acceptance-result-errors, .task-flow-upload-warning),
.workspace [role="alert"], .workspace .acceptance-result-errors .source-notice { color: var(--danger) !important; }
.workspace .collection-feedback.error, .workspace .task-flow-upload-warning { border-color: #EDCBD0; border-left-color: var(--danger); background: #FFF6F7; }
.task-flow-shell, .task-flow-body { min-width: 0; }
.task-flow-focus-bar > :first-child { min-width: 0; grid-column: 1; grid-row: 1; }
#task-flow-position { display: block; color: var(--red); font-size: 12px; font-weight: 600; line-height: 1.5; }
.workspace #task-flow-task { margin: 2px 0 0; font-size: 15px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.task-flow-focus-bar .direction-focus-actions { grid-column: 2; grid-row: 1; }
.workspace .task-flow-progress { margin: -4px 0 12px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.task-flow-directory { top: calc(var(--topbar) + 90px); max-height: calc(100vh - var(--topbar) - 172px); }
.task-flow-directory-link {
  display: block; width: 100%; min-width: 0; margin: 3px 0 0; padding: 7px 8px;
  border: 1px solid transparent; border-radius: 8px; background: transparent;
  color: var(--ink-2); font: 12px/1.45 var(--sans); text-align: left;
  white-space: normal; overflow-wrap: anywhere;
}
.task-flow-directory-link:hover { background: var(--paper-3); }
.task-flow-directory-link[aria-current="true"] { border-color: #DDD3F7; color: var(--red-dark); background: var(--red-soft); }
.task-flow-directory-link .source-meta { display: block; margin: 2px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.workspace .task-flow-upload-warning { padding: 12px 14px; font-size: 14px; font-weight: 500; line-height: 1.75; white-space: normal; overflow-wrap: anywhere; }
.task-flow-body > .panel:first-child { margin-top: 0; }
.material-task-card > label { margin: 12px 0 5px; }
.material-task-card > textarea { min-height: 86px; line-height: 1.7; }
.material-asset-picker { padding: 10px 12px; margin: 14px 0; }
.material-asset-picker > div[id^="material-assets-"] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.material-asset-picker .material-asset-row { grid-template-columns: 64px minmax(0, 1fr); align-items: start; gap: 9px; margin: 0; padding: 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper-2); }
.material-asset-picker .material-asset-visual img { width: 64px; height: 64px; border-radius: 5px; }
.material-asset-picker .asset-thumbnail-error { min-height: 64px; font-size: 11px; padding: 6px; }
.material-asset-picker .material-asset-info label { margin: 0 0 4px; gap: 6px; font-size: 12px; line-height: 1.5; }
.material-asset-picker .material-asset-info input { width: 17px; height: 17px; margin-top: 1px; }
.workspace .material-asset-picker .material-asset-info .source-meta { margin-top: 4px; font-size: 11px; line-height: 1.55; }
.material-asset-picker .material-asset-info a { font-size: 11px; line-height: 1.5; }
.production-task-card > textarea { min-height: 200px; max-height: 52vh; font: 13px/1.75 var(--sans); }
.production-task-card > label { margin: 12px 0 5px; }
.production-task-card > .button-row { margin: 10px 0; }
.workspace .task-flow-effects { padding-top: 0; margin-top: 18px; }
.task-flow-effects .acceptance-effect { margin-top: 12px; }
/* Short identity and verified-source rows keep useful fields in the first screen. */
.workspace .panel.project-identity { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 16px; padding: 12px 16px; }
.workspace .project-identity .panel-heading { margin: 0; gap: 8px; align-items: center; }
.project-identity .project-name-wrap { min-width: 0; max-width: none; }
.project-identity #project-name { min-height: 44px; height: 44px; padding: 8px 12px; font: 16px/1.5 var(--sans); }
.workspace .review-card .source-card-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.review-card .source-card-heading h2 { flex: 1 1 220px; font-size: 16px; line-height: 1.45; }
.workspace .review-card .clarity-inline-confirm { display: flex; flex: 0 1 auto; align-items: flex-start; gap: 6px; margin: 0; font-size: 12px; line-height: 1.5; white-space: normal; }
.review-card .clarity-inline-confirm input { width: 17px; height: 17px; margin: 1px 0 0; }
.workspace .review-card > .source-meta { margin: 4px 0 0; font-size: 12px; line-height: 1.5; }
.workspace .review-card > .clarity-summary { margin: 4px 0 0; font-size: 13px; line-height: 1.6; }
.workspace .review-card .clarity-details { margin: 6px 0 0; }
.workspace .review-card .clarity-details > summary { padding: 6px 0; font-size: 12px; line-height: 1.5; }
.workspace .review-card-actions { margin-top: 8px; }
.review-card .source-state { max-width: 100%; font-size: 11px; line-height: 1.4; white-space: normal; }
#collection-source-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
#collection-source-list > .source-card { min-width: 0; margin: 0; }
#collection-source-list .source-card-heading { flex-wrap: wrap; gap: 6px 10px; }
#collection-source-list .source-body, #collection-source-list .source-body pre { min-width: 0; max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 1180px) and (min-width: 821px) {
  .workspace:not([data-stage="directions"]) { padding-top: 20px; }
  .material-asset-picker .material-asset-row { grid-template-columns: 54px minmax(0, 1fr); padding: 8px; gap: 8px; }
  .material-asset-picker .material-asset-visual img { width: 54px; height: 54px; }
}
@media (max-width: 980px) {
  .clarity-fab { grid-template-columns: 1fr; gap: 6px; }
}
@media (max-width: 820px) {
  .workspace:not([data-stage="directions"]) { padding-top: 16px; }
  .workspace .panel.project-identity { grid-template-columns: 1fr; gap: 8px; }
  .workspace .project-identity .panel-heading { justify-content: space-between; }
  #collection-source-list { grid-template-columns: 1fr; }
  .review-card .source-card-heading h2 { flex-basis: 100%; }
  .workspace .review-card .clarity-inline-confirm { flex-basis: 100%; }

  .workspace:not([data-stage="directions"]) .page-heading { flex-direction: row; align-items: flex-start; gap: 10px; }
  .workspace:not([data-stage="directions"]) .page-heading h1 { font-size: 25px; }
  .workspace:not([data-stage="directions"]) .status-badge { font-size: 11px; padding: 5px 8px; }
  .workspace:not([data-stage="directions"]) :is(.project-identity, .product-scope-panel, .collection-entry,
  .review-card, .analysis-record, .classification-card, .sequence-task-card, .material-task-card,
  .production-task-card, .acceptance-result, .acceptance-upload, .source-card) { padding: 14px; }
  .task-flow-directory { position: static; max-height: none; }
  .task-flow-directory-link { margin: 0; }
  .clarity-toolbar { gap: 8px; }
  .workspace .clarity-toolbar .button { min-height: 36px; font-size: 13px; padding: 7px 10px; }
  .material-asset-picker > div[id^="material-assets-"] { gap: 8px; }
  .material-asset-picker .material-asset-row { grid-template-columns: 1fr; }
  .material-asset-picker .material-asset-visual img { width: 100%; height: 88px; }
  .production-task-card > textarea { min-height: 180px; max-height: 46vh; font-size: 16px; }
}
@media (max-width: 560px) {
  .task-flow-focus-bar { grid-template-columns: minmax(0, 1fr); }
  .task-flow-focus-bar .direction-focus-actions { grid-column: 1; grid-row: 2; }
  .task-flow-focus-bar .direction-focus-actions .button { flex: 1; }
  .workspace #task-flow-task { font-size: 14px; }
  .material-asset-picker { padding: 10px; }
  .material-asset-picker .material-asset-info label { font-size: 12px; }
  .workspace .panel-heading { flex-wrap: wrap; }
  .workspace .panel-heading .subtle-tag { text-align: left; }
}

/* Keep decisions next to record names; supporting details remain below. */
.workspace .clarity-service { padding: 14px 0; }
.clarity-service .clarity-toolbar { justify-content: space-between; }
.clarity-service .button-row { margin: 0; }
.clarity-service > .research-status, .clarity-service > .collection-description { margin: 4px 0; }
.clarity-service > .clarity-details { margin-bottom: 0; }
.workspace .clarity-inline-confirm { flex: 0 1 auto; margin: 0; font-size: 12px; line-height: 1.5; }
.clarity-inline-confirm input { flex: none; }
.sequence-task-card .source-card-heading { align-items: center; }
.sequence-task-card .source-card-heading h3 { flex: 1 1 250px; }
.sequence-task-card .source-card-heading .sequence-task-actions { width: auto; margin: 0; gap: 6px; }
.sequence-task-card .source-card-heading .button { min-height: 32px; font-size: 12px; padding: 6px 10px; }
.sequence-task-card .source-card-heading .danger-text { font-size: 12px; }
.sequence-task-card .clarity-summary { margin: 6px 0; }
.sequence-task-card > .clarity-details { margin: 6px 0 0; }
.workspace .sequence-coverage { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 0; margin-bottom: 12px; border: 0; background: transparent; }
.workspace .sequence-coverage p { margin: 0; font-size: 12px; }
.workspace .source-notice:empty { display: none; }
@media (max-width: 560px) {
  .sequence-task-card .source-card-heading h3 { flex-basis: 100%; }
  .sequence-task-card .source-card-heading .sequence-task-actions { flex: 1; justify-content: flex-end; }
}
.clarity-flow-intro { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 0 !important; }
.clarity-flow-intro > .source-meta { flex: 1 1 300px; margin: 0; font-size: 13px; }
.clarity-flow-intro > .button { min-height: 36px; padding: 7px 12px; font-size: 13px; }
.workspace pre.production-readable { max-height: 280px; overflow-y: auto; padding: 14px; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); font: 13px/1.8 var(--sans); }
.production-editor textarea { min-height: 240px; max-height: 56vh; font: 13px/1.75 var(--sans); }
.acceptance-upload-details { margin: 0 0 14px; padding: 0 14px; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper-2); }
.acceptance-upload-details > summary { color: var(--red-dark); }
.acceptance-upload-details .acceptance-upload { padding: 8px 0 10px !important; margin: 0; border: 0; }
@media (max-width: 560px) { .production-editor textarea { font-size: 16px; } .workspace pre.production-readable { max-height: 240px; } }


/* ---------- simplified workflow: file rows and group preparation ---------- */
.workspace #collection-source-list.materials-panel { display: block; }
.workspace .materials-list { display: block; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper-2); }
.workspace .materials-list .material-row { min-width: 0; padding: 10px 14px; margin: 0; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; background: transparent; }
.workspace .materials-list .material-row:last-child { border-bottom: 0; }
.workspace .material-row-main { display: grid; grid-template-columns: minmax(0, 1fr) 148px minmax(120px, .6fr) 96px; align-items: center; gap: 12px; }
.workspace .material-row-main > * { min-width: 0; }
.workspace .material-row-name h3 { margin: 0; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.workspace .material-row-name .source-meta { margin: 3px 0 0; font-size: 12px; line-height: 1.5; }
.workspace .material-row-type select { min-height: 38px; height: 38px; padding: 5px 28px 5px 9px; font-size: 13px; }
.workspace .material-row-reading { margin: 0; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.workspace .material-row-include { margin: 0; gap: 6px; font-size: 12px; line-height: 1.5; }
.workspace .material-row-include input { margin-top: 1px; }
.workspace .material-row .material-row-details { margin: 4px 0 0; border: 0; }
.workspace .material-row .material-row-details > summary { padding: 3px 0; font-size: 12px; line-height: 1.5; }
.workspace .material-row-details .review-fields { margin-top: 10px; }
.workspace .material-row-details .review-body-editor { background: var(--paper); }
.workspace .materials-bulk { margin: 8px 0 12px; }
.workspace .materials-bulk-purpose { display: flex; flex-wrap: wrap; gap: 8px 12px; margin: 8px 0 12px; align-items: center; }
.workspace .materials-bulk-purpose label { margin: 0; font-size: 13px; }
.workspace .materials-bulk-purpose select { flex: 0 1 200px; width: 200px; min-height: 40px; }
.workspace .material-batch-preview { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--rule-strong); border-radius: 8px; background: var(--paper); }
.workspace .material-batch-preview > p { font-size: 13px; line-height: 1.7; }
.workspace .material-batch-preview ul { padding-left: 20px; max-height: 240px; overflow-y: auto; margin: 10px 0; }
.workspace .material-batch-preview li { margin: 4px 0; font-size: 13px; overflow-wrap: anywhere; }
.workspace .material-batch-preview .button { margin: 4px 8px 0 0; }
.workspace .material-history { margin-top: 12px; }
.workspace .preparation-group > .field-hint { margin: 4px 0 12px; font-size: 13px; }
.workspace .preparation-rows { border: 1px solid var(--rule); border-radius: 10px; background: var(--paper-2); }
.workspace .preparation-row { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) 120px; align-items: start; gap: 18px; padding: 12px 14px; border-bottom: 1px solid var(--rule); }
.workspace .preparation-row:last-child { border-bottom: 0; }
.workspace .preparation-row > div { min-width: 0; }
.workspace .preparation-row strong { font-size: 14px; font-weight: 600; line-height: 1.55; overflow-wrap: anywhere; }
.workspace .preparation-row p { margin: 4px 0 0; font-size: 13px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.workspace .preparation-row small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.workspace .preparation-row > div:last-child { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.workspace .preparation-row .source-state { max-width: 100%; font: 12px/1.5 var(--sans); letter-spacing: 0; white-space: normal; overflow-wrap: anywhere; }
.workspace .preparation-row .button { min-height: 34px; padding: 6px 12px; font-size: 12px; }
.workspace :is(.shared-materials, .material-single-editor) { margin: 14px 0; padding: 0; border-top: 1px solid var(--rule); }
.workspace :is(.shared-materials, .material-single-editor) > summary { padding: 10px 0; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.workspace .material-single-editor > .task-flow-shell { margin-top: 10px; }
.workspace .shared-material-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.workspace .shared-material-option { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 8px; min-width: 0; margin: 0; padding: 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper-2); cursor: pointer; }
.workspace .shared-material-option:has(input:checked) { border-color: #B9A8EC; background: var(--red-soft); }
.workspace .shared-material-option input { margin: 2px 0 0; }
.workspace .shared-material-option img { display: block; width: 100%; height: 76px; object-fit: contain; }
.workspace .shared-material-option span { grid-column: 1 / -1; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.workspace .shared-material-grid > .field-hint { grid-column: 1 / -1; }
.workspace .chosen-direction-summary:not(:empty) { margin: 12px 0; padding: 12px 14px; border: 1px solid #C6DECF; border-radius: 8px; background: var(--green-soft); }
.workspace .chosen-direction-summary strong { display: block; color: var(--green); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.workspace .chosen-direction-summary p { margin: 5px 0 0; font-size: 13px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 980px) {
  .workspace .material-row-main { grid-template-columns: minmax(0, 1fr) 144px 96px; gap: 8px 12px; }
  .workspace .material-row-name { grid-column: 1; grid-row: 1 / span 2; }
  .workspace .material-row-reading { grid-column: 2 / -1; grid-row: 2; }
  .workspace .material-row-include { grid-column: 3; grid-row: 1; }
  .workspace .shared-material-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .workspace .materials-list .material-row { padding: 10px 12px; }
  .workspace .material-row-main { grid-template-columns: minmax(0, 1fr) 96px; gap: 8px 10px; }
  .workspace .material-row-name { grid-column: 1 / -1; grid-row: 1; }
  .workspace .material-row-type { grid-column: 1; grid-row: 2; }
  .workspace .material-row-type select { font-size: 16px; min-height: 40px; height: 40px; }
  .workspace .material-row-reading { grid-column: 1 / -1; grid-row: 3; }
  .workspace .material-row-include { grid-column: 2; grid-row: 2; }
  .workspace .materials-bulk-purpose label, .workspace .materials-bulk-purpose select { flex: 1 1 100%; width: 100%; }
  .workspace .materials-bulk-purpose .button { flex: 1 1 100%; }
  .workspace .preparation-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 12px; }
  .workspace .preparation-row > div:first-child { grid-column: 1; grid-row: 1; }
  .workspace .preparation-row > div:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .workspace .preparation-row > div:last-child { grid-column: 2; grid-row: 1; max-width: 100px; }
  .workspace .shared-material-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}

/* Compact product setup; preserve the spacing of all downstream pages. */
.workspace[data-stage="project"] #stage-content > .project-profile-card { padding: 18px 22px; }
.workspace[data-stage="project"] .project-profile-card .form-grid { gap: 12px 20px; }
.workspace[data-stage="project"] .project-profile-card label { margin-bottom: 5px; }
.workspace[data-stage="project"] .project-profile-card input { padding: 8px 11px; min-height: 38px; }
.workspace[data-stage="project"] .project-profile-card textarea { padding: 9px 11px; min-height: 74px; line-height: 1.55; }
.workspace[data-stage="project"] .project-profile-settings { margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--rule); grid-template-columns: minmax(140px, .6fr) minmax(0, 1.4fr); align-items: start; }
.workspace[data-stage="project"] .project-profile-settings .field-wide { grid-column: auto; }
@media (max-width: 700px) {
  .workspace[data-stage="project"] #stage-content > .project-profile-card { padding: 14px; }
  .workspace[data-stage="project"] .project-profile-settings { grid-template-columns: 1fr; }
}

/* Compact single-image task overview. Detail editor and recovery gates stay intact. */
#workspace[data-stage="tasks"]{position:relative}
#workspace[data-stage="tasks"] .page-heading{padding-right:250px}
#workspace[data-stage="tasks"] #stage-state{display:none}
#workspace[data-stage="tasks"] #stage-content{display:grid;gap:16px}
.task-page-actions{position:absolute;right:32px;top:52px;display:flex;gap:9px}.task-page-actions .button{font-size:12px;min-height:36px;padding:8px 14px}
.task-page-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border:1px solid #dce2ed;border-radius:9px;overflow:hidden;background:#fff}
.task-page-stats>div{padding:15px 18px;display:grid;gap:6px;min-width:0}.task-page-stats>div+div{border-left:1px solid #dce2ed}.task-page-stats strong{font-size:19px;line-height:1.2}.task-page-stats span{font-size:12px;color:#718096}
#workspace[data-stage="tasks"] .task-overview{padding:0;margin:0;border:0;background:none;box-shadow:none;min-width:0}
.task-overview-table{width:100%;table-layout:fixed;border-collapse:separate;border-spacing:0;border:1px solid #dce2ed;border-radius:9px;overflow:hidden;background:white;color:#303948;font-size:12px}
.task-overview-table th{padding:12px 15px;background:#f7f9fb;font-size:11px;color:#718096;text-align:left;font-weight:600;border-bottom:1px solid #dce2ed}.task-overview-table th:nth-child(1){width:30%}.task-overview-table th:nth-child(2){width:34%}.task-overview-table th:nth-child(3){width:11%}.task-overview-table th:nth-child(4){width:15%}.task-overview-table th:nth-child(5){width:10%}
.task-overview-table td{padding:20px 15px;vertical-align:middle;border-bottom:1px solid #dce2ed;line-height:1.6;overflow-wrap:anywhere}.task-overview-table tr:last-child td{border-bottom:0}.task-overview-number{display:block;color:#8792a2;font-size:10px;margin-bottom:5px;font-weight:600}.task-overview-name strong{font-size:13px;font-weight:600;line-height:1.6}
.workspace .task-overview-proof{margin:0;color:#6b788c;font-size:12px;line-height:1.7;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;white-space:normal}
.task-overview-assets{color:#6b788c}.task-overview-state{font-size:10px;padding:4px 8px;background:#f0f2f6;color:#718096;border-radius:5px;display:inline-block}.task-overview-state[data-state="ready"]{background:#e7f5ef;color:#2e8062}.task-overview-state[data-state="missing"]{background:#fff1e6;color:#a36b29}.task-overview-state[data-state="pending"]{background:#eef0ff;color:#5867bd}.task-overview-action{text-align:right}.task-overview-action .text-button{padding:3px 0;font-size:11px;color:#5263c8;white-space:nowrap}.task-overview-row.active{background:#f6f7ff}.task-overview-row.active .task-overview-name{box-shadow:inset 3px 0 #5263c8}
#workspace[data-stage="tasks"] :is(.shared-materials,.material-single-editor){margin:0;padding:0;border:0}
#workspace[data-stage="tasks"] .shared-materials{margin-top:13px}
#workspace[data-stage="tasks"] :is(.shared-materials,.material-single-editor)>summary{font-size:11px;padding:0;color:#7b8799}
#workspace[data-stage="tasks"] .material-single-editor:not([open]){display:none}
#workspace[data-stage="tasks"] .material-single-editor[open]{background:#fff;border:1px solid #dce2ed;border-radius:9px;padding:16px 20px}
#workspace[data-stage="tasks"] .task-flow-directory{display:none}
#workspace[data-stage="tasks"] .task-flow-workspace{display:block}
#workspace[data-stage="tasks"] .material-task-card{padding:0;margin:0;border:0;box-shadow:none}
#workspace[data-stage="tasks"] .material-task-card>.source-card-heading{display:none}
#workspace[data-stage="tasks"] .task-flow-focus-bar{position:static;margin-bottom:12px;padding:12px 0;border-bottom:1px solid #e2e6ee;background:none;box-shadow:none}
#workspace[data-stage="tasks"] .task-flow-progress{display:none}
#workspace[data-stage="tasks"] .material-asset-picker{margin-top:16px}.task-page-tools,.task-result-details{font-size:11px;color:#7b8799}.task-page-tools>summary,.task-result-details>summary{cursor:pointer}.task-page-tools{justify-self:end}.task-page-tools>summary{text-align:right}.task-page-tools .button{font-size:12px;margin:8px 0 0 8px}.task-result-details:not([open]){margin-bottom:-34px;justify-self:start;z-index:1}.task-result-details .run-result-preview{margin-top:10px!important}
#workspace[data-stage="tasks"] .activity,#workspace[data-stage="tasks"] .workspace-foot,#workspace[data-stage="tasks"] .transfer-scope,#workspace[data-stage="tasks"] #stage-notes-details,#workspace[data-stage="tasks"] #confirm-hint{display:none}
#workspace[data-stage="tasks"] .step-footer{position:static;display:flex;justify-content:space-between;background:none;border:0;box-shadow:none;padding:6px 0 0}#workspace[data-stage="tasks"] .step-footer .button{font-size:12px;min-height:36px;padding:8px 14px}
@media(max-width:850px){#workspace[data-stage="tasks"] .page-heading{padding-right:0}.task-page-actions{position:static;justify-content:flex-end;order:-1}.task-overview-table th:nth-child(1){width:28%}.task-overview-table th:nth-child(2){width:28%}.task-overview-table th:nth-child(3){width:13%}.task-overview-table th:nth-child(4){width:18%}.task-overview-table th:nth-child(5){width:13%}.task-overview-table td,.task-overview-table th{padding:14px 9px}}
@media(max-width:560px){.task-page-stats>div{padding:13px 10px}.task-page-stats strong{font-size:17px}.task-page-stats span{font-size:11px}.task-overview-table th:nth-child(2),.task-overview-table td:nth-child(2){display:none}.task-overview-table th:nth-child(1){width:42%}.task-overview-table th:nth-child(3){width:14%}.task-overview-table th:nth-child(4){width:26%}.task-overview-table th:nth-child(5){width:18%}.task-overview-name strong{font-size:12px}.task-overview-state{padding:4px 5px}.task-overview-table td,.task-overview-table th{padding:13px 8px}.task-overview-action .text-button{font-size:10px}#workspace[data-stage="tasks"] .material-single-editor[open]{padding:13px}}

.task-overview-name strong{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

/* Visible, keyboard-accessible reasons and read-only destinations for all workflow pages. */
#workflow-guidance{margin:0 0 18px;padding:14px 18px;border:1px solid #e8d7ac;border-radius:9px;background:#fffaf0;color:#705720;font-size:12px;line-height:1.7}
#workflow-guidance[hidden]{display:none!important}#workflow-guidance>strong{font-size:13px}.workflow-guidance-list{padding-left:18px;margin:7px 0 0}.workflow-guidance-list li+li{margin-top:6px}
.workflow-guidance-link{font:inherit;text-align:left;color:inherit;background:none;border:0;padding:0;cursor:pointer;line-height:inherit;overflow-wrap:anywhere;text-decoration:underline;text-decoration-color:#c9b586;text-underline-offset:3px}.workflow-guidance-link:hover{color:#6744ba}.workflow-guidance-link:focus-visible{outline:2px solid #7a64d3;outline-offset:4px}.workflow-guidance-link:disabled{cursor:wait;opacity:.7}.workflow-guidance-arrow{white-space:nowrap}.workflow-focus{outline:3px solid #9880df!important;outline-offset:4px;scroll-margin:120px 0}
.run-clarifications{margin:16px 0;padding:17px;border:1px solid #e3d8ba;border-radius:8px;background:#fffaf0}.run-clarifications h3{margin:0 0 10px;font-size:15px}.run-clarifications label{display:block;font-size:13px;line-height:1.7;margin:15px 0 7px}.run-clarifications textarea{width:100%;padding:10px;box-sizing:border-box;resize:vertical}.run-clarifications .button-row{margin-top:12px;flex-wrap:wrap}.run-saved-counts{font-size:12px;color:#6b788c}

:root {
  --paper: #f5f5f7;
  --paper-2: #ffffff;
  --paper-3: #f0f0f2;
  --ink: #1d1d1f;
  --ink-2: #3a3a3c;
  --muted: #6e6e73;
  --subtle: #86868b;
  --rule: #e8e8ed;
  --rule-strong: #d2d2d7;
  --red: #0071e3;
  --red-dark: #0077ed;
  --red-soft: rgba(0, 113, 227, .075);
  --danger: #d70015;
  --green: #248a3d;
  --green-soft: #edf8f1;
  --amber: #9a5b00;
  --amber-soft: #fff8e8;
  --rail: #fbfbfd;
  --rail-2: #ffffff;
  --rail-3: #f0f0f2;
  --rail-text: #1d1d1f;
  --rail-muted: #86868b;
  --sidebar: 252px;
  --topbar: 64px;
  --content: 1240px;
  --radius: 12px;
}
body { letter-spacing: -.011em; }
::selection { background: rgba(0, 113, 227, .18); color: var(--ink); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible { outline-color: var(--red); }
#app-shell .sidebar {
  padding: 22px 16px 16px;
  border-right: 1px solid rgba(0, 0, 0, .06);
  background: rgba(251, 251, 253, .96);
  color: var(--rail-text);
}
#app-shell .brand { align-items: center; gap: 11px; padding: 0 4px; }
#app-shell .brand-mark, #auth-screen .poster-mark {
  width: 38px; height: 38px; border: 0; border-radius: 11px;
  background: #1d1d1f; color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 2px 8px rgba(0, 0, 0, .12);
}
#app-shell .brand-mark svg, #auth-screen .poster-mark svg { display: block; width: 21px; height: 21px; }
#app-shell .brand-mark::after, #auth-screen .poster-mark::after { content: none; }
#app-shell .brand-text { color: var(--ink); font-size: 17px; font-weight: 650; letter-spacing: -.02em; }
#app-shell .brand-text small { margin-top: 3px; color: var(--subtle); font: 9px/1.5 var(--sans); letter-spacing: .08em; }
#app-shell .project-picker { margin-top: 26px; }
#app-shell .project-picker label, #app-shell .nav-label, #app-shell .nav-group-name {
  color: var(--subtle); font: 10px/1.5 var(--sans); font-weight: 550; letter-spacing: .04em;
}
#app-shell .picker-row select {
  height: 42px; border: 1px solid var(--rule); border-radius: 11px;
  background-color: var(--paper-2); color: var(--ink-2); font-size: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .025);
}
#app-shell .picker-row .icon-button, #app-shell .icon-button {
  border: 1px solid var(--rule); border-radius: 11px; background: var(--paper-2); color: var(--muted);
}
#app-shell .picker-row .icon-button:hover, #app-shell .icon-button:hover {
  border-color: var(--rule-strong); background: var(--paper-3); color: var(--ink);
}
#app-shell .import-entry, #app-shell .import-entry.button {
  border-bottom-color: var(--rule-strong); color: var(--muted); font-size: 11px;
}
#app-shell .import-entry:hover, #app-shell .import-entry.button:hover { color: var(--red); border-bottom-color: var(--red); }
#app-shell .nav-label { margin-top: 24px; }
#app-shell .nav-group { padding-top: 12px; }
#app-shell .nav-group-name { margin-bottom: 5px; }
#app-shell .stage-link {
  min-height: 38px; padding: 7px 10px; gap: 9px; border: 0; border-radius: 11px;
  background: transparent; color: var(--ink-2); font-size: 12px;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}
#app-shell .stage-link:hover { background: rgba(0, 0, 0, .035); color: var(--ink); transform: translateX(1px); }
#app-shell .stage-number { width: 23px; color: #aeaeb2; font: 10px/1 var(--sans); font-weight: 600; }
#app-shell .stage-indicator { width: 5px; height: 5px; background: #c7c7cc; }
#app-shell .stage-indicator.confirmed { background: #30a46c; }
#app-shell .stage-link.active {
  background: var(--paper-2); color: var(--ink); font-weight: 650;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 5px 16px rgba(0, 0, 0, .04);
}
#app-shell .stage-link.active::before { display: none; }
#app-shell .stage-link.active .stage-number { color: var(--red); font-size: 10px; }
#app-shell .stage-link.active .stage-indicator { background: var(--red); }
#app-shell .account-panel, #app-shell .sidebar-foot { border-color: var(--rule); }
#app-shell #account-username, #app-shell .account-panel .text-button,
#app-shell .account-panel > p, #app-shell .sidebar-foot { color: var(--muted); }
#app-shell .account-panel .text-button:hover { color: var(--red); }
#app-shell .account-panel .review-delete-confirm {
  border: 1px solid #eedbb4; border-radius: 12px; background: var(--amber-soft); color: var(--ink-2);
}
#app-shell .account-panel .review-delete-confirm .button.secondary { border-color: var(--rule-strong); color: var(--ink-2); }
#app-shell .small-dot { background: #30a46c; }
.main .topbar {
  height: var(--topbar); padding: 0 32px;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
  background: rgba(245, 245, 247, .78);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
}
.main .breadcrumb, .main .save-status { color: var(--muted); font: 11px/1.5 var(--sans); letter-spacing: 0; }
.main .breadcrumb strong { color: var(--ink-2); font-weight: 500; }
.main .save-status::before { background: #30a46c; }
.main .save-status[data-state="saving"]::before { background: #ff9500; }
.main .save-status[data-state="error"], .main .save-status[data-state="conflict"] { color: var(--danger) !important; }
.main .workspace { padding: 32px 40px 140px; }
.main .page-heading { gap: 24px; padding-bottom: 20px; margin-bottom: 16px; border-bottom-color: var(--rule); }
.main .page-heading h1 {
  color: var(--ink); font-size: clamp(30px, 3vw, 38px); font-weight: 680;
  line-height: 1.16; letter-spacing: -.045em;
}
.main .eyebrow { margin-bottom: 8px; color: var(--subtle); font: 10px/1.5 var(--sans); font-weight: 600; letter-spacing: .1em; }
.main .page-description { margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.75; }
.main .status-badge {
  padding: 6px 11px; border: 0; border-radius: 980px;
  background: rgba(120, 120, 128, .1); color: var(--muted);
  font: 11px/1.2 var(--sans); letter-spacing: 0;
}
.main .status-badge.confirmed { background: var(--green-soft); color: var(--green); }
.main .status-badge.needs_review { background: var(--amber-soft); color: var(--amber); }
#app-shell .button {
  min-height: 40px; padding: 9px 17px; border-radius: 980px;
  font-size: 12px; font-weight: 500; line-height: 1.35;
  transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}
#app-shell .button:active:not(:disabled) { transform: scale(.975); }
#app-shell .button.primary, #app-shell #confirm-stage {
  border-color: var(--red); background: var(--red); color: #fff; font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 113, 227, .14);
}
#app-shell .button.primary:hover:not(:disabled), #app-shell #confirm-stage:hover:not(:disabled) {
  border-color: var(--red-dark); background: var(--red-dark); box-shadow: 0 4px 14px rgba(0, 113, 227, .2);
}
#app-shell .button.secondary { border-color: var(--rule-strong); background: var(--paper-2); color: var(--ink-2); }
#app-shell .button.secondary:hover:not(:disabled) { background: var(--paper-3); }
#app-shell .button.quiet { color: var(--muted); }
#app-shell .text-button { color: var(--muted); }
#app-shell .text-button:hover:not(:disabled) { color: var(--red); }
#app-shell input, #app-shell textarea, #app-shell select {
  border-color: var(--rule-strong); border-radius: 11px; background-color: var(--paper-2);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
#app-shell input:focus, #app-shell textarea:focus, #app-shell select:focus {
  border-color: var(--red); box-shadow: 0 0 0 4px rgba(0, 113, 227, .12);
}
#app-shell input::placeholder, #app-shell textarea::placeholder { color: #aeaeb2; }
#app-shell input[type="checkbox"], #app-shell input[type="radio"] { border-radius: 5px; }
#app-shell input[type="radio"] { border-radius: 50%; }
#app-shell input[type="checkbox"]:checked, #app-shell input[type="radio"]:checked {
  border-color: var(--red); background-color: var(--red);
}
#app-shell fieldset { border-color: var(--rule); border-radius: 14px; background: var(--paper); }
#app-shell .file-drop { border-color: var(--rule-strong); border-radius: 16px; background: #fafafc; }
#app-shell .file-drop:hover, #app-shell .file-drop.is-dragover { border-color: var(--red); background: var(--red-soft); }
#workspace :is(.project-identity, .product-scope-panel, .collection-entry,
.review-card, .analysis-record, .classification-card, .sequence-task-card,
.material-task-card, .direction-task-card, .production-task-card, .acceptance-result,
.source-card, .asset-card, .analysis-preview, .sequence-preview, .research-record,
.direction-item, .sequence-route, .production-replacement, .acceptance-effect,
.acceptance-upload, .direction-batch-panel, .materials-list, .preparation-rows) {
  border: 1px solid rgba(0, 0, 0, .055); border-radius: 16px; background: var(--paper-2);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .028);
}
#workspace .panel-heading h2, #workspace .panel > h2 { color: var(--ink); font-weight: 650; letter-spacing: -.02em; }
#workspace .panel-heading p, #workspace .panel-description, #workspace .collection-description,
#workspace .source-meta, #workspace .source-origin, #workspace .footer-hint,
#workspace .transfer-scope { color: var(--muted); }
#workspace .metric-grid { border-color: var(--rule); }
#workspace .metric, #workspace .progress-item { border-color: var(--rule); }
#workspace .metric-value { color: var(--ink); font-weight: 650; letter-spacing: -.035em; }
#workspace .progress-track { height: 4px; border-radius: 4px; background: var(--rule); }
#workspace .progress-fill { border-radius: 4px; background: var(--red); }
#workspace .collection-tabs { border-bottom-color: var(--rule); }
#workspace .collection-tab[aria-selected="true"] { border-bottom-color: var(--red); color: var(--red); }
#workspace .source-state { border: 0; border-radius: 980px; background: rgba(120, 120, 128, .1); color: var(--muted); }
#workspace .source-notice, #workspace .build-notice { border-radius: 10px; background: var(--paper); }
#workspace .asset-thumbnail, #workspace .material-asset-visual img,
#workspace .direction-bound-asset img { border-radius: 10px; background: var(--paper); }
#workspace .direction-focus-bar, #workspace .direction-directory {
  border: 1px solid rgba(0, 0, 0, .055); border-radius: 15px;
  background: rgba(255, 255, 255, .88); box-shadow: 0 5px 18px rgba(0, 0, 0, .035);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
}
#workspace .direction-task-link[aria-current="true"], #workspace .task-flow-directory-link[aria-current="true"] {
  border-color: transparent; background: var(--red-soft); color: var(--red);
}
#workspace .direction-preview, #workspace .direction-preview-option { border-radius: 12px; }
#workspace .task-overview-table { border-color: var(--rule); border-radius: 14px; color: var(--ink-2); }
#workspace .task-overview-table th { border-color: var(--rule); background: #fafafc; color: var(--muted); }
#workspace .task-overview-table td { border-color: var(--rule); }
#workspace .task-overview-row.active { background: var(--red-soft); }
#workspace .task-overview-row.active .task-overview-name { box-shadow: inset 3px 0 var(--red); }
#workspace .task-page-stats { border-color: var(--rule); border-radius: 14px; overflow: hidden; }
#workspace .task-page-stats > div + div { border-color: var(--rule); }
#workspace .task-page-actions .text-button, #workspace .task-overview-action .text-button { color: var(--red); }
#app-shell .step-footer {
  min-height: 68px; padding: 12px 40px;
  border-top: 1px solid rgba(0, 0, 0, .06);
  background: rgba(245, 245, 247, .82);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, .025);
}
#app-shell dialog {
  border: 1px solid rgba(0, 0, 0, .07); border-radius: 22px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .18);
}
#app-shell dialog::backdrop { background: rgba(0, 0, 0, .38); backdrop-filter: blur(6px); }
#app-shell .dialog-heading h2 { color: var(--ink); letter-spacing: -.03em; }
#auth-screen { grid-template-columns: minmax(0, 1fr) 500px; background: var(--paper); }
#auth-screen .auth-poster { padding: 46px 54px 36px; background: var(--paper); color: var(--ink); }
#auth-screen .auth-poster::after { display: none; }
#auth-screen .poster-meta, #auth-screen .poster-kicker, #auth-screen .poster-foot { color: var(--subtle); }
#auth-screen .poster-title { color: var(--ink); font-weight: 680; letter-spacing: -.055em; }
#auth-screen .poster-title em { color: var(--ink); }
#auth-screen .poster-manifesto { color: var(--muted); font-size: 19px; letter-spacing: -.015em; }
#auth-screen .poster-rule { background: var(--rule-strong); }
#auth-screen .poster-index { gap: 12px; }
#auth-screen .poster-index div {
  min-width: 0; padding: 12px 14px;
  border: 1px solid var(--rule); border-radius: 12px;
  background: rgba(255, 255, 255, .58);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .025);
}
#auth-screen .poster-index b { color: var(--subtle); font-size: 9px; font-weight: 600; }
#auth-screen .poster-index span { margin-top: 6px; color: var(--ink-2); font-size: 12px; line-height: 1.5; }
#auth-screen .poster-foot i { background: #30a46c; }
#auth-screen .auth-panel { padding: 48px 42px; }
#auth-screen .auth-card {
  width: 100%; max-width: 410px; padding: 34px;
  border: 1px solid rgba(0, 0, 0, .05); border-radius: 26px; background: rgba(255, 255, 255, .92);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .07);
}
#auth-screen .auth-meta { margin-bottom: 28px; color: var(--subtle); font-family: var(--sans); letter-spacing: .08em; }
#auth-screen .auth-card h1 { color: var(--ink); font-size: 30px; font-weight: 680; letter-spacing: -.04em; }
#auth-screen .auth-description { color: var(--muted); }
#auth-screen .feishu-qr-wrap { padding: 12px; border: 1px solid var(--rule); border-radius: 16px; background: #fff; }
#auth-screen .auth-foot { border-color: var(--rule); color: var(--subtle); }
#auth-screen .review-delete-confirm { border-radius: 12px; }
#app-shell .empty-state { max-width: 680px; }
#app-shell .empty-symbol { color: var(--red); }
#app-shell .empty-state h1 { color: var(--ink); font-weight: 680; letter-spacing: -.045em; }
#app-shell .empty-state p { color: var(--muted); }
#workflow-guidance, .run-clarifications { border: 0; border-radius: 14px; background: var(--amber-soft); }
.workflow-guidance-link:hover { color: var(--red); }
.workflow-guidance-link:focus-visible, .workflow-focus { outline-color: var(--red) !important; }

@media (max-width: 1180px) {
  :root { --sidebar: 232px; }
  .main .workspace { padding: 28px 28px 140px; }
  #auth-screen { grid-template-columns: minmax(0, 1fr) 460px; }
  #auth-screen .auth-poster { padding: 36px 38px 30px; }
  #auth-screen .auth-panel { padding: 36px 28px; }
}
@media (max-width: 820px) {
  :root { --sidebar: 0px; --topbar: 54px; }
  #app-shell .sidebar { padding: 14px 16px 12px; border-right: 0; border-bottom: 1px solid var(--rule); }
  #app-shell .brand-mark { width: 32px; height: 32px; border-radius: 9px; }
  #app-shell .brand-text { font-size: 16px; }
  #app-shell .stage-link:hover { transform: none; }
  .main .topbar { height: 54px; padding: 0 20px; }
  .main .workspace { padding: 26px 20px 150px; }
  .main .page-heading { gap: 14px; padding-bottom: 18px; }
  .main .page-heading h1 { font-size: 29px; }
  .main .page-description { font-size: 12px; }
  #app-shell .button { min-height: 42px; }
  #app-shell .step-footer { padding: 10px 16px; }
  #auth-screen { display: block; }
  #auth-screen .auth-poster { min-height: 0; padding: 30px 24px 22px; }
  #auth-screen .poster-main { margin-top: 0; padding-top: 34px; }
  #auth-screen .poster-title { font-size: 48px; }
  #auth-screen .poster-manifesto { margin-top: 18px; font-size: 15px; }
  #auth-screen .poster-foot { margin-top: 22px; }
  #auth-screen .auth-panel { padding: 24px 20px 40px; }
  #auth-screen .auth-card { max-width: 440px; padding: 28px 24px; border-radius: 22px; }
  #auth-screen .auth-meta { margin-bottom: 24px; }
  #auth-screen .auth-card h1 { font-size: 27px; }
}
@media (max-width: 560px) {
  .main .workspace { padding: 24px 16px 150px; }
  .main .page-heading h1 { font-size: 27px; }
  #workspace :is(.project-identity, .product-scope-panel, .collection-entry,
  .review-card, .analysis-record, .classification-card, .sequence-task-card,
  .material-task-card, .direction-task-card, .production-task-card, .acceptance-result,
  .source-card, .asset-card, .analysis-preview, .sequence-preview, .research-record,
  .direction-item, .sequence-route, .production-replacement, .acceptance-effect) { border-radius: 14px; }
  #auth-screen .auth-poster { padding: 26px 20px 18px; }
  #auth-screen .poster-title { font-size: 42px; }
  #auth-screen .poster-kicker { margin-bottom: 14px; }
  #auth-screen .auth-panel { padding: 20px 16px 32px; }
  #auth-screen .auth-card { padding: 25px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  #app-shell .button, #app-shell .stage-link { transition: none; }
}
body #workspace :is(.delivery-view, .buyer-side-link, .fact-evidence details > summary,
.category-node-detail > summary, .category-input-adjustments > summary,
.category-picture-adjustments > summary, .fact-row-action .text-button,
.fab-card-actions .text-button, .fab-guide .text-button) { color: var(--red); }
body #workspace :is(.run-status-icon, .category-stats strong) { color: var(--red); }
body #workspace[data-stage="ai_analysis"] .run-actions .button.primary { border-color: var(--red); background: var(--red); }
body #workspace[data-stage="ai_analysis"] .run-timeline [data-state="running"] .run-step-number { border-color: var(--red); background: var(--red-soft); color: var(--red); }
body #workspace[data-stage="ai_analysis"] .run-timeline [data-state="running"] .run-step-state { color: var(--red); }
body #workspace .run-progress [data-state="running"] { border-color: rgba(0, 113, 227, .18); background: var(--red-soft); color: var(--red); }
body #workspace .run-result-preview { border-color: var(--rule); background: var(--paper); }
body #workspace .facts-filters .active { border-color: rgba(0, 113, 227, .18); background: var(--red-soft); color: var(--red); }
body #workspace .fact-row.active { background: var(--red-soft); }
body #workspace .fact-row.active .fact-row-copy { box-shadow: inset 3px 0 var(--red); }
body #workspace .fact-state-button:focus-visible, body #workspace .fact-stat:focus-visible,
body #workspace .fact-row-action .text-button:focus-visible { outline-color: var(--red); }
body #workspace .core-selected { background: var(--red-soft); color: var(--red); }
body #workspace .fab-state.graded, body #workspace .buyer-priority.first { background: var(--red-soft); color: var(--red); }
body #workspace .category-scope-card .category-card-media,
body #workspace .category-scope-card .category-basis { background: var(--red-soft); color: var(--red); }
body #workspace .run-source-row input { accent-color: var(--red); }
body #workspace .delivery-active-row { background: var(--red-soft); }

/* Preserve validation and save-state signals in the Apple workspace. */
.main .save-status[data-state="error"]::before,
.main .save-status[data-state="conflict"]::before { background: var(--danger); }
#app-shell :is(input, textarea, select)[aria-invalid="true"] { border-color: var(--danger); background-color: #fff7f8; }
#app-shell :is(input, textarea, select)[aria-invalid="true"]:focus { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(215, 0, 21, .12); }

.handoff-zip-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  flex-shrink: 0; white-space: nowrap;
  min-height: 42px; padding: 10px 18px;
  border: 1px solid #0066cc; border-radius: 980px;
  background: linear-gradient(180deg, #0a84ff 0%, #0071e3 100%); color: #fff;
  box-shadow: 0 3px 12px rgba(0, 113, 227, .22), inset 0 1px 0 rgba(255, 255, 255, .2);
  font-size: 13px; font-weight: 600; line-height: 1.35;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.handoff-zip-btn:hover:not(:disabled) { background: linear-gradient(180deg, #0077ed 0%, #0066cc 100%); box-shadow: 0 5px 18px rgba(0, 113, 227, .28); transform: translateY(-1px); }
.handoff-zip-btn:active:not(:disabled) { transform: scale(.98); }
.aplus-skip-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 16px 0; padding: 14px 16px;
  border: 1px solid var(--rule); border-radius: 14px;
  background: rgba(255, 255, 255, .72); color: var(--ink-2);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .025);
  font-size: 13px; line-height: 1.65;
}
.aplus-skip-bar > :is(p, h2, h3) { margin: 0; }
.mcp-source-badge, .needs-shoot-badge {
  display: inline-flex; align-items: center; gap: 5px;
  max-width: 100%; min-height: 24px; padding: 3px 9px;
  border: 1px solid rgba(0, 113, 227, .12); border-radius: 980px;
  background: var(--red-soft); color: #0066cc;
  font-size: 11px; font-weight: 550; line-height: 1.45; letter-spacing: 0;
  white-space: nowrap;
}
.needs-shoot-badge { border-color: rgba(154, 91, 0, .14); background: var(--amber-soft); color: var(--amber); }
.xlsx-upload-hint {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 12px 0; padding: 12px 14px;
  border: 1px solid rgba(0, 113, 227, .12); border-radius: 12px;
  background: rgba(0, 113, 227, .045); color: var(--ink-2);
  font-size: 12px; line-height: 1.7; overflow-wrap: anywhere;
}
.xlsx-upload-hint::before {
  content: "XLSX"; flex: none; margin-top: 1px; padding: 2px 6px;
  border-radius: 5px; background: rgba(0, 113, 227, .1); color: #0066cc;
  font: 600 9px/1.5 var(--sans); letter-spacing: .04em;
}
#auth-screen #feishu-login-direct, #auth-screen #feishu-login-qr { display: none; }
#auth-screen .no-break { white-space: nowrap; }
#auth-screen .feishu-intro p { text-wrap: pretty; }

@media (max-width: 768px) {
  #auth-screen .auth-poster { min-height: 0; padding: 20px 20px 16px; }
  #auth-screen .poster-main { margin-top: 0; padding-top: 18px; }
  #auth-screen .poster-title, #auth-screen .poster-rule, #auth-screen .poster-index { display: none; }
  #auth-screen .poster-kicker { margin-bottom: 10px; }
  #auth-screen .poster-manifesto { margin-top: 12px; font-size: 14px; line-height: 1.6; }
  #auth-screen .poster-foot { margin-top: 14px; }
  #auth-screen .auth-panel { padding: 16px 16px max(24px, env(safe-area-inset-bottom)); }
  #auth-screen .auth-card { padding: 22px 20px; border-radius: 20px; }
  #auth-screen .auth-meta { margin-bottom: 16px; }
  #auth-screen .auth-card h1 { font-size: 26px; }
  #auth-screen .auth-description { margin-top: 8px; font-size: 13px; line-height: 1.6; text-wrap: pretty; }
  #auth-screen .auth-feishu { margin-top: 20px; }
  #auth-screen .auth-feishu .button { min-height: 46px; margin-top: 10px; }
  #auth-screen #feishu-login[data-login-view="direct"] #feishu-login-direct,
  #auth-screen #feishu-login[data-login-view="direct"] #feishu-login-qr { display: block; }
  #auth-screen #feishu-login[data-login-view="direct"] :is(.feishu-intro, .feishu-qr-wrap, #feishu-login-start),
  #auth-screen #feishu-login[data-login-view="scan"] :is(#feishu-login-direct, #feishu-login-qr) { display: none; }
  #auth-screen #feishu-login[data-login-view="scan"] .feishu-qr { width: 180px; height: 180px; }
  #auth-screen #feishu-login-message { text-wrap: pretty; }
  #auth-screen .auth-foot { margin-top: 22px; padding-top: 12px; }
  .aplus-skip-bar { align-items: stretch; flex-direction: column; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .handoff-zip-btn { transition: none; }
}
