/* Vidmerce admin dashboard. Colours are the same tokens as site.css (shared/design-tokens.json). Light theme only.
   No inline styles anywhere (CSP): everything the pages need is a class here. */

:root {
  color-scheme: light;
  --ink: #0F1724;
  --muted: #5D6878;
  --line: #E3E7EC;
  --bg: #F5F6F8;
  --surface: #FFFFFF;
  --accent: #2B57E0;
  --accent-soft: #E6ECFD;
  --accent-line: #C9D6FA;
  --money: #128A57;
  --money-soft: #E1F4EA;
  --warn: #B26A00;
  --warn-soft: #FCEFD9;
  --warn-line: #EFD3A6;
  --danger: #B4231B;
  --danger-soft: #FCE9E7;
  --danger-line: #F1C2BD;
  --track: #D5DAE1;
  --seg: #E9ECF1;
  --head: #FAFBFC;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --nav-w: 236px;
  /* text on moneySoft / warnSoft: the base tokens give 3.8:1 / 3.7:1 at 11 px, these give 5.1:1 / 4.9:1 */
  --money-ink: #0E7446;
  --warn-ink: #965A00;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body.adm {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
:where(.adm) :is(h1, h2, h3, p, ul, dl, dd, fieldset, figure) {
  margin: 0;
  padding: 0;
}
:where(.adm) ul {
  list-style: none;
}
.adm a {
  color: var(--accent);
  text-decoration: none;
}
.adm a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.adm button,
.adm input,
.adm select {
  font: inherit;
  color: inherit;
}
.adm :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
.adm code {
  font-family: var(--mono);
  font-size: 12px;
  padding: 1px 6px;
  background: var(--seg);
  border-radius: 6px;
  overflow-wrap: anywhere;
}
.adm-codes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.adm .sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.adm-muted {
  color: var(--muted);
}

/* ---------- shell ---------- */
.adm-shell {
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr);
  min-height: 100vh;
  background: linear-gradient(to right, var(--surface) calc(var(--nav-w) - 1px), var(--line) calc(var(--nav-w) - 1px), var(--line) var(--nav-w), transparent var(--nav-w));
}
.adm-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 12px 16px;
  overflow-y: auto;
}
.adm-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  color: var(--ink) !important;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  text-decoration: none !important;
}
.adm-brand em {
  font-style: normal;
  font-weight: 500;
  color: var(--muted);
}
.adm-links {
  display: grid;
  gap: 2px;
}
.adm-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 500;
  text-decoration: none !important;
}
.adm-links a .icon {
  width: 18px;
  height: 18px;
}
.adm-links a:hover {
  background: var(--bg);
  color: var(--ink);
}
.adm-links a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.adm-signout {
  margin-top: auto;
  padding: 0 8px;
}
.adm-main {
  min-width: 0;
  max-width: 1320px;
  width: 100%;
  padding: 24px 28px 72px;
  display: grid;
  gap: 18px;
  align-content: start;
}

/* ---------- page head, cards ---------- */
.adm-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.adm-head h1 {
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.adm-sub {
  margin-top: 2px;
  color: var(--muted);
  max-width: 70ch;
}
.adm-head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.adm-help {
  max-width: 78ch;
  padding: 10px 14px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 10px;
  color: #1C3A9A;
}
.adm-help code {
  background: #fff;
}
/* help text and action rows placed straight in a card (Shopify page) get the card's inner padding */
.adm-card > .adm-help {
  margin: 0 16px 12px;
}
.adm-card > .adm-actions {
  padding: 0 16px 16px;
}
.adm-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 0;
}
.adm-card-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px 10px;
}
.adm-card-head h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.adm-note {
  color: var(--muted);
  font-size: 13px;
}
.adm-card-foot {
  padding: 10px 16px 14px;
  font-size: 13px;
}
.adm-empty {
  padding: 18px 16px 20px;
  color: var(--muted);
}
.adm-empty-page,
.adm-login {
  padding: 22px;
  display: grid;
  gap: 12px;
}
.adm-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.adm-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.adm-stack {
  display: grid;
  gap: 18px;
  min-width: 0;
}

/* ---------- stats ---------- */
.adm-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.adm-stat {
  display: grid;
  gap: 2px;
  align-content: start;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 0;
}
.adm-stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.adm-stat-value {
  font-size: 26px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.adm-stat-hint {
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

/* ---------- tables ---------- */
.adm-table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--line);
  border-radius: 0 0 12px 12px;
}
/* long lists scroll inside their card so the header row stays in view */
.adm-table-wrap.is-tall {
  overflow-y: auto;
  max-height: min(78vh, 820px);
}
.adm-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.adm-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 12px;
  background: var(--head);
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.adm-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.adm-table tbody tr:last-child td {
  border-bottom: 0;
}
.adm-table tbody tr:hover td {
  background: #FBFCFE;
}
.adm-table td.nowrap,
.adm-table td.nowrap .adm-cell-sub {
  white-space: nowrap;
}
.adm-table td.col-main {
  min-width: 220px;
}
.adm-table td.col-wide {
  min-width: 260px;
  max-width: 420px;
}
.adm-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.adm-table tr.is-off td {
  color: var(--muted);
}
.adm-table td form {
  margin: 0;
}
.adm-cell-sub {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}
.adm-title {
  font-weight: 600;
  color: var(--ink) !important;
}
.adm-title:hover {
  color: var(--accent) !important;
}
.adm-error-text {
  color: var(--danger);
  font-size: 12px;
}
.adm-actions,
.adm-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.adm-inline {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin: 0;
}
.adm-pager,
.adm-pager-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.adm-pager-links {
  display: flex;
  gap: 8px;
}

/* ---------- badges ---------- */
.adm-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.adm-badge.is-ok { background: var(--money-soft); color: var(--money-ink); }
.adm-badge.is-warn { background: var(--warn-soft); color: var(--warn-ink); }
.adm-badge.is-accent { background: var(--accent-soft); color: var(--accent); }
.adm-badge.is-danger { background: var(--danger-soft); color: var(--danger); }
.adm-badge.is-muted { background: var(--seg); color: var(--muted); }

/* ---------- lists ---------- */
.adm-health {
  display: grid;
}
.adm-health li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 12px;
  align-items: center;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
}
.adm-health-name {
  font-weight: 600;
}
.adm-health-detail {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.adm-dl {
  display: grid;
  grid-template-columns: minmax(110px, auto) minmax(0, 1fr);
  gap: 8px 16px;
  padding: 4px 16px 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.adm-dl dt {
  color: var(--muted);
}
.adm-dl dd {
  overflow-wrap: anywhere;
}

/* ---------- forms ---------- */
.adm-form,
.adm-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
}
.adm-form-tight {
  margin-top: 4px;
}
.adm-filters {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
}
.adm-filters-inline {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
/* the same filter row used on its own (media, Shopify import) keeps the card outline */
.adm-main > .adm-filters-inline {
  border: 1px solid var(--line);
  border-radius: 12px;
}
.adm-filters .adm-field {
  min-width: 140px;
}
.adm-grow {
  flex: 1 1 220px;
}
.adm-wide {
  grid-column: span 2;
}
.adm-field {
  display: grid;
  gap: 4px;
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}
.adm-field > span,
.adm-field > legend {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 0;
}
.adm-hint:empty {
  display: none;
}
.adm-hint {
  font-size: 12px;
  color: var(--muted);
}
.adm-submit {
  align-content: end;
}
.adm-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  align-items: center;
  align-content: end;
}
.adm-checks > legend {
  float: left;
  width: 100%;
}
.adm-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
}
.adm-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}
.adm input[type="text"],
.adm input[type="search"],
.adm input[type="password"],
.adm input[type="email"],
.adm input[type="url"],
.adm input[type="number"],
.adm input[type="date"],
.adm input[type="month"],
.adm select {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--track);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
}
.adm input.adm-input-sm {
  width: 84px;
}
.adm input:focus-visible,
.adm select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}
.adm-login {
  width: min(100%, 400px);
  box-shadow: 0 1px 2px rgba(15, 23, 36, 0.04), 0 8px 24px rgba(15, 23, 36, 0.06);
}
.adm-login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.adm-login-brand h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.adm-login .adm-btn {
  height: 40px;
}
.adm-center {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

/* ---------- buttons ---------- */
.adm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none !important;
}
.adm-btn:hover {
  filter: brightness(0.93);
}
.adm-btn:active {
  transform: translateY(1px);
}
.adm-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  filter: none;
}
.adm-btn.ghost {
  background: var(--surface);
  color: var(--ink) !important;
  border-color: var(--track);
}
.adm-btn.ghost:hover {
  background: var(--bg);
  filter: none;
}
.adm-btn.danger {
  background: var(--surface);
  color: var(--danger) !important;
  border-color: var(--danger-line);
}
.adm-btn.danger:hover {
  background: var(--danger-soft);
  filter: none;
}
.adm-btn.sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 7px;
}

/* ---------- flash ---------- */
.adm-flash {
  display: grid;
  gap: 2px;
  padding: 10px 14px;
  border: 1px solid;
  border-radius: 10px;
  font-size: 13px;
}
.adm-flash.is-ok {
  background: var(--money-soft);
  border-color: #B8E2CC;
  color: #0B5C3A;
}
.adm-flash.is-err {
  background: var(--danger-soft);
  border-color: var(--danger-line);
  color: var(--danger);
}

/* ---------- pin popover (details) ---------- */
.adm-pin summary {
  list-style: none;
  cursor: pointer;
}
.adm-pin summary::-webkit-details-marker {
  display: none;
}
.adm-pin[open] {
  flex-basis: 100%;
}
.adm-pin-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  margin-top: 8px;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.adm-pin-form label {
  display: grid;
  gap: 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.adm-pin-form select,
.adm-pin-form input[type="date"] {
  width: auto;
  height: 28px;
  font-size: 12px;
}
.adm-pin-form input[type="text"] {
  width: min(260px, 100%);
  height: 28px;
  font-size: 12px;
}

/* ---------- tablet / mobile ---------- */
@media (max-width: 1100px) {
  .adm-cols,
  .adm-cols-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 980px) {
  .adm-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .adm-shell {
    grid-template-columns: minmax(0, 1fr);
    background: none;
  }
  .adm-nav {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    overflow-y: hidden;
  }
  .adm-brand span {
    display: none;
  }
  .adm-brand {
    flex: none;
    padding: 0 4px 0 0;
  }
  .adm-links {
    display: flex;
    gap: 4px;
    flex: none;
  }
  .adm-links a {
    padding: 7px 10px;
    white-space: nowrap;
  }
  .adm-signout {
    margin: 0 0 0 auto;
    flex: none;
    padding: 0;
  }
  .adm-main {
    padding: 16px 16px 56px;
  }
  .adm-head h1 {
    font-size: 21px;
  }
  .adm-wide {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .adm-table-wrap.is-tall {
    max-height: none;
    overflow-y: visible;
  }
  .adm-table.stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
  .adm-table.stack,
  .adm-table.stack tbody,
  .adm-table.stack tr,
  .adm-table.stack td {
    display: block;
    width: 100%;
  }
  .adm-table.stack tr {
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
  }
  .adm-table.stack tbody tr:last-child {
    border-bottom: 0;
  }
  .adm-table.stack td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding: 4px 0;
    border: 0;
    text-align: right;
  }
  .adm-table.stack td::before {
    content: attr(data-label);
    flex: none;
    max-width: 40%;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: left;
    padding-top: 2px;
  }
  .adm-table.stack td > * {
    min-width: 0;
  }
  .adm-table.stack td .adm-cell-sub {
    text-align: right;
  }
  .adm-table.stack td.col-main,
  .adm-table.stack td.col-wide {
    max-width: none;
    min-width: 0;
  }
  .adm-table.stack td:first-child {
    display: block;
    padding-bottom: 6px;
    text-align: left;
  }
  .adm-table.stack td:first-child::before {
    display: none;
  }
  .adm-table.stack td:first-child .adm-cell-sub {
    text-align: left;
  }
  .adm-table.stack td:empty {
    display: none;
  }
  .adm-table.stack tbody tr:hover td {
    background: transparent;
  }
  .adm-table.stack td input[type="text"],
  .adm-table.stack td select {
    max-width: 62vw;
  }
  .adm-actions,
  .adm-badges {
    justify-content: flex-end;
  }
  .adm-pager {
    flex-direction: column;
    align-items: flex-start;
  }
  .adm-stat-value {
    font-size: 22px;
  }
}

/* ---------- brand portal (/brand) ---------- */
.adm textarea {
  width: 100%;
  min-width: 0;
  min-height: 84px;
  padding: 8px 10px;
  border: 1px solid var(--track);
  border-radius: 8px;
  background: var(--surface);
  font: inherit;
  font-size: 13px;
  resize: vertical;
}
.adm textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}
.adm input[type="file"] {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 3px;
  border: 1px dashed var(--track);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  color: var(--muted);
}
.adm input[type="file"]::file-selector-button {
  height: 26px;
  margin-right: 10px;
  padding: 0 10px;
  border: 1px solid var(--track);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.bp-license {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  grid-column: 1 / -1;
  padding: 12px 14px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.5;
  cursor: pointer;
}
.bp-license input {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--accent);
}
.bp-full {
  grid-column: 1 / -1;
}
.bp-thumb {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
}
.bp-thumb-video {
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.bp-status:empty {
  display: none;
}
.bp-status {
  grid-column: 1 / -1;
  font-size: 13px;
}
.bp-status.is-err {
  color: #B4231B;
  font-weight: 500;
}

/* ---------- phones: navigation bar, stacked tables, touch targets ---------- */
@media (max-width: 860px) {
  /* short pages (Shopify, empty lists): the spare height goes to the content, never to the nav bar */
  .adm-shell {
    grid-template-rows: auto minmax(0, 1fr);
  }
  /* row 1: logo, brand name, sign out · row 2: the page links */
  .adm-nav {
    flex-wrap: wrap;
    row-gap: 6px;
    overflow: visible;
  }
  .adm-nav > .adm-note {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: var(--ink);
  }
  .adm-signout {
    order: 2;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .adm-links {
    order: 3;
    flex: 1 1 100%;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    padding-right: 28px;
    /* fade on the right edge: there are more links to scroll to */
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent);
  }
  .adm-links::-webkit-scrollbar {
    display: none;
  }
  /* five links or fewer (brand portal): wrap, so every page stays in view */
  .adm-links:not(:has(> a:nth-child(6))) {
    flex-wrap: wrap;
    overflow: visible;
    padding-right: 0;
    -webkit-mask-image: none;
    mask-image: none;
  }
}
@media (max-width: 560px) {
  .adm-signout .adm-note {
    display: none;
  }
}
@media (max-width: 720px) {
  /* stacked rows: the label floats left and the value flows beside it, right-aligned; a value that doesn't fit
     continues under the label instead of being squeezed into a narrow column or overlapping the next item
     (Sources → missing env vars). Inline content (a link + " · text") stays on one line of text. */
  .adm-table.stack td {
    display: flow-root;
    text-align: right;
    overflow-wrap: anywhere;
  }
  .adm-table.stack td::before {
    float: left;
    margin-right: 14px;
  }
  .adm-table.stack td .adm-inline,
  .adm-table.stack td .adm-codes {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  /* a note / code field and its button share one line while there is room */
  .adm-table.stack td .adm-inline input[type="text"] {
    flex: 1 1 150px;
    width: auto;
  }
}
@media (max-width: 860px), (pointer: coarse) {
  .adm-links a {
    min-height: 44px;
  }
  .adm-brand {
    position: relative;
  }
  .adm-brand::after {
    content: "";
    position: absolute;
    inset: -8px -6px;
  }
  /* 44 px fields; 16 px text also stops iOS Safari from zooming into a field on focus */
  .adm input[type="text"],
  .adm input[type="search"],
  .adm input[type="password"],
  .adm input[type="email"],
  .adm input[type="url"],
  .adm input[type="number"],
  .adm input[type="date"],
  .adm input[type="month"],
  .adm select,
  .adm-pin-form select,
  .adm-pin-form input[type="date"],
  .adm-pin-form input[type="text"] {
    height: 44px;
    font-size: 16px;
  }
  .adm textarea {
    font-size: 16px;
  }
  .adm input[type="file"] {
    min-height: 44px;
  }
  .adm input[type="file"]::file-selector-button {
    height: 36px;
  }
  .adm input.adm-input-sm {
    width: 96px;
  }
  .adm-btn,
  .adm-btn.sm,
  .adm-login .adm-btn {
    height: auto;
    min-height: 44px;
  }
  .adm-btn.sm {
    padding: 0 12px;
    font-size: 13px;
  }
  .adm-toggle {
    min-height: 44px;
  }
  .adm-toggle input {
    width: 20px;
    height: 20px;
  }
}
