/* Every piece the dashboard's pages are built from, in «هادئ», the look the
   owner chose (the same rules the samples in designs/ were drawn with).
   Colours and sizes are the variables in tokens.css. */

/* ── The page: the menu beside it, or above it, or (on a phone) under
it. ── */
.app {
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr);
  min-height: 100dvh;
}

.nav {
  position: sticky;
  top: var(--bar, 0px);
  align-self: start;
  height: calc(100dvh - var(--bar, 0px));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  padding: var(--s4) var(--s3);
  background: var(--nav-bg);
  border-inline-end: 1px solid var(--border);
}

.nav ul {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s1) var(--s3) var(--s3);
  color: var(--text);
  font-size: 1.0625rem;
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.625rem;
  background: var(--brand);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
}

.nav li a,
.nav li button {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s3);
  width: 100%;
  min-height: var(--tap);
  padding: 0 var(--s3);
  border: 0;
  border-radius: var(--r);
  background: none;
  color: var(--nav-text);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.nav li a:hover,
.nav li button:hover {
  background: var(--hover);
}

.nav li a[aria-current='page'] {
  background: var(--accent-soft);
  color: var(--nav-on);
  font-weight: 700;
}

.nav .more {
  display: none;
}

.badge {
  margin-inline-start: auto;
  min-width: 1.5rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--bad-bg);
  color: var(--bad-ink);
  font-size: var(--fs-s);
  font-weight: 700;
  text-align: center;
}

.nav-foot {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-top: auto;
  padding: var(--s3);
  border-top: 1px solid var(--border);
  color: var(--nav-text);
  font-size: var(--fs-s);
  line-height: 1.5;
}

.nav-foot strong {
  display: block;
  color: var(--text);
  font-size: var(--fs);
}

.who {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.main {
  min-width: 0;
  padding: var(--s5) clamp(1rem, 3vw, 2.5rem) var(--s7);
}

.page {
  display: grid;
  /* One column no wider than the screen: a long row of tabs scrolls by
     itself instead of widening the page on a phone. */
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s5);
  max-width: 80rem;
  margin-inline: auto;
}

@media (max-width: 44rem) {
  .app {
    display: block;
  }

  /* The four parts used most, under the thumb; the rest behind «المزيد». */
  .nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 5;
    height: auto;
    padding: var(--s1) var(--s2) calc(var(--s1) + env(safe-area-inset-bottom));
    overflow: visible;
    background: var(--surface);
    border: 0;
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 20px rgb(0 0 0 / 0.07);
  }

  .brand,
  .nav-foot,
  .nav li:nth-child(n + 5):not(.more) {
    display: none;
  }

  .nav .more {
    display: block;
  }

  .nav ul {
    flex-direction: row;
    gap: 0;
  }

  .nav li {
    flex: 1;
  }

  .nav li a,
  .nav li button {
    flex-direction: column;
    justify-content: center;
    gap: 0;
    min-height: 3.5rem;
    padding: var(--s1);
    color: var(--text-2);
    font-size: 0.75rem;
  }

  .nav li a[aria-current='page'] {
    background: none;
    color: var(--accent-ink);
  }

  .nav li .i {
    width: 1.5rem;
    height: 1.5rem;
  }

  .nav .badge {
    position: absolute;
    top: 0.125rem;
    inset-inline-start: calc(50% + 0.25rem);
    min-width: 1.25rem;
    font-size: 0.6875rem;
    line-height: 1.25rem;
  }

  .main {
    padding: var(--s4) var(--s4) 6rem;
  }

  .page {
    gap: var(--s4);
  }

}

/* ── The top of a page: its name, the search, what to do. ── */
.head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3);
}

.head h1 {
  margin-inline-end: auto;
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1.4;
}

.find {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-width: 18rem;
  min-height: var(--tap);
  padding: 0 var(--s3);
  border: 1px solid var(--field);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
}

.find kbd {
  margin-inline-start: auto;
  padding: 0 0.4rem;
  border: 1px solid var(--border-strong);
  border-radius: 0.3rem;
  background: var(--surface-2);
  font-family: inherit;
  font-size: 0.75rem;
  direction: ltr;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: var(--tap);
  padding: 0 var(--s4);
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.btn:hover {
  background: var(--hover);
}

.btn.primary {
  border-color: transparent;
  background: var(--accent);
  color: var(--on-accent);
}

.btn.primary:hover {
  filter: brightness(1.08);
}

.btn.quiet {
  border-color: transparent;
  background: none;
}

.btn.quiet:hover {
  background: var(--hover);
}

.btn.only {
  width: var(--tap);
  padding: 0;
}

.btn.bad {
  border-color: transparent;
  background: var(--bad-ink);
  color: var(--bad-on);
}

.btn.bad-line {
  border-color: var(--bad-ink);
  color: var(--bad-ink);
}

/* ── The counts, which are also the filter. ── */
.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--s3);
}

.stat {
  display: grid;
  padding: var(--s3) var(--s4);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: start;
  cursor: pointer;
}

.stat span {
  display: flex;
  align-items: center;
  gap: var(--s2);
  color: var(--text-2);
  font-size: var(--fs-s);
  font-weight: 600;
}

.stat b {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.stat[aria-pressed='true'] {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.stat .stat-i {
  display: none;
}

.dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--c-ink, var(--text-2));
}

.c-ok {
  --c-bg: var(--ok-bg);
  --c-ink: var(--ok-ink);
}

.c-warn {
  --c-bg: var(--warn-bg);
  --c-ink: var(--warn-ink);
}

.c-bad {
  --c-bg: var(--bad-bg);
  --c-ink: var(--bad-ink);
}

.c-info {
  --c-bg: var(--info-bg);
  --c-ink: var(--info-ink);
}

.c-neutral {
  --c-bg: var(--neutral-bg);
  --c-ink: var(--neutral-ink);
}

/* ── Above the list: search inside it, the order, the count, export. ── */
.tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3);
}

.field {
  position: relative;
  flex: 1 1 16rem;
  max-width: 24rem;
}

.field .i {
  position: absolute;
  inset-block: 0;
  inset-inline-start: var(--s3);
  margin-block: auto;
  color: var(--text-2);
  pointer-events: none;
}

.input,
.select {
  width: 100%;
  min-height: var(--tap);
  padding: 0 var(--s3);
  border: 1px solid var(--field);
  border-radius: var(--r);
  background: var(--surface);
}

.field .input {
  padding-inline-start: 2.5rem;
}

.select {
  width: auto;
}

.count {
  margin-inline-start: auto;
  color: var(--text-2);
  font-size: var(--fs-s);
}

/* The tools and the list they work on. */
.board {
  display: grid;
  gap: inherit;
  min-width: 0;
}

/* ── The list as a table. ── */
.sheet {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.sheet.flat {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  padding: var(--s3) var(--s4);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--fs-s);
  font-weight: 600;
  text-align: start;
  white-space: nowrap;
}

td {
  padding: var(--s3) var(--s4);
  border-top: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:hover {
  background: var(--hover);
}

.c-act {
  width: 1%;
  text-align: end;
}

.who-store {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-width: 0;
}

.kind {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--r);
  background: var(--surface-2);
  color: var(--text-2);
}

.who-store a {
  font-weight: 700;
  text-decoration: none;
}

.who-store a:hover {
  color: var(--accent-ink);
  text-decoration: underline;
}

.sub {
  display: block;
  color: var(--text-2);
  font-size: var(--fs-s);
  line-height: 1.5;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.0625rem 0.625rem;
  border-radius: 999px;
  background: var(--c-bg);
  color: var(--c-ink);
  font-size: var(--fs-s);
  font-weight: 700;
  white-space: nowrap;
}

.chip .i {
  width: 1em;
  height: 1em;
  stroke-width: 2.25;
}

.num .i {
  display: none;
}

.soon {
  color: var(--warn-ink);
  font-weight: 700;
}

/* ── The same list as cards: every look on a phone, and «بطاقات»
everywhere. ── */
[data-list='cards'] .stores {
  overflow: visible;
  border: 0;
  background: none;
  box-shadow: none;
}

[data-list='cards'] .stores :is(table,
tbody,
tr,
td) {
  display: block;
}

[data-list='cards'] .stores thead {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

[data-list='cards'] .stores tbody {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  gap: var(--s4);
}

[data-list='cards'] .stores tr {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s1) var(--s3);
  align-content: start;
  padding: var(--s4);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

[data-list='cards'] .stores tr[hidden] {
  display: none;
}

[data-list='cards'] .stores td {
  padding: 0;
  border: 0;
}

[data-list='cards'] .stores .c-store {
  margin-bottom: var(--s2);
}

[data-list='cards'] .stores .c-act {
  grid-area: 1 / 2;
  width: auto;
}

[data-list='cards'] .stores td[data-label] {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: var(--s4);
}

[data-list='cards'] .stores td[data-label]::before {
  content: attr(data-label);
  color: var(--text-2);
}

[data-list='cards'] .stores td .sub {
  display: inline;
  margin-inline-start: var(--s2);
}

[data-list='cards'] .stores .c-store .sub {
  display: block;
  margin: 0;
}

@media (max-width: 44rem) {
  [data-list='cards'] .stores tbody {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s3);
  }

}

/* ── A row's menu. ── */
.menu {
  position: fixed;
  inset: auto;
  margin: 0;
  min-width: 13rem;
  padding: var(--s1);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.18);
}

.menu button,
.menu a {
  display: flex;
  align-items: center;
  gap: var(--s3);
  width: 100%;
  min-height: var(--tap);
  padding: 0 var(--s3);
  border: 0;
  border-radius: var(--r);
  background: none;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}

.menu button:hover,
.menu a:hover {
  background: var(--hover);
}

.menu .is-bad {
  color: var(--bad-ink);
}

/* ── One store's page. ── */
.crumbs ol {
  display: flex;
  align-items: center;
  gap: var(--s2);
  color: var(--text-2);
  font-size: var(--fs-s);
}

.crumbs a:hover {
  color: var(--accent-ink);
}

.crumbs .i {
  width: 1em;
  height: 1em;
}

.hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s4) var(--s5);
  padding: var(--s5);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.avatar {
  display: grid;
  place-items: center;
  width: 3.75rem;
  height: 3.75rem;
  border-radius: var(--r-lg);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.avatar .i {
  width: 1.875rem;
  height: 1.875rem;
}

.hero h1 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2) var(--s3);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.4;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--s5);
  margin-top: var(--s1);
  color: var(--text-2);
  font-size: var(--fs-s);
}

.meta span {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
}

.acts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

.tabs {
  display: flex;
  gap: var(--s1);
  overflow: auto hidden;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}

.tab {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: var(--s2);
  min-height: var(--tap);
  margin-bottom: -1px;
  padding: 0 var(--s4);
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--text-2);
  font-weight: 600;
  cursor: pointer;
}

.tab:hover {
  color: var(--text);
}

.tab[aria-selected='true'] {
  border-bottom-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.tab.is-bad[aria-selected='true'] {
  border-bottom-color: var(--bad-ink);
  color: var(--bad-ink);
}

.tab:focus-visible {
  outline-offset: -3px;
}

.panel {
  display: grid;
  gap: var(--s4);
}

[hidden] {
  display: none !important;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--s4);
}

.card {
  display: grid;
  align-content: start;
  gap: var(--s3);
  min-width: 0;
  padding: var(--s4) var(--s5);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card h2 {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: 1rem;
  font-weight: 700;
}

.card h2 .btn {
  margin-inline-start: auto;
}

.card h2 > .i {
  color: var(--text-2);
}

.big {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.35;
}

.muted {
  color: var(--text-2);
  font-size: var(--fs-s);
}

progress {
  display: block;
  width: 100%;
  height: 0.5rem;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--surface-2);
  appearance: none;
}

progress::-webkit-progress-bar {
  background: var(--surface-2);
}

progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--accent);
}

progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--accent);
}

.rows > li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2) var(--s3);
  padding: var(--s3) 0;
  border-top: 1px solid var(--border);
}

.rows > li:first-child {
  padding-top: 0;
  border: 0;
}

.rows > li:last-child {
  padding-bottom: 0;
}

.rows .grow {
  flex: 1 1 12rem;
  min-width: 0;
}

.rows strong {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
  font-weight: 700;
}

.spot {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-2);
}

.when {
  color: var(--text-2);
  font-size: var(--fs-s);
  white-space: nowrap;
}

.card.is-bad {
  border-color: color-mix(in srgb, var(--bad-ink) 45%, var(--border));
}

.card.is-bad h2 {
  color: var(--bad-ink);
}

.card.is-bad h2 > .i {
  color: inherit;
}

@media (max-width: 44rem) {
  .head h1 {
    flex: 1 1 auto;
    font-size: 1.375rem;
  }

  .find {
    order: 3;
    flex: 1 1 100%;
    min-width: 0;
  }

  .find kbd {
    display: none;
  }

  .stats {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(8.5rem, 1fr);
    grid-template-columns: none;
    width: auto;
    margin-inline: calc(-1 * var(--s4));
    padding: 2px var(--s4);
    gap: var(--s2);
    overflow: auto hidden;
    border: 0;
    background: none;
    scroll-snap-type: inline proximity;
    scroll-padding-inline: var(--s4);
    scrollbar-width: none;
  }

  .stat {
    display: grid;
    padding: var(--s2) var(--s3);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    scroll-snap-align: start;
  }

  .stat b {
    font-size: 1.375rem;
  }

  .field {
    flex-basis: 100%;
    max-width: none;
  }

  .tools .select {
    flex: 1;
  }

  .count {
    order: 5;
    flex-basis: 100%;
    margin: 0;
  }

  .hero {
    grid-template-columns: auto minmax(0, 1fr);
    padding: var(--s4);
  }

  .hero h1 {
    font-size: 1.25rem;
  }

  .acts {
    grid-column: 1 / -1;
  }

  .acts .btn:not(.only) {
    flex: 1;
  }

  .tabs {
    margin-inline: calc(-1 * var(--s4));
    padding-inline: var(--s4);
  }

  .card {
    padding: var(--s4);
  }

  /* A table inside a card scrolls sideways before it squeezes. */
  .sheet.flat {
    overflow-x: auto;
  }

}

/* ════ What the samples did not have: signing in, forms, dialogs, notices,
   the quick search, and the states of a list. ════ */

.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn[aria-busy='true'] {
  opacity: 0.7;
  pointer-events: none;
}

.btn.wide {
  width: 100%;
}

.btn[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

/* A button that reads as a link, inside a sentence or under a form. */
.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.link.tall {
  min-height: var(--tap);
}

/* ── Before the dashboard: loading, signing in, a first password. ── */
.gate {
  display: grid;
  place-content: center;
  grid-template-columns: minmax(0, 26rem);
  min-height: 100dvh;
  padding: var(--s5) var(--s4);
}

.gate-card {
  display: grid;
  gap: var(--s4);
  padding: var(--s6) var(--s5);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.gate-card h1 {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.4;
}

.gate-card h1:focus {
  outline: none;
}

.gate-card .brand {
  padding: 0;
}

.gate-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s2) var(--s4);
}

/* ── A form: each field under its name, its hint and its error with it. ── */
.form {
  display: grid;
  gap: var(--s4);
}

.f {
  display: grid;
  gap: var(--s1);
}

.f label {
  font-weight: 600;
}

.f .hint {
  color: var(--text-2);
  font-size: var(--fs-s);
}

.f .input[aria-invalid='true'] {
  border-color: var(--bad-ink);
  box-shadow: inset 0 0 0 1px var(--bad-ink);
}

.err {
  display: flex;
  align-items: center;
  gap: var(--s2);
  color: var(--bad-ink);
  font-size: var(--fs-s);
  font-weight: 600;
}

.err:empty {
  display: none;
}

.input.code {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-align: center;
}

.input::placeholder {
  color: var(--text-2);
  opacity: 1;
}

input[type='checkbox'] {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ── A page's parts. ── */
.head h1:focus,
.hero h1:focus {
  outline: none;
}

.sec {
  font-size: 1.0625rem;
  font-weight: 700;
}

.part {
  display: grid;
  gap: var(--s3);
}

/* Loading, nothing found, could not load. */
.state {
  display: grid;
  justify-items: center;
  gap: var(--s3);
  padding: var(--s6) var(--s4);
  color: var(--text-2);
  text-align: center;
}

.state > .i {
  width: 2rem;
  height: 2rem;
}

.more-row {
  display: flex;
  justify-content: center;
}

/* ── «نظرة عامة»: what needs a look, each a link to its list. ── */
.attn {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: var(--s3);
}

.attn-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s1) var(--s3);
  padding: var(--s4);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  text-decoration: none;
}

.attn-card:hover {
  background: var(--hover);
}

.attn-card .spot {
  grid-row: span 2;
  background: var(--c-bg);
  color: var(--c-ink);
}

.attn-card b {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.attn-card .what {
  grid-column: 2;
  color: var(--text-2);
  font-size: var(--fs-s);
  font-weight: 600;
}

.attn-card > .i:last-child {
  grid-row: 1 / span 2;
  grid-column: 3;
  color: var(--text-2);
}

/* Nothing waiting: the card steps back. */
.attn-card.is-none .spot {
  background: var(--surface-2);
  color: var(--text-2);
}

.attn-card.is-none b {
  color: var(--text-2);
}

a.stat {
  color: inherit;
  text-decoration: none;
}

a.stat:hover,
button.stat:hover {
  background: var(--hover);
}

div.stat {
  cursor: default;
}

.stats.wide {
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
}

/* ── The stores list: picking rows, ordering by a column. ── */
.c-pick {
  width: 1%;
}

th .sort {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  min-height: 1.75rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

th .sort:hover {
  color: var(--text);
}

th .sort .i {
  width: 1em;
  height: 1em;
  opacity: 0.45;
}

th[aria-sort='ascending'] .sort,
th[aria-sort='descending'] .sort {
  color: var(--accent-ink);
}

th[aria-sort='ascending'] .sort .i,
th[aria-sort='descending'] .sort .i {
  opacity: 1;
}

th[aria-sort='ascending'] .sort .i {
  transform: rotate(180deg);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s2);
}

tr.is-closed .who-store a {
  color: var(--text-2);
}

[data-list='cards'] .stores tr {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

[data-list='cards'] .stores .c-pick {
  grid-area: 1 / 1;
  width: auto;
  padding-top: var(--s2);
}

[data-list='cards'] .stores .c-store {
  grid-area: 1 / 2;
}

[data-list='cards'] .stores .c-act {
  grid-area: 1 / 3;
}

/* Wider than a phone but too narrow for seven columns: two cards a row. */
[data-list='cards'] .stores td[data-label] {
  align-items: baseline;
  text-align: end;
}

.menu > p {
  padding: var(--s2) var(--s3) var(--s1);
}

.menu hr {
  margin: var(--s1) 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.menu .val {
  margin-inline-start: auto;
  color: var(--text-2);
  font-size: var(--fs-s);
  font-weight: 600;
}

/* ── The signed-in admin, at the foot of the menu. ── */
.nav-foot {
  padding: var(--s2) 0 0;
}

.account {
  display: flex;
  align-items: center;
  gap: var(--s3);
  width: 100%;
  min-height: var(--tap);
  padding: var(--s2) var(--s3);
  border: 0;
  border-radius: var(--r);
  background: none;
  color: inherit;
  text-align: start;
  line-height: 1.5;
  cursor: pointer;
}

.account:hover {
  background: var(--hover);
}

.account .i:last-child {
  margin-inline-start: auto;
}

/* ── Dialogs: in the middle on a computer, up from the bottom on a phone. ── */
.dlg {
  width: min(30rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: var(--s5);
  overflow-y: auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 64px rgb(0 0 0 / 0.3);
}

.dlg::backdrop,
.palette::backdrop {
  background: rgb(10 14 20 / 0.55);
}

.dlg-body {
  display: grid;
  gap: var(--s3);
}

.dlg h2 {
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.5;
}

.dlg h2:focus {
  outline: none;
}

.dlg-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--s2);
  margin-top: var(--s3);
}

.cred {
  display: grid;
  gap: var(--s1);
  padding: var(--s3) var(--s4);
  border-radius: var(--r);
  background: var(--surface-2);
}

.cred .pass {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  user-select: all;
}

.links {
  display: grid;
  gap: var(--s1);
}

.links a,
.links button {
  display: flex;
  align-items: center;
  gap: var(--s3);
  width: 100%;
  min-height: var(--tap);
  padding: 0 var(--s3);
  border: 0;
  border-radius: var(--r);
  background: none;
  font-weight: 600;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}

.links a:hover,
.links button:hover {
  background: var(--hover);
}

.links a[aria-current='page'] {
  background: var(--accent-soft);
  color: var(--nav-on);
}

.links .badge {
  margin-inline-start: auto;
}

.links .is-bad {
  color: var(--bad-ink);
}

.links hr {
  width: 100%;
  margin: var(--s1) 0;
  border: 0;
  border-top: 1px solid var(--border);
}

/* ── Notices: what just happened, said once and read out. ── */
.toasts {
  position: fixed;
  inset-block-end: var(--s4);
  inset-inline-end: var(--s4);
  z-index: 20;
  display: grid;
  gap: var(--s2);
  width: min(24rem, calc(100vw - 2rem));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  border-radius: var(--r);
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.25);
  pointer-events: auto;
}

.toast.is-bad {
  background: var(--bad-ink);
  color: var(--bad-on);
}

/* ── The quick search (Ctrl+K). ── */
.palette {
  width: min(38rem, calc(100vw - 2rem));
  max-height: min(34rem, calc(100dvh - 2rem));
  margin-top: 10vh;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 64px rgb(0 0 0 / 0.3);
}

.palette[open] {
  display: flex;
  flex-direction: column;
}

.pal-top {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: 0 var(--s4);
  border-bottom: 1px solid var(--border);
}

.pal-top > .i {
  color: var(--text-2);
}

.pal-top input {
  flex: 1;
  min-width: 0;
  min-height: 3.25rem;
  border: 0;
  outline: 0;
  background: none;
  font-size: 1.0625rem;
}

.pal-list {
  flex: 1;
  min-height: 0;
  padding: var(--s2);
  overflow-y: auto;
}

.pal-group {
  padding: var(--s3) var(--s3) var(--s1);
  color: var(--text-2);
  font-size: var(--fs-s);
  font-weight: 700;
}

.pal-opt {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: var(--tap);
  padding: var(--s1) var(--s3);
  border-radius: var(--r);
  cursor: pointer;
}

.pal-opt .grow {
  flex: 1;
  min-width: 0;
}

.pal-opt .sub {
  display: block;
}

.pal-opt[aria-selected='true'] {
  background: var(--accent-soft);
  color: var(--nav-on);
}

.pal-opt[aria-selected='true'] .sub {
  color: inherit;
}

.pal-none {
  padding: var(--s5) var(--s4);
  color: var(--text-2);
  text-align: center;
}

@media (max-width: 44rem) {
  .dlg {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    padding: var(--s5) var(--s4) calc(var(--s4) + env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
  }

  .dlg-foot .btn {
    flex: 1;
  }

  .palette {
    width: 100%;
    max-width: 100%;
    max-height: 100dvh;
    height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  /* Above the menu at the bottom. */
  .toasts {
    inset: auto var(--s4) calc(4.5rem + env(safe-area-inset-bottom)) var(--s4);
    width: auto;
  }

  .tools .btn {
    flex: 1;
  }

  .attn {
    grid-template-columns: minmax(0, 1fr);
  }

  .stats.wide {
    grid-auto-columns: minmax(8.5rem, 1fr);
  }
}

/* ── Small pieces the pages added. ── */
.card.narrow {
  max-width: 28rem;
}

/* A filter that is on, and the press that takes it off. */
button.chip {
  min-height: 1.75rem;
  border: 0;
  cursor: pointer;
}

/* How many wait, beside a part's name: the count sits where the badge does. */
.badge-slot {
  display: contents;
}

.links .val {
  margin-inline-start: auto;
  color: var(--text-2);
  font-size: var(--fs-s);
}

.links > p {
  padding: var(--s1) var(--s3);
  font-size: var(--fs-s);
}

/* As cards the list has no head: its order is the select above it. A head
   kept for screen readers only would still take the keyboard's focus. */
[data-list='cards'] .stores thead {
  display: none;
}

/* As a table the store's name takes what the short columns leave. */
[data-list='table'] .stores :is(th, td) {
  padding-inline: var(--s3);
}

[data-list='table'] .stores :is(.c-phone, .c-state, .c-ends, .c-devices, .c-seen) {
  width: 1%;
  white-space: nowrap;
}

/* ════ Phase 2: the store's and the branch's pages, their dialogs, and
   the deletion requests. ════ */

/* Label and value, one fact a line; on a phone the label sits above. */
.facts {
  display: grid;
  gap: var(--s2);
}

.facts > div {
  display: grid;
  grid-template-columns: minmax(8rem, 11rem) minmax(0, 1fr);
  gap: var(--s3);
  align-items: baseline;
}

.facts dt {
  color: var(--text-2);
  font-size: var(--fs-s);
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* A round mark beside a line, in the line's tone. */
.spot.c-ok,
.spot.c-info,
.spot.c-warn,
.spot.c-bad,
.spot.c-neutral {
  background: var(--c-bg);
  color: var(--c-ink);
}

/* Said across the top of a page: closed for deletion. */
.notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2) var(--s3);
  padding: var(--s3) var(--s4);
  border: 1px solid color-mix(in srgb, var(--bad-ink) 45%, var(--border));
  border-radius: var(--r-lg);
  background: var(--bad-bg);
  color: var(--bad-ink);
  font-weight: 600;
}

.notice p {
  flex: 1 1 16rem;
}

.notice .btn {
  color: inherit;
}

/* A box to tick, its name beside it. */
.check {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  min-height: var(--tap);
  padding-block: var(--s2);
}

.check input {
  flex: none;
  margin-top: 0.2rem;
}

.check label {
  display: block;
  font-weight: 600;
  cursor: pointer;
}

.check .hint {
  display: block;
  color: var(--text-2);
  font-size: var(--fs-s);
}

.check:has(input:disabled) label {
  color: var(--text-2);
  cursor: not-allowed;
}

.checks {
  display: grid;
  gap: 0;
  margin: 0;
  padding: var(--s3) var(--s4);
  border: 1px solid var(--border);
  border-radius: var(--r);
}

.checks legend {
  padding: 0 var(--s2);
  font-weight: 700;
}

.select.wide {
  width: 100%;
}

textarea.input {
  min-height: 5rem;
  padding-block: var(--s2);
  resize: vertical;
}

/* Two ways to do one thing, side by side: one is chosen. */
.seg {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  margin: 0;
  padding: 0.25rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  background: var(--surface-2);
}

.seg label {
  position: relative;
  display: grid;
  place-items: center;
  min-height: calc(var(--tap) - 0.5rem);
  padding: 0 var(--s3);
  border-radius: calc(var(--r) - 0.25rem);
  color: var(--text-2);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.seg label:has(input:checked) {
  background: var(--surface);
  color: var(--accent-ink);
  box-shadow: 0 0 0 1px var(--border-strong);
  font-weight: 700;
}

.seg label:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}

/* The log: each line opens to what changed. */
.log > li {
  display: block;
}

.log summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2) var(--s3);
  min-height: var(--tap);
  border-radius: var(--r);
  cursor: pointer;
  list-style: none;
}

.log summary::-webkit-details-marker {
  display: none;
}

.log summary:hover {
  background: var(--hover);
}

.log summary .grow,
.card .rows .grow {
  flex: 1 1 12rem;
  min-width: 0;
}

.log-body {
  display: grid;
  gap: var(--s2);
  padding: var(--s2) 0 var(--s2) 0;
  padding-inline-start: 3rem;
}

.log-body pre {
  max-height: 20rem;
  margin: 0;
  padding: var(--s3);
  overflow: auto;
  border-radius: var(--r);
  background: var(--surface-2);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.card .tools {
  flex-wrap: wrap;
}

.card .rows .sub {
  display: block;
}

.sheet.flat table {
  width: 100%;
}

@media (max-width: 44rem) {
  .facts > div {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .log-body {
    padding-inline-start: 0;
  }

  .seg {
    grid-auto-flow: row;
  }
}

/* ── Imports and the catalogue. ── */

/* A wide table inside a card scrolls on its own, not the page. */
.sheet.scroll {
  overflow-x: auto;
}

.lined td {
  vertical-align: top;
}

/* The filter that is on. */
button.chip[aria-pressed='true'] {
  box-shadow: 0 0 0 2px var(--c-ink);
}

/* What an import adds, said before it is sent. */
.sum {
  display: grid;
  gap: var(--s1);
  padding: var(--s3) var(--s4);
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface-2);
}

.sum .warn {
  color: var(--warn-ink);
  font-weight: 600;
}

.notice.warn {
  border-color: color-mix(in srgb, var(--warn-ink) 45%, var(--border));
  background: var(--warn-bg);
  color: var(--warn-ink);
}

/* A pack's count beside its price. */
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s3);
}

/* The stores to fill a list from: one is chosen. */
.picklist {
  display: grid;
  max-height: 16rem;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--r);
}

.pick-row {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: var(--tap);
  padding: var(--s2) var(--s3);
  border-top: 1px solid var(--border);
  cursor: pointer;
}

.pick-row:first-child {
  border-top: 0;
}

.pick-row:hover {
  background: var(--hover);
}

.pick-row:has(input:checked) {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.pick-row .grow {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
}

.pick-row .kind {
  width: 2rem;
  height: 2rem;
}

.kinds {
  max-width: 34rem;
}

.kinds label {
  grid-auto-flow: column;
  gap: var(--s2);
}

/* On a phone each row of these tables is a card: its cells one under the
   other, each with its column's name. */
@media (max-width: 44rem) {
  .pair {
    grid-template-columns: 1fr;
  }

  .lined thead {
    display: none;
  }

  .lined :is(tbody, tr, td) {
    display: block;
  }

  .lined tr {
    position: relative;
    padding: var(--s3) var(--s4);
    border-top: 1px solid var(--border);
  }

  .lined tr:first-child {
    border-top: 0;
  }

  .lined tr[hidden] {
    display: none;
  }

  .lined td {
    padding: var(--s1) 0;
    border: 0;
  }

  .lined td[data-label]::before {
    content: attr(data-label);
    display: block;
    color: var(--text-2);
    font-size: var(--fs-s);
  }

  .lined td.c-pick,
  .lined td.c-act {
    position: absolute;
    inset-block-start: var(--s2);
    width: auto;
  }

  .lined td.c-pick {
    inset-inline-end: var(--s4);
  }

  .lined td.c-act {
    inset-inline-end: calc(var(--s4) + 2.5rem);
  }
}

/* ── Settings: a form on its own page, the lists under it. ── */
.settings {
  max-width: 42rem;
}

.notice.is-warn {
  border-color: color-mix(in srgb, var(--warn-ink) 45%, var(--border));
  background: var(--warn-bg);
  color: var(--warn-ink);
}

.notice .i {
  flex: none;
}

/* What was typed on several lines keeps them. */
.pre {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.big-text {
  font-size: 1.0625rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.card.is-live {
  border-color: color-mix(in srgb, var(--ok-ink) 55%, var(--border));
}

.sec > .i {
  color: var(--accent-ink);
}

/* The authenticator's QR code stays black on white, which every camera reads. */
.qr {
  justify-self: center;
  width: 12.5rem;
  height: 12.5rem;
  padding: var(--s2);
  border-radius: var(--r);
  background: #fff;
}

.secret {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  letter-spacing: 0.06em;
  text-align: center;
  overflow-wrap: anywhere;
  user-select: all;
}

.center {
  text-align: center;
}
