:root {
  --ink: #1e2925;
  --muted: #69736e;
  --line: #d9ded8;
  --paper: #f8f7f4;
  --warm: #e9e6df;
  --forest: #25443b;
  --sand: #bfae91;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Manrope, Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: linear-gradient(130deg, #e8e4dc 0%, #f8f7f4 48%, #edf0ea 100%); }
.login-card { width: min(100%, 400px); background: #fffdf9; padding: 43px 42px 37px; border: 1px solid #d9ded8; box-shadow: 0 24px 60px #1d30281c; }
.login-logo { width: 178px; height: auto; display: block; margin: 0 0 31px; }
.login-card h1 { font-size: 48px; }
.login-intro { color: #68736e; font-size: 12px; line-height: 1.65; margin: 15px 0 25px; }
.login-button { margin-top: 22px; }
.login-button span { margin-left: 7px; }
.login-helper { margin: 13px 0 0; color: #85918b; text-align: center; font-size: 10px; }
.login-helper strong { color: #53645c; }
.login-error { margin: 10px 0 -8px; color: #a64032; font-size: 11px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { background: #203e35; color: #edf0e9; padding: 30px 22px 24px; display: flex; flex-direction: column; }
.brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 11px; font-weight: 700; letter-spacing: .11em; font-size: 14px; margin: 0 10px 68px; }
.brand small { display: block; color: #abc0b5; letter-spacing: .08em; font-size: 9px; margin-top: 2px; font-weight: 500; }
.brand-mark { width: 31px; height: 31px; border: 1px solid #a5bfb1; display: grid; place-items: center; font: 600 19px 'Playfair Display', serif; letter-spacing: 0; }
nav { display: grid; gap: 7px; }
.nav-link { color: #b7c5bd; text-decoration: none; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 5px; font-size: 13px; font-weight: 500; }
.nav-link span { font-size: 17px; width: 18px; text-align: center; color: #d7e2db; }
.nav-link b { margin-left: auto; color: #94a99e; font: 500 11px 'DM Mono', monospace; }
.nav-link.active { background: #38594e; color: white; }
.sidebar-footer { margin-top: auto; border-top: 1px solid #466258; padding: 21px 8px 0; display: flex; align-items: center; gap: 10px; }
.avatar { background: #c9b99a; color: #213c34; border-radius: 50%; width: 31px; height: 31px; display: grid; place-items: center; font: 600 10px 'DM Mono', monospace; }
.sidebar-footer strong, .sidebar-footer small { display: block; font-size: 11px; }
.sidebar-footer small { color: #a8bbb0; margin-top: 3px; font-size: 9px; }
main { min-width: 0; padding: 0 5.2vw 42px; }
.topbar { height: 82px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.crumb { color: var(--muted); font: 500 12px 'DM Mono', monospace; }
.crumb span { padding: 0 9px; color: #9ca49e; }
.text-button { background: none; color: var(--forest); border: 0; font-size: 12px; font-weight: 700; padding: 9px 0; }
.logout-button { border: 1px solid #b7c4bc; background: transparent; color: #41574c; font-size: 11px; font-weight: 700; padding: 7px 11px; }
.logout-button:hover { border-color: #668173; color: var(--forest); }
.workspace { display: grid; grid-template-columns: minmax(315px, .78fr) minmax(475px, 1.22fr); gap: clamp(38px, 6vw, 110px); max-width: 1240px; margin: 55px auto 46px; }
.eyebrow { color: #708078; font: 500 10px 'DM Mono', monospace; letter-spacing: .12em; margin: 0 0 11px; }
h1 { margin: 0; font: 600 clamp(42px, 4vw, 58px)/.98 'Playfair Display', serif; letter-spacing: -.04em; }
h1 em { color: #788a82; font-weight: 600; }
.intro { max-width: 345px; color: #68736e; font-size: 13px; line-height: 1.7; margin: 19px 0 29px; }
.field-label { color: #3c4943; font-size: 11px; display: block; font-weight: 700; margin: 18px 0 8px; }
.field-label span { color: #94a099; font-weight: 500; }
.text-input, .select-input { width: 100%; background: #fff; border: 1px solid #d7ddd7; color: var(--ink); border-radius: 3px; min-height: 44px; padding: 0 13px; outline: none; font-size: 12px; transition: border .2s, box-shadow .2s; }
.text-input:focus, .select-input:focus { border-color: #688478; box-shadow: 0 0 0 3px #dce8df; }
.project-fields { display: grid; grid-template-columns: 1fr 88px; gap: 10px; }
.people-fields { grid-template-columns: 1fr 1fr; }
.compact-label { margin-top: 12px; }
.hidden { display: none !important; }
.select-input { appearance: auto; }
.notes { padding: 11px 13px; min-height: 82px; resize: vertical; line-height: 1.5; }
.product-note { display: flex; gap: 13px; margin-top: 10px; color: #7d8782; font: 500 9px 'DM Mono', monospace; text-transform: uppercase; }
.product-note span + span { border-left: 1px solid #ccd2cd; padding-left: 13px; }
.material-fieldset { border: 0; padding: 0; margin: 31px 0 4px; }
.material-fieldset legend { width: 100%; color: #3c4943; font-size: 11px; font-weight: 700; margin-bottom: 11px; }
.material-fieldset legend span { float: right; color: #95a09a; font-weight: 500; }
.finish-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.finish-card { padding: 6px; border: 1px solid #d7ddd7; background: #fff; border-radius: 3px; text-align: left; transition: .2s ease; }
.finish-card:hover { transform: translateY(-1px); border-color: #9caca3; }
.finish-card[aria-pressed="true"] { border: 2px solid #305548; padding: 5px; box-shadow: 0 3px 9px #30493b20; }
.finish-card img { aspect-ratio: 1.75; width: 100%; object-fit: cover; display: block; border-radius: 1px; }
.finish-card span { display: block; padding: 6px 2px 1px; font: 500 10px 'DM Mono', monospace; color: #506059; }
.fabric-picker { display: grid; grid-template-columns: 76px 1fr; gap: 10px; align-items: stretch; }
.fabric-picker img { width: 76px; height: 44px; object-fit: cover; border: 1px solid #d7ddd7; border-radius: 3px; }
.material-helper { color: #85918b; font-size: 10px; line-height: 1.45; margin: 8px 0 0; }
.preview-panel { padding-top: 12px; }
.preview-topline { display: flex; justify-content: space-between; align-items: flex-start; margin: 0 2px 13px; }
.preview-topline .eyebrow { margin-bottom: 4px; }
.preview-topline strong { font-size: 13px; }
.state { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #cbd6ce; padding: 6px 9px; color: #406b57; background: #f0f6f0; border-radius: 20px; font: 500 9px 'DM Mono', monospace; }
.state i { width: 6px; height: 6px; border-radius: 50%; background: #4d8a68; }
.state.generating { color: #7e602b; background: #fbf5e9; border-color: #ebd9b4; }
.state.generating i { background: #c58a22; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; transform: scale(.65); } }
.preview-stage { min-height: 443px; position: relative; overflow: hidden; display: grid; place-items: center; background: #ededea; border: 1px solid #e2e3df; }
.preview-stage img { width: 100%; height: 100%; min-height: 443px; object-fit: cover; object-position: center; transition: opacity .35s ease; }
.flou-pair { height: 100%; width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: #e7e7e3; }
.flou-pair figure { min-width: 0; margin: 0; position: relative; overflow: hidden; background: #fbfbfa; }
.flou-pair img { width: 100%; height: 100%; min-height: 443px; object-fit: cover; object-position: center; display: block; }
.flou-pair figcaption { position: absolute; top: 13px; left: 13px; background: #f8f7f4e8; padding: 5px 7px; color: #53645c; font: 500 9px 'DM Mono', monospace; }
.render-placeholder { width: 100%; height: 100%; min-height: 443px; padding: 36px; display: grid; align-content: center; justify-items: center; gap: 10px; text-align: center; background: #efefec; color: #728078; }
.render-placeholder strong { color: #3d5148; font: 600 20px 'Playfair Display', serif; }
.render-placeholder span { max-width: 250px; font-size: 11px; line-height: 1.6; }
.finish-watermark { position: absolute; z-index: 2; top: 18px; right: 20px; color: #25443b; font: 500 13px 'DM Mono', monospace; border-bottom: 1px solid #849b8e; padding-bottom: 4px; }
.stage-badge { position: absolute; z-index: 2; left: 18px; bottom: 16px; background: #f8f7f4e8; padding: 8px 10px; border-radius: 2px; color: #506159; font-size: 9px; font-weight: 700; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: #55936f; display: inline-block; margin-right: 5px; }
.preview-meta { display: flex; justify-content: space-between; color: #6e7b74; font: 500 10px 'DM Mono', monospace; margin: 12px 2px 18px; }
.primary-button, .outline-button { border: 0; background: var(--forest); color: white; min-height: 47px; font-size: 12px; font-weight: 700; letter-spacing: .01em; transition: transform .2s, background .2s; }
.primary-button { width: 100%; }
.primary-button:hover, .outline-button:hover { transform: translateY(-1px); background: #31594c; }
.primary-button:disabled { cursor: wait; opacity: .76; }
.primary-button span { margin-right: 6px; color: #d4e4db; }
.helper { font-size: 10px; color: #85918b; line-height: 1.5; text-align: center; margin: 11px 0 0; }
.approval-strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); max-width: 1240px; margin: 0 auto; padding: 21px 0; display: grid; grid-template-columns: 1.5fr .65fr .65fr .65fr auto; align-items: center; gap: 24px; }
.approval-strip .eyebrow { margin-bottom: 5px; }
.approval-strip strong { font-size: 12px; }
.approval-strip div:not(:first-child) span { display: block; color: #89948e; font: 500 9px 'DM Mono', monospace; margin-bottom: 4px; }
.outline-button { background: transparent; color: var(--forest); border: 1px solid #aebeb5; min-height: 39px; padding: 0 15px; }
.outline-button span { margin-left: 10px; font-size: 16px; vertical-align: -1px; }
.toast { position: fixed; z-index: 10; right: 24px; bottom: 22px; max-width: 340px; background: #244137; color: #fff; padding: 13px 17px; font-size: 12px; border-radius: 3px; transform: translateY(100px); opacity: 0; transition: .3s; box-shadow: 0 12px 32px #1d302850; }
.toast.show { transform: translateY(0); opacity: 1; }
.finishing-sheet { display: none; }
@media print {
  @page { size: letter portrait; margin: 0; }
  body { background: #fff; color: #000; font-family: Arial, sans-serif; }
  .app-shell, .toast { display: none !important; }
  .finishing-sheet { display: block; width: 8.5in; min-height: 11in; margin: 0 auto; padding: .42in .5in .3in; font-size: 9pt; }
  .sheet-header { height: .72in; display: flex; justify-content: space-between; align-items: flex-start; padding: .01in 0 .03in; }
  .sheet-logo { width: 1.83in; height: .7in; object-fit: contain; object-position: left top; }
  .sheet-client { min-width: 2.65in; font-size: 9pt; }
  .sheet-client p { margin: 0 0 13pt; display: grid; grid-template-columns: .72in .12in 1fr; }
  .sheet-client b, .sheet-info-grid b { font-weight: 400; }
  .sheet-title { border: 2px solid #000; border-bottom: 1px solid #000; height: .19in; line-height: .17in; text-align: center; font-size: 9pt; font-weight: 700; }
  .sheet-info-grid { display: grid; grid-template-columns: .42fr .58fr; grid-template-rows: repeat(3, .23in); border: 2px solid #000; border-top: 0; }
  .sheet-info-grid p { min-width: 0; margin: 0; padding: 3pt 4pt; display: grid; grid-template-columns: .9in .1in minmax(0, 1fr); }
  .sheet-info-grid p:nth-child(1) { grid-column: 1; grid-row: 1; border-right: 1px solid #000; border-bottom: 1px solid #000; }
  .sheet-info-grid p:nth-child(2) { grid-column: 2; grid-row: 1 / span 2; border-bottom: 1px solid #000; }
  .sheet-info-grid p:nth-child(3) { grid-column: 1; grid-row: 2; border-right: 1px solid #000; }
  .sheet-info-grid p:nth-child(4) { grid-column: 1 / -1; grid-row: 3; border-top: 1px solid #000; }
  .sheet-main { min-height: 5.08in; display: grid; grid-template-columns: 1.86fr .74fr; border: 2px solid #000; border-top: 0; }
  .sheet-visual { position: relative; padding: .12in .03in .38in; overflow: hidden; }
  .sheet-section-label { text-align: center; font-weight: 700; margin: 0 0 3pt; font-size: 8pt; }
  .sheet-render-wrap { position: relative; height: 3.65in; margin-top: .15in; }
  .sheet-product-image { display: block; width: 100%; height: 100%; object-fit: contain; margin: 0 auto; }
  .sheet-preview-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 2pt; height: 100%; }
  .sheet-preview-pair figure { position: relative; margin: 0; border: 1px solid #ddd; overflow: hidden; }
  .sheet-preview-pair img { width: 100%; height: 100%; object-fit: contain; }
  .sheet-preview-pair figcaption { position: absolute; top: 4pt; left: 4pt; background: #fff; padding: 2pt 3pt; font-size: 6pt; font-weight: 700; }
  .sheet-annotation { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
  .sheet-annotation path { fill: none; stroke: #e00000; stroke-width: 2.2; }
  .sheet-callout { position: absolute; z-index: 2; color: #000; background: #fffdfa; padding: 1pt 3pt; font-size: 8pt; font-weight: 700; }
  .wood-callout { left: 23.3%; top: 12.3%; }
  .body-callout { left: 50%; top: 94.5%; transform: translateX(-50%); }
  .fabric-callout { left: 80%; top: 12.3%; }
  .sheet-visual:not(.has-fabric) .fabric-arrow { display: none; }
  .sheet-note { position: absolute; left: 4pt; right: 4pt; margin: 0; font: 5.8pt/1.18 Georgia, serif; }
  .sheet-note { bottom: 17pt; }
  .sheet-note-id { bottom: 4pt; }
  .sheet-detail { border-left: 1px solid #000; }
  .sheet-detail h2 { height: .37in; margin: 0; border-bottom: 1px solid #000; display: grid; place-items: center; font-size: 9pt; font-weight: 400; }
  .sheet-detail > div { padding: 6pt 5pt 0; }
  .sheet-detail > div + div { border-top: 1px solid #000; }
  .sheet-detail strong { font-size: 9pt; }
  .sheet-detail p { margin: 6pt 0 7pt; font-size: 8pt; line-height: 1.3; }
  .sheet-detail small { font-size: 7pt; }
  .sheet-detail .sheet-notes { margin-top: 9pt; border-top: 1px solid #000; padding-top: 6pt; }
  .sheet-swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: .14in; padding: .08in .22in; border: 2px solid #000; border-top: 0; height: 1.95in; }
  .sheet-swatches figure { position: relative; margin: 0; min-width: 0; border: 2px solid #000; overflow: hidden; }
  .sheet-swatches img { display: block; width: 100%; height: 1.54in; object-fit: cover; }
  .sheet-swatches figcaption { position: absolute; bottom: 0; left: 0; right: 0; height: .19in; border-top: 2px solid #000; background: #fff; text-align: center; line-height: .17in; font-size: 8pt; }
  .sheet-swatches .blank-swatch { border-color: #000; }
  .sheet-swatches .blank-swatch figcaption { font-size: 6.5pt; }
  .sheet-signature-title { height: .2in; border: 2px solid #000; border-top: 0; text-align: center; line-height: .18in; font-size: 8pt; }
  .sheet-signatures { display: grid; grid-template-columns: .8fr 1.34fr .84fr; height: .94in; border: 2px solid #000; border-top: 0; }
  .sheet-signatures div { position: relative; border-right: 1px solid #000; padding: 4pt; }
  .sheet-signatures div:last-child { border-right: 0; }
  .sheet-signatures p { margin: 0; font-size: 8pt; }
  .sheet-signatures strong { position: absolute; bottom: 0; left: 0; right: 0; height: .18in; border-top: 1px solid #000; text-align: center; font-size: 8pt; line-height: .17in; font-weight: 400; }
}
@media (max-width: 850px) { .app-shell { grid-template-columns: 1fr; }.sidebar { display: none; } main { padding: 0 24px 35px; }.workspace { grid-template-columns: 1fr; margin-top: 38px; gap: 42px; }.approval-strip { grid-template-columns: 1fr 1fr; }.approval-strip > :first-child { grid-column: 1/-1; }.outline-button { grid-column: 1/-1; } }
@media (max-width: 470px) { main { padding: 0 17px 30px; }.preview-stage, .preview-stage img { min-height: 300px; }.preview-meta { font-size: 8px; }.finish-grid { grid-template-columns: repeat(2, 1fr); } }
