:root {
  color-scheme: dark;
  --app-bg: #05080d;
  --app-panel: #0d131c;
  --app-panel-strong: #121a25;
  --app-line: rgba(204, 222, 242, 0.14);
  --app-text: #f5f7fb;
  --app-muted: #9daabb;
  --app-soft: #6f7d90;
  --app-mint: #72ebda;
  --app-cyan: #78dff5;
  --app-gold: #d7af61;
  --app-danger: #ff8d98;
  --paper: #ffffff;
  --paper-text: #18202b;
  --paper-muted: #586779;
  --paper-line: #dce4ec;
  --paper-blue: #0077b8;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 0;
  margin: 0;
  background: var(--app-bg);
  color: var(--app-text);
  letter-spacing: 0;
  text-rendering: geometricPrecision;
}

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

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

button {
  color: inherit;
}

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

img {
  display: block;
  max-width: 100%;
}

.is-hidden {
  display: none !important;
}

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

.app-shell {
  min-height: 100vh;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    radial-gradient(circle at 76% 18%, rgba(114, 235, 218, 0.08), transparent 28%),
    var(--app-bg);
  background-size: 72px 72px, 72px 72px, auto, auto;
}

.app-topbar,
.contract-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--app-line);
  background: rgba(5, 8, 13, 0.88);
  padding: 12px clamp(18px, 4vw, 56px);
  backdrop-filter: blur(20px) saturate(1.2);
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.app-brand img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 12px 30px rgba(215, 175, 97, 0.22);
}

.app-brand strong,
.app-brand small {
  display: block;
  line-height: 1;
}

.app-brand strong {
  font-size: 14px;
  font-weight: 800;
}

.app-brand small {
  margin-top: 5px;
  color: var(--app-soft);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.topbar-actions,
.contract-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.environment-pill,
.confidential-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--app-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  padding: 9px 12px;
  color: #cbd5e2;
  font-size: 11px;
  font-weight: 700;
}

.environment-pill i,
.metric-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--app-mint);
  box-shadow: 0 0 0 4px rgba(114, 235, 218, 0.1);
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.icon-button:hover {
  border-color: rgba(114, 235, 218, 0.38);
  background: rgba(114, 235, 218, 0.08);
  transform: translateY(-1px);
}

.icon-button svg,
.button svg,
.text-button svg,
.auth-points svg,
.notice-box svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.button-primary {
  background: linear-gradient(135deg, #c9fff5, #50d9e9);
  color: #051017;
  box-shadow: 0 12px 34px rgba(80, 217, 233, 0.15);
}

.button-quiet {
  border-color: var(--app-line);
  background: rgba(255, 255, 255, 0.035);
  color: #e2e8f0;
}

.button-full {
  width: 100%;
}

.app-kicker {
  margin: 0 0 12px;
  color: var(--app-mint);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-view {
  display: grid;
  width: min(1180px, calc(100% - 40px));
  min-height: calc(100vh - 77px);
  margin: 0 auto;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.58fr);
  gap: clamp(44px, 8vw, 120px);
  align-items: center;
  padding: 70px 0;
}

.auth-copy {
  max-width: 720px;
}

.auth-copy h1,
.dashboard-intro h1 {
  margin: 0;
  font-family: "Instrument Sans", sans-serif;
  font-size: clamp(44px, 6vw, 78px);
  line-height: 0.98;
  font-weight: 700;
}

.auth-copy > p:not(.app-kicker) {
  max-width: 650px;
  margin: 26px 0 0;
  color: #bdc9d8;
  font-size: 17px;
  line-height: 1.8;
}

.auth-points {
  display: grid;
  gap: 14px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}

.auth-points li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #d6deea;
  font-size: 13px;
}

.auth-points svg {
  color: var(--app-mint);
}

.auth-panel {
  border: 1px solid var(--app-line);
  border-top-color: rgba(114, 235, 218, 0.42);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(17, 25, 36, 0.96), rgba(9, 14, 22, 0.96));
  padding: clamp(26px, 4vw, 42px);
  box-shadow: var(--shadow);
}

.panel-label {
  color: var(--app-gold);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-panel h2 {
  margin: 16px 0 8px;
  font-size: 27px;
}

.auth-panel > p {
  margin: 0 0 26px;
  color: var(--app-muted);
  font-size: 13px;
  line-height: 1.6;
}

.auth-panel > small {
  display: block;
  margin-top: 15px;
  color: var(--app-soft);
  text-align: center;
  font-size: 10px;
}

.form-feedback {
  min-height: 18px;
  margin: 12px 0 0;
  color: var(--app-muted);
  font-size: 11px;
  line-height: 1.5;
}

.form-feedback.is-error {
  color: var(--app-danger);
}

.form-feedback.is-success {
  color: var(--app-mint);
}

.dashboard-view {
  width: min(1260px, calc(100% - 40px));
  margin: 0 auto;
  padding: 58px 0 80px;
}

.dashboard-intro,
.section-toolbar,
.dialog-header,
.dialog-footer,
.signature-pad-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.dashboard-intro h1 {
  font-size: clamp(42px, 5vw, 66px);
}

.dashboard-intro > div > p:last-child {
  margin: 14px 0 0;
  color: var(--app-muted);
  font-size: 14px;
}

.metric-grid {
  display: grid;
  margin-top: 42px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  min-height: 154px;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: rgba(13, 19, 28, 0.82);
  padding: 22px;
}

.metric-card-accent {
  border-color: rgba(114, 235, 218, 0.28);
  background: linear-gradient(145deg, rgba(17, 47, 50, 0.62), rgba(13, 19, 28, 0.88));
}

.metric-card > span {
  color: var(--app-muted);
  font-size: 11px;
  font-weight: 700;
}

.metric-card > strong {
  display: block;
  margin-top: 18px;
  font-family: "Instrument Sans", sans-serif;
  font-size: 37px;
  line-height: 1;
}

.metric-card > small {
  display: block;
  margin-top: 10px;
  color: var(--app-soft);
  font-size: 10px;
}

.metric-card .metric-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: inherit;
  font-size: 18px;
}

.contracts-section {
  margin-top: 44px;
}

.section-toolbar h2 {
  margin: 0;
  font-size: 26px;
}

.search-control {
  position: relative;
  display: block;
  width: min(340px, 100%);
}

.search-control svg {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 17px;
  height: 17px;
  color: var(--app-soft);
  transform: translateY(-50%);
}

.search-control input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  outline: 0;
  background: rgba(255, 255, 255, 0.035);
  padding: 0 14px 0 42px;
  color: var(--app-text);
  font-size: 12px;
}

.search-control input:focus {
  border-color: rgba(114, 235, 218, 0.5);
}

.table-wrap {
  margin-top: 18px;
  overflow-x: auto;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: rgba(10, 15, 23, 0.8);
}

table {
  width: 100%;
  min-width: 800px;
  border-collapse: collapse;
}

th,
td {
  padding: 17px 18px;
  border-bottom: 1px solid var(--app-line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--app-soft);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

td {
  color: #dce4ee;
  font-size: 12px;
}

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

.contract-cell strong,
.contract-cell small {
  display: block;
}

.contract-cell strong {
  font-size: 12px;
}

.contract-cell small {
  margin-top: 5px;
  color: var(--app-soft);
  font-size: 10px;
}

.status-chip,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(120, 223, 245, 0.25);
  border-radius: 999px;
  background: rgba(120, 223, 245, 0.08);
  padding: 7px 10px;
  color: #bfeef7;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-chip.is-signed,
.status-badge.is-signed {
  border-color: rgba(114, 235, 218, 0.3);
  background: rgba(114, 235, 218, 0.1);
  color: #a9f6e9;
}

.table-actions {
  display: flex;
  gap: 8px;
}

.table-action {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--app-line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  padding: 0 10px;
  color: #dbe5f0;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.table-action svg {
  width: 14px;
  height: 14px;
}

.loading-row td {
  height: 110px;
  color: var(--app-soft);
  text-align: center;
}

.empty-state {
  display: grid;
  min-height: 240px;
  place-items: center;
  align-content: center;
  border: 1px dashed var(--app-line);
  border-radius: 8px;
  margin-top: 18px;
  color: var(--app-muted);
  text-align: center;
}

.empty-state svg {
  width: 28px;
  height: 28px;
  margin-bottom: 14px;
  color: var(--app-mint);
}

.empty-state strong {
  font-size: 14px;
}

.empty-state p {
  margin: 7px 0 0;
  font-size: 11px;
}

.system-strip {
  display: grid;
  margin-top: 52px;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  border-top: 1px solid var(--app-line);
  border-bottom: 1px solid var(--app-line);
  padding: 25px 0;
}

.system-strip > div {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 10px;
}

.system-strip > div span {
  grid-row: span 2;
  color: var(--app-mint);
  font-size: 10px;
  font-weight: 800;
}

.system-strip strong {
  font-size: 12px;
}

.system-strip small {
  color: var(--app-soft);
  font-size: 10px;
}

.system-strip > svg {
  width: 16px;
  height: 16px;
  color: var(--app-soft);
}

.create-dialog {
  width: min(880px, calc(100% - 24px));
  max-height: calc(100vh - 30px);
  overflow: auto;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: #0c121b;
  padding: 0;
  color: var(--app-text);
  box-shadow: var(--shadow);
}

.create-dialog::backdrop {
  background: rgba(1, 3, 6, 0.76);
  backdrop-filter: blur(8px);
}

.dialog-shell {
  padding: clamp(22px, 4vw, 38px);
}

.dialog-header {
  margin-bottom: 28px;
}

.dialog-header h2 {
  margin: 0;
  font-size: 27px;
}

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

.field {
  display: grid;
  min-width: 0;
  gap: 8px;
}

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

.field > span {
  color: #c6d0dd;
  font-size: 10px;
  font-weight: 750;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--app-line);
  border-radius: 7px;
  outline: none;
  background: rgba(255, 255, 255, 0.035);
  padding: 12px 13px;
  color: var(--app-text);
  font-size: 12px;
  line-height: 1.55;
  resize: vertical;
}

.field select option {
  background: #0c121b;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(114, 235, 218, 0.5);
  box-shadow: 0 0 0 3px rgba(114, 235, 218, 0.06);
}

.dialog-footer {
  margin-top: 28px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dialog-footer .form-feedback {
  flex: 1 1 260px;
  margin: 0 auto 0 0;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  max-width: min(360px, calc(100% - 44px));
  border: 1px solid rgba(114, 235, 218, 0.28);
  border-radius: 8px;
  background: #101a22;
  padding: 14px 16px;
  color: #dffcf7;
  font-size: 11px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Public contract */

.public-contract-page {
  background: #e8edf2;
  color: var(--paper-text);
}

.public-contract-page .contract-topbar {
  color: var(--app-text);
}

.confidential-label {
  border-color: rgba(215, 175, 97, 0.25);
  color: #e7ca8e;
}

.contract-main {
  width: min(980px, calc(100% - 36px));
  margin: 44px auto 80px;
}

.contract-loading,
.contract-error {
  display: grid;
  min-height: 60vh;
  place-items: center;
  align-content: center;
  color: #314154;
  text-align: center;
}

.contract-loading strong {
  margin-top: 18px;
  font-size: 17px;
}

.contract-loading p,
.contract-error p {
  max-width: 520px;
  margin: 8px 0 22px;
  color: #6a7786;
  font-size: 12px;
}

.loading-mark {
  width: 44px;
  height: 44px;
  border: 2px solid rgba(0, 119, 184, 0.15);
  border-top-color: var(--paper-blue);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.contract-error > svg {
  width: 42px;
  height: 42px;
  color: #b55b67;
}

.contract-error h1 {
  margin: 18px 0 0;
  font-size: 28px;
}

.contract-document {
  overflow: hidden;
  border: 1px solid #d7e0e8;
  border-radius: 4px;
  background: var(--paper);
  box-shadow: 0 26px 70px rgba(40, 55, 72, 0.18);
}

.document-cover {
  display: grid;
  min-height: 510px;
  place-items: center;
  align-content: center;
  border-bottom: 5px solid var(--paper-blue);
  padding: 72px clamp(28px, 8vw, 88px);
  text-align: center;
}

.document-cover > img {
  width: 82px;
  height: 82px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 13px 30px rgba(31, 39, 48, 0.15);
}

.document-overline {
  margin: 22px 0 12px;
  color: var(--paper-blue);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.document-cover h1 {
  max-width: 740px;
  margin: 0;
  color: #062e4c;
  font-family: "Instrument Sans", sans-serif;
  font-size: clamp(36px, 6vw, 58px);
  line-height: 1.02;
}

.document-subtitle {
  max-width: 660px;
  margin: 16px 0 0;
  color: #566679;
  font-size: 15px;
  line-height: 1.6;
}

.document-client {
  margin-top: 42px;
}

.document-client span,
.document-client strong {
  display: block;
}

.document-client span {
  color: #778494;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.document-client strong {
  margin-top: 7px;
  font-size: 16px;
}

.document-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--paper-line);
  background: #f4f7fa;
  padding: 0 clamp(24px, 6vw, 64px);
}

.document-summary-grid > div {
  min-width: 0;
  border-right: 1px solid var(--paper-line);
  padding: 22px 18px;
}

.document-summary-grid > div:first-child {
  padding-left: 0;
}

.document-summary-grid > div:last-child {
  border-right: 0;
}

.document-summary-grid span,
.document-summary-grid strong {
  display: block;
}

.document-summary-grid span {
  color: #7a8796;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.document-summary-grid strong {
  margin-top: 7px;
  overflow-wrap: anywhere;
  color: #263545;
  font-size: 10px;
}

.document-summary-grid .status-badge {
  display: inline-flex;
  color: #096a91;
}

.document-section {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 22px;
  border-bottom: 1px solid var(--paper-line);
  padding: 48px clamp(24px, 7vw, 72px);
}

.section-number {
  padding-top: 5px;
  color: var(--paper-blue);
  font-size: 11px;
  font-weight: 800;
}

.document-section h2,
.signature-heading h2,
.signed-receipt h2 {
  margin: 0 0 16px;
  color: #083e62;
  font-size: 21px;
}

.document-section p {
  margin: 0 0 13px;
  color: #455568;
  font-size: 12px;
  line-height: 1.8;
}

.document-section p:last-child {
  margin-bottom: 0;
}

.scope-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.scope-list li {
  position: relative;
  padding-left: 22px;
  color: #455568;
  font-size: 12px;
  line-height: 1.65;
}

.scope-list li::before {
  position: absolute;
  top: 8px;
  left: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--paper-blue);
  content: "";
}

.notice-box {
  display: grid;
  margin-top: 22px;
  grid-template-columns: 28px 1fr;
  gap: 13px;
  border-left: 3px solid #d3a74e;
  background: #fffaf0;
  padding: 18px;
}

.notice-box svg {
  color: #9b762e;
}

.notice-box p {
  color: #5f5135;
}

.commercial-table {
  border-top: 1px solid var(--paper-line);
}

.commercial-table > div {
  display: grid;
  grid-template-columns: minmax(150px, 0.36fr) minmax(0, 1fr);
  border-bottom: 1px solid var(--paper-line);
  padding: 13px 0;
}

.commercial-table span {
  color: #788595;
  font-size: 10px;
}

.commercial-table strong {
  color: #263545;
  font-size: 11px;
}

.legal-note {
  border-left: 3px solid #9fb3c5;
  padding-left: 15px;
  font-size: 10px !important;
}

.signature-section {
  background: #07111b;
  padding: 52px clamp(24px, 7vw, 72px);
  color: var(--app-text);
}

.signature-heading {
  max-width: 660px;
  margin-bottom: 30px;
}

.signature-heading h2 {
  color: #f4f7fb;
  font-size: 28px;
}

.signature-heading > p:last-child {
  margin: 0;
  color: var(--app-muted);
  font-size: 12px;
}

.signature-form .field input {
  min-height: 45px;
}

.signature-pad-wrap {
  margin-top: 22px;
}

.signature-pad-label {
  margin-bottom: 9px;
}

.signature-pad-label > span {
  color: #c6d0dd;
  font-size: 10px;
  font-weight: 750;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  padding: 5px 0;
  color: var(--app-mint);
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}

.signature-pad-wrap canvas {
  display: block;
  width: 100%;
  height: 220px;
  touch-action: none;
  border: 1px solid rgba(204, 222, 242, 0.2);
  border-radius: 7px;
  background:
    linear-gradient(to bottom, transparent calc(78% - 1px), #b9c5d3 78%, transparent calc(78% + 1px)),
    #ffffff;
  cursor: crosshair;
}

.signature-pad-wrap > p {
  margin: 8px 0 0;
  color: var(--app-soft);
  font-size: 9px;
}

.check-field {
  display: grid;
  margin-top: 18px;
  grid-template-columns: 19px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  color: #c8d2df;
  font-size: 10px;
  line-height: 1.65;
  cursor: pointer;
}

.check-field input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--app-mint);
}

.button-sign {
  width: 100%;
  min-height: 52px;
  margin-top: 18px;
}

.signed-receipt {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 18px;
  background: #eafaf6;
  padding: 42px clamp(24px, 7vw, 72px);
}

.signed-receipt > svg {
  width: 42px;
  height: 42px;
  color: #168e74;
}

.signed-receipt h2 {
  margin-bottom: 8px;
  color: #135b4d;
}

.signed-receipt p {
  margin: 0;
  color: #41665e;
  font-size: 11px;
  line-height: 1.65;
}

.signed-receipt code {
  display: block;
  margin-top: 15px;
  overflow-wrap: anywhere;
  color: #56756e;
  font-size: 8px;
}

.document-footer {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #f4f7fa;
  padding: 18px clamp(24px, 7vw, 72px);
  color: #667587;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.document-summary-grid .status-badge.is-draft {
  border-color: rgba(165, 116, 24, 0.32);
  background: #fff7e8;
  color: #8a6217;
}

.phase-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding-left: 21px;
  color: #455568;
}

.phase-list li {
  padding-left: 7px;
  font-size: 12px;
  line-height: 1.7;
}

.phase-list li::marker {
  color: var(--paper-blue);
  font-weight: 800;
}

.delivery-table,
.payment-table {
  margin-top: 24px;
  border-top: 1px solid var(--paper-line);
}

.delivery-table > div,
.payment-table > div {
  display: grid;
  align-items: start;
  border-bottom: 1px solid var(--paper-line);
  padding: 12px 0;
}

.delivery-table > div {
  grid-template-columns: minmax(72px, 0.22fr) minmax(0, 1fr);
}

.payment-table > div {
  grid-template-columns: minmax(110px, 0.3fr) minmax(180px, 1fr) minmax(150px, 0.45fr);
  gap: 14px;
}

.delivery-table span,
.payment-table span {
  color: #788595;
  font-size: 10px;
}

.delivery-table strong,
.payment-table strong {
  color: #263545;
  font-size: 11px;
}

.document-subheading {
  margin: 28px 0 0;
  color: #083e62;
  font-size: 14px;
}

.commercial-note {
  margin-top: 20px !important;
  color: #677688 !important;
  font-size: 10px !important;
}

.review-notice {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  border-top: 1px solid rgba(211, 167, 78, 0.28);
  background: #111a24;
  padding: 38px clamp(24px, 7vw, 72px);
  color: #f4f7fb;
}

.review-notice svg {
  color: #d3a74e;
}

.review-notice h2 {
  margin: 4px 0 10px;
  color: #f4f7fb;
  font-size: 22px;
}

.review-notice p:last-child {
  max-width: 720px;
  margin: 0;
  color: #b8c5d3;
  font-size: 11px;
  line-height: 1.7;
}
@media (max-width: 900px) {
  .auth-view {
    grid-template-columns: 1fr;
    gap: 44px;
    padding: 58px 0;
  }

  .auth-copy {
    max-width: 760px;
  }

  .auth-panel {
    width: min(500px, 100%);
  }

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

  .system-strip {
    grid-template-columns: repeat(4, 1fr);
  }

  .system-strip > svg {
    display: none;
  }

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

  .document-summary-grid > div:nth-child(2) {
    border-right: 0;
  }

  .document-summary-grid > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--paper-line);
  }
}

@media (max-width: 640px) {
  .app-topbar,
  .contract-topbar {
    min-height: 68px;
    padding: 10px 14px;
  }

  .app-brand img {
    width: 40px;
    height: 40px;
  }

  .environment-pill,
  .confidential-label {
    display: none;
  }

  .button {
    min-height: 44px;
  }

  .topbar-actions .button {
    width: 42px;
    padding: 0;
    font-size: 0;
  }

  .topbar-actions .button svg {
    width: 18px;
    height: 18px;
  }

  .auth-view,
  .dashboard-view {
    width: min(100% - 28px, 1180px);
  }

  .auth-view {
    min-height: calc(100vh - 69px);
    padding: 46px 0;
  }

  .auth-copy h1 {
    font-size: 43px;
  }

  .auth-copy > p:not(.app-kicker) {
    font-size: 14px;
    line-height: 1.7;
  }

  .auth-points li {
    align-items: flex-start;
    font-size: 11px;
    line-height: 1.55;
  }

  .dashboard-view {
    padding: 38px 0 58px;
  }

  .dashboard-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-intro h1 {
    font-size: 42px;
  }

  .dashboard-intro .button {
    width: 100%;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 30px;
  }

  .metric-card {
    min-height: 132px;
    padding: 17px;
  }

  .metric-card > strong {
    margin-top: 15px;
    font-size: 31px;
  }

  .metric-card .metric-status {
    font-size: 15px;
  }

  .section-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 15px;
  }

  .search-control {
    width: 100%;
  }

  .system-strip {
    grid-template-columns: 1fr 1fr;
    gap: 24px 14px;
  }

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

  .field-wide {
    grid-column: auto;
  }

  .dialog-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .dialog-footer .form-feedback {
    grid-column: 1 / -1;
  }

  .contract-main {
    width: 100%;
    margin: 0 auto;
  }

  .contract-document {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .document-cover {
    min-height: calc(100svh - 68px);
    padding: 58px 22px;
  }

  .document-cover > img {
    width: 72px;
    height: 72px;
  }

  .document-cover h1 {
    font-size: 39px;
  }

  .document-subtitle {
    font-size: 13px;
  }

  .document-summary-grid {
    padding: 0 18px;
  }

  .document-summary-grid > div {
    padding: 17px 12px;
  }

  .document-section {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
    padding: 38px 20px;
  }

  .document-section h2 {
    font-size: 19px;
  }

  .document-section p,
  .scope-list li {
    font-size: 11px;
  }

  .commercial-table > div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .signature-section {
    padding: 42px 20px;
  }

  .signature-pad-wrap canvas {
    height: 190px;
  }

  .signed-receipt {
    grid-template-columns: 1fr;
    padding: 38px 20px;
  }

  .document-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px;
  }
}

@media (max-width: 640px) {
  .phase-list {
    gap: 12px;
    padding-left: 18px;
  }

  .phase-list li,
  .delivery-table span,
  .delivery-table strong,
  .payment-table span,
  .payment-table strong {
    font-size: 11px;
  }

  .delivery-table > div,
  .payment-table > div {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .review-notice {
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 12px;
    padding: 34px 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  @page {
    size: A4;
    margin: 14mm;
  }

  .contract-topbar,
  .signature-section {
    display: none !important;
  }

  .public-contract-page {
    background: #ffffff;
  }

  .contract-main {
    width: 100%;
    margin: 0;
  }

  .contract-document {
    border: 0;
    box-shadow: none;
  }

  .document-cover {
    min-height: 245mm;
    break-after: page;
  }

  .document-section,
  .signed-receipt {
    break-inside: avoid;
  }
}
