/* =========================================================
   WigWag Quotes - admin styles
   Rebrand here: change the --brand colours and the logo.
   ========================================================= */
:root {
  --brand: #d6246e;          /* WigWag pink (placeholder until final branding) */
  --brand-dark: #a8174f;
  --brand-soft: #fde7f0;

  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #1c2233;
  --muted: #6b7280;
  --line: #e5e7ef;
  --sidebar: #1c2233;
  --sidebar-text: #c9cede;

  --green: #16a34a; --green-soft: #e3f6ea;
  --red: #dc2626;   --red-soft: #fde8e8;
  --amber: #b45309; --amber-soft: #fdf1dc;
  --grey-soft: #eef0f4;

  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 24, 40, .06), 0 4px 16px rgba(20, 24, 40, .05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --engine: var(--brand);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 15px; color: var(--text); background: var(--bg); line-height: 1.45; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .6em; line-height: 1.2; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; background: var(--grey-soft); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.strong { font-weight: 600; color: var(--text); }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }

/* ---------- Layout ---------- */
body.admin { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; flex: 0 0 250px; background: var(--sidebar); color: var(--sidebar-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; background: var(--brand); color: #fff;
  display: inline-grid; place-items: center; font-weight: 800; font-size: 18px; flex: 0 0 36px;
}
.brand-text { font-weight: 700; line-height: 1.1; }
.brand-text small { display: block; font-weight: 500; font-size: .75rem; opacity: .7; margin-top: 2px; }
.menu { display: flex; flex-direction: column; padding: 6px 10px; gap: 2px; }
.menu a {
  display: flex; align-items: center; gap: 10px; color: var(--sidebar-text); padding: 9px 12px; border-radius: 8px; font-size: .93rem;
}
.menu a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 18px; }
.menu a:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.menu a.active { background: var(--brand); color: #fff; }
.sidebar-foot { margin-top: auto; padding: 16px 18px 20px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: .85rem; }
.sidebar-foot .me { color: #fff; margin-bottom: 10px; }
.sidebar-foot .me small { display: block; color: var(--sidebar-text); opacity: .8; }
.sidebar-foot a, .sidebar-foot .link { color: var(--sidebar-text); display: block; margin: 4px 0; }
.main { flex: 1; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 22px 32px 6px; }
.topbar h1 { font-size: 1.55rem; margin: 0; }
.topbar-actions { margin-left: auto; }
.menu-toggle { display: none; background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--text); }
.content { padding: 16px 32px 48px; }
.content.narrow { max-width: 1000px; margin: 0 auto; }

/* ---------- Cards, alerts ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; margin-bottom: 20px; }
.table-card { padding: 0; overflow-x: auto; }
.alert { margin: 12px 32px 0; padding: 12px 16px; border-radius: 10px; font-size: .93rem; }
.auth .alert, .engineer .alert { margin: 0 0 16px; }
.alert-success { background: var(--green-soft); color: #0f5f2d; }
.alert-error { background: var(--red-soft); color: #8f1a1a; }
.alert-info { background: var(--brand-soft); color: var(--brand-dark); }
.empty-state { text-align: center; padding: 48px 24px; }
.reveal { border: 2px solid var(--brand); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent;
  padding: 9px 16px; border-radius: 9px; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer;
  background: var(--grey-soft); color: var(--text); text-decoration: none; line-height: 1.2;
}
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); filter: none; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--text); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger-soft { background: var(--red-soft); color: var(--red); }
.btn-success-soft { background: var(--green-soft); color: var(--green); }
.btn-link { background: none; color: var(--muted); padding: 4px 6px; font-weight: 500; }
.btn-engine { background: var(--engine); color: var(--engine-ink, #fff); }
.btn-small { padding: 6px 11px; font-size: .82rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn.disabled, .btn:disabled { opacity: .45; pointer-events: none; }
button.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-align: left; }

/* ---------- Forms ---------- */
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .88rem; margin-bottom: 14px; }
.form label small { font-weight: 400; }
input[type=text], input[type=number], input[type=tel], input:not([type]), input[type=email], input[type=password], input[type=search], select, textarea {
  font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--text); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-actions { display: flex; gap: 10px; margin-bottom: 24px; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.inline-form input { flex: 1 1 200px; width: auto; }

/* ---------- Toolbar, chips, filters ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.toolbar .search input { width: 280px; }
.filters select { width: auto; min-width: 170px; }
.period { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font: inherit; font-size: .85rem; cursor: pointer; color: var(--text); }
.chip.active { background: var(--text); color: #fff; border-color: var(--text); }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 700; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .empty { text-align: center; color: var(--muted); padding: 36px; }
.table td .inline + .inline, .table td .btn + .inline, .table td .btn + .btn { margin-left: 4px; }
.link-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Pills & badges ---------- */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--grey-soft); color: var(--muted); }
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-red { background: var(--red-soft); color: var(--red); }
.pill-amber { background: var(--amber-soft); color: var(--amber); }
.pill-grey { background: var(--grey-soft); color: var(--muted); }
.status-won { background: var(--green-soft); color: var(--green); }
.status-lost { background: var(--red-soft); color: var(--red); }
.status-new { background: var(--brand-soft); color: var(--brand-dark); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.badges form { display: inline-flex; margin: 0; }
.badge { display: inline-block; border-radius: 7px; padding: 4px 9px; font-size: .75rem; font-weight: 700; border: 1.5px solid var(--engine); font-family: inherit; line-height: 1.2; }
.engine-badge.on { background: var(--engine); color: var(--engine-ink, #fff); cursor: pointer; }
.engine-badge.paused { background: #fff; color: var(--engine); border-style: dashed; cursor: pointer; }
.engine-badge.off { background: #fff; color: #b8bdc9; border-color: #dfe2ea; cursor: pointer; }
.engine-badge.coming { background: #fff; color: #cfd3dc; border-color: #eceef3; border-style: dotted; cursor: default; }
button.engine-badge:hover { filter: brightness(.95); }

/* ---------- Dashboard engine cards ---------- */
.engine-grid { display: grid; grid-template-columns: repeat(5, minmax(180px, 1fr)); gap: 18px; }
.engine-grid.small { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.engine-card { display: flex; flex-direction: column; gap: 12px; }
.engine-head { background: var(--engine); color: var(--engine-ink, #fff); font-weight: 700; text-align: center; padding: 16px 12px; border-radius: var(--radius); text-transform: uppercase; letter-spacing: .02em; font-size: .92rem; }
.engine-body { background: #fff; border: 1.5px solid var(--engine); border-radius: var(--radius); padding: 16px; flex: 1; }
.stats { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; margin: 0; font-size: .9rem; }
.stats dt { color: var(--text); }
.stats dd { margin: 0; font-weight: 700; text-align: right; }
.engine-foot { margin: 14px 0 0; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; }
.engine-card.coming-soon .engine-head, .engine-card.coming-soon .btn-engine { opacity: .45; }
.engine-card.coming-soon .engine-body { border-style: dashed; opacity: .7; }
.soon { display: grid; place-items: center; height: 100%; min-height: 150px; color: var(--muted); font-weight: 600; }
.linkbox { display: block; margin-top: 6px; }

/* ---------- Engine manage ---------- */
.engine-banner { display: flex; justify-content: space-between; align-items: center; background: var(--engine); color: var(--engine-ink, #fff); font-weight: 700; padding: 14px 20px; border-radius: var(--radius); margin-bottom: 14px; }
.engine-banner a { color: var(--engine-ink, #fff); font-weight: 500; }
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab { padding: 10px 16px; font-weight: 600; font-size: .9rem; color: var(--muted); border-bottom: 3px solid transparent; }
.tab.active { color: var(--text); border-color: var(--engine); }
.tab.disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Engineer edit ---------- */
.status-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.switch-list { display: flex; flex-direction: column; gap: 8px; }
.switch-row { display: flex !important; flex-direction: row !important; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; margin: 0 !important; cursor: pointer; }
.switch-row.disabled { opacity: .55; cursor: not-allowed; }
.switch-row .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--engine); flex: 0 0 12px; }
.switch-label { flex: 1; display: flex; gap: 8px; align-items: center; }
.switch { appearance: none; width: 42px; height: 24px; border-radius: 999px; background: #d4d8e2; position: relative; cursor: pointer; transition: background .15s; flex: 0 0 42px; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch:checked { background: var(--engine); }
.switch:checked::after { left: 21px; }
.switch:disabled { cursor: not-allowed; }
.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.logo-slot { border: 1px solid var(--line); border-top: 4px solid var(--engine); border-radius: 10px; padding: 14px; }
.logo-title { font-weight: 600; margin-bottom: 10px; }
.logo-preview { height: 90px; display: grid; place-items: center; background: var(--grey-soft); border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
.logo-preview img { max-height: 80px; max-width: 90%; }
.logo-form { display: flex; flex-direction: column; gap: 8px; }
.logo-form input[type=file] { font-size: .82rem; }
.danger-zone .danger-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Pager ---------- */
.pager { display: flex; gap: 6px; }
.pager a { padding: 6px 12px; border-radius: 8px; background: #fff; border: 1px solid var(--line); color: var(--text); }
.pager a.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- Auth ---------- */
body.auth { display: grid; place-items: center; min-height: 100vh; padding: 20px; background: linear-gradient(160deg, var(--brand-soft), var(--bg) 55%); }
.auth-wrap { width: 100%; max-width: 420px; }
.auth-brand { display: flex; align-items: center; gap: 10px; justify-content: center; font-weight: 700; font-size: 1.15rem; margin-bottom: 18px; }
.auth-card { padding: 28px; }

/* ---------- Engineer placeholder ---------- */
.eng-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 28px; background: var(--sidebar); color: #fff; }
.eng-top .brand { padding: 0; }
.eng-top-right { display: flex; gap: 16px; align-items: center; font-size: .9rem; }
.eng-top-right a, .eng-top-right .link { color: var(--sidebar-text); }
.engineer .content { padding-top: 28px; }

/* ---------- Public quote page ---------- */
body.public { background: #fff; }
body.public.embedded { background: transparent; }
html.wwq-autoheight { overflow-y: hidden; } /* parent page resizes the iframe (embed.js), see frame.js */
.quote-shell { max-width: 760px; margin: 0 auto; padding: 24px 18px 40px; }
.quote-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 3px solid var(--engine); margin-bottom: 28px; }
.quote-logo { max-height: 64px; max-width: 240px; }
.quote-company { font-size: 1.2rem; }
.quote-engine { color: var(--engine); font-weight: 700; }
.quote-body { text-align: center; padding: 24px 0; }
.quote-contact { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .engine-grid { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: -260px; z-index: 50; transition: left .2s; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  body.sidebar-open .sidebar { left: 0; }
  .menu-toggle { display: block; }
  .topbar, .content { padding-left: 18px; padding-right: 18px; }
  .alert { margin-left: 18px; margin-right: 18px; }
  .grid-2 { grid-template-columns: 1fr; }
  .engine-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .toolbar .search input { width: 100%; }
}
@media (max-width: 520px) {
  .engine-grid { grid-template-columns: 1fr; }
}
.table th.right { text-align: right; }

/* ---------- Landing page (quotes.wigwag.co.uk/) ---------- */
body.landing { background: linear-gradient(170deg, var(--brand-soft), var(--bg) 60%); min-height: 100vh; display: flex; flex-direction: column; }
body.landing main { flex: 1; }
.landing-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1500px; width: 100%; margin: 0 auto; padding: 20px 20px; }
.landing-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--text); }
.landing-brand:hover { text-decoration: none; }
.landing-hero { max-width: 1500px; margin: 0 auto; padding: 64px 20px 40px; text-align: center; }
.landing-hero h1 { font-size: clamp(1.8rem, 4.5vw, 2.9rem); letter-spacing: -.02em; margin-bottom: .45em; }
.landing-hero .lead { font-size: 1.12rem; color: var(--muted); max-width: 620px; margin: 0 auto 28px; }
.landing-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.btn-large { padding: 13px 26px; font-size: 1rem; }
.landing-engines { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 0; margin: 40px 0 0; }
.landing-engines li { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid var(--engine); border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: .9rem; }
.landing-engines .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--engine); }
.landing-engines li.is-soon { border-style: dashed; color: var(--muted); }
.landing-engines li small { font-weight: 500; font-size: .75rem; color: var(--muted); }
.landing-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; max-width: 1100px; margin: 0 auto; padding: 20px 20px 64px; }
.feature { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; }
.feature h3 { font-size: 1.05rem; }
.feature p { margin: 0; color: var(--muted); }
.landing-foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 20px; border-top: 1px solid var(--line); }
@media (max-width: 800px) {
  .landing-features { grid-template-columns: 1fr; }
  .landing-hero { padding-top: 36px; }
}

/* ---------- Stage 2: shared bits ---------- */
.note { background: var(--grey-soft); border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; font-size: .9rem; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; font-size: .85rem; }
.check input { width: auto; }
.form label .check { margin-top: 2px; }
.card h2 small { font-weight: 400; }
.nav-count { margin-left: auto; background: #fff; color: var(--brand-dark); border-radius: 999px; font-size: .72rem; font-weight: 700; padding: 1px 8px; }
.menu a.active .nav-count { background: rgba(255,255,255,.25); color: #fff; }
textarea { font: inherit; font-weight: 400; min-height: 120px; resize: vertical; }
.lead-text { max-width: 760px; margin: 0 0 18px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 20px 4px; }
.card-head h2 { margin: 0; }
.card.narrow-card { max-width: 680px; }

/* ---------- Support tickets ---------- */
.pill-new { background: #e6f0ff; color: #2b5fb0; margin-left: 6px; }
.ticket-open { background: var(--brand-soft); color: var(--brand-dark); }
.ticket-pending { background: var(--amber-soft); color: var(--amber); }
.ticket-closed { background: var(--grey-soft); color: var(--muted); }
.ticket-layout { display: grid; grid-template-columns: 1fr 280px; gap: 20px; align-items: start; }
.ticket-side h3 { margin-bottom: 12px; }
.side-list { margin: 0 0 16px; font-size: .9rem; }
.side-list dt { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; margin-top: 12px; }
.side-list dd { margin: 3px 0 0; word-break: break-word; }
.thread { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.msg { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.msg-staff { background: #f4f6ff; border-color: #d3dcff; }
.msg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.msg-date { margin-left: auto; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--grey-soft); display: inline-grid; place-items: center; font-weight: 700; font-size: .85rem; flex: 0 0 32px; }
.msg-staff .avatar { background: var(--brand); color: #fff; }
.msg-body { white-space: pre-wrap; line-height: 1.6; }
.msg-attachment { display: inline-flex; flex-direction: column; gap: 4px; margin-top: 12px; color: var(--muted); }
.msg-attachment img { max-width: 260px; max-height: 200px; border-radius: 8px; border: 1px solid var(--line); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.page-head h1 { margin: 0; }
.page-head-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.eng-nav { display: flex; gap: 4px; margin-right: auto; margin-left: 32px; }
.eng-nav a { color: var(--sidebar-text); padding: 7px 12px; border-radius: 8px; font-size: .92rem; }
.eng-nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.eng-nav a.active { background: var(--brand); color: #fff; }
@media (max-width: 900px) {
  .ticket-layout { grid-template-columns: 1fr; }
  .eng-top { flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
  .eng-nav { margin-left: 0; order: 3; width: 100%; }
}

/* ---------- Email templates ---------- */
.tpl-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 44%); gap: 20px; align-items: start; }
.tpl-preview { position: sticky; top: 16px; }
.tpl-preview iframe { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.tpl-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.tpl-block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tpl-block-head h2 { margin: 0; }
.editor-toolbar { display: flex; gap: 6px; }
.small-select { width: auto; padding: 6px 10px; font-size: .85rem; }
textarea.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.CodeMirror { border: 1px solid var(--line); border-radius: 9px; font-size: 13px; }
.shortcodes { margin-top: 10px; padding: 10px 12px; background: #fafbfc; border: 1px solid var(--line); border-radius: 9px; }
.shortcode-group { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin: 3px 0; }
.shortcode-title { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-right: 4px; min-width: 100%; }
.shortcode { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .75rem; background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 2px 7px; cursor: pointer; color: var(--text); }
.shortcode:hover { border-color: var(--brand); color: var(--brand-dark); }
.engine-tag { display: inline-block; background: var(--engine); color: var(--engine-ink, #fff); border-radius: 8px; padding: 9px 14px; font-weight: 700; font-size: .9rem; }
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { background: #fff; border-radius: 12px; width: 860px; max-width: 100%; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.modal-head, .modal-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-foot { border-bottom: 0; border-top: 1px solid var(--line); }
.modal-head h3 { margin: 0 8px 0 0; }
.modal-close { margin-left: auto; background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }
.modal-body { overflow-y: auto; padding: 16px 18px; flex: 1; }
.modal-hint { margin-left: auto; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.media-thumb { position: relative; border: 2px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; background: #f8f9fc; }
.media-thumb.selected, .media-thumb:hover { border-color: var(--brand); }
.media-thumb img { width: 100%; height: 100px; object-fit: contain; display: block; background: #fff; }
.media-name { font-size: .72rem; padding: 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.media-del { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; display: none; line-height: 22px; padding: 0; }
.media-thumb:hover .media-del { display: block; }
@media (max-width: 1200px) {
  .tpl-layout { grid-template-columns: 1fr; }
  .tpl-preview { position: static; }
}

/* ---------- Managing a heating engineer ---------- */
.menu-label { padding: 18px 22px 4px; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sidebar-text); opacity: .6; }
.menu-acting-name { padding: 0 22px 6px; color: #fff; font-weight: 600; font-size: .9rem; }
.acting-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 12px 32px 0; padding: 12px 16px; border-radius: 10px; background: var(--amber-soft); color: #7a3d06; font-size: .92rem; }
.acting-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.content.managing .page-head h1 { display: none; }
.content.managing .page-head { justify-content: flex-end; }
.status-bar-action { margin-left: auto; }
@media (max-width: 900px) { .acting-bar { margin-left: 18px; margin-right: 18px; } }
.eng-nav .nav-count { margin-left: 6px; }
.note-action { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--brand-soft); color: var(--brand-dark); }
/* ---------- Sidebar colours (v0.4.12): dark grey, WigWag pink for the page you're on ----------
   Used by the super admin sidebar and the heating engineer's own sidebar. */
:root {
  --sa-side: #cf0063;        /* WigWag pink (accents, badges) */
  --sa-side-hover: #cf5084;  /* rollover */
  --sa-side-active: #cf0063; /* page you are on */
  --sa-bg: #2b2f38;          /* sidebar background */
  --sa-managing-bg: #3a404c; /* "Managing heating engineer" panel, a little lighter */
}
.sidebar { background: var(--sa-bg); color: #fff; }
.sidebar .brand-mark { background: var(--sa-side); color: #fff; }
.sidebar .brand-text small { opacity: .75; }
.sidebar .menu a { color: #fff; }
.sidebar .menu a:hover { background: var(--sa-side-hover); color: #fff; }
.sidebar .menu a.active { background: var(--sa-side-active); color: #fff; }
.sidebar .nav-count { background: var(--sa-side); color: #fff; }
.sidebar .menu a.active .nav-count,
.sidebar .menu a:hover .nav-count { background: #fff; color: var(--sa-side); }
.sidebar .menu-label { color: #fff; opacity: .6; }
.sidebar .menu-acting-name { color: #fff; }
.sidebar-foot { border-top-color: rgba(255, 255, 255, .15); }
.sidebar-foot .me, .sidebar-foot .me small, .sidebar-foot a, .sidebar-foot .link { color: #fff; }
.sidebar-foot a:hover, .sidebar-foot .link:hover { color: #fff; text-decoration: underline; }

/* ---------- Logins: username, edit row, blocked (v0.2.3) ---------- */
.edit-row td { background: var(--grey-soft); }
.edit-row .inline-form { margin-top: 0; align-items: center; }
.edit-row .inline-form input { flex: 1 1 160px; }
.login-user { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88rem; }
.pill + .pill { margin-left: 4px; }
.trusted-ips { width: 100%; min-height: 110px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.login-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; min-width: 220px; }
.login-actions form { margin: 0; }

/* ---------- Managing a heating engineer: a lighter grey panel in the super admin sidebar (v0.4.12) ----------
   Only super admins ever see this section, so it marks where their own menu ends. */
.sidebar-managing { flex: 1 0 auto; background: var(--sa-managing-bg); margin: 14px 0 0; padding: 4px 0 10px; border-top: 3px solid var(--sa-side); }

/* Heating engineer's own admin (v0.4.12): same dark sidebar as super admin. Old top bar kept for reference. */
.eng-top { background: var(--sa-bg); }
.eng-top .brand-mark { background: var(--sa-side); color: #fff; }
.eng-nav a, .eng-top-right a, .eng-top-right .link { color: #fff; }
.eng-nav a:hover { background: var(--sa-side-hover); color: #fff; }
.eng-nav a.active { background: var(--sa-side-active); color: #fff; }
.eng-top .nav-count { background: #fff; color: var(--sa-side); }

/* ---------- Stage 3a: catalogues, brands, media library (v0.3.0) ---------- */
.spacer { flex: 1; }
.grid-3 { display: grid; grid-template-columns: 1fr 2fr auto; gap: 14px 20px; align-items: start; }
.label-like { font-weight: 600; font-size: .9rem; display: flex; flex-direction: column; gap: 6px; }
.plain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.table-title { padding: 18px 20px 0; margin: 0; }
.page-actions { display: flex; justify-content: flex-end; gap: 8px; margin: -6px 0 10px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip:hover { text-decoration: none; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } }

/* Sidebar: catalogues with a chip in the engine colour */
.sidebar .menu-catalogues a.menu-cat { position: relative; }
.cat-chip { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 7px; background: var(--engine); color: var(--engine-ink); display: inline-grid; place-items: center; margin-left: -3px; box-shadow: 0 0 0 1.5px rgba(255,255,255,.7); }
.sidebar .menu a .cat-chip svg { width: 15px; height: 15px; }
.sidebar .menu a.menu-cat.active { box-shadow: inset 4px 0 0 var(--engine); }
.sidebar .menu a.menu-cat.is-soon { opacity: .6; }
.sidebar .menu a.menu-cat .cat-soon { margin-left: auto; font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; border: 1px solid rgba(255,255,255,.6); border-radius: 999px; padding: 1px 7px; }

/* Engine checkboxes (catalogue tags) */
.engine-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.engine-check { border: 1.5px solid var(--engine); border-radius: 999px; padding: 5px 12px; font-weight: 600; cursor: pointer; background: #fff; }
.engine-check:has(input:checked) { background: var(--engine); color: var(--engine-ink); }
.engine-check input { accent-color: var(--engine); }

/* Catalogue page */
.catalogue-banner .soon-tag { background: rgba(255,255,255,.25); border-radius: 999px; padding: 3px 12px; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.catalogue.is-soon .engine-banner { opacity: .75; }
.catalogue-tabs .tab { text-decoration: none; color: var(--muted); }
.catalogue-tabs .tab.active { color: var(--text); }
.tab-count { display: inline-block; min-width: 20px; text-align: center; background: var(--grey-soft); border-radius: 999px; font-size: .72rem; padding: 1px 6px; margin-left: 4px; }
.soon-card { border: 1.5px dashed var(--engine); }
.catalogue-placeholder { border-top: 4px solid var(--engine); }
.catalogue-placeholder ul { margin-top: 10px; }
.brand-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.brand-tile { display: flex; flex-direction: column; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; color: var(--text); }
.brand-tile:hover { border-color: var(--engine); text-decoration: none; }
.brand-tile.is-hidden { opacity: .55; }
.brand-tile-logo { height: 48px; display: grid; place-items: center; }
.brand-tile-logo img { max-height: 48px; max-width: 150px; }
.brand-logo-cell img { max-height: 36px; max-width: 130px; display: block; }

/* Media library */
.dropzone { position: relative; border: 2px dashed var(--line); border-radius: var(--radius); padding: 26px; text-align: center; background: #fafbfd; margin-bottom: 16px; transition: border-color .15s, background .15s; }
.dropzone.over, .dropzone.has-files { border-color: var(--sa-side, var(--brand)); background: #fff5fa; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.dropzone-text { display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.dropzone-files { color: var(--text); font-weight: 600; }
.upload-go { justify-content: flex-end; height: 100%; padding-top: 22px; }
.media-library { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.media-library.is-icons { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.media-card { display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px; color: var(--text); min-width: 0; }
.media-card:hover { border-color: var(--sa-side, var(--brand)); text-decoration: none; box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.media-card-img { aspect-ratio: 4 / 3; background: #f4f5f8 linear-gradient(45deg, #eceef3 25%, transparent 25%, transparent 75%, #eceef3 75%) 0 0 / 14px 14px; border-radius: 6px; display: grid; place-items: center; overflow: hidden; }
.media-library.is-icons .media-card-img { aspect-ratio: 1; }
.media-card-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.media-library.is-icons .media-card-img img { width: 56px; height: 56px; }
.media-card-title { font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-card-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-card-tags { display: flex; flex-wrap: wrap; gap: 4px; min-height: 22px; }
.media-card-tags .badge, .media-card-tags .pill { font-size: .66rem; padding: 2px 6px; }
.media-edit { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.media-preview > img { width: 100%; max-height: 520px; object-fit: contain; background: #f4f5f8 linear-gradient(45deg, #eceef3 25%, transparent 25%, transparent 75%, #eceef3 75%) 0 0 / 16px 16px; border-radius: 8px; margin-bottom: 14px; }
.media-preview.is-icon > img { max-height: 200px; padding: 30px; }
@media (max-width: 1000px) { .media-edit { grid-template-columns: 1fr; } }
.category-row { display: grid; grid-template-columns: minmax(160px, 2fr) 90px 110px 60px auto; gap: 10px; align-items: center; }
.category-row.add-row { padding: 14px 20px 18px; border-top: 1px solid var(--line); }
.category-row .row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.category-row input.narrow { width: 100%; }
@media (max-width: 700px) { .category-row { grid-template-columns: 1fr 1fr; } }

/* Picker field + pop-up */
.media-field { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.media-field-preview { width: 200px; height: 110px; border: 1px dashed var(--line); border-radius: 10px; display: grid; place-items: center; background: #fafbfd; overflow: hidden; }
.media-field-preview.is-icon { width: 90px; height: 90px; }
.media-field-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.media-field-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.media-picker-box { width: 960px; }
.media-picker-filters { display: flex; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.media-picker-filters select, .media-picker-filters input { width: auto; flex: 1 1 160px; }
.media-thumb.is-icon img { height: 70px; padding: 10px; }
.media-warn { position: absolute; top: 5px; left: 5px; width: 20px; height: 20px; border-radius: 50%; background: var(--amber); color: #fff; font-weight: 800; font-size: .75rem; display: grid; place-items: center; }
.media-upload-btn { margin: 0; }

/* v0.3.0 layout fixes */
.form label.engine-check, .engine-check { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; margin: 0; font-size: .85rem; }
.engine-check input[type=checkbox] { width: auto; margin: 0; }
.filters input[type=search] { width: auto; flex: 1 1 220px; }
.media-thumb img, .media-field-preview img { background: #f4f5f8 linear-gradient(45deg, #eceef3 25%, transparent 25%, transparent 75%, #eceef3 75%) 0 0 / 12px 12px; }
.form .label-like { margin-bottom: 14px; }

/* ===== Air con engineer pages (v0.4.0) ===== */
.ac-cats{display:flex;flex-direction:column;gap:8px;margin:10px 0 6px}
.ac-cat-group{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.ac-cat-group > .muted{min-width:90px}
.chip.on{background:#0e7c7b;color:#fff;border-color:#0e7c7b}
.chip.on .tab-count{background:rgba(255,255,255,.25);color:#fff}
.ac-scroll{overflow-x:auto}
.ac-table input.price{width:96px;text-align:right}
.ac-table input.years{width:72px}
.ac-table tr.is-off td{opacity:.55}
.ac-table tr.is-off td:first-child{opacity:1}
.ac-range-row td{background:#f4f6fa;font-weight:700;font-size:13px;color:#4a5263}
.ac-thumb{width:56px;height:42px;object-fit:contain;border:1px solid #e5e7ef;border-radius:6px;background:#fff}
.colour-pair{display:flex;gap:6px;align-items:center}
.colour-pair input[type=color]{width:44px;height:38px;padding:2px;flex:none}
.kv{display:grid;grid-template-columns:max-content 1fr;gap:6px 14px;margin:0}
.kv dt{color:#6b7280}.kv dd{margin:0}
.content.narrow:has(.ac-table){max-width:1200px}
.media-gallery{display:flex;flex-direction:column;gap:10px}
.mg-items{display:flex;flex-wrap:wrap;gap:10px}
.mg-item{position:relative;width:132px;border:1px solid #e5e7ef;border-radius:8px;background:#fff;padding:4px}
.mg-item:first-child{border-color:#0e7c7b;box-shadow:0 0 0 2px rgba(14,124,123,.18)}
.mg-item img{display:block;width:100%;height:96px;object-fit:contain}
.mg-tools{display:flex;justify-content:space-between;margin-top:4px}
.mg-tools button{border:1px solid #e5e7ef;background:#f7f8fb;border-radius:6px;width:34px;height:26px;cursor:pointer;font-size:16px;line-height:1}
.mg-adder{display:flex;align-items:center;gap:10px}
.feature-rows{display:grid;gap:8px}
.feature-row{display:grid;grid-template-columns:220px 1fr;gap:8px}
@media(max-width:700px){.feature-row{grid-template-columns:1fr}}
.ac-range-head{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.ac-range-head .btn{margin-left:auto}
.ac-table td:nth-child(2){min-width:230px}
.form label.check{flex-direction:row;align-items:center;gap:8px;margin-bottom:6px;font-weight:400}
.form .label-like label.check .muted{margin-left:4px}
.grid-3.ac-even{grid-template-columns:repeat(3,minmax(0,1fr))}
@media (max-width: 900px) { .grid-3.ac-even { grid-template-columns: 1fr; } }
tr.row-link{cursor:pointer}
tr.row-link:hover td{background:#f8f9fc}
.status-select{min-width:130px;font-weight:600}
/* Engineer dashboard (v0.4.9) */
.dash-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin:6px 0 22px}
.dash-stat{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:16px 18px;display:flex;flex-direction:column;gap:2px}
.dash-stat .n{font-size:1.7rem;font-weight:800;line-height:1.1}
.dash-stat .k{color:#6b7280;font-size:.85rem;font-weight:600}
.dash-stat.is-hot{border-color:#cf0063;box-shadow:0 0 0 2px rgba(207,0,99,.12)}
.dash-stat.is-hot .n{color:#cf0063}
.dash-h{font-size:1.05rem;margin:8px 0 10px}
.dash-engines{grid-template-columns:repeat(auto-fill,minmax(320px,1fr))}
.dash-counts{margin:0 0 10px}
.dash-new{color:#cf0063}
.dash-actions{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:14px}
.link-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.dash-engines + .dash-h, .dash-engines ~ .dash-h{margin-top:24px}
.dash-engines{grid-template-columns:repeat(auto-fill,minmax(280px,1fr))}
.dash-link{margin-top:12px}
.dash-latest{margin-top:26px}
dd.dash-new{color:#cf0063}

/* v0.4.11 air con quote pictures */
.pic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.pic-tile { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: #fff; }
.pic-tile-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pic-tile .media-field { flex-direction: column; align-items: stretch; }
.pic-tile .media-field-preview { width: 100%; height: 120px; }
.pic-default { display: flex; align-items: center; gap: 8px; }
.pic-default img { width: 48px; height: 36px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.catalogue-brand-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }

/* v0.4.19 sidebar sections that fold away (Catalogues, Settings) */
.menu-section-toggle { display: flex; align-items: center; gap: 6px; width: 100%; background: none; border: 0; cursor: pointer; text-align: left; font: inherit; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.sidebar .menu-section-toggle { color: #fff; opacity: .6; }
.sidebar .menu-section-toggle:hover, .sidebar .menu-section-toggle:focus-visible { opacity: 1; }
.menu-chev { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; flex: 0 0 12px; }
.menu-section.is-open .menu-chev { transform: rotate(90deg); }
.menu-section-body { display: none; }
.menu-section.is-open .menu-section-body { display: block; }

/* v0.4.19 Manage Tiers */
.tiers-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.tiers-head h2 { margin: 0; }
.tier-list { display: flex; flex-direction: column; }
.tier-row { display: grid; grid-template-columns: 150px 180px 1fr 80px; grid-template-areas: 'icon label desc order' 'icon meta actions actions'; gap: 10px 16px; align-items: center; padding: 16px 0; border-top: 1px solid var(--line); margin: 0; }
.tier-row-icon { grid-area: icon; } .tier-row-label { grid-area: label; } .tier-row-desc { grid-area: desc; } .tier-row-order { grid-area: order; }
.tier-row-meta { grid-area: meta; } .tier-row-actions { grid-area: actions; align-items: center; } .tier-row-actions .tier-row-on { margin-right: 10px; }
.tier-row label { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; font-weight: 600; color: var(--muted); margin: 0; }
.tier-row label.check { flex-direction: row; align-items: center; color: var(--text); font-size: .9rem; }
.tier-row input[type="text"], .tier-row input:not([type]), .tier-row input[type="number"] { width: 100%; }
.tier-row.is-off { opacity: .6; }
.tier-row-icon .media-field { flex-direction: row; flex-wrap: nowrap; gap: 8px; align-items: center; }
.tier-row-icon .media-field-preview.is-icon { width: 48px; height: 48px; flex: 0 0 48px; }
.tier-row-icon .media-field-actions { flex-direction: column; align-items: flex-start; gap: 4px; }
.tier-row-icon [data-media-title] { display: none; }
.tier-row-actions { display: flex; gap: 8px; justify-content: flex-end; }
@media (max-width: 760px) { .tier-row { grid-template-columns: 1fr 1fr; grid-template-areas: 'icon icon' 'label order' 'desc desc' 'meta meta' 'actions actions'; } }
[data-media-clear][hidden] { display: none !important; }

/* v0.4.19 save bar: appears when a long form has unsaved changes */
.save-bar { position: fixed; left: 250px; right: 0; bottom: 0; z-index: 40; display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 12px 28px; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(20, 24, 33, .12); transform: translateY(110%); transition: transform .2s ease; }
.save-bar.is-shown { transform: translateY(0); }
.save-bar-text { margin-right: auto; font-weight: 600; }
body:not(.admin) .save-bar { left: 0; }
body.has-save-bar .content { padding-bottom: 96px; }
@media (max-width: 900px) { .save-bar { left: 0; padding: 10px 16px; } }

/* v0.4.20: clicking the preview opens the picker; softer focus ring on sidebar section headings */
.media-field-preview[data-media-choose] { cursor: pointer; }
.media-field-preview[data-media-choose]:hover { border-color: var(--sa-side, var(--brand)); }
.menu-section-toggle:focus { outline: none; }
.menu-section-toggle:focus-visible { outline: 2px solid var(--sa-side-hover); outline-offset: 2px; border-radius: 6px; }

/* Warnings: unpriced models, go-live checklist */
.note-warn { background: var(--amber-soft); color: #7a3d06; }
.note-warn a { color: inherit; text-decoration: underline; }
.dot-warn { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); margin-left: 2px; vertical-align: middle; }
.ac-table input.years::placeholder { font-style: italic; color: #a0a6b0; }
.golive { margin: 0 0 22px; }
.golive h2 { margin: 0 0 4px; font-size: 1.05rem; }
.golive ul { list-style: none; margin: 10px 0 0; padding: 0; }
.golive li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line, #eceef2); }
.golive li:first-child { border-top: 0; }
.golive .tick { flex: 0 0 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; background: var(--amber-soft); color: var(--amber); }
.golive li.done .tick { background: var(--green-soft); color: var(--green); }
.golive li.done .lbl { color: var(--muted); }
.golive .hint { display: block; font-size: .85rem; color: var(--muted); }

/* v0.4.23: AC models & prices: own list, Add models page */
.link-remove { background: none; border: 0; padding: 4px 0; font: inherit; font-size: .85rem; color: var(--muted); cursor: pointer; text-decoration: underline; }
.link-remove:hover { color: var(--red); }
.add-tools { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin: 6px 0 14px; }
.add-brands { display: flex; flex-wrap: wrap; gap: 6px; }
button.chip { font: inherit; cursor: pointer; }
.add-search { max-width: 280px; }
.add-brand { padding: 6px 18px; margin-bottom: 14px; }
.add-range { padding: 12px 0; border-top: 1px solid var(--line); }
.add-range:first-child { border-top: 0; }
.add-range-head { display: flex; gap: 10px; align-items: center; cursor: pointer; margin-bottom: 8px; }
.add-models { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 14px; padding-left: 26px; }
.add-model { display: flex; gap: 10px; align-items: flex-start; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.add-model:hover { background: var(--grey-soft); }
.add-model input, .add-range-head input { margin-top: 3px; flex: 0 0 auto; }
.add-model .add-name { display: block; font-weight: 600; }
.add-bar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 12px 16px; margin-top: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 -4px 16px rgba(20, 24, 40, .06); }
.add-bar .btn[disabled] { opacity: .5; cursor: not-allowed; }
@media (max-width: 640px) { .add-search { max-width: none; width: 100%; } .add-models { padding-left: 0; } }
.form label.add-model, .form label.add-range-head { flex-direction: row; gap: 10px; margin-bottom: 0; font-weight: 400; font-size: .92rem; }
.form label.add-range-head { margin-bottom: 8px; align-items: center; }
.form label.add-model .small { font-weight: 400; }
.ac-table td[data-total] .pill { white-space: nowrap; }
/* v0.4.24: "All domestic / All commercial" views */
.chip.chip-all { border-style: dashed; }
.chip.chip-all.on { border-style: solid; }
.ac-table tr.ac-cat-row td { background: #2b2f38; color: #fff; font-weight: 700; font-size: .95rem; padding: 10px 16px; }
.ac-table tr.ac-cat-row td .small { font-weight: 400; color: rgba(255, 255, 255, .7); margin-left: 8px; }
/* v0.4.29: template editor "Use this template for" */
.form label.tpl-assign { margin: 14px 0 0; max-width: 440px; }

/* Maintenance mode page */
.maint-quote { margin: 12px 0 16px; padding: 14px 16px; border-left: 4px solid var(--brand); background: var(--brand-soft); border-radius: 8px; }

/* Boiler sizing rules + test a home */
.sizing-test-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 16px; }
.sizing-result { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.sizing-checks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.sizing-check { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.sizing-check.is-result { background: var(--grey-soft); border-color: transparent; }
.sizing-check .pill { font-size: .9rem; }
.sizing-reason { font-weight: 600; margin: 14px 0 4px; }
.sizing-matches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 12px; }
.sizing-matches h3 { font-size: .95rem; margin: 8px 0; }
.sizing-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sizing-list li { display: flex; flex-direction: column; }
.sizing-more { margin-top: 6px; }
.sizing-more summary { cursor: pointer; color: var(--muted, #6b7280); font-size: .875em; }
.sizing-more summary:hover { text-decoration: underline; }
.sizing-more[open] summary { margin-bottom: 6px; }
.table-compact td, .table-compact th { padding: 6px 10px; }
.table-compact input, .table-compact select { width: 100%; min-width: 64px; margin: 0; }
@media (max-width: 900px) {
  .sizing-test-grid, .sizing-checks { grid-template-columns: 1fr 1fr; }
  .sizing-matches { grid-template-columns: 1fr; }
}

.media-fit-row{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:0 0 12px}
.media-fit h2{margin-bottom:6px}
.link-details { font-size: .85rem; margin-right: 10px; white-space: nowrap; }

/* v0.7.0: models & prices notice (every engine) and discontinued models */
.catalogue-notice { border: 2px solid #cf0063; background: #fdeaf3; color: #5c0a2e; border-radius: 10px; padding: 14px 16px; margin: 0 0 16px; font-size: .92rem; }
.catalogue-notice h2 { color: #cf0063; font-size: 1.05rem; margin: 0 0 6px; }
.catalogue-notice p { margin: 0 0 6px; }
.catalogue-notice-form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.catalogue-notice-form .check { font-weight: 600; }
.catalogue-notice-form .btn { background: #cf0063; border-color: #cf0063; color: #fff; }
.catalogue-notice-slim { border-width: 0 0 0 4px; padding: 8px 12px; }
.catalogue-notice-slim summary { cursor: pointer; color: #cf0063; }
.catalogue-notice-slim summary .small { color: #5c0a2e; font-weight: 400; }
.catalogue-notice-slim[open] summary { margin-bottom: 6px; }
.discontinued-line { margin-top: 4px; }
.discontinued-line .link-details { margin-left: 6px; }
.notice-acks { margin: 0 0 8px; padding-left: 18px; }
button.link-details { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; font: inherit; font-size: .85rem; text-decoration: underline; }

/* v0.9.1: heating engineer menu grouped by quote engine, headings in the engine's colour (as the dashboard cards). */
.menu-engine { margin: 8px 0 2px; }
.menu .menu-engine-toggle, .sidebar .menu .menu-engine-toggle {
  display: flex; align-items: center; gap: 8px; width: calc(100% - 20px); margin: 0 10px; padding: 9px 12px;
  background: var(--engine); color: var(--engine-ink); opacity: .82; border-radius: 9px;
  font-size: .78rem; letter-spacing: .06em;
}
.menu .menu-engine-toggle:hover, .menu .menu-engine.is-open .menu-engine-toggle { opacity: 1; }
.menu-engine .menu-chev { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.5; transition: transform .15s; flex: 0 0 14px; }
.menu-engine .menu-section-body { padding: 4px 0 2px 10px; }
.menu-engine .menu-section-body a { box-shadow: inset 2px 0 0 color-mix(in srgb, var(--engine) 55%, transparent); }
.sidebar .menu .menu-engine .menu-section-body a.active { background: var(--engine); color: var(--engine-ink); }
/* v0.9.2: no focus ring on the engine headings after a mouse click; a white one for keyboard users. */
.menu .menu-engine-toggle:focus { outline: none; box-shadow: none; }
.menu .menu-engine-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* v0.11.4: finance rows with a deposit box (name wider, three number boxes) */
.grid-3.fin-row{grid-template-columns:minmax(0,2fr) repeat(3,minmax(0,1fr))}
.fin-deposit{display:flex;gap:6px}.fin-deposit input{flex:1 1 auto;min-width:0}.fin-deposit select{flex:0 0 auto;width:auto}
@media (max-width: 900px) { .grid-3.fin-row { grid-template-columns: 1fr 1fr; } .grid-3.fin-row > label:first-child { grid-column: 1 / -1; } }

/* v0.12.0: colour label on models that come in several colours */
.colour-pill{display:inline-flex;align-items:center;gap:5px;background:#f1f3f7;color:#3a4352;font-weight:500}
.colour-pill .cp-dot{width:11px;height:11px;border-radius:50%;border:1px solid rgba(0,0,0,.3);display:inline-block}

/* v0.12.1: which property types use the business VAT */
.vat-props{display:flex;flex-wrap:wrap;align-items:center;gap:6px 18px;margin:4px 0 16px}
.vat-props p{flex-basis:100%;margin:0}

/* v0.12.8: Super admin > Trials */
.pill-teal { background: #e3f4f3; color: #0e7c7b; }
.trial-chips { margin: 0 0 0 auto; }
.trial-help { margin: -6px 0 14px; }
.trials-scroll { overflow-x: auto; }
.trials-table td { padding: 10px 10px; vertical-align: top; font-size: .9rem; }
.trials-table td .pill { white-space: nowrap; }
.trials-table select, .trials-table input[type=date], .trials-table textarea { font-size: .85rem; padding: 6px 8px; }
.trials-table select.trial-days { width: auto; min-width: 0; }
.trials-table input[type=date] { width: 140px; border: 1px solid var(--line); border-radius: 8px; font-family: inherit; }
.trials-table .trial-paid { display: flex; align-items: center; gap: 6px; font-weight: 600; margin-bottom: 6px; }
.trials-table th { white-space: nowrap; }
.trials-table input[type=date] { width: 132px; }
.trials-table textarea.trial-notes { width: 100%; min-width: 210px; min-height: 0; height: auto; resize: vertical; }
.trials-table tr.is-ended td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.trials-table tr.is-soon td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.trials-table .btn.is-dirty { box-shadow: 0 0 0 3px var(--brand-soft); }
.trial-remind .btn { white-space: nowrap; }
.trial-remind { display: flex; align-items: center; gap: 12px; justify-content: space-between; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; }

/* ---------- Help Centre (v0.12.13) ---------- */
.help-engines { margin: 12px 0 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.chip-off { opacity: .5; cursor: default; }
.chip-off small { font-size: .65rem; letter-spacing: .04em; margin-left: 4px; }
.help-tabs { align-items: center; }
.help-tabs .tabs-right { margin-left: auto; display: flex; gap: 8px; padding-bottom: 6px; }
.help-table td.nowrap { white-space: nowrap; }
.help-table .danger { color: var(--red); }
.help-form label { display: block; margin-bottom: 14px; }
.help-form label.no-gap { margin-bottom: 6px; font-weight: 600; }
.help-editor { border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-bottom: 8px; }
.help-editor.is-busy { opacity: .6; pointer-events: none; }
.help-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); background: #fafafa; border-radius: 10px 10px 0 0; position: sticky; top: 0; z-index: 2; }
.help-toolbar button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 4px 9px; font: inherit; font-size: .82rem; cursor: pointer; }
.help-toolbar button:hover { background: var(--grey-soft); }
.help-toolbar .sep { width: 1px; background: var(--line); margin: 0 4px; }
.help-area { min-height: 320px; padding: 14px 18px; outline: none; }
.help-editor + .muted, .help-editor .muted { padding: 0 12px 8px; }
.prose h2 { font-size: 1.15rem; margin: 18px 0 8px; }
.prose h3 { font-size: 1rem; margin: 16px 0 6px; }
.prose p, .prose ul, .prose ol { margin: 0 0 10px; line-height: 1.55; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 4px; }
.prose img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; margin: 6px 0; }
.prose blockquote { margin: 10px 0; padding: 10px 14px; background: var(--brand-soft); border-left: 4px solid var(--brand); border-radius: 6px; }
.prose a { text-decoration: underline; }
.help-preview { margin: 0 0 14px; }
.help-search { margin-bottom: 16px; max-width: 560px; }
.help-search input { width: 100%; padding: 11px 14px; font-size: 1rem; }
.help-layout { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
.help-toc { position: sticky; top: 16px; font-size: .9rem; }
.help-toc ol { margin: 8px 0 0; padding-left: 20px; }
.help-toc li { margin-bottom: 6px; }
.help-section h2, .help-faqs h2 { margin-top: 0; }
.help-section { scroll-margin-top: 16px; }
.help-section:target { box-shadow: 0 0 0 2px var(--brand); }
.help-faq { border-top: 1px solid var(--line); padding: 10px 0; }
.help-faq summary { cursor: pointer; font-weight: 600; }
.help-faq .prose { padding-top: 8px; }
.help-link span { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--text); color: #fff; font-size: .72rem; margin-right: 3px; }
@media (max-width: 900px) { .help-layout { grid-template-columns: 1fr; } .help-toc { position: static; } }
/* Help Centre in each engine's colour (v0.12.14) */
.help-themed .chip.active { background: var(--engine); border-color: var(--engine); color: var(--engine-ink, #fff); }
.help-themed .help-table td a b, .help-themed .help-section h2, .help-themed .help-faqs h2, .help-themed .help-toc b { color: var(--engine); }
.help-themed .help-tabs .tab { font-size: .95rem; }
.help-themed .help-tabs .tab-count { background: var(--engine); color: var(--engine-ink, #fff); }
.help-themed .prose blockquote { background: color-mix(in srgb, var(--engine) 10%, #fff); border-left-color: var(--engine); }
.help-themed .help-toc { border-top: 4px solid var(--engine); }
.help-themed .help-faq summary::marker { color: var(--engine); }
.help-themed .help-section:target { box-shadow: 0 0 0 2px var(--engine); }
.help-themed .help-toc a, .help-themed .prose a { color: var(--engine); }
.help-form.help-themed { border-top: 4px solid var(--engine); }
