/* public/workspace-shell.css */
.workspace-hub {
  padding: 28px 0 50px;
}
.workspace-hub h1 {
  font-size: clamp(28px, 4vw, 44px);
  margin: 10px 0;
}
.workspace-hub .section-head {
  gap: 20px;
}
.workspace-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin: 25px 0;
}
.workspace-stats > div {
  padding: 20px;
  background: #e9f0e9;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.workspace-stats b {
  display: block;
  font-size: 30px;
}
.workspace-stats span {
  font-size: 12px;
  color: var(--muted);
}
.workspace-subnav {
  margin: 20px 0;
}
.workspace-filters {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 14px;
  align-items: end;
}
.workspace-actions {
  margin: 18px 0;
}
.workspace-notice {
  color: #24583f;
  font-size: 14px;
  margin: 12px 0;
  white-space: pre-wrap;
}
.workspace-hub .report-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  margin: 10px 0;
  border-radius: 5px;
}
.workspace-hub .report-card > div:nth-child(2) {
  flex: 1;
}
.workspace-hub .report-card h3 {
  font-size: 17px;
  margin: 0 0 8px;
}
.workspace-hub .report-card p,
.workspace-hub .report-card small {
  font-size: 12px;
  color: var(--muted);
}
.workspace-hub .report-card .actions {
  margin-left: auto;
  flex-wrap: wrap;
}
.table-scroll {
  overflow: auto;
  margin: 25px 0;
}
.table-scroll table {
  width: 100%;
  border-collapse: collapse;
  min-width: 580px;
}
.table-scroll th,
.table-scroll td {
  border: 1px solid var(--line);
  padding: 14px;
  text-align: left;
  vertical-align: top;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}
.table-scroll .changed {
  background: #edf7ed;
}
.profile-logo {
  margin: 25px 0;
  padding: 20px;
  border: 1px solid var(--line);
}
.profile-logo img {
  max-height: 90px;
  max-width: 200px;
  object-fit: contain;
}
.report-details {
  padding: 20px 0;
  margin: 22px 0;
  border-block: 1px solid var(--line);
}
.report-details summary {
  font-weight: 600;
  cursor: pointer;
}
.report-details .fields {
  margin-top: 20px;
}
.plan-preview {
  max-width: 100%;
  max-height: 480px;
  object-fit: contain;
}
.signature-preview {
  max-width: 320px;
  max-height: 110px;
  object-fit: contain;
}
.findings-editor {
  margin: 30px 0;
}
.findings-editor > .micro {
  margin-bottom: 20px;
}
#signature-pad {
  display: block;
  border: 1px solid #9faea3;
  width: 100%;
  max-width: 640px;
  height: 180px;
  touch-action: none;
  background: #fff;
  margin: 20px 0;
}
.custom-report-sections {
  margin: 25px 0;
}
.workspace-navigation {
  flex-wrap: wrap;
}
.workspace-navigation button {
  font-size: 12px;
  padding: 10px;
}
.report-completion {
  padding: 13px 18px;
  background: #edf4ef;
  border-left: 3px solid var(--teal);
  font-size: 12px;
  margin: 20px 0;
}
.workspace-error {
  padding: 25px;
  border: 1px solid #d6ada3;
  background: #fff2ee;
}
.offline-banner {
  padding: 12px 20px;
  background: #fff0ce;
  font-size: 13px;
  text-align: center;
}
.core-extra {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 14px 0;
}
.condition-extra {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 14px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.module-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.action-suggestion {
  border: 1px solid var(--line);
  background: #eef4ed;
  padding: 18px;
  margin: 16px 0;
}
@media (max-width: 760px) {
  .workspace-filters {
    grid-template-columns: 1fr 1fr;
  }
  .workspace-hub .report-card {
    flex-wrap: wrap;
  }
  .workspace-hub .report-card .actions {
    flex-basis: 100%;
    margin-left: 0;
  }
  .workspace-stats {
    gap: 8px;
  }
  .workspace-stats > div {
    padding: 15px;
  }
  .core-extra,
  .condition-extra {
    grid-template-columns: 1fr;
  }
  .workspace-navigation {
    gap: 2px;
  }
  .workspace-navigation button {
    padding: 9px;
    font-size: 11px;
  }
  .workspace-hub .section-head {
    align-items: start;
  }
  .workspace-stats span {
    font-size: 10px;
  }
}
@media (max-width: 430px) {
  .workspace-filters {
    grid-template-columns: 1fr;
  }
  .workspace-stats b {
    font-size: 24px;
  }
  .workspace-hub .section-head {
    flex-direction: column;
  }
  .workspace-hub .report-card {
    padding: 15px;
  }
  .workspace-navigation {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  .workspace-navigation button {
    white-space: normal;
  }
  .workspace-actions button {
    font-size: 11px;
  }
}
@media print {
  .batch-report {
    break-after: page;
  }
  .batch-report:last-child {
    break-after: auto;
  }
  .report-details {
    border: 0;
  }
  .signature-preview {
    max-height: 80px;
  }
  .report-core {
    break-inside: avoid;
  }
}
@media screen {
  .report-completion {
    margin: 24px 0 0;
    padding: 12px 16px;
    border-left: 2px solid #86a795;
    background: #edf1ea;
    color: #466052;
    line-height: 1.6;
    border-radius: 0 6px 6px 0;
  }
  .editor-title {
    padding: 26px 0;
    align-items: flex-start;
  }
  .editor-title > div:first-child {
    min-width: 0;
  }
  .editor-title h1 {
    font-size: clamp(27px, 3.2vw, 38px);
    line-height: 1.17;
    letter-spacing: -1.2px;
    overflow-wrap: anywhere;
    margin: 12px 0;
  }
  .editor-title .kicker {
    color: #53715f;
    font-size: 10px;
    letter-spacing: 1.6px;
  }
  .editor-title .actions {
    padding-top: 6px;
  }
  .editor-title .actions button {
    min-height: 44px;
    font-size: 13px;
  }
  .save-status {
    display: inline-block;
    line-height: 1.5;
    color: #53655a;
  }
  .workspace {
    gap: 24px;
    grid-template-columns: 190px minmax(0, 1fr);
  }
  .workspace > aside {
    align-self: start;
    position: sticky;
    top: 24px;
  }
  .workspace .steps {
    gap: 6px;
  }
  .workspace .step {
    min-height: 48px;
    padding: 12px 13px;
    gap: 10px;
    border-radius: 6px;
    color: #56675c;
    font-size: 13px;
    text-align: left;
  }
  .workspace .step span {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    font-size: 11px;
    border-color: #a3b5a7;
    background: #fff;
  }
  .workspace .step.active {
    background: #213e32;
    border-color: #213e32;
    color: #fff;
    box-shadow: 0 3px 8px #1733260d;
  }
  .workspace .step.active span {
    color: #163b2e;
    background: #a7e3ce;
    border-color: #a7e3ce;
  }
  .workspace .step:hover:not(.active) {
    background: #e8eee5;
    border-color: #cbd9c9;
  }
  .workspace .side-note {
    font-size: 12px;
    margin: 23px 13px;
    line-height: 1.8;
  }
  .workspace .panel {
    padding: 30px;
    border-color: #d4ded1;
    border-radius: 9px;
    box-shadow: 0 6px 24px #263c2d05;
  }
  .workspace .panel-head {
    padding-bottom: 23px;
    margin-bottom: 26px;
  }
  .workspace .panel-head h2 {
    font-size: 25px;
    line-height: 1.2;
    letter-spacing: -.7px;
    margin-bottom: 10px;
  }
  .workspace .panel-head p {
    max-width: 660px;
    font-size: 14px;
    line-height: 1.7;
  }
  .workspace .fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 20px;
  }
  .workspace .field {
    min-width: 0;
    font-size: 13px;
    gap: 9px;
    line-height: 1.45;
  }
  .workspace input,
  .workspace select,
  .workspace textarea {
    font-size: 14px;
    border-color: #c8d4c5;
    border-radius: 5px;
    padding: 12px;
    min-height: 45px;
  }
  .workspace .check input {
    min-height: 18px;
    padding: 0;
  }
  .workspace .field small {
    font-size: 12px;
    line-height: 1.6;
  }
  .workspace :is(input, select, textarea):focus {
    border-color: #38785d;
    box-shadow: 0 0 0 2px #38785d12;
  }
  .workspace :is(button, input, select, textarea):focus-visible,
  .workspace-hub :is(button, input, select, textarea, summary):focus-visible {
    outline: 3px solid #30765a;
    outline-offset: 3px;
  }
  .workspace .step.active:focus-visible {
    outline-color: #163b2e;
    outline-offset: 4px;
  }
  .workspace .condition {
    padding: 22px;
    margin-top: 20px;
    border: 1px solid #d9e2d5;
    border-radius: 7px;
    background: #fcfdf9;
    grid-template-columns: minmax(0, 1fr) 170px;
    align-items: start;
  }
  .workspace .condition h3 {
    font-size: 17px;
    line-height: 1.4;
    margin: 8px 0;
  }
  .workspace .condition-extra {
    grid-column: 1/-1;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  }
  .workspace .core {
    background: #f4f7ef;
    border-radius: 7px;
    padding: 24px;
  }
  .workspace .core-top {
    gap: 16px;
    align-items: flex-start;
  }
  .workspace .core-top h3 {
    font-size: 19px;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }
  .workspace .layer {
    align-items: end;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, .7fr) minmax(0, 1fr) 40px;
    gap: 10px;
    margin-top: 18px;
  }
  .workspace .layer label {
    min-width: 0;
  }
  .workspace .layer button {
    min-height: 45px;
    font-size: 21px;
    color: #83554b;
  }
  .workspace .layer small {
    font-size: 12px;
    line-height: 1.4;
  }
  .workspace .core-extra {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .workspace .report-details {
    padding: 19px 20px;
    border: 1px solid #d8e1d3;
    border-radius: 7px;
    background: #f7f9f3;
  }
  .workspace .report-details summary {
    line-height: 1.5;
    font-size: 14px;
  }
  .workspace .report-details[open] {
    background: #fcfdf9;
  }
  .workspace .step-footer {
    padding-top: 23px;
    margin-top: 30px;
    align-items: center;
  }
  .workspace .step-footer button {
    min-height: 46px;
    padding: 12px 19px;
    font-size: 14px;
  }
  .workspace .step-footer .primary {
    background: #214a36;
    color: #fff;
    border-color: #214a36;
  }
  .workspace .step-footer .primary:hover {
    background: #163c29;
  }
  .workspace .photo-card {
    padding: 16px;
    border-radius: 7px;
    background: #fbfcf8;
  }
  .workspace-hub {
    padding-top: 12px;
  }
  .workspace-hub .section-head {
    align-items: start;
    margin-bottom: 24px;
  }
  .workspace-hub h1 {
    font-size: clamp(29px, 3.4vw, 41px);
    line-height: 1.15;
    letter-spacing: -1.3px;
    overflow-wrap: anywhere;
  }
  .workspace-hub .kicker {
    color: #5b7766;
    font-size: 10px;
    letter-spacing: 1.6px;
  }
  .workspace-hub .section-head .actions {
    padding-top: 8px;
  }
  .workspace-hub .section-head button {
    min-height: 44px;
    font-size: 13px;
  }
  .workspace-stats {
    gap: 12px;
    margin: 22px 0;
  }
  .workspace-stats > div {
    background: #fff;
    border-color: #d7e1d3;
    border-radius: 7px;
    padding: 17px 21px;
  }
  .workspace-stats b {
    font-size: 30px;
    line-height: 1.2;
    color: #28543e;
    font-variant-numeric: tabular-nums;
    margin-bottom: 5px;
  }
  .workspace-stats span {
    font-size: 12px;
    line-height: 1.4;
  }
  .workspace-subnav {
    gap: 4px;
    border-bottom: 1px solid #d4dfd0;
    padding-bottom: 13px;
    margin-bottom: 23px;
  }
  .workspace-subnav button {
    min-height: 42px;
    border-color: transparent;
    padding: 10px 16px;
    color: #4b6554;
  }
  .workspace-subnav button.active {
    background: #243f31;
    border-color: #243f31;
    color: white;
  }
  .workspace-hub .workspace-filters {
    gap: 13px;
    background: #eef2e9;
    border: 1px solid #dde5d7;
    padding: 18px;
    border-radius: 7px;
  }
  .workspace-hub .workspace-filters input,
  .workspace-hub .workspace-filters select {
    min-height: 44px;
    font-size: 14px;
  }
  .workspace-hub .workspace-actions {
    gap: 8px;
    padding: 2px 0;
  }
  .workspace-hub .workspace-actions button {
    min-height: 40px;
    font-size: 12px;
  }
  .workspace-hub .report-card {
    border-radius: 7px;
    border-color: #d7e1d3;
    padding: 22px;
    gap: 17px;
  }
  .workspace-hub .report-card > div:nth-child(2) {
    min-width: 0;
  }
  .workspace-hub .report-card h3 {
    font-size: 18px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }
  .workspace-hub .report-card p {
    font-size: 12px;
    line-height: 1.6;
    margin-bottom: 5px;
  }
  .workspace-hub .report-card small {
    line-height: 1.5;
    overflow-wrap: anywhere;
  }
  .workspace-hub .report-card [data-ws=open] {
    min-height: 44px;
    background: #edf4e9;
    border-color: #bfd1b9;
    color: #254c33;
    padding-inline: 21px;
  }
  .workspace-hub .report-card .check {
    padding: 10px 0;
    align-self: flex-start;
  }
  .workspace-hub .workspace-note {
    padding-top: 18px;
    border-top: 1px solid #dbe3d5;
    font-size: 12px;
    max-width: 950px;
  }
  .template-builder {
    padding: 27px;
    background: #fff;
    border: 1px solid #d5dfd0;
    border-radius: 8px;
    margin-bottom: 32px;
  }
  .template-builder h2,
  .saved-templates h2 {
    font-size: 23px;
    letter-spacing: -.6px;
    line-height: 1.3;
    margin-bottom: 10px;
  }
  .template-builder > p {
    font-size: 14px;
    line-height: 1.7;
    color: #5b6c5f;
    max-width: 760px;
    margin-bottom: 24px;
  }
  .template-builder .fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
  .template-builder .check {
    grid-column: 1/-1;
  }
  .template-builder [type=submit] {
    margin-top: 23px;
    min-height: 45px;
    font-size: 14px;
    background: #214a36;
    border-color: #214a36;
    color: #fff;
  }
  .template-builder :is(input, select, textarea) {
    font-size: 14px;
    min-height: 45px;
  }
  .template-builder .check input {
    min-height: 18px;
  }
  .saved-templates > .micro {
    font-size: 13px;
    margin-bottom: 20px;
  }
  .template-library {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
  .template-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 24px;
    border: 1px solid #d4dfd0;
    border-radius: 8px;
    background: #fff;
  }
  .template-card-heading {
    border-bottom: 1px solid #e0e7da;
    padding-bottom: 17px;
  }
  .template-type {
    font-size: 10px;
    line-height: 1.5;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: #47745b;
    display: block;
    margin-bottom: 11px;
  }
  .template-card h3 {
    font-size: 21px;
    line-height: 1.3;
    letter-spacing: -.4px;
    margin-bottom: 10px;
    overflow-wrap: anywhere;
  }
  .template-card-heading p {
    font-size: 12px;
    color: #657461;
    margin: 0;
  }
  .template-outline {
    list-style: decimal-leading-zero;
    margin: 19px 0 24px;
    padding-left: 26px;
    color: #55745f;
    font-size: 12px;
    flex: 1;
  }
  .template-outline li {
    padding: 5px 0 5px 4px;
    line-height: 1.65;
    overflow-wrap: anywhere;
  }
  .template-outline li > span {
    color: #344d3c;
    font-size: 13px;
  }
  .template-outline small {
    display: inline-block;
    color: #60745e;
    font-size: 10px;
    background: #eef3e8;
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 8px;
    vertical-align: 1px;
  }
  .template-card .actions {
    padding-top: 18px;
    border-top: 1px solid #e0e7da;
    justify-content: space-between;
  }
  .template-start {
    background: #edf4e9;
    color: #264f35;
    border-color: #bfd1b9;
    min-height: 44px;
    font-size: 13px;
  }
  .template-empty {
    background: #eef3e9;
    border: 1px dashed #c2d2bb;
    border-radius: 8px;
    padding: 30px;
  }
  .template-empty h3 {
    font-size: 22px;
    margin: 14px 0 10px;
    letter-spacing: -.4px;
  }
  .template-empty p {
    font-size: 14px;
    line-height: 1.75;
    max-width: 600px;
    margin: 0;
    color: #5a6c5c;
  }
}
@media screen and (max-width: 900px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
    gap: 17px;
  }
  .workspace > aside {
    position: static;
  }
  .workspace .steps {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    padding: 0;
  }
  .workspace .step {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    white-space: normal;
    font-size: 12px;
    padding: 11px 6px;
    gap: 7px;
    min-width: 0;
  }
  .workspace .step span {
    flex-basis: 24px;
  }
  .workspace .side-note {
    display: none;
  }
  .workspace-hub .workspace-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .workspace-hub .report-card .actions {
    flex-basis: 100%;
    margin-left: 0;
  }
  .workspace-hub .report-card {
    flex-wrap: wrap;
  }
}
@media screen and (max-width: 560px) {
  .editor-title {
    padding: 22px 0;
    gap: 15px;
  }
  .editor-title .actions {
    padding-top: 0;
    gap: 8px;
  }
  .editor-title .actions button {
    padding: 11px 12px;
    font-size: 12px;
  }
  .workspace .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }
  .workspace .step {
    min-height: 48px;
    flex-direction: row;
    justify-content: flex-start;
    font-size: 11px;
    line-height: 1.4;
    padding: 10px 8px;
    gap: 7px;
  }
  .workspace .panel {
    padding: 21px 17px;
    border-radius: 8px;
  }
  .workspace .panel-head {
    padding-bottom: 19px;
    margin-bottom: 22px;
  }
  .workspace .panel-head h2 {
    font-size: 23px;
  }
  .workspace .panel-head p {
    font-size: 13px;
    line-height: 1.7;
  }
  .workspace .fields,
  .workspace .core-extra,
  .workspace .condition-extra {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .workspace :is(input, select, textarea),
  .workspace-hub :is(input, select, textarea) {
    font-size: 16px;
  }
  .workspace .field {
    font-size: 13px;
  }
  .workspace .condition {
    padding: 17px 14px;
    grid-template-columns: minmax(0, 1fr);
    gap: 13px;
  }
  .workspace .condition h3 {
    font-size: 17px;
    margin: 0;
  }
  .workspace .core {
    padding: 18px 14px;
  }
  .workspace .core-top {
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
  }
  .workspace .layer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .workspace .layer label:first-child {
    grid-column: 1/-1;
  }
  .workspace .layer button {
    align-self: end;
  }
  .workspace .report-details {
    padding: 17px 14px;
  }
  .workspace .step-footer {
    gap: 10px;
  }
  .workspace .step-footer button {
    padding: 12px;
    font-size: 13px;
  }
  .workspace-hub .section-head {
    flex-direction: column;
    gap: 12px;
  }
  .workspace-hub .section-head .actions {
    padding: 0;
  }
  .workspace-stats {
    gap: 7px;
    margin-block: 20px;
  }
  .workspace-stats > div {
    padding: 14px 11px;
  }
  .workspace-stats b {
    font-size: 26px;
  }
  .workspace-stats span {
    font-size: 11px;
  }
  .workspace-hub .workspace-filters {
    padding: 16px;
    grid-template-columns: minmax(0, 1fr);
  }
  .workspace-hub .workspace-filters input,
  .workspace-hub .workspace-filters select {
    font-size: 16px;
  }
  .workspace-hub .report-card {
    padding: 18px 15px;
    gap: 13px;
  }
  .workspace-hub .report-card .actions {
    gap: 8px;
  }
  .workspace-hub .report-card .actions button {
    min-height: 44px;
  }
  .workspace-hub .workspace-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  .workspace-hub .workspace-actions button {
    min-height: 44px;
    padding: 10px;
    font-size: 11px;
  }
  .workspace-hub .workspace-actions .micro {
    grid-column: 1/-1;
  }
  .workspace-subnav {
    gap: 3px;
  }
  .workspace-subnav button {
    padding-inline: 13px;
    font-size: 12px;
  }
  .template-builder {
    padding: 22px 18px;
  }
  .template-builder .fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .template-builder [type=submit] {
    width: 100%;
  }
  .template-library {
    grid-template-columns: minmax(0, 1fr);
    gap: 15px;
  }
  .template-card {
    padding: 22px 19px;
  }
  .template-empty {
    padding: 25px 21px;
  }
}
