/* Amax Support – light & dark themes. Brand colours come from Admin → Branding (--brand, --brand-accent). */
:root {
  --brand: #003e79; --brand-accent: #2f86d6;
  --bg: #f3f5f9; --surface: #ffffff; --surface-2: #f7f9fc; --line: #dde3ec; --text: #17202e; --muted: #5d6b80;
  --primary: var(--brand); --primary-text: #ffffff; --link: var(--brand);
  --top-bg: var(--brand); --top-text: #ffffff;
  --ok: #157a4a; --ok-bg: #e3f5ec; --warn: #9a5b00; --warn-bg: #fff3dc; --bad: #b42318; --bad-bg: #fde8e7;
  --info-bg: #e7f0fb; --info: #0f4c8a; --internal-bg: #fff8e0;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d131c; --surface: #151d29; --surface-2: #1b2534; --line: #2a3547; --text: #e6ebf2; --muted: #93a1b5;
    --primary: color-mix(in srgb, var(--brand) 45%, #6aa8ff); --primary-text: #07111f; --link: color-mix(in srgb, var(--brand) 30%, #8cc0ff);
    --top-bg: color-mix(in srgb, var(--brand) 55%, #0d131c); --top-text: #ffffff;
    --ok: #4cc38a; --ok-bg: #12301f; --warn: #f0b44c; --warn-bg: #33270f; --bad: #ff7b72; --bad-bg: #3a1717;
    --info-bg: #142740; --info: #8cc0ff; --internal-bg: #2e2812;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d131c; --surface: #151d29; --surface-2: #1b2534; --line: #2a3547; --text: #e6ebf2; --muted: #93a1b5;
  --primary: color-mix(in srgb, var(--brand) 45%, #6aa8ff); --primary-text: #07111f; --link: color-mix(in srgb, var(--brand) 30%, #8cc0ff);
  --top-bg: color-mix(in srgb, var(--brand) 55%, #0d131c); --top-text: #ffffff;
  --ok: #4cc38a; --ok-bg: #12301f; --warn: #f0b44c; --warn-bg: #33270f; --bad: #ff7b72; --bad-bg: #3a1717;
  --info-bg: #142740; --info: #8cc0ff; --internal-bg: #2e2812;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; -webkit-text-size-adjust: 100%; }
a { color: var(--link); }
h1 { font-size: 1.5rem; margin: .2rem 0 .6rem; line-height: 1.25; }
h2 { font-size: 1.1rem; margin: 0 0 .7rem; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
code { font-family: Consolas, ui-monospace, monospace; font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; word-break: break-all; }
pre { white-space: pre-wrap; word-break: break-word; }
.muted { color: var(--muted); } .small { font-size: .86rem; } .center { text-align: center; }
.ok-text { color: var(--ok); } .bad-text { color: var(--bad); }
[hidden] { display: none !important; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .5rem 1rem; padding-top: max(.5rem, env(safe-area-inset-top));
  background: var(--top-bg); color: var(--top-text); box-shadow: 0 1px 0 rgba(0,0,0,.15); }
.brand { display: flex; align-items: center; gap: .6rem; color: inherit; text-decoration: none; font-weight: 600; white-space: nowrap; }
.brand img { height: 38px; width: auto; display: block; }
.mainnav { display: flex; gap: .2rem; flex: 1; overflow-x: auto; }
.mainnav a { color: inherit; text-decoration: none; opacity: .85; padding: .45rem .75rem; border-radius: 8px; white-space: nowrap; }
.mainnav a:hover { opacity: 1; background: rgba(255,255,255,.1); }
.mainnav a[aria-current] { opacity: 1; background: rgba(255,255,255,.18); }
.tools { display: flex; align-items: center; gap: .4rem; margin-left: auto; }
.iconbtn { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; color: inherit; cursor: pointer; }
.iconbtn:hover { background: rgba(127,127,127,.18); }
.iconbtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.iconbtn.sm { width: 28px; height: 28px; font-size: .75rem; color: var(--muted); }
.iconbtn.danger:hover { color: var(--bad); }
/* theme icon: sun in dark mode (click → light), moon in light mode */
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; } :root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .i-sun { display: block; } :root:not([data-theme]) .i-moon { display: none; } }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.2); color: inherit; text-decoration: none; font-weight: 700; }
.badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e5484d; color: #fff; font-size: 11px; line-height: 18px; font-weight: 700; }
.bell-wrap { position: relative; }
.bell-panel { position: absolute; right: 0; top: 46px; width: min(380px, 92vw); max-height: 70vh; overflow: auto; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0,0,0,.2); }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: .7rem .9rem; border-bottom: 1px solid var(--line); }
.bell-panel ul { list-style: none; margin: 0; padding: 0; }
.bell-panel li a { display: block; padding: .6rem .9rem; color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.bell-panel li a:hover { background: var(--surface-2); }
.bell-panel li.unread a { border-left: 3px solid var(--primary); }
.bell-panel li .muted { display: block; font-size: .82rem; }
.bell-panel li.muted { padding: .9rem; }

/* Layout */
.wrap { max-width: 1240px; margin: 0 auto; padding: 1rem; padding-bottom: 6rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-bottom: .6rem; }
.page-head h1, .page-head h2 { margin: 0; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: .2rem; }
.crumbs a { color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.card.flush { padding: 0; overflow: hidden; } .pad { padding: 1rem 1.1rem 0; }
details.card > summary { cursor: pointer; }
details.card[open] > summary { margin-bottom: .8rem; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.grid2 > .card, .grid2 > div > .card { margin-bottom: 1rem; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 1rem 1rem 5.5rem; }
.empty { color: var(--muted); padding: 1rem; margin: 0; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.9rem; line-height: 1.1; color: var(--primary); }
.stat span { color: var(--muted); font-size: .88rem; }
.stat-warn b { color: var(--warn); } .stat-bad b { color: var(--bad); }

/* Ticket list */
.tlist { list-style: none; margin: 0; padding: 0; }
.trow a { display: block; padding: .75rem 1rem; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; border-left: 4px solid transparent; }
.trow a:hover { background: var(--surface-2); }
.trow.prio-critical a { border-left-color: var(--bad); } .trow.prio-high a { border-left-color: var(--warn); }
.trow-main { display: flex; gap: .6rem; align-items: baseline; }
.ref { font-family: Consolas, monospace; font-size: .82rem; color: var(--muted); white-space: nowrap; }
.ttl { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }  /* a long unbroken title (a path, a fault code) must not widen the page on a phone */
.trow-meta { display: flex; flex-wrap: wrap; gap: .3rem .8rem; align-items: center; font-size: .84rem; margin-top: .3rem; }
.card .tlist .trow:last-child a { border-bottom: 0; }

.pill { display: inline-block; padding: .08rem .55rem; border-radius: 999px; font-size: .76rem; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.pill.ok, .st-resolved, .st-closed { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.st-open { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.st-accepted, .st-in_progress { background: var(--info-bg); color: var(--info); border-color: transparent; }
.st-awaiting_customer, .st-on_hold { background: var(--surface-2); }
.pr-critical, .sev-critical { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.pr-high, .sev-warning { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.pr-low, .sev-info { color: var(--muted); }
.src-agent { background: var(--info-bg); color: var(--info); border-color: transparent; }
.pill-internal { background: var(--internal-bg); color: var(--warn); border-color: transparent; }

/* Tabs & filters */
.tabs { display: flex; gap: .3rem; overflow-x: auto; margin-bottom: .8rem; border-bottom: 1px solid var(--line); }
.tabs a { padding: .5rem .8rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a[aria-current] { color: var(--text); border-bottom-color: var(--primary); font-weight: 600; }
.filters { display: flex; gap: .5rem; margin-bottom: .8rem; flex-wrap: wrap; }
.filters input[type=search] { flex: 1; min-width: 200px; }

/* Forms */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .75rem; }
.label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
input, select, textarea { display: block; width: 100%; margin-top: .3rem; padding: .6rem .7rem; font: inherit; font-weight: 400; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--primary) 40%, transparent); border-color: var(--primary); }
input[type=checkbox], input[type=radio] { display: inline-block; width: 18px; height: 18px; margin: 0 .45rem 0 0; vertical-align: -3px; accent-color: var(--primary); }
input[type=color] { height: 42px; padding: 3px; }
input:disabled { opacity: .6; }
label.check { font-weight: 400; display: flex; align-items: flex-start; gap: .1rem; }
label.check input { flex: none; margin-top: 2px; }
.sub { margin-left: 1.6rem; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem .2rem; margin: 0 0 1rem; }
legend { font-weight: 700; padding: 0 .3rem; }
.req { color: var(--bad); }
.help { margin: -.5rem 0 .8rem; color: var(--muted); font-size: .84rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1rem; align-items: end; }
.narrow { max-width: 110px; }
.stack > * { margin-bottom: .7rem; }
form.inline { display: inline-flex; gap: .4rem; align-items: center; margin: 0 .4rem .5rem 0; }
form.inline select { margin: 0; width: auto; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 1rem; margin-top: .6rem; }
.form-type { margin-bottom: 1rem; padding-bottom: .8rem; border-bottom: 1px solid var(--line); }
.form-type p { margin: .2rem 0 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem 1rem; border-radius: 9px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 88%, #000); }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn-accept { background: var(--ok); border: 0; color: #fff; font-size: 1.05rem; padding: .75rem 1.3rem; box-shadow: var(--shadow); }
.btn-block { width: 100%; }
.btn.sm { padding: .25rem .6rem; font-size: .82rem; }
.btnrow { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .6rem; }
.linkbtn { background: none; border: 0; color: var(--link); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }

.flash { padding: .7rem .9rem; border-radius: 10px; margin-bottom: .8rem; background: var(--info-bg); color: var(--info); }
.flash-ok { background: var(--ok-bg); color: var(--ok); } .flash-err { background: var(--bad-bg); color: var(--bad); } .flash-warn { background: var(--warn-bg); color: var(--warn); }
.flash ul { margin: .3rem 0 0; padding-left: 1.2rem; }

/* Upload */
.dropzone { display: block; position: relative; border: 2px dashed var(--line); border-radius: 12px; padding: 1.1rem; text-align: center; color: var(--muted); font-weight: 600; cursor: pointer; background: var(--surface-2); }
.dropzone.small { padding: .6rem; }
.dropzone.drag { border-color: var(--primary); color: var(--primary); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.previews { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 .8rem; }
.previews .pv { width: 84px; font-size: .7rem; color: var(--muted); word-break: break-all; }
.previews .pv img, .previews .pv video, .previews .pv .pvf { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); }
.progress { flex: 1; height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--primary); transition: width .2s; }

/* Ticket page */
.ticket-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.ticket-head > div { min-width: 0; } .ticket-head h1 { overflow-wrap: anywhere; }
.pills { display: flex; gap: .35rem; flex-wrap: wrap; }
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; align-items: start; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.facts dt { color: var(--muted); font-size: .88rem; }
.facts dd { margin: 0; }
.desc { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.timeline { margin-bottom: 1rem; }
.tl { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem 1rem; margin-bottom: .6rem; }
.tl header { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; font-size: .88rem; margin-bottom: .2rem; }
.tl time { margin-left: auto; color: var(--muted); font-size: .8rem; }
.tl-system, .tl-status { background: transparent; border-style: dashed; padding: .4rem 1rem; color: var(--muted); font-size: .88rem; }
.tl-internal { background: var(--internal-bg); }
.tl-agent { border-left: 4px solid var(--info); }
.tl-customer { border-left: 4px solid var(--brand-accent); }
.atts { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .5rem; }
.att { margin: 0; }
.att img { display: block; max-width: 220px; max-height: 180px; border-radius: 8px; border: 1px solid var(--line); }
.att video { display: block; width: min(420px, 100%); max-height: 320px; border-radius: 8px; background: #000; }
.att figcaption { font-size: .75rem; color: var(--muted); margin-top: .2rem; max-width: 420px; }
.att-file { display: inline-block; padding: .4rem .7rem; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; font-size: .88rem; }
.reply textarea { margin-top: 0; }
.reply-actions { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; margin-top: .6rem; }
.reply-actions label.check { margin: 0 auto 0 0; }
.reply-actions select { width: auto; margin: 0; }
.visit { padding: .4rem 0; border-bottom: 1px solid var(--line); margin-bottom: .5rem; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .8rem; color: var(--muted); font-weight: 600; background: var(--surface-2); }
.table tr.dim td { opacity: .55; }
.rowedit summary { cursor: pointer; color: var(--link); }
.rowedit[open] { min-width: 280px; }
pre.detail { max-height: 260px; overflow: auto; background: var(--surface-2); padding: .5rem; border-radius: 6px; font-size: .8rem; }
pre.notes { font-size: .85rem; max-height: 200px; overflow: auto; }
ul.simple { list-style: none; padding: 0; margin: 0 0 .8rem; }
ul.simple li { padding: .35rem 0; border-bottom: 1px solid var(--line); }

/* Customer type chooser */
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.type-card { display: block; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); box-shadow: var(--shadow); border-top: 4px solid var(--primary); }
.type-card:hover { border-color: var(--primary); }
.type-card span { display: block; color: var(--muted); font-size: .86rem; margin-top: .2rem; }

/* Deployments */
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--muted); vertical-align: middle; }
.dot-up { background: #22a565; box-shadow: 0 0 0 3px color-mix(in srgb, #22a565 25%, transparent); }
.dot-down { background: #e5484d; box-shadow: 0 0 0 3px color-mix(in srgb, #e5484d 25%, transparent); }
.dot-new { background: #f0a020; }
.keybox { border: 2px solid var(--warn); }
code.key { display: block; padding: .6rem; margin: .5rem 0 .8rem; font-size: .95rem; user-select: all; }
.meter { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin-bottom: .2rem; max-width: 260px; }
.meter span { display: block; height: 100%; background: var(--primary); }

/* Form builder */
.fb-row { display: grid; grid-template-columns: 30px 1fr 30px; gap: .5rem; padding: .8rem; border: 1px solid var(--line); border-radius: 10px; margin-bottom: .6rem; background: var(--surface-2); }
.fb-handle { display: flex; flex-direction: column; gap: .2rem; }
.fb-flags { padding-bottom: .75rem; }
.fb-flags label { margin-bottom: .2rem; }
.brand-preview { display: flex; gap: 1rem; align-items: center; padding: .8rem; background: var(--top-bg); color: var(--top-text); border-radius: 10px; margin-bottom: 1rem; }
.brand-preview img { height: 54px; }
.brand-preview .muted { color: inherit; opacity: .8; }

/* Auth pages */
body.bare { min-height: 100vh; display: grid; place-items: center; padding: 1rem;
  background: linear-gradient(160deg, var(--top-bg) 0 38%, var(--bg) 38%); }
.auth-card { width: min(420px, 100%); background: var(--surface); border-radius: 16px; padding: 1.6rem; box-shadow: 0 20px 50px rgba(0,0,0,.18); }
.auth-logo { display: block; height: 72px; margin: 0 auto 1rem; }
.auth-card h1 { text-align: center; }
.btn-ms { width: 100%; padding: .7rem; }
.btn-ms small { font-weight: 400; color: var(--muted); }
.or { display: flex; align-items: center; gap: .6rem; color: var(--muted); margin: 1rem 0; font-size: .85rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.code-input { font-size: 1.6rem; letter-spacing: .4em; text-align: center; }
.theme-float { position: fixed; top: 12px; right: 12px; color: #fff; }
.narrow-card { max-width: 560px; }

/* Mobile */
.bottomnav { display: none; }
@media (max-width: 900px) {
  .ticket-layout { grid-template-columns: 1fr; }
  .ticket-side { order: -1; }
  .grid2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .mainnav { display: none; }
  .brand span { display: none; }
  .brand img { height: 34px; }
  .wrap { padding: .8rem; padding-bottom: 6rem; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .bottomnav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom); }
  .bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .45rem 0 .5rem; font-size: .7rem; color: var(--muted); text-decoration: none; }
  .bottomnav a[aria-current] { color: var(--primary); font-weight: 700; }
  .bn-i { width: 22px; height: 22px; background: currentColor; -webkit-mask: var(--ic) center/contain no-repeat; mask: var(--ic) center/contain no-repeat; }
  .table { font-size: .85rem; }
  .table th, .table td { padding: .5rem; }
  .card.flush { overflow-x: auto; }
  .ticket-head .btn-accept { width: 100%; }
  .ticket-head form { width: 100%; }
  /* Remote support PCs: one block per PC with a full-size Connect button, instead of a table wider than the phone */
  .card.flush .remote-pcs thead { display: none; }
  .remote-pcs tr { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
  .remote-pcs td { display: block; padding: 0 !important; border: 0; }
  .remote-pcs .pc-name { font-weight: 600; }
  .remote-pcs .pc-actions { flex-basis: 100%; align-items: center; gap: 1rem; margin-top: .3rem; }
  .remote-pcs .pc-actions .btn { flex: 1; max-width: 16rem; padding: .6rem 1rem; text-align: center; }
  /* More: the rest of the menu, above the bar */
  .bn-more { flex: 1; position: relative; }
  .bn-more summary { list-style: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .45rem 0 .5rem; font-size: .7rem; color: var(--muted); cursor: pointer; }
  .bn-more summary::-webkit-details-marker { display: none; }
  .bn-more summary[aria-current], .bn-more[open] summary { color: var(--primary); font-weight: 700; }
  .bn-more-menu { position: absolute; right: .4rem; bottom: calc(100% + .4rem); min-width: 12rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: .3rem; }
  .bn-more-menu a { flex-direction: row; justify-content: flex-start; gap: .7rem; padding: .7rem .8rem; font-size: .95rem; color: var(--text); border-radius: 8px; }
  .bn-more-menu a[aria-current] { color: var(--primary); }
}
.bn-home { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 11l9-7 9 7v9a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1z'/%3E%3C/svg%3E"); }
.bn-ticket { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 7h18v4a2 2 0 0 0 0 4v4H3v-4a2 2 0 0 0 0-4z'/%3E%3C/svg%3E"); }
.bn-plus { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8v8M8 12h8'/%3E%3C/svg%3E"); }
.bn-pulse { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 12h4l3-7 4 14 3-7h4'/%3E%3C/svg%3E"); }
.bn-building { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 21V4h10v17M14 9h6v12M8 8h2M8 12h2M8 16h2'/%3E%3C/svg%3E"); }
.bn-screen { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='12' rx='1'/%3E%3Cpath d='M8 20h8M12 16v4'/%3E%3C/svg%3E"); }
.bn-more-i { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Ccircle cx='5' cy='12' r='2'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3Ccircle cx='19' cy='12' r='2'/%3E%3C/svg%3E"); }
.bn-gear { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9l2.1 2.1M17 17l2.1 2.1M4.9 19.1L7 17M17 7l2.1-2.1'/%3E%3C/svg%3E"); }

.card > h3:first-child { margin-top: 0; }

/* Help centre */
.help-hero { text-align: center; padding: 1.2rem 0 1.4rem; }
.help-search { display: flex; gap: .5rem; max-width: 640px; margin: .6rem auto 0; }
.help-search input { margin: 0; font-size: 1.05rem; }
.help-sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; align-items: start; }
.help-sections .card { margin: 0; }
.help-list { list-style: none; margin: 0; padding: 0; }
.help-list li a { display: block; padding: .55rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); }
.help-list li:last-child a { border-bottom: 0; }
.help-list li a:hover b { color: var(--link); text-decoration: underline; }
.help-list span { display: block; color: var(--muted); font-size: .86rem; }
.help-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1rem; align-items: start; }
.help-article { padding: 1.4rem 1.8rem; line-height: 1.65; }
.help-article h1 { font-size: 1.7rem; }
.help-article h2 { font-size: 1.25rem; margin-top: 1.8rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.help-article h3 { font-size: 1.05rem; margin-top: 1.3rem; }
.help-article .lead { font-size: 1.08rem; color: var(--muted); margin-top: 0; }
.help-article li { margin-bottom: .3rem; }
.help-article .help-table { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--line); border-radius: 10px; }
.help-article .help-table .table td, .help-article .help-table .table th { font-size: .92rem; }
.help-callout { margin: 1rem 0; padding: .8rem 1rem; border-radius: 10px; background: var(--info-bg); color: var(--text); border-left: 4px solid var(--info); }
.help-warn { background: var(--warn-bg); border-left-color: var(--warn); }
.help-code { background: var(--surface-2); padding: .8rem 1rem; border-radius: 8px; overflow-x: auto; font-size: .88rem; }
.flow { list-style: none; counter-reset: flow; margin: 1.2rem 0; padding: 0; display: flex; flex-direction: column; align-items: stretch; gap: 0; max-width: 620px; }
.help-article .flow-step, .flow-step { counter-increment: flow; position: relative; padding: .7rem 1rem .7rem 3.2rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 1.6rem; }
.flow-step::before { content: counter(flow); position: absolute; left: .8rem; top: .7rem; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--primary); color: var(--primary-text); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.flow-step:not(:last-child)::after { content: ""; position: absolute; left: 50%; bottom: -1.45rem; width: 2px; height: 1.3rem; background: var(--line); }
.flow-step:not(:last-child) > b::after { content: ""; position: absolute; left: calc(50% - 5px); bottom: -1.55rem; border: 6px solid transparent; border-top-color: var(--muted); }
.flow-step > b { display: block; }
.flow-step > span { display: block; color: var(--muted); font-size: .9rem; }
.flow-decision { border-style: dashed; border-color: var(--warn); }
.flow-decision::before { content: "?"; background: var(--warn); color: #fff; }
.flow-end { background: var(--ok-bg); border-color: transparent; }
.flow-end::before { content: "✓"; background: var(--ok); color: #fff; }
.bn-help { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M9.5 9a2.5 2.5 0 1 1 3.5 2.3c-.7.3-1 .9-1 1.7M12 17h.01'/%3E%3C/svg%3E"); }
.helplink { font-size: .85rem; font-weight: 400; }
@media (max-width: 900px) { .help-layout { grid-template-columns: 1fr; } .help-article { padding: 1rem; } }
/* remote help: the customer's "Request engineer assistance" card and the engineer's notice of it */
.remote-cta { border-left: 4px solid var(--brand-accent); }
.remote-cta fieldset { border: 0; padding: 0; margin: 0; } .remote-cta legend { font-weight: 600; margin-bottom: .3rem; }
.remote-cta label.check { gap: .45rem; }
.remote-help { border-left: 3px solid var(--brand-accent); padding-left: .75rem; margin-bottom: .75rem; }
