:root {
  --ink: #17221f;
  --muted: #66736f;
  --line: #dfe5e2;
  --canvas: #f4f6f5;
  --surface: #ffffff;
  --brand: #173f35;
  --brand-strong: #0f3028;
  --brand-soft: #e2eee9;
  --accent: #d49b4a;
  --danger: #a73737;
  --danger-soft: #fbeaea;
  --shadow: 0 16px 48px rgb(28 53 45 / 8%);
  --radius: 14px;
  --sidebar-width: 250px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--canvas);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

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

h1,
h2,
h3 {
  line-height: 1.18;
  letter-spacing: -0.025em;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(1.75rem, 2.5vw, 2.3rem);
}

h2 {
  margin-bottom: 8px;
  font-size: 1.25rem;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  background: var(--brand);
  color: white;
  font-family: Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.brand-light {
  color: white;
}

.brand-light .brand-mark {
  background: var(--surface);
  color: var(--brand);
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 9px 17px;
  cursor: pointer;
  font-weight: 680;
  text-decoration: none;
}

.button:focus-visible,
input:focus-visible,
summary:focus-visible,
.tenant-choice:focus-visible,
.menu-button:focus-visible {
  outline: 3px solid rgb(23 63 53 / 20%);
  outline-offset: 2px;
}

.button-primary {
  border-color: var(--brand);
  background: var(--brand);
  color: white;
}

.button-primary:not(:disabled):hover {
  background: var(--brand-strong);
}

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

.button-danger {
  border-color: #e0b6b6;
  background: white;
  color: var(--danger);
}

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

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button-block {
  width: 100%;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: #34423e;
  font-size: 0.87rem;
  font-weight: 680;
}

.field input {
  width: 100%;
  height: 46px;
  border: 1px solid #cbd5d1;
  border-radius: 9px;
  background: white;
  padding: 0 13px;
  color: var(--ink);
}

.field textarea,
.field select {
  width: 100%;
  border: 1px solid #cbd5d1;
  border-radius: 9px;
  background: white;
  padding: 11px 13px;
  color: var(--ink);
  resize: vertical;
}

.input-suffix {
  display: flex;
  align-items: center;
  border: 1px solid #cbd5d1;
  border-radius: 9px;
  background: white;
  padding-right: 13px;
  color: var(--muted);
}

.input-suffix:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgb(23 63 53 / 12%);
}

.input-suffix input {
  border: 0;
  outline: 0;
  box-shadow: none;
}

.field [aria-invalid="true"] {
  border-color: var(--danger);
}

.field-error {
  color: var(--danger);
  font-size: 0.78rem;
}

.field input:hover {
  border-color: #aab8b3;
}

.field input:focus {
  border-color: var(--brand);
}

.field small {
  color: var(--muted);
  font-size: 0.78rem;
}

.check-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 0.87rem;
}

.check-field input {
  margin-top: 3px;
}

.check-field a,
.auth-links a {
  color: var(--brand);
  font-weight: 650;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  font-size: 0.86rem;
}

.stack-form {
  display: grid;
  gap: 18px;
}

.alert {
  margin: 20px 0;
  border-radius: 9px;
  padding: 11px 13px;
  font-size: 0.9rem;
}

.alert-error {
  border: 1px solid #edc8c8;
  background: var(--danger-soft);
  color: var(--danger);
}

/* Authentication */

.auth-layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(420px, 0.85fr) minmax(500px, 1.15fr);
}

.auth-brand-panel {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(34px, 5vw, 72px);
  background: var(--brand);
  color: white;
}

.auth-brand-panel::before,
.auth-brand-panel::after {
  position: absolute;
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: 50%;
  content: "";
}

.auth-brand-panel::before {
  right: -280px;
  bottom: -220px;
  width: 640px;
  height: 640px;
}

.auth-brand-panel::after {
  right: -110px;
  bottom: -65px;
  width: 340px;
  height: 340px;
  background: rgb(255 255 255 / 2%);
}

.auth-message,
.auth-brand-footer,
.auth-brand-panel > .brand {
  position: relative;
  z-index: 1;
}

.auth-message {
  max-width: 580px;
}

.auth-message .eyebrow {
  color: #bdcfc9;
}

.auth-message h1 {
  margin-bottom: 24px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 4.4vw, 4.8rem);
  font-weight: 500;
  letter-spacing: -0.045em;
}

.auth-message > p:last-child {
  max-width: 520px;
  color: #d8e1de;
  font-size: 1.08rem;
}

.auth-brand-footer {
  margin: 0;
  color: #aec1bb;
  font-size: 0.83rem;
}

.auth-form-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 48px;
  background: #fafbf9;
}

.auth-card {
  width: min(100%, 410px);
}

.auth-card h2 {
  margin-bottom: 10px;
  font-size: 2rem;
}

.form-intro {
  margin-bottom: 30px;
  color: var(--muted);
}

.mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 46px;
  font-size: 1.05rem;
  font-weight: 750;
}

.auth-form-panel-wide {
  align-items: start;
  padding-block: 42px;
}

.auth-card-wide {
  width: min(100%, 590px);
}

.auth-secondary-action {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
}

.auth-secondary-action a {
  text-underline-offset: 3px;
}

.totp-setup-steps {
  display: grid;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.totp-setup-steps > li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 13px;
}

.totp-setup-steps p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.step-number {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 780;
}

.totp-enrollment {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin-top: 14px;
}

.totp-qr {
  display: block;
  width: 176px;
  height: 176px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  padding: 8px;
}

.manual-secret {
  min-width: 0;
}

.manual-secret small {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
}

.manual-secret code {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--canvas);
  padding: 10px 12px;
  font-size: 0.81rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.totp-confirm-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 13px;
}

.security-notice {
  margin-bottom: 20px;
  border: 1px solid #d7e3df;
  border-radius: 10px;
  background: var(--brand-soft);
  padding: 12px 14px;
  color: var(--brand-strong);
  font-size: 0.88rem;
}

.recovery-card {
  width: min(100%, 650px);
}

.recovery-code-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.recovery-code-grid li {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--canvas);
  padding: 9px 11px;
  text-align: center;
}

.recovery-code-grid code {
  font-size: 0.83rem;
  letter-spacing: 0.025em;
}

.recovery-hint {
  margin-bottom: 23px;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Application shell */

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--surface);
  padding: 25px 18px 18px;
}

.sidebar > .brand {
  margin: 0 9px 35px;
}

.main-nav {
  display: grid;
  gap: 4px;
}

.nav-section {
  margin: 25px 12px 7px;
  color: #89938f;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  min-height: 41px;
  align-items: center;
  gap: 11px;
  border-radius: 8px;
  padding: 8px 11px;
  color: #52605c;
  font-size: 0.89rem;
  font-weight: 590;
  text-decoration: none;
}

a.nav-item:hover {
  background: #f3f6f5;
  color: var(--ink);
}

.nav-item.is-active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 720;
}

.nav-item.is-disabled {
  color: #8d9894;
}

.nav-icon {
  display: grid;
  width: 21px;
  place-items: center;
}

.nav-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.app-column {
  min-width: 0;
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  height: 72px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 94%);
  padding: 0 clamp(20px, 4vw, 48px);
}

.topbar-spacer {
  flex: 1;
}

.tenant-menu {
  position: relative;
}

.tenant-menu > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 9px;
  cursor: pointer;
  list-style: none;
  padding: 5px 7px;
}

.tenant-menu > summary::-webkit-details-marker,
.mobile-nav > summary::-webkit-details-marker {
  display: none;
}

.tenant-menu > summary::after {
  margin-left: 2px;
  color: var(--muted);
  content: "⌄";
}

.tenant-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 760;
}

.tenant-summary {
  display: grid;
  line-height: 1.2;
}

.tenant-summary strong {
  max-width: 220px;
  overflow: hidden;
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tenant-summary small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: capitalize;
}

.menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 250px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  box-shadow: var(--shadow);
  padding: 8px;
}

.menu-panel a,
.menu-button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 7px;
  background: transparent;
  padding: 9px 10px;
  color: #3e4b47;
  cursor: pointer;
  font-size: 0.86rem;
  text-align: left;
  text-decoration: none;
}

.menu-panel a:hover,
.menu-button:hover {
  background: var(--canvas);
}

.menu-user {
  margin: 2px 3px 7px;
  border-bottom: 1px solid var(--line);
  padding: 7px 7px 12px;
  font-size: 0.84rem;
  font-weight: 650;
}

.menu-user small {
  color: var(--muted);
  font-weight: 400;
}

.mobile-nav {
  display: none;
  position: relative;
}

.main-content {
  width: min(100%, 1380px);
  margin: 0 auto;
  padding: clamp(26px, 4vw, 48px);
}

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

.page-heading p:last-child {
  margin: 0;
  color: var(--muted);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.metric-card,
.content-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 2px 7px rgb(28 53 45 / 2%);
}

.metric-card {
  display: grid;
  min-height: 145px;
  align-content: center;
  padding: 25px;
}

.metric-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 620;
}

.metric-card strong {
  margin-bottom: 7px;
  font-size: 1.65rem;
  letter-spacing: -0.03em;
}

.metric-card small {
  color: #82908b;
}

.metric-link {
  color: var(--ink);
  text-decoration: none;
}

.metric-link:hover {
  border-color: #b9ccc4;
  box-shadow: 0 8px 24px rgb(28 53 45 / 7%);
}

.content-card {
  padding: 25px;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.87rem;
}

.empty-state {
  border: 1px dashed #ccd5d1;
  border-radius: 11px;
  padding: 38px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state.compact {
  margin-top: 24px;
}

.empty-state h2,
.empty-state h3 {
  margin: 8px 0;
  color: var(--ink);
}

.empty-state p {
  margin-bottom: 0;
}

.empty-icon {
  display: block;
  color: var(--brand);
  font-size: 1.8rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 620;
  text-decoration: none;
}

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

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

.document-filters {
  display: flex;
  width: min(100%, 650px);
  align-items: center;
  gap: 10px;
}

.document-filters .search-field {
  flex: 1;
}

.filter-field select {
  min-width: 160px;
  border: 1px solid #cbd5d1;
  border-radius: 9px;
  background: white;
  padding: 11px 13px;
  color: var(--ink);
}

.search-field {
  display: flex;
  width: min(100%, 420px);
  height: 43px;
  align-items: center;
  gap: 8px;
  border: 1px solid #cbd5d1;
  border-radius: 9px;
  padding: 0 12px;
  color: var(--muted);
}

.search-field:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgb(23 63 53 / 12%);
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.data-table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-align: left;
  text-transform: uppercase;
}

.data-table td {
  border-bottom: 1px solid #edf0ef;
  padding: 15px 12px;
  color: #4f5d59;
}

.data-table tbody tr:hover {
  background: #fafcfb;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table td a {
  color: var(--ink);
  text-decoration: none;
}

.data-table td a:hover {
  color: var(--brand);
}

.number-chip,
.small-label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 670;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.table-action {
  width: 38px;
  text-align: right;
}

.record-form {
  display: grid;
  max-width: 900px;
  gap: 20px;
}

.form-heading {
  margin-bottom: 24px;
}

.form-section {
  display: grid;
  grid-template-columns: minmax(180px, 0.38fr) minmax(0, 1fr);
  gap: 35px;
}

.form-grid {
  display: grid;
  gap: 18px;
}

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

.form-grid.address-grid {
  grid-template-columns: 110px minmax(0, 1fr) 90px;
}

.span-two {
  grid-column: 1 / -1;
}

.postal-field {
  grid-column: 1;
}

.city-field {
  grid-column: 2;
}

.country-field {
  grid-column: 3;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 4px 0 30px;
}

.form-actions.split-actions {
  justify-content: space-between;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  gap: 22px;
}

.detail-main {
  display: grid;
  gap: 22px;
}

.detail-sidebar {
  display: grid;
  gap: 20px;
}

.subtle-card p {
  margin: 0;
  color: var(--muted);
}

.customer-document-list {
  display: grid;
  margin-top: 14px;
}

.customer-document-list a {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 12px 0;
  color: var(--ink);
  font-size: 0.8rem;
  text-decoration: none;
}

.customer-document-list a > span {
  display: grid;
  min-width: 0;
}

.customer-document-list small {
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-document-list a > strong {
  white-space: nowrap;
}

.address-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  margin-top: 22px;
}

.address-card {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 17px;
  color: #50605b;
  font-size: 0.88rem;
}

.address-card .small-label {
  margin-bottom: 10px;
}

.address-card strong {
  margin-bottom: 4px;
  color: var(--ink);
}

.contact-list {
  display: grid;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 13px 0;
}

.contact-list li > span:nth-child(2) {
  display: grid;
}

.contact-remove {
  margin-left: auto;
}

.contact-list small {
  margin-top: 2px;
  color: var(--muted);
}

.contact-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 750;
}

.inline-empty {
  margin: 20px 0;
  color: var(--muted);
}

.inline-create {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 17px;
}

.inline-create summary {
  display: inline-block;
  margin-bottom: 17px;
  color: var(--brand);
  cursor: pointer;
  font-weight: 680;
  list-style: none;
}

.inline-actions {
  text-align: right;
}

.danger-zone {
  border: 1px solid #eccaca;
  border-radius: var(--radius);
  background: #fffafa;
  padding: 20px;
}

.danger-zone h2 {
  color: var(--danger);
  font-size: 1rem;
}

.danger-zone p {
  color: #7b6060;
  font-size: 0.82rem;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  background: #edf1ef;
  color: #53615d;
  font-size: 0.74rem;
  font-weight: 680;
  white-space: nowrap;
}

.status-finalized,
.status-sent {
  background: #e5eef5;
  color: #2b5b7d;
}

.status-paid {
  background: var(--brand-soft);
  color: var(--brand);
}

.status-cancelled {
  background: var(--danger-soft);
  color: var(--danger);
}

.editor-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(270px, 0.55fr);
  gap: 28px;
  margin-bottom: 24px;
}

.editor-heading h1 {
  margin-bottom: 0;
}

.preview-label {
  align-self: end;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.document-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(270px, 0.55fr);
  align-items: start;
  gap: 28px;
}

.editor-fields {
  display: grid;
  min-width: 0;
  gap: 20px;
}

.editor-section {
  grid-template-columns: 1fr;
  gap: 22px;
}

.items-section {
  display: block;
}

.item-table-wrap {
  width: 100%;
  margin-top: 20px;
  overflow-x: auto;
}

.item-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

.item-table th {
  border-bottom: 1px solid var(--line);
  padding: 8px 5px;
  color: var(--muted);
  font-size: 0.67rem;
  letter-spacing: 0.025em;
  text-align: left;
  text-transform: uppercase;
}

.item-table td {
  border-bottom: 1px solid var(--line);
  padding: 9px 5px;
  vertical-align: top;
}

.item-table input,
.item-table select,
.item-table textarea {
  width: 100%;
  border: 1px solid #d5deda;
  border-radius: 7px;
  background: white;
  padding: 8px;
  color: var(--ink);
  font-size: 0.78rem;
}

.item-table textarea {
  min-width: 185px;
  resize: vertical;
}

.item-description select {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.71rem;
}

.item-table .number-input {
  min-width: 80px;
}

.item-table .short-input {
  min-width: 63px;
}

.item-move {
  width: 25px;
}

.item-move button,
.icon-button {
  display: block;
  border: 0;
  background: transparent;
  color: #85918d;
  cursor: pointer;
  line-height: 1;
  padding: 3px;
}

.icon-button {
  color: var(--danger);
  font-size: 1.2rem;
}

.item-total {
  min-width: 92px;
  padding-top: 17px !important;
  font-size: 0.8rem;
  font-weight: 680;
  text-align: right;
  white-space: nowrap;
}

.add-item-button {
  margin-top: 12px;
  border: 0;
  background: transparent;
  color: var(--brand);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 680;
}

.document-totals {
  display: grid;
  width: min(100%, 350px);
  gap: 7px;
  margin: 24px 0 0 auto;
}

.document-totals > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 0.84rem;
}

.document-totals strong {
  color: var(--ink);
}

.document-totals .grand-total {
  margin-top: 5px;
  border-top: 1px solid var(--ink);
  padding-top: 10px;
  color: var(--ink);
  font-size: 1rem;
}

.document-totals .grand-total strong {
  font-size: 1.14rem;
}

.document-totals.totals-invalid {
  border-radius: 8px;
  background: #f8faf9;
  padding: 12px;
}

.totals-invalid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.editor-actions {
  position: sticky;
  z-index: 5;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: rgb(244 246 245 / 95%);
  padding: 15px 0 20px;
}

.document-preview {
  position: sticky;
  top: 100px;
}

.preview-paper {
  aspect-ratio: 1 / 1.414;
  border: 1px solid #d8dddb;
  background: white;
  box-shadow: 0 12px 35px rgb(25 48 41 / 9%);
  padding: 10%;
}

.preview-brand {
  color: var(--brand);
  font-family: Georgia, serif;
  font-size: clamp(0.85rem, 1.3vw, 1.2rem);
  font-weight: 700;
}

.preview-address {
  width: 62%;
  margin: 20% 0 15%;
  border-bottom: 4px solid #edf1ef;
  padding-bottom: 9%;
  color: var(--muted);
  font-size: 0.58rem;
}

.preview-paper h2 {
  display: flex;
  justify-content: space-between;
  color: var(--brand);
  font-family: Georgia, serif;
  font-size: clamp(0.85rem, 1.35vw, 1.2rem);
}

.preview-paper h2 span {
  color: var(--muted);
  font-family: inherit;
  font-size: 0.55em;
  font-weight: 400;
}

.preview-lines {
  display: grid;
  gap: 8px;
  margin-top: 15%;
}

.preview-lines span {
  height: 5px;
  background: #edf1ef;
}

.preview-lines span:nth-child(2) {
  width: 87%;
}

.preview-total {
  display: flex;
  justify-content: space-between;
  margin-top: 23%;
  border-top: 1px solid var(--brand);
  padding-top: 8px;
  color: var(--muted);
  font-size: 0.65rem;
}

.document-preview > p {
  margin: 12px 10px 0;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

.heading-actions {
  display: flex;
  gap: 9px;
}

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

.document-summary {
  display: grid;
  gap: 28px;
}

.summary-meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
}

.summary-meta > div {
  display: grid;
  gap: 5px;
}

.summary-meta span:first-child {
  color: var(--muted);
  font-size: 0.73rem;
}

.static-totals {
  margin-top: 0;
}

.document-actions {
  display: grid;
  gap: 9px;
  margin-top: 17px;
}

.recent-list {
  display: grid;
  margin-top: 22px;
}

.recent-list > a {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto 120px 20px;
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 14px 5px;
  color: var(--ink);
  text-decoration: none;
}

.recent-list > a > span:first-child {
  display: grid;
}

.recent-list small {
  margin-top: 2px;
  color: var(--muted);
}

.settings-card {
  max-width: 760px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.settings-grid .settings-card {
  max-width: none;
}

.detail-list {
  margin: 28px 0 0;
}

.detail-list > div {
  display: grid;
  grid-template-columns: minmax(130px, 0.35fr) 1fr;
  border-top: 1px solid var(--line);
  padding: 15px 0;
}

.detail-list dt {
  color: var(--muted);
}

.detail-list dd {
  min-width: 0;
  margin: 0;
  font-weight: 620;
  overflow-wrap: anywhere;
}

/* Tenant selection */

.selection-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 20px;
}

.selection-card {
  width: min(100%, 560px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  box-shadow: var(--shadow);
  padding: clamp(28px, 5vw, 50px);
}

.mobile-brand.always-visible {
  display: flex;
}

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

.tenant-choice {
  display: grid;
  width: 100%;
  min-height: 66px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  padding: 10px 13px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.tenant-choice:hover {
  border-color: #aebbb7;
  background: #fbfcfc;
}

.tenant-choice > span:nth-child(2) {
  display: grid;
}

.tenant-choice small {
  margin-top: 3px;
  color: var(--muted);
}

.selection-logout {
  margin-top: 26px;
  text-align: center;
}

@media (max-width: 900px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-brand-panel {
    display: none;
  }

  .auth-form-panel {
    min-height: 100vh;
    padding: 30px 22px;
  }

  .mobile-brand {
    display: flex;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .mobile-nav {
    display: block;
  }

  .mobile-nav > summary {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.3rem;
    list-style: none;
    padding: 7px 9px;
  }

  .mobile-nav nav {
    position: absolute;
    top: calc(100% + 9px);
    left: 0;
    display: grid;
    width: min(360px, calc(100vw - 30px));
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: white;
    box-shadow: var(--shadow);
    padding: 8px;
  }

  .mobile-nav nav a,
  .mobile-nav nav span {
    border-radius: 7px;
    padding: 9px 10px;
    color: var(--muted);
    text-decoration: none;
  }

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

  .form-section {
    grid-template-columns: 1fr;
    gap: 22px;
  }

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

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .editor-heading,
  .document-editor-layout,
  .final-document-layout {
    grid-template-columns: 1fr;
  }

  .preview-label,
  .document-preview {
    display: none;
  }

  .detail-sidebar {
    grid-row: 2;
  }
}

@media (max-width: 520px) {

  .auth-form-panel-wide {
    padding-block: 25px;
  }

  .totp-enrollment {
    grid-template-columns: 1fr;
  }

  .totp-qr {
    width: 160px;
    height: 160px;
  }

  .totp-confirm-form,
  .recovery-code-grid {
    grid-template-columns: 1fr;
  }

  .totp-confirm-form .button {
    width: 100%;
  }
  .topbar {
    height: 64px;
    padding: 0 15px;
  }

  .tenant-summary {
    display: none;
  }

  .tenant-menu > summary::after {
    display: none;
  }

  .main-content {
    padding: 25px 16px;
  }

  .page-heading {
    display: grid;
    margin-bottom: 24px;
  }

  .page-heading .button {
    width: 100%;
  }

  .metric-card {
    min-height: 125px;
    padding: 21px;
  }

  .content-card {
    padding: 18px;
  }

  .form-grid.two-columns,
  .form-grid.address-grid,
  .address-cards {
    grid-template-columns: 1fr;
  }

  .postal-field,
  .city-field,
  .country-field {
    grid-column: 1;
  }

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

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

  .split-actions > span:empty {
    display: none;
  }

  .split-actions > span:last-child {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .split-actions > .button {
    width: 100%;
  }

  .document-filters {
    display: grid;
  }

  .document-filters .search-field,
  .document-filters .filter-field select {
    width: 100%;
  }

  .editor-actions {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
    border-top: 0;
    padding-bottom: 0;
  }

  .item-table-wrap {
    overflow-x: visible;
  }

  .item-table,
  .item-table tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .item-table thead {
    display: none;
  }

  .item-table .document-item {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 12px;
    border-bottom: 1px solid var(--line);
    padding: 0 0 20px;
  }

  .item-table .document-item + .document-item {
    padding-top: 20px;
  }

  .item-table .document-item td {
    display: grid;
    min-width: 0;
    gap: 5px;
    border: 0;
    padding: 0;
  }

  .item-table .document-item td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 0.67rem;
    font-weight: 680;
    letter-spacing: 0.025em;
    text-transform: uppercase;
  }

  .item-table .item-description {
    grid-column: 1 / -1;
  }

  .item-table .item-move {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
  }

  .item-table .item-move::before {
    margin-right: auto;
  }

  .item-table .item-move button {
    display: inline-block;
    padding: 5px 9px;
  }

  .item-table .number-input,
  .item-table .short-input,
  .item-table textarea {
    min-width: 0;
  }

  .item-table .item-total {
    align-content: end;
    min-width: 0;
    padding-top: 0 !important;
    text-align: left;
  }

  .item-remove {
    position: absolute;
    top: 1px;
    right: 0;
  }

  .item-remove::before {
    display: none;
  }

  .summary-meta {
    grid-template-columns: 1fr;
  }

  .recent-list > a {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .recent-list > a > span:nth-child(3) {
    display: none;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table thead {
    display: none;
  }

  .data-table tr {
    position: relative;
    border-bottom: 1px solid var(--line);
    padding: 13px 34px 13px 0;
  }

  .data-table td {
    display: grid;
    grid-template-columns: 112px 1fr;
    border: 0;
    padding: 4px 0;
  }

  .data-table td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 0.75rem;
  }

  .data-table td:first-child {
    display: block;
    padding-bottom: 7px;
    font-size: 1rem;
  }

  .data-table td:first-child::before,
  .data-table .table-action::before {
    display: none;
  }

  .data-table .table-action {
    position: absolute;
    top: 13px;
    right: 2px;
    display: block;
    width: auto;
  }

  .selection-page {
    align-items: start;
    padding: 20px 12px;
  }

  .selection-card {
    border: 0;
    box-shadow: none;
    padding: 24px 15px;
  }
}

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

/* Public site, account flows and operator UI */
.public-body { background: #f7f8f5; }
.public-header { display: flex; width: min(1180px, calc(100% - 48px)); align-items: center; justify-content: space-between; margin: 0 auto; padding: 24px 0; }
.public-header nav, .public-footer nav { display: flex; align-items: center; gap: 26px; }
.public-header nav > a:not(.button), .public-footer a { color: var(--muted); font-weight: 620; text-decoration: none; }
.hero { display: grid; width: min(1180px, calc(100% - 48px)); min-height: 650px; align-items: center; gap: 70px; grid-template-columns: .92fr 1.08fr; margin: 0 auto; padding: 70px 0 90px; }
.hero h1 { max-width: 720px; margin-bottom: 26px; font-size: clamp(3.4rem, 6.2vw, 6.4rem); line-height: .96; }
.hero-lead { max-width: 650px; color: var(--muted); font-size: 1.16rem; }
.hero-actions { display: flex; align-items: center; gap: 14px; margin-top: 30px; }
.button-quiet { color: var(--brand); }
.hero-note { margin-top: 18px; color: #78847f; font-size: .82rem; }
.mock-window { overflow: hidden; border: 1px solid #d7ded9; border-radius: 20px; background: white; box-shadow: 0 35px 90px rgb(24 50 42 / 16%); transform: rotate(1.2deg); }
.mock-bar { display: flex; gap: 6px; border-bottom: 1px solid var(--line); padding: 13px 16px; }
.mock-bar span { width: 8px; height: 8px; border-radius: 50%; background: #d6ddd9; }
.mock-body { display: grid; min-height: 430px; grid-template-columns: 120px 1fr; }
.mock-nav { background: var(--brand); }
.mock-content { padding: 70px 38px; }
.mock-kicker { color: var(--brand); font-size: .65rem; font-weight: 800; letter-spacing: .13em; }
.mock-content > strong { display: block; margin: 8px 0 28px; font-size: 1.9rem; }
.mock-metrics { display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr); }
.mock-metrics i { height: 74px; border-radius: 9px; background: #e7efeb; }
.mock-list { display: grid; gap: 10px; margin-top: 28px; }
.mock-list b { height: 38px; border-bottom: 1px solid var(--line); }
.public-section, .workflow-section, .security-section, .public-cta { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 100px 0; }
.public-section > h2, .workflow-section h2, .security-section h2, .public-cta h2 { max-width: 700px; font-size: clamp(2.2rem, 4vw, 4rem); }
.feature-grid { display: grid; gap: 18px; grid-template-columns: repeat(3, 1fr); margin-top: 48px; }
.feature-grid article { min-height: 250px; border: 1px solid var(--line); border-radius: 16px; background: white; padding: 30px; }
.feature-grid article > span { color: var(--accent); font-weight: 800; }
.feature-grid h3 { margin: 70px 0 10px; font-size: 1.45rem; }
.feature-grid p, .security-section > p, .public-cta p { color: var(--muted); }
.workflow-section, .security-section { display: grid; gap: 70px; grid-template-columns: .9fr 1.1fr; border-top: 1px solid var(--line); }
.workflow-section ol { display: grid; gap: 0; margin: 0; padding: 0; counter-reset: flow; list-style: none; }
.workflow-section li { display: grid; gap: 4px; border-bottom: 1px solid var(--line); padding: 22px 0 22px 52px; position: relative; }
.workflow-section li::before { position: absolute; top: 22px; left: 0; width: 30px; color: var(--accent); content: "0" counter(flow); counter-increment: flow; font-weight: 800; }
.workflow-section li span { color: var(--muted); }
.security-section { border-radius: 24px; background: var(--brand); color: white; padding: 72px; }
.security-section .eyebrow, .security-section > p { color: #b9d4ca; }
.security-section > p { align-self: center; font-size: 1.08rem; }
.public-cta { text-align: center; }
.public-cta h2, .public-cta p { margin-right: auto; margin-left: auto; }
.public-cta p { max-width: 620px; }
.public-footer { display: flex; width: min(1180px, calc(100% - 48px)); align-items: center; justify-content: space-between; border-top: 1px solid var(--line); margin: 0 auto; padding: 36px 0; color: var(--muted); font-size: .86rem; }
.centered-state { display: grid; min-height: 100vh; place-items: center; padding: 30px; }
.state-card { width: min(560px, 100%); border: 1px solid var(--line); border-radius: 18px; background: white; padding: 54px; box-shadow: var(--shadow); text-align: center; }
.state-card-form { text-align: left; }
.state-icon { display: grid; width: 58px; height: 58px; place-items: center; border-radius: 50%; margin: 0 auto 24px; background: var(--brand-soft); color: var(--brand); font-size: 1.4rem; font-weight: 800; }
.state-icon-error { background: var(--danger-soft); color: var(--danger); }
.resend-panel { margin: 24px 0; text-align: left; }
.resend-panel summary { color: var(--brand); cursor: pointer; font-weight: 700; text-align: center; }
.resend-panel form { margin-top: 16px; }
.legal-page, .platform-main { width: min(1180px, calc(100% - 48px)); margin: 70px auto; }
.legal-page { max-width: 820px; }
.legal-page > h1 { margin-bottom: 14px; font-size: clamp(2.6rem, 6vw, 4.7rem); line-height: 1; }
.legal-lead { margin: 0 0 36px; color: var(--muted); font-size: 1.05rem; }
.legal-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.legal-card { min-height: 190px; border: 1px solid var(--line); border-radius: 16px; background: white; padding: 28px; }
.legal-card h2, .legal-copy h2 { margin: 0 0 16px; font-size: 1rem; letter-spacing: -.01em; }
.legal-card p, .legal-card address { margin: 0; color: var(--muted); font-style: normal; line-height: 1.75; }
.legal-card strong { color: var(--ink); }
.legal-card a, .legal-copy a, .legal-back a { color: var(--brand); font-weight: 650; }
.legal-copy { border-top: 1px solid var(--line); margin-top: 34px; padding-top: 28px; }
.legal-copy + .legal-copy { margin-top: 28px; }
.legal-copy p { color: var(--muted); line-height: 1.75; }
.legal-back { margin-top: 46px; }
.platform-body { background: var(--canvas); }
.platform-header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: white; padding: 16px 30px; }
.platform-header > div, .platform-header form { display: flex; align-items: center; gap: 18px; margin: 0; }
.inline-form { display: inline-flex; align-items: center; gap: 8px; }
.inline-form input, .inline-form select { width: auto; min-height: 38px; border: 1px solid #cbd5d1; border-radius: 8px; padding: 6px 9px; }
table small, .member-row small { display: block; color: var(--muted); }
.settings-grid { display: grid; align-items: start; gap: 22px; grid-template-columns: minmax(0, 1fr) 340px; }
.member-list { display: grid; }
.member-row { display: grid; align-items: center; gap: 14px; grid-template-columns: auto minmax(180px, 1fr) auto auto auto; border-top: 1px solid var(--line); padding: 16px 0; }
.member-identity { min-width: 0; }
.member-identity small { overflow: hidden; text-overflow: ellipsis; }
.member-subheading { margin-top: 34px; }
.muted-avatar { background: #eef1ef; color: var(--muted); }
.row-menu { position: relative; }
.row-menu summary { cursor: pointer; list-style: none; }
.row-menu > div { position: absolute; z-index: 3; top: 30px; right: 0; width: 190px; border: 1px solid var(--line); border-radius: 9px; background: white; padding: 8px; box-shadow: var(--shadow); }
.row-menu button { width: 100%; border: 0; background: none; padding: 9px; cursor: pointer; text-align: left; }
.row-menu a { display: block; padding: 9px; color: var(--ink); text-decoration: none; }
.danger-link { color: var(--danger); }
.role-guide { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 20px; }
.role-guide h3 { margin-bottom: 12px; font-size: .94rem; }
.role-guide p { margin: 8px 0; color: var(--muted); font-size: .82rem; }
.narrow-card { max-width: 680px; }
.platform-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.heading-actions, .review-actions, .export-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.heading-actions form, .review-actions form { margin: 0; }
.upload-card { max-width: 850px; }
.dropzone { display: grid; min-height: 300px; place-items: center; align-content: center; gap: 7px; border: 2px dashed #adc0b8; border-radius: 16px; background: #f9fbfa; padding: 40px; cursor: pointer; text-align: center; }
.dropzone:hover, .dropzone:focus-within { border-color: var(--brand); background: var(--brand-soft); }
.dropzone-icon { display: grid; width: 58px; height: 58px; place-items: center; border-radius: 50%; background: var(--brand); color: white; font-size: 1.5rem; }
.dropzone > span:last-of-type { color: var(--muted); font-size: .86rem; }
.dropzone input { width: 100%; max-width: 100%; margin-top: 16px; }
.privacy-note { border: 1px solid #d5e3dd; border-radius: 10px; background: #f1f7f4; padding: 16px; }
.privacy-note p { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }
.review-layout { display: grid; align-items: start; gap: 22px; grid-template-columns: minmax(360px, .9fr) minmax(520px, 1.1fr); }
.document-viewer { overflow: hidden; min-height: 740px; border: 1px solid var(--line); border-radius: 14px; background: #dfe4e1; position: sticky; top: 92px; }
.viewer-toolbar { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: white; padding: 12px 16px; }
.viewer-toolbar a { color: var(--brand); font-size: .84rem; font-weight: 650; }
.document-viewer iframe { width: 100%; height: 690px; border: 0; background: white; }
.document-viewer > img { display: block; width: 100%; max-height: 690px; object-fit: contain; }
.xml-preview { display: grid; min-height: 660px; place-items: center; align-content: center; gap: 10px; }
.xml-preview > span { color: var(--brand); font-size: 3rem; font-weight: 800; }
.review-form fieldset { display: grid; gap: 18px; border: 0; margin: 0; padding: 0; }
.money-grid { display: grid; gap: 12px; grid-template-columns: repeat(4, 1fr); }
.review-actions { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 18px; }
.category-grid { display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr); margin-top: 20px; }
.category-grid article { display: grid; gap: 3px; border: 1px solid var(--line); border-radius: 9px; padding: 14px; }
.category-grid span, .quota-note, .muted { color: var(--muted); font-size: .85rem; }
.key-values { display: grid; gap: 12px; }
.key-values div { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.key-values dt { color: var(--muted); }
.key-values dd { margin: 0; font-weight: 700; }
.export-row { border-top: 1px solid var(--line); padding: 16px 0; }
.status-queued, .status-processing, .status-pending { background: #fff1cf; color: #765617; }
.status-review_required { background: #fce8cc; color: #7f5111; }
.status-approved, .status-active, .status-exported { background: var(--brand-soft); color: var(--brand); }
.status-failed, .status-suspended, .status-rejected { background: var(--danger-soft); color: var(--danger); }

@media (max-width: 850px) {
  .public-header { width: min(100% - 30px, 1180px); }
  .public-header nav > a:not(.button) { display: none; }
  .hero { width: min(100% - 30px, 1180px); min-height: auto; grid-template-columns: 1fr; padding: 55px 0; }
  .hero-copy { min-width: 0; }
  .hero h1 { font-size: clamp(2.65rem, 12vw, 5rem); }
  .hero-product { display: none; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-actions .button { text-align: center; }
  .public-section, .workflow-section, .security-section, .public-cta, .public-footer { width: min(100% - 30px, 1180px); padding: 70px 0; }
  .feature-grid, .workflow-section, .security-section, .settings-grid { grid-template-columns: 1fr; }
  .security-section { padding: 34px; }
  .feature-grid article { min-height: 210px; }
  .public-footer { align-items: flex-start; gap: 24px; flex-direction: column; }
  .public-footer nav { align-items: flex-start; gap: 12px; flex-direction: column; }
  .legal-page { width: min(100% - 30px, 820px); margin: 44px auto; }
  .legal-grid { grid-template-columns: 1fr; }
  .legal-card { min-height: 0; padding: 24px; }
  .state-card { padding: 34px 24px; }
  .member-row { grid-template-columns: auto 1fr auto; }
  .member-row .inline-form, .member-row > form { grid-column: 1 / -1; }
  .review-layout { grid-template-columns: 1fr; }
  .document-viewer { min-height: 420px; position: static; }
  .document-viewer iframe { height: 380px; }
  .money-grid, .category-grid { grid-template-columns: repeat(2, 1fr); }
  .heading-actions { align-items: stretch; flex-direction: column; }
  .dropzone { min-height: 260px; padding: 28px 18px; }
}
