:root {
  color-scheme: light;
  --ink: #173941;
  --brand: #005b70;
  --brand-dark: #004657;
  --muted: #5f7379;
  --border: #d6e0e1;
  --surface: #fff;
  --background: #f4f7f6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--background);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--brand); }
button, input { font: inherit; }
a, button, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #d68b27; outline-offset: 4px; }
.skip-link { position: absolute; top: -100px; padding: 12px; background: white; z-index: 10; }
.skip-link:focus { top: 8px; left: 8px; }
.site-header { display: flex; align-items: center; gap: 40px; min-height: 90px; padding: 16px 6vw; border-bottom: 1px solid var(--border); background: var(--surface); }
.brand { text-decoration: none; display: flex; flex-direction: column; color: var(--brand); }
.brand-logo { display: block; width: 96px; height: 64px; object-fit: contain; }
.brand-description { margin-top: 5px; font-size: 11px; letter-spacing: .17em; text-transform: uppercase; }
.main-nav { display: flex; gap: 24px; }
.main-nav a { padding: 8px 0; color: var(--muted); text-decoration: none; font-size: 14px; }
.main-nav a[aria-current] { color: var(--brand); border-bottom: 2px solid var(--brand); }
.sign-out { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.signed-in-name { color: var(--muted); font-size: 13px; }
.text-button { background: none; border: 0; color: var(--brand); padding: 8px 0; cursor: pointer; font-size: 14px; }
.page { width: min(1080px, 88vw); margin: 0 auto; padding: 64px 0 80px; flex: 1; }
.page-heading { margin-bottom: 36px; }
.eyebrow { color: var(--brand); font-size: 11px; letter-spacing: .15em; font-weight: 700; margin: 0 0 14px; }
h1 { font-size: clamp(32px, 4vw, 44px); font-weight: 650; letter-spacing: -.035em; line-height: 1.15; margin: 0 0 14px; }
h2 { font-size: 23px; font-weight: 650; letter-spacing: -.02em; margin: 0 0 12px; }
p { line-height: 1.7; }
.muted { color: var(--muted); margin: 0; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 36px; }
.tool-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .7fr); gap: 36px; align-items: center; }
.tool-card { max-width: 580px; }
.tool-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: #e7f1f2; color: var(--brand); font-size: 22px; font-weight: 700; margin-bottom: 26px; }
.tool-card p { color: var(--muted); max-width: 390px; margin-bottom: 28px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 24px; min-height: 46px; padding: 12px 20px; border-radius: 6px; border: 1px solid transparent; text-decoration: none; font-size: 14px; font-weight: 600; cursor: pointer; }
.primary { background: var(--brand); color: white; }
.primary:hover { background: var(--brand-dark); }
.secondary { border-color: var(--border); background: white; color: var(--brand); }
.future-tools { padding: 26px; color: var(--muted); border-left: 1px solid var(--border); }
.future-tools p:last-child { max-width: 220px; margin: 0; }
.site-footer { padding: 22px 6vw; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.login-page { display: grid; grid-template-columns: 1fr 410px; gap: 80px; align-items: center; padding-top: 80px; padding-bottom: 100px; }
.login-introduction h1 { max-width: 400px; font-size: clamp(40px, 5vw, 60px); }
.intro-copy { color: var(--muted); font-size: 17px; }
.intro-rule { width: 50px; height: 3px; background: var(--brand); margin-top: 38px; }
.quiet { color: var(--muted); font-size: 12px; margin-top: 20px; }
.login-panel .muted { font-size: 14px; margin-bottom: 28px; }
label { display: block; font-size: 13px; font-weight: 600; margin: 20px 0 8px; }
input:not([type="hidden"]) { width: 100%; padding: 12px; border-radius: 5px; border: 1px solid #b9c9cc; min-height: 46px; background: white; color: var(--ink); }
.full-width { width: 100%; margin-top: 28px; }
.account-help { color: var(--muted); font-size: 12px; line-height: 1.6; margin-top: 24px; margin-bottom: 0; }
.form-error { color: #8b2525; border-left: 3px solid #b93b3b; padding: 10px 12px; background: #fff2f1; font-size: 13px; line-height: 1.6; }
.empty-state { text-align: center; padding: 64px 24px; }
.empty-state p { color: var(--muted); margin-bottom: 28px; }
.status-pill { display: inline-block; border-radius: 30px; padding: 5px 12px; font-size: 11px; font-weight: 600; background: #e7f1f2; color: var(--brand); margin-bottom: 24px; }
.back-link { margin-bottom: 26px; }
.processing-history { margin-top: 24px; }
.processing-history summary { cursor: pointer; font-weight: 600; }
.filter-bar { display: flex; gap: 14px; align-items: end; flex-wrap: wrap; margin-bottom: 20px; }
.filter-field { flex: 1; min-width: 130px; }
.filter-field:first-of-type { flex: 2; min-width: 210px; }
.filter-field label { margin-top: 0; }
select { width: 100%; padding: 12px; min-height: 46px; border: 1px solid #b9c9cc; border-radius: 5px; background: white; color: var(--ink); font: inherit; }
.button-primary { background: var(--brand); color: white; }
.quote-table { width: 100%; border-collapse: collapse; text-align: left; }
.quote-table th { color: var(--muted); font-size: 12px; font-weight: 600; padding: 0 14px 18px; }
.quote-table td { border-top: 1px solid var(--border); padding: 20px 14px; font-size: 14px; }
.quote-table small, .outcomes small, .task-list small, .activity-list small { display: block; color: var(--muted); font-size: 12px; margin-top: 7px; overflow-wrap: anywhere; }
.quote-link { font-weight: 650; text-decoration: none; }
.quote-table .quote-actions { width: 1%; text-align: right; white-space: nowrap; }
.table-scroll { overflow-x: auto; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid transparent; border-radius: 20px; background: #e7f1f2; color: var(--brand); font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge[class*="state-"]::before { display: inline-block; min-width: 1em; text-align: center; font-size: 14px; line-height: 1; }
.state-draft { background: #174db1; color: #fff; }
.state-draft::before { content: "✎" / ""; }
.state-awaiting_signature { background: #ffcb3b; color: #342100; }
.state-awaiting_signature::before { content: "◷" / ""; }
.state-signature_received { background: #e6c6ff; color: #411369; border-color: #a96bdb; }
.state-signature_received::before { content: "↓" / ""; }
.state-signed { background: #93e9ae; color: #103c20; border-color: #48a765; }
.state-signed::before { content: "✓" / ""; }
.state-withdrawn { background: #bd2341; color: #fff; }
.state-withdrawn::before { content: "×" / ""; }
.state-superseded { background: #e9edf2; color: #253242; border-color: #9ba7b7; }
.state-superseded::before { content: "↪" / ""; }
.load-more { display: flex; margin: 24px auto 0; border-color: var(--border); width: max-content; }
#list-status { margin-top: 14px; text-align: center; }
.notice { border: 1px solid var(--border); border-radius: 8px; padding: 18px 24px; margin-bottom: 24px; }
.attention { border-color: #e7a328; border-left: 6px solid #d97706; background: #fff0c2; color: #78350f; }
.app-message { display: flex; align-items: center; gap: 14px; padding: 18px 22px; margin-bottom: 24px; border: 1px solid #c4b5fd; border-left: 6px solid #7c3aed; border-radius: 8px; background: #ede9fe; color: #4c1d95; font-size: 16px; font-weight: 600; line-height: 1.6; }
.app-message.success { border-color: #86cf9b; border-left-color: #15803d; background: #dcfce7; color: #14532d; }
.app-message.warning { border-color: #e7a328; border-left-color: #d97706; background: #fff0c2; color: #78350f; }
.app-message.error { border-color: #f19a9a; border-left-color: #dc2626; background: #fee2e2; color: #7f1d1d; }
.message-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 28px; height: 28px; border: 2px solid currentColor; border-radius: 50%; font-size: 17px; line-height: 1; }
.notice p { margin-bottom: 0; }
.record-summary { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; padding: 22px 28px; margin-bottom: 36px; font-size: 13px; }
.detail-tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--border); margin-bottom: 28px; }
.detail-tabs button { border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); padding: 14px 18px; cursor: pointer; font-size: 14px; font-weight: 600; }
.detail-tabs button[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.detail-tabs button:hover { color: var(--brand); }
[data-detail-panel][hidden] { display: none; }
[data-detail-panel] > h2 { margin-top: 0; }
.version-card { margin-bottom: 24px; }
.record-actions { display: flex; gap: 12px; align-items: center; flex-wrap: nowrap; overflow-x: auto; margin: 18px 0; padding-bottom: 4px; }
.record-actions form { margin: 0; }
.record-actions .button { white-space: nowrap; }
.secondary-version summary { cursor: pointer; padding: 18px 24px; background: #eaf0ef; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.section-heading { display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.section-heading h3 { margin: 0; font-size: 18px; }
.artifact-heading { margin: 24px 0 10px; font-size: 14px; }
.artifact-status { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 22px; }
.artifact-status-item { display: flex; flex-direction: column; gap: 5px; padding: 16px 18px; border: 1px solid var(--border); border-left: 4px solid #9cadb0; border-radius: 8px; background: #f5f7f7; }
.artifact-status-label { color: var(--ink); font-size: 13px; font-weight: 600; }
.artifact-status-item strong { font-size: 18px; line-height: 1.3; }
.artifact-status-item small { color: var(--muted); font-size: 12px; }
.artifact-state-pending { border-left-color: #c48b21; background: #fff8e9; }
.artifact-state-pending strong { color: #815714; }
.artifact-state-ready { border-left-color: #358058; background: #edf8f0; }
.artifact-state-ready strong { color: #276442; }
.artifact-state-failed { border-left-color: #b93b3b; background: #fff2f1; }
.artifact-state-failed strong { color: #8b2525; }
.artifact-completed { margin: -8px 0 22px; color: var(--muted); font-size: 13px; }
.file-list, .outcomes, .task-list, .activity-list { padding: 0; list-style: none; margin-bottom: 0; }
.file-list li { display: flex; gap: 16px; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--border); font-size: 14px; }
.file-list span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.document-file-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 16px 0; }
.document-info { display: grid; grid-template-columns: 120px minmax(0, 1fr) 70px; gap: 12px; align-items: center; min-width: 0; }
.document-info strong { font-size: 13px; }
.document-info span { color: var(--ink); font-size: 14px; }
.document-info small { color: var(--muted); font-size: 12px; text-align: right; white-space: nowrap; }
.document-actions { display: flex; gap: 8px; }
.document-actions .button { min-width: 100px; min-height: 40px; padding: 9px 14px; }
.task-list li, .activity-list li { padding: 18px 0; border-top: 1px solid var(--border); font-size: 14px; }
.activity-list span { display: block; font-size: 13px; margin-top: 8px; }
.task-list .button { margin-top: 14px; border-color: var(--border); background: white; }
.errorlist { color: #8b2525; font-size: 13px; }
.draft-form > .panel { max-width: 650px; margin-bottom: 24px; }
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.upload-grid input[type=file] { font-size: 13px; color: var(--muted); padding: 7px; }
.upload-grid input[type=file]::file-selector-button { min-height: 46px; margin-right: 14px; padding: 12px 20px; border: 1px solid transparent; border-radius: 6px; background: var(--brand); color: white; font: inherit; font-weight: 600; cursor: pointer; }
.upload-grid input[type=file]::file-selector-button:hover { background: var(--brand-dark); }
.saved-file { padding: 14px; border-left: 3px solid var(--brand); background: #eaf2f1; font-size: 14px; overflow-wrap: anywhere; }
.draft-actions { display: flex; align-items: center; gap: 24px; margin-top: 30px; }
.draft-actions .muted { max-width: 620px; font-size: 13px; }
.unsaved-dialog { width: min(600px, 90vw); border: 1px solid var(--border); border-radius: 12px; padding: 30px; color: var(--ink); }
.unsaved-dialog::backdrop { background: rgb(0 0 0 / 40%); }
.unsaved-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.review-recipient { max-width: 680px; margin-bottom: 24px; }
.review-recipient strong { font-size: 20px; }
.review-documents { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 24px 0; }
.review-documents .panel { min-width: 0; }
.pdf-preview { display: block; width: 100%; height: 560px; border: 1px solid var(--border); border-radius: 6px; }
.mail-preview { display: block; width: 100%; height: 480px; border: 1px solid var(--border); border-radius: 6px; background: white; }
.review-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 24px; }
.review-actions h2 { width: 100%; }
.review-actions p { width: 100%; }
.copy-options { border: 1px solid var(--border); border-radius: 8px; margin: 20px 0; padding: 14px 20px 20px; }
.copy-options legend { font-size: 14px; font-weight: 600; padding: 0 6px; }
.copy-options label { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.copy-options input[type=checkbox] { width: auto; min-height: auto; }
@media (max-width: 760px) {
  .site-header { flex-wrap: wrap; gap: 18px; padding: 18px 6vw; }
  .main-nav { order: 3; width: 100%; }
  .signed-in-name { display: none; }
  .login-page { grid-template-columns: 1fr; gap: 28px; padding-top: 40px; }
  .login-introduction h1 { font-size: 38px; }
  .intro-rule, .login-introduction .quiet { display: none; }
  .panel { padding: 26px; }
  .tool-grid { grid-template-columns: 1fr; gap: 26px; }
  .page { padding-top: 40px; }
  .file-list li { flex-direction: column; gap: 8px; }
  .document-file-list li { grid-template-columns: 1fr; gap: 12px; }
  .document-info { grid-template-columns: 1fr auto; gap: 4px 12px; }
  .document-info strong { grid-column: 1 / -1; }
  .document-info small { align-self: start; }
  .document-actions .button { flex: 1; }
  .upload-grid { grid-template-columns: 1fr; }
  .artifact-status { grid-template-columns: 1fr; }
  .review-documents { grid-template-columns: 1fr; }
  .draft-actions { align-items: start; flex-direction: column; }
  .quote-table th, .quote-table td { padding-left: 8px; padding-right: 8px; }
  .detail-tabs button { padding: 12px 10px; }
}
