:root {
  color-scheme: light;
  --ink: #14221b;
  --muted: #607168;
  --line: #d9e3de;
  --fill: #f6faf8;
  --brand: #0b6b43;
  --brand-dark: #064f31;
  --brand-soft: #e8f4ef;
  --accent: #d7a64a;
  --ok: #168a54;
  --warn: #9a5b00;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(11, 107, 67, 0.1) 0%, rgba(237, 243, 240, 0) 180px),
    #edf3f0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 18px 20px 28px;
}

.brandbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 2px 16px;
}

.logo {
  width: min(330px, 68vw);
  height: auto;
  display: block;
  mix-blend-mode: multiply;
}

.brand-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.codename {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0;
  white-space: nowrap;
}

.badge {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.titleband {
  text-align: center;
  padding: 22px 10px 24px;
}

.titleband.compact {
  padding-top: 16px;
}

.titleband p {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
}

h1 {
  position: relative;
  display: inline-block;
  margin: 0;
  font-size: clamp(34px, 7vw, 52px);
  line-height: 1.05;
  letter-spacing: 0;
  color: var(--brand-dark);
  font-weight: 760;
  max-width: 100%;
  overflow-wrap: anywhere;
}

h1::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -12px;
  width: 76px;
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
  transform: translateX(-50%);
}

.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 18px 44px rgba(10, 52, 35, 0.12);
}

form {
  display: grid;
  gap: 16px;
}

.module-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 8px;
}

.module-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  font-size: 14px;
}

.module-tabs a[hidden] {
  display: none;
}

.module-tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #c62828;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
}

.module-tabs a.active {
  color: white;
  border-color: var(--brand);
  background: var(--brand);
}

.grid {
  display: grid;
  gap: 14px;
}

.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 7px;
}

label span {
  color: var(--muted);
  font-size: 14px;
}

.field-tip {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.upload-list {
  display: grid;
  gap: 8px;
}

.upload-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
}

.upload-item span {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-item small {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.muted {
  margin: -8px 0 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--fill);
  font: inherit;
  outline: none;
}

input[readonly] {
  color: var(--muted);
  background: #eef4f1;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(11, 107, 67, 0.14);
}

button {
  height: 46px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, #0e7a4d 0%, var(--brand-dark) 100%);
  color: white;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

button:hover {
  background: linear-gradient(180deg, #0c6f46 0%, #043f27 100%);
}

button:disabled {
  background: #9fb8df;
  cursor: wait;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.resource-card {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--fill);
  padding: 13px 14px;
  display: grid;
  align-content: space-between;
}

.resource-card span {
  color: var(--muted);
  font-size: 13px;
}

.resource-card strong {
  color: var(--brand-dark);
  font-size: 25px;
  line-height: 1.15;
  font-weight: 760;
}

.impact {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--muted);
  background: var(--brand-soft);
}

.impact.warn {
  color: #8a3f00;
  border-color: #e4bd7f;
  background: #fff5df;
}

.hidden {
  display: none !important;
}

.confirm-panel {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(11, 107, 67, 0.24);
  border-radius: 8px;
  background: #f3fbf7;
  padding: 14px;
}

.confirm-panel h2 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 18px;
  letter-spacing: 0;
}

.confirm-grid {
  display: grid;
  gap: 8px;
}

.confirm-grid p {
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
}

.confirm-grid span {
  color: var(--muted);
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.project-picker {
  display: grid;
  gap: 9px;
}

.project-results {
  display: grid;
  gap: 8px;
}

.project-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button.project-result {
  width: 100%;
  height: auto;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 11px;
  background: white;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}

button.project-result:hover {
  background: var(--brand-soft);
}

button.project-chip {
  width: auto;
  max-width: 100%;
  min-height: 36px;
  height: auto;
  border: 1px solid rgba(11, 107, 67, 0.28);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  overflow-wrap: anywhere;
}

.people-picker {
  display: grid;
  gap: 9px;
}

.people-results,
.people-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button.person-result,
button.person-chip {
  width: auto;
  min-height: 34px;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  background: white;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 600;
}

button.person-result:hover,
button.person-chip:hover {
  background: var(--brand-soft);
}

button.person-chip {
  border-color: rgba(11, 107, 67, 0.28);
  background: var(--brand-soft);
}

.external-labor-panel {
  display: grid;
  gap: 13px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.external-labor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.external-labor-head > div {
  display: grid;
  gap: 5px;
}

.field-label {
  color: var(--muted);
  font-size: 14px;
}

.external-worker-picker {
  display: grid;
  gap: 9px;
}

.external-worker-results {
  display: grid;
  gap: 7px;
  max-height: 220px;
  overflow-y: auto;
}

button.external-worker-result {
  width: 100%;
  height: auto;
  min-height: 42px;
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 11px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

button.external-worker-result:hover {
  border-color: rgba(11, 107, 67, 0.42);
  background: var(--brand-soft);
}

button.external-worker-result:disabled {
  color: var(--muted);
  background: #eef4f1;
  cursor: default;
}

.external-worker-result strong {
  color: var(--brand-dark);
  font-size: 14px;
}

.external-worker-result small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.external-worker-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 22px;
}

button.external-worker-chip {
  width: auto;
  height: 34px;
  border: 1px solid rgba(11, 107, 67, 0.28);
  border-radius: 999px;
  padding: 0 11px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 650;
}

button.external-worker-chip:hover {
  background: #d8ede4;
}

.external-worker-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.external-labor-grid {
  align-items: end;
}

.external-worker-dialog {
  width: min(560px, calc(100% - 28px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(10, 52, 35, 0.24);
}

.external-worker-dialog::backdrop {
  background: rgba(20, 34, 27, 0.48);
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.dialog-head h2 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 20px;
  letter-spacing: 0;
}

.dialog-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

button.dialog-close {
  width: 36px;
  min-width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  padding: 0;
  background: #fff;
  color: var(--muted);
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
}

button.dialog-close:hover {
  background: var(--fill);
  color: var(--ink);
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.dialog-actions button {
  height: 42px;
}

.task-list-panel {
  margin-top: 16px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 20px;
  letter-spacing: 0;
}

.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

button.ghost,
.ghost-link {
  width: auto;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 13px;
  background: var(--fill);
  color: var(--brand-dark);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
}

button.ghost:hover,
.ghost-link:hover {
  background: var(--brand-soft);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  background: white;
  color: var(--brand-dark);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.button-link:hover {
  background: var(--brand-soft);
}

button.button-link {
  cursor: pointer;
  font-family: inherit;
}

button.button-link:disabled {
  cursor: wait;
  opacity: 0.7;
}

.button-link.warning-link {
  border-color: #e8b99d;
  background: #fffaf6;
  color: #8a3b14;
}

.button-link.warning-link:hover {
  background: #fff1e8;
}

.task-list {
  display: grid;
  gap: 10px;
}

.load-more {
  margin: 14px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.task-date-group {
  display: grid;
  gap: 10px;
}

.task-date-group + .task-date-group {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.task-date-group h3 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
}

.task-item {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--fill);
  padding: 13px 14px;
}

.task-item header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.task-item header strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.task-item header span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  padding: 4px 9px;
  font-size: 12px;
}

.task-meta,
.task-content,
.task-people,
.empty {
  margin: 0;
}

.task-meta,
.task-people,
.empty {
  color: var(--muted);
  font-size: 13px;
}

.task-content {
  color: var(--ink);
  line-height: 1.55;
}

.task-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-numbers span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  padding: 5px 10px;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 650;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--fill);
  padding: 5px;
  margin-bottom: 14px;
}

.segmented button {
  height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.segmented button.active {
  background: white;
  color: var(--brand-dark);
  box-shadow: 0 1px 5px rgba(10, 52, 35, 0.1);
}

.task-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.safety-detail-panel {
  margin-top: 16px;
}

.selected-task {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--fill);
  padding: 12px;
}

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

.selected-task-grid p {
  margin: 0;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.selected-task-grid span {
  color: var(--muted);
  font-size: 12px;
}

.selected-task-grid strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.hazard-fields {
  display: grid;
  gap: 16px;
}

.workflow-block {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 18px 0;
}

.workflow-block:first-child {
  border-top: 0;
  padding-top: 4px;
}

.workflow-block h3,
.workflow-action h3 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 18px;
  letter-spacing: 0;
}

.workflow-block h4 {
  margin: 2px 0 -4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
}

.workflow-grid {
  gap: 12px 18px;
}

.workflow-round {
  display: grid;
  gap: 13px;
  border-top: 1px dashed var(--line);
  padding-top: 15px;
}

.workflow-round:first-of-type {
  border-top-style: solid;
}

.workflow-round header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.workflow-round header strong {
  min-width: 0;
  color: var(--ink);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.workflow-round header span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  padding: 4px 9px;
  font-size: 12px;
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-list a {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--fill);
  padding: 7px 10px;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 650;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.attachment-list a:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.workflow-action {
  border-top: 2px solid var(--brand);
  padding-top: 18px;
  margin-top: 4px;
}

.workflow-action h3 {
  margin-bottom: 14px;
}

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

button.warning-button {
  background: #8b3434;
}

button.warning-button:hover {
  background: #6f2828;
}

.muted-panel {
  opacity: 0.62;
}

.message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  border-radius: 6px;
  line-height: 1.5;
}

.message.ok {
  color: var(--ok);
}

.message.warn {
  color: var(--warn);
  border: 1px solid #e4bd7f;
  background: #fff5df;
  padding: 10px 12px;
  font-weight: 650;
}

.message:empty {
  min-height: 0;
  border: 0;
  padding: 0;
  background: transparent;
}

.portal-shell {
  width: min(1120px, 100%);
}

.portal-brandbar {
  padding-bottom: 10px;
}

.portal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  align-items: stretch;
  padding: 24px 0 18px;
}

.portal-hero h1 {
  display: block;
  font-size: clamp(32px, 5vw, 48px);
}

.portal-hero h1::after {
  left: 0;
  transform: none;
}

.portal-hero p {
  max-width: 760px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.portal-status {
  display: grid;
  align-content: center;
  gap: 10px;
  border: 1px solid rgba(11, 107, 67, 0.18);
  border-radius: 8px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(232, 244, 239, 0.85));
}

.portal-status strong {
  color: var(--brand-dark);
  font-size: 22px;
}

.portal-status span,
.portal-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 16px;
}

button.portal-module {
  min-height: 94px;
  height: auto;
  display: grid;
  align-content: space-between;
  gap: 12px;
  border: 1px solid rgba(11, 107, 67, 0.2);
  border-radius: 8px;
  padding: 13px;
  background: linear-gradient(180deg, #e1f0e9 0%, #cfe5da 100%);
  color: var(--brand-dark);
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 8px 22px rgba(10, 52, 35, 0.07);
}

button.portal-module:hover {
  border-color: rgba(11, 107, 67, 0.36);
  background: linear-gradient(180deg, #e8f5ef 0%, #d8eadf 100%);
}

button.portal-module.active {
  border-color: var(--brand);
  background: linear-gradient(180deg, #0c7650 0%, var(--brand-dark) 100%);
  color: white;
  box-shadow: 0 14px 30px rgba(6, 79, 49, 0.22);
}

button.portal-module span {
  font-size: 16px;
  font-weight: 760;
}

button.portal-module strong {
  color: inherit;
  opacity: 0.76;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.portal-panel,
.portal-roadmap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 18px;
  box-shadow: 0 18px 44px rgba(10, 52, 35, 0.1);
}

.portal-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.portal-panel-head h2 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 24px;
}

.portal-panel-head p {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.portal-panel-head > span {
  flex: 0 0 auto;
  align-self: flex-start;
  border: 1px solid rgba(215, 166, 74, 0.38);
  border-radius: 999px;
  padding: 7px 11px;
  color: #7a4b04;
  background: #fff6df;
  font-size: 13px;
  white-space: nowrap;
}

.portal-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.portal-feature {
  min-height: 148px;
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--fill);
  color: var(--ink);
  text-decoration: none;
}

.portal-feature:hover {
  border-color: rgba(11, 107, 67, 0.34);
  background: var(--brand-soft);
}

.portal-feature strong {
  color: var(--brand-dark);
  font-size: 18px;
}

.portal-feature p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.portal-feature-state {
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  color: #72500b;
  background: #fff3d1;
  font-size: 12px;
  font-weight: 700;
}

.portal-feature-state.ready {
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.portal-feature-state.active {
  color: #1f5573;
  background: #e4f3fb;
}

.portal-roadmap {
  margin-top: 16px;
}

.portal-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.portal-steps li {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: var(--fill);
}

.portal-steps strong {
  display: block;
  margin-bottom: 8px;
  color: var(--brand-dark);
  font-size: 15px;
}

.portal-steps span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 680px) {
  .shell {
    padding: 14px;
  }

  .two {
    grid-template-columns: 1fr;
  }

  .resource-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brandbar {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 10px;
  }

  .brand-meta {
    width: 100%;
    justify-content: space-between;
  }

  .titleband {
    padding-top: 14px;
  }

  .panel {
    padding: 16px;
  }

  .confirm-actions {
    grid-template-columns: 1fr;
  }

  .task-item header {
    display: grid;
  }

  .selected-task-grid {
    grid-template-columns: 1fr;
  }

  .task-actions {
    justify-content: stretch;
  }

  .task-actions .button-link {
    width: 100%;
  }

  .section-head {
    align-items: flex-start;
  }

  .section-actions {
    justify-content: flex-end;
  }

  .external-labor-head {
    align-items: stretch;
    flex-direction: column;
  }

  .external-labor-head button {
    width: 100%;
  }

  .external-worker-dialog {
    padding: 16px;
  }

  .dialog-actions {
    grid-template-columns: 1fr;
  }

  .workflow-round header {
    align-items: flex-start;
  }

  .review-actions {
    grid-template-columns: 1fr;
  }

  .portal-hero,
  .portal-panel-head {
    grid-template-columns: 1fr;
    display: grid;
  }

  .portal-grid,
  .portal-feature-grid,
  .portal-steps {
    grid-template-columns: 1fr;
  }

  button.portal-module {
    min-height: 72px;
  }
}

@media (min-width: 681px) and (max-width: 980px) {
  .portal-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .portal-feature-grid,
  .portal-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.task-draft-shell {
  width: min(1480px, 100%);
}

.task-draft-titleband {
  padding: 14px 8px 22px;
}

.task-draft-titleband h1 {
  font-size: 32px;
  line-height: 1.15;
}

.task-draft-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.task-draft-filters {
  width: min(390px, 100%);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.task-draft-toolbar > button {
  min-width: 84px;
}

.task-draft-workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 620px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(10, 52, 35, 0.1);
}

.task-draft-batches {
  min-width: 0;
  border-right: 1px solid var(--line);
  background: #f5f8f6;
}

.task-draft-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.task-draft-pane-head h2,
.task-draft-detail-head h2,
.task-draft-card h3 {
  margin: 0;
  letter-spacing: 0;
}

.task-draft-pane-head h2 {
  font-size: 17px;
}

.task-draft-pane-head > span {
  color: var(--muted);
  font-size: 13px;
}

.task-draft-batch-list {
  display: grid;
  align-content: start;
  max-height: 760px;
  overflow: auto;
}

button.task-draft-batch-item {
  display: grid;
  gap: 7px;
  width: 100%;
  height: auto;
  min-height: 78px;
  padding: 13px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

button.task-draft-batch-item:hover,
button.task-draft-batch-item.active {
  background: #fff;
}

button.task-draft-batch-item.active {
  box-shadow: inset 4px 0 0 var(--brand);
}

button.task-draft-batch-item:disabled {
  color: var(--ink);
  cursor: wait;
  opacity: 0.72;
}

.task-draft-batch-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.task-draft-batch-item-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.task-draft-batch-item-meta,
.task-draft-batch-error {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.task-draft-batch-error {
  color: #9a3f2c;
}

.task-draft-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  flex: 0 0 auto;
  border: 1px solid #cbd8d1;
  border-radius: 999px;
  padding: 3px 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.task-draft-status.is-pending {
  border-color: #c7a557;
  background: #fff8e6;
  color: #76510a;
}

.task-draft-status.is-warning {
  border-color: #d9a99c;
  background: #fff1ed;
  color: #963b27;
}

.task-draft-status.is-done {
  border-color: #a7cdbb;
  background: #edf8f2;
  color: #0b6b43;
}

.task-draft-status.is-muted {
  background: #eff2f0;
  color: #6d7771;
}

.task-draft-detail {
  min-width: 0;
  padding: 18px;
}

.task-draft-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.task-draft-detail-head h2 {
  font-size: 20px;
}

.task-draft-detail-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.task-draft-detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.task-draft-detail-actions button {
  width: auto;
  height: 38px;
  padding: 0 13px;
  white-space: nowrap;
}

.task-draft-error-banner {
  margin: 14px 0 0;
  border: 1px solid #e1b0a5;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff1ed;
  color: #8f3523;
  font-size: 13px;
  line-height: 1.5;
}

.task-draft-detail-content {
  display: grid;
  grid-template-columns: minmax(260px, 36%) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding-top: 16px;
}

.task-draft-source-image {
  position: sticky;
  top: 14px;
  display: grid;
  gap: 8px;
  min-height: 220px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef2f0;
  padding: 8px;
}

.task-draft-source-image a {
  display: block;
  overflow: auto;
  max-height: 72vh;
  background: #fff;
}

.task-draft-source-image img {
  display: block;
  width: 100%;
  height: auto;
}

.task-draft-source-image figcaption {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.task-draft-source-image.is-error {
  align-content: center;
}

.task-draft-card-list {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.task-draft-card {
  display: grid;
  gap: 13px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  background: #fff;
}

.task-draft-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.task-draft-card-head > div {
  display: flex;
  align-items: baseline;
  min-width: 0;
  gap: 8px;
}

.task-draft-card h3 {
  min-width: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.task-draft-index {
  color: var(--brand);
  font-size: 13px;
  font-weight: 750;
}

.task-draft-field-grid,
.task-draft-source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px 16px;
  margin: 0;
}

.task-draft-field {
  display: grid;
  align-content: start;
  min-width: 0;
  gap: 3px;
}

.task-draft-field.wide {
  grid-column: 1 / -1;
}

.task-draft-field dt {
  color: var(--muted);
  font-size: 12px;
}

.task-draft-field dd {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.task-draft-warnings,
.task-draft-dialog-warnings {
  border-left: 3px solid #cf9b35;
  background: #fff9ea;
  padding: 9px 11px;
}

.task-draft-warnings ul,
.task-draft-dialog-warnings ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  color: #735116;
  font-size: 13px;
  line-height: 1.45;
}

.task-draft-warnings li.is-error,
.task-draft-dialog-warnings li.is-error {
  color: #9a3524;
}

.task-draft-source-details {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.task-draft-source-details summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
}

.task-draft-source-grid {
  margin-top: 12px;
  padding: 12px;
  background: #f7f9f8;
}

.task-draft-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.task-draft-card-actions button {
  width: auto;
  min-width: 92px;
  height: 40px;
  padding: 0 13px;
}

.task-draft-card-actions .task-draft-cancel {
  color: #963b27;
}

.task-draft-published {
  margin: 0;
  border-top: 1px solid var(--line);
  padding-top: 11px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.task-draft-empty-state {
  display: grid;
  min-height: 360px;
  place-items: center;
  color: var(--muted);
}

.task-draft-dialog {
  width: min(860px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(15, 35, 26, 0.28);
}

.task-draft-dialog::backdrop {
  background: rgba(16, 31, 24, 0.48);
}

.task-draft-number-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.task-draft-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1.25fr;
  gap: 10px;
  position: sticky;
  bottom: 0;
  border-top: 1px solid var(--line);
  margin: 0;
  padding: 14px 0 0;
  background: #fff;
}

@media (max-width: 980px) {
  .task-draft-workspace {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .task-draft-detail-content {
    grid-template-columns: 1fr;
  }

  .task-draft-source-image {
    position: static;
  }

  .task-draft-source-image a {
    max-height: 520px;
  }
}

@media (max-width: 680px) {
  .task-draft-toolbar {
    align-items: stretch;
  }

  .task-draft-toolbar > button {
    min-width: 68px;
  }

  .task-draft-workspace {
    display: block;
    min-height: 420px;
    overflow: visible;
  }

  .task-draft-batches {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .task-draft-batch-list {
    display: flex;
    max-height: none;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  button.task-draft-batch-item {
    width: min(78vw, 280px);
    min-width: min(78vw, 280px);
    border-right: 1px solid var(--line);
    border-bottom: 0;
    scroll-snap-align: start;
  }

  button.task-draft-batch-item.active {
    box-shadow: inset 0 -4px 0 var(--brand);
  }

  .task-draft-detail {
    padding: 14px;
  }

  .task-draft-detail-head,
  .task-draft-card-head {
    display: grid;
  }

  .task-draft-detail-actions {
    justify-content: flex-start;
  }

  .task-draft-detail-actions button {
    flex: 1 1 auto;
  }

  .task-draft-field-grid,
  .task-draft-source-grid,
  .task-draft-number-grid {
    grid-template-columns: 1fr;
  }

  .task-draft-field.wide {
    grid-column: auto;
  }

  .task-draft-card-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .task-draft-card-actions button {
    width: 100%;
  }

  .task-draft-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    padding: 16px;
  }

  .task-draft-dialog-actions {
    grid-template-columns: 1fr 1fr;
    padding-top: 12px;
  }

  .task-draft-dialog-actions #saveConfirmDraftBtn {
    grid-column: 1 / -1;
  }

  .task-draft-source-image a {
    max-height: none;
    overflow: visible;
  }
}
