/* PostWatch Documents v3 — isolated collection/detail and filing flows. */
.docs3-page {
  color: var(--pw-text, var(--text));
  display: grid;
  gap: 24px;
  min-width: 0;
}

.docs3-page .eyebrow {
  color: var(--pw-steel-600, var(--primary));
  display: block;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.docs3-page-header {
  align-items: flex-start;
  display: flex;
  gap: 20px;
  justify-content: space-between;
}

.docs3-page-header > div:first-child {
  max-width: 760px;
  min-width: 0;
}

.docs3-page-header h1,
.docs3-detail-head h2,
.docs3-dialog-head h2 {
  text-wrap: balance;
}

.docs3-page-header p {
  text-wrap: pretty;
}

.docs3-header-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.docs3-header-actions .btn,
.docs3-create-menu > summary {
  min-height: 48px;
}

.docs3-create-menu {
  position: relative;
}

.docs3-create-menu > summary {
  align-items: center;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  list-style: none;
  user-select: none;
}

.docs3-create-menu > summary::-webkit-details-marker {
  display: none;
}

.docs3-create-menu > summary > svg:last-child {
  height: 16px;
  transition: transform 160ms ease;
  width: 16px;
}

.docs3-create-menu[open] > summary > svg:last-child {
  transform: rotate(180deg);
}

.docs3-create-popover {
  background: var(--pw-surface, var(--surface));
  border: 1px solid var(--pw-border, var(--border));
  border-radius: 16px;
  box-shadow: 0 24px 64px rgb(11 32 55 / .18);
  display: grid;
  gap: 4px;
  padding: 10px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(340px, calc(100vw - 32px));
  z-index: 40;
}

.docs3-create-popover > span {
  color: var(--pw-text-muted, var(--text-muted));
  font-size: .8rem;
  font-weight: 750;
  padding: 8px 10px 6px;
}

.docs3-create-popover button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 12px;
  color: var(--pw-text, var(--text));
  cursor: pointer;
  display: grid;
  font: inherit;
  gap: 12px;
  grid-template-columns: 24px minmax(0, 1fr) 18px;
  min-height: 60px;
  padding: 10px;
  text-align: left;
  touch-action: manipulation;
}

.docs3-create-popover button:hover {
  background: color-mix(in srgb, var(--pw-navy-800, var(--primary)) 8%, transparent);
}

.docs3-create-popover button > svg {
  height: 22px;
  width: 22px;
}

.docs3-create-popover button > svg:last-child {
  height: 17px;
  width: 17px;
}

.docs3-create-popover button span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.docs3-create-popover button strong {
  font-size: .94rem;
}

.docs3-create-popover button small {
  color: var(--pw-text-muted, var(--text-muted));
  font-size: .78rem;
  margin-top: 2px;
}

.docs3-offline,
.docs3-receipt,
.docs3-truth-note,
.docs3-exception {
  align-items: flex-start;
  border: 1px solid var(--pw-border, var(--border));
  border-radius: 14px;
  display: flex;
  gap: 12px;
  padding: 14px 16px;
}

.docs3-offline {
  background: color-mix(in srgb, var(--pw-warning, #9a5b00) 9%, var(--pw-surface, var(--surface)));
  border-color: color-mix(in srgb, var(--pw-warning, #9a5b00) 30%, var(--pw-border, var(--border)));
}

.docs3-offline svg,
.docs3-receipt > svg,
.docs3-truth-note > svg,
.docs3-exception > svg {
  flex: 0 0 auto;
  height: 21px;
  margin-top: 2px;
  width: 21px;
}

.docs3-offline strong,
.docs3-truth-note strong,
.docs3-exception strong {
  display: block;
  font-size: .95rem;
}

.docs3-offline p,
.docs3-truth-note p {
  color: var(--pw-text-muted, var(--text-muted));
  font-size: .875rem;
  line-height: 1.5;
  margin: 3px 0 0;
}

.docs3-receipt {
  align-items: center;
  background: color-mix(in srgb, var(--pw-success, #157347) 9%, var(--pw-surface, var(--surface)));
  border-color: color-mix(in srgb, var(--pw-success, #157347) 30%, var(--pw-border, var(--border)));
  min-height: 54px;
}

.docs3-receipt--warning {
  background: color-mix(in srgb, var(--pw-warning, #9a5b00) 9%, var(--pw-surface, var(--surface)));
  border-color: color-mix(in srgb, var(--pw-warning, #9a5b00) 30%, var(--pw-border, var(--border)));
}

.docs3-receipt--error {
  background: color-mix(in srgb, var(--pw-danger, #b42318) 9%, var(--pw-surface, var(--surface)));
  border-color: color-mix(in srgb, var(--pw-danger, #b42318) 30%, var(--pw-border, var(--border)));
}

.docs3-receipt span {
  flex: 1;
  font-size: .92rem;
  line-height: 1.5;
}

.docs3-receipt .icon-btn {
  flex: 0 0 44px;
}

.docs3-kpis {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.docs3-mobile-summary {
  display: none;
}

.docs3-kpi {
  background: var(--pw-surface, var(--surface));
  border: 1px solid var(--pw-border, var(--border));
  border-radius: 16px;
  color: var(--pw-text, var(--text));
  display: flex;
  flex-direction: column;
  min-height: 116px;
  padding: 18px 18px 16px;
  position: relative;
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.docs3-kpi::before {
  background: var(--docs3-kpi-color, var(--pw-border, var(--border)));
  border-radius: 99px;
  content: '';
  height: 6px;
  left: 18px;
  position: absolute;
  right: 18px;
  top: 0;
}

.docs3-kpi--attention { --docs3-kpi-color: var(--pw-steel-600, var(--primary)); }
.docs3-kpi--danger { --docs3-kpi-color: var(--pw-danger, #b42318); }
.docs3-kpi--warning { --docs3-kpi-color: var(--pw-warning, #9a5b00); }
.docs3-kpi--neutral { --docs3-kpi-color: var(--pw-navy-800, var(--primary)); }

.docs3-kpi:hover,
.docs3-kpi.is-active {
  border-color: var(--docs3-kpi-color);
  box-shadow: 0 12px 30px rgb(11 32 55 / .08);
  transform: translateY(-2px);
}

.docs3-kpi strong {
  font-size: clamp(1.7rem, 2.5vw, 2.2rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.04em;
  line-height: 1;
}

.docs3-kpi span {
  font-size: 1rem;
  font-weight: 760;
  margin-top: 12px;
  padding-top: 0;
}

.docs3-kpi small {
  color: var(--pw-text-muted, var(--text-muted));
  font-size: .8rem;
  line-height: 1.4;
  margin-top: 4px;
}

.docs3-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(330px, 400px) minmax(0, 1fr);
  min-height: 660px;
  min-width: 0;
}

.docs3-master,
.docs3-detail-card,
.docs3-detail-empty,
.docs3-error {
  background: var(--pw-surface, var(--surface));
  border: 1px solid var(--pw-border, var(--border));
  border-radius: 18px;
}

.docs3-master {
  align-self: start;
  min-width: 0;
  overflow: hidden;
}

.docs3-master-tools {
  background: color-mix(in srgb, var(--pw-surface-muted, var(--surface-2)) 65%, transparent);
  border-bottom: 1px solid var(--pw-border, var(--border));
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) 148px;
  padding: 16px;
}

.docs3-master-tools > p {
  color: var(--pw-text-muted, var(--text-muted));
  font-size: .875rem;
  grid-column: 1 / -1;
  margin: 0;
}

.docs3-search,
.docs3-category,
.docs3-field,
.docs3-file-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.docs3-search > span,
.docs3-category > span,
.docs3-field > span,
.docs3-file-field > span:first-child {
  font-size: .84rem;
  font-weight: 760;
}

.docs3-search > div {
  align-items: center;
  display: flex;
  position: relative;
}

.docs3-search svg {
  color: var(--pw-text-muted, var(--text-muted));
  height: 19px;
  left: 13px;
  pointer-events: none;
  position: absolute;
  width: 19px;
}

.docs3-search input,
.docs3-category select,
.docs3-field input,
.docs3-field select,
.docs3-field textarea {
  background: var(--pw-surface, var(--surface));
  border: 1px solid var(--pw-border, var(--border));
  border-radius: 12px;
  color: var(--pw-text, var(--text));
  font: inherit;
  font-size: 1rem;
  min-height: 48px;
  padding: 10px 12px;
  width: 100%;
}

.docs3-search input {
  padding-left: 40px;
}

.docs3-field textarea {
  line-height: 1.5;
  min-height: 96px;
  resize: vertical;
}

.docs3-search input::placeholder,
.docs3-field input::placeholder,
.docs3-field textarea::placeholder {
  color: color-mix(in srgb, var(--pw-text-muted, var(--text-muted)) 76%, transparent);
}

.docs3-segments {
  background: var(--pw-surface, var(--surface));
  border: 1px solid var(--pw-border, var(--border));
  border-radius: 12px;
  display: grid;
  gap: 2px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-column: 1 / -1;
  padding: 3px;
}

.docs3-segments a {
  align-items: center;
  border-radius: 9px;
  color: var(--pw-text-muted, var(--text-muted));
  display: flex;
  font-size: .8rem;
  font-weight: 760;
  justify-content: center;
  min-height: 44px;
  padding: 7px 10px;
  text-decoration: none;
}

.docs3-segments a:hover,
.docs3-segments a.is-active {
  background: var(--pw-surface-muted, var(--surface-2));
  color: var(--pw-text, var(--text));
}

.docs3-segments a.is-active {
  box-shadow: 0 1px 4px rgb(11 32 55 / .1);
}

.docs3-record-list {
  max-height: min(68vh, 820px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.docs3-record {
  align-items: center;
  border-bottom: 1px solid var(--pw-border, var(--border));
  color: var(--pw-text, var(--text));
  content-visibility: auto;
  contain-intrinsic-size: 96px;
  display: grid;
  gap: 12px;
  grid-template-columns: 44px minmax(0, 1fr) auto 18px;
  min-height: 96px;
  padding: 14px 16px;
  text-decoration: none;
  touch-action: manipulation;
}

.docs3-record:last-child {
  border-bottom: 0;
}

.docs3-record:hover,
.docs3-record.is-active {
  background: color-mix(in srgb, var(--pw-navy-800, var(--primary)) 8%, transparent);
}

.docs3-record.is-active {
  box-shadow: inset 3px 0 0 var(--pw-navy-800, var(--primary));
}

.docs3-record__icon,
.docs3-detail-icon,
.docs3-file-panel__icon {
  align-items: center;
  background: var(--pw-surface-muted, var(--surface-2));
  border-radius: 12px;
  display: inline-flex;
  justify-content: center;
}

.docs3-record__icon {
  height: 44px;
  width: 44px;
}

.docs3-record__icon svg {
  height: 22px;
  width: 22px;
}

.docs3-record__icon--expired,
.docs3-detail-icon--expired {
  background: color-mix(in srgb, var(--pw-danger, #b42318) 12%, var(--pw-surface, var(--surface)));
  color: var(--pw-danger, #b42318);
}

.docs3-record__icon--missing,
.docs3-detail-icon--missing {
  background: color-mix(in srgb, var(--pw-warning, #9a5b00) 12%, var(--pw-surface, var(--surface)));
  color: var(--pw-warning, #9a5b00);
}

.docs3-record__icon--soon,
.docs3-detail-icon--soon {
  background: color-mix(in srgb, var(--pw-gold-600, #a87920) 13%, var(--pw-surface, var(--surface)));
  color: var(--pw-warning, #9a5b00);
}

.docs3-record__icon--filed,
.docs3-detail-icon--filed {
  background: color-mix(in srgb, var(--pw-success, #157347) 10%, var(--pw-surface, var(--surface)));
  color: var(--pw-success, #157347);
}

.docs3-record__copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.docs3-record__copy strong {
  font-size: 1rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs3-record__copy small,
.docs3-record__copy em {
  color: var(--pw-text-muted, var(--text-muted));
  font-size: .78rem;
  font-style: normal;
  line-height: 1.35;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs3-record__copy em {
  margin-top: 7px;
}

.docs3-record__chevron {
  color: var(--pw-text-muted, var(--text-muted));
  height: 18px;
  width: 18px;
}

.docs3-status {
  align-items: center;
  border: 1px solid var(--pw-border, var(--border));
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: .75rem;
  font-weight: 780;
  gap: 6px;
  min-height: 30px;
  padding: 4px 9px;
  white-space: nowrap;
}

.docs3-status > svg,
.docs3-status > i {
  flex: 0 0 auto;
  height: 16px;
  width: 16px;
}

.docs3-status--expired {
  background: color-mix(in srgb, var(--pw-danger, #b42318) 8%, var(--pw-surface, var(--surface)));
  border-color: color-mix(in srgb, var(--pw-danger, #b42318) 26%, var(--pw-border, var(--border)));
  color: var(--pw-danger, #b42318);
}

.docs3-status--missing,
.docs3-status--soon {
  background: color-mix(in srgb, var(--pw-warning, #9a5b00) 8%, var(--pw-surface, var(--surface)));
  border-color: color-mix(in srgb, var(--pw-warning, #9a5b00) 26%, var(--pw-border, var(--border)));
  color: var(--pw-warning, #9a5b00);
}

.docs3-status--filed {
  background: color-mix(in srgb, var(--pw-success, #157347) 8%, var(--pw-surface, var(--surface)));
  border-color: color-mix(in srgb, var(--pw-success, #157347) 24%, var(--pw-border, var(--border)));
  color: var(--pw-success, #157347);
}

.docs3-list-empty {
  border: 0;
  min-height: 360px;
  padding: 40px 24px;
}

.docs3-list-empty .btn {
  margin-top: 10px;
}

.docs3-pagination {
  align-items: center;
  border-top: 1px solid var(--pw-border, var(--border));
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 12px;
}

.docs3-pagination span {
  color: var(--pw-text-muted, var(--text-muted));
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
}

.docs3-pagination .is-disabled {
  opacity: .45;
  pointer-events: none;
}

.docs3-detail {
  min-width: 0;
}

.docs3-detail-card {
  min-width: 0;
  overflow: hidden;
}

.docs3-detail-head {
  align-items: flex-start;
  border-bottom: 1px solid var(--pw-border, var(--border));
  display: grid;
  gap: 16px;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  padding: 22px 24px;
}

.docs3-detail-icon {
  height: 54px;
  width: 54px;
}

.docs3-detail-icon svg {
  height: 26px;
  width: 26px;
}

.docs3-detail-head > div {
  min-width: 0;
}

.docs3-detail-head > div > span {
  color: var(--pw-text-muted, var(--text-muted));
  display: block;
  font-size: .8rem;
  font-weight: 760;
  margin-bottom: 4px;
}

.docs3-detail-head h2 {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  line-height: 1.25;
  margin: 0;
  overflow-wrap: anywhere;
}

.docs3-detail-head p {
  color: var(--pw-text-muted, var(--text-muted));
  font-size: .92rem;
  line-height: 1.5;
  margin: 6px 0 0;
}

.docs3-page .docs3-mobile-back {
  display: none;
}

.docs3-exception {
  background: color-mix(in srgb, var(--pw-warning, #9a5b00) 8%, var(--pw-surface, var(--surface)));
  border-color: color-mix(in srgb, var(--pw-warning, #9a5b00) 28%, var(--pw-border, var(--border)));
  margin: 20px 24px 0;
}

.docs3-exception ul {
  color: var(--pw-text-muted, var(--text-muted));
  font-size: .875rem;
  line-height: 1.5;
  margin: 7px 0 0;
  padding-left: 20px;
}

.docs3-facts {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 14px 24px 4px;
}

.docs3-facts > div {
  border-bottom: 1px solid var(--pw-border, var(--border));
  min-width: 0;
  padding: 14px 12px;
}

.docs3-facts dt {
  color: var(--pw-text-muted, var(--text-muted));
  font-size: .75rem;
  font-weight: 740;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.docs3-facts dd {
  font-size: .92rem;
  font-weight: 680;
  margin: 0;
  overflow-wrap: anywhere;
}

.docs3-file-panel {
  align-items: center;
  background: var(--pw-surface-muted, var(--surface-2));
  border: 1px solid var(--pw-border, var(--border));
  border-radius: 14px;
  display: grid;
  gap: 14px;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  margin: 20px 24px 0;
  padding: 14px;
}

.docs3-file-panel__icon {
  background: var(--pw-surface, var(--surface));
  height: 46px;
  width: 46px;
}

.docs3-file-panel__icon svg {
  height: 22px;
  width: 22px;
}

.docs3-file-panel > div {
  min-width: 0;
}

.docs3-file-panel strong {
  display: block;
  font-size: .95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs3-file-panel p {
  color: var(--pw-text-muted, var(--text-muted));
  font-size: .82rem;
  line-height: 1.45;
  margin: 4px 0 0;
}

.docs3-inline-status {
  border-radius: 12px;
  font-size: .88rem;
  margin: 12px 24px 0;
  min-height: 0;
}

.docs3-inline-status:not(:empty) {
  border: 1px solid var(--pw-border, var(--border));
  padding: 12px 14px;
}

.docs3-inline-status.is-success {
  background: color-mix(in srgb, var(--pw-success, #157347) 9%, transparent);
  border-color: color-mix(in srgb, var(--pw-success, #157347) 28%, var(--pw-border, var(--border)));
}

.docs3-inline-status.is-error {
  background: color-mix(in srgb, var(--pw-danger, #b42318) 9%, transparent);
  border-color: color-mix(in srgb, var(--pw-danger, #b42318) 28%, var(--pw-border, var(--border)));
}

.docs3-detail-section {
  padding: 22px 24px;
}

.docs3-section-label {
  color: var(--pw-steel-600, var(--primary));
  display: block;
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .08em;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.docs3-detail-section h3 {
  font-size: 1.05rem;
  margin: 0;
}

.docs3-detail-section > p,
.docs3-notes {
  color: var(--pw-text-muted, var(--text-muted));
  font-size: .92rem;
  line-height: 1.6;
  margin: 8px 0 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.docs3-truth-note {
  background: color-mix(in srgb, var(--pw-steel-600, var(--primary)) 8%, var(--pw-surface, var(--surface)));
  border-color: color-mix(in srgb, var(--pw-steel-600, var(--primary)) 25%, var(--pw-border, var(--border)));
  margin: 20px 24px 0;
}

.docs3-actions,
.docs3-detail-actions,
.docs3-detail-actions > div {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.docs3-actions {
  margin-top: 18px;
}

.docs3-detail-actions {
  border-top: 1px solid var(--pw-border, var(--border));
  justify-content: space-between;
  padding: 18px 24px 22px;
}

.docs3-read-only {
  color: var(--pw-text-muted, var(--text-muted));
  font-size: .875rem;
  line-height: 1.5;
  margin: 0;
}

.docs3-danger-button {
  background: transparent;
  border-color: color-mix(in srgb, var(--pw-danger, #b42318) 36%, var(--pw-border, var(--border)));
  color: var(--pw-danger, #b42318);
}

.docs3-danger-button:hover {
  background: color-mix(in srgb, var(--pw-danger, #b42318) 8%, transparent);
}

.docs3-remove-confirm {
  align-items: center;
  background: color-mix(in srgb, var(--pw-danger, #b42318) 8%, var(--pw-surface, var(--surface)));
  border-top: 1px solid color-mix(in srgb, var(--pw-danger, #b42318) 26%, var(--pw-border, var(--border)));
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 18px 24px;
}

.docs3-remove-confirm[hidden] {
  display: none;
}

.docs3-remove-confirm strong {
  display: block;
  font-size: .95rem;
}

.docs3-remove-confirm p {
  color: var(--pw-text-muted, var(--text-muted));
  font-size: .82rem;
  line-height: 1.45;
  margin: 3px 0 0;
}

.docs3-detail-empty,
.docs3-error {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 500px;
  padding: 48px;
  text-align: center;
}

.docs3-detail-empty p,
.docs3-error p {
  max-width: 520px;
}

.docs3-detail-empty .btn,
.docs3-error .btn {
  margin-top: 12px;
}

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

.docs3-skeleton span {
  animation: docs3-pulse 1.4s ease-in-out infinite alternate;
  background: var(--pw-surface-muted, var(--surface-2));
  border: 1px solid var(--pw-border, var(--border));
  border-radius: 16px;
  min-height: 130px;
}

@keyframes docs3-pulse {
  from { opacity: .55; }
  to { opacity: 1; }
}

body.docs3-dialog-open {
  overflow: hidden;
}

.docs3-dialog {
  background: var(--pw-surface, var(--surface));
  border: 1px solid var(--pw-border, var(--border));
  border-radius: 22px;
  box-shadow: 0 32px 100px rgb(5 19 33 / .32);
  color: var(--pw-text, var(--text));
  margin: auto;
  max-height: min(90vh, 900px);
  max-height: min(90dvh, 900px);
  max-width: 760px;
  overflow: hidden;
  padding: 0;
  width: min(760px, calc(100vw - 32px));
}

.docs3-dialog::backdrop {
  backdrop-filter: blur(5px);
  background: rgb(5 19 33 / .58);
}

.docs3-dialog form {
  display: flex;
  flex-direction: column;
  max-height: inherit;
  min-height: 0;
}

.docs3-dialog-head {
  align-items: flex-start;
  border-bottom: 1px solid var(--pw-border, var(--border));
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 22px 24px 18px;
}

.docs3-dialog-head > div {
  min-width: 0;
}

.docs3-dialog #docs3-dialog-close {
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
}

.docs3-dialog-head > div > span {
  color: var(--pw-steel-600, var(--primary));
  display: block;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .08em;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.docs3-dialog-head h2 {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  margin: 0;
}

.docs3-dialog-head h2:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.docs3-dialog-head p {
  color: var(--pw-text-muted, var(--text-muted));
  font-size: .88rem;
  line-height: 1.5;
  margin: 5px 0 0;
}

.docs3-dialog-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 24px 28px;
}

.docs3-form-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.docs3-field[hidden] {
  display: none;
}

.docs3-field > span b,
.docs3-file-field > span b {
  color: var(--pw-danger, #b42318);
}

.docs3-field > small,
.docs3-file-field > small {
  color: var(--pw-text-muted, var(--text-muted));
  font-size: .78rem;
  line-height: 1.4;
}

.docs3-field-error {
  color: var(--pw-danger, #b42318);
  font-size: .8rem;
  font-style: normal;
  font-weight: 650;
  line-height: 1.4;
  min-height: 0;
}

.docs3-field-error:not(:empty) {
  min-height: 1.15em;
}

.docs3-field [aria-invalid="true"],
.docs3-file-field [aria-invalid="true"] {
  border-color: var(--pw-danger, #b42318);
  box-shadow: 0 0 0 1px var(--pw-danger, #b42318);
}

.docs3-file-picker {
  align-items: center;
  background: var(--pw-surface-muted, var(--surface-2));
  border: 1px dashed color-mix(in srgb, var(--pw-steel-600, var(--primary)) 55%, var(--pw-border, var(--border)));
  border-radius: 14px;
  cursor: pointer;
  display: grid;
  gap: 14px;
  grid-template-columns: 28px minmax(0, 1fr);
  min-height: 84px;
  padding: 14px 16px;
  position: relative;
  touch-action: manipulation;
}

.docs3-file-picker:hover {
  border-color: var(--pw-steel-600, var(--primary));
}

.docs3-file-picker > svg {
  height: 26px;
  width: 26px;
}

.docs3-file-picker > span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.docs3-file-picker strong {
  font-size: .94rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs3-file-picker small {
  color: var(--pw-text-muted, var(--text-muted));
  font-size: .78rem;
  line-height: 1.4;
  margin-top: 4px;
}

.docs3-file-picker input {
  height: 100%;
  inset: 0;
  opacity: 0;
  position: absolute;
  width: 100%;
}

.docs3-file-picker:focus-within {
  border-color: var(--pw-navy-800, var(--primary));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pw-navy-800, var(--primary)) 28%, transparent);
}

.docs3-upload-progress {
  background: var(--pw-surface-muted, var(--surface-2));
  border-radius: 12px;
  margin-top: 18px;
  padding: 13px 14px;
}

.docs3-upload-progress[hidden] {
  display: none;
}

.docs3-upload-progress > div {
  align-items: center;
  display: flex;
  font-size: .82rem;
  justify-content: space-between;
  margin-bottom: 8px;
}

.docs3-upload-progress strong {
  font-variant-numeric: tabular-nums;
}

.docs3-upload-progress progress {
  accent-color: var(--pw-navy-800, var(--primary));
  height: 10px;
  width: 100%;
}

.docs3-form-status {
  border-radius: 12px;
  font-size: .88rem;
  line-height: 1.5;
  margin-top: 14px;
  min-height: 0;
}

.docs3-form-status:not(:empty) {
  background: var(--pw-surface-muted, var(--surface-2));
  border: 1px solid var(--pw-border, var(--border));
  padding: 12px 14px;
}

.docs3-form-status.is-error {
  background: color-mix(in srgb, var(--pw-danger, #b42318) 8%, var(--pw-surface, var(--surface)));
  border-color: color-mix(in srgb, var(--pw-danger, #b42318) 30%, var(--pw-border, var(--border)));
}

.docs3-dialog-actions {
  align-items: center;
  background: var(--pw-surface, var(--surface));
  border-top: 1px solid var(--pw-border, var(--border));
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 24px calc(14px + env(safe-area-inset-bottom));
}

.docs3-dialog-actions .btn {
  min-height: 48px;
}

.docs3-generator-overlay {
  backdrop-filter: blur(5px);
  background: rgb(5 19 33 / .58) !important;
}

.docs3-generator-overlay .modal-box,
.docs3-generator-overlay .gen-menu {
  background: var(--pw-surface, var(--surface));
  border: 1px solid var(--pw-border, var(--border));
  border-radius: 22px;
  box-shadow: 0 32px 100px rgb(5 19 33 / .32);
  color: var(--pw-text, var(--text));
  max-height: min(90dvh, 900px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.docs3-generator-overlay input,
.docs3-generator-overlay select,
.docs3-generator-overlay textarea,
.docs3-generator-overlay button {
  font-size: 1rem;
  min-height: 44px;
}

.docs3-page button,
.docs3-page a,
.docs3-dialog button,
.docs3-dialog input,
.docs3-dialog select,
.docs3-dialog textarea,
.docs3-dialog summary {
  -webkit-tap-highlight-color: color-mix(in srgb, var(--pw-navy-800, var(--primary)) 18%, transparent);
  touch-action: manipulation;
}

.docs3-page a:focus-visible,
.docs3-page button:focus-visible,
.docs3-page input:focus-visible,
.docs3-page select:focus-visible,
.docs3-page summary:focus-visible,
.docs3-dialog button:focus-visible,
.docs3-dialog input:focus-visible,
.docs3-dialog select:focus-visible,
.docs3-dialog textarea:focus-visible,
.docs3-generator-overlay :is(button, input, select, textarea):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--pw-navy-800, var(--primary)) 70%, white);
  outline-offset: 2px;
}

.docs3-page button:disabled,
.docs3-dialog button:disabled,
.docs3-page .btn:disabled {
  cursor: not-allowed;
  opacity: .48;
}

@media (max-width: 1100px) {
  .docs3-layout {
    grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
  }

  .docs3-kpi {
    min-height: 118px;
  }

  .docs3-master-tools {
    grid-template-columns: 1fr;
  }

  .docs3-master-tools > p,
  .docs3-segments {
    grid-column: 1;
  }

  .docs3-record {
    grid-template-columns: 42px minmax(0, 1fr) 18px;
  }

  .docs3-record > .docs3-status {
    display: none;
  }

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

  .docs3-file-panel {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .docs3-file-panel .btn {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 767px) {
  .docs3-page {
    gap: 16px;
  }

  .docs3-page-header {
    display: grid;
    gap: 14px;
  }

  .docs3-header-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: 100%;
  }

  .docs3-header-actions .btn,
  .docs3-create-menu,
  .docs3-create-menu > summary {
    justify-content: center;
    width: 100%;
  }

  .docs3-create-popover {
    left: 0;
    position: absolute;
    right: auto;
  }

  .docs3-kpis {
    display: none;
  }

  .docs3-mobile-summary {
    align-items: center;
    background: var(--pw-surface, var(--surface));
    border: 1px solid color-mix(in srgb, var(--pw-steel-600, var(--primary)) 38%, var(--pw-border, var(--border)));
    border-radius: 15px;
    color: var(--pw-text, var(--text));
    display: grid;
    gap: 12px;
    grid-template-columns: 46px minmax(0, 1fr) 20px;
    min-height: 78px;
    padding: 13px 14px;
    text-decoration: none;
  }

  .docs3-mobile-summary__icon {
    align-items: center;
    background: color-mix(in srgb, var(--pw-steel-600, var(--primary)) 12%, var(--pw-surface, var(--surface)));
    border-radius: 12px;
    color: var(--pw-steel-600, var(--primary));
    display: flex;
    height: 46px;
    justify-content: center;
    width: 46px;
  }

  .docs3-mobile-summary__icon svg {
    height: 23px;
    width: 23px;
  }

  .docs3-mobile-summary > span:nth-child(2) {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .docs3-mobile-summary strong {
    font-size: .97rem;
    line-height: 1.3;
  }

  .docs3-mobile-summary small {
    color: var(--pw-text-muted, var(--text-muted));
    font-size: .78rem;
    line-height: 1.4;
    margin-top: 4px;
  }

  .docs3-mobile-summary > svg {
    color: var(--pw-text-muted, var(--text-muted));
    height: 20px;
    width: 20px;
  }

  .docs3-page.has-selection > .docs3-page-header,
  .docs3-page.has-selection > .docs3-mobile-summary {
    display: none;
  }

  .docs3-layout {
    display: block;
    min-height: 0;
  }

  .docs3-page.has-selection .docs3-master {
    display: none;
  }

  .docs3-page:not(.has-selection) .docs3-detail {
    display: none;
  }

  .docs3-master,
  .docs3-detail-card,
  .docs3-detail-empty,
  .docs3-error {
    border-radius: 16px;
  }

  .docs3-record-list {
    max-height: none;
  }

  .docs3-record {
    grid-template-columns: 44px minmax(0, 1fr) 18px;
    min-height: 92px;
    padding: 12px;
  }

  .docs3-record__copy strong,
  .docs3-record__copy small,
  .docs3-record__copy em {
    white-space: normal;
  }

  .docs3-detail-head {
    grid-template-columns: 44px 48px minmax(0, 1fr);
    padding: 16px;
  }

  .docs3-detail-head > .docs3-status {
    grid-column: 2 / -1;
    justify-self: start;
  }

  .docs3-page .docs3-mobile-back {
    display: inline-flex;
    grid-column: 1;
    grid-row: 1;
  }

  .docs3-detail-icon {
    grid-column: 2;
    grid-row: 1;
    height: 48px;
    width: 48px;
  }

  .docs3-detail-head > div {
    grid-column: 3;
    grid-row: 1;
  }

  .docs3-exception,
  .docs3-truth-note,
  .docs3-file-panel {
    margin-left: 16px;
    margin-right: 16px;
  }

  .docs3-facts {
    grid-template-columns: 1fr;
    padding: 12px 16px 0;
  }

  .docs3-facts > div {
    padding-left: 0;
    padding-right: 0;
  }

  .docs3-file-panel {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .docs3-inline-status {
    margin-left: 16px;
    margin-right: 16px;
  }

  .docs3-detail-section {
    padding: 20px 16px;
  }

  .docs3-actions,
  .docs3-detail-actions,
  .docs3-detail-actions > div {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .docs3-actions .btn,
  .docs3-detail-actions .btn {
    justify-content: center;
    width: 100%;
  }

  .docs3-detail-actions {
    align-items: stretch;
    padding: 16px;
  }

  .docs3-remove-confirm {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .docs3-remove-confirm .btn {
    width: 100%;
  }

  .docs3-detail-empty,
  .docs3-error {
    min-height: 420px;
    padding: 32px 20px;
  }

  .docs3-dialog {
    border-bottom: 0;
    border-left: 0;
    border-radius: 24px 24px 0 0;
    border-right: 0;
    bottom: 0;
    height: min(94vh, 900px);
    height: min(94dvh, 900px);
    margin: auto 0 0;
    max-height: calc(100vh - env(safe-area-inset-top));
    max-height: calc(100dvh - env(safe-area-inset-top));
    max-width: none;
    width: 100%;
  }

  .docs3-dialog form {
    height: 100%;
  }

  .docs3-dialog-head {
    padding: 18px 16px 14px;
  }

  .docs3-dialog-body {
    padding: 18px 16px 28px;
  }

  .docs3-form-grid {
    grid-template-columns: 1fr;
  }

  .docs3-field--wide {
    grid-column: 1;
  }

  .docs3-dialog-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    padding-left: 16px;
    padding-right: 16px;
  }

  .docs3-dialog-actions .btn {
    justify-content: center;
    width: 100%;
  }

  .docs3-generator-overlay {
    align-items: flex-end !important;
    padding: env(safe-area-inset-top) 0 0 !important;
  }

  .docs3-generator-overlay .modal-box,
  .docs3-generator-overlay .gen-menu {
    border-bottom: 0;
    border-left: 0;
    border-radius: 24px 24px 0 0;
    border-right: 0;
    margin: 0;
    max-height: calc(100vh - env(safe-area-inset-top));
    max-height: calc(100dvh - env(safe-area-inset-top));
    max-width: none;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    width: 100%;
  }
}

@media (max-width: 390px) {
  .docs3-header-actions {
    grid-template-columns: 1fr;
  }

  .docs3-master-tools {
    padding: 12px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .docs3-create-menu > summary > svg:last-child,
  .docs3-kpi {
    transition: none;
  }

  .docs3-kpi:hover,
  .docs3-kpi.is-active {
    transform: none;
  }

  .docs3-skeleton span {
    animation: none;
  }
}

@media (forced-colors: active) {
  .docs3-kpi::before {
    forced-color-adjust: none;
  }

  .docs3-page a:focus-visible,
  .docs3-page button:focus-visible,
  .docs3-page input:focus-visible,
  .docs3-page select:focus-visible,
  .docs3-dialog :is(button, input, select, textarea):focus-visible {
    outline-color: Highlight;
  }
}

@media print {
  .docs3-page > :not(.docs3-layout),
  .docs3-master,
  .docs3-detail-actions,
  .docs3-remove-confirm,
  .app-sidebar,
  .app-rail,
  .app-topbar,
  .mobile-bottom-nav {
    display: none !important;
  }

  .docs3-layout,
  .docs3-detail {
    display: block !important;
  }

  .docs3-detail-card {
    border: 0;
  }
}

/* Lifecycle controls stay readable on narrow Android screens without effects. */
.docs3-master-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.docs3-master-tools .docs3-sort, .docs3-master-tools .docs3-search { grid-column: 1 / -1; }
.docs3-category > span, .docs3-field > span { font-size: .875rem; }
.docs3-history ol { list-style: none; margin: 16px 0 0; padding: 0; }
.docs3-history li { border-top: 1px solid var(--pw-border, var(--border, #d9dde3)); padding: 16px 0; overflow-wrap: anywhere; }
.docs3-history li > strong, .docs3-history li > small { display: block; }
.docs3-history li > small { font-size: .875rem; margin-top: 6px; line-height: 1.5; color: var(--pw-text-muted, var(--text-muted, #657080)); }
.docs3-history li > p, #docs3-history-status { font-size: .875rem; line-height: 1.6; overflow-wrap: anywhere; }
.docs3-history-files { display: flex; flex-wrap: wrap; gap: 8px; }
.docs3-history .btn { min-height: 44px; max-width: 100%; white-space: normal; }
.docs3-dialog [aria-busy="true"] { cursor: progress; }
@media (max-width: 767px) {
  .docs3-master-tools { grid-template-columns: 1fr; }
  .docs3-history-files > .btn { flex: 1 1 100%; }
}

/* Compact filing workspace; route-owned layout also survives the shell layers. */
.docs3-page .docs3-detail-head { padding: 18px; gap: 12px; }
.docs3-page .docs3-detail-head h2 { font-size: 1.375rem; line-height: 1.25; text-wrap: initial; }
.docs3-page .docs3-detail-head p { margin-top: 4px; font-size: .875rem; line-height: 1.4; }
.docs3-page .docs3-status { font-size: .875rem; gap: 6px; }
.docs3-page .docs3-status > svg, .docs3-page .docs3-status > i { width: 16px; height: 16px; flex: 0 0 16px; }
.docs3-page .docs3-exception { margin: 14px 18px 0; padding: 12px; gap: 10px; }
.docs3-page .docs3-exception > svg { width: 18px; height: 18px; margin-top: 2px; }
.docs3-page .docs3-exception strong { font-size: .875rem; line-height: 1.4; }
.docs3-page .docs3-exception ul { margin-top: 4px; }
.docs3-page .docs3-file-panel { margin: 14px 18px 0; padding: 12px; gap: 10px; grid-template-columns: 36px minmax(0,1fr); }
.docs3-page .docs3-file-panel__icon { width: 36px; height: 36px; border-radius: 8px; }
.docs3-page .docs3-file-panel strong { white-space: normal; overflow-wrap: anywhere; font-size: .9375rem; }
.docs3-page .docs3-file-panel p { font-size: .875rem; line-height: 1.4; }
.docs3-page .docs3-file-actions { display: flex; flex-wrap: wrap; gap: 8px; grid-column: 1 / -1; }
.docs3-page .docs3-file-actions .btn { flex: 1 1 150px; width: auto; min-height: 44px; justify-content: center; white-space: normal; }
.docs3-page .docs3-facts { padding: 6px 18px 0; }
.docs3-page .docs3-facts > div { padding: 12px 8px; }
.docs3-page .docs3-facts dt { font-size: .875rem; text-transform: none; margin-bottom: 4px; }
.docs3-page .docs3-facts dd { font-size: .9375rem; line-height: 1.4; }
.docs3-page .docs3-detail-section { padding: 18px; }
.docs3-page .docs3-section-label { font-size: .875rem; letter-spacing: 0; text-transform: none; }
.docs3-page .docs3-detail-section h3 { font-size: 1rem; }
.docs3-page .docs3-detail-actions { padding: 14px 18px; }
.docs3-page .docs3-inline-status { margin-inline: 18px; }
.docs3-page .docs3-detail-empty, .docs3-page .docs3-error, .docs3-page .docs3-list-empty { min-height: 240px; padding: 28px 20px; }
@media (max-width: 767px) {
  .docs3-page.docs3-page { gap: 12px; }
  .docs3-page .docs3-detail-head { display: flex; flex-wrap: wrap; align-items: center; padding: 12px 14px 16px; gap: 8px 12px; }
  .docs3-page .docs3-mobile-back { display: inline-flex; align-items: center; justify-content: flex-start; gap: 6px; width: auto; min-height: 44px; padding: 6px 0; margin-right: auto; font-size: .875rem; text-decoration: none; color: var(--pw-text-muted, var(--text-muted)); order: 0; }
  .docs3-page .docs3-mobile-back svg { flex: 0 0 18px; width: 18px; height: 18px; }
  .docs3-page .docs3-detail-head > .docs3-status { order: 1; max-width: 100%; white-space: normal; }
  .docs3-page .docs3-detail-head > .docs3-detail-icon { display: none; }
  .docs3-page .docs3-detail-head > div { order: 2; flex: 1 0 100%; }
  .docs3-page .docs3-detail-head > div > span { font-size: .875rem; margin-bottom: 4px; }
  .docs3-page .docs3-detail-head h2 { font-size: 1.375rem; }
  .docs3-page .docs3-exception, .docs3-page .docs3-file-panel, .docs3-page .docs3-truth-note { margin-left: 14px; margin-right: 14px; }
  .docs3-page .docs3-facts { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 6px 14px 0; gap: 0 12px; }
  .docs3-page .docs3-facts > div { padding: 10px 0; }
  .docs3-page .docs3-detail-section { padding: 16px 14px; }
  .docs3-page .docs3-mobile-summary { grid-template-columns: minmax(0,1fr) 18px; min-height: 0; border-radius: 8px; padding: 10px 12px; gap: 8px; }
  .docs3-page .docs3-mobile-summary__icon { display: none; }
  .docs3-page .docs3-mobile-summary strong { font-size: .9375rem; }
  .docs3-page .docs3-mobile-summary small { font-size: .875rem; margin-top: 3px; }
  .docs3-page .docs3-header-actions { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .docs3-page .docs3-header-actions .btn, .docs3-page .docs3-create-menu > summary { white-space: normal; font-size: .875rem; padding-inline: 8px; }
  .docs3-page .docs3-master-tools { gap: 10px; padding: 12px; }
  .docs3-page .docs3-record { gap: 10px; grid-template-columns: 34px minmax(0,1fr) 16px; min-height: 84px; }
  .docs3-page .docs3-record__icon { height: 34px; width: 34px; border-radius: 7px; }
  .docs3-page .docs3-record__icon svg { height: 18px; width: 18px; }
}
.docs3-page .docs3-filters { grid-column: 1 / -1; min-width: 0; border-top: 1px solid var(--pw-border, var(--border)); }
.docs3-page .docs3-filters > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; font-size: .875rem; font-weight: 650; color: var(--pw-text-muted, var(--text-muted)); cursor: pointer; list-style: none; }
.docs3-page .docs3-filters > summary::-webkit-details-marker { display: none; }
.docs3-page .docs3-filters > summary svg { width: 18px; height: 18px; flex: 0 0 18px; }
.docs3-page .docs3-filters[open] > summary svg { transform: rotate(180deg); }
.docs3-page .docs3-filter-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; padding-bottom: 12px; }
.docs3-page .docs3-filter-fields .docs3-sort { grid-column: 1 / -1; }
.docs3-page .docs3-master-tools > .docs3-search { order: -2; }
.docs3-page .docs3-master-tools > .docs3-segments { order: -1; }
.docs3-page .docs3-filters > summary:focus-visible { outline: 3px solid var(--pw-focus, #2459b8); outline-offset: 2px; }
@media (max-width:767px) { .docs3-page-header .eyebrow { display: none; } }
