:root {
  --brand-primary: #1f4e79;
  --brand-primary-text: #ffffff;
  --brand-accent: #2e8bc0;
  --page-bg: #f5f6f8;
  --text: #1c2430;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--page-bg);
  color: var(--text);
  line-height: 1.5;
}
.site-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--brand-primary);
  color: var(--brand-primary-text);
}
.site-logo { height: 40px; width: auto; background: #fff; padding: 4px 8px; border-radius: 4px; }
.site-name { font-size: 1.25rem; font-weight: 600; }
.site-main { max-width: 60rem; margin: 2rem auto; padding: 0 1.5rem; }
.site-footer { max-width: 60rem; margin: 2rem auto; padding: 1rem 1.5rem; font-size: 0.875rem; color: #5a6472; }
.button {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background: var(--brand-accent);
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
}
.muted { color: #5a6472; }

/* Account pages */
.site-brand { display: flex; align-items: center; gap: 1rem; color: inherit; text-decoration: none; }
.site-header { justify-content: space-between; flex-wrap: wrap; }
.site-nav { display: flex; align-items: center; gap: 1.25rem; }
.site-nav a, .link-button { color: var(--brand-primary-text); font: inherit; text-decoration: underline; }
.inline-form { display: inline; margin: 0; }
.link-button { background: none; border: 0; padding: 0; cursor: pointer; }
.card { max-width: 28rem; background: #fff; border: 1px solid #d8dde4; border-radius: 6px; padding: 1.5rem; }
.card-wide { max-width: 40rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.field input[type="email"], .field input[type="password"], .field input[type="text"] {
  width: 100%; padding: 0.5rem; font: inherit; border: 1px solid #8a94a3; border-radius: 4px;
}
.hint { font-size: 0.875rem; color: #5a6472; }
button.button, a.button { border: 0; cursor: pointer; font: inherit; }
button.button, a.button, .button { font-weight: 600; font-size: 1.05rem; }   /* white on the logo reds: bold for legibility */
button.button-secondary, a.button-secondary { background: #fff; color: var(--brand-primary); border: 1px solid var(--brand-primary); }
.button-danger { background: #a61b1b; }
.alert { padding: 0.75rem 1rem; border-radius: 4px; margin: 0 0 1rem; }
.alert-error { background: #fdecec; border: 1px solid #e0a3a3; color: #7a1515; }
.alert-info { background: #e9f4ec; border: 1px solid #a3cdb0; color: #1c4a2b; }
.alert-warn { background: #fff6e0; border: 1px solid #e3c987; color: #5c4400; }
.qr { width: 12rem; margin: 1rem 0; background: #fff; }
.qr svg { display: block; width: 100%; height: auto; }
.key { font-family: ui-monospace, Consolas, monospace; font-size: 1.1rem; letter-spacing: 0.05em; word-break: break-all; }
.codes { list-style: none; padding: 0; columns: 2; font-family: ui-monospace, Consolas, monospace; font-size: 1.1rem; }
.codes li { padding: 0.15rem 0; }
.actions { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.divider { margin: 1.5rem 0; border: 0; border-top: 1px solid #d8dde4; }
table.simple { border-collapse: collapse; width: 100%; background: #fff; }
table.simple th, table.simple td { text-align: left; padding: 0.5rem; border-bottom: 1px solid #e3e7ec; }

/* Phase 4: customer pages */
a { color: #0a4a8a; }
.site-header a, .site-header a:visited { color: var(--brand-primary-text); }
:focus-visible { outline: 3px solid #1a5fb4; outline-offset: 2px; }
.site-header :focus-visible, .main-nav :focus-visible, .skip-link:focus-visible { outline-color: #fff; }
.skip-link { position: absolute; left: -999px; top: 0; padding: 0.5rem 1rem; background: var(--brand-primary); color: var(--brand-primary-text); z-index: 10; }
.skip-link:focus { left: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
#main:focus { outline: none; }
.site-main { max-width: 80rem; }
.site-main-wide { max-width: 110rem; }
.site-footer { max-width: 80rem; }
.site-footer p { margin: 0.25rem 0; }
.site-footer a { color: #0a4a8a; }

.main-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; padding: 0.5rem 1.5rem; background: #fff; border-bottom: 1px solid #d8dde4; }
.main-nav a { color: var(--brand-primary); font-weight: 600; text-decoration: none; padding: 0.25rem 0; border-bottom: 3px solid transparent; }
.main-nav a:hover { border-bottom-color: var(--brand-primary); }
.main-nav a[aria-current="page"] { border-bottom-color: var(--brand-primary); }

.freshness { background: #fff; border: 1px solid #d8dde4; border-radius: 6px; padding: 0.5rem 1rem; margin: 0 0 1rem; font-size: 0.875rem; }
.freshness p { margin: 0.25rem 0; }

.table-wrap { overflow-x: auto; max-width: 100%; margin: 0 0 1rem; background: #fff; border: 1px solid #d8dde4; border-radius: 6px; }
table.data { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
table.data caption { text-align: left; font-weight: 600; padding: 0.5rem; }
table.data th, table.data td { text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid #e3e7ec; vertical-align: top; }
table.data thead th { background: #eef1f5; white-space: nowrap; }
table.data th.num, table.data td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.data caption .caption-note { font-weight: normal; font-size: 0.85rem; margin-left: 0.5rem; }
table.data td.nowrap { white-space: nowrap; }
table.data td.col-site { min-width: 10rem; }
table.data td.col-product { min-width: 8rem; }
table.data .card-desc { display: block; }
table.data .cell-val .tag { margin-left: 0.25rem; }
table.data tfoot th, table.data tfoot td { font-weight: 600; border-top: 2px solid #8a94a3; border-bottom: 0; }
.card-search { margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; align-items: baseline; }
.card-search label { font-weight: 600; }
.card-search input { min-width: 16rem; }
.card-search[hidden], #card-search-none[hidden] { display: none; }
table.data tr[hidden] { display: none; }
/* Sortable headers: a button (table-sort.js) or a link (server-side sort) that looks like the header text. */
table.data .th-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; font-weight: inherit; text-align: inherit; }
table.data a.th-sort { text-decoration: none; }
table.data a.th-sort:hover { text-decoration: underline; }
table.data .sort-arrow { margin-left: 0.25rem; font-size: 0.75em; }
.credit { color: #a61b1b; }
.tag { display: inline-block; font-size: 0.75rem; padding: 0 0.4rem; border: 1px solid #5a6472; border-radius: 3px; color: #1c2430; background: #fff; }
.tag-credit { border-color: #a61b1b; color: #a61b1b; }
/* Phase 11: the tab strip at the top of the Tanks pages. */
.subnav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0 0 1rem; border-bottom: 1px solid #d8dde4; }
.subnav a { color: var(--brand-primary); font-weight: 600; text-decoration: none; padding: 0.35rem 0; border-bottom: 3px solid transparent; }
.subnav a:hover, .subnav a[aria-current="page"] { border-bottom-color: var(--brand-primary); }

.filters { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: flex-end; margin: 0 0 1rem; }
.filters .field { margin: 0; }
.filters select, .filters input[type="date"], .filters input[type="text"] { padding: 0.45rem; font: inherit; border: 1px solid #8a94a3; border-radius: 4px; background: #fff; color: var(--text); max-width: 100%; }
/* Multi-select filter: a details panel of checkboxes (works without script; multi-select.js adds the summary and a filter box). */
.filters .field-label { margin-bottom: 0.25rem; }
.multi-select { position: relative; }
.multi-select > summary { display: flex; align-items: center; box-sizing: border-box; min-height: 2.7rem; list-style: none; cursor: pointer; padding: 0.45rem 1.75rem 0.45rem 0.45rem; min-width: 11rem; max-width: 16rem; font: inherit; border: 1px solid #8a94a3; border-radius: 4px; background: #fff; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; }
.multi-select > summary::-webkit-details-marker { display: none; }
.multi-select-text { overflow: hidden; text-overflow: ellipsis; }   /* the summary is a flex row (same height as the date boxes) */
.multi-select > summary::after { content: ""; position: absolute; right: 0.6rem; top: 50%; width: 0.4rem; height: 0.4rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-70%) rotate(45deg); }
.multi-select[open] > summary::after { transform: translateY(-30%) rotate(-135deg); }
.multi-select-panel { position: absolute; z-index: 20; top: 100%; left: 0; margin-top: 2px; min-width: 16rem; max-width: 22rem; max-height: 20rem; overflow-y: auto; padding: 0.5rem; background: #fff; border: 1px solid #8a94a3; border-radius: 4px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }
.multi-select-tools { display: flex; gap: 0.5rem; margin: 0 0 0.5rem; }
.multi-select-tools[hidden], .multi-select-none[hidden], .multi-select-list li[hidden] { display: none; }
.multi-select-tools input[type="search"] { flex: 1; min-width: 0; padding: 0.35rem; font: inherit; border: 1px solid #8a94a3; border-radius: 4px; }
.multi-select-list { list-style: none; margin: 0; padding: 0; }
.filters .multi-select-list label.check { display: flex; gap: 0.5rem; align-items: baseline; font-weight: normal; margin: 0; padding: 0.2rem 0; cursor: pointer; }
.actions-line { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.pager { display: flex; gap: 1rem; align-items: center; margin: 0 0 1rem; }

.totals { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0 0 1.5rem; }
.totals > div { background: #fff; border: 1px solid #d8dde4; border-radius: 6px; padding: 0.75rem 1.25rem; min-width: 12rem; }
.totals dt { font-size: 0.875rem; color: #5a6472; }
.totals dd { margin: 0; font-size: 1.5rem; font-weight: 600; }
.details { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; margin: 0 0 1rem; }
.details dt { font-size: 0.875rem; color: #5a6472; }
.details dd { margin: 0; font-weight: 600; }

.chart { display: block; width: 100%; max-width: 48rem; height: auto; background: #fff; border: 1px solid #d8dde4; border-radius: 6px; margin: 0 0 1rem; }
.chart-bar { fill: var(--brand-primary); }
.chart-axis { stroke: #5a6472; stroke-width: 1; }
.chart-value, .chart-label { fill: var(--text); font-size: 11px; }

/* Phase 8: tank tiles, the level bar (an SVG, so no inline style is needed), state badges and the level chart. */
.tank-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1rem; margin: 0 0 1.5rem; }
.tank-tiles-single { grid-template-columns: minmax(16rem, 24rem); }
.tank-tile { background: #fff; border: 1px solid #d8dde4; border-left-width: 6px; border-radius: 6px; padding: 0.75rem 1rem; }
.tank-tile h3 { margin: 0; font-size: 1.05rem; }
/* The tank name is the link; its ::after covers the tile, so a click anywhere on the tile opens the tank. */
.tank-tile-link { position: relative; }
.tank-tile-link:hover { border-color: var(--brand-primary); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }
.tank-open { color: inherit; text-decoration: none; }
.tank-open::after { content: ""; position: absolute; inset: 0; }
.tank-open:hover, .tank-open:focus-visible { text-decoration: underline; }
.tank-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.tank-level { margin: 0.5rem 0 0.25rem; display: flex; justify-content: space-between; align-items: baseline; }
.tank-litres { font-size: 1.4rem; font-weight: 600; }
.tank-percent { font-weight: 600; }
.tank-bar { display: block; width: 100%; height: 0.75rem; margin: 0 0 0.5rem; }
.tank-bar-track { fill: #e3e7ec; }
.tank-bar-fill { fill: var(--brand-primary); }
.tank-facts { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin: 0 0 0.5rem; }
.tank-facts dt { font-size: 0.8rem; color: #5a6472; }
.tank-facts dd { margin: 0; font-weight: 600; }
.tank-asat { margin: 0; font-size: 0.85rem; }
.tank-low { border-left-color: #b26a00; }
.tank-low .tank-bar-fill { fill: #b26a00; }
.tank-high { border-left-color: #6a3fa0; }
.tank-high .tank-bar-fill { fill: #6a3fa0; }
.tank-offline { border-left-color: #5a6472; background: #f1f2f4; }
.tank-offline .tank-bar-fill { fill: #8a94a3; }
.tag-tank-low { border-color: #b26a00; background: #fff6e0; color: #5c4400; font-weight: 600; }
.tag-tank-high { border-color: #6a3fa0; background: #f0e9f8; color: #3d2160; font-weight: 600; }
.tag-tank-offline { border-color: #5a6472; background: #5a6472; color: #fff; font-weight: 600; }
.tank-panel { margin: 0 0 1.5rem; }
.tank-list { list-style: none; padding: 0; margin: 0 0 0.5rem; }
.tank-list li { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: baseline; padding: 0.25rem 0; border-bottom: 1px solid #e3e7ec; }
.tank-list-percent { font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-line { fill: none; stroke: var(--brand-primary); stroke-width: 2; stroke-linejoin: round; }
.chart-grid { stroke: #d8dde4; stroke-width: 1; }
.chart-point { fill: #fff; stroke: var(--brand-primary); stroke-width: 2; }
.chart-point-delivery { fill: var(--brand-primary); }

.legal { max-width: 48rem; }
.legal h2 { margin-top: 1.75rem; }
.legal h3 { margin-top: 1.25rem; }
.legal-table-wrap { overflow-x: auto; margin: 0 0 1rem; }
.legal-table { border-collapse: collapse; width: 100%; min-width: 30rem; }
.legal-table th, .legal-table td { border: 1px solid #d8dde4; padding: 0.4rem 0.6rem; text-align: left; vertical-align: top; }
.legal-table th { background: #f3f5f8; }

/* Phase 10: card request form, review and history. */
.request-form { max-width: 40rem; }
.request-group { border: 1px solid #d8dde4; border-radius: 6px; background: #fff; padding: 0.75rem 1rem; margin: 0 0 1rem; }
.request-group > legend { font-weight: 600; padding: 0 0.5rem; }
fieldset.field { border: 0; padding: 0; margin: 0 0 1rem; }
fieldset.field > legend { font-weight: 600; padding: 0; margin-bottom: 0.25rem; }
.field select, .field textarea { width: 100%; max-width: 100%; padding: 0.5rem; font: inherit; border: 1px solid #8a94a3; border-radius: 4px; }
.field input[type="date"] { padding: 0.5rem; font: inherit; border: 1px solid #8a94a3; border-radius: 4px; }
.field label.check { font-weight: normal; display: block; margin: 0.15rem 0; }
.field-label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.readonly-value { margin: 0 0 0.15rem; padding: 0.5rem; background: #eef1f5; border-radius: 4px; }
.field-error { display: block; color: #7a1515; font-weight: 600; margin-top: 0.25rem; }
.review { max-width: 40rem; flex-direction: column; }
.history { margin: 0.5rem 0 0; padding-left: 1.25rem; }
.history-note { display: block; font-style: italic; }
td details summary { cursor: pointer; }

@media screen and (max-width: 48rem) {
  .table-wrap { overflow-x: visible; background: transparent; border: 0; }
  table.data, table.data tbody, table.data tfoot, table.data tr, table.data th, table.data td { display: block; }
  table.data caption { display: block; }
  table.data thead { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  table.data tbody tr, table.data tfoot tr { background: #fff; border: 1px solid #d8dde4; border-radius: 6px; padding: 0.5rem 0.75rem; margin: 0 0 0.75rem; }
  table.data th, table.data td { border: 0; padding: 0.15rem 0; }
  table.data td { display: grid; grid-template-columns: 7rem 1fr; gap: 0 0.75rem; text-align: right; }
  table.data td::before { content: attr(data-label); font-weight: 600; text-align: left; }
  table.data td:empty { display: none; }
  table.data td.num { text-align: right; white-space: normal; }
  table.data td.nowrap { white-space: normal; }
  table.data td.col-site, table.data td.col-product { min-width: 0; }
  table.data tfoot th, table.data tfoot td { border: 0; }
  table.data tfoot th { padding-bottom: 0.25rem; }
}

@media print {
  .site-header, .main-nav, .filters, .pager, .skip-link, .actions-line .button, .site-footer { display: none; }
  body { background: #fff; }
  .site-main { margin: 0; max-width: none; }
  .table-wrap { overflow: visible; border: 0; }
}

/* Card preview (artwork 2000x1262, Tropic only). Sizes are in cqw so the text scales with the card. */
.card-preview { margin: 0 0 1.25rem; max-width: 30rem; }
.card-art { position: relative; width: 100%; aspect-ratio: 2000 / 1262; container-type: inline-size; background: url('/brand/tropic-card.webp') center / 100% 100% no-repeat;
  font-family: "OCR A Std", "OCR-A", Consolas, "Courier New", monospace; color: #fff; text-transform: uppercase; white-space: nowrap;
  /* Embossed white text (owner's choice, 28 Oct 2026), readable over the photo. */
  text-shadow: -1px -1px 1px rgba(0, 0, 0, 0.8), 1px 1px 1px rgba(255, 255, 255, 0.3), 0 2px 3px rgba(0, 0, 0, 0.6); }
.card-art span { position: absolute; left: 6%; line-height: 1; overflow: hidden; max-width: 88%; }
.card-number { top: 53%; font-size: 6.2cqw; letter-spacing: 0.06em; }
.card-line { font-size: 4.4cqw; letter-spacing: 0.05em; }
.card-line-1 { top: 66%; }
.card-line-2 { top: 75%; }
.card-line-3 { top: 84%; }
.card-art .card-expiry { left: auto; right: 7%; top: 82%; font-size: 6cqw; }

/* Phase 12: the invite form's permission tick boxes sit beside their labels. */
fieldset.field > p > label { display: inline; font-weight: normal; }
