:root{color-scheme:light;--ink:#241b16;--muted:#6d5e54;--paper:#fffaf6;--line:#ebdfd5;--brand:#a93c0b;--orange:#ff9d60;--dark:#251913;font-family:system-ui,-apple-system,sans-serif;background:#f7f0e9;color:var(--ink)}
*,*::before,*::after{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;padding:clamp(12px,4vw,56px)}
button,input,select,textarea{font:inherit}
button:not(:disabled){cursor:pointer}
button:disabled{opacity:.55}
:focus-visible{outline:3px solid #e96725;outline-offset:3px}
p,h1,h2{margin:0}
.shell{max-width:1080px;margin:auto;border:1px solid var(--line);border-radius:22px;overflow:hidden;background:var(--paper);box-shadow:0 18px 55px #56250916}
.mast{display:flex;gap:15px;align-items:center;min-height:66px;padding:9px clamp(16px,4vw,36px);border-bottom:1px solid var(--line)}
.brand{display:inline-flex;align-items:center;gap:7px;color:var(--ink);font-weight:900;font-size:23px;letter-spacing:.06em;text-decoration:none}
.mast>span,.eyebrow{font-weight:800;font-size:11px;letter-spacing:.15em;color:var(--brand)}
.mast>span{padding-left:14px;border-left:1px solid var(--line)}
.quiet{margin-left:auto;border:0;border-radius:9px;padding:9px 12px;background:#f3e5da;color:var(--ink);font-weight:700}
.layout{display:grid;grid-template-columns:minmax(260px, .85fr) minmax(0, 1.25fr)}
.intro{padding:clamp(22px,4vw,48px);background:radial-gradient(ellipse at 105% 0%,#63361f 0%,transparent 60%),var(--dark);color:#ffede1}
.intro .eyebrow{color:var(--orange)}
.intro h1{font-size:clamp(32px,5vw,52px);line-height:1.04;letter-spacing:-.05em;margin:13px 0 15px;color:#fffaf6}
.intro>p:not(.eyebrow){max-width:34ch;line-height:1.55;color:#ebd6c8}
.steps{list-style:none;padding:0;margin:30px 0 0}
.steps li{display:flex;align-items:flex-start;gap:13px;padding:12px 0;border-top:1px solid #ffdec42d;font-size:13px;line-height:1.55}
.steps li>span{font-weight:800;letter-spacing:.08em;color:var(--orange)}
.steps strong{color:#fffaf6}
code{font-size:.92em}
.content{min-width:0;padding:clamp(22px,4vw,48px);line-height:1.55}
.content h2{margin:6px 0 8px;font-size:clamp(23px,3vw,33px);letter-spacing:-.04em;line-height:1.15}
.content h2+p,.footnote,small{color:var(--muted);font-size:14px}
form{display:grid;gap:8px;margin:22px 0 0}
label{display:block;font-size:13px;font-weight:750}
input,select,textarea{display:block;width:100%;min-width:0;min-height:46px;padding:10px 12px;border-radius:9px;background:white;border:1px solid #dbccbf;color:var(--ink)}
input+label,#password-field{margin-top:7px}
#password-field>label{margin-bottom:8px}
.heading,.actions,.links{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.heading{justify-content:space-between}
.actions{margin-top:12px}
.links{margin-top:14px;gap:14px}
.primary,.secondary{min-height:44px;border-radius:999px;padding:10px 15px;font-size:14px;font-weight:750}
.primary{color:white;background:var(--brand);border:1px solid var(--brand);justify-self:start}
#auth-submit{margin-top:8px}
.secondary{background:#fff8f0;color:var(--brand);border:1px solid #c8a791}
.text-button{border:0;background:none;padding:4px 0;text-decoration:underline;text-underline-offset:3px;color:var(--brand);font-size:14px}
.badge{background:#f6e8dc;color:#80320e;border-radius:50px;font-size:12px;font-weight:800;padding:4px 9px}
.badge.ready{background:#e7f2e8;color:#285431}
.notice{margin-bottom:15px;border-radius:9px;padding:9px 12px;background:#f5e7db;font-size:14px}
.notice:empty{display:none}
.notice.error{background:#f9e7e1;color:#812d16}
.footnote{border-top:1px solid var(--line);margin-top:22px;padding-top:12px}
.workspace-notice{margin:12px clamp(16px,4vw,36px)}
.telegram-preview{margin:16px 0 0}
#settings a{color:var(--brand);font-weight:750;text-underline-offset:3px}
.telegram-fields{max-width:640px}
.telegram-step{display:grid;gap:8px;padding:16px 0;border-bottom:1px solid var(--line)}
.telegram-step:first-child{padding-top:0}
.telegram-step h2{display:flex;align-items:center;gap:10px;margin:0;font-size:clamp(19px,3vw,24px)}
.telegram-step h2 span{color:var(--brand);font-size:12px;letter-spacing:.08em}
.telegram-step p{line-height:1.5;color:var(--muted)}
.telegram-step label{margin-top:5px}
.pair-command{overflow-wrap:anywhere;padding:9px 12px;border-radius:9px;background:#f4e8dd;user-select:all}
.telegram-pair-actions{margin:0}
.workspace-nav{display:flex;flex-wrap:wrap;gap:6px;background:#f4e8dd;padding:10px clamp(12px,4vw,36px);border-bottom:1px solid var(--line)}
.workspace-nav a,.primary,.secondary{display:inline-flex;align-items:center;justify-content:center;text-decoration:none}
.workspace-nav a{min-height:42px;border-radius:9px;padding:8px 12px;color:var(--ink);font-size:14px;font-weight:750}
.workspace-nav a:hover,.workspace-nav a[aria-current]{background:white;color:var(--brand)}
.content h1{font-size:clamp(28px,4vw,42px);line-height:1.1;letter-spacing:-.05em;margin:5px 0 8px}
.content h1+p,.content .heading+p{color:var(--muted)}
.table-scroll{overflow:auto;margin:18px 0 13px}
table{width:100%;border-collapse:collapse;text-align:left;font-size:14px;min-width:490px}
th,td{padding:10px 8px;border-bottom:1px solid var(--line);overflow-wrap:anywhere}
td a{color:var(--brand);font-weight:750}
.request-summary,.request-data{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,185px),1fr));gap:10px;margin:18px 0}
.request-summary>div,.request-data>div{padding:12px;border:1px solid var(--line);border-radius:9px;background:white;min-width:0}
.request-summary dt,.request-data dt{color:var(--muted);font-size:13px;font-weight:750}
.request-summary dd,.request-data dd{margin:4px 0 0;overflow-wrap:anywhere}
.request-summary dd{font-weight:800}
.request-data .request-description{grid-column:1/-1;white-space:pre-wrap}
.empty,.share-box{background:#f6e8dc;border:1px solid var(--line);border-radius:12px;padding:14px;margin-top:18px}
fieldset{border:0;margin:0;padding:0;min-width:0}
fieldset:disabled :is(input,textarea,select){background:#f9f3ed;color:var(--ink);opacity:1}
.detail-grid,.adjustments{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.detail-grid.texts,.adjustments{grid-template-columns:repeat(2,minmax(0,1fr))}
.detail-grid.texts{margin-top:10px}
.detail-grid .notes-field{grid-column:1/-1}
.notes-field small{font-weight:500;font-size:12px}
.detail-grid input,.detail-grid textarea,.adjustments input,.estimate-line :is(input,select){margin-top:4px}
textarea{resize:vertical}
.line-heading{margin:19px 0 7px}
.line-heading h2{font-size:20px}
.estimate-line{display:grid;grid-template-columns:minmax(86px,.8fr) minmax(110px,2fr) minmax(55px,.6fr) minmax(76px,.8fr) minmax(64px,.7fr) auto;align-items:end;gap:8px;padding:9px 0;border-bottom:1px solid var(--line)}
.line-amount{padding:0 2px 8px;font-size:13px;font-weight:750}
.line-amount output{display:block;overflow-wrap:anywhere}
.line-remove{min-height:38px;padding:7px 10px;font-size:12px}
.price-grid{display:grid;grid-template-columns:1fr minmax(180px,240px);align-items:start;gap:18px;margin-top:17px}
.price-summary{margin:0;font-variant-numeric:tabular-nums}
.price-summary div{display:flex;justify-content:space-between;gap:8px;padding:4px 0}
.price-summary dd{margin:0;font-weight:750}
.grand-total{border-top:2px solid #e96725;margin-top:5px;font-size:1.2rem;font-weight:850}
.inline-error{color:#812d16;font-size:13px;margin-top:8px}
.inline-error:empty,.revision-actions:has(button[hidden]:first-child + button[hidden]){display:none}
.share-box input{margin-top:6px}
.share-box small{display:block;margin-top:8px}
.danger{color:#8c2b18}
@media(max-width:670px){.layout{grid-template-columns:1fr}.intro h1 br{display:none}.intro h1 br::after{content:" "}.steps{display:none}.mast{gap:8px}.mast>span{padding-left:9px}.content{min-height:300px}}
@media(max-width:670px){.detail-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.detail-grid label:first-child{grid-column:1/-1}.detail-grid.texts{grid-template-columns:1fr}.estimate-line{grid-template-columns:repeat(6,minmax(0,1fr));padding:12px 0}.estimate-line>*{grid-column:span 2}.estimate-line .line-description{grid-column:span 4}.estimate-line .line-remove{grid-column:1/-1;justify-self:start}.price-grid{grid-template-columns:1fr}}
.estimate-line .line-details{grid-column:1/-1}
.estimate-line .line-details small{font-weight:500}
.estimate-line textarea{margin-top:4px;min-height:40px}
.badge.accepted{background:#dcf3e3;color:#14632f}
.badge.changes{background:#fff3cf;color:#6f4b00}
.badge.declined,.badge.revoked{background:#eee;color:#4b4f56}
.badge.published{background:#e7f2e8;color:#285431}
.approval-box,.responses-box{border:1px solid #c6e6d1;background:#f3fbf6;border-radius:12px;padding:14px;margin-top:18px}
.responses-box{border-color:var(--line);background:white}
.approval-box h2,.responses-box h2{font-size:20px;margin:0}
.approval-grid{display:grid;grid-template-columns:1fr minmax(180px,260px);gap:12px;align-items:start}
.approval-signature{margin:18px 0 0;background:white;border:1px solid var(--line);border-radius:9px;padding:8px;text-align:center}
.approval-signature img{max-width:100%;max-height:90px}
.approval-signature figcaption{font-size:12px;color:var(--muted)}
#approval-hash{display:block;overflow-wrap:anywhere}
#response-list{margin:10px 0 0;padding-left:20px;display:grid;gap:10px}
#response-list li{font-size:14px}
#response-list p{white-space:pre-wrap;margin-top:3px;color:var(--muted)}
.view-note{font-size:12px;color:var(--muted);display:block}
@media(max-width:670px){.approval-grid{grid-template-columns:1fr}}
/* Leads */
.filter-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:16px}
.filter-row select{width:auto;min-width:220px}
.badge.lead-new{background:#fde3d3;color:#8a2f06}
.badge.lead-contacted{background:#e3ecfb;color:#1d3f7a}
.badge.lead-sent{background:#fff3cf;color:#6f4b00}
.badge.lead-won{background:#dcf3e3;color:#14632f}
.badge.lead-lost{background:#f9e1df;color:#7d1f16}
.badge.lead-archived{background:#eee;color:#4b4f56}
.badge.pending{background:#fff3cf;color:#6f4b00}
.badge.failed{background:#f9e1df;color:#7d1f16}
.status-form{display:grid;gap:6px;max-width:520px;margin:6px 0 4px}
.status-row{display:flex;gap:8px;flex-wrap:wrap}
.status-row select{flex:1 1 200px;width:auto}
a.secondary:not([href]){opacity:.5;pointer-events:none}
/* Telegram integration */
.tg-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr));gap:10px;margin:20px 0 6px}
.tg-card{padding:14px;border:1px solid var(--line);border-radius:12px;background:white;min-width:0}
.tg-card h2{margin:0 0 4px!important;font-size:12px!important;letter-spacing:.08em!important;text-transform:uppercase;color:var(--muted)}
.tg-value{font-size:19px;font-weight:800;overflow-wrap:anywhere}
.tg-card small{display:block;margin-top:4px;overflow-wrap:anywhere}
.tg-section{margin-top:28px;padding-top:20px;border-top:1px solid var(--line);display:block}
.tg-section h2{font-size:clamp(19px,2.4vw,24px)}
.tg-env{list-style:none;padding:0;margin:8px 0 0;display:grid;gap:6px}
.tg-env li{font-size:14px;padding:8px 10px;border-radius:9px;background:white;border:1px solid var(--line)}
.tg-env li::before{content:"✓ ";font-weight:800;color:#14632f}
.tg-env li.missing::before{content:"✕ ";color:#7d1f16}
.tg-toggles{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:8px;margin:10px 0}
label.check{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--line);border-radius:9px;background:white;font-weight:650}
label.check input{width:20px;min-height:20px;height:20px;margin:0;flex:none;accent-color:var(--brand)}
.tg-unsupported{margin:8px 0 22px;padding-left:18px;color:var(--muted);font-size:14px;display:grid;gap:4px}
.tg-summary{display:grid;grid-template-columns:minmax(0,2fr) repeat(auto-fit,minmax(130px,1fr));gap:10px;align-items:end;margin-top:10px}
.footnote-inline{color:var(--muted);font-size:14px}
.tg-checklist summary,#legacy-setup summary{cursor:pointer;list-style:none}
.tg-checklist summary h2,#legacy-setup summary h2{display:inline}
.tg-checklist summary::before,#legacy-setup summary::before{content:"▸ ";color:var(--brand)}
.tg-checklist[open] summary::before,#legacy-setup[open] summary::before{content:"▾ "}
.tg-checklist ol{display:grid;gap:8px;padding-left:20px;font-size:14px}
#settings td .secondary{min-height:36px;padding:6px 12px}
@media (max-width:640px){.tg-summary{grid-template-columns:1fr}}
