:root {
  --ink: #20323c;
  --muted: #697981;
  --line: #e2e7e5;
  --paper: #f6f7f3;
  --white: #fff;
  --teal: #23695d;
  --teal-dark: #195348;
  --mint: #e6f0e9;
  --navy: #172e36;
  --amber: #b36b13;
  --radius: 14px;
  --shadow: 0 3px 16px #20323c04
}

* {
  box-sizing: border-box
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif
}

a {
  color: inherit;
  text-decoration: none
}

button,
input,
textarea,
select {
  font: inherit
}

button,
a,
input,
textarea,
select,
summary {
  touch-action: manipulation
}

button {
  cursor: pointer
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #4a9a89;
  outline-offset: 3px
}

h1,
h2,
h3,
p {
  margin-top: 0
}

h1 {
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.22;
  font-weight: 650;
  letter-spacing: -1.1px;
  margin-bottom: 10px
}

h2 {
  font-size: 19px;
  letter-spacing: -.35px;
  line-height: 1.3;
  margin-bottom: 14px
}

h3 {
  font-size: 17px
}

small {
  display: block;
  font-size: 12px;
  color: var(--muted)
}

strong {
  font-weight: 600
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0
}

.muted {
  color: var(--muted)
}

.nowrap {
  white-space: nowrap
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0)
}

.skip-link {
  position: absolute;
  top: -50px;
  z-index: 100;
  padding: 10px;
  background: white
}

.skip-link:focus {
  top: 0
}

.small-label,
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px
}

.eyebrow {
  display: block;
  color: var(--teal);
  margin-bottom: 13px
}

.sidebar {
  width: 236px;
  position: fixed;
  inset: 0 auto 0 0;
  background: var(--white);
  border-right: 1px solid var(--line);
  padding: 37px 24px 20px;
  display: flex;
  flex-direction: column;
  z-index: 5
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 25px;
  line-height: 1.05;
  font-weight: 650;
  letter-spacing: -1px
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 43px;
  background: var(--teal);
  color: white;
  border-radius: 11px;
  font-size: 30px;
  line-height: 1
}

.brand-second {
  display: block
}

.workspace-label {
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 1.4px;
  color: #84918e;
  margin: 48px 10px 13px
}

.nav-link {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 13px;
  margin: 4px 0;
  border-radius: 9px;
  color: #627078;
  font-size: 13px;
  font-weight: 500
}

.nav-link span {
  width: 20px;
  font-size: 20px;
  line-height: 1
}

.nav-link:hover {
  background: #f2f5f1
}

.nav-link.active {
  color: var(--teal-dark);
  background: var(--mint);
  font-weight: 650
}

.sidebar-note {
  margin: 37px 4px 24px;
  padding: 18px 15px;
  background: #f6f7f1;
  border-radius: 10px;
  border: 1px solid #e9ecdf
}

.sidebar-note .small-label {
  color: #89977a;
  letter-spacing: 1px;
  font-size: 9px
}

.sidebar-note p {
  font-size: 16px;
  line-height: 1.4;
  margin: 8px 0
}

.sidebar-note small {
  font-size: 11px;
  line-height: 1.6
}

.sidebar-bottom {
  margin-top: auto
}

.settings-link {
  display: flex;
  justify-content: space-between;
  margin: 0 6px 20px;
  color: var(--muted);
  font-size: 12px
}

.user-row {
  display: flex;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 20px
}

.user-row strong {
  font-size: 12px
}

.user-row small {
  font-size: 10px
}

.avatar {
  display: grid;
  place-items: center;
  background: #e6e9e0;
  color: #536751;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  font-weight: 600
}

.logout-button {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 11px;
  padding: 9px 0 0 45px
}

.main-content {
  margin-left: 236px;
  padding: 0 44px 20px;
  max-width: 1900px
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  min-height: 81px;
  color: #7c898c;
  font-size: 11px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 36px
}

.breadcrumb-divider {
  padding: 0 11px;
  color: #bac2bd
}

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 27px
}

.page-heading p {
  margin-bottom: 0
}

.page-heading .button {
  flex-shrink: 0
}

.button {
  border: 1px solid var(--teal);
  border-radius: 8px;
  background: var(--teal);
  color: white;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 43px;
  padding: 10px 17px;
  font-weight: 550;
  font-size: 12px;
  line-height: 1.4;
  text-align: center
}

.button:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark)
}

.button.secondary {
  background: white;
  border-color: #d8e0db;
  color: var(--ink)
}

.button.secondary:hover {
  background: #f2f5f1;
  border-color: #a1b6a7
}

.button.plain {
  border-color: transparent;
  background: transparent;
  color: var(--muted)
}

.button.small {
  min-height: 37px;
  padding: 8px 13px
}

.button.full-width {
  width: 100%
}

.button-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap
}

.filter-row {
  display: flex;
  gap: 12px;
  margin: 0 0 24px;
  align-items: center;
  flex-wrap: wrap
}

.filter-row select {
  width: auto;
  min-width: 190px
}

.filter-row input {
  flex: 1;
  min-width: 180px
}

.filter-row.compact select {
  max-width: 280px
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 17px;
  margin-bottom: 30px
}

.metric {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 23px 23px 19px;
  background: white;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow)
}

.metric>span {
  font-size: 12px;
  color: var(--muted)
}

.metric strong {
  font-size: 38px;
  line-height: 1.5;
  font-weight: 550;
  letter-spacing: -1px
}

.metric small {
  font-size: 10px;
  display: flex;
  justify-content: space-between;
  gap: 6px
}

.metric.accent {
  background: var(--teal);
  border-color: var(--teal);
  color: white
}

.metric.accent>span,
.metric.accent small {
  color: #d2e7dd
}

a.metric:hover {
  transform: translateY(-2px);
  transition: transform .15s
}

.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 25px;
  box-shadow: var(--shadow)
}

.panel+.panel {
  margin-top: 20px
}

.table-panel {
  padding: 0;
  overflow: hidden
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px
}

.section-heading h2 {
  margin: 0
}

.section-heading p {
  font-size: 12px;
  margin: 7px 0 0
}

.table-panel>.section-heading {
  padding: 25px 25px 19px;
  margin: 0
}

.text-link {
  color: var(--teal);
  font-size: 12px;
  font-weight: 600
}

.text-link:hover {
  text-decoration: underline
}

.table-wrap {
  overflow-x: auto
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  text-align: left
}

thead {
  background: #fafbf8
}

th {
  font-size: 10px;
  color: #7b898d;
  font-weight: 500;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  white-space: nowrap
}

td {
  padding: 17px 20px;
  border-bottom: 1px solid #edf0ec
}

tr:last-child td {
  border-bottom: 0
}

td small {
  font-size: 10px;
  margin-top: 3px
}

tbody tr:hover {
  background: #fcfdfb
}

.document-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 550;
  min-width: 205px
}

.document-title:hover {
  color: var(--teal)
}

.document-title small {
  font-weight: 400
}

.pdf-icon {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .4px;
  background: #f6f0e8;
  color: #b1815b;
  display: grid;
  place-items: center;
  width: 31px;
  height: 36px;
  border-radius: 6px;
  flex-shrink: 0
}

.badge {
  font-size: 10px;
  line-height: 1.4;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 5px 8px;
  white-space: nowrap;
  font-weight: 550;
  background: #eef1ef;
  color: #6a777b
}

.badge.review,
.badge.open {
  background: #fbf0dd;
  color: #9c6e26
}

.badge.sent,
.badge.closed {
  background: #e7f1e9;
  color: #377457
}

.badge.approved,
.badge.pending,
.badge.in_progress,
.badge.sending {
  background: #eaf0f7;
  color: #4c7293
}

.badge.failed,
.badge.uncertain {
  background: #faeae6;
  color: #a04432
}

.row-arrow {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  font-size: 19px;
  color: #84948b
}

.row-arrow:hover {
  background: var(--mint);
  border-radius: 6px;
  color: var(--teal)
}

.empty-state {
  text-align: center;
  padding: 50px 30px;
  max-width: 650px;
  margin: auto
}

.empty-state p {
  max-width: 420px;
  margin: 0 auto 22px;
  color: var(--muted)
}

.empty-icon {
  display: grid;
  place-items: center;
  background: #eef3e9;
  color: var(--teal);
  width: 53px;
  height: 53px;
  border-radius: 15px;
  margin: 0 auto 20px;
  font-size: 25px
}

.dashboard-bottom {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  margin-top: 26px
}

.quiet-empty {
  padding: 25px 0 8px;
  color: var(--muted);
  font-size: 12px
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #83a786;
  margin-right: 8px
}

.workflow-card {
  padding: 26px 30px;
  border: 1px solid #e0e5d7;
  border-radius: var(--radius);
  background: #edf1e6
}

.workflow-card h2 {
  font-size: 24px;
  font-weight: 550;
  line-height: 1.3;
  margin-bottom: 13px
}

.workflow-card p {
  font-size: 12px;
  color: #6b7b68;
  max-width: 360px
}

.workflow-card .eyebrow {
  font-size: 9px;
  color: #7e936f
}

.feedback-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line)
}

.feedback-row:last-child {
  border: 0
}

.feedback-row>span:nth-child(2) {
  flex: 1
}

.feedback-row strong {
  font-size: 12px
}

.feedback-row small {
  font-size: 10px
}

.feedback-symbol {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f2f4ed;
  color: #809174
}

.page-footer {
  display: flex;
  justify-content: space-between;
  color: #96a09b;
  font-size: 10px;
  margin-top: 40px;
  padding: 20px 0 4px;
  border-top: 1px solid var(--line)
}

.back-link {
  display: inline-block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 24px
}

.back-link:hover {
  color: var(--teal)
}

.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(250px, 1fr);
  gap: 28px;
  max-width: 1150px;
  align-items: start
}

.note-card {
  background: #edf1e6;
  border: 1px solid #e0e5d7;
  border-radius: var(--radius);
  padding: 26px
}

.note-card h2 {
  font-size: 23px
}

.note-card p {
  font-size: 13px;
  color: #667761
}

.note-card.warning {
  background: #fbf2e1;
  border-color: #eadcbb;
  margin-top: 20px
}

.note-card.warning p {
  color: #89704e
}

label {
  font-weight: 550;
  font-size: 12px;
  display: block;
  margin-bottom: 7px
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid #d6ded8;
  border-radius: 7px;
  padding: 11px 12px;
  max-width: 100%;
  width: 100%;
  color: var(--ink);
  min-height: 42px
}

textarea {
  resize: vertical
}

input[type=file] {
  padding: 18px;
  background: #fafbf8;
  border: 1px dashed #bccbc1
}

input[type=checkbox] {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 3px 0 0;
  padding: 0;
  flex-shrink: 0;
  accent-color: var(--teal)
}

form p {
  margin-bottom: 19px
}

.helptext,
.helptext li {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 7px;
  line-height: 1.5
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 26px
}

.form-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 14px;
  margin-bottom: 0;
  line-height: 1.65
}

.errorlist {
  list-style: none;
  padding: 10px 12px;
  margin: 0 0 13px;
  background: #fcf0eb;
  color: #a14e39;
  font-size: 12px;
  border-radius: 6px
}

.errorlist li+li {
  margin-top: 5px
}

.messages {
  margin-bottom: 20px
}

.alert {
  border: 1px solid #dce6dd;
  background: #eef5ee;
  border-radius: 9px;
  padding: 14px 17px;
  font-size: 13px;
  margin-bottom: 16px;
  color: #396646
}

.alert.error {
  background: #fcf0eb;
  border-color: #ead4ca;
  color: #a14e39
}

.alert.warning {
  background: #fff4dc;
  border-color: #ecdcb7;
  color: #8a682e
}

.error-text {
  font-size: 12px;
  color: #a14e39;
  margin-top: 9px
}

.document-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 23px;
  align-items: start
}

.filename-heading {
  font-size: 28px;
  overflow-wrap: anywhere
}

.preview-panel {
  padding: 20px
}

.preview-panel .section-heading h2 {
  font-size: 16px
}

.document-actions .panel {
  padding: 22px
}

.document-actions h2 {
  font-size: 18px
}

.step-label {
  display: block;
  color: #8d9b91;
  font-size: 9px;
  letter-spacing: 1.3px;
  font-weight: 600;
  margin-bottom: 12px
}

.suggestions {
  padding: 12px 14px;
  border-radius: 7px;
  background: #f5f7f1;
  margin-bottom: 18px;
  font-size: 12px
}

.suggestions>strong {
  display: block;
  font-size: 10px;
  color: #788b76;
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 9px
}

.suggestions p {
  margin-bottom: 8px
}

.suggestions small {
  font-size: 10px
}

.small-link {
  display: block;
  margin-top: 15px;
  font-size: 11px
}

.recipient-summary {
  background: #f5f7f2;
  border: 1px solid #e7ede6;
  padding: 12px;
  border-radius: 7px;
  margin-bottom: 18px;
  overflow-wrap: anywhere
}

.recipient-summary strong,
.recipient-summary span {
  display: block;
  font-size: 12px
}

.recipient-summary span {
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px
}

.checkbox-label {
  display: flex;
  gap: 9px;
  font-weight: 400;
  line-height: 1.6;
  font-size: 11px;
  margin: 15px 0 18px
}

.detail-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
  align-items: start
}

.detail-columns>.panel {
  margin: 0
}

details {
  padding: 17px 0;
  border-bottom: 1px solid var(--line)
}

details:first-child {
  padding-top: 0
}

details:last-child {
  border-bottom: 0;
  padding-bottom: 0
}

summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px
}

summary span {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 11px;
  margin: 5px 0 0 17px
}

details[open] summary {
  margin-bottom: 19px
}

details p {
  font-size: 12px
}

.ocr-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: inherit;
  font-size: 12px;
  max-height: 350px;
  overflow-y: auto;
  background: #f7f8f5;
  padding: 15px;
  border-radius: 7px
}

.version-list,
.audit-list {
  list-style: none;
  margin: 0;
  padding: 0
}

.version-list li {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
  font-size: 12px
}

.version-list li:last-child {
  border: 0
}

.version-list small {
  font-size: 10px;
  margin-top: 4px
}

.version-list a {
  white-space: nowrap
}

.history-item {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px
}

.history-item:last-child {
  border: 0
}

.history-item small {
  margin: 4px 0 9px;
  font-size: 10px
}

.audit-list {
  max-height: 360px;
  overflow-y: auto
}

.audit-list li {
  font-size: 11px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line)
}

.audit-list small {
  font-size: 10px;
  margin-top: 3px
}

.thread-message {
  padding: 18px;
  background: #f4f6f1;
  border: 1px solid #e7ece3;
  border-radius: 9px;
  margin-bottom: 15px
}

.thread-message.staff-message {
  background: #edf4f2;
  border-color: #dce8e2;
  margin-left: 25px
}

.thread-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 10px;
  color: #75867a;
  margin-bottom: 11px;
  overflow-wrap: anywhere
}

.thread-meta time {
  white-space: nowrap
}

.message-body {
  font-size: 13px;
  overflow-wrap: anywhere
}

.reply-box {
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding-top: 24px
}

.reply-box>p {
  font-size: 12px
}

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

.tenant-grid>.panel {
  margin: 0
}

.tenant-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 19px
}

.tenant-avatar {
  width: 43px;
  height: 43px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: #e8eee2;
  color: #738564;
  font-size: 19px;
  font-weight: 600
}

.tenant-card h2 {
  font-size: 22px;
  margin-bottom: 6px
}

.tenant-card>p {
  font-size: 12px
}

.domain-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 17px 0
}

.domain-chips span {
  font-size: 10px;
  border: 1px solid var(--line);
  padding: 5px 8px;
  border-radius: 6px;
  background: #f9faf7;
  color: #6e7d71
}

.tenant-card details {
  padding-top: 13px
}

.folder-path {
  font-size: 10px;
  display: block;
  background: #f3f5f0;
  overflow-wrap: anywhere;
  padding: 10px;
  border-radius: 5px;
  margin-top: 8px
}

.tenant-card-footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  border-top: 1px solid var(--line);
  padding-top: 19px;
  margin-top: 20px
}

.narrow-panel {
  max-width: 680px
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 25px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 12px
}

.pagination a {
  color: var(--teal)
}

.public-layout .main-content {
  margin: 0 auto;
  max-width: 1200px;
  padding-top: 20px
}

.public-header {
  max-width: 1200px;
  margin: auto;
  padding: 30px 44px;
  display: flex;
  justify-content: space-between;
  align-items: center
}

.public-header .muted {
  font-size: 12px
}

.public-header .brand {
  font-size: 22px
}

.public-header .brand-mark {
  width: 34px;
  height: 38px;
  font-size: 26px
}

.public-layout .page-footer {
  margin-top: 60px
}

.login-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 80px;
  align-items: center;
  margin: 45px 20px 80px
}

.login-intro h1 {
  font-size: 52px;
  letter-spacing: -1.7px;
  line-height: 1.14
}

.login-intro>p {
  color: var(--muted);
  max-width: 330px;
  font-size: 15px;
  margin-top: 20px
}

.login-card {
  padding: 35px
}

.login-card h2 {
  font-size: 25px;
  margin-bottom: 12px
}

.login-card>p {
  font-size: 13px;
  margin-bottom: 25px
}

.login-card .eyebrow {
  font-size: 9px
}

.login-illustration {
  height: 195px;
  position: relative;
  margin-top: 35px;
  max-width: 340px
}

.paper-back,
.paper-front {
  position: absolute;
  width: 215px;
  height: 148px;
  border-radius: 9px;
  top: 15px;
  left: 45px
}

.paper-back {
  transform: rotate(-10deg);
  background: #d5e4d6;
  border: 1px solid #c9d9ca
}

.paper-front {
  transform: rotate(6deg);
  background: white;
  border: 1px solid #dfe5d9;
  padding: 25px;
  box-shadow: 0 10px 25px #1d463110
}

.paper-seal {
  position: absolute;
  right: 18px;
  top: 18px;
  color: var(--teal);
  font-size: 29px
}

.paper-front i {
  display: block;
  width: 90px;
  height: 4px;
  background: #e5ebe1;
  margin: 8px 0;
  border-radius: 4px
}

.paper-front i:nth-child(4) {
  width: 60px
}

.paper-front b {
  display: block;
  font-size: 11px;
  color: #86937b;
  margin-top: 22px;
  font-weight: 400
}

.public-layout .portal-card {
  max-width: 640px;
  margin: 30px auto
}

.public-layout .portal-heading {
  max-width: 740px;
  margin: 20px auto
}

.public-layout .card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 760px;
  margin: 20px auto
}

@media(min-width:1600px) {
  .main-content {
    padding-left: 60px;
    padding-right: 60px
  }
}

@media(max-width:1200px) {
  .sidebar {
    width: 210px;
    padding-left: 18px;
    padding-right: 18px
  }

  .main-content {
    margin-left: 210px;
    padding-left: 28px;
    padding-right: 28px
  }

  .metrics {
    gap: 12px
  }

  .metric {
    padding: 20px 16px
  }

  .metric>span {
    font-size: 11px
  }

  .metric small {
    font-size: 9px
  }

  .document-layout {
    grid-template-columns: minmax(0, 1fr) 290px
  }

  .document-actions .panel {
    padding: 19px
  }

  .page-heading h1 {
    font-size: 31px
  }

  .filename-heading {
    font-size: 25px !important
  }

  .section-heading {
    align-items: flex-start
  }

  .section-heading .text-link {
    white-space: nowrap;
    font-size: 11px
  }

  td,
  th {
    padding-left: 16px;
    padding-right: 16px
  }
}

@media(max-width:980px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }

  .dashboard-bottom,
  .detail-columns {
    grid-template-columns: 1fr
  }

  .document-layout {
    grid-template-columns: 1fr
  }

  .document-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start
  }

  .document-actions .panel+.panel {
    margin-top: 0
  }

  .form-layout {
    grid-template-columns: 1fr
  }

  .tenant-grid {
    grid-template-columns: 1fr
  }

  .login-layout {
    gap: 35px;
    margin-left: 0;
    margin-right: 0
  }

  .login-intro h1 {
    font-size: 42px
  }

  .login-card {
    padding: 25px
  }

  .page-heading {
    flex-wrap: wrap
  }

  .sidebar-note {
    display: none
  }

  .sidebar-bottom {
    padding-top: 30px
  }

  .topbar {
    font-size: 10px
  }

  .filter-row select {
    flex: 1
  }
}

@media(max-width:700px) {
  .sidebar {
    position: static;
    width: 100%;
    padding: 18px 20px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    display: block
  }

  .sidebar .brand {
    font-size: 18px
  }

  .sidebar .brand-mark {
    width: 30px;
    height: 34px;
    font-size: 24px
  }

  .workspace-label,
  .sidebar-bottom {
    display: none
  }

  .sidebar nav {
    display: flex;
    gap: 5px;
    margin-top: 16px;
    overflow-x: auto
  }

  .nav-link {
    font-size: 11px;
    padding: 9px;
    gap: 6px;
    white-space: nowrap;
    margin: 0
  }

  .nav-link span {
    font-size: 16px;
    width: auto
  }

  .main-content {
    margin: 0;
    padding: 0 20px 15px
  }

  .topbar {
    min-height: 58px;
    margin-bottom: 25px
  }

  .topbar>span:first-child {
    display: none
  }

  .topbar>span:last-child {
    margin-left: auto
  }

  .page-heading {
    gap: 15px;
    margin-bottom: 23px
  }

  .page-heading h1 {
    font-size: 29px
  }

  .page-heading p {
    font-size: 12px
  }

  .page-heading>.button {
    min-height: 39px
  }

  .eyebrow {
    font-size: 9px;
    margin-bottom: 10px
  }

  .metrics {
    gap: 10px
  }

  .metric {
    padding: 16px 14px
  }

  .metric strong {
    font-size: 32px
  }

  .metric small {
    font-size: 9px;
    min-height: 27px
  }

  .panel {
    padding: 20px
  }

  .table-panel {
    padding: 0
  }

  .table-panel>.section-heading {
    padding: 20px
  }

  .section-heading {
    flex-wrap: wrap;
    gap: 8px
  }

  .section-heading h2 {
    font-size: 17px
  }

  .section-heading .text-link {
    font-size: 10px
  }

  .table-wrap td,
  .table-wrap th {
    padding: 14px
  }

  .dashboard-bottom {
    gap: 18px
  }

  .document-actions {
    grid-template-columns: 1fr
  }

  .filter-row {
    gap: 8px
  }

  .filter-row select,
  .filter-row input {
    min-width: 140px
  }

  .filter-row input {
    flex-basis: 100%
  }

  .public-header {
    padding: 22px 20px
  }

  .public-header>.muted {
    display: none
  }

  .public-layout .main-content {
    padding: 15px 20px
  }

  .login-layout {
    grid-template-columns: 1fr;
    gap: 26px;
    margin: 15px 0 35px
  }

  .login-intro h1 {
    font-size: 39px
  }

  .login-intro>p {
    font-size: 13px;
    max-width: 350px
  }

  .login-illustration {
    display: none
  }

  .login-card {
    padding: 25px
  }

  .page-footer span {
    display: none
  }

  .filename-heading {
    font-size: 24px !important
  }

  .thread-message.staff-message {
    margin-left: 10px
  }

  .button-group {
    gap: 8px
  }

  .button-group .button {
    font-size: 11px;
    padding: 9px 12px
  }

  .tenant-card-footer {
    flex-wrap: wrap
  }

  .public-layout .page-footer {
    margin-top: 30px
  }
}

@media(prefers-reduced-motion:reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    transform: none !important
  }
}

/* A raster page preview works without browser PDF plug-ins or JavaScript. */
.preview-toolbar,
.preview-navigation,
.preview-controls,
.preview-page-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.preview-toolbar,
.preview-controls {
  justify-content: space-between;
  margin: 16px 0;
}

.preview-position {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.preview-position strong {
  color: var(--ink);
}

.preview-navigation .button {
  padding: 9px 13px;
  font-size: 12px;
}

.button.disabled {
  opacity: .4;
  cursor: default;
  pointer-events: none;
}

.document-canvas {
  padding: 16px;
  background: #e8ede8;
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: 78vh;
  overflow: auto;
}

.document-canvas:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
}

.document-page {
  display: block;
  width: 100%;
  height: auto;
  background: white;
  box-shadow: 0 2px 12px #243c2e18;
}

.document-canvas-detail .document-page {
  width: 1400px;
  max-width: none;
}

.preview-page-form label {
  margin: 0;
  font-size: 12px;
}

.preview-page-form select {
  width: auto;
  min-width: 70px;
}

.preview-controls .text-link {
  font-size: 12px;
}

.preview-error {
  border: 1px solid #e6cc9f;
  padding: 24px;
  background: #fff8ed;
  border-radius: 8px;
}

.preview-error p {
  font-size: 13px;
}

@media (max-width: 700px) {
  .preview-panel {
    padding: 16px;
  }

  .document-canvas {
    padding: 7px;
  }

  .preview-page-form {
    gap: 8px;
  }

  .preview-page-form label {
    width: 100%;
  }
}

/* Customer portal layout: static styles keep the Content Security Policy strict. */
.public-layout .portal-card-narrow {
  max-width: 640px;
  margin: 2rem auto;
  padding: 2rem;
}

.public-layout .portal-card-wide {
  max-width: 760px;
  margin: 2rem auto;
  padding: 2rem;
}

.portal-divider {
  margin: 2rem 0;
}

.portal-code-input {
  display: block;
  max-width: 220px;
  margin: 1rem 0;
  font-size: 1.5rem;
  letter-spacing: .3em;
}

.portal-footnote {
  margin-top: 2rem;
}

.portal-field {
  display: block;
  width: 100%;
  margin: 1rem 0;
}

.portal-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 2rem 0;
}

.portal-thread {
  max-width: 760px;
  margin: 2rem auto;
}

.public-layout .portal-message {
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.public-layout .portal-reply-card {
  padding: 1.5rem;
}

.operating-mode {
  margin: 0 0 24px;
  font-size: 13px;
}
