/* ============================================================================
   Lewis Forecourts — Data
   Same design language as lewisforecourts.io: warm paper, deep petrol green,
   brass used sparingly, serif display type. Denser, because this is a working tool.
   System fonts only — no webfont requests, nothing loaded from anywhere else.
   ========================================================================== */

:root {
  color-scheme: light;
  --paper: #fbfaf8; --paper-2: #f4f2ec; --paper-3: #ece9e1; --surface: #ffffff;
  --ink: #14171b; --ink-2: #39414c; --ink-3: #6a7380; --ink-4: #98a0ab;
  --accent: #12574e; --accent-2: #1a7a6c; --accent-3: #2b9c8b;
  --accent-soft: rgba(18, 87, 78, .07); --accent-line: rgba(18, 87, 78, .18);
  --brass: #ab7c38; --brass-soft: rgba(171, 124, 56, .1);
  --ok: #17795a; --ok-soft: rgba(23, 121, 90, .09);
  --warn: #9a6512; --warn-soft: rgba(154, 101, 18, .12);
  --bad: #a32c25; --bad-soft: rgba(163, 44, 37, .08);
  --line: rgba(20, 23, 27, .11); --line-soft: rgba(20, 23, 27, .06); --line-hard: rgba(20, 23, 27, .2);
  --radius: 14px; --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(20, 23, 27, .05);
  --shadow: 0 2px 6px rgba(20, 23, 27, .05), 0 12px 28px -12px rgba(20, 23, 27, .14);
  --display: ui-serif, Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 1240px;
  --gutter: clamp(16px, 3.5vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; } }

h1, h2 { font-family: var(--display); font-weight: 600; letter-spacing: -.015em; line-height: 1.12; margin: 0 0 .4em; }
h1 { font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.35rem); }
h2 { font-size: 1.28rem; }
h3 { font-size: 1rem; margin: 0 0 .4em; }
p { margin: 0 0 .9em; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-2); }
code, .mono { font-family: var(--mono); font-size: .88em; }
code { background: var(--paper-2); padding: 1px 5px; border-radius: 5px; }
del { color: var(--bad); text-decoration-color: rgba(163, 44, 37, .5); }
ins { color: var(--ok); text-decoration: none; background: var(--ok-soft); padding: 0 3px; border-radius: 3px; }
.muted { color: var(--ink-3); }
.small { font-size: .84rem; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.pre { white-space: pre-wrap; word-break: break-word; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 200; }
.skip:focus { left: 12px; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.wrap--wide { max-width: none; margin: 0 auto; padding: 0 var(--gutter); }
.main { padding-top: 22px; padding-bottom: 48px; min-height: calc(100vh - 150px); }

/* ------------------------------------------------------------------ top bar */
.top { position: sticky; top: 0; z-index: 50; background: var(--topbar, rgba(251, 250, 248, .93)); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--line); }
.top__inner { display: flex; align-items: center; gap: 14px; min-height: 64px; }
.top__spacer { flex: 1; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex: none; }
.brand:hover { color: var(--ink); }
.brand__mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font: 600 17px var(--display); background: linear-gradient(152deg, var(--accent-2), var(--accent)); box-shadow: 0 3px 10px rgba(18, 87, 78, .25); }
.brand__text { display: flex; flex-direction: column; line-height: 1.12; }
.brand__name { font: 600 1.02rem var(--display); letter-spacing: -.01em; }
.brand__sub { font-size: .6rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--brass); }
.brand__logo { display: block; height: 36px; width: auto; max-width: 220px; object-fit: contain; }
.brand__logo--big { height: 56px; max-width: 300px; }
.brand__sub--solo { align-self: flex-end; margin-bottom: 2px; }
.brand__mark--inline { display: inline-grid; width: 22px; height: 22px; font-size: 12px; border-radius: 6px; vertical-align: middle; }

.tabs { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tabs a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .93rem; padding: 8px 13px; border-radius: 9px; white-space: nowrap; }
.tabs a:hover { background: rgba(20, 23, 27, .05); color: var(--ink); }
.tabs a[aria-current] { color: var(--accent); background: var(--accent-soft); }

/* dropdown menus built on <details> */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu__panel { position: absolute; top: calc(100% + 6px); left: 0; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 60; }
.menu__panel--right { left: auto; right: 0; }
.menu__head { display: flex; flex-direction: column; padding: 8px 10px 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.menu__head span { font-size: .8rem; color: var(--ink-3); }
.menu__item { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font: inherit; background: none; border: 0; cursor: pointer; }
.menu__item:hover { background: var(--paper-2); color: var(--ink); }
.menu__item.is-current { color: var(--accent); font-weight: 600; }
.menu__item--muted { color: var(--ink-3); border-top: 1px solid var(--line-soft); margin-top: 4px; }
.sitepick__btn, .usermenu__btn { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-weight: 600; font-size: .93rem; }
.sitepick__btn:hover, .usermenu__btn:hover { border-color: var(--line-hard); }
.sitepick__label { font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.sitepick__static { font-weight: 600; padding: 6px 4px; }
.usermenu__btn { padding: 4px 10px 4px 4px; border-radius: 999px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font: 600 .85rem var(--display); }

/* ------------------------------------------------------------------ page parts */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: .84rem; color: var(--ink-3); margin-bottom: 14px; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.pagehead { margin: 8px 0 26px; max-width: 900px; }
.pagehead--tight { margin-bottom: 16px; max-width: none; }
.eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--brass); margin-bottom: 8px; }
.lede { font-size: 1.05rem; color: var(--ink-2); max-width: 760px; }
.title-code { font-family: var(--mono); font-size: .5em; color: var(--ink-3); font-weight: 400; letter-spacing: 0; vertical-align: middle; }
.section { margin-top: 34px; }
.section__title { font-size: 1.18rem; display: flex; align-items: baseline; gap: 10px; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: .8rem; color: var(--ink-3); padding-top: 18px; padding-bottom: 28px; border-top: 1px solid var(--line); }

.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.grid--rowview { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .grid--rowview { grid-template-columns: 1fr; } }
.stack { display: flex; flex-direction: column; gap: 14px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-sm); }
.card--link { display: flex; flex-direction: column; gap: 6px; color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.card--link:hover { color: var(--ink); border-color: var(--accent-line); box-shadow: var(--shadow); transform: translateY(-1px); }
.card--compact { padding: 14px 16px; gap: 2px; }
.card__cta { margin-top: auto; padding-top: 8px; color: var(--accent); font-weight: 600; font-size: .92rem; }
.card h2 { font-size: 1.15rem; }
.feature p { color: var(--ink-2); font-size: .94rem; }
.narrow { max-width: 620px; }
.reauth { margin: 30px auto; }
.row-actions { display: flex; gap: 10px; align-items: center; }
.sitecard__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.sitecard__top h2 { margin: 0; }
.sitecard.is-waiting { background: var(--paper-2); box-shadow: none; }

.facts { display: grid; gap: 8px 18px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 6px 0 0; }
.facts div { min-width: 0; }
.facts dt { font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.facts--inline { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 12px; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--paper-3); color: var(--ink-2); white-space: nowrap; vertical-align: middle; }
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--bad { background: var(--bad-soft); color: var(--bad); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: middle; }
.dot--warn { background: var(--brass); }
.dot--bad { background: var(--bad); }

.note { padding: 11px 14px; border-radius: 10px; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--ink); margin: 0 0 16px; }
.note--ok { background: var(--ok-soft); border-color: rgba(23, 121, 90, .25); }
.note--bad { background: var(--bad-soft); border-color: rgba(163, 44, 37, .25); }
.note--warn { background: var(--warn-soft); border-color: rgba(154, 101, 18, .3); margin: 0; }
.hint { margin: 0 0 12px; font-size: .9rem; }
.hint summary { cursor: pointer; color: var(--ink-3); }
.hint__body { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; margin-top: 8px; max-width: 820px; }
.hint__body ul { margin: 0; padding-left: 18px; }

/* ------------------------------------------------------------------ controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 .93rem var(--sans); padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-2); color: #fff; }
.btn--ghost { background: var(--surface); border-color: var(--line-hard); color: var(--ink-2); }
.btn--ghost:hover { border-color: var(--ink-4); color: var(--ink); }
.btn--quiet { background: transparent; color: var(--ink-3); }
.btn--quiet:hover { color: var(--ink); background: rgba(20, 23, 27, .05); }
.btn--sm { padding: 6px 12px; font-size: .86rem; border-radius: 8px; }
.btn--block { width: 100%; }
.btn.is-disabled { opacity: .45; pointer-events: none; }
.field { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: .88rem; }
input, select, textarea { font: inherit; color: var(--ink); }
.field input, .search input, .select select { padding: 10px 12px; border: 1px solid var(--line-hard); border-radius: 10px; background: var(--surface); font-weight: 400; font-size: 1rem; }
.field input:focus, .search input:focus, .select select:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-soft); }
.input--code { font-family: var(--mono); font-size: 1.6rem !important; letter-spacing: .35em; text-align: center; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: .9rem; cursor: pointer; }
.check.is-disabled { color: var(--ink-4); cursor: default; }
.select { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--ink-3); }
.select select { padding: 6px 10px; font-size: .9rem; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.toolbar--sticky { position: sticky; top: 72px; z-index: 20; flex-wrap: wrap; }
.toolbar__spacer { flex: 1; }
.search { flex: 1 1 220px; max-width: 340px; }
.search input { width: 100%; padding: 8px 12px; font-size: .95rem; }
.arealinks { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .84rem; width: 100%; }
.arealinks a { color: var(--ink-3); text-decoration: none; }
.arealinks a:hover { color: var(--accent); }
.colpick { max-height: 60vh; overflow: auto; min-width: 280px; display: flex; flex-direction: column; gap: 4px; padding: 10px; }
.colpick__actions { display: flex; gap: 6px; margin-bottom: 4px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.pills a { padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line-hard); color: var(--ink-2); text-decoration: none; font-size: .88rem; font-weight: 600; background: var(--surface); }
.pills a[aria-current] { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ------------------------------------------------------------------ tables */
.tablewrap { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: auto; }
.tablewrap--x { max-height: calc(100vh - 150px); }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .88rem; }
.data th, .data td { padding: 7px 12px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.data thead th { position: sticky; top: 0; z-index: 2; background: var(--paper-2); font-size: .76rem; letter-spacing: .03em; color: var(--ink-2); font-weight: 700; white-space: nowrap; border-bottom: 1px solid var(--line); }
.data thead th a { color: inherit; text-decoration: none; }
.data thead th a:hover { color: var(--accent); }
.data thead th[aria-sort] { color: var(--accent); }
.data .filters th { top: 33px; background: var(--paper); padding: 4px 6px; }
.data .filters input { width: 100%; min-width: 80px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 7px; font-size: .82rem; background: var(--surface); }
.data .filters input:focus { outline: none; border-color: var(--accent-2); }
.data .filters input.is-set { border-color: var(--accent-2); background: var(--accent-soft); }
.data .filters input.is-bad { border-color: var(--bad); background: var(--bad-soft); }
.data tbody tr:hover td { background: var(--paper); }
.data td.num, .data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.data--explore td { white-space: nowrap; max-width: 380px; overflow: hidden; text-overflow: ellipsis; }
.data--explore td.is-null { background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(20, 23, 27, .025) 6px 12px); }
.data tr.is-removed td { color: var(--ink-4); text-decoration: line-through; text-decoration-color: rgba(163, 44, 37, .35); }
.data tr.is-empty { display: none; }
.show-empty .data tr.is-empty { display: table-row; }
.data tr.is-empty td { color: var(--ink-4); }
.data .empty { text-align: center; color: var(--ink-3); padding: 28px; }
.rowlink-h, .rowlink { width: 44px; white-space: nowrap; }
.rowlink a { text-decoration: none; font-weight: 700; padding: 0 4px; }
.data--list td:first-child { min-width: 260px; }
.data--list .mono { margin-left: 6px; }
.tablefoot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; }
.pager { display: flex; align-items: center; gap: 10px; }
.pager__info { font-size: .88rem; color: var(--ink-3); }
.legend .dot { margin-left: 6px; }

/* row view */
.fields { margin: 0; }
.fields__row { display: grid; grid-template-columns: minmax(140px, 36%) 1fr; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.fields__row dt { font-family: var(--mono); font-size: .82rem; color: var(--ink-2); word-break: break-all; }
.fields__row dt .muted { font-family: var(--sans); display: block; font-size: .72rem; }
.fields__row dd { margin: 0; word-break: break-word; }
.fields__row.is-changed { background: var(--warn-soft); margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 6px; }
.list { list-style: none; margin: 0; padding: 0; }
.list__item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.list__item:last-child { border-bottom: 0; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.timeline__head { font-weight: 700; font-size: .86rem; margin: 12px 0 4px -22px; padding-left: 20px; position: relative; }
.timeline__head::before { content: ''; position: absolute; left: 1px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--brass); }
.timeline__item { font-size: .9rem; padding: 3px 0; word-break: break-word; }
.timeline__item--removed { color: var(--bad); }
.timeline__item--added { color: var(--ok); }

/* ------------------------------------------------------------------ sign-in pages */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; gap: 22px; background: radial-gradient(1000px 500px at 50% -10%, rgba(18, 87, 78, .09), transparent 70%), var(--paper); }
.auth__brand { display: flex; align-items: center; gap: 12px; }
.auth__card { width: 100%; max-width: 420px; padding: 30px 30px 24px; box-shadow: var(--shadow); }
.auth__card--wide { max-width: 560px; }
.auth__card h1 { font-size: 1.7rem; }
.auth__foot { font-size: .78rem; color: var(--ink-3); text-align: center; max-width: 380px; }
.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 18px; counter-reset: s; }
.steps li { flex: 1; font-size: .78rem; font-weight: 600; color: var(--ink-4); border-top: 3px solid var(--line); padding-top: 6px; counter-increment: s; }
.steps li::before { content: counter(s) '. '; }
.steps li.is-current { color: var(--accent); border-color: var(--accent); }
.steps li.is-done { color: var(--ok); border-color: var(--ok); }
.pair { display: flex; gap: 18px; align-items: flex-start; margin: 6px 0 18px; }
.pair__qr svg { width: 190px; height: 190px; border: 1px solid var(--line); border-radius: 10px; }
.pair__text ol { margin: 0; padding-left: 18px; }
.pair__text li { margin-bottom: 6px; }
.secret { display: inline-block; background: var(--paper-2); padding: 3px 7px; border-radius: 6px; word-break: break-all; user-select: all; }
@media (max-width: 560px) { .pair { flex-direction: column; align-items: center; } }

/* ------------------------------------------------------------------ small screens */
@media (max-width: 760px) {
  .top__inner { flex-wrap: wrap; gap: 8px 10px; padding-top: 8px; padding-bottom: 4px; min-height: 0; }
  .brand__text { display: none; }
  .sitepick, .sitepick__static, .top__spacer { flex: 1; }
  .tabs { order: 5; flex-basis: 100%; margin: 0 -6px; }
  .tabs a { padding: 8px 9px; font-size: .9rem; }
  .usermenu__name { display: none; }
  .usermenu__btn { padding: 3px; }
  .toolbar--sticky { position: static; }
  .facts--inline { gap: 8px 20px; }
  .pagehead h1 { font-size: 1.6rem; }
}

/* ------------------------------------------------------------------ print */
@media print {
  @page { margin: 12mm; }
  body { background: #fff; font-size: 10pt; }
  .top, .foot, .toolbar, .hint, .crumbs, .tablefoot .pager, .rowlink, .rowlink-h, .filters, .skip, .colpick { display: none !important; }
  .tablewrap, .tablewrap--x { border: 0; overflow: visible; max-height: none; }
  .data thead th { position: static; background: #eee; }
  .data--explore td { white-space: normal; max-width: none; }
  .card { box-shadow: none; border-color: #ccc; }
  a { color: inherit; text-decoration: none; }
  .main::after { content: 'Printed from Lewis Forecourts Data'; display: block; margin-top: 10mm; font-size: 8pt; color: #666; }
}

/* ------------------------------------------------------------------ branding */
.previewbar { background: var(--brass); color: #fff; font-size: .9rem; }
.previewbar__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding-top: 8px; padding-bottom: 8px; }
.previewbar__inner span { flex: 1; }
.btn--onbar { background: rgba(255, 255, 255, .18); color: #fff; border-color: rgba(255, 255, 255, .45); }
.btn--onbar:hover { background: rgba(255, 255, 255, .3); color: #fff; }
.btn--danger { background: var(--bad); color: #fff; }
.btn--danger:hover { filter: brightness(1.08); color: #fff; }
.card.danger { border-color: rgba(163, 44, 37, .25); }
.brandgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.brandgrid__side { position: sticky; top: 80px; }
@media (max-width: 980px) { .brandgrid { grid-template-columns: 1fr; } .brandgrid__side { position: static; } }
.colour { display: grid; grid-template-columns: 46px 1fr 100px; gap: 12px; align-items: center; }
.colour input[type=color] { width: 46px; height: 40px; padding: 2px; border: 1px solid var(--line-hard); border-radius: 9px; background: var(--surface); cursor: pointer; }
.colour__text { display: flex; flex-direction: column; }
.colour__hex { padding: 8px 9px; border: 1px solid var(--line-hard); border-radius: 8px; font-size: .88rem; width: 100%; }
.colour input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.colour input[type=color]::-webkit-color-swatch { border: 0; border-radius: 6px; }
.colour input[type=color]::-moz-color-swatch { border: 0; border-radius: 6px; }
.colour__hex.is-bad { border-color: var(--bad); background: var(--bad-soft); }
.contrast:empty { display: none; }
.contrast { display: flex; flex-direction: column; gap: 4px; }
.contrast .bad { color: var(--bad); }
.contrast .ok { color: var(--ok); }
.check-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.swatch { display: inline-block; width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--line-hard); vertical-align: middle; margin-right: 3px; }
.logoprev { padding: 16px; border-radius: 10px; background: var(--paper-2); display: flex; align-items: center; min-height: 80px; }
.logoprev img { max-width: 100%; height: auto; }
.iconrow { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.iconprev { margin: 0; text-align: center; font-size: .74rem; color: var(--ink-3); }
.iconprev img { display: block; margin: 0 auto 6px; width: 72px; height: 72px; }
.iconprev--maskable img { border-radius: 50%; }
.iconprev--apple img { border-radius: 16px; }
.iconprev--favicon img { width: 32px; height: 32px; }
.histnote { margin-top: 10px; }
.histlogo { height: 20px; width: auto; max-width: 120px; vertical-align: middle; }
.preview-card { overflow: hidden; }
.bp { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--paper); color: var(--ink); margin-top: 10px; }
.bp__top { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--topbar, var(--paper)); border-bottom: 1px solid var(--line); overflow: hidden; }
.bp__top > * { flex-shrink: 0; white-space: nowrap; }
.bp__logo { height: 28px; width: auto; max-width: 150px; }
.bp__mark { width: 26px; height: 26px; font-size: 14px; border-radius: 8px; }
.bp__name { font: 600 .9rem var(--display); margin-right: 6px; }
.bp__tab { font-size: .78rem; padding: 4px 8px; border-radius: 7px; color: var(--ink-2); }
.bp__tab.is-on { background: var(--accent-soft); color: var(--accent); }
.bp__body { padding: 14px; }
.bp__h { font: 600 1.25rem var(--display); margin: 0 0 4px; display: block; color: var(--ink); }
.bp__p { color: var(--ink-2); font-size: .88rem; }
.bp__btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.bp__btns .btn { pointer-events: none; }
.bp__table { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.bp--auth { display: grid; place-items: center; padding: 18px; }
.bp__authcard { width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.bp__input { display: block; width: 100%; height: 28px; border: 1px solid var(--line-hard); border-radius: 7px; background: var(--surface); }

/* ------------------------------------------------------------------ receipts */
.rxform { gap: 14px; margin-bottom: 14px; }
.rxform__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 14px; }
.rxform__wide { grid-column: span 2; }
.rxform .field input, .rxform .field select { width: 100%; min-width: 0; height: 42px; padding: 8px 10px; font-size: .95rem; font-weight: 400; border: 1px solid var(--line-hard); border-radius: 10px; background: var(--surface); }
.rxform .field input:focus, .rxform .field select:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-soft); }
@media (max-width: 520px) { .rxform__grid { grid-template-columns: 1fr 1fr; } .rxform__wide { grid-column: 1 / -1; } }
.quickcard { margin-bottom: 18px; gap: 8px; }
.quickcard__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; }
.quickcard .card__cta { margin-top: 0; }
.quickfind { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px 12px; align-items: end; margin-top: 4px; }
.quickfind .field input { width: 100%; min-width: 0; height: 42px; padding: 8px 10px; font-size: .95rem; }
.quickfind .btn { height: 42px; }
.tablefoot--top { margin: 0 0 10px; }
.data--rx td { vertical-align: middle; }
.rowclick { cursor: pointer; }
.rowlink-a { font-weight: 600; text-decoration: none; }
.data tr.is-void td { color: var(--ink-3); }
.rxview { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: start; }
.rxview__paper { position: sticky; top: 84px; }
@media (max-width: 920px) { .rxview { grid-template-columns: 1fr; } .rxview__paper { position: static; } }
.rxview__note { max-width: 46ch; margin: 12px auto 0; }
.paper { background: #fff; padding: 22px 20px 26px; border-radius: 3px; width: fit-content; max-width: 100%; margin: 0 auto;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 10px 28px rgba(0, 0, 0, .09); }
/* The receipt itself: always black on white, whatever the site's colours. */
.rc { font: 13px/1.4 var(--mono); color: #111; width: 42ch; max-width: calc(100vw - 72px); font-variant-numeric: tabular-nums; }
.rc__c { text-align: center; }
.rc__name { font-weight: 700; font-size: 1.08em; }
.rc__row { display: flex; justify-content: space-between; gap: 1ch; }
.rc__desc { min-width: 0; overflow-wrap: anywhere; }
.rc__val { white-space: nowrap; }
.rc__code { color: #555; }
.rc__sub { padding-left: 2ch; color: #333; }
.rc__sec { margin-top: .35em; font-weight: 700; }
.rc__rule { border-top: 1px dashed #888; margin: .5em 0; }
.rc__gap { height: .7em; }
.rc__total { font-weight: 700; font-size: 1.1em; }
.rc__strong { font-weight: 700; }
.rc__copy { text-align: center; font-weight: 700; letter-spacing: .06em; }
.rc__vat { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; column-gap: 1ch; }
.rc__vat span:nth-child(4n+2), .rc__vat span:nth-child(4n+3), .rc__vat span:nth-child(4n) { text-align: right; }
.rc__vat span:nth-child(-n+4) { font-weight: 700; }
.rxcheck { margin: 0; font-weight: 600; }
.rxcheck--ok { color: var(--ok); }
.rxcheck--bad { color: var(--bad); }
.linklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .92rem; }
.data--compact th, .data--compact td { padding: 6px 8px; }
.hint--settings { margin-top: 18px; }

/* The print copy page (see print-80mm.css and print-a4.css for paper). */
.printpage { background: var(--paper-2); min-height: 100vh; }
.printbar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); font-size: .92rem; }
.printbar span { flex: 1 1 260px; }
.printsheet { max-width: 820px; margin: 24px auto; padding: 0 16px; }
.printpage--80mm .rc { background: #fff; margin: 0 auto; padding: 20px 16px; box-shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 10px 28px rgba(0, 0, 0, .09); }
.printpage--a4 .printsheet { background: #fff; padding: 24px; box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
.printpage--a4 .rc { margin: 18px auto; border: 1px solid #bbb; padding: 18px 16px; }
.printhead { display: flex; justify-content: space-between; gap: 20px; font: 10pt/1.45 var(--sans); color: #111; border-bottom: 1px solid #999; padding-bottom: 8px; }
.printhead__right { text-align: right; }
.printfoot { font: 8.5pt/1.45 var(--sans); color: #444; text-align: center; margin-top: 18px; }
@media print {
  .rxview > .stack, .rxview__note { display: none !important; }
  .rxview { display: block; }
  .paper { box-shadow: none; padding: 0; }
}
.rc__c, .rc__sub, .rc__row > span { white-space: pre-wrap; }
.rc__row > .rc__val { white-space: pre; }

/* Receipt results: a table on wide screens, a list of cards on phones. */
.data--rx .rx-meta { display: none; }
@media (max-width: 700px) {
  .data--rx thead { display: none; }
  .data--rx, .data--rx tbody { display: block; }
  .data--rx tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "when total" "meta meta" "what what" "paid paid" "flags flags";
    gap: 2px 10px; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); }
  .data--rx td { display: block; padding: 0; border: 0; text-align: left; }
  .data--rx td:empty { display: none; }
  .data--rx .rx-when { grid-area: when; } .data--rx .rx-total { grid-area: total; font-weight: 700; text-align: right; }
  .data--rx .rx-meta { grid-area: meta; display: block; font-size: .85rem; color: var(--ink-3); }
  .data--rx .rx-what { grid-area: what; } .data--rx .rx-paid { grid-area: paid; } .data--rx .rx-flags { grid-area: flags; }
  .data--rx .rx-till, .data--rx .rx-trans, .data--rx .rx-cashier { display: none; }
  .data--rx .empty { display: block; }
}
