/* Section Scale website styles
   Colours: Ink #111418, Paper #F4F2EE, Survey Orange #E4572E, Slate #5A5F66 */

@font-face { font-family: 'Archivo'; src: url('/fonts/archivo-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Archivo'; src: url('/fonts/archivo-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Archivo'; src: url('/fonts/archivo-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Plex Mono'; src: url('/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Plex Mono'; src: url('/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }

:root {
  --ink: #111418;
  --paper: #F4F2EE;
  --white: #FFFFFF;
  --accent: #E4572E;
  --accent-text: #B83D18; /* darker orange that passes contrast for text */
  --slate: #5A5F66;
  --body: #3D4249;
  --line: #DAD7D0;
  --dark-line: #3A3F46;
  --dark-muted: #A9AEB5;
  --dark-field: #1C2026;
  --radius: 6px;
  --mono: 'Plex Mono', ui-monospace, monospace;
  --sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.6; }
img, svg { max-width: 100%; display: block; }
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--accent-text); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.1; letter-spacing: -0.02em; margin: 0; font-weight: 600; }
h1 { font-size: clamp(36px, 5vw, 62px); letter-spacing: -0.025em; }
h2 { font-size: clamp(28px, 3.4vw, 42px); }
h3 { font-size: 21px; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.wrap--narrow { max-width: 860px; }
.wrap--form { max-width: 900px; }
.wrap--login { max-width: 440px; padding-top: 64px; padding-bottom: 64px; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--white); padding: 12px 16px; z-index: 100; }
.skip:focus { left: 16px; top: 16px; color: var(--white); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); }
.muted { color: var(--slate); }

/* Eyebrow labels and tags */
.eyebrow, .tag { font-family: var(--mono); font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent-text); margin: 0 0 12px; }
.tag { font-size: 12px; letter-spacing: 0.14em; margin-bottom: 8px; }
.eyebrow--accent, .tag--accent { color: var(--accent); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 4px; border: 2px solid transparent; font: 600 16px/1.2 var(--sans); text-decoration: none; cursor: pointer; color: var(--ink); background: none; }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.btn--accent:hover { background: #F06A43; border-color: #F06A43; color: var(--ink); }
.btn--dark { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn--dark:hover { background: #262B32; color: var(--paper); }
.btn--outline { border-color: currentColor; }
.btn--text { padding: 0 8px; text-decoration: underline; }
.btn--lg { min-height: 54px; padding: 0 26px; }
.btn--sm { min-height: 44px; padding: 0 16px; font-size: 15px; }
.btn--block { width: 100%; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; min-height: 44px; }
.more { font-weight: 600; font-size: 15px; }

/* Header */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: relative; z-index: 10; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-size: 22px; font-weight: 500; letter-spacing: -0.015em; min-height: 44px; }
.logo .mark { width: 22px; height: 36px; flex-shrink: 0; }
.logo--dark { color: var(--paper); }
.logo:hover { color: inherit; }
.nav-desktop { display: flex; align-items: center; gap: 4px 24px; font-size: 15px; }
.nav-desktop a:not(.btn) { text-decoration: none; padding: 10px 0; }
.menu { display: none; }
.menu > summary { list-style: none; display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 48px; height: 48px; padding: 12px; cursor: pointer; border-radius: 4px; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary span { display: block; height: 2px; background: var(--ink); border-radius: 2px; }
.nav-mobile { position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; padding: 8px 24px 20px; box-shadow: 0 12px 24px rgba(17, 20, 24, 0.08); }
.nav-mobile a:not(.btn) { text-decoration: none; padding: 14px 0; border-bottom: 1px solid var(--line); }
.nav-mobile .btn { margin-top: 16px; }

@media (max-width: 960px) {
  .nav-desktop { display: none; }
  .menu { display: block; }
}

/* Hero */
.hero { padding: 64px 0 56px; }
.hero-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 40px 56px; }
.hero-copy { flex: 1 1 520px; min-width: 0; padding-top: 12px; }
.hero h1 { margin-bottom: 20px; }
.lead { font-size: 19px; line-height: 1.55; color: var(--body); max-width: 600px; margin-bottom: 28px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.rating { font-size: 15px; color: var(--body); }
.rating span { color: var(--accent-text); letter-spacing: 2px; margin-right: 6px; }
.glance { margin: 48px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); border-top: 2px solid var(--ink); }
.glance div { padding: 20px 20px 0 0; }
.glance dt { font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--slate); }
.glance dd { margin: 6px 0 0; font-size: 18px; font-weight: 600; }

/* Page hero for inner pages */
.page-hero { padding: 56px 0 48px; border-bottom: 1px solid var(--line); }
.page-hero h1 { max-width: 900px; margin-bottom: 18px; }
.page-hero .lead { margin-bottom: 0; }
.crumbs ol { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--slate); }
.crumbs li + li::before { content: '/'; margin-right: 6px; color: var(--line); }

/* Sections */
.section { padding: 88px 0; }
.section--white { background: var(--white); }
.section--dark { background: var(--ink); color: var(--paper); }
.section--dark a { color: var(--paper); }
.section h2 { margin-bottom: 16px; max-width: 780px; }
.section-lead { font-size: 18px; line-height: 1.6; color: var(--body); max-width: 680px; margin-bottom: 40px; }
.section--dark .section-lead { color: var(--dark-muted); }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; }
.section-head .section-lead { margin-bottom: 40px; }
.sub { font-size: 18px; margin: 40px 0 16px; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 48px 64px; align-items: start; }
.split--wide-left { grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); }
.stack { display: flex; flex-direction: column; gap: 20px; }

/* Cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 24px; }
.card-grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 10px; }
.section--white .card { background: var(--paper); }
.section:not(.section--white) .card { background: var(--white); }
.card p { margin: 0; color: var(--body); flex-grow: 1; font-size: 16px; }
.card--featured { border: 2px solid var(--ink); }
.card--link { text-decoration: none; color: var(--ink); }
.card--link:hover { border-color: var(--ink); color: var(--ink); }
.card-title { font-size: 20px; font-weight: 600; line-height: 1.3; }
.icon { width: 32px; height: 32px; color: var(--ink); }
.tier { border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.tier--featured { border: 2px solid var(--ink); background: var(--paper); }
.tier h3 { margin-bottom: 6px; }
.tier ul { padding-left: 18px; color: var(--body); line-height: 1.9; }
.price-card { background: var(--ink); color: var(--paper); border-radius: var(--radius); padding: 32px; }
.price-card .price { font-size: 40px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 6px; }
.price-card .price-vat { font-size: 16px; font-weight: 400; letter-spacing: 0; color: var(--dark-muted); }
.price-card p { color: var(--dark-muted); }

/* Lists */
.ticks { list-style: none; padding: 0; margin: 0 0 8px; }
.ticks li { display: flex; gap: 14px; align-items: baseline; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 17px; }
.ticks li::before { content: ''; width: 10px; height: 10px; background: var(--accent); flex-shrink: 0; transform: translateY(-1px); }
.pills { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; font-size: 15px; }
.pills li { padding: 10px 16px; background: var(--paper); border-radius: 4px; }
.section:not(.section--white) .pills li { background: var(--white); }
.pills--links li { padding: 0; background: none !important; }
.pills--links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; background: var(--white); border: 1px solid var(--line); border-radius: 4px; text-decoration: none; }
.section--white .pills--links a { background: var(--paper); }
.pills--links a:hover { border-color: var(--ink); }

/* Sample drawings */
.drawing { margin: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.drawing svg { width: 100%; height: auto; }
.drawing figcaption { margin-top: 14px; font-size: 15px; color: var(--slate); }
.drawing figcaption strong { color: var(--ink); }

/* Process */
.steps { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; }
.steps li { border-top: 2px solid var(--dark-line); padding-top: 20px; }
.steps span { font-family: var(--mono); font-size: 14px; color: var(--accent); }
.steps h3 { margin: 10px 0; font-size: 19px; }
.steps p { margin: 0; font-size: 15px; color: var(--dark-muted); }

/* Projects and reviews */
.project { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.project img { width: 100%; height: 200px; object-fit: cover; }
.project > div { padding: 24px; }
.review { margin: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.review footer { font-size: 14px; color: var(--slate); }
.more-line { margin-top: 24px; }

/* Questions */
.faq details { border-top: 1px solid var(--line); padding: 18px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-size: 19px; font-weight: 600; min-height: 44px; display: list-item; padding: 6px 0; }
.faq p { margin: 10px 0 0; color: var(--body); }

/* Prose for long-form pages */
.prose h2 { font-size: 28px; margin: 36px 0 14px; }
.prose h2:first-child { margin-top: 0; }
.prose p { color: var(--body); }

/* Forms */
.quote-card { flex: 1 1 380px; min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.quote-card h2 { font-size: 22px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field label, .field legend { font-size: 14px; font-weight: 600; padding: 0; }
.optional { font-weight: 400; color: var(--slate); }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=search], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; background: var(--paper); border: 1px solid #A9AEB5; border-radius: 4px; font: 16px/1.4 var(--sans); color: var(--ink);
}
textarea { resize: vertical; min-height: 110px; }
input[aria-invalid=true], textarea[aria-invalid=true] { border-color: #B3261E; border-width: 2px; }
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.checks--wide { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; font-weight: 400; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); flex-shrink: 0; }
.form-note { margin: 0; font-size: 13px; color: var(--slate); }
.field-error { margin: 0; font-size: 14px; color: #B3261E; font-weight: 600; }
.form-error { margin: 0; padding: 12px 16px; border-radius: 4px; background: #FBE9E7; color: #8C1D18; font-weight: 600; }
.form-success { padding: 12px 16px; border-radius: 4px; background: #E6F4EA; color: #1E5631; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 18px; margin-bottom: 18px; }
.span-all { grid-column: 1 / -1; }
.quote-form { display: flex; flex-direction: column; gap: 14px; }
.quote-form .btn { align-self: flex-start; }
.quote-form--dark label, .quote-form--dark legend { color: var(--paper); }
.quote-form--dark .optional, .quote-form--dark .form-note { color: var(--dark-muted); }
.quote-form--dark input, .quote-form--dark select, .quote-form--dark textarea { background: var(--dark-field); border-color: var(--dark-line); color: var(--paper); }
.quote-form--dark .check input { accent-color: var(--accent); }
.quote-form--dark .field-error { color: #FFB4A9; }
.quote-side { background: var(--paper); border-radius: 8px; padding: 28px; }
.quote-side h2 { font-size: 24px; margin-bottom: 18px; }
.quote-side input[type=text], .quote-side input[type=email], .quote-side input[type=tel], .quote-side select, .quote-side textarea { background: var(--white); }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.cf-turnstile { min-height: 65px; }

/* Call to action band */
.cta-band { background: var(--ink); color: var(--paper); padding: 56px 0; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.cta-band h2 { font-size: clamp(26px, 3vw, 36px); margin-bottom: 8px; }
.cta-band p { margin: 0; color: var(--dark-muted); }

/* Footer */
.site-footer { background: #0B0D10; color: var(--dark-muted); padding: 64px 0 24px; font-size: 15px; }
.site-footer a { color: var(--dark-muted); }
.site-footer a:hover { color: var(--paper); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; }
.footer-brand .logo { margin-bottom: 12px; font-size: 20px; }
.site-footer h2 { font-size: 14px; color: var(--paper); margin-bottom: 14px; letter-spacing: 0; }
.site-footer ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.site-footer address { font-style: normal; line-height: 1.8; }
.footer-legal { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 48px; padding-top: 20px; border-top: 1px solid #23272E; font-size: 13px; }
.footer-legal p { margin: 0; }

/* Cookie consent */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 560px; margin: 0 auto; background: var(--ink); color: var(--paper); border-radius: 8px; padding: 20px; z-index: 50; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3); }
.consent[hidden] { display: none; }
.consent p { margin: 0 0 14px; font-size: 15px; }
.consent a { color: var(--paper); }
.consent .btn--outline { color: var(--paper); }
.consent-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* WhatsApp chat in the corner */
.chat { position: fixed; right: 20px; bottom: 20px; z-index: 40; }
.chat > summary { list-style: none; }
.chat > summary::-webkit-details-marker { display: none; }
.chat-button { display: inline-flex; align-items: center; gap: 10px; height: 58px; padding: 0 22px 0 18px; border-radius: 999px; background: #25D366; color: var(--ink); font-weight: 600; font-size: 16px; cursor: pointer; box-shadow: 0 10px 28px rgba(17, 20, 24, 0.25); transition: transform 0.15s ease; }
.chat-button:hover { transform: translateY(-2px); }
.chat-icon { width: 26px; height: 26px; flex-shrink: 0; color: var(--ink); }
.chat-panel { position: absolute; right: 0; bottom: 72px; width: min(340px, calc(100vw - 32px)); background: var(--white); border-radius: 12px; box-shadow: 0 18px 48px rgba(17, 20, 24, 0.28); overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: var(--ink); color: var(--paper); }
.chat-avatar { width: 40px; height: 40px; border-radius: 50%; background: #262B32; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.chat-avatar .mark { width: 14px; height: 24px; }
.chat-name { margin: 0; font-weight: 600; }
.chat-hours { margin: 2px 0 0; font-size: 13px; color: var(--dark-muted); }
.chat-body { padding: 18px; background: var(--paper); }
.chat-bubble { margin: 0; padding: 12px 14px; background: var(--white); border-radius: 4px 12px 12px 12px; font-size: 15px; line-height: 1.5; color: var(--body); box-shadow: 0 1px 2px rgba(17, 20, 24, 0.08); }
.chat-start { display: flex; margin: 16px 18px 0; gap: 10px; background: #25D366; border-color: #25D366; color: var(--ink); }
.chat-start:hover { background: #3BE07A; border-color: #3BE07A; color: var(--ink); }
.chat-start .chat-icon { width: 22px; height: 22px; }
.chat-alt { margin: 10px 18px 16px; font-size: 14px; text-align: center; color: var(--slate); }
.chat-panel > .chat-start:last-child { margin-bottom: 18px; }
body:has(.consent:not([hidden])) .chat { bottom: 200px; }

@media (max-width: 640px) {
  .chat { right: 16px; bottom: 16px; }
  .chat-button { width: 58px; padding: 0; justify-content: center; }
  .chat-button-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .chat-panel { bottom: 70px; }
  body:has(.consent:not([hidden])) .chat { bottom: 230px; }
}

@media (prefers-reduced-motion: reduce) { .chat-button { transition: none; } }

/* Admin */
.admin { background: var(--paper); }
.admin-bar { background: var(--white); border-bottom: 1px solid var(--line); }
.admin-bar-row { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; flex-wrap: wrap; }
.admin-bar .logo { font-size: 18px; }
.admin-main { padding: 32px 0 64px; }
.admin-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin h1 { font-size: 32px; }
.admin h2 { font-size: 20px; margin-bottom: 8px; }
.inline-form { display: flex; align-items: center; gap: 12px; }
.stack-form { display: flex; flex-direction: column; gap: 16px; }
.stack-form .btn { align-self: flex-start; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tabs a { padding: 10px 14px; border-radius: 4px; text-decoration: none; font-size: 14px; background: var(--white); border: 1px solid var(--line); }
.tabs a[aria-current=page] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.search { display: flex; gap: 8px; margin-bottom: 20px; max-width: 560px; }
.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 860px; }
.admin-table th { text-align: left; font-weight: 600; padding: 12px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.admin-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; background: #E8E6E1; }
.badge--new { background: #FDE3D8; color: #8A2F12; }
.badge--quoted { background: #E3ECFB; color: #1D3F7A; }
.badge--won { background: #E6F4EA; color: #1E5631; }
.badge--lost, .badge--spam { background: #EEE; color: #555; }
.detail { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 0 0 24px; }
.detail dt { color: var(--slate); }
.detail dd { margin: 0; }
.message { white-space: pre-wrap; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.empty { padding: 32px 0; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding: 40px 0; }
  .section { padding: 64px 0; }
  .quote-card { padding: 20px; }
  .checks { grid-template-columns: 1fr 1fr; }
  .detail { grid-template-columns: 1fr; gap: 2px 0; }
  .detail dd { margin-bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ───────── CRM (admin) ───────── */
.admin .wrap { max-width: 1240px; }
.admin .wrap--narrow { max-width: 900px; }
.admin-nav { border-top: 1px solid var(--line); }
.admin-nav-row { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: thin; }
.admin-nav a { padding: 12px 14px; font-size: 15px; text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; color: var(--body); }
.admin-nav a:hover { color: var(--ink); }
.admin-nav a[aria-current=page] { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.admin-search { flex: 1 1 260px; max-width: 420px; margin-left: auto; }
.admin-search input { min-height: 40px; }
.admin input[type=number], .admin input[type=date] { width: 100%; min-height: 44px; padding: 8px 12px; background: var(--white); border: 1px solid #A9AEB5; border-radius: 4px; font: 16px/1.4 var(--sans); color: var(--ink); }
.admin input[type=text], .admin input[type=email], .admin input[type=tel], .admin input[type=search], .admin select, .admin textarea { background: var(--white); min-height: 44px; }
.admin textarea { min-height: 72px; }
.admin .card { background: var(--white); padding: 22px; gap: 12px; }
.admin .card p { flex-grow: 0; font-size: 15px; }
.admin .card h2 { font-size: 18px; margin: 0; }
.admin .card h3 { font-size: 15px; margin: 6px 0 0; }
.admin fieldset.card { margin: 0; min-width: 0; }
.admin fieldset.card legend { float: left; width: 100%; font-size: 18px; font-weight: 600; padding: 0; margin-bottom: 4px; }
.admin fieldset.card legend + * { clear: both; }
.admin legend .muted { font-size: 14px; font-weight: 400; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card-head a { font-size: 14px; }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 18px; margin: 18px 0; }
.row-gap { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 14px; }
.field-row--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.field--grow { grid-column: span 2; }
.checks-row { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.hint { margin: 0; font-size: 13px; color: var(--slate); }
.small { font-size: 13px; }
.pre { white-space: pre-line; }
.lede { font-size: 18px !important; font-weight: 500; color: var(--ink); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.link-btn { background: none; border: 0; padding: 0 4px; font: inherit; font-size: 13px; color: var(--slate); text-decoration: underline; cursor: pointer; }
.inline-form--tight { display: inline-flex; gap: 0; }
.plain-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0; }
.plain-list li { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.plain-list li:last-child { border-bottom: 0; }

/* summary tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { display: flex; flex-direction: column; gap: 2px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: var(--ink); }
a.tile:hover { border-color: var(--ink); color: var(--ink); }
.tile-k { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--slate); }
.tile-v { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tile-s { font-size: 13px; color: var(--slate); }

/* badges for every record type */
.badge--draft { background: #EEECE7; color: #4A4E55; }
.badge--sent, .badge--booked { background: #E3ECFB; color: #1D3F7A; }
.badge--accepted, .badge--paid, .badge--delivered, .badge--closed { background: #E6F4EA; color: #1E5631; }
.badge--declined, .badge--expired, .badge--void, .badge--cancelled { background: #EEE; color: #555; }
.badge--overdue { background: #FBE9E7; color: #8C1D18; }
.badge--part-paid, .badge--checking { background: #FFF4D6; color: #6B4E00; }
.badge--surveyed, .badge--drawing { background: #FDE3D8; color: #8A2F12; }

/* timeline and tasks */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 170px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.tl-when { color: var(--slate); font-size: 13px; }
.tl-call::before { content: 'Call · '; font-weight: 600; }
.tl-email::before { content: 'Email · '; font-weight: 600; }
.tl-note { white-space: pre-line; }
.note-form textarea { min-height: 60px; }
.note-form { gap: 8px; }
.note-form select { width: auto; }
.tasks { list-style: none; padding: 0; margin: 0; }
.task { display: grid; grid-template-columns: 36px 1fr auto auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.task:last-child { border-bottom: 0; }
.tick { width: 26px; height: 26px; border: 2px solid var(--ink); border-radius: 50%; background: var(--white); cursor: pointer; font-size: 14px; line-height: 1; padding: 0; color: var(--white); }
.tick:hover { background: var(--paper); }
.task--done .tick { background: var(--ink); }
.task--done .task-title { text-decoration: line-through; color: var(--slate); }
.task-due { font-size: 13px; color: var(--slate); white-space: nowrap; }
.task--late .task-due { color: #B3261E; font-weight: 600; }
.task-link { font-size: 13px; }

/* tables */
.table-wrap--plain { border: 0; border-radius: 0; }
.admin-table--compact { min-width: 0; }
.admin-table--compact th, .admin-table--compact td { padding: 9px 8px; }
.admin-table .sum td { border-bottom: 0; padding-top: 6px; padding-bottom: 6px; color: var(--slate); }
.admin-table .sum td:first-child { text-align: right; }
.admin-table .sum--total td { color: var(--ink); font-weight: 600; font-size: 16px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font-family: var(--mono); font-size: 13px !important; }

/* quote editor */
.admin--wide .wrap { max-width: 1400px; }
.quote-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.suggest-col { position: sticky; top: 16px; }
.suggest { gap: 10px; border: 2px solid var(--ink) !important; }
.suggest .eyebrow { margin: 0; }
.suggest-price { font-size: 44px !important; font-weight: 600; letter-spacing: -0.03em; line-height: 1; margin: 0; color: var(--ink) !important; font-variant-numeric: tabular-nums; }
.suggest-range { color: var(--slate) !important; margin: 0; }
.suggest-conf { font-size: 13px !important; padding: 8px 10px; border-radius: 4px; background: var(--paper); margin: 0; }
.conf--starting::before, .conf--early::before, .conf--building::before, .conf--confident::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; background: #A9AEB5; }
.conf--early::before { background: #E9B44C; }
.conf--building::before { background: var(--accent); }
.conf--confident::before { background: #2E7D32; }
.suggest-lines { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 4px 0 0; font-size: 13.5px; }
.suggest-lines dt { color: var(--body); }
.suggest-lines dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.reasons { list-style: none; padding: 0; margin: 0; }
.reasons li { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.reasons li .small { grid-column: 1 / -1; }
.reasons--wide li { grid-template-columns: 1fr auto 130px; }
.reasons--wide li .small { grid-column: auto; text-align: right; }
.up { color: #1E5631; }
.down { color: #8C1D18; }
.your-price { background: #FFF4D6; border-radius: 4px; padding: 8px 10px; }
.similar { list-style: none; padding: 0; margin: 0; }
.similar li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.45; }
.similar .badge { font-size: 11px; padding: 1px 8px; }
.new-client { border-left: 3px solid var(--accent); padding-left: 14px; display: flex; flex-direction: column; gap: 14px; }
.new-client[hidden] { display: none; }

/* line items */
.items-head, .item-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px 120px 110px 36px; gap: 8px; align-items: start; }
.items-head { font-size: 13px; font-weight: 600; color: var(--slate); padding-bottom: 4px; }
.items-head span:nth-child(n+2) { text-align: right; }
#item-rows { display: flex; flex-direction: column; gap: 8px; }
.item-row textarea { min-height: 44px !important; height: 44px; resize: vertical; font-size: 15px; }
.item-row input { text-align: right; }
.item-amount { text-align: right; padding-top: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.item-remove { width: 36px; height: 44px; border: 1px solid var(--line); background: var(--white); border-radius: 4px; cursor: pointer; font-size: 20px; color: var(--slate); }
.item-remove:hover { color: #B3261E; border-color: #B3261E; }
.items-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.totals { display: grid; grid-template-columns: auto 120px; gap: 4px 16px; margin: 0; font-variant-numeric: tabular-nums; }
.totals dt { color: var(--slate); text-align: right; }
.totals dd { margin: 0; text-align: right; }
.totals .t-total { font-weight: 600; font-size: 19px; color: var(--ink); }

@media (max-width: 1080px) {
  .quote-grid, .split { grid-template-columns: 1fr; }
  .suggest-col { position: static; }
}
@media (max-width: 640px) {
  .items-head { display: none; }
  .item-row { grid-template-columns: 70px 1fr 1fr 36px; }
  .item-row textarea { grid-column: 1 / -1; }
  .timeline li { grid-template-columns: 1fr; gap: 0; }
  .field--grow { grid-column: auto; }
  .task { grid-template-columns: 36px 1fr; }
  .task-due, .task-link { grid-column: 2; }
}

/* ───────── client portal (quote and invoice links) ───────── */
.portal { background: var(--paper); }
.portal-bar { background: var(--white); border-bottom: 1px solid var(--line); }
.portal-bar-row { display: flex; align-items: center; min-height: 64px; }
.portal-main { padding: 36px 0 64px; }
.wrap--portal { max-width: 860px; display: flex; flex-direction: column; gap: 18px; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.doc-head h1 { font-size: clamp(28px, 4vw, 40px); }
.doc-head .eyebrow { margin-bottom: 6px; }
.doc-card { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 28px; }
.doc-card h2 { font-size: 18px; margin: 24px 0 8px; }
.doc-card h2:first-child { margin-top: 0; }
.doc-card .pre { margin: 0; }
.doc-parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; margin-bottom: 22px; }
.doc-parties .eyebrow { font-size: 11.5px; margin-bottom: 4px; color: var(--slate); }
.doc-parties p { margin: 0; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.doc-table th { text-align: left; background: var(--ink); color: var(--paper); font-weight: 500; padding: 10px 12px; font-size: 14px; }
.doc-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc-table tfoot td { border-bottom: 0; padding: 6px 12px; color: var(--slate); }
.doc-table tfoot td:first-child { text-align: right; }
.doc-table .doc-total td { color: var(--ink); font-weight: 600; font-size: 18px; background: var(--paper); padding: 12px; }
.doc-table .doc-total td:last-child { color: var(--accent-text); }
.portal-note { padding: 14px 18px; border-radius: 6px; background: #EEECE7; }
.portal-note--ok { background: #E6F4EA; color: #1E5631; }
.portal-note--warn { background: #FBE9E7; color: #8C1D18; }
.accept-form { border: 2px solid var(--ink); }
.accept-form h2 { margin: 0; }
.pay-box .detail { margin: 0 0 12px; }
.thanks h1 { font-size: clamp(30px, 4vw, 44px); margin-bottom: 14px; }
.portal-foot { text-align: center; }
@media (max-width: 640px) {
  .doc-card { padding: 18px; }
  .doc-table { font-size: 14px; }
  .doc-table, .doc-table tbody, .doc-table tfoot { display: block; }
  .doc-table thead { display: none; }
  .doc-table tr { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
  .doc-table td { border-bottom: 0; }
  .doc-table tbody td:nth-child(2), .doc-table tbody td:nth-child(3) { display: none; }
  .doc-table tfoot tr { border-bottom: 0; }
  .doc-table tfoot tr.doc-total { background: var(--paper); }
  .doc-table tfoot td:first-child { text-align: left; }
}
.admin [hidden] { display: none !important; }
.doc-table th.num, .admin-table th.num { text-align: right; }

/* Security checks card on the dashboard */
.security-card--warn { border-color: #B3261E !important; border-width: 2px !important; }
.checklist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.checklist .mark-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 10px; background: #2E7D32; }
.checklist .bad .mark-dot { background: #B3261E; }

/* Legal pages */
.legal h2 { font-size: 22px; margin: 36px 0 12px; }
.legal .clause { display: grid; grid-template-columns: 44px 1fr; gap: 0 8px; margin: 0 0 12px; }
.legal .clause-no { font-family: var(--mono); font-size: 14px; color: var(--slate); padding-top: 3px; }
.legal-summary { background: var(--paper); border-left: 4px solid var(--accent); padding: 16px 20px; border-radius: 4px; }
.form-box { border: 1px dashed var(--slate); border-radius: 6px; padding: 20px 24px; background: var(--paper); }
.form-box p { margin: 0 0 10px; }
.legal-table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 0 0 16px; }
.legal-table th, .legal-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal ul { padding-left: 20px; margin: 0 0 16px; }
.legal ul li { margin-bottom: 8px; }

/* Acceptance form */
.field-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.check--top { align-items: flex-start; min-height: 0; padding: 4px 0; line-height: 1.45; }
.check--top input { margin-top: 2px; }
.accept-form fieldset { margin: 0; }
.accept-form legend { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.cooling { border-left: 4px solid var(--accent) !important; }
