/* Portal surfaces — built on the design tokens declared in style.css */

.site-nav { display: flex; align-items: center; gap: clamp(.75rem, 2vw, 1.5rem); }
.site-nav form { margin: 0; }
.nav-link { position: relative; color: var(--ink-2); text-decoration: none; font: 400 .88rem var(--font-sans); transition: color .2s ease; }
.nav-link::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px; background: var(--blue); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.nav-link:hover { color: var(--blue); }
.nav-link:hover::after { transform: scaleX(1); }
.site-nav .header-login { margin-left: .4rem; }

/* Shared page shells */
.portal-shell { width: min(calc(100% - 3rem), var(--max)); margin: 0 auto; padding: clamp(3rem, 6vw, 5rem) 0 6rem; }
.portal-shell.narrow { max-width: 46rem; }
.portal-shell > .lead { margin-bottom: 2.5rem; }

.auth-shell { width: min(calc(100% - 3rem), 62rem); margin: 0 auto; padding: clamp(3rem, 7vw, 6rem) 0 7rem; display: grid; grid-template-columns: 1fr minmax(320px, .95fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; min-height: 68vh; }
.auth-shell h1 { font-size: var(--title-size); margin-bottom: 1rem; }
.auth-shell > div > p:last-child { color: var(--muted); max-width: 26rem; margin: 0; }

.auth-form { display: grid; gap: 1.1rem; padding: 1.9rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.auth-form label { display: grid; color: var(--blue-deep); font: 500 .67rem var(--font-mono); letter-spacing: .09em; text-transform: uppercase; }
.auth-form input, .auth-form select { width: 100%; margin-top: .3rem; padding: .7rem 0; border: 0; border-bottom: 1px solid var(--line-strong); background: transparent; outline: none; color: var(--ink); font: 400 .95rem var(--font-sans); letter-spacing: normal; text-transform: none; }
.auth-form select { padding-right: .3rem; }
.auth-form input:focus, .auth-form select:focus { border-color: var(--blue); }
/* One password field with a "Show" button at its end, instead of typing it twice. */
.password-field { position: relative; display: block; }
.password-field input { padding-right: 3.6rem; }
.password-toggle { position: absolute; right: 0; bottom: .55rem; padding: .2rem .45rem; border: 0; border-radius: 4px; background: transparent; color: var(--blue); cursor: pointer; font: 500 .66rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.password-toggle:hover, .password-toggle:focus-visible { background: var(--blue-pale); }
.auth-form .g-recaptcha { margin-top: .4rem; }
.auth-form .button { margin-top: .4rem; border: 0; cursor: pointer; }
.auth-form p { margin: 0; color: var(--muted); font-size: .84rem; }
.auth-form p a { color: var(--blue-deep); font-weight: 600; text-decoration: none; }

.field-error, .auth-form p.field-error { color: #b3392f; font-size: .82rem; font-weight: 600; }
.alert { margin: 0 0 1.5rem; padding: .85rem 1.1rem; border: 1px solid var(--line-blue); border-left-width: 3px; border-radius: var(--radius-sm); background: var(--blue-mist); color: var(--blue-deep); font-size: .88rem; font-weight: 600; }

/* Dashboard */
.dashboard-heading { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1.5rem; margin-bottom: 2.5rem; }
.dashboard-heading h1 { font-size: var(--title-size); margin: 0; }

.balance-card { position: relative; display: grid; grid-template-columns: auto auto 1fr; align-items: baseline; gap: .5rem 1rem; padding: 1.6rem 1.9rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.balance-card::after { content: ""; position: absolute; inset: 0 0 0 auto; width: 16rem; background: radial-gradient(circle at 80% 30%, rgba(0,100,249,.16), transparent 70%); pointer-events: none; }
.balance-card > span:first-child { grid-column: 1 / -1; color: var(--muted); font: 500 .7rem var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.balance-card strong { color: var(--blue); font: 300 clamp(2.6rem, 5vw, 3.6rem)/1 var(--font-display); letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.balance-card small { color: var(--muted); font: 500 .72rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.balance-card a { justify-self: end; position: relative; z-index: 1; color: var(--blue-deep); font: 500 .74rem var(--font-mono); letter-spacing: .05em; text-transform: uppercase; text-decoration: none; }

.jobs-section { margin-top: 3.5rem; }
.jobs-section h2 { font-size: 1.6rem; margin-bottom: 1.2rem; }

/* The Dashboard: the viewer (left) and the credits (right) side by side, the same height, then the projects. Labels are
   the site's eyebrows; the price of a credit is the Pricing page's table. */
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
/* Credits: the total and one line per kind of credit on the left, "Buy credits" on the right. */
/* No box: the credits sit on the page, their eyebrow where every page's eyebrow is. */
.dashboard-grid .dashboard-credits { display: flex; flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 1.5rem 2.5rem; padding: 0 0 .6rem; background: none; border: 0; border-radius: 0; box-shadow: none; }
.dashboard-grid .dashboard-credits::before { display: none; }
.dashboard-credits__main { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .2rem 2.6rem; min-width: 0; }
.dashboard-credits__eyebrow { grid-column: 1 / -1; }
.dashboard-kinds { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .35rem 1.2rem; margin: 0; padding-left: 2.6rem; border-left: 1px solid var(--line); font-size: .88rem; }
.dashboard-kinds dt { color: var(--ink-2); }
.dashboard-kinds dd { margin: 0; color: var(--muted); }
.dashboard-kinds dd b { margin-right: .35rem; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.dashboard-actions { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; min-width: 12rem; }
.dashboard-actions .button { justify-content: center; white-space: nowrap; }
/* "New project" across the top; "Buy credits" and "Plugin login" side by side below, so the stack stays two rows high. */
.dashboard-actions .button-primary { grid-column: 1 / -1; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
#credits-history td.num, #credits-history th.num { text-align: right; font-variant-numeric: tabular-nums; }
#credits-history b.is-in { color: var(--blue); font-weight: 600; }
#credits-history b.is-out { color: var(--ink); font-weight: 600; }
.buy-dialog { width: min(100%, 26rem); }
.buy-dialog h2 { margin: 0 0 1rem; font-size: 1.35rem; }
.buy-dialog .rate-table { padding: 0; border: 0; box-shadow: none; background: none; }
.buy-dialog .rate-table::before { display: none; }
.buy-dialog .button-wide { width: 100%; margin: 1.2rem 0 1rem; justify-content: center; }
.buy-dialog .button[disabled] { opacity: .6; cursor: not-allowed; }
.dashboard-viewer, .dashboard-credits { position: relative; display: flex; flex-direction: column; padding: 1.5rem 1.6rem 1.6rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.dashboard-viewer::before, .dashboard-credits::before { content: ""; position: absolute; top: -4px; left: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.dashboard-viewer__frame { flex: 1; min-height: clamp(420px, 60vh, 640px); display: grid; place-items: center; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--soft, #f5f8fd); color: var(--muted); font-size: .92rem; text-align: center; }
.dashboard-viewer__frame p { margin: 0 0 1rem; padding: 0 1rem; }
.dashboard-viewer__frame .dashboard-viewer__soon { margin-bottom: .4rem; color: var(--ink); font: 500 .9rem var(--font-mono); letter-spacing: .14em; text-transform: uppercase; }
.dashboard-viewer__frame .dashboard-viewer__soon strong { color: var(--blue); }
.dashboard-credits__balance { display: flex; align-items: baseline; gap: .6rem; margin: 0; }
.dashboard-credits__balance strong { color: var(--blue); font: 300 clamp(2.6rem, 5vw, 3.4rem)/1 var(--font-display); letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.dashboard-credits__balance span { color: var(--muted); font: 500 .72rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.dashboard-credits__note { margin: .6rem 0 0; color: var(--muted); font-size: .84rem; line-height: 1.5; }
.dashboard-credits__note a { color: var(--blue-deep); text-decoration: none; font-weight: 500; }
.dashboard-credits__note a:hover { text-decoration: underline; }
.dashboard-credits__part { margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.dashboard-credits .rate-table { padding: 0; border: 0; box-shadow: none; background: none; }
.dashboard-credits .rate-table::before { display: none; }
.dashboard-credits .rate-table__row { padding: .45rem 0; }
.dashboard-credits .rate-table__row span { font-size: .88rem; }
.dashboard-credits .rate-table__row strong { font-size: 1.25rem; }
.dashboard-credits .button-wide { width: 100%; margin-top: 1rem; justify-content: center; font-size: .8rem; }
.dashboard-credits .button[disabled] { opacity: .6; cursor: not-allowed; }
.dashboard-history { margin: .2rem 0 0; padding: 0; list-style: none; }
.dashboard-history li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--line); font-size: .86rem; color: var(--ink-2); }
.dashboard-history li:last-child { border-bottom: 0; }
.dashboard-history small { display: block; color: var(--muted); font: 400 .68rem var(--font-mono); letter-spacing: .04em; }
.dashboard-history b { font: 500 .9rem var(--font-mono); font-variant-numeric: tabular-nums; }
.dashboard-history b.is-in { color: var(--blue); }
.dashboard-history b.is-out { color: var(--ink); }
@media (max-width: 900px) { .dashboard-grid .dashboard-credits { flex-direction: column; align-items: stretch; } .dashboard-credits__main { grid-template-columns: 1fr; } .dashboard-kinds { padding-left: 0; border-left: 0; } .dashboard-viewer__frame { min-height: 280px; } }

.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.table-wrap table { width: 100%; border-collapse: collapse; }
.table-wrap th { padding: .95rem 1.2rem; text-align: left; background: var(--blue-mist); border-bottom: 1px solid var(--line); color: var(--blue-deep); font: 500 .66rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.table-wrap td { padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .9rem; vertical-align: middle; }
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap tr:hover td { background: var(--blue-mist); }
.table-wrap td strong { display: block; color: var(--ink); font: 500 .82rem var(--font-mono); letter-spacing: .07em; }
.table-wrap td small { color: var(--muted); font-size: .78rem; }

.status { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem; border-radius: 100vmax; background: var(--blue-pale); color: var(--blue-deep); font: 500 .67rem var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.status::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.status-processing, .status-queued { background: #fff3da; color: #8a5a10; }
.status-ready { background: #e2f6e8; color: #1f7a42; }
.status-failed, .status-failed_antivirus, .status-failed_upload { background: #fdeceb; color: #a8352b; }
/* A technician has the treatment in hand: shown like work in progress, not as an error. */
.status-failed_manual { background: #e6effe; color: #0a4fb8; }
.status-downloaded { background: #eaeef1; color: #4a5f6c; }
.status-completed { background: #e2f6e8; color: #1f7a42; }

.empty-state { padding: 3rem 1.5rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: #fff; text-align: center; color: var(--muted); }
.empty-state a { display: inline-block; margin-left: .4rem; color: var(--blue-deep); font-weight: 600; text-decoration: none; }
.empty-state a.button { display: inline-flex; margin-left: .8rem; color: #fff; }
/* "No projects yet" with its New project button: text and button centred on one line (stacked when narrow). */
.empty-state--action { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1rem 1.4rem; }
.empty-state--action a.button { margin-left: 0; }
.job-processing-note { margin: -1.6rem 0 2rem; color: var(--muted); font-size: .9rem; }

.job-actions { text-align: right; white-space: nowrap; }
.job-actions form { display: inline-block; margin: 0 .6rem 0 0; }
.button-small { min-height: 34px; padding: .45rem .85rem; font-size: .68rem; }
.report-link { border: 0; padding: 0; background: none; color: var(--blue-deep); font: 500 .74rem var(--font-mono); letter-spacing: .04em; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.report-sent { color: #1f7a42; font: 500 .74rem var(--font-mono); letter-spacing: .04em; }

.report-modal-overlay { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 1.5rem; background: rgba(18,21,25,.45); backdrop-filter: blur(2px); }
.report-modal { position: relative; width: min(100%, 26rem); padding: 1.75rem; border-radius: var(--radius); background: #fff; box-shadow: 0 24px 60px rgba(18,21,25,.25); }
.report-modal h3 { margin-bottom: .5rem; }
.report-modal p { margin: 0 0 1rem; color: var(--muted); font-size: .88rem; }
.report-modal textarea { width: 100%; padding: .75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); resize: vertical; color: var(--ink); font: 400 .92rem var(--font-sans); }
.report-modal textarea:focus { outline: none; border-color: var(--blue); }
.report-modal-close { position: absolute; top: .9rem; right: .9rem; width: 1.8rem; height: 1.8rem; border: 0; border-radius: 50%; background: var(--soft); color: var(--muted); font-size: 1rem; line-height: 1; cursor: pointer; }
.report-modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 1rem; margin-top: 1rem; }
.button-text { border: 0; padding: 0; background: none; color: var(--muted); font: 500 .74rem var(--font-mono); letter-spacing: .04em; cursor: pointer; }

/* Contact modal — opened via the #contact-modal anchor, no JS required */
.contact-modal-overlay { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 1.5rem; background: rgba(18,21,25,.5); backdrop-filter: blur(3px); opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s ease; }
.contact-modal-overlay:target { opacity: 1; visibility: visible; }
.contact-modal { position: relative; width: min(100%, 30rem); max-height: 90vh; overflow-y: auto; padding: 2rem; border-radius: var(--radius); background: #fff; box-shadow: 0 30px 70px rgba(18,21,25,.28); }
.contact-modal h2 { margin-bottom: .6rem; }
.contact-modal-lead { color: var(--muted); margin: 0 0 1.4rem; font-size: .92rem; }
.contact-modal-close { position: absolute; top: 1.1rem; right: 1.1rem; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--soft); color: var(--muted); text-decoration: none; font-size: 1.1rem; line-height: 1; }
.contact-modal-close:hover { color: var(--blue-deep); }
.contact-form { display: grid; gap: 1rem; }
.contact-form label { display: grid; color: var(--blue-deep); font: 500 .67rem var(--font-mono); letter-spacing: .09em; text-transform: uppercase; }
.contact-form input, .contact-form textarea { width: 100%; margin-top: .3rem; padding: .7rem 0; border: 0; border-bottom: 1px solid var(--line-strong); background: transparent; outline: none; color: var(--ink); font: 400 .95rem var(--font-sans); letter-spacing: normal; text-transform: none; resize: vertical; }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--blue); }
.contact-form .button { margin-top: .4rem; border: 0; cursor: pointer; }

/* Billing */
.pack-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.pack { display: flex; flex-direction: column; gap: .5rem; padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; transition: transform .25s ease, box-shadow .25s ease; }
.pack:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.pack > span:first-child { color: var(--blue); font: 500 .7rem var(--font-mono); letter-spacing: .11em; text-transform: uppercase; }
.pack strong { color: var(--ink); font: 300 1.5rem/1.1 var(--font-display); letter-spacing: -.04em; }
.pack p { flex: 1; margin: 0; color: var(--muted); font-size: .85rem; }
.pack button { min-height: 44px; margin-top: .6rem; padding: .7rem 1.1rem; border: 1px solid transparent; border-radius: var(--radius-sm); background: var(--blue); color: #fff; font: 500 .88rem var(--font-sans); cursor: pointer; transition: background .2s ease; }
.pack button:hover:not(:disabled) { background: var(--blue-deep); }
.pack button:disabled { background: #EEF1F5; color: var(--muted); cursor: not-allowed; }

/* New treatment */
.pipeline-form { display: grid; gap: 1rem; margin-top: 2rem; }
.pipeline-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.1rem; padding: 1.4rem 1.6rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; cursor: pointer; transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.pipeline-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.pipeline-card:has(input:checked) { border-color: var(--blue); background: var(--blue-mist); box-shadow: var(--shadow); }
.pipeline-card input { width: 1.15rem; height: 1.15rem; accent-color: var(--blue); }
.pipeline-card span { display: grid; gap: .25rem; }
.pipeline-card b { color: var(--ink); font: 400 1.1rem var(--font-display); letter-spacing: -.02em; }
.pipeline-card span.pipeline-card__product { display: inline; color: var(--blue); } /* SPACE, CLEAN in blue, as across the site */
.product-word { color: var(--blue); } /* product names (SPACE, CLEAN, CLOUD) in blue, as across the site */
.pipeline-card small { color: var(--muted); font-size: .86rem; }
.pipeline-card em { color: var(--blue-deep); font: 500 .7rem var(--font-mono); letter-spacing: .07em; text-transform: uppercase; font-style: normal; text-align: right; }
.pipeline-form .button { justify-self: start; margin-top: .8rem; border: 0; cursor: pointer; }

/* Legal pages */
.legal-hero { width: min(calc(100% - 3rem), var(--max)); margin: 0 auto; padding: clamp(3.5rem, 7vw, 6rem) 0 2.5rem; }
.legal-hero h1 { font-size: var(--title-size); margin-bottom: 1rem; }
.legal-hero .legal-meta { display: inline-flex; align-items: center; gap: .5rem; padding: .4rem .9rem; border: 1px solid var(--line); border-radius: 100vmax; background: #fff; color: var(--muted); font: 500 .68rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.legal-hero .legal-meta::before { content: ""; width: .4rem; height: .4rem; border-radius: 50%; background: var(--blue); }

.legal-layout { width: min(calc(100% - 3rem), var(--max)); margin: 0 auto; padding-bottom: 7rem; display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }

.legal-toc { position: sticky; top: 6rem; padding: 1.4rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 8px 26px rgba(18,21,25,.04); }
.legal-toc p { margin: 0 0 .9rem; color: var(--blue); font: 500 .68rem var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.legal-toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; display: grid; gap: .1rem; }
.legal-toc li { counter-increment: toc; }
.legal-toc a { display: grid; grid-template-columns: 1.6rem 1fr; gap: .3rem; padding: .35rem .4rem; border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; font-size: .82rem; line-height: 1.35; transition: background .2s ease, color .2s ease; }
.legal-toc a::before { content: counter(toc, decimal-leading-zero); color: var(--blue); font: 500 .7rem var(--font-mono); }
.legal-toc a:hover { background: var(--blue-mist); color: var(--blue-deep); }

.legal-body { min-width: 0; }
.legal-body section { padding-bottom: 2.6rem; margin-bottom: 2.6rem; border-bottom: 1px solid var(--line); scroll-margin-top: 6rem; }
.legal-body section:last-child { border-bottom: 0; }
.legal-body h2 { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: .7rem; font-size: clamp(1.5rem, 2.6vw, 2rem); margin-bottom: 1.4rem; }
.legal-body h2 span { color: var(--blue); font-size: .8rem; font-weight: 600; letter-spacing: .08em; }
.legal-body h3 { font-size: 1rem; margin: 1.6rem 0 .8rem; color: var(--blue-deep); }
.clause { margin: 0 0 .85rem; padding-left: 4.2rem; text-indent: -4.2rem; color: var(--muted); font-size: .93rem; line-height: 1.65; }
.clause > b { display: inline-block; width: 3.4rem; margin-right: .8rem; text-indent: 0; color: var(--blue); font: 500 .78rem/1.9 var(--font-mono); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.clause strong { color: var(--ink); }
.clause a { color: var(--blue-deep); font-weight: 700; }
.clause.deep { padding-left: 5.4rem; text-indent: -5.4rem; }
.clause.deep > b { width: 4.6rem; }
.clause.deeper { padding-left: 8rem; text-indent: -8rem; }
.clause.deeper > b { width: 5.6rem; }

.legal-table { margin: 1.4rem 0 .5rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.legal-table table { width: 100%; border-collapse: collapse; }
.legal-table th { padding: .9rem 1rem; text-align: left; background: var(--blue-mist); border-bottom: 1px solid var(--line); color: var(--blue-deep); font: 500 .64rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.legal-table td { padding: .9rem 1rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .85rem; line-height: 1.55; vertical-align: top; }
.legal-table tr:last-child td { border-bottom: 0; }
.legal-table td:first-child { color: var(--ink); font-weight: 600; }
.legal-table td b { display: block; color: var(--blue); font: 500 .7rem var(--font-mono); letter-spacing: .05em; margin-bottom: .25rem; }

@media (max-width: 900px) {
    .auth-shell { grid-template-columns: 1fr; min-height: 0; }
    .nav-link { display: none; }
    .legal-layout { grid-template-columns: 1fr; }
    .legal-toc { position: static; }
    .legal-table { overflow-x: auto; }
    .legal-table table { min-width: 34rem; }
}

@media (max-width: 640px) {
    .portal-shell, .auth-shell, .legal-hero, .legal-layout { width: min(calc(100% - 2rem), var(--max)); }
    .clause { padding-left: 3rem; text-indent: -3rem; }
    .clause > b { width: 2.3rem; margin-right: .5rem; }
    .clause.deep { padding-left: 3.8rem; text-indent: -3.8rem; }
    .clause.deep > b { width: 3.1rem; }
    .clause.deeper { padding-left: 4.6rem; text-indent: -4.6rem; }
    .clause.deeper > b { width: 3.9rem; }
    .balance-card { grid-template-columns: 1fr; }
    .balance-card a { justify-self: start; }
    .pipeline-card { grid-template-columns: auto 1fr; }
    .pipeline-card em { grid-column: 2; text-align: left; }
    .table-wrap { overflow-x: auto; }
}

/* --- Fiche d'un traitement + viewer IFC ------------------------------------ */
.job-link { display: block; color: inherit; text-decoration: none; }
.job-link:hover strong { color: var(--blue); }

.dashboard-heading .eyebrow a { color: var(--blue-deep); text-decoration: none; }
.dashboard-heading .eyebrow a:hover { text-decoration: underline; }

.job-detail { display: grid; grid-template-columns: minmax(0, 1fr) 21rem; gap: 1.6rem; align-items: start; }
.job-detail h2 { margin: 0 0 .9rem; color: var(--blue-deep); font: 500 .7rem var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }

.job-viewer-panel { min-width: 0; }
/* Le canvas xeokit se dimensionne sur son parent : il lui faut une hauteur
   explicite, sinon il se réduit à 0 et le modèle n'apparaît jamais. */
.job-viewer { position: relative; height: clamp(24rem, 58vh, 40rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--blue-mist); overflow: hidden; }
.job-viewer canvas { display: block; width: 100%; height: 100%; }
.job-viewer-empty { display: grid; place-items: center; padding: 2rem; text-align: center; color: var(--muted); }
.job-viewer-empty p { max-width: 24rem; margin: 0; }

.job-viewer-status { position: absolute; inset: 0; display: grid; place-items: center; padding: 2rem; background: var(--blue-mist); color: var(--muted); font-size: .88rem; text-align: center; }
.job-viewer-status[hidden] { display: none; }
.job-viewer-toolbar { position: absolute; top: .8rem; right: .8rem; display: flex; gap: .5rem; }
.job-viewer-hint { margin: .7rem 0 0; color: var(--muted); font-size: .78rem; }

.job-stats-panel { padding: 1.4rem 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.job-stats { display: grid; grid-template-columns: auto 1fr; gap: .55rem 1rem; margin: 0; }
.job-stats dt { color: var(--muted); font: 500 .66rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; align-self: baseline; }
.job-stats dd { margin: 0; color: var(--ink); font-size: .88rem; text-align: right; overflow-wrap: anywhere; }
.job-ref { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: .72rem; color: var(--muted); }

.job-detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.job-detail-actions form { margin: 0; }
.job-report-inline { display: inline-flex; }

@media (max-width: 900px) {
    .job-detail { grid-template-columns: 1fr; }
}
.captcha-field { display: grid; grid-template-columns: auto 1fr; gap: .5rem .9rem; align-items: center; }
.captcha-field img { display: block; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); }
.captcha-field label { grid-column: 1 / -1; }
.captcha-refresh { justify-self: start; padding: 0; border: 0; background: none; cursor: pointer; color: var(--blue); font: 500 .7rem var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }

/* DENSIFY card on browsers without WebGPU (public/assets/js/treatment-form.js) */
.pipeline-card.is-disabled { opacity: .55; filter: grayscale(1); cursor: not-allowed; }
.pipeline-card.is-disabled:hover { transform: none; box-shadow: none; }
.pipeline-card .gpu-warning { color: #a8352b; font-weight: 600; }
.pipeline-card .gpu-warning[hidden] { display: none; }
.pipeline-form [hidden] { display: none; }
.auth-forgot { margin: -.5rem 0 0; font-size: .82rem; text-align: right; }

/* New project: the building type in the same style as the other fields. */
.pipeline-form [data-building-type] { display: grid; gap: .3rem; max-width: 20rem; color: var(--blue-deep); font: 500 .67rem var(--font-mono); letter-spacing: .09em; text-transform: uppercase; }
.pipeline-form [data-building-type] select { width: 100%; padding: .6rem 0; border: 0; border-bottom: 1px solid var(--line-strong); background: transparent; color: var(--ink); font: 400 .95rem var(--font-sans); letter-spacing: normal; text-transform: none; outline: none; }
.pipeline-form [data-building-type] select:focus { border-color: var(--blue); }

/* Section labels on the project and Lighten pages: the site's eyebrows. */
.job-viewer-panel h2.eyebrow, .job-stats-panel h2.eyebrow, .portal-shell h2.eyebrow { display: flex; margin: 0 0 1rem; font-size: .72rem; }

/* SNAPTWIN CLOUD: the way in on the Dashboard (a button and the latest models, not the viewer itself). */
.dashboard-viewer__frame--cloud { min-height: 0; padding: 2.2rem 1rem; }
.dashboard-viewer__frame--cloud > div { max-width: 40rem; }
.dashboard-cloud__title { margin: 1.8rem 0 .5rem !important; color: var(--ink); font: 500 .72rem var(--font-mono); letter-spacing: .14em; text-transform: uppercase; }
.dashboard-cloud__models { margin: 0; padding: 0; list-style: none; text-align: left; }
.dashboard-cloud__models li + li { border-top: 1px solid var(--line); }
.dashboard-cloud__models a { display: flex; gap: .6rem; align-items: baseline; padding: .55rem .2rem; color: var(--ink); text-decoration: none; }
.dashboard-cloud__models a small { color: var(--muted); }
.dashboard-cloud__models a span { margin-left: auto; color: var(--blue); }
.dashboard-cloud__models a:hover { color: var(--blue); }

/* SNAPTWIN CLOUD page: a bar (models, back to the Dashboard) and the viewer filling the rest of the screen. */
.cloud-page { display: flex; flex-direction: column; height: calc(100svh - 78px); }
.cloud-bar { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; align-items: center; padding: .4rem max(1rem, calc((100% - var(--max)) / 2)); border-bottom: 1px solid var(--line); background: #fff; }
.cloud-bar .eyebrow { margin: 0; }
.cloud-bar .text-link { margin-left: auto; }
.cloud-pick { display: flex; gap: .6rem; align-items: center; }
.cloud-pick label { color: var(--muted); font-size: .85rem; }
.cloud-pick select { max-width: min(28rem, 60vw); padding: .25rem .5rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: inherit; font-size: .88rem; background: #fff; }
.cloud-none { margin: 0; color: var(--muted); font-size: .88rem; }
.cloud-frame { flex: 1; width: 100%; border: 0; display: block; }

/* Portal notices (livewire:portal-notices, in the layout): cards top right, under the header, shown once. */
.portal-notices { position: fixed; z-index: 40; top: calc(78px + 1rem); right: max(1.25rem, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: .75rem; width: min(24rem, calc(100vw - 2.5rem)); pointer-events: none; }
.portal-notice { position: relative; padding: 1rem 2.4rem 1rem 1.1rem; border: 1px solid var(--line-blue); border-left: 3px solid var(--blue); border-radius: var(--radius-sm); background: #fff; color: var(--ink); box-shadow: var(--shadow), 0 24px 48px -24px rgba(18, 21, 25, .25); pointer-events: auto; animation: portal-notice-in .35s ease both; }
.portal-notice--antivirus { border-color: #f3c9c4; border-left-color: #a8352b; }
.portal-notice__title { margin: 0 0 .3rem; font-size: .92rem; font-weight: 600; }
.portal-notice__body { margin: 0; color: var(--ink-2); font-size: .86rem; line-height: 1.5; }
.portal-notice__link { display: inline-block; margin-top: .6rem; color: var(--blue); font-size: .86rem; font-weight: 600; text-decoration: none; }
.portal-notice__link:hover { text-decoration: underline; }
.portal-notice__close { position: absolute; top: .45rem; right: .55rem; width: 1.8rem; height: 1.8rem; border: 0; background: none; color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.portal-notice__close:hover { color: var(--ink); }
@keyframes portal-notice-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) { .portal-notices { top: calc(64px + .75rem); } }
@media (prefers-reduced-motion: reduce) { .portal-notice { animation: none; } }

/* "Plugin login" pop-up (dashboard, components/plugin-logins): the form, the new login shown once with a Copy button,
   then the list with "Sign out". Class names plugin-keys__* are kept from the first version (/plugins). */
dialog.audience-dialog.plugin-dialog { width: min(calc(100% - 2rem), 38rem); }
/* The terms sentence stays on one line on a computer; it wraps only on a phone. */
.plugin-dialog .plugin-logins__form label.plugin-keys__terms { font-size: .8rem; white-space: nowrap; }
@media (max-width: 640px) { .plugin-dialog .plugin-logins__form label.plugin-keys__terms { white-space: normal; } }
.plugin-dialog h2 { margin: 0 0 .4rem; font-size: 1.35rem; }
.plugin-dialog p.contact-modal-lead { margin: 0 0 1rem; }
.plugin-dialog p.plugin-logins__soon { margin: 0 0 1.4rem; padding: .55rem .8rem; border-left: 3px solid var(--blue); border-radius: var(--radius-sm); background: var(--blue-mist); color: var(--blue-deep); font-size: .85rem; }
.plugin-logins__status { margin: 0 0 1rem; color: var(--blue-deep); font-size: .88rem; font-weight: 600; }
.plugin-logins .field-error { margin: 0 0 1rem; }
.plugin-dialog .plugin-keys__new { margin-bottom: 1.2rem; }
.plugin-logins__form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .9rem 1.2rem; }
.plugin-logins__name { display: grid; flex: 1 1 12rem; color: var(--blue-deep); font: 500 .67rem var(--font-mono); letter-spacing: .09em; text-transform: uppercase; }
.plugin-logins__name input { width: 100%; margin-top: .3rem; padding: .6rem 0; border: 0; border-bottom: 1px solid var(--line-strong); background: transparent; outline: none; color: var(--ink); font: 400 .95rem var(--font-sans); letter-spacing: normal; text-transform: none; }
.plugin-logins__name input:focus { border-color: var(--blue); }
.plugin-logins__form .button { border: 0; cursor: pointer; }
.plugin-logins__form label.plugin-keys__terms { flex-basis: 100%; order: 1; }
.plugin-logins__copy { display: flex; gap: .6rem; align-items: stretch; }
.plugin-logins__copy code { flex: 1; min-width: 0; }
.plugin-logins__copy .button { border: 0; cursor: pointer; }
.plugin-dialog p.plugin-logins__count { margin: 1.8rem 0 .5rem; color: var(--blue-deep); font: 500 .67rem var(--font-mono); letter-spacing: .09em; text-transform: uppercase; }
.plugin-logins__list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.plugin-logins__list li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.plugin-logins__list strong { display: block; color: var(--ink); font-size: .92rem; font-weight: 600; }
.plugin-logins__list small { color: var(--muted); font-size: .78rem; }
.plugin-keys__new { margin: 0 0 1.5rem; padding: 1.1rem 1.2rem; border: 1px solid var(--line-blue); border-left-width: 3px; border-radius: var(--radius-sm); background: var(--blue-mist); color: var(--blue-deep); }
.plugin-keys__new p { margin: 0 0 .6rem; font-size: .9rem; }
.plugin-keys__new p:last-child { margin: .6rem 0 0; }
.plugin-keys__value { display: block; padding: .7rem .8rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; color: var(--ink); font: 500 .85rem var(--font-mono); word-break: break-all; user-select: all; -webkit-user-select: all; cursor: text; }
.auth-form label.plugin-keys__terms, .plugin-logins label.plugin-keys__terms { display: flex; gap: .6rem; align-items: flex-start; font: 400 .88rem var(--font-sans); letter-spacing: normal; text-transform: none; color: var(--ink); }
.auth-form label.plugin-keys__terms input, .plugin-logins label.plugin-keys__terms input { width: auto; margin: .2rem 0 0; }
.plugin-keys__revoke { padding: .35rem .8rem; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; color: #b3392f; font: 600 .78rem var(--font-sans); cursor: pointer; }
.plugin-keys__revoke:hover { border-color: #b3392f; }

/* New treatment, step 2: sending the point cloud (treatments/upload.blade.php, assets/js/treatment-upload.js). */
.treatment-upload { display: grid; gap: 1.2rem; margin-top: 2rem; }
.treatment-upload__drop { position: relative; display: grid; gap: .45rem; justify-items: center; padding: 2.2rem 1.5rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: #fff; text-align: center; cursor: pointer; transition: border-color .25s ease, background .25s ease; }
.treatment-upload__drop:hover, .treatment-upload__drop:focus-within { border-color: var(--blue); background: var(--blue-mist); }
.treatment-upload__drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.treatment-upload__drop input:disabled { cursor: default; }
.treatment-upload__choose { color: var(--blue-deep); font: 600 .95rem var(--font-sans); }
.treatment-upload__file { color: var(--ink); font: 500 .85rem var(--font-mono); word-break: break-all; }
.treatment-upload__drop small, .treatment-upload__progress small { color: var(--muted); font-size: .8rem; }
.treatment-upload__progress { display: grid; gap: .45rem; }
.treatment-upload__progress progress { width: 100%; height: .55rem; accent-color: var(--blue); }
.treatment-upload__progress p { margin: 0; color: var(--blue-deep); font: 500 .78rem var(--font-mono); letter-spacing: .04em; }
.treatment-upload__note { margin: 0; color: var(--muted); font-size: .85rem; }
.treatment-upload .button { justify-self: start; }
.treatment-upload .button:disabled { opacity: .5; cursor: default; }
