:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #1d2733;
  --muted: #5f6b78;
  --line: #dde2e8;
  --brand: #0f4c75;
  --brand-ink: #ffffff;
  --accent: #1b7fbd;
  --ok: #1e7b45;
  --ok-bg: #e5f4ea;
  --warn: #8a5a00;
  --warn-bg: #fff4d9;
  --bad: #b3261e;
  --bad-bg: #fce8e6;
  --radius: 8px;
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
.muted { color: var(--muted); }
.small { font-size: .87rem; }
.mono { font-family: Consolas, "Cascadia Mono", monospace; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* Top bar */
.topbar {
  background: var(--brand);
  color: var(--brand-ink);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 1.25rem;
  min-height: 54px;
  flex-wrap: wrap;
}
.topbar .brand { display: flex; align-items: center; padding: .35rem 0; }
.topbar .brand img { height: 50px; width: auto; display: block; }
.role-badge { background: rgba(255,255,255,.18); padding: .1rem .5rem; border-radius: 999px; font-size: .78rem; margin-left: .25rem; }

/* Main menu: plain links plus drop-down groups (<details>) */
.mainnav { display: flex; align-items: center; gap: .2rem; flex: 1; }
.nav-item, .nav-group > summary {
  color: #d6e6f2; padding: .45rem .75rem; border-radius: 6px; cursor: pointer;
  white-space: nowrap; list-style: none; user-select: none;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after { content: "▾"; font-size: .7em; margin-left: .35rem; opacity: .75; }
.nav-item:hover, .nav-group > summary:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.nav-item.active, .nav-group.active > summary, .nav-group[open] > summary { background: rgba(255,255,255,.2); color: #fff; }
.nav-group { position: relative; }
.nav-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; min-width: 210px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(15, 40, 70, .18);
  padding: .35rem;
}
.nav-menu-right { left: auto; right: 0; }
.nav-menu a, .nav-menu button {
  display: block; width: 100%; text-align: left; padding: .5rem .7rem; border-radius: 5px;
  color: var(--ink); background: none; border: none; font: inherit; cursor: pointer; white-space: nowrap;
}
.nav-menu a:hover, .nav-menu button:hover { background: #eef3f8; text-decoration: none; }
.nav-menu form { margin: 0; border-top: 1px solid var(--line); margin-top: .3rem; padding-top: .3rem; }
.nav-user { margin-left: auto; }
.nav-user > summary { font-size: .92rem; }
.menu-toggle { display: none; }

@media (max-width: 900px) {
  .topbar { gap: .5rem; padding: .4rem .9rem; }
  .menu-toggle {
    display: block; margin-left: auto; background: none; color: #fff; font: inherit;
    border: 1px solid rgba(255,255,255,.4); border-radius: 6px; padding: .4rem .8rem; cursor: pointer;
  }
  .mainnav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; padding-bottom: .5rem; }
  .topbar.nav-open .mainnav { display: flex; }
  .nav-user { margin-left: 0; }
  .nav-menu, .nav-menu-right { position: static; box-shadow: none; border: none; background: rgba(255,255,255,.08); margin: .2rem 0 .4rem; }
  .nav-menu a, .nav-menu button { color: #fff; }
  .nav-menu a:hover, .nav-menu button:hover { background: rgba(255,255,255,.12); }
  .nav-menu form { border-top-color: rgba(255,255,255,.2); }
}

main { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.crumbs { font-size: .87rem; color: var(--muted); margin-bottom: .25rem; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; }
.panel > h2:first-child { margin-top: 0; }
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.stat .n { font-size: 1.8rem; font-weight: 700; }
.stat .l { color: var(--muted); font-size: .9rem; }
.stat a { color: inherit; }

/* Buttons */
.btn, button.btn {
  display: inline-block; border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: .45rem .9rem; border-radius: 6px; cursor: pointer; font: inherit; font-size: .93rem;
}
.btn:hover { background: #f0f3f6; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #166a9e; }
.btn.primary.saved, .btn.primary.saved:hover { background: var(--ok); border-color: var(--ok); }
.btn.danger { color: var(--bad); border-color: #efc2be; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.small { padding: .2rem .55rem; font-size: .83rem; }
.btn.armed, .btn.armed:hover { background: var(--bad); border-color: var(--bad); color: #fff; }
form.inline { display: inline; margin: 0; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: #f8fafb; }
tr:hover td { background: #fafcfd; }
td.num, th.num { text-align: right; white-space: nowrap; }
.empty { color: var(--muted); padding: 1rem .7rem; font-style: italic; }

/* Key/value details */
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.25rem; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }

/* Tags */
.tag { display: inline-block; padding: .08rem .5rem; border-radius: 999px; font-size: .8rem; background: #eef1f4; color: var(--muted); }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }
.tag.info { background: #e3f0f9; color: #155a86; }

/* Filters bar */
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.filters input[type=search], .filters select { width: auto; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff; }
.filters input[type=search] { min-width: 240px; }

/* Forms */
.form-panel { max-width: 720px; }
.form-panel div:has(> label) , .field { margin-bottom: 1rem; }
form label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .93rem; }
input[type=text], input[type=number], input[type=date], input[type=password], input[type=file], select, textarea {
  width: 100%; padding: .5rem .6rem; border: 1px solid #c9d1da; border-radius: 6px; font: inherit; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #9cc9e8; border-color: var(--accent); }
input[type=checkbox] { width: 1.1rem; height: 1.1rem; vertical-align: middle; }
div:has(> input[type=checkbox]) { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
div:has(> input[type=checkbox]) > label { margin: 0; order: 2; }
div:has(> input[type=checkbox]) > input { order: 1; }
div:has(> input[type=checkbox]) > .helptext { order: 3; flex-basis: 100%; }
.helptext { display: block; color: var(--muted); font-size: .85rem; margin-top: .25rem; font-weight: normal; }
ul.errorlist { list-style: none; margin: .25rem 0; padding: 0; color: var(--bad); font-size: .88rem; }
ul.errorlist.nonfield { background: var(--bad-bg); padding: .6rem .8rem; border-radius: 6px; }
.form-actions { display: flex; gap: .5rem; margin-top: 1.25rem; }
.inline-form { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; }
.inline-form > div { margin: 0; }
.inline-form input, .inline-form select { width: auto; }

/* Messages */
.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li { padding: .7rem 1rem; border-radius: 6px; margin-bottom: .5rem; border: 1px solid transparent; }
.messages .success { background: var(--ok-bg); color: var(--ok); border-color: #bfe3cb; }
.messages .error { background: var(--bad-bg); color: var(--bad); border-color: #f2c4bf; }
.messages .info, .messages .warning { background: var(--warn-bg); color: var(--warn); }

.notice { background: #eef6fc; border: 1px solid #cfe4f3; color: #174e74; padding: .7rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: .92rem; }

/* Pagination */
.pager { display: flex; gap: .5rem; align-items: center; margin-top: 1rem; font-size: .92rem; }

/* Login */
.login-wrap { max-width: 380px; margin: 8vh auto; }
.login-wrap .brand { text-align: center; margin-bottom: 1.25rem; }
.login-wrap .brand img { width: 100%; max-width: 340px; height: auto; }
.login-wrap .brand div { color: var(--muted); margin-top: .35rem; }

details summary { cursor: pointer; color: var(--accent); }
.center { text-align: center; }
hr { border: none; border-top: 1px solid var(--line); margin: 1.25rem 0; }

/* Multi-column form layout */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 1.25rem; }
.form-grid .span-all { grid-column: 1 / -1; }

/* Tables with inputs in the cells */
.entry-table td { padding: .35rem .4rem; }
.entry-table input[type=text], .entry-table input[type=number] { padding: .35rem .45rem; min-width: 6rem; }
.entry-table tr:hover td { background: transparent; }
.shock-table input { max-width: 8rem; }
.shock-summary td, .shock-summary th { padding: .3rem .5rem; }

.swatch-inline { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; }

/* Dashboard: fleet status */
.fleet-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.group-toggle { margin: 0 0 0 auto; }
.group-toggle label { display: inline-flex; gap: .4rem; align-items: center; margin: 0; font-weight: normal; cursor: pointer; }
.group-toggle input[type=checkbox] { width: 1rem; height: 1rem; }
.fleet-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin: .1rem 0 1rem; font-size: .9rem; color: var(--muted); }
.fleet-key { display: inline-flex; align-items: center; gap: .4rem; }
.fleet-seg-name { font-weight: 500; opacity: .92; margin-right: .4rem; white-space: nowrap; overflow: hidden; }
.fleet-chart { display: grid; gap: .55rem; }
.fleet-row { display: grid; grid-template-columns: minmax(120px, 190px) 1fr 110px; align-items: center; gap: .9rem; }
.fleet-label { display: flex; flex-direction: column; line-height: 1.25; }
.fleet-label a { color: var(--ink); font-weight: 600; }
.fleet-track { position: relative; height: 26px; }
.fleet-grid { position: absolute; top: -4px; bottom: -4px; width: 1px; background: #e8e6df; }
.fleet-bar { position: relative; display: flex; gap: 2px; height: 100%; }
.fleet-seg { position: relative; display: flex; align-items: center; justify-content: center; min-width: 4px;
  color: #fff; font-size: .82rem; font-weight: 600; font-variant-numeric: tabular-nums; overflow: visible; }
.fleet-seg:last-child { border-radius: 0 4px 4px 0; }
.fleet-seg:hover { text-decoration: none; filter: brightness(1.08); }
.fleet-seg:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: #1d2733; color: #fff; font-weight: 500; font-size: .82rem; padding: .3rem .55rem; border-radius: 5px; white-space: nowrap; z-index: 5; pointer-events: none; }
.fleet-avail { font-size: 1.05rem; white-space: nowrap; }
.fleet-axis .fleet-track { height: 14px; }
.fleet-tick { position: absolute; transform: translateX(-50%); font-size: .75rem; color: #898781; font-variant-numeric: tabular-nums; }
.fleet-table { margin-top: 1rem; }
.avail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem 1.5rem; }
.avail-group h3 { margin: 0 0 .35rem; display: flex; align-items: center; gap: .5rem; }
@media (max-width: 640px) {
  .fleet-row { grid-template-columns: 1fr; gap: .3rem; }
  .fleet-axis { display: none; }
}

/* Reports */
.report-card { display: block; color: var(--ink); }
.report-card:hover { text-decoration: none; border-color: var(--accent); }
.report-card h2 { color: var(--accent); }
.cell-bar { position: relative; display: flex; align-items: center; gap: .5rem; font-variant-numeric: tabular-nums; }
.cell-bar span { display: block; height: 12px; min-width: 2px; background: #2a78d6; border-radius: 0 4px 4px 0; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; flex-wrap: wrap; }
.tab { padding: .5rem .9rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }

/* History timeline */
.timeline-item { border-left: 4px solid var(--accent); }
.timeline-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.timeline-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem 2rem; }
table.compact td, table.compact th { padding: .3rem .4rem; font-size: .9rem; }
.summary-table td, .summary-table th { padding: .35rem .6rem; }

/* Photos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.photo-grid figure { margin: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fafbfc; }
.photo-grid img { width: 100%; height: 150px; object-fit: cover; display: block; }
.photo-grid figcaption { padding: .5rem .6rem; font-size: .88rem; }

@media (max-width: 640px) {
  .topbar { gap: .5rem; padding: .5rem .75rem; }
  .filters input[type=search] { min-width: 0; width: 100%; }
  dl.kv { grid-template-columns: 1fr; }
  dl.kv dt { margin-top: .4rem; }
}

/* Shipping */
.ship-ends { margin-bottom: 1rem; gap: 1rem 2rem; }
.ship-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .2rem; }
.ship-notes { margin-top: 1rem; }
.tool-checks ul { list-style: none; margin: 0; padding: 0; columns: 2 320px; }
.tool-checks li { margin: 0 0 .35rem; break-inside: avoid; }
.tool-checks label { font-weight: normal; display: flex; gap: .5rem; align-items: center; margin: 0; }
.tool-checks input { width: 1.1rem; height: 1.1rem; }

/* Users & roles */
.roles-table th:not(:first-child), .roles-table td:not(:first-child) { text-align: center; white-space: nowrap; }
.temp-login { background: #f8fafc; border: 1px solid var(--line); border-radius: 6px; padding: .9rem 1rem; margin: 1rem 0; }
.temp-login dd { font-size: 1.15rem; }

/* Build sheet */
.build-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #6795cf; padding-bottom: .6rem; margin-bottom: 1rem; }
.build-head img { height: 48px; width: auto; }
.build-head > div { text-align: right; }
.build-title { font-size: 1.3rem; font-weight: 700; color: #375571; letter-spacing: .04em; }
.build-kv { margin-bottom: 1.25rem; }
.build-table tr.build-off td { background: #fff6e5; }
.build-table tr.ship-group td { background: #eef3f9; border-top: 1px solid var(--line); }
.build-table th.check, .build-table td.check { width: 2.5rem; text-align: center; }
.build-table .box { display: inline-block; width: 14px; height: 14px; border: 1.5px solid #5f6b78; border-radius: 2px; }
.signature-row { display: grid; grid-template-columns: 2fr 1fr 2fr; gap: 2rem; margin-top: 2.5rem; }
.signature-row div { border-top: 1px solid #5f6b78; padding-top: .3rem; }
.signature-row span { font-size: .85rem; color: var(--muted); }

/* Field reports */
.tag.stage-prerun { background: #eef1f4; color: var(--muted); }
.tag.stage-in_hole { background: #e3f0f9; color: #155a86; }
.tag.stage-complete, .tag.stage-out { background: var(--ok-bg); color: var(--ok); }
.who-bar { display: flex; flex-wrap: wrap; gap: .5rem .6rem; align-items: center; background: #f4f6f9; border: 1px solid var(--line);
  border-radius: 6px; padding: .45rem .8rem; margin: 0 0 1rem; font-size: .9rem; }
.who-bar .who-label { color: var(--muted); }
.who-bar select, .who-bar input[type=text] { width: auto; padding: .25rem .4rem; }
ul.due-list { list-style: none; margin: 0; padding: 0; }
ul.due-list li { padding: .4rem .7rem; margin: 0 0 .35rem; border-left: 4px solid #6795cf; background: #f4f8fd; border-radius: 0 6px 6px 0; }
ul.due-list li.late { border-left-color: var(--bad); background: var(--bad-bg); }
.check-yes { color: var(--ok); font-weight: 700; }
.quick-upload { display: inline-block; }
.quick-upload input[type=file] { width: auto; font-size: .82rem; padding: 0; border: none; background: none; }
.checklist-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .5rem 2rem; }
.checklist-stage h3 { margin: .2rem 0 .5rem; font-size: 1rem; }
ul.checks { list-style: none; margin: 0; padding: 0; }
ul.checks li { margin: 0 0 .3rem; display: flex; gap: .45rem; align-items: baseline; }
ul.checks.inline { display: flex; flex-wrap: wrap; gap: .3rem 1.5rem; }
ul.checks .box { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 1rem; height: 1rem;
  border: 1.5px solid #9aa6b2; border-radius: 3px; font-size: .75rem; line-height: 1; }
ul.checks li.done .box { background: var(--ok); border-color: var(--ok); color: #fff; }
ul.checks li:not(.done) { color: var(--muted); }
.file-chip { display: inline-flex; gap: .35rem; align-items: center; background: #f4f6f9; border: 1px solid var(--line);
  border-radius: 999px; padding: .1rem .6rem; margin: 0 .35rem .3rem 0; font-size: .88rem; }
.linklike { background: none; border: none; padding: 0 .1rem; color: var(--muted); cursor: pointer; font: inherit; }
.linklike:hover { color: var(--bad); }
.linklike.armed { color: #fff; background: var(--bad); border-radius: 4px; padding: 0 .3rem; }
.upload-row { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: flex-end; margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.upload-row .field { margin: 0; }
.files-table h3 { margin-top: 1rem; }
.tag-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.tool-tag { border: 2px solid; border-radius: 8px; overflow: hidden; background: #fff; break-inside: avoid; page-break-inside: avoid; }
.tool-tag .tag-band { padding: .3rem .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: .8rem; }
.tool-tag .tag-serial { font-size: 1.35rem; font-weight: 700; padding: .45rem .7rem 0; }
.tool-tag .tag-type { padding: 0 .7rem .35rem; color: var(--muted); font-size: .9rem; }
.tool-tag dl { display: grid; grid-template-columns: max-content 1fr; gap: .15rem .8rem; margin: 0; padding: .4rem .7rem .7rem; font-size: .9rem; }
.tool-tag dt { color: var(--muted); }
.tool-tag dd { margin: 0; }
.tool-tag.tag-green { border-color: #1e7b45; } .tool-tag.tag-green .tag-band { background: #1e7b45; color: #fff; }
.tool-tag.tag-yellow { border-color: #d4a106; } .tool-tag.tag-yellow .tag-band { background: #f5c518; color: #3d2e00; }
.tool-tag.tag-red { border-color: #b3261e; } .tool-tag.tag-red .tag-band { background: #b3261e; color: #fff; }

@media print {
  .tool-tag .tag-band { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tag-sheet { grid-template-columns: repeat(3, 1fr); }
  .topbar, .actions, .filters, .pager, form, .no-print, .messages { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .panel { border: none; padding: 0; }
  tr:hover td { background: none; }
}

/* ---- Field calculators (poppet / orifice, magnetic spacing). The markup is
   generated from field_utilities/nexus-field-calculators.html; these rules
   are the same look, kept inside .calc so nothing else is affected. ---- */
.hide { display: none !important; }
.calc { --navy: #375571; --blue: #6795cf; --light: #eef3f9; --ok-bg: #e3f4ea; --warn-bg: #fdf3d8; --bad-bg: #fbe7e5; }
.calc .cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }
.calc .cols.wide-right { grid-template-columns: minmax(0, 5fr) minmax(0, 8fr); }
@media (max-width: 820px) { .calc .cols, .calc .cols.wide-right { grid-template-columns: 1fr; } }
.calc .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .6rem 1.1rem; }
.calc label { display: block; font-size: .84rem; font-weight: 600; margin-bottom: .15rem; }
.calc input, .calc select { width: 100%; }
.calc input[type=checkbox], .calc input[type=radio] { width: auto; }
.calc .unit { font-weight: 400; color: var(--muted); }
.calc .result { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--light); }
.calc .result:last-child { border-bottom: 0; }
.calc .result b.big { font-size: 1.5rem; }
.calc table { border-collapse: collapse; width: 100%; font-size: .86rem; }
.calc th, .calc td { border: 1px solid var(--line); padding: .28rem .4rem; text-align: right; }
.calc th { background: var(--light); font-weight: 600; }
.calc td.l, .calc th.l { text-align: left; }
.calc tr:hover td { background: transparent; }
.calc .matrix td { cursor: pointer; }
.calc .matrix td.in { background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.calc .matrix td.na { background: #f2f2f2; color: #aaa; cursor: default; }
.calc .matrix td.sel, .calc .matrix th.sel { outline: 2px solid var(--navy); outline-offset: -2px; }
.calc .matrix th.fleet { background: var(--navy); color: #fff; }
.calc .matrix td.other, .calc .matrix th.other { color: #9aa5b1; font-weight: 400; }
.calc .matrix td.other.in { background: #f3faf6; color: #7fae93; font-weight: 400; }
.calc .key { display: inline-block; width: .9rem; height: .9rem; vertical-align: -2px; border: 1px solid var(--line); border-radius: 3px; }
.calc .picks { display: flex; flex-wrap: wrap; gap: .4rem; margin: .2rem 0 .8rem; }
.calc .picks button { border: 1px solid #9fd3b5; background: var(--ok-bg); color: var(--ok); border-radius: 999px; padding: .25rem .7rem; font: inherit; font-weight: 600; cursor: pointer; }
.calc .bha { table-layout: fixed; }
.calc .bha td { text-align: left; padding: .22rem .25rem; }
.calc .bha th { padding: .28rem .3rem; }
.calc .bha input, .calc .bha select { padding: .28rem .4rem; min-width: 0; }
.calc .bha .del { padding: .15rem .4rem; }
.calc .bha .grip { border: 1px solid #aab6c3; background: #f4f6f9; border-radius: 5px; padding: .15rem .45rem; font: inherit; cursor: grab; touch-action: none; color: var(--navy); }
.calc .bha.locked .grip, .calc .bha.locked .del { visibility: hidden; }
.calc .bha tr.dragging td { background: #fff7d6; }
.calc .bha tr.drop-before td { border-top: 3px solid var(--blue); }
.calc .bha tr.drop-after td { border-bottom: 3px solid var(--blue); }
body.reordering, body.reordering * { cursor: grabbing !important; user-select: none; }
.calc details summary { cursor: pointer; color: var(--navy); font-weight: 600; }
.calc-tabs .btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
@media print { .noprint, .who-bar, .topbar { display: none !important; } }

/* Drag-to-reorder rows on an entry table (the run form's BHA): the same look as the calculators. */
.entry-table .grip { border: 1px solid #aab6c3; background: #f4f6f9; border-radius: 5px; padding: .15rem .45rem; font: inherit; cursor: grab; touch-action: none; color: #375571; }
.entry-table tr.dragging td { background: #fff7d6; }
.entry-table tr.drop-before td { border-top: 3px solid #6795cf; }
.entry-table tr.drop-after td { border-bottom: 3px solid #6795cf; }

/* The app's short name beside the logo (settings.APP_TAG), when it has one. */
.topbar .brand .app-name { color: #fff; font-weight: 700; font-size: 1.35rem; letter-spacing: .02em; margin-left: .45rem; opacity: .95; }
.login-wrap .brand div.app-name { color: var(--brand); font-weight: 700; font-size: 1.5rem; margin-top: .5rem; }
/* The strip across the top of a test site, so nobody mistakes it for the real one. */
.site-label { background: #b45309; color: #fff; text-align: center; font-weight: 600; padding: .3rem .75rem; font-size: .9rem; }
@media print { .site-label { display: none; } }
