:root { color-scheme: light; --ink: #172c2a; --muted: #61716e; --accent: #176f5d; --line: #dce5e0; --paper: #f5f7f3; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
a:focus-visible, summary:focus-visible { outline: 3px solid #4a9b86; outline-offset: 5px; }
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1160px; margin: auto; padding: 21px 32px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 700; letter-spacing: -.4px; }
.brand-mark { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 10px; background: var(--accent); color: white; font-size: 19px; }
.header-label { font-size: 13px; color: var(--muted); }
.container { max-width: 1160px; margin: auto; padding: 0 32px; }
.hero { padding: 56px 0 34px; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.4px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.2; font-weight: 650; letter-spacing: -1.3px; margin: 12px 0 17px; }
h2 { font-size: 21px; line-height: 1.4; letter-spacing: -.4px; }
h3 { font-size: 20px; line-height: 1.4; }
.lead { color: var(--muted); max-width: 740px; font-size: 17px; }
.muted { color: var(--muted); font-size: 13px; }
.stats { display: flex; flex-wrap: wrap; gap: 48px; margin-top: 34px; padding: 25px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats div { display: flex; flex-direction: column; gap: 2px; }
.stats strong { font-size: 30px; line-height: 1.3; font-weight: 600; }
.stats span { color: var(--muted); font-size: 13px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 16px 0; }
.company-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.company-card { display: flex; flex-direction: column; padding: 28px; background: white; border: 1px solid var(--line); border-radius: 16px; transition: border-color .15s, transform .15s; }
.company-card:hover { border-color: #80a79a; transform: translateY(-2px); }
.company-symbol { width: 48px; height: 48px; display: grid; place-items: center; background: #eaf2ec; color: var(--accent); border-radius: 12px; margin-bottom: 26px; font-size: 21px; font-weight: 650; }
.company-card p { color: var(--muted); margin: 8px 0 3px; font-size: 14px; }
.card-action { display: flex; align-items: center; justify-content: space-between; color: var(--accent); font-size: 14px; font-weight: 600; border-top: 1px solid var(--line); padding-top: 17px; margin-top: 27px; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 13px; padding-top: 27px; }
.breadcrumbs a:hover { color: var(--accent); text-decoration: underline; }
.page-heading { padding: 28px 0; }
.page-heading h1 { max-width: 850px; font-size: clamp(26px, 3vw, 36px); letter-spacing: -.8px; }
.notice { padding: 16px 20px; margin-bottom: 24px; background: #fbf5e7; color: #6d572a; border: 1px solid #e8dcc0; border-radius: 10px; font-size: 14px; }
.template-list { border: 1px solid var(--line); border-radius: 14px; background: white; overflow: hidden; }
.template-row { display: flex; gap: 18px; align-items: center; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.template-row:last-child { border-bottom: 0; }
.template-row:hover { background: #f8fbf8; }
.file-icon { display: grid; place-items: center; flex: 0 0 48px; height: 54px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 10px; font-weight: 650; }
.row-body { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 5px; }
.row-body strong { font-weight: 550; font-size: 15px; }
.badge { display: inline-block; width: fit-content; flex-shrink: 0; padding: 4px 10px; border-radius: 7px; color: var(--muted); background: #f0f3f0; font-size: 11px; white-space: nowrap; }
.badge.ready { color: var(--accent); background: #eaf4ed; }
.badge.missing { color: #8b682b; background: #fcf3e3; }
.arrow { color: var(--muted); }
.detail-heading { display: flex; gap: 28px; align-items: center; justify-content: space-between; }
.button { display: inline-flex; flex-shrink: 0; align-items: center; gap: 18px; padding: 12px 18px; border-radius: 9px; background: var(--accent); color: white; font-size: 14px; font-weight: 550; }
.button:hover { background: #125847; }
.hero .button { margin-top: 24px; }
.variables { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.variable-card { padding: 21px; border: 1px solid var(--line); border-radius: 12px; background: white; min-width: 0; }
.variable-heading { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; }
.variable-heading h3 { font-size: 15px; font-weight: 550; }
code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }
.variable-name { display: block; color: var(--accent); background: #f1f6f2; padding: 8px 10px; border-radius: 6px; margin-top: 14px; }
.variable-card p { margin-top: 13px; }
details { margin-top: 17px; padding-top: 13px; border-top: 1px solid var(--line); font-size: 13px; }
summary { cursor: pointer; color: var(--muted); }
.field-list { padding-left: 18px; margin: 16px 0 0; }
.field-list li { margin: 7px 0; }
.field-list strong { font-weight: 500; }
.field-list code { margin-left: 10px; color: var(--muted); }
.empty-state { padding: 30px; color: var(--muted); }
.footer { margin-top: 48px; padding-top: 23px; padding-bottom: 26px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
@media (max-width: 700px) {
  .container, .header-inner { padding-left: 20px; padding-right: 20px; }
  .header-label { display: none; }
  .hero { padding-top: 34px; }
  .stats { gap: 22px; }
  .stats strong { font-size: 25px; }
  .stats div { flex: 1 1 110px; }
  .company-grid, .variables { grid-template-columns: 1fr; }
  .template-row { gap: 12px; padding: 18px 16px; flex-wrap: wrap; }
  .template-row .badge { margin-left: 60px; }
  .template-row .arrow { margin-left: auto; }
  .detail-heading { align-items: flex-start; flex-direction: column; }
  .variable-heading { flex-direction: column; gap: 8px; }
}

/* Source preparation pages; company home styles remain unchanged. */
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; }
.row-actions .button { padding: 9px 13px; font-size: 13px; }
button.button { border: 0; font-family: inherit; line-height: inherit; cursor: pointer; }
.button-secondary { background: #eaf2ec; color: var(--accent); }
.button-secondary:hover { background: #dcebe1; }
.button:disabled, .button:disabled:hover { background: #e4e9e5; color: #7b8981; cursor: not-allowed; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #4a9b86; outline-offset: 3px; }
.source-card { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 26px; margin-bottom: 22px; }
.source-card .section-heading { margin-top: 0; flex-wrap: wrap; }
.input-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 9px; }
.source-input { display: block; width: 100%; max-width: 100%; padding: 14px; border: 1px solid #cbd9d1; border-radius: 9px; background: #fbfcfa; font-size: 14px; line-height: 1.6; font-family: inherit; color: var(--ink); resize: vertical; }
.input-hint { margin-top: 10px; }
.upload-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 25px 0 18px; }
.upload-field { padding: 19px; border: 1px dashed #b9ccc1; border-radius: 10px; min-width: 0; }
.upload-field input { display: block; width: 100%; margin-top: 15px; font-family: inherit; font-size: 13px; color: var(--muted); }
.upload-field input::file-selector-button { padding: 8px 12px; border: 1px solid var(--line); border-radius: 7px; margin-right: 10px; background: #eaf2ec; color: var(--accent); cursor: pointer; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 24px; }
.source-error { background: #fff1ed; color: #93472d; border-color: #ecd0c4; }
.source-error-text { color: #93472d; font-size: 13px; margin-top: 5px; }
.source-list { list-style: none; padding: 0; margin: 0 0 22px; }
.source-list li { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.source-list strong { font-size: 14px; overflow-wrap: anywhere; }
.source-list .badge { margin-top: 2px; }
.parsed-text { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; }
.generation-card { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding: 23px 26px; border: 1px solid var(--line); border-radius: 14px; }
.generation-card > div { flex: 1 1 400px; }
.generation-card h2 { font-size: 18px; margin-bottom: 8px; }
@media (max-width: 800px) {
  .row-actions { width: 100%; justify-content: flex-start; margin-left: 66px; }
  .template-row { flex-wrap: wrap; }
  .row-actions .badge { margin-left: 0; }
  .upload-grid { grid-template-columns: 1fr; }
  .source-card { padding: 20px; }
}
@media (max-width: 450px) {
  .row-actions { margin-left: 0; }
  .row-actions .button { flex: 1; justify-content: center; }
  .source-card .section-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
}
.account-menu { display: flex; align-items: center; gap: 16px; }
.account-menu form { margin: 0; }
.logout-button { border: 1px solid var(--line); border-radius: 7px; padding: 7px 12px; background: #f3f7f3; color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; }
.login-panel { max-width: 460px; margin: 65px auto 80px; padding: 32px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.login-panel h1 { font-size: 32px; }
.login-panel .lead { font-size: 15px; margin-bottom: 26px; }
.login-form .source-input { margin-bottom: 20px; }
.login-form .button { width: 100%; justify-content: center; margin-top: 8px; }
@media (max-width: 500px) { .login-panel { padding: 24px; margin-top: 38px; } }
:root { --review-border: #d8e4df; }
.review-variable { padding: 24px 0; border-top: 1px solid var(--review-border); }
.review-variable h2 { font-size: 20px; margin-bottom: 8px; }
.review-node { margin: 12px 0; }
.review-node h3 { font-size: 16px; }
.review-input { min-height: 48px; padding: 12px; }
.review-row { margin: 16px 0; padding: 16px; border: 1px solid var(--review-border); border-radius: 12px; }
.review-missing { color: #a05d1b; font-size: 13px; margin-top: 4px; }
.review-confirmations { display: grid; gap: 16px; padding: 24px 0; border-top: 1px solid var(--review-border); }
.review-confirmations label { display: flex; align-items: flex-start; gap: 10px; }
.review-confirmations input { margin-top: 4px; }

/* Document workspace: retain the company catalog, refine preparation/review. */
.workflow-steps { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); list-style:none; padding:0; margin:4px 0 28px; border:1px solid var(--line); border-radius:14px; overflow:hidden; background:#fff; }
.workflow-steps li { display:flex; gap:10px; align-items:center; padding:18px; font-size:12px; color:#89958f; border-right:1px solid var(--line); font-variant-numeric:tabular-nums; }
.workflow-steps li:last-child { border-right:0; }
.workflow-steps span { font-size:13px; font-weight:550; }
.workflow-steps .active { background:#eaf4ed; color:var(--accent); box-shadow:inset 0 -3px var(--accent); }
.workflow-steps .done { color:var(--accent); }
.entity-picker { background:linear-gradient(125deg,#fff,#f2f8f4); border-color:#bdd4c7; }
.entity-picker h2 { margin-top:6px; }
.entity-picker .input-label { margin-top:22px; }
select.source-input { min-height:52px; cursor:pointer; }
.entity-summary { display:grid; gap:7px; padding:22px 25px; border:1px solid #c8dbd0; border-radius:12px; background:#edf5ef; margin-bottom:24px; }
.entity-summary strong { font-size:20px; letter-spacing:-.3px; }
#review-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin-top:24px; }
#review-fields .review-variable { min-width:0; margin:0; padding:20px; border:1px solid var(--line); border-radius:12px; background:#fcfdfb; }
#review-fields .review-variable:has(.review-row), #review-fields .review-variable:has(.review-node > h3) { grid-column:1 / -1; }
#review-fields .review-variable h2 { font-size:16px; letter-spacing:-.2px; }
#review-fields .review-input { background:#fff; line-height:1.5; }
.review-from-profile .review-input { background:#f0f5f1 !important; color:#40564a; border-color:#d2dfd6; }
.profile-origin { display:flex; gap:6px; align-items:center; font-size:12px; color:var(--accent); margin-top:7px; }
.profile-origin::before { content:'✓'; font-weight:700; }
.variable-path { font-size:11px; overflow-wrap:anywhere; }
.conflict-panel { border-color:#e4d6b6; background:#fffdf8; }
.conflict-panel h2 { font-size:18px; }
.conflict-panel summary { color:#715c2e; }
.conflict-values { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-top:14px; }
.conflict-values > div { min-width:0; padding:12px; border-radius:8px; background:#f6f2e9; }
.conflict-values p { margin-top:4px; overflow-wrap:anywhere; white-space:pre-wrap; }
#review-form > .form-actions { position:sticky; bottom:12px; padding:18px 20px; background:#fff; border:1px solid var(--line); border-radius:12px; box-shadow:0 8px 28px #173b2812; z-index:2; }
.review-confirmations input { accent-color:var(--accent); width:17px; height:17px; flex-shrink:0; }
@media (max-width:760px) {
 .workflow-steps { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .workflow-steps li { padding:13px; }
 .workflow-steps li:nth-child(-n+2) { border-bottom:1px solid var(--line); }
 #review-fields, .conflict-values { grid-template-columns:1fr; }
 #review-fields .review-variable { padding:16px; }
 #review-form > .form-actions { bottom:0; padding:14px; }
 .entity-summary { padding:18px; }
}
