/* BeatO Partnership management interface.
   No JavaScript and no inline styles (the content-security policy forbids both), so everything
   interactive here is plain HTML: links, forms, <details>, and CSS :has() for showing the
   settings that go with a chosen option. */

/* ------------------------------------------------------------------ tokens */
:root {
  /* BeatO's colours, as in the app (app/src/beato/.../brand/Brand.kt). The logo's teal is #07A1A9;
     buttons and links use the darker #00767C so that white text on them stays readable. */
  --bg: #f4f8f8;
  --surface: #ffffff;
  --surface-2: #f7fafa;
  --surface-3: #ecf2f2;
  --line: #dae4e5;
  --line-strong: #bccacb;
  --ink: #181c1d;
  --ink-2: #3f4949;
  --muted: #5d6b6c;
  --brand: #00767c;
  --brand-ink: #005a5f;
  --brand-soft: #e1f4f5;
  --brand-logo: #07a1a9;
  --accent: #fcda04;
  --on-brand: #ffffff;
  --ok: #17753a;
  --ok-soft: #e6f5ea;
  --warn: #7a5a00;
  --warn-soft: #fff6cc;
  --danger: #ba1a1a;
  --danger-ink: #93000a;
  --danger-soft: #fdeceb;
  --info: #00767c;
  --info-soft: #e1f4f5;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(24, 28, 29, .05), 0 1px 3px rgba(24, 28, 29, .06);
  --focus: 0 0 0 3px rgba(0, 118, 124, .28);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: only light;   /* one theme, by design: the interface does not follow the device's dark mode */
}

/* -------------------------------------------------------------------- base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14.5px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 15.5px; font-weight: 650; }
h3 { font-size: 13.5px; font-weight: 650; }
p { margin: 0 0 12px; }
ul, ol { margin: 0 0 12px; padding-left: 20px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.icon { width: 18px; height: 18px; flex: none; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 8px; }

/* ------------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--surface); color: var(--ink-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 12px 14px; position: sticky; top: 0; height: 100vh; }
.brand { display: block; padding: 2px 8px 16px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { display: block; height: 30px; width: auto; }
.brand-sub { display: block; margin-top: 6px; font-size: 11.5px; font-weight: 650; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side .nav-label { font-size: 11px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 16px 10px 6px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 550; }
.side nav a .icon { color: var(--muted); }
.side nav a:hover { background: var(--surface-3); text-decoration: none; color: var(--ink); }
.side nav a.on { background: var(--brand-soft); color: var(--brand-ink); box-shadow: inset 3px 0 0 var(--accent); }
.side nav a.on .icon { color: var(--brand); }
.side nav a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 8px 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 650; font-size: 13px; flex: none; text-transform: uppercase; }
.me-name { color: var(--ink); font-weight: 600; font-size: 13.5px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-role { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot a, .side-foot button.navlink { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); background: none; border: 0; font: inherit; font-weight: 550; cursor: pointer; text-align: left; margin: 0; }
.side-foot a .icon, .side-foot button.navlink .icon { color: var(--muted); }
.side-foot button.navlink { justify-content: flex-start; min-height: 0; white-space: normal; }
.side-foot form { margin: 0; }
.side-foot a:hover, .side-foot button.navlink:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.main { min-width: 0; }
.content { max-width: 1160px; margin: 0 auto; padding: 26px 32px 56px; }

/* ------------------------------------------------------------- page header */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); }
.crumbs .icon { width: 13px; height: 13px; opacity: .7; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 20px; margin-bottom: 20px; }
.page-head .sub { color: var(--muted); margin: 4px 0 0; max-width: 72ch; }
.page-head .actions { margin: 0; }
.title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -4px 0 22px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: flex; align-items: center; gap: 8px; padding: 10px 14px; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }
.tabs .icon { width: 16px; height: 16px; }
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 18px; }
.jump a { font-size: 13px; padding: 4px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); }
.jump a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }

/* ------------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.card-head .sub { color: var(--muted); font-size: 13px; margin: 3px 0 0; font-weight: 400; }
.card-body { padding: 20px; }
.card-body > :last-child { margin-bottom: 0; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); color: var(--muted); font-size: 13px; }
.card.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.card.attention { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 16px 18px; }
.grid.tight { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.cols-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); gap: 16px; margin-bottom: 20px; }

/* ------------------------------------------------------------------- stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: flex; align-items: center; gap: 14px; }
.stat-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px var(--brand-soft); display: grid; place-items: center; flex: none; }
.stat-icon .icon { width: 20px; height: 20px; }
.stat b { display: block; font-size: 24px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; }

/* summary tiles on the integrations page */
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.tile-head { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 8px; }
.tile-head .icon { width: 16px; height: 16px; }
.tile-value { font-weight: 650; font-size: 15px; margin-bottom: 6px; }
.tile p { color: var(--muted); font-size: 13px; margin: 0; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11.5px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
tbody tr:last-child td, table tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.actions-cell { text-align: right; white-space: nowrap; }
tr.off td { color: var(--muted); }
td.primary a { font-weight: 600; }
td .sub { display: block; color: var(--muted); font-size: 12.5px; }
.empty { text-align: center; padding: 38px 20px; color: var(--muted); }
.empty .icon { width: 30px; height: 30px; opacity: .55; margin-bottom: 8px; }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 3px; }
.empty p { margin: 0 auto; max-width: 52ch; }

/* ------------------------------------------------------------------ badges */
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.5; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.tag.plain::before, .tag.code::before { display: none; }
.tag.good { background: var(--ok-soft); color: var(--ok); }
.tag.bad { background: var(--danger-soft); color: var(--danger); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.info { background: var(--info-soft); color: var(--info); }
.tag.code { font-family: var(--mono); font-weight: 500; border-radius: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ------------------------------------------------------------------ alerts */
/* Alerts are always <div>s; badges (.tag.warn and so on) are <span>s and must not pick these up. */
div.flash, div.error, div.warn, div.note { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 18px; border: 1px solid transparent; }
div.flash .icon, div.error .icon, div.warn .icon, div.note .icon { margin-top: 1px; }
div.flash { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
div.error { background: var(--danger-soft); color: var(--danger-ink); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
div.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
div.note { background: var(--info-soft); color: var(--ink-2); border-color: color-mix(in srgb, var(--info) 20%, transparent); }
div.note .icon { color: var(--info); }
.card-body > div.flash:last-child, .card-body > div.warn:last-child, .card-body > div.note:last-child { margin-bottom: 0; }
.card-body > .grid + div.note, .card-body > .field + div.note { margin-top: 16px; }
.card-body > div.note + .grid, .card-body > div.error + .grid { margin-top: 0; }

/* ------------------------------------------------------------------- forms */
label { display: block; font-weight: 600; font-size: 13px; margin: 0 0 5px; color: var(--ink-2); }
.field { min-width: 0; }
.field + .field, .grid + .field, .field + .grid, .grid + .grid { margin-top: 16px; }
.grid > .field + .field { margin-top: 0; }
input[type=text], input[type=email], input[type=password], input[type=date], select, textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: inherit; color: var(--ink); background: var(--surface); min-height: 38px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
input:disabled, select:disabled, textarea:disabled { background-color: var(--surface-3); color: var(--muted); cursor: not-allowed; }
/* The browser's own arrow sits hard against the border and differs between browsers, so draw one. */
select { appearance: none; -webkit-appearance: none; padding-right: 34px; text-overflow: ellipsis; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%235d6b6c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px 16px; }
select:disabled { cursor: not-allowed; }
textarea { min-height: 84px; resize: vertical; }
.hint { color: var(--muted); font-size: 12.5px; margin: 5px 0 0; font-weight: 400; }
p.hint { margin-bottom: 12px; }
.check { display: flex; align-items: flex-start; gap: 9px; font-weight: 500; margin: 0; color: var(--ink); }
.check input { width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--brand); flex: none; }
.check small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; }
.form-section { padding: 20px; border-bottom: 1px solid var(--line); }
.form-section:last-of-type { border-bottom: 0; }
.form-section > h3 { margin-bottom: 4px; font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.form-section > .hint { margin-bottom: 14px; max-width: 80ch; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.form-actions .hint { margin: 0; }
.search { display: flex; gap: 10px; align-items: center; }
.search input { flex: 1; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.inline-form .field { flex: 1 1 220px; margin: 0; }

/* choices: radio buttons shown as cards */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.choice { position: relative; display: block; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 12px 14px 12px 40px; cursor: pointer; margin: 0; font-weight: 400; background: var(--surface); }
.choice input { position: absolute; left: 14px; top: 15px; width: 16px; height: 16px; accent-color: var(--brand); margin: 0; }
.choice b { display: block; color: var(--ink); font-size: 14px; }
.choice small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.choice:hover { border-color: var(--muted); }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
.choice:has(input:focus-visible) { box-shadow: var(--focus); }

/* settings that belong to one choice: shown only while that choice is selected */
.depends { margin-top: 16px; padding: 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); }
.depends > h3 { margin-bottom: 4px; }
.depends > h3:not(:first-child) { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.depends .grid + .grid, .depends .field + .grid, .depends .grid + .field { margin-top: 16px; }
@supports selector(:has(*)) {
  .depends { display: none; }
  form:has(#login_mode_PARTNER_API:checked) .depends.for-partner-login,
  form:has(#patient_mode_PARTNER_FETCH:checked) .depends.for-partner-fetch,
  form:has(#patient_mode_PARTNER_PUSH:checked) .depends.for-partner-push { display: block; }
}

/* disclosures */
details.disclosure { border-top: 1px solid var(--line); }
details.disclosure > summary { list-style: none; cursor: pointer; padding: 14px 20px; display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--brand); }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary .icon { transition: transform .15s; width: 15px; height: 15px; }
details.disclosure[open] > summary .icon.chev { transform: rotate(90deg); }
details.disclosure > summary:hover { background: var(--surface-2); }
details.disclosure > .card-body, details.disclosure > form > .card-body { border-top: 1px solid var(--line); }
details.more { margin-top: 16px; }
details.more > summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: 13.5px; }
details.more > .more-body { margin-top: 12px; }

/* ----------------------------------------------------------------- buttons */
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 15px; min-height: 38px; border: 1px solid var(--brand); border-radius: var(--radius-sm); background: var(--brand); color: var(--on-brand); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
button:hover, .button:hover { background: var(--brand-ink); border-color: var(--brand-ink); text-decoration: none; }
button .icon, .button .icon { width: 16px; height: 16px; }
button.secondary, .button.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
button.secondary:hover, .button.secondary:hover { background: var(--surface-2); border-color: var(--muted); }
button.danger, .button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
button.danger:hover, .button.danger:hover { background: var(--danger-ink); border-color: var(--danger-ink); }
button.danger.secondary, .button.danger.secondary { background: var(--surface); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
button.danger.secondary:hover, .button.danger.secondary:hover { background: var(--danger-soft); }
button.small, .button.small { min-height: 30px; padding: 4px 10px; font-size: 13px; }
button.link { min-height: 0; padding: 0; border: 0; background: none; color: var(--brand); font-weight: 600; }
button.link:hover { background: none; text-decoration: underline; }
button.link.danger { color: var(--danger); }
form.inline { display: inline; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.actions.end { justify-content: flex-end; }
.card-head .actions { margin: 0; }

/* -------------------------------------------------------------- key values */
dl.facts { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 0; margin: 0; }
dl.facts dt, dl.facts dd { padding: 10px 0; border-bottom: 1px solid var(--line); margin: 0; }
dl.facts dt { color: var(--muted); padding-right: 16px; }
dl.facts dd { overflow-wrap: anywhere; }
dl.facts dt:last-of-type, dl.facts dd:last-of-type { border-bottom: 0; }
.card-body.flush { padding: 4px 20px; }

.secret { font: 600 18px/1.4 var(--mono); letter-spacing: .03em; padding: 14px 16px; background: var(--surface-3); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); display: block; user-select: all; overflow-wrap: anywhere; margin: 0 0 14px; }
.qr { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); display: block; margin: 4px auto 12px; padding: 4px; }
.key-text { text-align: center; color: var(--muted); letter-spacing: .06em; margin-bottom: 18px; }
.pager { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 12px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.perm { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; padding: 11px 20px; border-bottom: 1px solid var(--line); }
.perm:last-child { border-bottom: 0; }
.perm select { width: auto; min-width: 190px; }
.perm-group { padding: 9px 20px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 11.5px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.check-list { display: grid; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.steps { display: flex; gap: 8px; align-items: center; justify-content: center; margin-bottom: 22px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.steps span { display: flex; align-items: center; gap: 7px; }
.steps i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; background: var(--surface-3); color: var(--muted); font-size: 12px; }
.steps .done i { background: var(--ok-soft); color: var(--ok); }
.steps .now { color: var(--ink); }
.steps .now i { background: var(--brand); color: var(--on-brand); box-shadow: 0 0 0 3px var(--accent); }
.steps .bar { width: 28px; height: 1px; background: var(--line-strong); }

/* --------------------------------------------------- signed-out pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: radial-gradient(1100px 520px at 50% -12%, var(--brand-soft), transparent 70%), var(--bg); }
.auth-box { width: 100%; max-width: 420px; }
.auth .card { margin-bottom: 14px; border-top: 3px solid var(--brand-logo); }
.auth .card-body { padding: 26px; }
.auth-brand { text-align: center; margin: 0 0 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.auth-brand img { height: 38px; width: auto; display: block; margin: 0 auto; }
.auth-brand .brand-sub { margin-top: 8px; }
.auth h1 { font-size: 20px; margin-bottom: 6px; }
.auth .lead { color: var(--muted); margin-bottom: 20px; }
.auth button, .auth .button { width: 100%; }
.auth button.link { width: auto; }
.auth .links { display: flex; flex-direction: column; gap: 8px; align-items: center; margin-top: 16px; font-size: 13.5px; }
.auth-foot { text-align: center; color: var(--muted); font-size: 12.5px; }
.auth.wide .auth-box { max-width: 520px; }

/* --------------------------------------------------------------- small screens */
@media (max-width: 920px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }   /* the top bar takes only the height it needs */
  .side { position: static; height: auto; padding: 10px 12px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
  .side nav { min-width: 0; }
  .page-head .sub { max-width: none; }
  .search, .inline-form { flex-wrap: wrap; }
  .form-actions { align-items: stretch; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 2px 6px; }
  .brand img { height: 24px; }
  .brand-sub, .side .nav-label, .me { display: none; }
  .side nav { flex-direction: row; overflow-x: auto; flex: 1 1 100%; order: 3; scrollbar-width: none; }
  .side nav::-webkit-scrollbar { display: none; }
  .side nav a { white-space: nowrap; padding: 7px 10px; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; display: flex; gap: 2px; }
  .side-foot a span, .side-foot button.navlink span { display: none; }
  .content { padding: 18px 16px 44px; }
  th, td { padding: 10px 14px; }
  .card-head, .card-body, .form-section, .form-actions { padding-left: 16px; padding-right: 16px; }
  dl.facts { grid-template-columns: 1fr; }
  dl.facts dt { border-bottom: 0; padding-bottom: 0; font-size: 12.5px; }
  .perm { grid-template-columns: 1fr; }
}
@media print {
  .side, .tabs, .actions, .crumbs, .jump { display: none !important; }
  .shell { display: block; }
  .card { box-shadow: none; }
  body { background: #fff; }
}
