/* Task-first working surfaces. Loaded after the original presentation styles. */
:root {
  --ink: #24352c;
  --muted: #58685f;
  --line: #e0e7e2;
  --green: #276348;
  --red: #a63732;
  --amber: #7d591f;
  --blue: #355e7c;
  --work-soft: #f5f8f5;
}

body { font-size: 14px; line-height: 1.5; }
.content { padding-top: 26px; }
.page-heading { align-items: center; margin-bottom: 22px; }
.page-heading h1 { font-size: 28px; letter-spacing: -.8px; }
.page-heading p { font-size: 14px; color: var(--muted); line-height: 1.55; }
.eyebrow, .section-kicker { font-size: 11px; color: #45614f; }
.small, .tiny { font-size: 12px; line-height: 1.5; }
.muted { color: var(--muted); }
.btn { min-height: 40px; padding: 9px 14px; font-size: 13px; line-height: 1.4; border-radius: 7px; }
.btn-small { min-height: 40px; padding: 8px 12px; font-size: 12px; }
.btn-primary { color: #fff; }
.icon-btn { width: 40px; height: 40px; color: #53665a; }
.badge { font-size: 12px; padding: 5px 7px; line-height: 1.25; }
.badge.gray { color: #536159; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible {
  outline: 3px solid #285d45;
  outline-offset: 3px;
}
.nav button { min-height: 42px; font-size: 14px; color: #54645a; }
.nav-label { font-size: 11px; color: #617066; }
.nav-count { font-size: 12px; color: #425b49; }
.brand-sub, .workspace-switch .workspace-caption, .profile small,
.prototype-tag, .page-footer, .breadcrumb, .search-button { font-size: 12px; color: #596960; }
.guide-link { font-size: 13px; color: #53665a; }
.sidebar-bottom { padding-top: 12px; }
.prototype-tag { margin: 8px 14px 12px; line-height: 1.45; }
.profile { padding-top: 12px; flex-wrap: wrap; }
.role-picker { display: grid; gap: 6px; width: 100%; min-width: 0; margin-top: 8px; }
.role-picker label, .role-picker > span { color: #58685f; font-size: 12px; }
.role-picker select {
  min-width: 0; width: 100%; min-height: 40px;
  border: 1px solid #c9d5cc; border-radius: 7px;
  padding: 8px 10px; background: #fff; color: var(--ink); font-size: 13px;
}

/* Keep the actionable columns within the workspace width. */
.work-list, .fabric-work-list { width: 100%; min-width: 0; }
.work-list-head, .work-list-header, .work-heading, .work-row {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.45fr) minmax(0, .85fr) minmax(100px, .55fr);
  column-gap: 20px;
  align-items: center;
}
.work-list-head, .work-list-header, .work-heading {
  padding: 13px 20px;
  background: #f5f8f5;
  color: #52645a;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1px;
}
.work-row {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  font-size: 14px;
  line-height: 1.45;
}
.work-row:last-child { border-bottom: 0; }
.work-row:hover { background: #fcfdfb; }
.work-row > *, .fabric-work-row > * { min-width: 0; }
.work-identity, .work-action, .work-deadline { overflow-wrap: anywhere; }
.work-identity button, .work-action button:not(.btn) {
  max-width: 100%; text-align: left; padding: 0;
  white-space: normal; line-height: 1.4; color: var(--ink);
}
.work-identity button:hover, .work-action button:not(.btn):hover { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.work-identity strong, .work-action strong, .work-deadline strong { display: block; font-size: 14px; font-weight: 650; line-height: 1.45; }
.work-style-name, .work-action-title { display: block; font-size: 14px; font-weight: 650; line-height: 1.45; }
.work-reference, .work-style-meta, .work-note, .work-progress, .work-date-label, .work-target {
  display: block; margin-top: 5px; font-size: 12px; line-height: 1.5; color: var(--muted);
}
.work-date-label { margin: 0 0 5px; }
.work-owner { display: flex; align-items: center; gap: 6px; margin-top: 6px; line-height: 1.5; }
.work-status { margin-top: 5px; font-size: 12px; color: #435f4b; }
.work-progress { font-size: 12px; }
.work-action-title { text-wrap: pretty; }
.work-reference-link { min-height: 34px; font-size: 12px; color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.work-empty { padding: 35px 24px; text-align: center; color: var(--muted); }
.work-empty h3 { color: var(--ink); font-size: 16px; }
.work-empty p { font-size: 14px; margin-top: 8px; }
.work-identity small, .work-action small, .work-deadline small,
.work-identity p, .work-action p, .work-deadline p {
  display: block; margin-top: 5px; font-size: 12px; line-height: 1.5; color: var(--muted);
}
.work-identity .garment { display: none; }
.work-action .badge { margin-top: 6px; }
.work-action .work-owner, .work-owner { color: #435c4b; font-size: 12px; }
.work-status { display: inline-flex; align-items: center; gap: 5px; }
.work-deadline .red-text { color: var(--red); }
.work-deadline .badge { margin-top: 6px; }
.work-controls { display: flex; flex-direction: column; align-items: stretch; gap: 7px; }
.work-controls .btn { width: 100%; white-space: normal; padding-left: 10px; padding-right: 10px; }
.work-controls .btn-ghost { min-height: 34px; font-size: 12px; }
.work-list-note { padding: 13px 20px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }

/* Fabric work remains visible as a dedicated queue, rather than a nested dialog. */
.fabric-work-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr) minmax(130px, .65fr);
  align-items: center; gap: 20px; padding: 20px;
  border-bottom: 1px solid var(--line); background: #fff;
}
.fabric-work-row:last-child { border-bottom: 0; }
.fabric-work-row strong { display: block; font-size: 14px; line-height: 1.45; }
.fabric-work-row small, .fabric-work-row p {
  display: block; font-size: 12px; color: var(--muted); line-height: 1.55; margin-top: 5px;
}
.fabric-work-row .btn { white-space: normal; width: 100%; }
.fabric-work-row button:not(.btn) { text-align: left; padding: 0; }
.fabric-work-identity { min-width: 0; overflow-wrap: anywhere; }
.fabric-work-controls { min-width: 0; }
.fabric-work-dates, .fabric-milestones { display: grid; gap: 8px; min-width: 0; margin-top: 12px; }
.fabric-work-dates { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fabric-work-dates > span { font-size: 12px; color: var(--muted); }
.fabric-work-dates strong { color: #385443; font-size: 13px; margin-top: 4px; }
.fabric-work-date, .fabric-milestone { font-size: 12px; line-height: 1.5; }
.fabric-work-date strong, .fabric-milestone strong { font-size: 13px; }

/* A single clear task gets its own short form. */
.modal-head { padding: 20px 24px 16px; gap: 14px; }
.modal-head h2 { font-size: 21px; line-height: 1.35; }
.modal-head p { font-size: 13px; color: var(--muted); line-height: 1.55; }
.modal-body { padding: 20px 24px; }
.modal-footer { position: sticky; bottom: 0; z-index: 1; padding: 14px 24px; background: #fff; }
.modal:has(.focused-form) { width: min(620px, 100%); }
.focused-form { min-width: 0; }
.focused-form .form-grid { gap: 18px; }
.task-summary {
  padding: 15px 17px; border: 1px solid #d9e5da; border-radius: 9px;
  background: #f2f7f2; color: #3b5544; margin-bottom: 20px;
}
.task-summary strong { display: block; font-size: 15px; line-height: 1.45; }
.task-summary p, .task-summary small { display: block; font-size: 13px; color: #53685a; line-height: 1.55; margin-top: 5px; }
.task-status-caption { padding: 10px 0 0; color: #52645a; font-size: 13px; line-height: 1.55; }
.quick-error, .form-error { color: #a02f2b; font-size: 13px; line-height: 1.6; }
.quick-error:not(:empty) { padding: 12px 14px; margin-top: 16px; background: #fff1ee; border: 1px solid #ecd0c8; border-radius: 7px; }
.field label { display: block; color: #354d3e; font-size: 13px; line-height: 1.4; margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%; min-width: 0; min-height: 42px; padding: 10px 11px;
  border-color: #c6d3c9; border-radius: 7px;
  font-size: 14px; line-height: 1.45; color: var(--ink); background: #fff;
}
.field textarea { min-height: 86px; resize: vertical; }
.field-help { color: #596b5f; font-size: 12px; line-height: 1.55; margin-top: 7px; }
.field input:read-only { color: #53665a; background: #f3f6f3; }
.field input::placeholder, .field textarea::placeholder { color: #68756c; opacity: 1; }
.field select:disabled { color: #53665a; opacity: 1; background: #f3f6f3; }

/* Full style context is secondary to the next update. */
.drawer-top { padding: 18px 24px 16px; }
.drawer-topline { margin-bottom: 12px; }
.drawer-topline > span { font-size: 11px; color: #596c60; }
.drawer-title { margin-bottom: 16px; }
.drawer-title h2 { font-size: 21px; line-height: 1.35; }
.drawer-title p { color: #596b60; font-size: 13px; }
.detail-identifiers { gap: 12px 18px; margin-top: 14px; }
.detail-identifiers label { font-size: 12px; color: #5a6b60; }
.detail-identifiers strong { font-size: 13px; }
.detail-tabs { margin-top: 15px; margin-bottom: -16px; }
.detail-tabs button { min-height: 44px; font-size: 13px; color: #56685c; }
.drawer-scroll { padding: 20px 24px; }
.drawer-footer { padding: 13px 24px; }
.drawer-footer p { font-size: 12px; color: #56685c; }
.detail-panel { padding: 20px; }
.detail-panel h3 { font-size: 16px; line-height: 1.45; }
.detail-alert { font-size: 14px; line-height: 1.5; color: #785b2a; }
.detail-alert small { font-size: 12px; color: inherit; line-height: 1.6; }
.detail-alert.green { color: #306342; }
.style-work-summary {
  padding: 18px 20px; border: 1px solid #d4e3d6; border-radius: 9px;
  background: #f1f7f1; margin-bottom: 18px; color: #354f3f;
}
.style-work-summary strong { display: block; font-size: 16px; line-height: 1.45; }
.style-work-summary p, .style-work-summary small { display: block; font-size: 13px; line-height: 1.6; color: #52695a; margin-top: 6px; }
.style-work-summary .btn { margin-top: 12px; }
.style-work-summary .flex { gap: 14px; flex-wrap: wrap; }
.readable-checklist { display: grid; margin-top: 14px; }
.checklist-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line);
  font-size: 14px; line-height: 1.45;
}
.checklist-row:last-child { border-bottom: 0; }
.checklist-row > :first-child { flex: 1; min-width: 0; }
.checklist-row strong { font-size: 14px; }
.checklist-row small { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.checklist-row .btn, .checklist-row button { flex-shrink: 0; }
.checklist-row button:not(.btn) { min-height: 40px; padding: 7px 9px; color: var(--green); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.checklist-row .badge { white-space: normal; text-align: center; }
.identity-editor summary, .planning-references summary { min-height: 40px; font-size: 14px; color: #3c5947; cursor: pointer; padding: 8px 0; }
.planning-references { margin-top: 16px; color: #586b5e; font-size: 13px; }
.planning-references p { font-size: 13px; line-height: 1.65; margin-top: 6px; }
.rule-label, .reference-date, .target-reference { color: #5a6d60; font-size: 12px; line-height: 1.6; }
.gate-name { font-size: 14px; }
.gate-name small { color: #566b5d; font-size: 12px; line-height: 1.5; }
.gate-row select { font-size: 14px; min-height: 40px; color: #354b3c; border-color: #c5d3c8; }
.task-metadata summary { min-height: 36px; font-size: 12px; color: #52685a; padding-top: 6px; }
.task-date-summary { font-size: 12px; color: #586c60; }
.task-date-summary strong { font-size: 13px; }
.deadline-grid label, .pp-date-grid label, .fabric-dates label { color: #516b58; font-size: 12px; }
.deadline-grid div { color: #3f5947; font-size: 14px; }
.pp-date-grid small, .fabric-dates small, .fabric-target small, .fabric-target > span { color: #536d5b; font-size: 12px; }
.fabric-handover-card .section-kicker { font-size: 11px; }
.pis-status > span { font-size: 14px; color: #715b2f; }
.pis-status p { font-size: 13px; color: #695f43; }
.history-line strong { font-size: 14px; }
.history-line small { font-size: 12px; }
.history-line p { font-size: 13px; color: #576b5e; }

/* Filters and queues use the same readable control scale. */
.view-tabs { gap: 20px; margin-bottom: 18px; }
.view-tabs button { min-height: 44px; font-size: 13px; color: #58685e; }
.filterbar { padding: 14px 18px; gap: 10px; }
.field-filter { min-height: 40px; color: #586e60; border-color: #d3ddd5; }
.field-filter select, .field-filter input { font-size: 13px; color: #405446; }
.field-filter input::placeholder { color: #68756c; }
.field-filter:focus-within { outline: 2px solid #285d45; outline-offset: 2px; }
.date-filter { color: #52665a; font-size: 12px; }
.date-filter input { min-height: 40px; font-size: 13px; }
.filterbar .result-count { font-size: 12px; color: #53675b; }
.panel-head p, .panel-footer { color: #596b60; font-size: 12px; }
.panel-footer { gap: 12px; flex-wrap: wrap; }
.queue-tools .small { color: #566b5d; }
.task-row .task-title, .followup-list .task-title { font-size: 14px; line-height: 1.45; }
.task-sub, .task-note, .task-sub .brand-name, .followup-list .task-sub, .followup-list .task-note { font-size: 12px; color: #586b60; line-height: 1.5; }
.task-due, .task-due small { font-size: 12px; }
.task-due small { color: #596a60; }
.queue-tab { min-height: 40px; font-size: 13px; color: #55695d; }
.empty p { font-size: 14px; }
.inline-notice { font-size: 13px; color: #5b613d; }
.toast { font-size: 14px; line-height: 1.45; }

@media (max-width: 1150px) and (min-width: 761px) {
  .work-list-head, .work-list-header, .work-heading, .work-row { column-gap: 14px; padding-left: 16px; padding-right: 16px; }
  .work-controls .btn { padding-left: 7px; padding-right: 7px; }
  .fabric-work-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(110px, .65fr); gap: 14px; }
  .fabric-work-dates { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .fabric-work-dates > span { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
  .fabric-work-dates strong { margin: 0; }
}

@media (max-width: 900px) and (min-width: 761px) {
  .work-list-head, .work-list-header, .work-heading { display: none; }
  .work-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 18px; }
  .work-identity { grid-column: 1; grid-row: 1; }
  .work-deadline { grid-column: 2; grid-row: 1; text-align: right; }
  .work-action { grid-column: 1; grid-row: 2; }
  .work-controls { grid-column: 2; grid-row: 2; align-self: end; max-width: 160px; justify-self: end; width: 100%; }
}

@media (max-width: 760px) {
  .content { padding: 22px 16px; }
  .page-heading { gap: 16px; }
  .page-heading h1 { font-size: 26px; }
  .page-heading p { font-size: 14px; }
  .header-actions { justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
  .btn, .btn-small, .icon-btn { min-height: 44px; font-size: 13px; }
  .icon-btn { width: 44px; }
  .view-tabs { gap: 18px; }
  .view-tabs button { min-height: 44px; font-size: 13px; }
  .nav button { min-height: 44px; font-size: 14px; }
  .role-picker select { min-height: 44px; font-size: 16px; }
  .work-list-head, .work-list-header, .work-heading { display: none; }
  .work-list { padding: 0; }
  .work-row { grid-template-columns: minmax(0, 1fr); gap: 13px; padding: 19px 17px; }
  .work-row > * { grid-column: auto; grid-row: auto; text-align: left; }
  .work-identity strong { font-size: 16px; }
  .work-style-name { font-size: 16px; }
  .work-reference, .work-style-meta, .work-note, .work-date-label, .work-target { font-size: 13px; }
  .work-identity small, .work-action small, .work-deadline small { font-size: 13px; }
  .work-action { padding-top: 11px; border-top: 1px solid #e6ece7; }
  .work-action strong { font-size: 15px; }
  .work-deadline { padding: 10px 12px; border-radius: 7px; background: #f4f7f3; }
  .work-deadline strong { font-size: 14px; }
  .work-controls { flex-direction: row; flex-wrap: wrap; gap: 8px; width: 100%; max-width: none; }
  .work-controls .btn { flex: 1; width: auto; min-width: 0; min-height: 44px; }
  .work-controls .btn-ghost { flex: 0 1 auto; min-height: 44px; }
  .work-reference-link { min-height: 44px; padding: 8px 11px; font-size: 13px; }
  .fabric-work-row { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 19px 17px; }
  .fabric-work-row > * { grid-column: auto; grid-row: auto; }
  .fabric-work-row strong { font-size: 16px; }
  .fabric-work-row small, .fabric-work-row p { font-size: 13px; }
  .fabric-work-dates, .fabric-milestones { grid-template-columns: minmax(0, 1fr); padding: 12px; background: #f4f7f3; border-radius: 7px; }
  .fabric-work-dates > span { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
  .fabric-work-dates strong { font-size: 13px; text-align: right; margin: 0; }
  .fabric-work-row .btn { min-height: 44px; }
  .modal { max-height: calc(100dvh - 24px); }
  .overlay.center { padding: 12px; }
  .modal-head, .modal-body { padding: 18px; }
  .modal-head { gap: 10px; }
  .modal-head h2 { font-size: 20px; }
  .modal-head p { font-size: 13px; }
  .modal-footer { padding: 13px 18px; flex-wrap: wrap; }
  .modal-footer .btn { flex: 1; white-space: normal; }
  .focused-form .form-grid, .form-grid { grid-template-columns: minmax(0, 1fr); gap: 17px; }
  .field.wide, .form-grid > .wide { grid-column: 1; }
  .field input, .field select, .field textarea, .field-filter input, .field-filter select,
  .date-filter input, .gate-row select, .search-modal-input { font-size: 16px; min-height: 44px; }
  .field label { font-size: 13px; }
  .field-help { font-size: 12px; }
  .field-filter { min-height: 44px; min-width: 0; max-width: 100%; }
  .field-filter input { width: 100%; }
  .field-filter select { max-width: 100%; }
  .filterbar { padding: 13px 16px; gap: 9px; }
  .filterbar .field-filter:has(input) { flex: 1 1 100%; }
  .filterbar .field-filter:has(select) { flex: 1 1 calc(50% - 9px); }
  .filterbar .field-filter select { width: 100%; }
  .filterbar .result-count { font-size: 12px; margin-left: 0; }
  .date-filter { flex: 1 1 100%; font-size: 13px; justify-content: space-between; }
  .date-filter input { max-width: 190px; }
  .drawer-top { padding: 14px 17px 12px; }
  .drawer-topline { margin-bottom: 6px; }
  .drawer-title { margin-bottom: 10px; gap: 9px; }
  .drawer-title .garment { display: none; }
  .drawer-title h2 { font-size: 19px; }
  .drawer-title p { font-size: 12px; }
  .drawer-title > div { min-width: 0; }
  .drawer-title > span { flex-shrink: 0; }
  .detail-identifiers { gap: 10px 12px; margin-top: 10px; }
  .detail-identifiers strong { overflow-wrap: anywhere; font-size: 13px; }
  .detail-tabs { margin-top: 10px; margin-bottom: -12px; }
  .detail-tabs button { min-height: 44px; font-size: 13px; }
  .drawer-scroll { padding: 17px; }
  .drawer-footer { padding: 12px 17px; align-items: center; }
  .drawer-footer p { font-size: 12px; max-width: 125px; }
  .detail-panel { padding: 17px; }
  .style-work-summary { padding: 16px; }
  .style-work-summary .btn { width: 100%; white-space: normal; }
  .checklist-row { gap: 10px; flex-wrap: wrap; }
  .checklist-row > :first-child { flex-basis: 55%; }
  .checklist-row .badge { font-size: 12px; }
  .checklist-row button:not(.btn) { min-height: 44px; }
  .deadline-grid, .pp-date-grid, .fabric-dates { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .fabric-dates strong { font-size: 17px; }
  .fabric-dates label { font-size: 12px; }
  .fabric-dates small { font-size: 12px; }
  .task-date-summary { grid-template-columns: minmax(0, 1fr); font-size: 12px; }
  .task-date-summary strong { font-size: 13px; }
  .task-title, .followup-list .task-title { font-size: 14px; }
  .task-sub, .task-note, .followup-list .task-sub, .followup-list .task-note { font-size: 12px; }
  .task-due, .task-due small { font-size: 12px; }
  .task-meta .btn { display: inline-flex; }
  .toast { max-width: calc(100vw - 24px); font-size: 13px; white-space: normal; }
  .page-footer { flex-wrap: wrap; font-size: 12px; line-height: 1.5; }
}

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

/* A failed local save and unsaved drafts must be visible and recoverable. */
.storage-banner { padding: 16px 20px; margin-bottom: 20px; border: 1px solid #e5b9ab; border-radius: 10px; background: #fff1ec; color: #823c2e; line-height: 1.6; }
.storage-banner p { margin: 5px 0 12px; font-size: 13px; }
.draft-confirm-backdrop { position: fixed; inset: 0; display: grid; place-items: center; z-index: 150; padding: 20px; background: rgba(26,42,33,.48); }
.draft-confirm-backdrop .modal { width: min(560px,100%); }
.draft-confirm-backdrop .modal-footer { flex-wrap: wrap; }
.draft-confirm-backdrop .modal-footer .btn { white-space: normal; }
.advanced-fields { border-top: 1px solid #dce5de; margin-top: 12px; padding-top: 8px; }
.advanced-fields summary { min-height: 40px; padding: 10px 0; color: #385b43; cursor: pointer; font-size: 13px; font-weight: 600; }
.advanced-fields[open] summary { margin-bottom: 12px; }
.advanced-fields .form-grid { margin-bottom: 5px; }
.task-row { padding: 18px 20px; gap: 18px; }
.task-body { min-width: 0; flex: 1; }
.task-title { text-align: left; }
.task-sub { display: flex; flex-wrap: wrap; gap: 6px; }
.task-note { line-height: 1.55; margin-top: 7px; }
.task-meta { align-items: center; gap: 10px; }
.task-due { width: 160px; line-height: 1.5; font-size: 12px; white-space: normal; }
.sidebar { overflow-y: auto; }
.sidebar-bottom { margin-top: auto; }
.work-owner { font-weight: 550; }
[hidden] { display: none !important; }
@media (max-width: 760px) {
  .task-row { display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; padding: 18px 16px; }
  .task-meta { justify-content: space-between; flex-wrap: wrap; }
  .task-due { flex: 1; width: auto; min-width: 140px; }
  .task-meta .btn { min-width: 100px; }
  .draft-confirm-backdrop { padding: 12px; }
  .draft-confirm-backdrop .modal-footer { flex-direction: column; align-items: stretch; }
  .topbar .breadcrumb { min-width: 0; }
}
