:root {
  --ink: #1c2b28;
  --muted: #51645e;
  --line: #ccd6d1;
  --lightline: #e1e7e3;
  --accent: #16483f;
  --active: #0c352e;
  --pale: #e9f1ec;
  --paper: #fff;
  --bg: #f4f6f3;
  --error: #9c292a;
  --warning: #785019;
  --warnbg: #faf0dd;
  --font:
    Inter, "Avenir Next", Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font: 16px var(--font);
  color: var(--ink);
  background: var(--bg);
  font-variant-numeric: tabular-nums;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
body:has(dialog[open]) {
  overflow: hidden;
}
a {
  color: var(--accent);
  text-underline-offset: 0.19em;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 2rem;
  line-height: 1.15;
  letter-spacing: -0.037em;
}
h2 {
  font-size: 1.3rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
h3 {
  font-size: 1rem;
  line-height: 1.35;
}
p {
  line-height: 1.55;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a.button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.65;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
:focus-visible {
  outline: 3px solid #b27421;
  outline-offset: 3px;
}
::selection {
  background: #cee6d8;
}
input,
textarea {
  caret-color: var(--accent);
}
button,
.button {
  border: 1px solid transparent;
  border-radius: 7px;
  min-height: 46px;
  padding: 11px 17px;
  font-weight: var(--weight-strong);
  font-size: 0.93rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  line-height: 1.35;
  text-decoration: none;
  text-align: center;
  color: var(--ink);
  background: transparent;
  transition: background 0.14s;
}
.primary {
  background: var(--accent);
  color: white;
}
.primary:hover {
  background: var(--active);
}
.secondary {
  background: white;
  border-color: #bbc8c1;
}
.secondary:hover,
.row:hover {
  background: #f1f5f1;
}
.subtle {
  color: var(--accent);
  padding-inline: 6px;
}
.subtle:hover {
  text-decoration: underline;
}
.icon {
  width: 20px;
  height: 20px;
  flex: none;
  display: inline-block;
  vertical-align: middle;
  stroke: currentColor;
  stroke-width: 1.75;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.skip {
  position: fixed;
  top: -90px;
  left: 14px;
  z-index: 20;
  padding: 14px;
  background: white;
}
.skip:focus {
  top: 6px;
}
.mast {
  background: white;
  border-bottom: 1px solid var(--line);
}
.mast-inner,
.nav-inner,
.container {
  width: min(1080px, 100%);
  padding-inline: 32px;
  margin: auto;
}
.mast-inner {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  white-space: nowrap;
  color: var(--ink);
  text-decoration: none;
}
.wordmark {
  font-size: 1.18rem;
  font-weight: var(--weight-bold);
  letter-spacing: -0.035em;
}
.mark {
  width: 36px;
  height: 36px;
}
.account {
  display: flex;
  align-items: center;
  gap: 13px;
}
.who {
  font-size: 0.84rem;
  color: var(--muted);
  font-weight: var(--weight-strong);
}
.sample {
  font-size: 0.75rem;
  border: 1px solid #d2dbd6;
  border-radius: 4px;
  padding: 4px 7px;
  color: var(--muted);
  font-weight: var(--weight-strong);
}
.nav {
  background: white;
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  gap: 24px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 49px;
  position: relative;
  font-size: 0.88rem;
  font-weight: var(--weight-strong);
  text-decoration: none;
  color: var(--muted);
}
.nav a[aria-current="page"] {
  color: var(--accent);
}
.nav a[aria-current="page"]:after {
  content: "";
  position: absolute;
  bottom: -1px;
  height: 3px;
  background: var(--accent);
  left: 0;
  right: 0;
}
.container {
  padding-block: 32px 64px;
}
.heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.heading p,
.muted,
.foot {
  color: var(--muted);
}
.account-row[aria-pressed="true"] {
  background: #e8f0e9;
}
.account-row small {
  overflow-wrap: anywhere;
  font-weight: var(--weight-regular);
}
#account-editor {
  scroll-margin-block: 12px;
}
#account-editor:empty {
  display: none;
}
.account-access {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--lightline);
}
.account-access > span {
  font-size: 0.88rem;
  color: var(--muted);
}
.empty {
  color: var(--muted);
}
.heading p {
  font-size: 0.94rem;
  margin-top: 6px;
}
.back {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: var(--weight-strong);
  min-height: 40px;
  margin-bottom: 8px;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.85fr);
  gap: 22px;
  align-items: start;
}
.stack {
  display: grid;
  gap: 17px;
}
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-width: 0;
}
.padded {
  padding: 24px;
}
.panel-title {
  padding: 17px 20px;
  border-bottom: 1px solid var(--lightline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.actions.spread {
  justify-content: space-between;
}
.block {
  width: 100%;
}
.narrow {
  max-width: 700px;
}
.tight {
  display: grid;
  gap: 10px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field {
  display: grid;
  gap: 6px;
  min-width: 0;
  align-content: start;
}
.field > span,
.legend {
  font-weight: var(--weight-strong);
  font-size: 0.88rem;
}
.field small,
small,
.foot {
  color: var(--muted);
  font-size: 0.81rem;
  line-height: 1.48;
}
input:not([type="checkbox"]),
textarea,
select {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 46px;
  border: 1px solid #aebcb5;
  background: #fff;
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  line-height: 1.4;
}
input[type="file"] {
  font-size: 0.83rem;
  padding: 8px;
}
textarea {
  resize: vertical;
  min-height: 78px;
}
input::placeholder,
textarea::placeholder {
  color: #687771;
}
input[type="checkbox"] {
  accent-color: var(--accent);
  width: 20px;
  height: 20px;
}
.options {
  display: grid;
  gap: 4px;
}
.choice {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  font-size: 0.92rem;
}
.form-error,
.error-banner {
  color: var(--error);
  font-weight: var(--weight-strong);
  font-size: 0.89rem;
  line-height: 1.5;
}
.form-error:empty {
  display: none;
}
.feedback {
  padding: 12px 14px;
  background: #e8f2e9;
  color: #1b4d3e;
  border: 1px solid #bdd4c5;
  border-radius: 6px;
  font-size: 0.9rem;
}
.feedback a {
  font-weight: var(--weight-strong);
}
.feedback.attention {
  background: var(--warnbg);
  color: #654111;
  border-color: #e6cfac;
}
.divider {
  border: 0;
  border-top: 1px solid var(--lightline);
  margin: 1px 0;
}
.row {
  width: 100%;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid var(--lightline);
  text-align: left;
}
.row:last-child {
  border-bottom: 0;
  border-radius: 0 0 9px 9px;
}
.row .rowtext {
  flex: 1;
  min-width: 0;
}
.row strong,
.row small {
  display: block;
}
.row strong {
  overflow-wrap: anywhere;
  font-size: 0.95rem;
  line-height: 1.42;
}
.row small {
  margin-top: 3px;
}
.row .icon {
  width: 18px;
}
.empty {
  padding: 18px 20px;
  font-size: 0.9rem;
}
.counter,
.tag {
  font-size: 0.76rem;
  font-weight: var(--weight-strong);
  color: var(--muted);
  white-space: nowrap;
}
.tag {
  color: #245344;
  background: var(--pale);
  border-radius: 4px;
  padding: 4px 7px;
  display: inline-flex;
}
.tag.amber {
  color: #6e4b1b;
  background: var(--warnbg);
}
.tag.gray {
  background: #edf0ed;
  color: #52605a;
}
.detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 16px;
  margin: 0;
}
.detail dt {
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 3px;
}
.detail dd {
  margin: 0;
  font-size: 0.98rem;
  font-weight: var(--weight-strong);
  overflow-wrap: anywhere;
}
.photo {
  object-fit: contain;
  max-width: 100%;
  max-height: 300px;
  border-radius: 6px;
  background: var(--bg);
}
.count-icon {
  display: inline-flex;
  padding: 10px;
  background: var(--pale);
  color: var(--accent);
  border-radius: 7px;
}
.shell-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.shell-title p {
  font-size: 0.83rem;
  color: var(--muted);
}
.scanbtn {
  min-height: 58px;
  font-size: 1rem;
}
.scanbtn .icon {
  width: 23px;
  height: 23px;
}
.inlineform {
  display: flex;
  gap: 9px;
  align-items: stretch;
}
.inlineform input {
  flex: 1;
  min-width: 0;
}
.inlineform button {
  flex: none;
}
.disabled {
  color: var(--muted);
}
#notice:empty {
  display: none;
}
#notice {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 7px;
  padding: 12px 18px;
  background: #1a3831;
  color: white;
  z-index: 10;
  font-size: 0.9rem;
  max-width: calc(100vw - 24px);
  width: max-content;
  box-shadow: 0 4px 14px #18332920;
}
.auth-wrap {
  max-width: 450px;
  margin: 8vh auto;
  padding: 0 18px;
}
.auth-wrap .panel {
  padding: 27px;
}
.auth-wrap h1 {
  font-size: 1.75rem;
}
.auth-wrap .brand {
  margin-bottom: 21px;
}
.auth-wrap h1 + p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.93rem;
}
.sample-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 17px;
  text-align: center;
}
dialog {
  max-width: min(520px, calc(100vw - 30px));
  width: 100%;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
}
dialog::backdrop {
  background: #0c201bd9;
}
.dialog-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
video {
  width: 100%;
  max-height: 55vh;
  background: #14231e;
  border-radius: 7px;
  display: block;
}
#camera-status {
  margin-top: 12px;
  font-size: 0.9rem;
}
.filter-bar {
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.batchlabel {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 11px 14px;
  border-bottom: 1px solid var(--lightline);
}
.batchlabel span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.batchlabel small {
  display: block;
}
.checklist {
  max-height: 300px;
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.nonce {
  white-space: nowrap;
}
.panel code,
.mono {
  font-family: ui-monospace, "SFMono-Regular", monospace;
  font-size: 0.91em;
}
.visually-hidden {
  position: absolute;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.label-wrap {
  display: grid;
  justify-items: start;
  gap: 12px;
}
.label-wrap svg {
  max-width: 100%;
  height: auto;
}
.label-print {
  width: max-content;
  max-width: 100%;
  background: white;
  padding: 10px 14px;
  border: 1px solid var(--line);
  color: black;
}
.label-print strong {
  display: block;
  font-size: 0.88rem;
}
.label-print svg {
  display: block;
}
#print-area {
  display: none;
}
button[data-logout] {
  min-height: 40px;
}
.admin-count {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.listhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.wrap-anywhere {
  overflow-wrap: anywhere;
}
.quiet-link {
  font-size: 0.87rem;
  font-weight: var(--weight-strong);
}
@media (max-width: 740px) {
  .mast-inner,
  .nav-inner,
  .container {
    padding-inline: 16px;
  }
  .mast-inner {
    min-height: 57px;
  }
  .nav-inner {
    justify-content: space-between;
    gap: 12px;
  }
  .nav a {
    font-size: 0.79rem;
    gap: 5px;
    min-height: 46px;
  }
  .nav a .icon {
    width: 16px;
  }
  .mark {
    width: 31px;
    height: 31px;
  }
  .wordmark {
    font-size: 1.03rem;
  }
  .brand {
    gap: 7px;
  }
  .account {
    gap: 7px;
  }
  .who {
    display: none;
  }
  .container {
    padding-block: 22px 60px;
  }
  .heading {
    margin-bottom: 16px;
  }
  .heading p {
    font-size: 0.88rem;
  }
  .layout {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .padded {
    padding: 17px;
  }
  h1 {
    font-size: 1.62rem;
  }
  h2 {
    font-size: 1.18rem;
  }
  .sample {
    font-size: 0.68rem;
    padding: 3px 5px;
  }
  .row {
    padding: 12px 15px;
  }
  .panel-title {
    padding: 13px 15px;
  }
  .auth-wrap {
    margin-top: 7vh;
  }
  .form-grid {
    gap: 11px;
  }
  .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filter-bar > :first-child {
    grid-column: 1 / -1;
  }
  .actions button,
  .actions a {
    min-height: 44px;
  }
}
@media (max-width: 400px) {
  .nav a {
    gap: 4px;
  }
  .nav-inner {
    gap: 7px;
  }
  .form-grid,
  .filter-bar {
    grid-template-columns: 1fr;
  }
  .mast-inner {
    gap: 6px;
  }
  .nav-inner,
  .container,
  .mast-inner {
    padding-inline: 12px;
  }
  .primary,
  .secondary {
    padding-inline: 12px;
  }
  .padded {
    padding: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media print {
  @page {
    margin: 8mm;
  }
  body {
    background: white;
  }
  body > * {
    display: none !important;
  }
  #print-area {
    display: block !important;
  }
  #print-area .label-print {
    border: none;
    padding: 0;
  }
  #print-area svg {
    max-width: 100%;
    height: auto;
  }
}
.overrides {
  border-block: 1px solid var(--lightline);
}
.overrides summary {
  cursor: pointer;
  padding-block: 13px;
  color: var(--accent);
  font-weight: var(--weight-strong);
  font-size: 0.9rem;
}
.overrides[open] > div {
  padding-bottom: 15px;
}
.collection-main {
  max-width: 1416px;
  width: 100%;
}
.collection-tools {
  padding: 17px 19px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
}
.catalog-searchbar {
  display: grid;
  grid-template-columns: minmax(210px, 1.7fr) repeat(2, minmax(145px, 1fr));
  gap: 14px;
}
.catalog-search {
  display: flex;
  align-items: center;
  position: relative;
}
.catalog-search .icon {
  position: absolute;
  left: 12px;
  color: var(--muted);
  pointer-events: none;
}
.catalog-search input {
  padding-left: 42px;
}
#catalog-facets {
  margin-top: 8px;
}
#catalog-facets summary,
.catalog-columns summary {
  width: max-content;
  cursor: pointer;
  color: var(--accent);
  padding: 7px 0;
  font-size: 0.85rem;
  font-weight: var(--weight-strong);
}
.catalog-facets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 8px 0 2px;
}
.collection-controls,
.collection-summary,
.catalog-view-tools,
.catalog-switch,
.catalog-taskbar,
.card-actions,
.selection-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.collection-controls {
  justify-content: space-between;
  margin-top: 16px;
  gap: 10px;
}
.collection-summary {
  min-width: 0;
}
.collection-summary > strong {
  white-space: nowrap;
  font-size: 1.13rem;
  letter-spacing: -0.025em;
}
.catalog-view-tools {
  gap: 16px;
}
.catalog-columns {
  position: relative;
}
.catalog-columns .columns-pop {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 3;
  min-width: 165px;
  border: 1px solid var(--line);
  padding: 6px 13px;
  background: #fff;
  border-radius: 7px;
  box-shadow: 0 5px 15px #253b3014;
}
.catalog-switch {
  gap: 0;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.catalog-mode {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 0.82rem;
  border-radius: 4px;
}
.catalog-mode .icon {
  width: 15px;
  height: 15px;
}
.catalog-mode[aria-pressed="true"] {
  background: var(--pale);
  color: var(--accent);
}
.catalog-taskbar {
  flex-wrap: wrap;
  justify-content: flex-start;
  margin: 12px 0 15px;
  border-block: 1px solid var(--line);
}
.catalog-taskbar label {
  font-size: 0.82rem;
  font-weight: var(--weight-strong);
}
.catalog-taskbar select {
  width: auto;
  max-width: calc(100% - 90px);
  min-height: 36px;
  padding: 4px 24px 4px 8px;
  margin: 7px 0;
}
.catalog-taskbar .subtle {
  margin-left: auto;
}
.catalog-page.view-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
  align-items: stretch;
}
.catalog-card {
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #cbd4cd;
  border-radius: 7px;
}
.catalog-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.rug-link {
  display: block;
  min-width: 0;
  text-decoration: none;
  color: var(--ink);
  border-radius: 6px 6px 0 0;
}
.rug-image {
  display: grid;
  place-items: center;
  overflow: hidden;
  aspect-ratio: 4/5;
  border-radius: 6px 6px 0 0;
  background: #e9e5dd;
  border-bottom: 1px solid var(--lightline);
}
.rug-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.no-photo {
  display: grid;
  justify-items: center;
  gap: 8px;
  color: #55564c;
  font-size: 0.75rem;
}
.no-photo .icon {
  width: 29px;
  height: 29px;
}
.rug-select {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: #fffffff2;
  border: 1px solid #b6c0b7;
  border-radius: 5px;
  cursor: pointer;
}
.rug-select input {
  width: 18px;
  height: 18px;
  margin: 0;
}
.rug-caption {
  display: grid;
  gap: 4px;
  padding: 13px 13px 5px;
}
.rug-number {
  font-size: 0.79rem;
  font-weight: var(--weight-strong);
  color: var(--muted);
  overflow-wrap: anywhere;
}
.rug-caption strong {
  overflow-wrap: anywhere;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 1.24rem;
  line-height: 1.22;
}
.rug-link:hover .rug-caption strong {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.card-data {
  padding: 0 13px 10px;
  display: grid;
  gap: 7px;
}
.catalog-specs,
.catalog-meta,
.catalog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 8px;
  color: var(--muted);
  font-size: 0.81rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.catalog-specs span + span:before {
  content: "·";
  margin-right: 7px;
}
.catalog-tags > span {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 4px;
}
.catalog-meta small {
  font-size: 0.72rem;
}
.catalog-status .tag {
  white-space: normal;
}
.card-actions {
  flex-wrap: wrap;
  gap: 0 10px;
  margin-top: auto;
  padding: 0 10px;
  border-top: 1px solid var(--lightline);
}
.rug-action {
  color: var(--accent);
  padding: 7px 3px;
  min-height: 40px;
  font-size: 0.8rem;
  line-height: 1.3;
}
.rug-action:hover {
  text-decoration: underline;
}
.rug-action:disabled {
  opacity: 0.65;
  cursor: default;
}
.rug-action .icon {
  width: 16px;
  height: 16px;
}
.inline-edit:not(:empty) {
  border-top: 1px solid var(--line);
  padding: 12px;
}
.inline-edit .form-grid {
  grid-template-columns: 1fr;
}
#catalog-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 16px 0;
}
#catalog-selection {
  position: fixed;
  z-index: 7;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 9px 14px;
  background: #fff;
  border: 1px solid var(--accent);
  border-radius: 9px;
  box-shadow: 0 3px 20px #132d272e;
}
#catalog-selection[hidden] {
  display: none;
}
#catalog-selection strong {
  white-space: nowrap;
  font-size: 0.9rem;
}
.selection-actions {
  flex-wrap: wrap;
  gap: 5px;
}
.selection-actions button {
  min-height: 38px;
  padding: 6px 10px;
  font-size: 0.83rem;
}
body:has(#catalog-selection:not([hidden])) #notice {
  bottom: 88px;
}
.view-list .catalog-card {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(200px, 1fr) minmax(170px, 1.1fr) minmax(
      130px,
      0.7fr
    );
  margin-top: -1px;
  border-radius: 0;
  padding: 7px 10px 7px 44px;
}
.view-list .rug-select {
  top: 50%;
  transform: translateY(-50%);
  left: 4px;
  width: 32px;
  height: 32px;
  border: 0;
}
.view-list .rug-link {
  display: flex;
  align-items: center;
  gap: 10px;
}
.view-list .rug-image {
  flex: none;
  width: 54px;
  height: 63px;
  border-radius: 4px;
  border: 0;
}
.view-list .no-photo {
  font-size: 0;
  gap: 0;
}
.view-list .no-photo .icon {
  width: 18px;
}
.view-list .rug-caption {
  padding: 0;
  gap: 2px;
}
.view-list .rug-caption strong {
  font: 650 0.95rem/1.3 var(--font);
}
.view-list .card-data {
  padding: 2px 12px;
  gap: 4px;
}
.view-list .card-actions {
  padding: 0;
  border: 0;
  margin: auto 0;
}
.view-list .inline-edit:not(:empty) {
  grid-column: 1/-1;
}
.item-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.item-photos img {
  min-width: 0;
  width: min(100%, 250px);
  height: 200px;
  object-fit: contain;
}
@media (min-width: 1420px) {
  .catalog-page.view-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
@media (max-width: 999px) {
  .catalog-page.view-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
}
@media (max-width: 740px) {
  .catalog-searchbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .catalog-searchbar > .field:first-child {
    grid-column: 1/-1;
  }
  .catalog-facets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .collection-tools {
    padding: 12px;
  }
  .catalog-page.view-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
  }
  .catalog-view-tools {
    gap: 10px;
  }
  .catalog-mode {
    padding: 6px;
  }
  .collection-summary {
    flex-wrap: wrap;
    gap: 0 5px;
  }
  .collection-summary > strong {
    font-size: 1rem;
  }
  .catalog-taskbar {
    gap: 5px;
  }
  .catalog-taskbar select {
    max-width: calc(100% - 85px);
    font-size: 0.84rem;
  }
  .catalog-taskbar > button {
    font-size: 0.82rem;
  }
  .rug-caption {
    padding: 9px 8px 4px;
  }
  .rug-caption strong {
    font-size: 1.04rem;
  }
  .card-data {
    padding: 0 8px 7px;
    gap: 4px;
  }
  .card-actions {
    padding: 0 5px;
    gap: 0 5px;
  }
  .rug-number,
  .catalog-specs,
  .catalog-meta {
    font-size: 0.73rem;
  }
  .catalog-status .tag {
    font-size: 0.69rem;
  }
  .rug-select {
    width: 33px;
    height: 33px;
    left: 5px;
    top: 5px;
  }
  .view-list .catalog-card {
    grid-template-columns: minmax(0, 1fr) minmax(100px, 0.65fr);
    padding-left: 36px;
  }
  .view-list .card-data {
    padding: 0 0 0 6px;
  }
  .view-list .card-actions {
    grid-column: 1/-1;
  }
  #catalog-selection {
    width: calc(100% - 16px);
    bottom: 6px;
    gap: 6px;
    flex-wrap: wrap;
    padding: 6px 8px;
  }
  .collection-main:has(#catalog-selection:not([hidden])) {
    padding-bottom: 130px;
  }
  .selection-actions button {
    padding: 4px 6px;
  }
}
@media (max-width: 380px) {
  .catalog-taskbar label {
    width: 100%;
    padding-top: 5px;
  }
  .catalog-taskbar select {
    max-width: 62%;
  }
  .catalog-view-tools {
    gap: 5px;
  }
  .catalog-mode .icon {
    display: none;
  }
  .rug-select {
    left: 4px;
    top: 4px;
  }
}
.columns-pop {
  max-height: min(60vh, 340px);
  overflow: auto;
}
.gallery-view {
  height: min(62vh, 520px);
  display: grid;
  place-items: center;
  background: #e9e5dd;
  margin-bottom: 10px;
}
.gallery-view img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
@media (min-width: 741px) {
  .collection-main {
    padding-top: 22px;
  }
  .collection-main .heading {
    margin-bottom: 14px;
  }
  .collection-tools {
    padding: 12px 16px 6px;
  }
  .collection-controls {
    margin-top: 9px;
  }
  .catalog-taskbar {
    margin: 6px 0 11px;
  }
}
@media (max-width: 740px) {
  .collection-main .heading {
    margin-bottom: 10px;
  }
  .collection-tools .catalog-searchbar {
    display: block;
  }
  .collection-controls {
    margin-top: 8px;
  }
  .catalog-taskbar {
    margin: 6px 0 10px;
  }
  .collection-main .collection-tools {
    padding: 9px 11px 2px;
  }
  #catalog-facets {
    margin-top: 2px;
  }
}
.catalog-edit [hidden] {
  display: none;
}
/* A facet keeps keyboard and touch selection in one place while its result set updates. */
.facet-picker {
  position: relative;
  min-width: 0;
}
.facet-picker > summary,
#catalog-facets .facet-picker > summary {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 0;
  list-style: none;
  color: var(--ink);
  font-size: 0.88rem;
}
.facet-picker > summary::-webkit-details-marker {
  display: none;
}
.facet-label {
  font-weight: var(--weight-strong);
  text-align: left;
}
.facet-value {
  min-height: 46px;
  width: 100%;
  min-width: 0;
  padding: 9px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border: 1px solid #aebcb5;
  border-radius: 6px;
  background: var(--paper);
  font-weight: var(--weight-regular);
}
.facet-value-text {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.facet-value .icon {
  width: 16px;
  height: 16px;
}
.facet-picker[open] .facet-value,
.facet-picker.has-values .facet-value {
  border-color: var(--accent);
  color: var(--accent);
}
.facet-picker[open] .facet-value .icon {
  transform: rotate(180deg);
}
.facet-menu {
  position: absolute;
  z-index: 6;
  top: calc(100% + 3px);
  left: 0;
  width: max(100%, 215px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px;
  box-shadow: 0 5px 15px #1c2b281e;
}
.facet-menu fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.facet-values {
  max-height: min(36vh, 280px);
  overflow: auto;
  overscroll-behavior: contain;
}
.facet-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 4px 6px;
  font-size: 0.91rem;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.facet-option input {
  flex: none;
}
.facet-option-detail {
  display: block;
  margin-block-start: 1px;
  color: var(--muted);
  font-size: 0.81rem;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}
.facet-option:hover {
  background: var(--bg);
}
.facet-option[hidden],
.facet-no-match[hidden],
.description-tail[hidden] {
  display: none;
}
.facet-search {
  display: block;
  margin-bottom: 4px;
}
.facet-empty,
.facet-no-match {
  display: block;
  padding: 8px;
}
.facet-footer {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
}
.facet-footer button {
  min-height: 44px;
}
.catalog-facets > .facet-picker:last-child .facet-menu,
.catalog-searchbar > .facet-picker:last-child .facet-menu {
  left: auto;
  right: 0;
}
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.active-filters:not(:empty) {
  padding: 8px 0;
}
.active-filters button {
  min-height: 32px;
  padding: 2px 8px;
  color: var(--accent);
  background: var(--pale);
  font-size: 0.79rem;
  text-align: left;
}
.active-filters button:hover {
  text-decoration: underline;
}
.rug-media {
  min-width: 0;
}
button.rug-image {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 0;
  min-height: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
}
.image-expand {
  position: absolute;
  right: 5px;
  bottom: 5px;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  background: var(--paper);
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 5px;
}
.image-expand .icon {
  width: 15px;
  height: 15px;
}
.rug-angles {
  display: flex;
  align-items: center;
  gap: 3px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 4px 5px;
  scrollbar-width: thin;
}
.angle-thumb {
  flex: 0 0 45px;
  height: 44px;
  min-height: 44px;
  min-width: 44px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg);
}
.angle-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.angle-thumb[aria-pressed="true"] {
  border: 2px solid var(--accent);
  padding: 1px;
}
.angle-thumb:hover {
  border-color: var(--accent);
}
.angle-thumb:focus-visible {
  outline-offset: -3px;
}
.angle-thumb:disabled {
  opacity: 0.7;
  cursor: default;
  font-size: 0.55rem;
  color: var(--muted);
}
.catalog-description {
  font-size: 0.85rem;
  color: var(--ink);
  line-height: 1.42;
  overflow-wrap: anywhere;
}
.description-more {
  min-height: 28px;
  padding: 0 4px;
  margin-left: 3px;
  color: var(--accent);
  font-size: 0.8rem;
  text-decoration: underline;
}
.angle-error {
  display: block;
  font-size: 0.72rem;
  font-weight: var(--weight-strong);
  color: var(--warning);
  padding: 0 7px 3px;
}
.catalog-hero[hidden],
.angle-error[hidden] {
  display: none;
}
.view-list .catalog-card {
  grid-template-columns:
    minmax(112px, 0.7fr) minmax(135px, 0.9fr) minmax(175px, 1.4fr)
    minmax(105px, 0.65fr);
  grid-template-areas: "media name data actions";
  gap: 8px;
}
.view-list .rug-media {
  grid-area: media;
  width: 100%;
  max-width: 160px;
}
.view-list .rug-image {
  width: 100%;
  height: 88px;
  border: 0;
}
.view-list .rug-link {
  grid-area: name;
}
.view-list .card-data {
  grid-area: data;
}
.view-list .card-actions {
  grid-area: actions;
}
.view-list .rug-angles {
  padding: 3px 0;
}
.view-list .inline-edit:empty {
  display: none;
}
@media (max-width: 740px) {
  .catalog-facets > .facet-picker[open] {
    grid-column: 1/-1;
  }
  .catalog-facets .facet-menu {
    position: static;
    width: 100%;
    margin-top: 3px;
    box-shadow: none;
  }
  .active-filters button {
    min-height: 44px;
  }
  .view-list .catalog-card {
    grid-template-columns: minmax(86px, 0.65fr) minmax(0, 1fr);
    grid-template-areas: "media name" "media data" "actions actions";
    gap: 4px 8px;
  }
  .view-list .rug-media {
    max-width: 125px;
  }
  .view-list .rug-image {
    height: 100px;
  }
  .view-list .rug-caption {
    align-self: start;
  }
  .view-list .card-data {
    padding: 0;
  }
  .view-list .inline-edit:not(:empty) {
    grid-column: 1/-1;
  }
  .catalog-description {
    font-size: 0.79rem;
  }
}
.angle-frame {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 2px;
}
.angle-frame img.angle-strip {
  position: absolute;
  top: 0;
  height: 100%;
  max-width: none;
  object-fit: fill;
}
.size-filter-note:not(:empty) {
  display: block;
  padding: 6px;
}
.collection-workspace {
  min-width: 0;
}
#catalog-sidebar[hidden],
#catalog-sidebar [hidden] {
  display: none;
}
@media (min-width: 1024px) {
  .collection-layout {
    display: grid;
    grid-template-columns: clamp(208px, 18.5vw, 248px) minmax(0, 1fr);
    column-gap: 24px;
    align-items: start;
  }
  #catalog-sidebar {
    position: sticky;
    top: 12px;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    align-self: start;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
  }
  .sidebar-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 46px;
    padding: 3px 6px 3px 13px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
  }
  .sidebar-header h2 {
    font-size: 1.05rem;
  }
  .sidebar-header .subtle,
  .sidebar-facet-head .subtle {
    padding: 4px 6px;
    min-height: 29px;
    font-size: 0.76rem;
  }
  .sidebar-header .subtle:disabled,
  .sidebar-facet-head .subtle:disabled {
    visibility: hidden;
  }
  #sidebar-facets {
    padding-inline: 12px;
  }
  .sidebar-facet {
    padding: 7px 0 9px;
    border-bottom: 1px solid var(--lightline);
  }
  .sidebar-facet:last-child {
    border-bottom: 0;
  }
  .sidebar-facet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    min-height: 28px;
  }
  .sidebar-facet-head h3 {
    font-size: 0.87rem;
    line-height: 1.2;
  }
  .sidebar-count:not(:empty) {
    font-size: 0.72rem;
    padding: 2px 4px;
    border-radius: 3px;
    margin-left: 3px;
    background: var(--pale);
    color: var(--accent);
  }
  .sidebar-facet .facet-menu {
    position: static;
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .sidebar-facet .facet-footer {
    display: none;
  }
  .sidebar-facet .facet-option {
    min-height: 29px;
    gap: 7px;
    font-size: 0.83rem;
    padding: 3px 1px;
  }
  .sidebar-facet .facet-option input {
    width: 17px;
    height: 17px;
    margin: 0;
  }
  .sidebar-facet .facet-values {
    max-height: none;
    overflow: visible;
  }
  .sidebar-facet .compact-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
    column-gap: 5px;
  }
  .sidebar-facet .facet-values:focus-visible {
    outline-offset: -2px;
  }
  #facet-dimensions.sidebar-facet .facet-values {
    overscroll-behavior-y: contain;
  }
  .sidebar-facet .facet-values[tabindex] {
    max-height: 135px;
    overflow: auto;
    scrollbar-width: thin;
    padding-right: 4px;
  }
  .sidebar-facet .facet-search input {
    min-height: 34px;
    font-size: 0.82rem;
    padding: 5px 8px;
  }
  .sidebar-facet .facet-search {
    margin: 4px 0 3px;
  }
  .sidebar-facet .size-filter-note:not(:empty) {
    padding: 4px 0 0;
    font-size: 0.71rem;
  }
  .sidebar-facet [data-act="more-sizes"] {
    padding: 2px 3px;
    min-height: 29px;
    font-size: 0.77rem;
  }
  .collection-workspace #catalog-facets {
    display: none;
  }
  .collection-workspace .collection-tools {
    padding: 0;
    border: 0;
    background: transparent;
  }
  .collection-workspace .catalog-searchbar {
    display: block;
  }
  .collection-workspace .active-filters:not(:empty) {
    padding-bottom: 0;
  }
  .collection-workspace .catalog-page.view-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
  }
}
@media (min-width: 1280px) {
  .collection-workspace .catalog-page.view-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) and (pointer: coarse) {
  .sidebar-facet .facet-option,
  .sidebar-facet-head .subtle,
  .sidebar-header .subtle,
  .sidebar-facet [data-act="more-sizes"] {
    min-height: 44px;
  }
}

/* Worker phone: fuzzy find with an in-bar scanner. */
#main:focus {
  outline: none;
}
.find {
  display: grid;
  gap: 12px;
  padding-bottom: 12px;
}
.find-count {
  color: var(--muted);
  font-size: 0.9rem;
}
.find-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.find-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  text-decoration: none;
}
.find-row img,
.find-nophoto {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--pale);
  display: grid;
  place-items: center;
  color: var(--muted);
}
.find-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.find-text > * {
  overflow-wrap: anywhere;
}
.find-text strong {
  font-size: 1.02rem;
}
.find-dock {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin-inline: -4px;
  padding: 10px 4px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, transparent, var(--bg) 14px);
}
.find-bar {
  display: flex;
  align-items: center;
  position: relative;
  background: white;
  border: 1.5px solid var(--accent);
  border-radius: 12px;
  box-shadow: 0 4px 16px #16483f22;
}
.find-bar > .icon {
  position: absolute;
  left: 13px;
  color: var(--muted);
  pointer-events: none;
}
.find-bar input {
  flex: 1;
  min-width: 0;
  min-height: 54px;
  border: 0 !important;
  border-radius: 12px;
  padding-left: 42px !important;
  font-size: 17px;
  background: transparent;
}
.find-scan {
  flex: none;
  width: 54px;
  min-height: 54px;
  margin: 3px;
  border-radius: 9px;
  background: var(--accent);
  color: white;
}
.find-scan .icon {
  width: 26px;
  height: 26px;
}
.scan-miss h2 {
  overflow-wrap: anywhere;
}
.photo-add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.photo-add .button {
  flex: 1 1 140px;
}
.photo-add[aria-busy="true"] .button {
  opacity: 0.6;
  pointer-events: none;
}
.photo-add .form-error:empty {
  display: none;
}
/* 2.25 x 1.25 in thermal label: barcode with number and size beside it. */
.small-label {
  width: 2.25in;
  max-width: 100%;
  padding: 0.06in 0.08in;
  display: grid;
  grid-template-columns: 1.3in 1fr;
  align-items: center;
  gap: 0.06in;
  font-family: var(--font);
}
.small-label svg {
  width: 100%;
  height: auto;
  max-height: 1.1in;
}
.small-label .label-text {
  display: grid;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.small-label .label-number {
  font-size: 12pt;
  line-height: 1.1;
}
.small-label .label-size {
  font-size: 9pt;
  line-height: 1.2;
}
@media print {
  @page {
    size: 2.25in 1.25in;
    margin: 0;
  }
  #print-area .small-label {
    width: 2.25in;
    height: 1.25in;
    padding: 0.05in 0.08in;
    overflow: hidden;
  }
}
/* Audit: tap targets >= 24px everywhere, 44px on touch screens. */
a.rug-link,
.review-warehouse,
.quiet-link,
.subtle,
input[type="checkbox"],
input[type="radio"] {
  min-height: 24px;
  min-width: 24px;
}
.find-dock,
.photo-add {
  scroll-margin-bottom: 90px;
}
@media (pointer: coarse) {
  .rug-select {
    width: 44px;
    height: 44px;
  }
  .rug-select input,
  .facet-option input,
  .choice input {
    width: 22px;
    height: 22px;
  }
  a.rug-link,
  .review-warehouse,
  .quiet-link,
  .subtle,
  .nav a,
  .back,
  button[data-logout],
  .facet-option,
  .choice {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  a.rug-link {
    display: flex;
  }
}
@media (max-width: 640px) {
  .mast-inner,
  .nav-inner,
  .container {
    padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right));
  }
  .nav-inner {
    gap: 18px;
    overflow-x: auto;
    flex-wrap: nowrap !important;
    scrollbar-width: none;
  }
  .container:has(.find) {
    padding-bottom: 0;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}
.find-bar input:focus-visible {
  outline: var(--focus-ring);
  outline-offset: -3px;
}
/* Phones: keep search and scan in thumb reach at the bottom of the screen. */
@media (max-width: 740px) {
  .find {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }
  .find-dock {
    position: fixed;
    left: 0;
    right: 0;
    margin: 0;
    padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right));
  }
}
.photo-add input[type="file"] {
  display: none;
}
.remove-item summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--error);
  font-weight: var(--weight-strong);
}
.danger {
  color: var(--error);
  border-color: #d9b0b0;
}
.facet-count {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: var(--weight-strong);
}
#location-note {
  margin-left: 10px;
}
/* Size bucket counts: one option per line with its rug count at the end. */
.facet-option .facet-count {
  margin-inline-start: auto;
  padding-inline-start: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}
.facet-option.is-empty {
  opacity: 0.55;
}
.facet-select {
  display: block;
  padding: 4px 6px;
}
.facet-select select {
  width: 100%;
  min-height: 44px;
  font-size: 1rem;
}
@media (min-width: 1024px) and (pointer: fine) {
  .sidebar-facet .facet-select select {
    min-height: 32px;
    font-size: 0.83rem;
  }
}
/* Shared tokens (audit 19): one type scale, spacing step and focus ring for every screen. */
:root {
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px;
  --text-sm: 0.875rem; --text-md: 1rem; --text-lg: 1.25rem;
  --focus-ring: 3px solid #b27421;
  --weight-regular: 400; --weight-strong: 600; --weight-bold: 700;
  --target-min: 24px;
}
:focus-visible { outline: var(--focus-ring); outline-offset: 3px; }
/* Chrome drops :focus-visible while moving between the month/day/year parts of a date box. */
/* Three weights only: regular, strong and bold (strong inside bold text stays bold, not black). */
b, strong, th { font-weight: var(--weight-bold); }
input[type="date"]:is(:focus, :focus-within) { outline: var(--focus-ring); outline-offset: 3px; }
/* Audit 16: every control at least 24px; 44px on touch screens. */
button, .button, select, input:not([type="checkbox"]):not([type="radio"]), a.back, .nav a { min-height: var(--target-min); }
input[type="checkbox"], input[type="radio"] { min-width: 20px; min-height: 20px; }
@media (pointer: coarse) {
  :root { --target-min: 44px; }
  input[type="checkbox"], input[type="radio"] { min-width: 24px; min-height: 24px; }
  .compact, .page-nav button { min-height: 44px; }
  body select, body textarea, body button, body .button,
  body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) { min-height: 44px; }
}
/* Audit 24: selects look clickable and buttons respond when pressed. */
select, label:has(> input[type="checkbox"]), summary { cursor: pointer; }
button:active:not(:disabled), .button:active { transform: translateY(1px); filter: brightness(0.94); }
.primary:active:not(:disabled) { background: var(--active); }
/* Audit 22: on phones the admin nav scrolls sideways instead of wrapping into a tall block. */
@media (max-width: 740px) {
  .nav-inner { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
  .nav-inner::-webkit-scrollbar { display: none; }
  .nav a { flex: none; white-space: nowrap; }
}
.import-details { margin-top: var(--space-4); border-top: 1px solid var(--lightline); padding-top: var(--space-3); }
.import-details summary { font-weight: var(--weight-strong); color: var(--muted); min-height: 44px; display: flex; align-items: center; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Audit 2: every control on a touch screen is at least 44px tall (iPhone), whatever the page's own sizes. */
@media (pointer: coarse) {
  #main :is(button, summary, select, .button, a.back),
  #main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) { min-height: 44px; }
  #main .rug-action { min-width: 44px; }
}

/* Staff and client logins (logins.js) */
.notice-box {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid #e3d3a4;
  background: #fbf6e6;
  font-size: 0.92rem;
  line-height: 1.5;
}
.role-choices {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.role-choices legend {
  font-weight: var(--weight-strong);
  margin-bottom: 6px;
}
.role-choice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--lightline);
  cursor: pointer;
  min-height: 44px;
}
.role-choice:has(input:checked) {
  border-color: #16483f;
  background: #e8f0e9;
}
.role-choice input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex: none;
}
.role-choice span {
  display: grid;
  gap: 2px;
}
.role-choice small {
  color: var(--muted);
  font-size: 0.85rem;
}
.password-field {
  display: grid;
  gap: 6px;
}
.password-field > label:first-child {
  font-weight: var(--weight-strong);
}
.password-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.password-row input {
  flex: 1 1 180px;
  min-width: 0;
}
.password-field small {
  color: var(--muted);
}
.form-buttons,
.access-buttons,
.handover-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.login-group {
  margin: 0;
  padding: 12px 16px 4px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.handover dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 14px;
  margin: 14px 0 18px;
}
.handover dt {
  color: var(--muted);
}
.handover dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.handover-password {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 1.05rem;
}
