:root {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  color: #16333b;
  background: #f3f6f5;
  font-size: 112.5%;
  --ink: #16333b;
  --muted: #64777c;
  --line: #dbe4e2;
  --accent: #136c64;
  --wash: #e7f3ef;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
.logo-filter-definitions {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 16px;
  background: white;
  color: var(--ink);
  font-weight: 600;
}
button:hover {
  background: #edf4f1;
}
.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.primary:hover {
  background: #105850;
}
.dark {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
.quiet {
  background: none;
  border-color: transparent;
  color: var(--muted);
}
.danger {
  color: #a23434;
}
.small {
  font-size: 0.875rem;
  padding: 7px 10px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 2.125rem;
  letter-spacing: -1.2px;
  font-weight: 600;
  margin-bottom: 12px;
}
h2 {
  font-size: 1.4375rem;
  letter-spacing: -0.5px;
}
h3 {
  font-size: 1rem;
}
p {
  line-height: 1.6;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: 0.875rem;
  letter-spacing: 2px;
  font-weight: 700;
  text-transform: uppercase;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 750;
  letter-spacing: 2px;
  font-size: 0.9375rem;
}
.brandmark {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  background: #d8eee4;
  color: #164f46;
  border-radius: 10px;
  font-size: 1.3125rem;
  letter-spacing: -3px;
  padding-right: 3px;
}
.brand small {
  display: block;
  font-size: 0.875rem;
  letter-spacing: 3px;
  font-weight: 500;
  margin-top: 3px;
}
.loading {
  padding: 20vh 10vw;
  font-size: 1.5rem;
  letter-spacing: 3px;
}
.loading span {
  display: block;
  font-size: 0.875rem;
  letter-spacing: 0;
  margin-top: 20px;
}
.auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
.auth-story {
  background: #153a40;
  color: #f4f9f7;
  padding: 54px 65px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-story:after {
  content: '';
  position: absolute;
  width: 470px;
  height: 470px;
  border: 1px solid #5f858575;
  border-radius: 50%;
  right: -210px;
  bottom: -180px;
  box-shadow:
    0 0 0 65px #517d7722,
    0 0 0 130px #517d7715;
}
.auth-story h1 {
  font-size: 3.625rem;
  line-height: 1.1;
  letter-spacing: -2.5px;
  max-width: 530px;
  margin-top: 80px;
}
.auth-story p {
  color: #bcd2d1;
  max-width: 410px;
  font-size: 1.0625rem;
}
.auth-story footer {
  color: #91b2b1;
  font-size: 0.875rem;
  margin-top: 60px;
}
.auth-content {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px;
}
.auth-form {
  width: 100%;
  max-width: 390px;
}
.auth-form h2 {
  font-size: 1.8125rem;
}
.auth-form .primary {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
}
.field {
  display: block;
  margin: 0 0 18px;
  font-size: 0.875rem;
  font-weight: 600;
}
.field small {
  display: block;
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 400;
  margin-top: 6px;
  line-height: 1.5;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #cbd7d4;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  margin-top: 7px;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #327b70;
  outline: 2px solid #bfdbd2;
}
textarea {
  resize: vertical;
  min-height: 90px;
}
.error {
  background: #fff0ed;
  color: #9b3030;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 14px 0;
}
.error:empty {
  display: none;
}
.shell {
  max-width: 1640px;
  margin: auto;
}
.topbar {
  background: white;
  border-bottom: 1px solid var(--line);
  padding: 20px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
}
.userbar {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 0.875rem;
}
.avatar {
  background: var(--wash);
  border-radius: 50%;
  height: 36px;
  width: 36px;
  display: grid;
  place-items: center;
  font-size: 0.875rem;
  font-weight: 700;
}
.navigation {
  display: flex;
  gap: 24px;
  padding: 0 36px;
  background: white;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.navigation button {
  border: 0;
  border-radius: 0;
  padding: 18px 0;
  color: var(--muted);
  white-space: nowrap;
  font-size: 0.875rem;
  border-bottom: 3px solid transparent;
}
.navigation button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
main {
  padding: 38px 36px 70px;
}
.pagehead {
  display: flex;
  justify-content: space-between;
  gap: 25px;
  align-items: flex-start;
  margin-bottom: 26px;
}
.pagehead p {
  margin-bottom: 0;
}
.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.tag {
  background: var(--wash);
  color: #236b51;
  font-size: 0.875rem;
  padding: 6px 9px;
  border-radius: 6px;
  white-space: nowrap;
}
.tag.grey {
  background: #edf0f2;
  color: #64777c;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 22px 0;
}
.stat {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
}
.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 10px;
}
.stat strong {
  font-size: 1.8125rem;
  font-weight: 600;
  letter-spacing: -0.8px;
}
.filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 230px 190px;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfc;
  border-radius: 12px 12px 0 0;
}
.filters input,
.filters select {
  margin: 0;
  background: white;
  font-size: 0.875rem;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.tablewrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 0.875rem;
}
thead {
  background: #f6f9f8;
  color: var(--muted);
  font-size: 0.875rem;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
th {
  padding: 15px 22px;
  font-weight: 650;
  white-space: nowrap;
}
td {
  padding: 21px 22px;
  border-top: 1px solid #eaf0ed;
  vertical-align: middle;
}
td strong {
  font-size: 0.875rem;
  font-weight: 600;
}
td small {
  display: block;
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: 6px;
}
.product-name {
  min-width: 210px;
  max-width: 360px;
}
.strength {
  font-size: 0.875rem;
  color: #3b6f67;
  display: inline-block;
  border: 1px solid #d8e8e2;
  background: #f5faf7;
  padding: 6px 8px;
  border-radius: 5px;
  white-space: nowrap;
}
.price {
  font-variant-numeric: tabular-nums;
  font-size: 1.0625rem;
  font-weight: 650;
  white-space: nowrap;
}
.reports {
  display: flex;
  gap: 10px;
  font-size: 0.875rem;
  white-space: nowrap;
}
.quantity {
  display: flex;
  align-items: center;
  gap: 8px;
}
.quantity input {
  width: 66px;
  margin: 0;
  padding: 9px 7px;
}
.tablefoot {
  display: flex;
  justify-content: space-between;
  padding: 16px 22px;
  color: var(--muted);
  font-size: 0.875rem;
  border-top: 1px solid var(--line);
}
.empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--muted);
}
.empty h3 {
  color: var(--ink);
}
.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.formpanel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 26px;
}
.formgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}
.span2 {
  grid-column: 1/-1;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
}
.check input {
  width: auto;
  margin: 0;
}
.toolbar-note {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 450px;
}
.order-row {
  cursor: pointer;
}
.order-row:hover {
  background: #f9fcfa;
}
.order-total {
  text-align: right;
}
dialog {
  border: 0;
  border-radius: 16px;
  box-shadow: 0 25px 100px #092d3544;
  max-width: 780px;
  width: calc(100% - 40px);
  padding: 30px;
  color: var(--ink);
}
dialog::backdrop {
  background: #142f3580;
  backdrop-filter: blur(3px);
}
.dialoghead {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 15px;
  margin-bottom: 25px;
}
.dialoghead h2 {
  margin-bottom: 6px;
}
.dialogfoot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 12px;
}
.cartitem {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}
.cartitem .detail {
  flex: 1;
}
.cartitem input {
  width: 75px;
  margin: 0;
}
.summary {
  display: flex;
  justify-content: space-between;
  padding: 24px 0;
  font-size: 1.25rem;
}
.timeline {
  margin: 25px 0;
  padding-left: 17px;
  border-left: 2px solid #d7e8df;
}
.timeline article {
  padding: 0 0 22px 10px;
}
.timeline article p {
  margin: 7px 0 0;
  font-size: 0.875rem;
  white-space: pre-wrap;
}
.timeline time {
  font-size: 0.875rem;
  color: var(--muted);
  display: block;
  margin-top: 5px;
}
.notice {
  padding: 14px 16px;
  background: #eef5f2;
  color: #355f54;
  border-radius: 9px;
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 16px 0;
}
.private {
  color: #6d6289;
}
.linkbox {
  word-break: break-all;
  background: #eef5f2;
  padding: 15px;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-top: 15px;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  padding: 13px 23px;
  background: #163a34;
  color: white;
  border-radius: 10px;
  box-shadow: 0 8px 25px #173b3330;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 100;
}
#toast.show {
  opacity: 1;
}
.desktopnote {
  font-size: 0.875rem;
  color: var(--muted);
  padding: 20px 36px;
  border-top: 1px solid var(--line);
}
.print-only {
  display: none;
}
.negative {
  color: #a23434;
}
@media (max-width: 1050px) {
  .auth-story {
    padding: 40px;
  }
  .auth-story h1 {
    font-size: 2.875rem;
  }
  .topbar,
  main {
    padding-left: 22px;
    padding-right: 22px;
  }
  .navigation {
    padding: 0 22px;
  }
  .filters {
    grid-template-columns: 1fr 1fr;
  }
  .filters input {
    grid-column: 1/-1;
  }
  .two {
    grid-template-columns: 1fr;
  }
  td,
  th {
    padding-left: 15px;
    padding-right: 15px;
  }
  .user-name {
    display: none;
  }
}
@media (max-width: 680px) {
  .auth {
    display: block;
  }
  .auth-story {
    padding: 24px;
  }
  .auth-story h1,
  .auth-story p,
  .auth-story footer {
    display: none;
  }
  .auth-content {
    padding: 40px 24px;
  }
  .topbar {
    padding: 16px;
  }
  .brand {
    font-size: 0.875rem;
  }
  .userbar {
    gap: 8px;
  }
  .navigation {
    gap: 20px;
    padding: 0 16px;
  }
  main {
    padding: 25px 16px;
  }
  h1 {
    font-size: 1.75rem;
  }
  .pagehead {
    display: block;
  }
  .pagehead .actions {
    margin-top: 18px;
  }
  .stats {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
  }
  .stat {
    padding: 15px 10px;
  }
  .stat strong {
    font-size: 1.375rem;
  }
  .filters {
    padding: 14px;
    gap: 10px;
    grid-template-columns: 1fr;
  }
  .filters input {
    grid-column: auto;
  }
  .formgrid {
    grid-template-columns: 1fr;
  }
  .span2 {
    grid-column: auto;
  }
  .formpanel {
    padding: 20px;
  }
  .cartitem {
    flex-wrap: wrap;
  }
  .cartitem .detail {
    min-width: 160px;
  }
  dialog {
    padding: 22px;
    width: calc(100% - 20px);
  }
  .desktopnote {
    padding: 18px;
  }
  .reports {
    flex-direction: column;
  }
}
@media print {
  @page {
    size: landscape;
    margin: 12mm;
  }
  body {
    background: white;
    font-size: 10pt;
  }
  .topbar,
  .navigation,
  .pagehead .actions,
  .filters,
  .stats,
  .desktopnote,
  .quantity,
  .no-print,
  #toast,
  dialog {
    display: none !important;
  }
  .print-only {
    display: block;
  }
  main {
    padding: 0;
  }
  .pagehead h1 {
    font-size: 24pt;
  }
  .panel {
    border: 0;
    overflow: visible;
  }
  .tablewrap {
    overflow: visible;
  }
  thead {
    display: table-header-group;
  }
  tr {
    break-inside: avoid;
  }
  th,
  td {
    padding: 11px 9px;
  }
  .price {
    font-size: 12pt;
  }
  .tablefoot {
    border: 0;
  }
  .order-total {
    text-align: left;
  }
  a {
    color: inherit;
  }
  .tablefoot button {
    display: none;
  }
  .product-name {
    min-width: 0;
  }
  table {
    font-size: 9pt;
  }
  .reports {
    display: flex;
  }
  .catalogue-reports > .product-seals {
    display: none;
  }
  .print-product-seals .product-seals {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin: 4px 0 0;
  }
  .print-product-seals .product-seals:empty {
    display: none;
  }
  .print-product-seals .tag {
    background: none;
    color: black;
    border: 0;
    padding: 0;
    font-size: 9pt;
    font-weight: 700;
    text-transform: uppercase;
  }
  body:not(.printing-catalogue) main:before {
    content: 'Use Print price list in the Catalogue tab to print the current list.';
  }
  body:not(.printing-catalogue) .panel {
    display: none;
  }
}
.auth-help {
  margin-top: 24px;
}
/* Keep forms, long product names and dialogs usable on small touch screens. */
.field,
.formpanel,
.two > * {
  min-width: 0;
}
.detail,
.product-name,
.dialoghead > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
dialog {
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
body:has(dialog[open]) {
  overflow: hidden;
}
@media screen and (max-width: 680px) {
  input,
  select,
  textarea,
  .filters input,
  .filters select {
    font-size: 1rem;
    min-height: 44px;
  }
  button,
  .small,
  .navigation button {
    min-height: 44px;
  }
  .topbar {
    flex-wrap: wrap;
    gap: 12px;
  }
  .userbar {
    width: 100%;
    justify-content: flex-end;
  }
  .userbar .tag {
    margin-right: auto;
  }
  .navigation {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 12px;
    overflow: visible;
  }
  .navigation button {
    white-space: normal;
    padding: 12px 2px;
    line-height: 1.4;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
  }
  .stat span {
    margin: 0;
  }
  .tablefoot {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }
  .tablefoot .actions {
    justify-content: space-between;
  }
  .pagehead > button {
    margin-top: 16px;
  }
  .pagehead .actions > button {
    flex: 1;
  }
  .catalogue-table .product-name {
    min-width: 0;
  }
  .strength {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .catalogue-table tr {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .reports a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 3px;
  }
  table:not(.catalogue-table),
  table:not(.catalogue-table) tbody {
    display: block;
  }
  table:not(.catalogue-table) thead {
    display: none;
  }
  table:not(.catalogue-table) tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    padding: 20px 16px;
    border-bottom: 1px solid var(--line);
  }
  table:not(.catalogue-table) td {
    display: block;
    min-width: 0;
    border: 0;
    padding: 0;
    overflow-wrap: anywhere;
    white-space: normal;
  }
  table:not(.catalogue-table) td:first-child {
    grid-column: 1/-1;
    min-width: 0;
    max-width: none;
  }
  table:not(.catalogue-table) td:before {
    content: attr(data-label);
    display: block;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 500;
    margin-bottom: 6px;
  }
  table:not(.catalogue-table) td:last-child {
    grid-column: 1/-1;
  }
  table:not(.catalogue-table) td:last-child button {
    width: 100%;
  }
  .cartitem .detail {
    flex-basis: 100%;
    min-width: 0;
  }
  .cartitem .detail small {
    display: block;
    overflow-wrap: anywhere;
  }
  .cartitem input {
    flex: 1;
    min-width: 70px;
  }
  .cartitem button {
    flex: 1;
  }
  dialog {
    padding: 20px 16px;
    width: calc(100% - 16px);
    max-height: calc(100dvh - 16px);
  }
  .dialoghead {
    gap: 8px;
  }
  .dialoghead h2 {
    font-size: 1.375rem;
  }
  .dialoghead button {
    flex-shrink: 0;
    min-width: 44px;
    padding: 8px;
  }
  .dialogfoot {
    flex-direction: column-reverse;
  }
  .dialogfoot button {
    width: 100%;
  }
  .summary {
    font-size: 1.125rem;
    gap: 12px;
    flex-wrap: wrap;
  }
  .notice,
  .timeline {
    overflow-wrap: anywhere;
  }
  #toast {
    width: max-content;
    max-width: calc(100% - 32px);
    bottom: max(16px, env(safe-area-inset-bottom));
    font-size: 0.875rem;
  }
}
@media screen and (max-width: 1000px) {
  .catalogue-table,
  .catalogue-table tbody {
    display: block;
  }
  .catalogue-table thead {
    display: none;
  }
  .catalogue-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 18px 20px;
    gap: 14px;
    border-bottom: 1px solid var(--line);
  }
  .catalogue-table td {
    display: block;
    border: 0;
    padding: 0;
  }
  .catalogue-table .product-name {
    grid-column: 1/-1;
    max-width: none;
  }
  .catalogue-table td:nth-child(3) {
    font-size: 0.875rem;
    align-self: center;
    text-align: right;
  }
  .catalogue-table td:nth-child(5) {
    justify-self: end;
    align-self: center;
  }
  .catalogue-table td:last-child {
    grid-column: 1/-1;
  }
  .catalogue-table .quantity {
    justify-content: flex-end;
  }
  .catalogue-table .quantity button {
    padding: 9px 26px;
  }
  .catalogue-table .reports {
    flex-direction: row;
  }
}
/* Brand and appearance controls are shared by the public and admin screens. */
.brand-logo {
  display: block;
  width: 150px;
  height: 73px;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
  padding: 5px;
}
.auth-story .brand-logo {
  width: 205px;
  height: 100px;
}
.logo-preview {
  display: block;
  max-width: 100%;
  width: 260px;
  height: 130px;
  object-fit: contain;
  background: white;
  padding: 8px;
  border-radius: 8px;
  margin-bottom: 20px;
}
.theme-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--muted);
}
.theme-control select {
  width: auto;
  min-width: 95px;
  margin: 0;
}
.auth-form > .theme-control {
  justify-content: flex-end;
  margin-bottom: 26px;
}
.auth-toggle {
  width: 100%;
  margin-top: 14px;
}
.portal-panels {
  margin-top: 24px;
}
.formpanel h2:not(:first-child) {
  margin-top: 30px;
}
@media screen {
  :root[data-theme='dark'] {
    color-scheme: dark;
    --ink: #e4ecee;
    --muted: #a6b8bc;
    --line: #34474d;
    --accent: #71cbbb;
    --wash: #233e39;
    background: #111c21;
    color: var(--ink);
  }
  [data-theme='dark'] .topbar,
  [data-theme='dark'] .navigation,
  [data-theme='dark'] .panel,
  [data-theme='dark'] .formpanel,
  [data-theme='dark'] .stat,
  [data-theme='dark'] dialog {
    background: #1b292f;
    color: var(--ink);
  }
  [data-theme='dark'] input,
  [data-theme='dark'] select,
  [data-theme='dark'] textarea,
  [data-theme='dark'] button {
    background: #26373e;
    border-color: #465c63;
    color: var(--ink);
  }
  [data-theme='dark'] button:hover {
    background: #344d54;
  }
  [data-theme='dark'] .quiet {
    background: transparent;
    border-color: transparent;
    color: var(--muted);
  }
  [data-theme='dark'] .primary,
  [data-theme='dark'] .dark {
    background: #72cdbb;
    color: #102c28;
    border-color: #72cdbb;
  }
  [data-theme='dark'] .primary:hover,
  [data-theme='dark'] .dark:hover {
    background: #94dfd0;
  }
  [data-theme='dark'] thead,
  [data-theme='dark'] .filters {
    background: #17252b;
  }
  [data-theme='dark'] td {
    border-color: #30434a;
  }
  [data-theme='dark'] .strength {
    background: #243f38;
    border-color: #3d665a;
    color: #ade1cf;
  }
  [data-theme='dark'] .tag {
    background: #2c493f;
    color: #b3e2cf;
  }
  [data-theme='dark'] .tag.grey {
    background: #344147;
    color: #b9c9cf;
  }
  [data-theme='dark'] .notice,
  [data-theme='dark'] .linkbox {
    background: #253f38;
    color: #c1e3d5;
  }
  [data-theme='dark'] .error {
    background: #4a282c;
    color: #ffbdba;
  }
  [data-theme='dark'] .negative,
  [data-theme='dark'] .danger {
    color: #ffaaa6;
  }
  [data-theme='dark'] .order-row:hover {
    background: #263940;
  }
  [data-theme='dark'] .avatar {
    color: #bce7d8;
  }
  [data-theme='dark'] .timeline {
    border-color: #476358;
  }
  [data-theme='dark'] .private {
    color: #c2b0df;
  }
}
@media screen and (max-width: 680px) {
  .brand-logo {
    width: 126px;
    height: 61px;
  }
  .auth-story .brand-logo {
    width: 155px;
    height: 76px;
  }
  .userbar {
    flex-wrap: wrap;
  }
  .userbar .theme-control {
    order: 4;
    width: 100%;
    justify-content: flex-end;
  }
  .theme-control select {
    font-size: 1rem;
  }
  .auth-content {
    padding-top: 24px;
  }
}
@media print {
  html[data-theme] {
    color-scheme: light;
    background: #fff;
    color: #16333b;
  }
  .theme-control {
    display: none !important;
  }
}

.auth-story > * {
  position: relative;
  z-index: 1;
}
.auth-story:after {
  pointer-events: none;
}
/* A continuous navigation surface, with compact phone browsing. */
@media screen {
  .navigation {
    gap: 0;
  }
  .navigation button {
    background: transparent;
    padding-left: 16px;
    padding-right: 16px;
  }
  [data-theme='dark'] .navigation button {
    background: transparent;
    border-bottom-color: transparent;
    color: var(--muted);
  }
  [data-theme='dark'] .navigation button:hover {
    background: #25383e;
  }
  [data-theme='dark'] .navigation button.active {
    background: transparent;
    border-bottom-color: var(--accent);
    color: var(--accent);
  }
}
@media screen and (max-width: 680px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    padding: 10px 12px;
  }
  .topbar .brand-logo {
    width: 96px;
    height: 47px;
    padding: 3px;
  }
  .userbar {
    display: contents;
  }
  .userbar .tag,
  .userbar .avatar,
  .userbar .user-name {
    display: none;
  }
  .userbar .theme-control {
    order: initial;
    width: auto;
    font-size: 0;
    gap: 0;
  }
  .userbar .theme-control select {
    width: 94px;
    min-width: 0;
    padding: 8px;
    font-size: 1rem;
  }
  .userbar > button {
    padding: 8px;
    font-size: 0.875rem;
  }
  .navigation {
    grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
    padding: 0 8px;
    gap: 0;
  }
  .navigation button {
    padding: 8px 4px;
    font-size: 0.875rem;
    min-height: 44px;
  }
  main {
    padding: 18px 12px 36px;
  }
  .pagehead {
    margin-bottom: 14px;
  }
  .pagehead .eyebrow {
    display: none;
  }
  .pagehead h1 {
    font-size: 1.5625rem;
    margin-bottom: 6px;
  }
  .pagehead p {
    font-size: 0.875rem;
    line-height: 1.45;
  }
  .pagehead .actions {
    margin-top: 12px;
    gap: 8px;
  }
  .filters {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    padding: 10px;
    gap: 8px;
  }
  .filters input {
    grid-column: 1/-1;
  }
  .filters select {
    min-width: 0;
    padding: 8px;
  }
  .catalogue-table tr {
    grid-template-columns: minmax(0, 1fr) 136px;
    gap: 6px 10px;
    padding: 12px;
  }
  .catalogue-table .product-name {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }
  .catalogue-table .product-name strong {
    font-size: 0.875rem;
    line-height: 1.35;
  }
  .catalogue-table td small {
    margin-top: 3px;
    font-size: 0.875rem;
  }
  .catalogue-table td:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
    align-self: center;
  }
  .catalogue-table .strength {
    padding: 3px 6px;
    font-size: 0.875rem;
  }
  .catalogue-table td:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
    font-size: 0.875rem;
    overflow-wrap: anywhere;
  }
  .catalogue-table td:nth-child(4) {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
  }
  .catalogue-table .price {
    font-size: 1.125rem;
  }
  .catalogue-table td:nth-child(5) {
    grid-column: 1;
    grid-row: 3;
    justify-self: start;
    min-width: 0;
  }
  .catalogue-table .reports {
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.875rem;
  }
  .catalogue-table .reports a {
    padding: 4px 0;
  }
  .catalogue-table td:last-child {
    grid-column: 2;
    grid-row: 3;
    align-self: center;
  }
  .catalogue-table .quantity {
    gap: 6px;
  }
  .catalogue-table .quantity input {
    width: 58px;
    padding: 8px 5px;
  }
  .catalogue-table .quantity button {
    padding: 8px 12px;
    min-width: 58px;
  }
  .auth-story {
    padding: 14px 20px;
  }
  .auth-story .brand-logo {
    width: 125px;
    height: 61px;
  }
  .auth-story .eyebrow {
    display: none;
  }
  .auth-content {
    padding: 20px;
  }
  .auth-form > .theme-control {
    margin-bottom: 18px;
  }
}

/* Readable type, adjustable without overriding browser text zoom. */
:root[data-font-size='16'] {
  font-size: 100%;
}
:root[data-font-size='18'] {
  font-size: 112.5%;
}
:root[data-font-size='20'] {
  font-size: 125%;
}
:root[data-font-size='22'] {
  font-size: 137.5%;
}
body {
  line-height: 1.5;
}
input,
select,
textarea {
  font-size: 1rem;
}
button,
.small {
  min-height: 44px;
}
button:disabled {
  cursor: not-allowed;
}
.field,
table,
.filters input,
.filters select,
.navigation button {
  font-size: 1rem;
}
td strong {
  font-size: 1rem;
}
.price {
  font-size: 1.15rem;
}
.original-price {
  font-size: 0.9rem;
  color: var(--muted);
  white-space: nowrap;
}
.sale-label {
  color: var(--accent);
  font-weight: 600;
}
.section-title {
  margin-top: 1.8rem;
}
.catalogue-tools {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 20px;
  margin-bottom: 20px;
}
.minimum-note {
  margin-top: 10px;
}
.catalogue-tools form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  max-width: 560px;
}
.catalogue-tools .field {
  margin: 0;
  flex: 1;
  min-width: 160px;
}
.catalogue-tools small,
.catalogue-tools .error {
  flex-basis: 100%;
}
.catalogue-tools small {
  font-size: 0.875rem;
  color: var(--muted);
}
.catalogue-tools input {
  margin-top: 3px;
}
.reports a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
}
.formpanel {
  overflow-wrap: anywhere;
}
.warehouse-form textarea {
  min-height: 110px;
}
@media screen and (max-width: 680px) {
  .catalogue-tools {
    display: block;
    margin-bottom: 12px;
  }
  .catalogue-tools form {
    max-width: none;
  }
  .minimum-note {
    margin: 8px 0;
  }
  .catalogue-table td.product-name strong {
    font-size: 1rem;
  }
  .catalogue-table td,
  .catalogue-table td small,
  .catalogue-table .strength,
  .catalogue-table .reports {
    font-size: 0.875rem;
  }
  .catalogue-table .price {
    font-size: 1.1rem;
  }
  .navigation button {
    font-size: 0.875rem;
    white-space: normal;
  }
  .userbar {
    flex-wrap: wrap;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .formpanel {
    padding: 16px;
  }
  .summary {
    gap: 12px;
    flex-wrap: wrap;
  }
  .dialogfoot {
    flex-wrap: wrap;
  }
  .dialogfoot button {
    flex: 1;
  }
  .filters {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .filters input {
    grid-column: 1/-1;
  }
  .quantity input {
    width: 4rem;
  }
  .cartitem input {
    width: 4rem;
  }
}
@media print {
  .catalogue-tools form {
    display: none;
  }
  .original-price {
    text-decoration: line-through;
  }
  .sale-label {
    color: #16333b;
  }
}

.faq-list details {
  border-bottom: 1px solid var(--line);
  padding: 1rem 0;
}
.faq-list summary {
  cursor: pointer;
  font-weight: 600;
  min-height: 44px;
  overflow-wrap: anywhere;
}
.faq-list p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 1rem 0;
}
.faq-edit-list {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.25rem;
}
.faq-form textarea {
  min-height: 150px;
}

.request-item-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.warehouse-label {
  white-space: normal;
  overflow-wrap: anywhere;
}
.cartitem .detail {
  min-width: 0;
}

.cart-page {
  max-width: 1000px;
  margin: 0 auto;
}
.cart-page .cartitem {
  padding: 20px 0;
}
.cart-page .dialogfoot {
  flex-wrap: wrap;
}

.profile-page {
  max-width: 680px;
  margin: 0 auto;
}

.support-form {
  max-width: 900px;
  margin: 0 auto;
}
.support-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.support-row > div {
  flex: 1;
  min-width: 180px;
}
.support-row small,
.ticket-message small {
  display: block;
  color: var(--muted);
  margin-top: 8px;
}
.support-row strong,
.ticket-message p {
  overflow-wrap: anywhere;
}
.ticket-message {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 16px 0;
}
.ticket-message p {
  white-space: pre-wrap;
  margin: 14px 0 0;
}
.staff-reply {
  border-left: 4px solid var(--accent);
}
.ticket-status {
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding-top: 20px;
}
[hidden] {
  display: none !important;
}
@media print {
  body.printing-report .topbar,
  body.printing-report .navigation,
  body.printing-report .desktopnote,
  body.printing-report .no-print,
  body.printing-report #toast {
    display: none !important;
  }
  body.printing-report main {
    padding: 0;
  }
  body.printing-report .tablewrap {
    overflow: visible;
  }
  body.printing-report tr {
    break-inside: avoid;
  }
  body.printing-report .stats {
    display: flex;
  }
  body.printing-report {
    background: white;
    color: black;
  }
}
@media print {
  body.printing-report main:before {
    content: none !important;
  }
  body.printing-report .panel {
    display: block !important;
  }
  body.printing-report .stats {
    display: flex !important;
  }
  body.printing-report .stat,
  body.printing-report .notice,
  body.printing-report .panel {
    background: white !important;
    color: black !important;
  }
  body.printing-report .stat span {
    color: #333 !important;
  }
}

@media print {
  body.printing-report main,
  body.printing-report td,
  body.printing-report th,
  body.printing-report small,
  body.printing-report .stat strong {
    color: black !important;
  }
  body.printing-report thead {
    background: #eee !important;
  }
}

.shipping-label {
  display: block;
  color: var(--accent);
  font-weight: 600;
  margin-top: 6px;
}

.product-editor-page {
  max-width: 1000px;
  margin: 0 auto;
}
.product-editor-page .dialogfoot {
  flex-wrap: wrap;
}

.navigation button[data-view='orders'] {
  white-space: nowrap;
}
.discount-disclosure {
  margin: 0 0 20px;
}
.discount-disclosure summary {
  cursor: pointer;
  min-height: 44px;
  padding: 10px 0;
  color: var(--accent);
  font-weight: 600;
}
.discount-disclosure form {
  padding: 16px 0;
  max-width: 600px;
}
@media print {
  .discount-disclosure {
    display: none !important;
  }
}

.inline-product-row input,
.inline-product-row select {
  min-width: 120px;
  width: 100%;
  margin: 3px 0;
}
.inline-product-row .product-name input {
  min-width: 220px;
}
.inline-product-row .actions {
  margin: 6px 0;
}
.inline-review > td {
  padding: 20px;
  background: var(--surface);
}
.inline-review form {
  max-width: 900px;
}
.inline-product-row > td:last-child {
  min-width: 260px;
}
.inline-product-row > td:nth-child(7) {
  min-width: 185px;
}
.inline-product-row .actions button {
  white-space: nowrap;
}

.favicon-preview {
  object-fit: contain;
  margin-block: 12px;
}

/* Keep the dedicated print document outside the interactive page layout. */
.catalogue-print-frame {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 8.5in;
  height: 11in;
  border: 0;
}
