:root {
  --bg: #f3f6f5;
  --panel: #ffffff;
  --text: #142425;
  --muted: #728083;
  --line: #dfe7e6;
  --green: #116b63;
  --green-2: #1c8b7d;
  --green-soft: #e3f2ef;
  --amber: #d77a27;
  --red: #c84b46;
  --blue: #3b71df;
  --shadow: 0 14px 42px rgba(31, 58, 58, .08);
  --font: "Microsoft YaHei UI", "PingFang SC", "Segoe UI", sans-serif;
}

/* Real attachments, project editing and To-Do diagnostics. */
.project-edit-button {
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid #c9ddd9;
  border-radius: 6px;
  color: #116b63;
  background: #f4fbf9;
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
}
.project-edit-button:hover { border-color: #79afa7; background: #eaf7f4; }
.selected-project-edit { min-height: 36px; padding: 7px 12px; }

.attachment-download-link {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  padding: 5px 10px;
  border: 1px solid #b7d9d3;
  border-radius: 7px;
  color: #116b63;
  background: #f2faf8;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.participant-attachment-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 18px 0 12px;
  padding: 16px;
  border: 1px solid #c6ded9;
  border-radius: 12px;
  background: #f6fbfa;
}
.participant-attachment-card.is-missing { border-color: #eadbbd; background: #fffaf0; }
.participant-attachment-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 12px;
  background: #167d73;
}
.participant-attachment-icon .ui-icon { width: 22px; height: 22px; }
.participant-attachment-card > div:nth-child(2) { display: grid; gap: 4px; min-width: 0; }
.participant-attachment-card span,
.participant-attachment-card small { color: #6f7d93; font-size: 12px; }
.participant-attachment-card strong { overflow-wrap: anywhere; font-size: 16px; }
.participant-download-action {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border-radius: 9px;
  color: #fff;
  background: #167d73;
  font-weight: 850;
  text-decoration: none;
}

.todo-anomaly-center {
  margin: 0 0 16px;
  border: 1px solid #dbe5e8;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 7px 24px rgba(24, 54, 65, .05);
}
.todo-anomaly-center summary {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  cursor: pointer;
  list-style: none;
}
.todo-anomaly-center summary::-webkit-details-marker { display: none; }
.todo-anomaly-center summary span { display: grid; gap: 4px; }
.todo-anomaly-center summary small { color: #75839a; font-weight: 500; }
.anomaly-count {
  display: grid;
  min-width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 15px;
  color: #167d73;
  background: #eaf7f4;
}
.anomaly-count.has-error { color: #a33b30; background: #fff0ed; }
.anomaly-list { display: grid; gap: 0; border-top: 1px solid #edf1f2; }
.anomaly-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid #edf1f2;
}
.anomaly-row:last-child { border-bottom: 0; }
.anomaly-row > div:first-child { display: grid; gap: 3px; min-width: 0; }
.anomaly-row span { color: #a33b30; font-size: 11px; font-weight: 800; }
.anomaly-row small { color: #75839a; overflow-wrap: anywhere; }
.anomaly-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.anomaly-empty { padding: 18px 16px; color: #71809c; }

.confirm-todo-dialog { width: min(520px, calc(100vw - 32px)); }
.confirm-todo-summary {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 9px 14px;
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 10px;
  background: #f4f8f8;
}
.confirm-todo-summary span { color: #71809c; }
.confirm-todo-summary strong { overflow-wrap: anywhere; }
.danger-confirm { background: #167d73; }

@media (max-width: 720px) {
  .project-edit-button { min-height: 36px; padding: 7px 10px; }
  .participant-attachment-card { grid-template-columns: 42px minmax(0, 1fr); }
  .participant-attachment-icon { width: 42px; height: 42px; }
  .participant-download-action,
  .participant-attachment-card > .participant-read-state { grid-column: 1 / -1; width: 100%; }
  .anomaly-row { align-items: stretch; flex-direction: column; }
  .anomaly-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .todo-confirm-actions { grid-template-columns: 1fr; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-width: 1280px; background: var(--bg); }
body { margin: 0; color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.5; background: radial-gradient(circle at 10% -10%, #deefec 0, transparent 31rem), var(--bg); }
button, input, select { font-family: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .68; }

.app-shell { min-height: 100vh; padding: 22px 28px 80px; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; max-width: 1680px; margin: 0 auto 18px; padding: 13px 17px; border: 1px solid rgba(255,255,255,.9); border-radius: 18px; background: rgba(250,252,251,.86); box-shadow: 0 8px 30px rgba(39,65,64,.06); backdrop-filter: blur(14px); }
.brand, .top-actions, .sync, .modal-head, .modal-actions, .item-meta, .item-foot, .stage-head, .status-strip { display: flex; align-items: center; }
.brand { gap: 12px; }
.brand-icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 12px; color: #fff; background: var(--green); font-size: 24px; box-shadow: 0 7px 18px rgba(17,107,99,.22); }
.brand span { display: block; margin-bottom: 2px; color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.brand h1 { margin: 0; font-size: 19px; }
.top-actions { gap: 11px; }
.local-label { padding: 6px 10px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 11px; font-weight: 800; }
.sync { gap: 7px; color: var(--muted); font-size: 11px; }
.sync i { width: 7px; height: 7px; border-radius: 50%; background: #21a36e; box-shadow: 0 0 0 4px rgba(33,163,110,.11); }
.primary, .secondary, .close { border: 0; border-radius: 11px; font-weight: 750; }
.primary { padding: 10px 15px; color: #fff; background: var(--green); box-shadow: 0 7px 18px rgba(17,107,99,.18); }
.secondary { padding: 10px 15px; color: var(--text); background: #edf1f0; }
.close { width: 34px; height: 34px; color: var(--muted); background: #eef2f1; font-size: 21px; }
.app-shell.is-auth-pending { visibility: hidden; }
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 10%, rgba(28,139,125,.2), transparent 34rem),
    radial-gradient(circle at 88% 88%, rgba(59,113,223,.12), transparent 30rem),
    #f2f6f5;
}
.auth-gate[hidden] { display: none; }
.auth-card {
  width: min(460px, calc(100vw - 40px));
  padding: 42px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 24px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 24px 70px rgba(31,58,58,.14);
  text-align: center;
  backdrop-filter: blur(16px);
}
.auth-logo { display: grid; width: 58px; height: 58px; margin: 0 auto 20px; place-items: center; border-radius: 18px; background: var(--green); box-shadow: 0 12px 28px rgba(17,107,99,.24); }
.auth-logo .ui-icon { width: 29px; height: 29px; }
.auth-card .mini-label { margin-bottom: 8px; }
.auth-card h1 { margin: 0; font-size: 25px; }
.auth-card p { margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.auth-card small { display: block; margin-top: 20px; color: #889496; }
.auth-progress { display: flex; justify-content: center; gap: 8px; margin: 25px 0 6px; }
.auth-progress i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: authPulse 1.1s infinite ease-in-out; }
.auth-progress i:nth-child(2) { animation-delay: .16s; }
.auth-progress i:nth-child(3) { animation-delay: .32s; }
.auth-retry { margin-top: 24px; }
.user-chip { padding: 7px 11px; border: 1px solid #d9e5e3; border-radius: 999px; color: #3d5553; background: #fff; font-size: 11px; font-weight: 750; }
.admin-link { display: inline-flex; align-items: center; text-decoration: none; }
.role-preview-control { display: inline-flex; align-items: center; gap: 7px; padding: 5px 6px 5px 10px; border: 1px solid #d6e2e0; border-radius: 11px; color: #536563; background: #fff; font-size: 11px; font-weight: 800; }
.role-preview-control select { min-height: 30px; padding: 4px 26px 4px 8px; border: 0; border-radius: 7px; color: var(--green); background: var(--green-soft); font-size: 12px; font-weight: 850; outline: none; }
@keyframes authPulse { 0%, 80%, 100% { opacity: .35; transform: scale(.8); } 40% { opacity: 1; transform: scale(1.15); } }
.dashboard { max-width: 1680px; margin: 0 auto; }
.loading { display: grid; min-height: 65vh; place-items: center; color: var(--muted); }

.status-strip { gap: 10px; margin-bottom: 14px; }
.overview-label { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.status-chip { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.78); color: var(--muted); font-size: 11px; }
.status-chip strong { color: var(--text); font-size: 16px; }
.status-chip.overdue strong { color: var(--red); }

.flow-panel, .items-panel, .timeline-panel, .column-stage { border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); }
.flow-panel { padding: 24px; border-radius: 21px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.mini-label { display: block; margin-bottom: 4px; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.panel-heading h2 { margin: 0; font-size: 21px; }
.panel-heading p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.terminal-note { padding: 7px 10px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 10px; font-weight: 800; white-space: nowrap; }

.process-rail { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 13px; }
.process-rail::before { position: absolute; top: 25px; right: 7%; left: 7%; height: 3px; border-radius: 999px; background: #dbe7e5; content: ""; }
.process-step { position: relative; z-index: 1; text-align: center; }
.step-circle { display: grid; width: 52px; height: 52px; margin: 0 auto 11px; place-items: center; border: 5px solid #fff; border-radius: 50%; color: var(--green); background: var(--green-soft); box-shadow: 0 0 0 1px #d4e3e0; font-size: 16px; font-weight: 850; }
.process-step.completed .step-circle { color: #fff; background: var(--green); box-shadow: 0 8px 20px rgba(17,107,99,.18); }
.process-step.current .step-circle { color: #fff; background: var(--blue); box-shadow: 0 0 0 7px rgba(59,113,223,.11), 0 9px 22px rgba(59,113,223,.22); }
.process-step.future .step-circle { color: #8ba09d; background: #edf4f2; }
.process-step.completed strong { color: var(--green); }
.process-step.current strong { color: var(--blue); }
.process-step.current small { color: var(--blue); font-weight: 800; }
.process-step strong { display: block; min-height: 34px; font-size: 11px; line-height: 1.45; }
.process-step small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.4; }

.selected-summary { display: grid; justify-items: end; gap: 7px; }
.current-stage-label { padding: 7px 10px; border-radius: 999px; color: #fff; background: var(--blue); font-size: 10px; font-weight: 800; }
.stage-editor { width: 320px; padding: 10px; border: 1px solid #cfdbf4; border-radius: 12px; background: #f6f9ff; text-align: left; }
.stage-editor label { display: block; margin-bottom: 7px; color: #315aa9; font-size: 9px; font-weight: 850; letter-spacing: .05em; }
.stage-editor-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
.stage-editor-select { min-width: 0; padding: 8px 25px 8px 9px; border: 1px solid #bdcdef; border-radius: 9px; color: var(--text); background: #fff; font-size: 10px; outline: none; }
.stage-save { padding: 8px 11px; border: 0; border-radius: 9px; color: #fff; background: var(--blue); font-size: 10px; font-weight: 800; box-shadow: 0 5px 13px rgba(59,113,223,.2); }
.stage-save:disabled { cursor: wait; opacity: .55; }
.stage-editor small { display: block; margin-top: 6px; color: #7181a2; font-size: 8px; line-height: 1.4; }
.stage-editor.compact { width: 100%; margin-top: 13px; }
.project-detail-grid { display: grid; grid-template-columns: minmax(300px,.72fr) minmax(440px,1.28fr); gap: 14px; margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line); }
.project-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.project-facts div { padding: 11px; border-radius: 11px; background: #f5f8f7; }
.project-facts span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; }
.project-facts strong { display: block; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.project-facts .danger { color: var(--red); }
.project-facts .pending-send { color: var(--amber); }
.collaboration-panel { min-width: 0; padding: 14px; border: 1px solid #cfdcf2; border-radius: 14px; background: linear-gradient(145deg,#f9fbff,#f5f8fd); }
.collaboration-panel.compact { margin-top: 15px; }
.collaboration-panel.compact .dispatch-setup,
.collaboration-panel.compact .dispatch-summary,
.collaboration-panel.compact .participant-grid { grid-template-columns: 1fr; }
.collaboration-panel.compact .approval-gate { align-items: stretch; flex-direction: column; }
.collaboration-panel.compact .gate-actions { display: grid; }
.collaboration-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 11px; }
.collaboration-head h3 { margin: 0; font-size: 13px; }
.collaboration-head p { margin: 4px 0 0; color: var(--muted); font-size: 8px; }
.gate-badge { padding: 6px 9px; border-radius: 999px; color: #8a5b12; background: #fff0d4; font-size: 9px; font-weight: 850; white-space: nowrap; }
.gate-badge.confirming { color: #315aa9; background: #e7efff; }
.gate-badge.review { color: #7658bb; background: #eee9fb; }
.gate-badge.ready { color: #087353; background: #daf3e8; }
.gate-badge.terminal { color: #fff; background: #324b4b; }
.dispatch-setup { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; padding: 11px; border: 1px dashed #c9d6ee; border-radius: 11px; background: #fff; }
.dispatch-field { display: grid; gap: 6px; }
.dispatch-field > label, .dispatch-recipients > span { color: #71809c; font-size: 8px; font-weight: 800; }
.dispatch-field select { width: 100%; min-height: 34px; padding: 7px 9px; border: 1px solid #d5def0; border-radius: 8px; color: var(--text); background: #fff; font-size: 9px; }
.file-line { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 8px; min-height: 34px; }
.file-button { position: relative; padding: 8px 10px; border-radius: 8px; color: #fff; background: var(--blue); font-size: 9px; font-weight: 800; cursor: pointer; }
.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.file-button:focus-within { outline: 3px solid rgba(38, 105, 191, .24); outline-offset: 2px; }
.file-line > span { overflow: hidden; color: #53626f; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.dispatch-recipients { display: grid; gap: 5px; padding: 8px 10px; border-radius: 9px; background: #f3f6fb; }
.dispatch-recipients strong { font-size: 9px; }
.dispatch-button { min-height: 34px; border: 0; border-radius: 9px; color: #fff; background: var(--green); font-size: 9px; font-weight: 850; }
.prototype-warning { grid-column: 1 / -1; color: #9b7a49; font-size: 8px; }
.dispatch-summary { display: grid; grid-template-columns: 1fr 1.2fr 1.25fr .8fr; gap: 8px; padding: 9px; border-radius: 10px; background: #fff; }
.dispatch-summary div { min-width: 0; }
.dispatch-summary span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 8px; }
.dispatch-summary strong { display: block; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.participant-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 9px; }
.participant-card { padding: 10px; border: 1px solid #dfe5ee; border-radius: 11px; background: #fff; }
.participant-card.confirmed { border-color: #b8dfd1; background: #f5fcf9; }
.participant-main { display: grid; grid-template-columns: 31px 1fr auto; align-items: center; gap: 8px; }
.role-avatar { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 9px; color: #fff; background: var(--blue); font-size: 10px; font-weight: 900; }
.participant-card.confirmed .role-avatar { background: var(--green); }
.participant-main strong { display: block; font-size: 9px; }
.participant-main small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.participant-status { padding: 4px 6px; border-radius: 999px; color: #9b6a1d; background: #fff0d4; font-size: 8px; font-weight: 850; }
.participant-status.confirmed { color: var(--green); background: var(--green-soft); }
.participant-meta { display: flex; align-items: center; justify-content: space-between; gap: 7px; min-height: 28px; margin-top: 8px; padding-top: 7px; border-top: 1px solid #edf0f4; }
.participant-meta > span { color: var(--muted); font-size: 8px; }
.participant-actions { display: flex; gap: 5px; }
.participant-actions button { padding: 5px 7px; border-radius: 7px; font-size: 8px; font-weight: 800; }
.urge-button { border: 1px solid #e0b46e; color: #9c6510; background: #fff8ec; }
.simulate-button { border: 0; color: #fff; background: var(--blue); }
.approval-gate { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 9px; padding: 10px; border-radius: 11px; background: #eaf0fa; }
.gate-copy { display: grid; gap: 4px; }
.gate-copy strong { font-size: 10px; }
.gate-copy span { color: #687995; font-size: 8px; }
.gate-actions { display: flex; gap: 6px; }
.gate-actions button { min-height: 32px; padding: 7px 9px; border: 0; border-radius: 8px; font-size: 8px; font-weight: 850; }
.admin-approve { color: #fff; background: #7658bb; }
.advance-button { color: #fff; background: var(--green); }
.gate-actions button:disabled, .dispatch-button:disabled, .participant-actions button:disabled { color: #96a1ad; background: #dce2e8; cursor: not-allowed; opacity: .8; }
.terminal-message { padding: 17px; border-radius: 11px; color: #4f6061; background: #eef4f2; font-size: 10px; text-align: center; }
.audit-details { margin-top: 11px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfc; }
.audit-details summary { display: flex; align-items: center; gap: 7px; padding: 10px 12px; color: #607074; font-size: 9px; font-weight: 800; cursor: pointer; }
.audit-details summary b { display: grid; min-width: 20px; height: 20px; place-items: center; border-radius: 7px; color: var(--green); background: var(--green-soft); font-size: 8px; }
.audit-details .activity-panel { margin: 0 10px 10px; border: 0; background: #f5f8f7; }
.activity-panel { padding: 13px; border: 1px solid #dfe7e6; border-radius: 13px; background: #fbfcfc; }
.activity-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.activity-head h3 { margin: 0; font-size: 12px; }
.live-badge { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 9px; font-weight: 800; }
.live-badge i { width: 7px; height: 7px; border-radius: 50%; background: #1fa26d; box-shadow: 0 0 0 4px rgba(31,162,109,.1); }
.event-list { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.event-row { display: grid; grid-template-columns: 27px 1fr; align-items: center; gap: 8px; min-width: 0; padding: 8px; border-radius: 9px; background: #f0f5f4; }
.event-icon { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 8px; color: #fff; background: var(--green); font-size: 12px; font-weight: 900; }
.event-icon.stage { background: var(--blue); }
.event-icon.override { background: #44546f; }
.event-icon.attachment { background: var(--amber); }
.event-icon.recipient { background: #7658bb; }
.event-icon.dispatch { background: #1c8b7d; }
.event-icon.confirm { background: #21a36e; }
.event-icon.urge { background: #c56d20; }
.event-icon.admin { background: #7658bb; }
.event-icon.advance { background: var(--blue); }
.event-row strong { display: block; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.event-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.activity-panel.compact { margin-top: 16px; }
.activity-panel.compact .event-list { grid-template-columns: 1fr; }

.items-panel { margin-top: 15px; padding: 20px; border-radius: 19px; }
.items-grid { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 11px; }
.item-card { padding: 15px; border: 1px solid #e0e8e7; border-radius: 14px; background: #fbfcfc; cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.item-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(31,58,58,.08); }
.item-card.selected { border: 2px solid var(--blue); box-shadow: 0 0 0 4px rgba(59,113,223,.08); }
.item-card.done { opacity: .72; background: #f2f5f4; }
.item-card.overdue { border-color: #efc4c1; background: #fffafa; }
.item-meta { justify-content: space-between; gap: 8px; }
.stage-pill { padding: 5px 8px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 9px; font-weight: 800; }
.stage-pill.done { color: #fff; background: #324b4b; }
.due { color: var(--muted); font-size: 9px; }
.due.overdue { color: var(--red); font-weight: 800; }
.item-card h3 { min-height: 41px; margin: 12px 0 9px; font-size: 13px; line-height: 1.55; }
.attachment-row { display: grid; gap: 4px; min-height: 37px; color: var(--muted); font-size: 9px; }
.attachment-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-foot { justify-content: space-between; gap: 8px; margin-top: 11px; padding-top: 10px; border-top: 1px solid #e7eceb; }
.card-sync-note, .readonly-state { color: #879597; font-size: 8px; font-weight: 700; }
.send-state { color: var(--amber); font-size: 9px; font-weight: 750; }
.send-state.none { color: #98a3a5; }
.card-open-hint { color: var(--blue); font-size: 9px; font-weight: 800; }

/* Variant B: a vertical approval path with the item queue beside it. */
.variant-b-layout { display: grid; grid-template-columns: 380px 1fr; gap: 15px; }
.timeline-panel { padding: 22px; border-radius: 19px; }
.vertical-flow { display: grid; margin-top: 18px; }
.vertical-step { position: relative; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 11px; min-height: 71px; }
.vertical-step:not(:last-child)::after { position: absolute; top: 49px; bottom: -9px; left: 18px; width: 2px; background: #dbe5e3; content: ""; }
.vertical-step .number { display: grid; z-index: 1; width: 38px; height: 38px; place-items: center; border-radius: 12px; color: var(--green); background: var(--green-soft); font-size: 11px; font-weight: 850; }
.vertical-step.completed .number { color: #fff; background: var(--green); }
.vertical-step.current .number { color: #fff; background: var(--blue); box-shadow: 0 0 0 5px rgba(59,113,223,.09); }
.vertical-step.future .number { color: #91a09f; background: #eef3f2; }
.vertical-step strong { display: block; font-size: 11px; }
.vertical-step small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.vertical-step b { display: grid; min-width: 27px; height: 27px; place-items: center; border-radius: 8px; color: var(--green); background: #edf5f3; font-size: 10px; }
.queue-list { display: grid; gap: 9px; }
.queue-row { display: grid; grid-template-columns: 1fr 160px; align-items: center; gap: 18px; padding: 14px; border: 1px solid #e1e8e7; border-radius: 13px; background: #fbfcfc; }
.queue-row { cursor: pointer; }
.queue-row.selected { border: 2px solid var(--blue); background: #f6f9ff; }
.selected-title { margin: 4px 0 0; font-size: 16px; line-height: 1.45; }
.queue-row h3 { margin: 0 0 7px; font-size: 13px; }
.queue-row p { margin: 0; color: var(--muted); font-size: 9px; }
.queue-controls { display: grid; justify-items: end; gap: 7px; }

/* Variant C: a compact stage wall, useful when the team mainly scans bottlenecks. */
.wall-grid { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 9px; overflow-x: auto; }
.column-stage { min-height: 510px; padding: 12px; border-radius: 15px; box-shadow: 0 8px 28px rgba(35,60,60,.05); }
.stage-head { justify-content: space-between; gap: 8px; min-height: 41px; padding-bottom: 9px; border-bottom: 2px solid var(--green-soft); }
.stage-head strong { font-size: 10px; line-height: 1.35; }
.stage-head b { display: grid; min-width: 25px; height: 25px; place-items: center; border-radius: 8px; color: var(--green); background: var(--green-soft); font-size: 10px; }
.wall-items { display: grid; gap: 8px; margin-top: 10px; }
.wall-card { padding: 11px; border: 1px solid #e0e8e6; border-radius: 11px; background: #fbfcfc; }
.wall-card { cursor: pointer; }
.wall-card.selected { border: 2px solid var(--blue); background: #f6f9ff; box-shadow: 0 0 0 3px rgba(59,113,223,.07); }
.wall-card.overdue { border-color: #efc4c1; }
.wall-card h3 { margin: 0 0 8px; font-size: 10px; line-height: 1.5; }
.wall-card span { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; }
.selected-project-banner { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 14px; padding: 17px 20px; border-radius: 17px; color: #fff; background: linear-gradient(110deg,#174b4a,#116b63); box-shadow: var(--shadow); }
.selected-project-banner h2 { margin: 0; font-size: 18px; }
.selected-project-banner > div:last-child { display: grid; justify-items: end; gap: 4px; }
.selected-project-banner > div:last-child strong { font-size: 12px; }
.selected-project-banner > div:last-child span { color: rgba(255,255,255,.68); font-size: 9px; }
.selected-banner-side { min-width: 370px; }
.selected-banner-status { display: grid; justify-items: end; gap: 4px; }
.selected-project-banner .stage-editor { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); }
.selected-project-banner .stage-editor label, .selected-project-banner .stage-editor small { color: rgba(255,255,255,.78); }

footer { display: flex; justify-content: space-between; max-width: 1680px; margin: 14px auto 0; padding: 0 4px; color: #899698; font-size: 9px; }
.variant-switcher { position: static; z-index: 1; display: grid; grid-template-columns: 40px auto 40px; align-items: center; width: max-content; min-width: 250px; margin: 14px auto 18px; padding: 7px; border-radius: 17px; color: #fff; background: rgba(21,39,41,.93); box-shadow: 0 10px 28px rgba(15,32,34,.18); backdrop-filter: blur(12px); }
.variant-switcher button { width: 34px; height: 34px; border: 0; border-radius: 11px; color: #fff; background: rgba(255,255,255,.08); font-size: 17px; }
.variant-switcher div { text-align: center; }
.variant-switcher span { display: block; color: rgba(255,255,255,.55); font-size: 8px; }
.variant-switcher strong { display: block; margin-top: 2px; font-size: 11px; }

.modal { width: min(510px, calc(100vw - 40px)); padding: 22px; border: 0; border-radius: 20px; background: #fff; box-shadow: 0 30px 90px rgba(14,34,36,.28); }
.modal::backdrop { background: rgba(13,30,32,.42); backdrop-filter: blur(4px); }
.modal-head { justify-content: space-between; margin-bottom: 20px; }
.modal-head h2 { margin: 0; font-size: 21px; }
.field { display: grid; gap: 7px; margin-top: 13px; color: #4f5e60; font-size: 11px; font-weight: 700; }
.field span { display: flex; align-items: center; justify-content: space-between; }
.field span b { padding: 3px 6px; border-radius: 6px; color: var(--green); background: var(--green-soft); font-size: 8px; }
.field input, .field select { width: 100%; padding: 11px; border: 1px solid #d7e1df; border-radius: 10px; color: var(--text); background: #fbfcfc; outline: none; }
.attachment-source-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.attachment-source-actions .file-button,
.attachment-source-actions .dingdrive-picker-button,
.attachment-source-actions .dingtalk-document-picker-button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; margin: 0; text-align: center; }
.dingtalk-document-picker-button { grid-column: 1 / -1; color: var(--green); border-color: #9fc9c3; background: #f4fbfa; }
.dingdrive-picker-button:disabled,
.dingtalk-document-picker-button:disabled { cursor: not-allowed; opacity: .55; }
.required-field input { padding: 13px; border-color: #95beb8; font-size: 14px; }
.field small { color: #929d9f; font-size: 9px; font-weight: 500; line-height: 1.45; }
.optional-title { display: flex; align-items: center; gap: 9px; margin: 20px 0 2px; color: #98a3a5; font-size: 9px; }
.optional-title::before, .optional-title::after { height: 1px; flex: 1; background: #e4e9e8; content: ""; }
.form-message { min-height: 17px; margin: 10px 0 0; color: var(--red); font-size: 10px; }
.modal-actions { justify-content: flex-end; gap: 9px; margin-top: 10px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 80; max-width: 360px; padding: 12px 15px; border-radius: 11px; color: #fff; background: #193234; box-shadow: 0 14px 36px rgba(13,28,30,.25); font-size: 11px; opacity: 0; pointer-events: none; transform: translateY(10px); transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.empty { padding: 30px 10px; color: #98a3a5; text-align: center; font-size: 10px; }

/* Tabler-inspired enterprise visual pass: readability first, no decorative motion. */
:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #182433;
  --muted: #667085;
  --line: #dfe3e8;
  --green: #0f766e;
  --green-2: #0d9488;
  --green-soft: #e8f5f2;
  --amber: #d97706;
  --red: #d63939;
  --blue: #206bc4;
  --shadow: 0 1px 2px rgba(24, 36, 51, .04), 0 8px 24px rgba(24, 36, 51, .055);
}

html { min-width: 0; overflow-x: hidden; }
body {
  min-width: 0;
  overflow-x: hidden;
  background: linear-gradient(180deg, #eef6f4 0, #f4f6f8 240px, #f4f6f8 100%);
  font-size: 15px;
  line-height: 1.55;
}

.ui-icon { display: block; width: 18px; height: 18px; flex: 0 0 auto; }
.ui-icon.is-inverse { filter: brightness(0) invert(1); }
.step-circle .ui-icon, .vertical-step .number .ui-icon, .event-icon .ui-icon { width: 17px; height: 17px; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
[data-item-card]:focus-visible {
  outline: 3px solid rgba(32, 107, 196, .24);
  outline-offset: 2px;
}

.app-shell { padding: 16px 22px 82px; }
.topbar {
  max-width: 1640px;
  margin-bottom: 18px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 1px 2px rgba(24, 36, 51, .04), 0 6px 18px rgba(24, 36, 51, .04);
  backdrop-filter: blur(10px);
}
.brand { gap: 12px; }
.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--green);
  box-shadow: 0 6px 14px rgba(15, 118, 110, .18);
}
.brand span {
  margin-bottom: 1px;
  color: #20736d;
  font-size: 12px;
  letter-spacing: .035em;
}
.brand h1 { color: #17212f; font-size: 21px; line-height: 1.25; }
.top-actions { gap: 10px; }
.local-label {
  padding: 5px 9px;
  border-radius: 7px;
  color: #176b63;
  background: var(--green-soft);
  font-size: 12px;
}
.sync { gap: 8px; color: #667085; font-size: 13px; }
.primary, .secondary, .close {
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
}
.primary, .secondary {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
}
.primary {
  background: var(--green);
  box-shadow: 0 2px 5px rgba(15, 118, 110, .16);
}
.primary:hover { background: #0b6a63; }
.secondary { border: 1px solid var(--line); background: #fff; }
.close { display: grid; width: 38px; height: 38px; place-items: center; background: #f1f3f5; }

.dashboard { max-width: 1640px; }
.status-strip {
  display: grid;
  grid-template-columns: 110px repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
  margin-bottom: 14px;
}
.overview-label {
  display: flex;
  align-items: center;
  padding: 0 6px 0 2px;
  color: #475467;
  font-size: 13px;
  letter-spacing: .02em;
}
.status-chip {
  min-height: 52px;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 13px;
  border-radius: 10px;
  background: #fff;
  color: #667085;
  font-size: 13px;
  box-shadow: 0 1px 2px rgba(24, 36, 51, .025);
}
.status-chip strong { font-size: 20px; line-height: 1; }

.flow-panel, .items-panel, .timeline-panel, .column-stage {
  border-color: var(--line);
  box-shadow: var(--shadow);
}
.flow-panel { padding: 24px; border-radius: 12px; }
.items-panel { margin-top: 14px; padding: 20px; border-radius: 12px; }
.status-strip + .items-panel { margin-top: 0; }
.items-panel + .selected-project-flow { margin-top: 14px; }
.timeline-panel { padding: 22px; border-radius: 12px; }
.panel-heading { gap: 24px; margin-bottom: 22px; }
.mini-label {
  margin-bottom: 4px;
  color: #27766f;
  font-size: 12px;
  letter-spacing: .035em;
}
.panel-heading h2 { color: #17212f; font-size: 24px; line-height: 1.3; }
.panel-heading p { margin-top: 7px; color: #667085; font-size: 14px; }
.project-list-tools { display: flex; align-items: flex-end; flex-direction: column; gap: 9px; }
.project-filter { display: inline-grid; grid-template-columns: repeat(3, auto); gap: 3px; padding: 3px; border: 1px solid #dbe5e3; border-radius: 9px; background: #f4f7f7; }
.project-filter-button { display: inline-flex; min-height: 34px; align-items: center; justify-content: center; gap: 6px; padding: 6px 10px; border: 0; border-radius: 6px; color: #667085; background: transparent; font-size: 12px; font-weight: 750; }
.project-filter-button:hover { color: var(--green); background: #fff; }
.project-filter-button.selected { color: #fff; background: var(--green); box-shadow: 0 3px 8px rgba(17, 107, 99, .18); }
.project-filter-button b { min-width: 18px; padding: 1px 5px; border-radius: 999px; color: inherit; background: rgba(255, 255, 255, .18); font-size: 10px; }
.project-filter-button:not(.selected) b { background: #e5eceb; }
.project-filter-empty { min-height: 112px; padding: 28px 16px; border: 1px dashed #cfdcda; border-radius: 9px; background: #fafcfc; }
.terminal-note, .current-stage-label, .gate-badge, .stage-pill, .participant-status {
  border-radius: 7px;
  font-size: 12px;
  font-weight: 750;
}
.terminal-note { padding: 6px 9px; }
.current-stage-label { padding: 6px 9px; background: var(--blue); }

.selected-summary {
  display: grid;
  grid-template-columns: auto auto;
  align-items: start;
  justify-content: end;
  gap: 8px;
}
.selected-summary .stage-editor { grid-column: 1 / -1; }
.stage-editor {
  width: 360px;
  padding: 12px;
  border-color: #cbdaf0;
  border-radius: 10px;
  background: #f7faff;
}
.stage-editor label { margin-bottom: 7px; font-size: 12px; letter-spacing: 0; }
.stage-editor-row { gap: 8px; }
.stage-editor-select {
  min-height: 40px;
  padding: 8px 30px 8px 10px;
  border-radius: 7px;
  font-size: 14px;
}
.stage-save {
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 14px;
}
.stage-editor small { margin-top: 7px; color: #667085; font-size: 12px; }

.process-rail { gap: 10px; }
.process-rail::before { top: 24px; height: 2px; background: #d8e2e1; }
.step-circle {
  width: 48px;
  height: 48px;
  margin-bottom: 10px;
  border-width: 4px;
  font-size: 16px;
}
.process-step strong { min-height: 39px; color: #344054; font-size: 14px; line-height: 1.4; }
.process-step small { margin-top: 4px; color: #7b8794; font-size: 12px; }

.project-detail-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-top: 22px;
  padding-top: 18px;
}
.project-facts {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.project-facts div {
  min-height: 74px;
  padding: 13px 14px;
  border: 1px solid #e2e9e8;
  border-radius: 10px;
  background: linear-gradient(145deg, #fbfcfc, #f5f8f7);
}
.project-facts span { margin-bottom: 7px; font-size: 12px; }
.project-facts strong {
  overflow: visible;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.collaboration-panel {
  padding: 18px;
  border-color: #dce5e3;
  border-radius: 12px;
  background: linear-gradient(155deg, #ffffff 0%, #f9fbfa 100%);
  box-shadow: 0 8px 24px rgba(24, 36, 51, .045);
}
.collaboration-panel.compact { margin-top: 16px; }
.collaboration-panel.compact .dispatch-step { grid-column: 1 / -1; }
.collaboration-head { margin-bottom: 13px; }
.collaboration-head h3 { font-size: 17px; }
.collaboration-head p { margin-top: 4px; font-size: 13px; }
.gate-badge { padding: 6px 9px; }
.dispatch-setup {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.dispatch-field { gap: 7px; }
.dispatch-field > label, .dispatch-recipients > span { font-size: 12px; }
.dispatch-field select { min-height: 40px; border-radius: 7px; font-size: 13px; }
.file-button { padding: 9px 11px; border-radius: 7px; font-size: 13px; }
.dispatch-recipients { gap: 6px; padding: 9px 11px; border-radius: 8px; }
.dispatch-recipients strong, .dispatch-button { font-size: 13px; }
.dispatch-button { min-height: 40px; padding: 8px 10px; border-radius: 7px; }
.prototype-warning { font-size: 12px; }
.dispatch-summary { gap: 10px; padding: 11px; border-radius: 8px; }
.dispatch-summary span { font-size: 12px; }
.dispatch-summary strong {
  overflow: visible;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}
.participant-grid { gap: 10px; margin-top: 10px; }
.participant-card { padding: 12px; border-radius: 9px; }
.participant-main { grid-template-columns: 36px 1fr auto; gap: 10px; }
.role-avatar { width: 36px; height: 36px; border-radius: 8px; font-size: 13px; }
.participant-main strong { font-size: 14px; }
.participant-main small { font-size: 12px; }
.participant-status { padding: 5px 7px; }
.participant-meta { min-height: 34px; margin-top: 9px; padding-top: 8px; }
.participant-meta > span { font-size: 12px; }
.participant-actions button { min-height: 32px; padding: 6px 8px; border-radius: 6px; font-size: 12px; }
.approval-gate { margin-top: 10px; padding: 12px; border-radius: 9px; }

.dispatch-step {
  min-width: 0;
  padding: 14px;
  border: 1px solid #dfe7e6;
  border-radius: 10px;
  background: rgba(255, 255, 255, .92);
}
.dispatch-step-attachment { grid-column: span 7; }
.dispatch-step-recipient { grid-column: span 5; }
.dispatch-step-method { grid-column: 1 / -1; }
.dispatch-step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.dispatch-step-head > div { min-width: 0; }
.dispatch-step-head strong {
  display: block;
  color: #23303f;
  font-size: 14px;
  line-height: 1.35;
}
.dispatch-step-head small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
.dispatch-step-index {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 5px 12px rgba(15, 118, 110, .16);
}
.dispatch-step .attachment-source-actions { margin-top: 2px; }
.attachment-file-status {
  display: grid;
  gap: 3px;
  min-height: 56px;
  padding: 10px 11px;
  border: 1px dashed #cfdbd9;
  border-radius: 8px;
  color: #71809a;
  background: #f8faf9;
}
.attachment-file-status.has-file {
  border-style: solid;
  border-color: #bcd9d3;
  color: #245f59;
  background: #f2faf8;
}
.attachment-file-status span {
  font-size: 11px;
  font-weight: 750;
}
.attachment-file-status strong {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
.dispatch-review-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 13px;
  border: 1px solid #d8e4e1;
  border-radius: 10px;
  background: linear-gradient(135deg, #f3f9f7, #f8fbfa);
}
.dispatch-review-bar > div { min-width: 0; }
.dispatch-method-field { flex: 0 1 360px; }
.dispatch-method-field select { width: 100%; }
.dispatch-ready-copy { flex: 1 1 260px; }
.dispatch-review-bar span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 11px;
}
.dispatch-review-bar strong {
  display: block;
  font-size: 13px;
  line-height: 1.45;
}
.dispatch-review-bar .dispatch-button {
  width: auto;
  min-width: 230px;
  flex: 0 0 auto;
}
.dispatch-setup > .prototype-warning { grid-column: 1 / -1; }
.gate-copy { gap: 4px; }
.gate-copy strong { font-size: 14px; }
.gate-copy span { font-size: 12px; }
.gate-actions button { min-height: 36px; padding: 7px 10px; border-radius: 7px; font-size: 12px; }
.terminal-message { padding: 18px; border-radius: 9px; font-size: 14px; }

.audit-details { margin-top: 12px; border-radius: 9px; }
.audit-details summary { padding: 11px 13px; font-size: 13px; }
.audit-details summary b { min-width: 22px; height: 22px; border-radius: 6px; font-size: 12px; }
.activity-panel { padding: 14px; border-radius: 10px; }
.activity-head { margin-bottom: 11px; }
.activity-head h3 { font-size: 16px; }
.live-badge { font-size: 12px; }
.event-list { gap: 8px; }
.event-row { grid-template-columns: 32px 1fr; gap: 9px; padding: 9px; border-radius: 8px; }
.event-icon { width: 32px; height: 32px; border-radius: 7px; }
.event-row strong { font-size: 13px; }
.event-row small { font-size: 12px; }

.items-grid { grid-template-columns: repeat(4, minmax(235px, 1fr)); gap: 12px; }
.item-card {
  padding: 15px;
  border-radius: 10px;
  background: #fff;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.item-card:hover { box-shadow: 0 7px 20px rgba(24, 36, 51, .075); }
.item-card.selected { border-width: 2px; box-shadow: 0 0 0 3px rgba(32, 107, 196, .08); }
.stage-pill { padding: 5px 8px; }
.due { font-size: 12px; }
.item-meta-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.project-delete-button { min-height: 30px; padding: 4px 8px; border: 1px solid #edcfcb; border-radius: 6px; color: #a9443a; background: #fff8f7; font-size: 11px; font-weight: 750; line-height: 1; }
.project-delete-button:hover { border-color: #d99a92; color: #8f2e25; background: #fff0ee; }
.project-delete-button:focus-visible { outline: 3px solid rgba(190, 73, 61, .18); outline-offset: 2px; }
.item-card h3 { min-height: 48px; margin: 12px 0 10px; font-size: 16px; line-height: 1.5; }
.attachment-row { min-height: 44px; font-size: 13px; }
.attachment-label { display: flex; align-items: center; gap: 5px; }
.attachment-label .ui-icon { width: 16px; height: 16px; }
.item-foot { margin-top: 12px; padding-top: 11px; }
.card-sync-note, .readonly-state, .send-state, .card-open-hint { font-size: 12px; }

.variant-b-layout { grid-template-columns: 430px minmax(0, 1fr); gap: 14px; }
.selected-title { font-size: 19px; }
.vertical-flow { margin-top: 18px; }
.vertical-step { grid-template-columns: 40px 1fr auto; gap: 12px; min-height: 72px; }
.vertical-step:not(:last-child)::after { left: 19px; }
.vertical-step .number { width: 40px; height: 40px; border-radius: 9px; font-size: 13px; }
.vertical-step strong { font-size: 14px; }
.vertical-step small { font-size: 12px; }
.vertical-step b { min-width: 36px; height: 28px; border-radius: 6px; font-size: 12px; }
.queue-list { gap: 10px; }
.queue-row { grid-template-columns: minmax(0, 1fr) 155px; gap: 20px; padding: 15px; border-radius: 9px; background: #fff; }
.queue-row h3 { margin-bottom: 7px; font-size: 15px; }
.queue-row p { font-size: 13px; }
.queue-controls .project-delete-button { margin-top: 2px; }

.selected-project-banner {
  margin-bottom: 14px;
  padding: 18px 22px;
  border-radius: 12px;
  background: linear-gradient(112deg, #115e59, #0f766e);
  box-shadow: 0 8px 24px rgba(15, 118, 110, .14);
}
.selected-project-banner h2 { font-size: 21px; }
.selected-project-banner > div:last-child strong { font-size: 14px; }
.selected-project-banner > div:last-child span { font-size: 12px; }
.selected-project-banner .mini-label { color: rgba(255, 255, 255, .75); }
.selected-project-banner .stage-editor { border-color: rgba(255, 255, 255, .24); background: rgba(255, 255, 255, .09); }
.selected-project-banner + .collaboration-panel.compact { margin: 0 0 14px; }
.selected-project-banner + .collaboration-panel.compact .dispatch-setup {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.selected-project-banner + .collaboration-panel.compact .participant-grid { grid-template-columns: 1fr 1fr; }
.selected-project-banner + .collaboration-panel.compact .approval-gate { flex-direction: row; align-items: center; }
.selected-project-banner + .collaboration-panel.compact .gate-actions { display: flex; }
.wall-grid { grid-template-columns: repeat(7, minmax(165px, 1fr)); gap: 10px; }
.column-stage { min-height: 390px; padding: 13px; border-radius: 10px; }
.stage-head { min-height: 44px; padding-bottom: 10px; }
.stage-head strong { font-size: 13px; }
.stage-head b { min-width: 28px; height: 28px; border-radius: 7px; font-size: 12px; }
.wall-card { padding: 12px; border-radius: 8px; background: #fff; }
.wall-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 7px; }
.wall-card h3 { font-size: 14px; }
.wall-card-head h3 { min-width: 0; margin-bottom: 8px; overflow-wrap: anywhere; }
.wall-card-head .project-delete-button { flex: 0 0 auto; }
.wall-card span { font-size: 12px; }

footer { max-width: 1640px; margin-top: 14px; color: #7b8794; font-size: 12px; }
.variant-switcher {
  grid-template-columns: 40px auto 40px;
  min-width: 254px;
  padding: 7px;
  border-radius: 11px;
  background: rgba(24, 36, 51, .94);
}
.variant-switcher button { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 8px; }
.variant-switcher span { font-size: 11px; }
.variant-switcher strong { font-size: 13px; }

.modal { padding: 24px; border-radius: 12px; }
.modal-head h2 { font-size: 23px; }
.field { gap: 8px; margin-top: 14px; font-size: 14px; }
.field span b { font-size: 11px; }
.field input, .field select { min-height: 44px; border-radius: 8px; font-size: 14px; }
.required-field input { font-size: 15px; }
.field small { font-size: 12px; }
.contact-field { align-content: end; }
.contact-picker {
  display: grid;
  grid-template-columns: 36px minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 9px 11px;
  border: 1px solid #d5def0;
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.contact-picker:hover { border-color: #84aef1; background: #f8fbff; }
.contact-picker:focus-visible { border-color: var(--blue); outline: 3px solid rgba(38,113,210,.14); }
.contact-picker.has-person { border-color: #9ecfbe; background: #f6fcfa; }
.contact-picker-avatar {
  display: grid !important;
  width: 36px;
  height: 36px;
  place-items: center;
  justify-content: center !important;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  font-size: 15px;
  font-weight: 850;
}
.contact-picker.has-person .contact-picker-avatar { background: var(--green); }
.contact-picker-copy { display: grid !important; justify-content: initial !important; min-width: 0; gap: 3px; }
.contact-picker-copy strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.contact-picker-copy small { color: var(--muted); font-size: 11px; font-weight: 600; }
.contact-picker-arrow { justify-content: center !important; color: var(--blue); font-size: 24px; line-height: 1; }
.field > .contact-picker { min-height: 62px; }
.recipient-selector-field { grid-column: 1 / -1; }
.multi-contact-picker {
  min-height: 52px;
  border-color: #dbe4ed;
  background: #fbfcfd;
  box-shadow: none;
}
.multi-contact-picker:hover { background: #f6f9fc; box-shadow: 0 4px 14px rgba(32, 72, 112, .06); }
.multi-contact-picker.has-person { border-color: #b9d8cf; background: #f7fbfa; }
.selected-recipient-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 2px;
}
.selected-recipient-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 7px 4px 4px;
  border: 1px solid #d7e6e1;
  border-radius: 999px;
  color: #25463f;
  background: #f4faf8;
  font-size: 12px;
  font-weight: 700;
  animation: recipient-in .16s ease-out both;
}
.selected-recipient-chip b {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  font-size: 10px;
}
.selected-recipient-chip button {
  display: grid;
  width: 20px;
  height: 20px;
  margin-left: 1px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #6e827d;
  background: transparent;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.selected-recipient-chip button:hover { color: #a33; background: #fbeaea; }
.dispatch-setup > .dispatch-button { grid-column: 1 / -1; }
.participant-grid,
.selected-project-banner + .collaboration-panel.compact .participant-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
@keyframes recipient-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
.directory-dialog {
  width: min(760px, calc(100vw - 32px));
  max-width: none;
  max-height: 86vh;
  max-height: min(780px, 86dvh);
  padding: 0;
  overflow: hidden;
}
.directory-dialog::backdrop { background: rgba(24, 39, 43, .24); backdrop-filter: blur(2px); }
.directory-dialog[open] { display: block; }
.directory-dialog-shell {
  display: grid;
  grid-template-rows: auto auto auto minmax(240px, 1fr) auto auto;
  max-height: 86vh;
  max-height: min(780px, 86dvh);
  padding: 22px;
}
.directory-dialog-head { margin-bottom: 14px; }
.directory-dialog-head > div { min-width: 0; }
.directory-dialog-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; font-weight: 500; }
.directory-search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.directory-search {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid #d5def0;
  border-radius: 8px;
  background: #fbfcfd;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.directory-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(38,113,210,.12); }
.directory-search .ui-icon { width: 18px; height: 18px; opacity: .58; }
.directory-search input { min-width: 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 14px; }
.directory-native-fallback { min-height: 42px; white-space: nowrap; }
.directory-selected-panel {
  min-width: 0;
  margin-top: 12px;
  padding: 11px;
  border: 1px solid #dce8e4;
  border-radius: 9px;
  background: #f8fbfa;
}
.directory-section-head, .directory-pane-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.directory-section-head strong, .directory-pane-title { color: #344054; font-size: 12px; font-weight: 800; }
.directory-section-head > span { color: var(--green); font-size: 12px; font-weight: 800; }
.directory-selected-chips { display: flex; min-height: 32px; max-height: 94px; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 8px; overflow-y: auto; }
.directory-empty-inline { color: var(--muted); font-size: 12px; }
.directory-selected-chip { background: #fff; }
.directory-layout {
  display: grid;
  min-height: 0;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
}
.directory-departments, .directory-people {
  display: grid;
  min-width: 0;
  min-height: 0;
  padding: 10px;
  border: 1px solid #e0e6ed;
  border-radius: 9px;
  background: #fff;
}
.directory-departments { grid-template-rows: auto minmax(0, 1fr); }
.directory-people { grid-template-rows: auto minmax(0, 1fr) auto; }
.directory-pane-title { min-height: 28px; padding: 0 4px 7px; border-bottom: 1px solid #edf0f4; }
.directory-pane-title small { color: var(--muted); font-size: 11px; font-weight: 600; }
.directory-department-list, .directory-people-list {
  min-height: 0;
  margin-top: 7px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.directory-department-list { display: grid; align-content: start; gap: 3px; }
.directory-department {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 8px 7px 9px;
  border: 0;
  border-radius: 7px;
  color: #475467;
  background: transparent;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.directory-department span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.directory-department.depth-1 { padding-left: 21px; }
.directory-department.depth-2 { padding-left: 33px; }
.directory-department.depth-3 { padding-left: 45px; }
.directory-department.depth-4 { padding-left: 57px; }
.directory-department small { color: #98a2b3; font-size: 17px; }
.directory-department:hover { background: #f3f6f9; }
.directory-department.is-active { color: var(--green); background: var(--green-soft); font-weight: 800; }
.directory-people-list { display: grid; align-content: start; gap: 5px; }
.directory-person {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.directory-person:hover { border-color: #d9e3eb; background: #f8fafc; }
.directory-person.is-selected { border-color: #b9d8cf; background: #f3faf7; }
.directory-person-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #4b78b8;
  font-size: 13px;
  font-weight: 850;
}
.directory-person.is-selected .directory-person-avatar { background: var(--green); }
.directory-person-copy { min-width: 0; }
.directory-person-copy strong, .directory-person-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.directory-person-copy strong { font-size: 13px; }
.directory-person-copy small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.directory-person-check {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: transparent;
  background: #fff;
  font-size: 13px;
  font-weight: 900;
}
.directory-person.is-selected .directory-person-check { border-color: var(--green); color: #fff; background: var(--green); }
.directory-empty { padding: 28px 10px; color: var(--muted); font-size: 12px; text-align: center; }
.directory-load-more { width: 100%; min-height: 36px; margin-top: 7px; }
.directory-status { min-height: 18px; margin: 8px 2px 0; color: var(--muted); font-size: 11px; }
.directory-status.is-error { color: var(--red); }
.directory-dialog-actions { margin-top: 6px; padding-top: 10px; border-top: 1px solid #edf0f4; }
.document-dialog {
  width: min(760px, calc(100vw - 32px));
  max-width: none;
  max-height: min(780px, 88dvh);
  padding: 0;
  overflow: hidden;
}
.document-dialog::backdrop { background: rgba(24, 39, 43, .28); backdrop-filter: blur(3px); }
.document-dialog[open] { display: block; }
.document-dialog-shell {
  display: grid;
  grid-template-rows: auto auto auto minmax(220px, 1fr) auto auto auto;
  max-height: min(780px, 88dvh);
  padding: 22px;
}
.document-dialog-head { margin-bottom: 14px; }
.document-dialog-head > div { min-width: 0; }
.document-dialog-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; font-weight: 500; }
.document-browser-toolbar {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) minmax(210px, .8fr);
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dce8e6;
  border-radius: 10px;
  background: #f8fbfa;
}
.document-back { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; }
.document-path,
.document-filter { display: grid; gap: 5px; min-width: 0; }
.document-path span,
.document-filter span,
.document-selected > span { color: var(--muted); font-size: 11px; font-weight: 750; }
.document-path strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.document-filter input {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #d4e0de;
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  outline: none;
}
.document-filter input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(17,107,99,.12); }
.document-selected {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 46px;
  margin: 10px 0;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--green-soft);
}
.document-selected strong { overflow-wrap: anywhere; font-size: 13px; }
.document-node-list {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 220px;
  padding: 8px;
  overflow: auto;
  border: 1px solid #e0e7e6;
  border-radius: 10px;
  background: #fff;
}
.document-node {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 60px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--text);
  background: #f8faf9;
  text-align: left;
}
.document-node:hover { border-color: #bfd7d3; background: #f2f8f7; }
.document-node.is-selected { border-color: var(--green); background: var(--green-soft); box-shadow: 0 0 0 2px rgba(17,107,99,.08); }
.document-node-type {
  display: grid;
  width: 44px;
  height: 40px;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: #3477c6;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}
.document-node.is-folder .document-node-type { color: var(--green); background: #dff0ed; }
.document-node-copy { display: grid; gap: 4px; min-width: 0; }
.document-node-copy strong { overflow-wrap: anywhere; font-size: 13px; }
.document-node-copy small { color: var(--muted); font-size: 11px; }
.document-node > .ui-icon { justify-self: center; }
.document-node input[type="radio"] { width: 20px; height: 20px; margin: 0; accent-color: var(--green); }
.document-load-more { width: 100%; min-height: 38px; margin-top: 8px; }
.document-status { min-height: 18px; margin: 7px 2px 0; color: var(--muted); font-size: 11px; }
.document-status.is-error { color: var(--red); }
.document-reference-note { margin-top: 8px; color: #8b6d3e; font-size: 11px; line-height: 1.5; }
.document-dialog-actions { margin-top: 8px; padding-top: 10px; border-top: 1px solid #edf0f4; }
.optional-title { font-size: 12px; }
.form-message, .toast, .empty { font-size: 13px; }

/* Role-specific dashboard roots */
html.view-participant,
html.view-boss { min-width: 0; }
html.view-participant .variant-switcher,
html.view-boss .variant-switcher { display: none; }
html.view-boss #openCreate { display: none !important; }
html.view-participant .dashboard { max-width: 940px; }
html.view-boss .dashboard { max-width: 1180px; }
.role-view {
  padding: 28px;
  border: 1px solid rgba(210, 225, 222, .95);
  border-radius: 22px;
  background: rgba(255, 255, 255, .95);
  box-shadow: var(--shadow);
}
.role-preview-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px 14px;
  border: 1px solid #ecd39d;
  border-radius: 12px;
  color: #765018;
  background: #fff8e9;
}
.role-preview-notice strong { flex: 0 0 auto; font-size: 13px; }
.role-preview-notice span { color: #896b3d; font-size: 12px; line-height: 1.55; }
.role-view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.role-view-head h2 { margin: 4px 0 5px; font-size: clamp(24px, 3vw, 34px); line-height: 1.25; }
.role-view-head p { max-width: 760px; margin: 0; color: var(--muted); }
.role-status-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 999px;
  color: #8a5b16;
  background: #fff1d7;
  font-size: 13px;
  font-weight: 850;
}
.role-status-badge.is-complete { color: var(--green); background: var(--green-soft); }
.role-progress {
  overflow-x: auto;
  margin: 0 -4px 22px;
  padding: 8px 4px 16px;
  scrollbar-width: thin;
}
.role-progress .process-rail { min-width: 820px; }
.assigned-current-stage {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 15px;
  padding: 9px 18px 9px 9px;
  border: 1px solid #c9dcff;
  border-radius: 999px;
  color: #1659c7;
  background: linear-gradient(135deg, #f2f7ff 0%, #ffffff 100%);
  box-shadow: 0 8px 22px rgba(37, 99, 235, .08);
}
.assigned-stage-node {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #2563eb;
  box-shadow: 0 0 0 7px #e5eeff, 0 7px 18px rgba(37, 99, 235, .2);
  font-size: 17px;
  font-weight: 900;
}
.assigned-current-stage strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 18px;
}
.participant-deadline-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding: 15px 17px;
  border: 1px solid #dce5f2;
  border-radius: 14px;
  background: #f7f9fd;
}
.participant-deadline-card span { color: #71809a; font-size: 13px; font-weight: 750; }
.participant-deadline-card strong { color: #17233a; font-size: 17px; }
.role-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.role-facts > div {
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid #e3ebea;
  border-radius: 13px;
  background: #f7faf9;
}
.role-facts span,
.participant-task-copy span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; }
.role-facts strong { display: block; overflow-wrap: anywhere; font-size: 15px; }
.role-facts strong.danger { color: var(--red); }
.participant-task-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid #d8e5e3;
  border-radius: 15px;
  background: linear-gradient(135deg, #f8fcfb, #f3f8f7);
}
.participant-task-card.is-complete { border-color: #bddfd5; background: #f1faf7; }
.participant-task-card .role-avatar { width: 46px; height: 46px; font-size: 16px; }
.participant-task-copy { min-width: 0; }
.participant-task-copy strong { display: block; font-size: 17px; }
.participant-task-copy small { display: block; margin-top: 3px; color: var(--muted); line-height: 1.55; }
.participant-complete-action,
.boss-approve-action {
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: var(--green);
  font-weight: 850;
  box-shadow: 0 8px 20px rgba(17, 107, 99, .18);
}
.participant-read-state {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #667776;
  background: #e9efee;
  font-size: 12px;
  font-weight: 800;
}
.role-empty-state {
  display: grid;
  min-height: min(620px, 68vh);
  place-items: center;
  align-content: center;
  padding: 54px 28px;
  text-align: center;
}
.role-empty-state h2 { margin: 12px 0 8px; font-size: 29px; }
.role-empty-state p { max-width: 570px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.75; }
.role-empty-icon { display: grid; width: 58px; height: 58px; margin-bottom: 18px; place-items: center; border-radius: 18px; background: var(--green); box-shadow: 0 12px 28px rgba(17, 107, 99, .2); }
.boss-selector-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e5eceb;
}
.boss-selector-row label { display: grid; flex: 1 1 620px; max-width: 760px; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 750; }
.boss-selector-row select { width: 100%; min-height: 46px; padding: 10px 42px 10px 13px; border: 1px solid #cedbd9; border-radius: 11px; color: var(--text); background: #f8faf9; font-size: 15px; font-weight: 750; }
.boss-view-head { margin-bottom: 18px; }
.boss-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.boss-facts .quote-fact { border-color: #c7ddd8; background: linear-gradient(135deg, #eff9f6, #f8fcfb); }
.boss-facts .quote-fact strong { color: var(--green); font-size: 19px; }
.boss-review-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid #d9e3e2;
  border-radius: 15px;
  background: #f7f9f9;
}
.boss-review-panel.is-actionable { border-color: #b9d8cf; background: linear-gradient(135deg, #eff9f6, #f7fcfa); }
.boss-review-panel.is-approved { border-color: #b9d8cf; background: #f3faf8; }
.boss-review-panel h3 { margin: 4px 0 2px; font-size: 19px; }
.boss-review-panel p { margin: 0; color: var(--muted); }

@media (max-width: 1320px) {
  .items-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .process-step small { display: none; }
  .project-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1080px) {
  .app-shell { padding-right: 16px; padding-left: 16px; }
  .topbar { align-items: flex-start; flex-direction: column; gap: 12px; }
  .top-actions { width: 100%; flex-wrap: wrap; }
  .status-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-label { grid-column: 1 / -1; }
  .panel-heading { flex-direction: column; }
  .selected-summary { width: 100%; justify-items: stretch; }
  .stage-editor { width: 100%; }
  .process-rail {
    min-width: 0;
    grid-template-columns: repeat(7, minmax(120px, 1fr));
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
  }
  .selected-project-flow { overflow-x: visible; }
  .project-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dispatch-step-attachment,
  .dispatch-step-recipient { grid-column: 1 / -1; }
  .variant-b-layout { grid-template-columns: 1fr; }
  .items-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
  .selected-project-banner { align-items: stretch; flex-direction: column; }
  .selected-banner-side { min-width: 0; }
  .selected-banner-status { justify-items: start; }
}

@media (max-width: 720px) {
  .attachment-source-actions { grid-template-columns: 1fr; }
  .modal .modal-actions { position: sticky; bottom: 0; z-index: 2; padding: 12px 0 2px; background: #fff; box-shadow: 0 -10px 18px rgba(255,255,255,.92); }
  .app-shell { padding: 10px 10px 82px; }
  .topbar { padding: 11px; }
  .brand h1 { font-size: 19px; }
  .top-actions .primary { width: 100%; }
  .status-strip { grid-template-columns: 1fr; }
  .overview-label { grid-column: auto; }
  .flow-panel, .items-panel, .timeline-panel { padding: 15px; }
  .panel-heading h2 { font-size: 21px; }
  .stage-editor-row { grid-template-columns: 1fr; }
  .project-facts, .items-grid, .participant-grid, .event-list { grid-template-columns: 1fr; }
  .dispatch-setup,
  .selected-project-banner + .collaboration-panel.compact .dispatch-setup { grid-template-columns: 1fr; }
  .dispatch-summary { grid-template-columns: 1fr; }
  .dispatch-review-bar { align-items: stretch; flex-direction: column; }
  .dispatch-method-field,
  .dispatch-ready-copy { width: 100%; flex-basis: auto; }
  .dispatch-review-bar .dispatch-button { width: 100%; min-width: 0; }
  .queue-row { grid-template-columns: 1fr; gap: 10px; }
  .queue-controls { justify-items: start; }
  .approval-gate { align-items: stretch; flex-direction: column; }
  .gate-actions { display: grid; }
  .selected-project-banner + .collaboration-panel.compact .participant-grid { grid-template-columns: 1fr; }
  .selected-project-banner + .collaboration-panel.compact .approval-gate { align-items: stretch; flex-direction: column; }
  .selected-project-banner + .collaboration-panel.compact .gate-actions { display: grid; }
  .directory-dialog {
    width: 100%;
    max-height: 90vh;
    max-height: 90dvh;
    margin: auto 0 0;
    border-radius: 16px 16px 0 0;
  }
  .directory-dialog-shell {
    max-height: 90vh;
    max-height: 90dvh;
    grid-template-rows: auto auto auto minmax(250px, 1fr) auto auto;
    padding: 15px 14px max(14px, env(safe-area-inset-bottom));
  }
  .directory-dialog-head p { font-size: 11px; }
  .directory-search-row { grid-template-columns: 1fr; }
  .directory-native-fallback { justify-self: start; min-height: 38px; }
  .directory-layout { grid-template-columns: 118px minmax(0, 1fr); gap: 8px; }
  .directory-departments, .directory-people { padding: 7px; }
  .directory-department { min-height: 44px; padding-right: 6px; padding-left: 7px; }
  .directory-department.depth-1,
  .directory-department.depth-2,
  .directory-department.depth-3,
  .directory-department.depth-4 { padding-left: 7px; }
  .directory-person { grid-template-columns: 36px minmax(0, 1fr) 24px; min-height: 56px; padding: 7px; }
  .directory-person-avatar { width: 36px; height: 36px; }
  .directory-dialog-actions { display: grid; grid-template-columns: .75fr 1.25fr; }
  .directory-dialog-actions button { width: 100%; }
  .document-dialog {
    width: 100%;
    max-height: 92dvh;
    margin: auto 0 0;
    border-radius: 16px 16px 0 0;
  }
  .document-dialog-shell {
    max-height: 92dvh;
    grid-template-rows: auto auto auto minmax(220px, 1fr) auto auto auto;
    padding: 15px 14px max(14px, env(safe-area-inset-bottom));
  }
  .document-dialog-head p { font-size: 11px; }
  .document-browser-toolbar { grid-template-columns: auto minmax(0, 1fr); padding: 9px; }
  .document-filter { grid-column: 1 / -1; }
  .document-node-list { min-height: 220px; }
  .document-dialog-actions { display: grid; grid-template-columns: .75fr 1.25fr; }
  .document-dialog-actions button { width: 100%; }
  footer { align-items: flex-start; flex-direction: column; gap: 6px; }
  html.view-participant .app-shell,
  html.view-boss .app-shell { padding-bottom: 26px; }
  html.view-participant .top-actions,
  html.view-boss .top-actions { gap: 7px; }
  html.view-participant .top-actions .sync,
  html.view-boss .top-actions .sync { margin-left: auto; }
  .role-preview-control { flex: 1 1 100%; justify-content: space-between; }
  .role-preview-control select { min-width: 130px; }
  .role-view { padding: 18px 15px; border-radius: 16px; }
  .role-preview-notice { align-items: flex-start; flex-direction: column; gap: 4px; }
  .role-view-head { flex-direction: column; gap: 12px; margin-bottom: 17px; }
  .role-view-head h2 { font-size: 24px; }
  .role-status-badge { min-height: 32px; }
  .role-progress { margin-right: -5px; margin-bottom: 15px; margin-left: -5px; }
  .role-progress .process-rail { min-width: 760px; }
  .assigned-current-stage { width: 100%; border-radius: 16px; }
  .assigned-stage-node { width: 42px; height: 42px; flex-basis: 42px; }
  .assigned-current-stage strong { font-size: 17px; }
  .participant-deadline-card { grid-template-columns: 1fr; gap: 4px; }
  .role-facts,
  .boss-facts { grid-template-columns: 1fr; }
  .participant-task-card { grid-template-columns: 42px minmax(0, 1fr); }
  .participant-task-card .role-avatar { width: 42px; height: 42px; }
  .participant-complete-action,
  .participant-read-state { grid-column: 1 / -1; justify-content: center; width: 100%; }
  .boss-selector-row { align-items: stretch; flex-direction: column; }
  .boss-selector-row label { flex-basis: auto; max-width: none; }
  .boss-review-panel { align-items: stretch; flex-direction: column; }
  .boss-approve-action { width: 100%; }
}

/* Employee-owned intake submissions. */
.participant-upload-dispatch {
  grid-template-columns: 1fr;
  gap: 14px;
}
.participant-upload-dispatch .dispatch-step { grid-column: 1 / -1; }

.submission-list-panel {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid #d9e3f1;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(23, 32, 51, .035);
}
.submission-list-head {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border-bottom: 1px solid #e6ecf4;
  background: linear-gradient(135deg, #f8faff, #f2f6fd);
}
.submission-list-head h4 { margin: 1px 0 0; font-size: 16px; }
.submission-list-head > strong {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  color: #2458c6;
  background: #eaf2ff;
  font-size: 12px;
}
.submission-list { display: grid; }
.submission-row {
  display: grid;
  grid-template-columns: 34px minmax(130px, .55fr) minmax(220px, 1.45fr) auto;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 14px 16px;
  border-bottom: 1px solid #edf1f6;
}
.submission-row:last-child { border-bottom: 0; }
.submission-row.is-submitted { background: #fff; }
.submission-row.is-pending { background: #fafbfd; }
.submission-order {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: #2563eb;
  font-size: 12px;
  font-weight: 850;
}
.submission-row.is-pending .submission-order { color: #71809a; background: #e8edf4; }
.submission-person,
.submission-file { display: grid; min-width: 0; gap: 3px; }
.submission-person strong,
.submission-file strong { overflow-wrap: anywhere; }
.submission-person small,
.submission-file > span,
.submission-file > small { color: #78869a; font-size: 11px; }
.submission-file p {
  margin: 4px 0 0;
  color: #56657c;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.submission-download,
.submission-pending-badge {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}
.submission-download { color: #fff; background: #2563eb; }
.submission-download:hover { background: #1d4ed8; }
.submission-pending-badge { color: #7b8798; background: #edf1f5; }

.participant-submission-card {
  display: grid;
  gap: 14px;
  margin: 18px 0 12px;
  padding: 17px;
  border: 1px solid #cfdcf0;
  border-radius: 14px;
  background: linear-gradient(145deg, #fbfcff, #f5f8fd);
}
.participant-submission-card.is-missing { border-style: dashed; }
.participant-submission-head {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
}
.participant-submission-head > div:nth-child(2) { display: grid; min-width: 0; gap: 3px; }
.participant-submission-head span,
.participant-submission-head small { color: #71809a; font-size: 12px; }
.participant-submission-head strong { overflow-wrap: anywhere; font-size: 16px; }
.participant-submission-note {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 11px 13px;
  border-radius: 9px;
  color: #42516a;
  background: #fff;
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.participant-submission-note span { color: #71809a; font-size: 11px; font-weight: 800; }
.participant-submission-form {
  display: grid;
  grid-template-columns: minmax(220px, .9fr) minmax(260px, 1.35fr);
  align-items: end;
  gap: 11px;
  padding-top: 2px;
}
.participant-file-choice,
.participant-note-field { display: grid; min-width: 0; gap: 6px; }
.participant-requirement-change-field,
.participant-submission-form > .participant-submit-action { grid-column: 1 / -1; }
.participant-file-choice > span,
.participant-note-field > span { color: #66758c; font-size: 12px; font-weight: 800; }
.participant-file-choice > strong {
  display: flex;
  min-height: 46px;
  align-items: center;
  padding: 10px 12px;
  overflow: hidden;
  border: 1px solid #cbd8ec;
  border-radius: 9px;
  color: #274675;
  background: #fff;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.participant-file-choice { cursor: default; }
.participant-file-choice > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.participant-file-choice > span small { color: #8a97aa; font-size: 11px; font-weight: 700; }
.participant-upload-source-trigger {
  min-height: 46px;
  padding: 10px 15px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: #2563eb;
  font-weight: 850;
  box-shadow: 0 7px 18px rgba(37, 99, 235, .2);
  cursor: pointer;
}
.participant-upload-source-trigger:hover { background: #1d4ed8; }
.submission-source-dialog { width: min(620px, calc(100vw - 32px)); }
.submission-source-shell { display: grid; gap: 18px; }
.submission-source-shell .modal-head { margin-bottom: 0; }
.submission-source-shell .modal-head p { margin: 7px 0 0; color: var(--muted); line-height: 1.55; }
.submission-source-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.submission-source-option {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 17px;
  border: 1px solid #d6e1f2;
  border-radius: 15px;
  text-align: left;
  color: #17233a;
  background: linear-gradient(145deg, #fff, #f5f8fd);
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.submission-source-option:hover:not(:disabled) {
  border-color: #8fb3f5;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .1);
  transform: translateY(-1px);
}
.submission-source-option:disabled { cursor: not-allowed; opacity: .5; }
.submission-source-option strong { font-size: 17px; }
.submission-source-option small { color: #71809a; line-height: 1.5; }
.submission-source-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 13px;
  color: #1d4ed8;
  background: #e7efff;
  font-size: 12px;
  font-weight: 900;
}
.submission-source-icon.is-dingtalk { color: #075db8; background: #e4f3ff; }

.project-description-field textarea {
  min-height: 170px;
  resize: vertical;
  line-height: 1.65;
}

.submission-deadline-field {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}
.submission-deadline-field > span { color: var(--muted); font-size: 13px; font-weight: 750; }
.submission-deadline-field input { min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: #f8fafc; cursor: pointer; }
.submission-deadline-field small { color: var(--muted); }
.inherited-recipient-note { display: block; margin-top: 8px; color: #486581; line-height: 1.55; }

.review-submission-list { display: grid; gap: 12px; margin-top: 18px; }
.review-submission-row {
  display: grid;
  grid-template-columns: 38px minmax(130px, .65fr) minmax(260px, 1.4fr) auto minmax(220px, .9fr);
  gap: 14px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(24, 36, 51, .035);
}
.review-submission-row.is-approved { border-color: #b9dfd8; background: #fbfefd; }
.review-submission-row.is-rejected { border-color: #f3c7c7; background: #fffafa; }
.review-submission-person,
.review-submission-content,
.review-submission-actions { display: grid; gap: 5px; min-width: 0; }
.review-submission-person small,
.review-submission-content > span,
.review-submission-content small { color: var(--muted); font-size: 12px; }
.review-submission-content strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-submission-content p { margin: 4px 0 0; color: #475467; white-space: pre-wrap; }
.review-reject-reason,
.participant-rejection-note { padding: 9px 11px; border-radius: 8px; color: #a12626 !important; background: #fff0f0; }
.participant-rejection-note span { display: block; margin-bottom: 3px; font-size: 11px; font-weight: 800; }
.review-submission-actions textarea { width: 100%; min-height: 58px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; resize: vertical; }
.review-approve-button,
.review-reject-button { min-height: 36px; border: 0; border-radius: 8px; font-weight: 800; cursor: pointer; }
.review-approve-button { color: #fff; background: var(--blue); }
.review-reject-button { color: #a12626; background: #ffeded; }
.review-status { width: max-content; padding: 5px 9px; border-radius: 999px; color: #775b14; background: #fff4d8; font-size: 12px; font-weight: 800; }
.review-status.is-approved { color: #0f6b61; background: #e5f5f1; }
.review-status.is-rejected { color: #a12626; background: #ffeded; }
.review-waiting-copy { color: #8a5d1c; line-height: 1.55; }

@media (max-width: 900px) {
  .review-submission-row { grid-template-columns: 34px minmax(0, 1fr); }
  .review-submission-content,
  .review-submission-download,
  .review-submission-actions { grid-column: 2; }
}
.participant-file-choice input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.participant-note-field textarea {
  min-height: 76px;
  padding: 10px 12px;
  resize: vertical;
  border: 1px solid #cbd8ec;
  border-radius: 9px;
  color: var(--text);
  background: #fff;
  font: inherit;
  line-height: 1.5;
}
.participant-submit-action {
  min-width: 132px;
  min-height: 46px;
  padding: 10px 16px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: #2563eb;
  font-weight: 850;
  box-shadow: 0 7px 18px rgba(37, 99, 235, .18);
}
.participant-submit-action:hover:not(:disabled) { background: #1d4ed8; }

/* Access administration */
.admin-page { min-height: 100vh; }
.admin-shell { max-width: 1500px; margin: 0 auto; padding: 28px; }
.admin-topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 18px; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.9); box-shadow: var(--shadow); }
.admin-topbar h1 { margin: 0; font-size: 25px; }
.admin-topbar p { margin: 7px 0 0; color: var(--muted); }
.admin-top-actions { display: flex; align-items: center; gap: 10px; }
.admin-main { display: grid; grid-template-columns: minmax(360px,.72fr) minmax(680px,1.28fr); gap: 16px; }
.admin-main[hidden], .admin-blocked[hidden] { display: none; }
.admin-panel { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.admin-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.admin-panel-head h2 { margin: 0; font-size: 20px; }
.allowlist-list { min-width: 0; }
.audit-panel { grid-column: 1 / -1; }
.admin-form { display: grid; gap: 4px; }
.admin-picker-button { width: 100%; min-height: 48px; margin-top: 8px; border-style: dashed; }
.admin-selected-users { display: grid; gap: 4px; margin-top: 9px; padding: 11px 12px; border: 1px solid #d7e5e2; border-radius: 10px; color: #173f3c; background: #f5fbfa; line-height: 1.5; }
.admin-selected-users span { color: var(--muted); overflow-wrap: anywhere; }
.admin-selected-users.is-empty { color: var(--muted); background: #f8faf9; }
.admin-form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.admin-search { width: min(320px, 42vw); min-height: 40px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8faf9; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td { padding: 12px 10px; border-bottom: 1px solid #e9efee; text-align: left; white-space: nowrap; }
.admin-table th { color: var(--muted); font-size: 11px; }
.admin-table tr.is-disabled { color: #8d9899; background: #fafbfb; }
.admin-table code { padding: 4px 6px; border-radius: 6px; color: #44546f; background: #f1f4f7; font-family: Consolas, monospace; }
.role-badge, .access-state { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.role-badge { color: #315aa9; background: #e7efff; }
.access-state { color: #7b8586; background: #eef1f1; }
.access-state.is-active { color: var(--green); background: var(--green-soft); }
.table-action { padding: 7px 10px; font-size: 12px; }
.table-actions { display: flex; align-items: center; gap: 6px; }
.admin-audit-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.admin-audit-list article { padding: 13px; border: 1px solid #e4ebea; border-radius: 12px; background: #f8faf9; }
.admin-audit-list article > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.admin-audit-list article span, .admin-audit-list article p { color: var(--muted); font-size: 11px; }
.admin-audit-list article p { margin: 8px 0 0; }
.admin-blocked { display: grid; min-height: 55vh; place-items: center; align-content: center; padding: 30px; border: 1px solid var(--line); border-radius: 20px; background: #fff; text-align: center; box-shadow: var(--shadow); }
.admin-blocked h1 { margin: 0; }
.admin-blocked p { color: var(--muted); }

@media (max-width: 1100px) {
  .admin-main { grid-template-columns: 1fr; }
  .audit-panel { grid-column: auto; }
  .admin-audit-list { grid-template-columns: 1fr 1fr; }
}

/* Mobile layout: native page scrolling and pull-to-refresh stay unobstructed. */
@media (max-width: 720px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overscroll-behavior-y: auto;
    -webkit-text-size-adjust: 100%;
  }

  body { touch-action: pan-y; }

  .app-shell {
    padding: max(8px, env(safe-area-inset-top)) 8px max(20px, env(safe-area-inset-bottom));
  }

  .topbar {
    position: static;
    gap: 10px;
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 14px;
  }

  .brand { width: 100%; }
  .brand-icon { width: 38px; height: 38px; }
  .brand span { font-size: 10px; }
  .brand h1 { font-size: 19px; }

  .top-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .local-label,
  .user-chip {
    min-width: 0;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .role-preview-control,
  .top-actions > .primary {
    width: 100%;
    grid-column: 1 / -1;
  }

  .role-preview-control select { min-width: 0; font-size: 14px; }
  .top-actions .admin-link,
  .top-actions .sync { min-height: 44px; justify-content: center; }

  .status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .overview-label { grid-column: 1 / -1; }
  .status-chip { min-height: 58px; padding: 10px 12px; }

  .flow-panel,
  .items-panel,
  .timeline-panel { padding: 13px; border-radius: 12px; }

  .panel-heading { gap: 12px; margin-bottom: 16px; }
  .panel-heading h2 { font-size: 20px; }
  .panel-heading p { font-size: 13px; line-height: 1.65; }
  .project-list-heading,
  .project-list-tools { width: 100%; }
  .project-list-tools { align-items: stretch; }
  .project-list-tools .terminal-note { align-self: flex-start; }
  .project-filter { width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .project-filter-button { min-width: 0; min-height: 42px; padding: 7px 5px; font-size: 12px; }
  .project-filter-button b { min-width: 17px; padding-right: 4px; padding-left: 4px; }
  .item-meta { align-items: flex-start; }
  .item-meta-actions { flex-wrap: wrap; }
  .project-delete-button { min-height: 36px; padding: 7px 9px; }
  .queue-controls { width: 100%; grid-template-columns: 1fr auto; align-items: center; justify-items: start; }
  .queue-controls .project-delete-button { grid-column: 2; grid-row: 1 / span 2; justify-self: end; }
  .project-filter-empty { min-height: 96px; }

  .selected-summary {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .selected-summary > .current-stage-label,
  .selected-summary > .terminal-note {
    width: 100%;
    text-align: center;
  }

  .stage-editor { width: 100%; }
  .stage-editor-row { grid-template-columns: 1fr; }
  .stage-editor-select,
  .stage-save { min-height: 44px; font-size: 16px; }

  .selected-project-flow { overflow: visible; }
  .process-rail,
  .role-progress .process-rail {
    min-width: 0;
    grid-template-columns: 1fr;
    gap: 8px;
    overflow: visible;
    padding-bottom: 0;
  }

  .process-rail::before {
    top: 20px;
    right: auto;
    bottom: 20px;
    left: 19px;
    width: 2px;
    height: auto;
  }

  .process-step {
    display: grid;
    min-width: 0;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    text-align: left;
  }

  .step-circle {
    width: 40px;
    height: 40px;
    margin: 0;
    border-width: 3px;
    font-size: 14px;
  }

  .process-step strong { min-height: 0; font-size: 13px; }
  .process-step small { display: none; }
  .role-progress { overflow: visible; margin: 0 0 17px; padding: 0; }

  .selected-project-banner { gap: 14px; padding: 15px; }
  .selected-project-banner h2 { font-size: 18px; overflow-wrap: anywhere; }
  .selected-banner-side { min-width: 0; width: 100%; }

  .collaboration-head { flex-direction: column; gap: 8px; }
  .gate-badge { align-self: flex-start; }
  .participant-main { grid-template-columns: 36px minmax(0, 1fr); }
  .participant-status { grid-column: 1 / -1; justify-self: start; }

  .submission-list-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .submission-row {
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: start;
    gap: 9px 11px;
    padding: 13px;
  }
  .submission-file,
  .submission-download,
  .submission-pending-badge { grid-column: 2; }
  .submission-download,
  .submission-pending-badge { width: 100%; min-height: 44px; }
  .participant-submission-head { grid-template-columns: 42px minmax(0, 1fr); }
  .participant-submission-head .participant-download-action,
  .participant-submission-head .participant-read-state { grid-column: 1 / -1; width: 100%; }
  .participant-submission-form { grid-template-columns: 1fr; }
  .participant-file-choice > strong { min-height: 48px; overflow-wrap: anywhere; text-overflow: clip; white-space: normal; }
  .participant-note-field textarea { min-height: 96px; font-size: 16px; }
  .participant-submit-action { width: 100%; min-height: 48px; }

  .file-line { grid-template-columns: 1fr; }
  .file-button { min-height: 44px; }
  .file-line > span { white-space: normal; overflow-wrap: anywhere; }
  .dispatch-field select,
  .field input,
  .field select,
  .directory-search input,
  .admin-search { font-size: 16px; }

  .primary,
  .secondary,
  .dispatch-button,
  .gate-actions button,
  .participant-actions button { min-height: 44px; }

  .modal:not(.directory-dialog):not(.document-dialog) {
    width: calc(100% - 16px);
    max-height: calc(100dvh - 16px);
    margin: auto;
    padding: 18px 14px max(16px, env(safe-area-inset-bottom));
    overflow-y: auto;
    border-radius: 16px;
  }

  .modal-head { align-items: flex-start; gap: 10px; margin-bottom: 15px; }
  .modal-head h2 { font-size: 21px; }
  .modal-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .modal-actions button { width: 100%; }

  .directory-dialog { max-height: 94dvh; }
  .directory-dialog-shell {
    max-height: 94dvh;
    grid-template-rows: auto auto auto minmax(220px, 1fr) auto auto;
  }
  .directory-layout { grid-template-columns: 104px minmax(0, 1fr); }
  .document-dialog { max-height: 94dvh; }
  .document-dialog-shell { max-height: 94dvh; }
  .document-node { grid-template-columns: 40px minmax(0, 1fr) 24px; gap: 8px; padding: 8px; }
  .document-node-type { width: 40px; height: 38px; }

  .variant-switcher {
    position: static;
    right: auto;
    bottom: auto;
    left: auto;
    width: calc(100% - 16px);
    max-width: 420px;
    margin: 12px auto max(12px, env(safe-area-inset-bottom));
    transform: none;
  }

  footer { padding: 0 4px; font-size: 11px; }

  .role-view { padding: 16px 13px; }
  .role-view-head h2 { font-size: 22px; overflow-wrap: anywhere; }
  .role-empty-state { min-height: 58vh; padding: 36px 18px; }
  .role-empty-state h2 { font-size: 24px; }
  .boss-selector-row { gap: 12px; margin-bottom: 17px; padding-bottom: 15px; }
  .boss-selector-row select { min-height: 48px; font-size: 16px; }

  .admin-shell { padding: max(8px, env(safe-area-inset-top)) 8px max(16px, env(safe-area-inset-bottom)); }
  .admin-topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 12px;
    padding: 16px;
    border-radius: 14px;
  }
  .admin-topbar h1 { font-size: 23px; line-height: 1.35; }
  .admin-topbar p { font-size: 13px; line-height: 1.65; }
  .admin-top-actions {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }
  .admin-top-actions .user-chip {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }
  .admin-panel { padding: 15px; border-radius: 14px; }
  .admin-panel-head { flex-direction: column; gap: 8px; margin-bottom: 14px; }
  .admin-panel-head h2 { font-size: 19px; }
  .admin-panel-head .terminal-note { align-self: flex-start; }
  .admin-form-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .admin-form-actions button { width: 100%; }
  .admin-search { width: 100%; min-height: 44px; }
  .admin-table-wrap { margin: 0 -15px; padding: 0 15px; }
  .admin-table { min-width: 760px; }
  .admin-audit-list { grid-template-columns: 1fr; }
}

/* 2026-08 visual refinement: calm blue-gray workspace with semantic success green. */
:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #66758c;
  --line: #dbe4f0;
  --green: #2563eb;
  --green-2: #3b82f6;
  --green-soft: #eaf2ff;
  --blue: #2563eb;
  --success: #15826d;
  --success-soft: #e8f6f2;
  --shadow: 0 1px 2px rgba(23, 32, 51, .04), 0 12px 30px rgba(36, 55, 91, .075);
}

body {
  background:
    radial-gradient(circle at 8% -8%, rgba(67, 123, 255, .13), transparent 30rem),
    linear-gradient(180deg, #eef3fb 0, #f6f8fc 300px, #f4f7fb 100%);
}

.topbar {
  border-color: rgba(214, 224, 238, .92);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 1px 2px rgba(23, 32, 51, .04), 0 10px 28px rgba(36, 55, 91, .065);
}

.brand-icon,
.participant-attachment-icon,
.participant-download-action,
.danger-confirm {
  background: linear-gradient(145deg, #1d4ed8, #2563eb);
  box-shadow: 0 7px 18px rgba(37, 99, 235, .2);
}

.brand span,
.local-label,
.mini-label,
.project-edit-button,
.attachment-download-link,
.anomaly-count {
  color: #2458c6;
}

.local-label,
.anomaly-count { background: #edf4ff; }

.project-edit-button,
.attachment-download-link {
  border-color: #c8d8f5;
  background: #f7faff;
}

.project-edit-button:hover,
.attachment-download-link:hover {
  border-color: #8fb1ef;
  background: #edf4ff;
}

.primary:hover,
.dispatch-button:hover:not(:disabled),
.advance-button:hover:not(:disabled) { background: #1d4ed8; }

.flow-panel,
.items-panel,
.timeline-panel,
.column-stage,
.role-view,
.todo-anomaly-center {
  border-color: #dce5f0;
  box-shadow: var(--shadow);
}

.item-card {
  border-color: #dfe6ef;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(23, 32, 51, .025);
}

.item-card:hover {
  border-color: #bdd0ee;
  box-shadow: 0 10px 24px rgba(36, 55, 91, .09);
}

.item-card.selected {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1), 0 10px 24px rgba(36, 55, 91, .08);
}

.selected-project-banner {
  background: linear-gradient(115deg, #172554 0%, #1e3a8a 58%, #2563eb 100%);
  box-shadow: 0 14px 32px rgba(30, 58, 138, .2);
}

.collaboration-panel {
  border-color: #cfdbef;
  background: linear-gradient(145deg, #fbfcff, #f4f7fd);
}

.dispatch-step {
  border-color: #dbe4f0;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 1px 2px rgba(23, 32, 51, .035);
}

.process-rail::before { background: #d9e2ef; }
.process-step.future .step-circle {
  color: #8795aa;
  border-color: #d8e1ec;
  background: #f2f5f9;
}

.process-step.completed .step-circle,
.participant-card.confirmed .role-avatar {
  background: var(--success);
  box-shadow: 0 7px 18px rgba(21, 130, 109, .17);
}

.process-step.completed strong,
.participant-status.confirmed,
.role-status-badge.is-complete { color: var(--success); }

.participant-status.confirmed,
.role-status-badge.is-complete { background: var(--success-soft); }

.sync i {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(21, 130, 109, .1);
}

.gate-badge.ready { color: #0f6e5b; background: var(--success-soft); }

.participant-attachment-card {
  border-color: #cfdbef;
  background: #f7faff;
}

.attachment-file-status.has-file,
.admin-selected-users {
  border-color: #c9daf3;
  color: #213f75;
  background: #f5f8ff;
}

.project-filter {
  border-color: #d7e1ee;
  background: #f3f6fa;
}

.project-filter-button.selected {
  box-shadow: 0 3px 8px rgba(37, 99, 235, .2);
}

.selected-recipient-chip {
  border-color: #ccdaee;
  color: #29446f;
  background: #f5f8ff;
}

/* Step 4 commercial review */
.commercial-review-editor,
.commercial-review-summary {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid #cbd9ee;
  border-radius: 16px;
  background: linear-gradient(145deg, #ffffff 0%, #f5f8fe 100%);
  box-shadow: 0 8px 24px rgba(32, 55, 96, .06);
}

.commercial-review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.commercial-review-head h3,
.commercial-review-head h4 { margin: 3px 0 0; color: #17233a; }
.commercial-review-head small { color: #71809a; line-height: 1.5; }

.commercial-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.commercial-field { display: grid; min-width: 0; gap: 7px; }
.commercial-field.is-wide { grid-column: 1 / -1; }
.commercial-field > span { color: #52627a; font-size: 13px; font-weight: 800; }
.commercial-field input,
.commercial-field textarea {
  width: 100%;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid #cbd8ec;
  border-radius: 10px;
  color: #17233a;
  background: #fff;
  font: inherit;
  line-height: 1.55;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.commercial-field textarea { resize: vertical; }
.commercial-field input:focus,
.commercial-field textarea:focus {
  border-color: #5685df;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}
.commercial-field input:disabled,
.commercial-field textarea:disabled { color: #66758c; background: #eef2f7; }

.commercial-review-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
}
.commercial-review-actions small { color: #71809a; line-height: 1.55; }
.commercial-save-button {
  min-width: 170px;
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: #2563eb;
  font-weight: 850;
  box-shadow: 0 7px 18px rgba(37, 99, 235, .2);
  cursor: pointer;
}
.commercial-save-button:hover:not(:disabled) { background: #1d4ed8; }
.commercial-save-button:disabled { cursor: wait; opacity: .68; }

.commercial-review-summary { margin-bottom: 18px; }

/* Dedicated workflow workspaces: boss approval, output record and progress. */
.boss-source-strip,
.progress-settings-row,
.stage-primary-actions,
.outcome-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
}
.boss-source-strip {
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid #dbe5f4;
  border-radius: 14px;
  background: #f7f9fd;
}
.boss-source-strip span,
.progress-settings-row span,
.output-record-field > span,
.progress-report-field > span { color: var(--muted); font-size: 13px; font-weight: 700; }
.boss-approval-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.boss-approval-card {
  padding: 16px;
  border: 1px solid #dbe5f4;
  border-radius: 16px;
  background: #fff;
}
.boss-approval-card.is-approved { border-color: #bfd7ff; background: #f5f8ff; }
.boss-approval-card-head { display: flex; align-items: center; gap: 12px; }
.boss-approval-card-head > div { display: grid; gap: 3px; flex: 1; }
.boss-approval-card-head small { color: var(--muted); }
.boss-opinion-copy { margin: 14px 0 0; min-height: 48px; color: #384861; white-space: pre-wrap; }
.boss-disposition { margin-top: 18px; padding: 18px; border: 1px solid #dbe5f4; border-radius: 16px; background: #f8faff; }
.boss-disposition:not(.is-ready) { opacity: .72; }
.boss-rework-list { display: grid; gap: 10px; margin: 14px 0; }
.boss-rework-row { display: grid; grid-template-columns: minmax(150px, .7fr) minmax(260px, 1.5fr) auto; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; background: #fff; }
.boss-rework-row > div { display: grid; gap: 4px; }
.boss-rework-row small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.boss-rework-row textarea,
.boss-opinion-field textarea,
.output-record-field textarea,
.progress-report-field textarea { width: 100%; resize: vertical; }
.output-record-field,
.progress-report-field,
.boss-opinion-field { display: grid; gap: 9px; }
.stage-primary-actions { margin-top: 14px; justify-content: flex-end; }
.progress-settings-row { justify-content: flex-start; margin: 16px 0; padding: 15px; border-radius: 14px; background: #f7f9fd; }
.progress-settings-row label { display: flex; align-items: center; gap: 12px; }
.progress-settings-row input { min-height: 44px; }
.progress-submitters { display: grid; gap: 10px; }
.progress-submitter-row { display: grid; grid-template-columns: minmax(170px, .5fr) 1.5fr; gap: 16px; padding: 14px 16px; border: 1px solid #e1e7f0; border-radius: 14px; background: #fff; }
.progress-submitter-row.is-complete { border-color: #bfd7ff; background: #f6f9ff; }
.progress-submitter-row > div { display: grid; gap: 4px; }
.progress-submitter-row small { color: var(--muted); }
.progress-submitter-row p { margin: 0; white-space: pre-wrap; }
.outcome-actions { margin-top: 18px; justify-content: flex-end; }
.outcome-actions span { margin-right: auto; color: var(--muted); }
.boss-opinion-panel { display: grid; gap: 16px; align-items: stretch; }
.boss-review-context p strong { color: var(--ink); }
.progress-report-view .progress-report-field { margin-top: 22px; }
.progress-report-view .participant-submit-action { margin-top: 14px; width: 100%; }

@media (max-width: 760px) {
  .boss-approval-grid { grid-template-columns: 1fr; }
  .boss-rework-row,
  .progress-submitter-row { grid-template-columns: 1fr; }
  .boss-source-strip,
  .progress-settings-row,
  .stage-primary-actions,
  .outcome-actions { align-items: stretch; flex-direction: column; }
  .progress-settings-row label { align-items: stretch; flex-direction: column; }
  .stage-primary-actions button,
  .outcome-actions button { width: 100%; }
}
.commercial-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.commercial-summary-grid > div {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 13px 14px;
  border: 1px solid #dce5f2;
  border-radius: 11px;
  background: rgba(255, 255, 255, .88);
}
.commercial-summary-grid span { color: #71809a; font-size: 12px; font-weight: 750; }
.commercial-summary-grid strong { overflow-wrap: anywhere; white-space: pre-wrap; }

@media screen and (max-width: 720px) {
  .commercial-review-editor,
  .commercial-review-summary { padding: 15px; border-radius: 13px; }
  .commercial-review-head,
  .commercial-review-actions { align-items: stretch; flex-direction: column; }
  .commercial-review-grid,
  .commercial-summary-grid { grid-template-columns: 1fr; }
  .commercial-field.is-wide { grid-column: auto; }
  .commercial-save-button { width: 100%; }
  .submission-source-dialog {
    width: 100%;
    max-width: none;
    margin: auto 0 0;
    border-radius: 18px 18px 0 0;
  }
  .submission-source-options { grid-template-columns: 1fr; }
  .submission-source-option { grid-template-columns: 48px minmax(0, 1fr); align-items: center; }
  .submission-source-option small { grid-column: 2; }
}
