/* Sigler Market – one stylesheet, no build step.
   Colors live in the variables below; change --brand-* to re-skin the portal. */

:root {
  --brand-900: #0f2a47;
  --brand-800: #143a63;
  --brand-700: #174a80;
  --brand-600: #1b5fa8;
  --brand-100: #dce9f7;
  --brand-50: #eef4fb;
  --accent: #f0a020;

  --ink: #18212d;
  --ink-2: #445063;
  --ink-3: #5f6a7a;
  --line: #e2e7ee;
  --line-strong: #cbd3dd;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;

  --ok: #16703f;
  --ok-bg: #e5f4eb;
  --warn: #8a5300;
  --warn-bg: #fdf1dc;
  --danger: #b42318;
  --danger-bg: #fdeceb;
  --info: #174a80;
  --info-bg: #e6effa;
  --muted: #576274;
  --muted-bg: #eef1f5;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.14);
  --focus: 0 0 0 3px rgba(27, 95, 168, 0.35);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--brand-600);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

p a,
.page-header__sub a,
.card__footer a,
.help a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.h3 {
  font-size: 1.02rem;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.5rem;
  line-height: 1.25;
  color: var(--ink);
}

h1 {
  font-size: 1.65rem;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.2rem;
}

h3 {
  font-size: 1.02rem;
}

p {
  margin: 0 0 0.75rem;
}

code,
.mono {
  font-family: var(--mono);
  font-size: 0.88em;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 100;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  left: 8px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.main {
  flex: 1;
  padding-top: 28px;
  padding-bottom: 56px;
}

.muted {
  color: var(--ink-3);
}

.small {
  font-size: 0.86rem;
}

.nowrap {
  white-space: nowrap;
}

.cell-badge {
  margin-top: 4px;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stack > * + * {
  margin-top: 16px;
}

.stack-lg > * + * {
  margin-top: 24px;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.row--between {
  justify-content: space-between;
}

.spacer {
  flex: 1;
}

/* ---------------------------------------------------------------- Top bar */

.topbar {
  background: var(--brand-900);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 8px rgba(15, 23, 42, 0.18);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 62px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: 0.01em;
  margin-right: auto;
}

.brand:hover {
  text-decoration: none;
}

.brand__mark {
  width: 34px;
  height: 34px;
  flex: none;
}

.brand__tag {
  font-weight: 500;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.65);
  border-left: 1px solid rgba(255, 255, 255, 0.25);
  padding-left: 10px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.82);
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 500;
}

.nav__link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.nav__form {
  display: contents;
}

.nav__link--button {
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}

.nav__link.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.nav__icon {
  width: 18px;
  height: 18px;
  flex: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #241600;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
}

.pill--quiet {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  font: inherit;
  cursor: pointer;
}

.usermenu {
  position: relative;
}

.usermenu > summary {
  list-style: none;
  cursor: pointer;
}

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

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand-100);
  color: var(--brand-900);
  font-weight: 700;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.usermenu__name {
  display: none;
}

.usermenu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 230px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 30;
}

.usermenu__who {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.usermenu__who strong {
  display: block;
}

.usermenu__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--ink);
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.usermenu__item:hover {
  background: var(--brand-50);
  text-decoration: none;
}

/* ----------------------------------------------------------- Admin subnav */

.subnav {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.subnav__inner {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.subnav__inner::-webkit-scrollbar {
  display: none;
}

.subnav__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-right: 10px;
  white-space: nowrap;
}

.subnav__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 14px 12px 12px;
  color: var(--ink-2);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.subnav__link:hover {
  color: var(--ink);
  text-decoration: none;
}

.subnav__link.is-active {
  color: var(--brand-700);
  border-bottom-color: var(--brand-600);
}

.count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--muted-bg);
  color: var(--ink-2);
  font-size: 0.74rem;
  font-weight: 700;
}

.count--warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.count--info {
  background: var(--info-bg);
  color: var(--info);
}

/* ------------------------------------------------------------ Page header */

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.page-header h1 {
  margin: 0;
}

.page-header__sub {
  margin: 4px 0 0;
  color: var(--ink-3);
  max-width: 68ch;
}

.page-header__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.breadcrumbs {
  font-size: 0.86rem;
  color: var(--ink-3);
  margin-bottom: 6px;
}

.breadcrumbs a {
  color: var(--ink-3);
}

/* ---------------------------------------------------------------- Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn--primary {
  background: var(--brand-600);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

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

.btn--secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.btn--secondary:hover {
  background: var(--surface-2);
  border-color: var(--ink-3);
}

.btn--danger {
  background: var(--surface);
  color: var(--danger);
  border-color: #f0c3bf;
}

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

.btn--success {
  background: var(--ok);
  color: #fff;
}

.btn--success:hover {
  background: #0f5a32;
}

.btn--ghost {
  background: transparent;
  color: var(--brand-600);
  padding-left: 8px;
  padding-right: 8px;
}

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

.btn--sm {
  padding: 6px 11px;
  font-size: 0.86rem;
}

.btn--lg {
  padding: 12px 20px;
  font-size: 1.02rem;
}

.btn--block {
  width: 100%;
}

.btn[disabled],
.btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-icon {
  width: 18px;
  height: 18px;
  flex: none;
}

.link-button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--brand-600);
  cursor: pointer;
}

.link-button:hover {
  text-decoration: underline;
}

.link-button--danger {
  color: var(--danger);
}

/* ------------------------------------------------------------------ Cards */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.card__header h2,
.card__header h3 {
  margin: 0;
}

.card__body {
  padding: 20px;
}

.card__footer {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius) var(--radius);
}

.card--flush .table th:first-child,
.card--flush .table td:first-child {
  padding-left: 20px;
}

.card--flush .table th:last-child,
.card--flush .table td:last-child {
  padding-right: 20px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}

.layout--wide-aside {
  grid-template-columns: minmax(0, 1fr) 380px;
}

.sticky {
  position: sticky;
  top: 86px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
  margin: 0;
}

.dl dt {
  color: var(--ink-3);
}

.dl dd {
  margin: 0;
}

.prewrap {
  white-space: pre-line;
}

/* ------------------------------------------------------------------ Stats */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  color: inherit;
}

a.stat:hover {
  text-decoration: none;
  border-color: var(--brand-100);
  box-shadow: 0 0 0 3px var(--brand-50), var(--shadow);
}

.stat__label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-3);
}

.stat__value {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin: 2px 0;
}

.stat__meta {
  font-size: 0.84rem;
  color: var(--ink-3);
}

.stat--warn .stat__value {
  color: var(--warn);
}

/* ----------------------------------------------------------------- Tables */

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.table th {
  text-align: left;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--surface-2);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover td {
  background: #fbfcfe;
}

.table tfoot td {
  font-weight: 700;
  border-top: 2px solid var(--line);
  border-bottom: 0;
}

.table .num {
  text-align: right;
}

.table--compact td {
  padding: 8px 12px;
}

.row-link {
  font-weight: 600;
  color: var(--ink);
}

.cell-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.cell-item__name {
  font-weight: 600;
  color: var(--ink);
}

.cell-item__meta {
  font-size: 0.84rem;
  color: var(--ink-3);
}

/* Links inside grey meta text need more than colour to stand out. */
.cell-item__meta a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.is-negative {
  color: var(--danger);
}

.is-positive {
  color: var(--ok);
}

/* ----------------------------------------------------------------- Badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.4;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge--ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.badge--warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.badge--danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge--info {
  background: var(--info-bg);
  color: var(--info);
}

.badge--muted {
  background: var(--muted-bg);
  color: var(--muted);
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--muted-bg);
  color: var(--ink-2);
  font-size: 0.76rem;
  font-weight: 600;
}

/* ----------------------------------------------------------------- Alerts */

.messages {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--info-bg);
  color: var(--info);
}

.alert a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
}

.alert__body {
  flex: 1;
}

/* A page-level notice sits apart from what follows it. */
.main > .alert {
  margin-bottom: 16px;
}

.alert__body ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.alert__close {
  background: none;
  border: 0;
  color: inherit;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.6;
  padding: 0 2px;
}

.alert__close:hover {
  opacity: 1;
}

.alert--success {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: #bfe3cc;
}

.alert--warning {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: #f4d9a6;
}

.alert--error {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: #f3c4bf;
}

.alert--info {
  border-color: var(--brand-100);
}

/* ------------------------------------------------------------------ Forms */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
}

.form-grid .field--full {
  grid-column: 1 / -1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field + .field {
  margin-top: 16px;
}

.form-grid .field + .field {
  margin-top: 0;
}

.field > label,
.label {
  font-weight: 600;
  font-size: 0.92rem;
}

.field .required {
  color: var(--danger);
  margin-left: 2px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="date"],
input[type="url"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  line-height: 1.4;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand-600);
  box-shadow: var(--focus);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%235f6a7a' stroke-width='1.6' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

input[type="file"] {
  font: inherit;
  font-size: 0.9rem;
}

input[type="checkbox"],
input[type="radio"] {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--brand-600);
  flex: none;
}

.field--error input,
.field--error select,
.field--error textarea {
  border-color: var(--danger);
}

.help {
  font-size: 0.84rem;
  color: var(--ink-3);
}

.errorlist {
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--danger);
  font-size: 0.86rem;
  font-weight: 600;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  cursor: pointer;
}

.radio-cards {
  display: grid;
  gap: 8px;
}

.radio-cards label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
}

.radio-cards--row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.radio-cards label:has(input:checked) {
  border-color: var(--brand-600);
  background: var(--brand-50);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.input-group {
  display: flex;
  gap: 8px;
}

.input-group > input {
  flex: 1;
}

.qty {
  width: 92px !important;
  text-align: center;
}

.qty--sm {
  width: 72px !important;
  padding: 6px 8px !important;
}

/* ---------------------------------------------------------------- Filters */

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}

.toolbar .search {
  flex: 1 1 260px;
  max-width: 420px;
  position: relative;
}

.toolbar .search input {
  padding-left: 36px;
}

.toolbar .search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--ink-3);
  pointer-events: none;
}

.toolbar select {
  width: auto;
  min-width: 160px;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  font-weight: 500;
  font-size: 0.92rem;
}

.chip:hover {
  text-decoration: none;
  border-color: var(--brand-600);
  color: var(--brand-700);
}

.chip.is-active {
  background: var(--brand-700);
  border-color: var(--brand-700);
  color: #fff;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  overflow-x: auto;
}

.tabs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  color: var(--ink-2);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}

.tabs a:hover {
  color: var(--ink);
  text-decoration: none;
}

.tabs a.is-active {
  color: var(--brand-700);
  border-bottom-color: var(--brand-600);
}

/* ------------------------------------------------------- Catalog / product */

.shop-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
}

.account-card {
  min-width: 300px;
  padding: 16px 18px;
}

.account-card__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.account-card__amount {
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.account-card__divider {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* Big radio choices: who an order is for, and how it's delivered. */
.choice-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.choice-card {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}

.choice-card:hover {
  border-color: var(--brand-600);
}

.choice-card:has(input:checked) {
  border-color: var(--brand-600);
  background: var(--brand-50);
  box-shadow: 0 0 0 1px var(--brand-600);
}

.choice-card:has(input:focus-visible) {
  box-shadow: var(--focus);
}

.choice-card input {
  margin-top: 3px;
}

.choice-card__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.choice-card__title {
  font-weight: 650;
}

.choice-card__price {
  font-size: 1.15rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.choice-card__price s {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-3);
  margin-left: 4px;
}

.choice-card__text {
  font-size: 0.86rem;
  color: var(--ink-2);
}

.plain-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.plain-fieldset legend {
  padding: 0;
  margin-bottom: 12px;
}

.plain-fieldset legend h2 {
  margin: 0;
}

.choice-cards--compact .choice-card {
  align-items: center;
  font-weight: 600;
}

.meter {
  height: 8px;
  border-radius: 999px;
  background: var(--muted-bg);
  overflow: hidden;
  margin: 10px 0 8px;
}

.meter__bar {
  height: 100%;
  border-radius: inherit;
  background: var(--brand-600);
}

.meter__bar--warn {
  background: var(--accent);
}

.meter__bar--danger {
  background: var(--danger);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}

.product-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  color: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.product-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: var(--brand-100);
  box-shadow: var(--shadow-lg);
}

.product-card__media {
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.product-card__media img,
.product-card__media .thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.product-card.is-soldout .product-card__media {
  opacity: 0.55;
}

.product-card__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px 16px;
  flex: 1;
}

.product-card__category {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.product-card__name {
  font-weight: 650;
  font-size: 1.02rem;
  color: var(--ink);
  line-height: 1.3;
}

.product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
}

.price {
  font-weight: 700;
  font-size: 1.08rem;
  font-variant-numeric: tabular-nums;
}

.price__unit {
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--ink-3);
}

/* Placeholder tile for items without a photo. */
.thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  font-weight: 750;
  letter-spacing: 0.02em;
  flex: none;
  overflow: hidden;
}

img.thumb {
  object-fit: cover;
  background: var(--surface-2);
}

.thumb__icon {
  width: 56%;
  height: 56%;
  stroke-width: 1.5;
}

.thumb--lg .thumb__icon {
  width: 34%;
  height: 34%;
  stroke-width: 1.1;
}

.thumb--md {
  width: 56px;
  height: 56px;
  font-size: 1.05rem;
}

.thumb--sm {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  font-size: 0.85rem;
}

.tone-0 { background: linear-gradient(135deg, #dce9f7, #c3d8f0); color: #174a80; }
.tone-1 { background: linear-gradient(135deg, #fdf1dc, #f8ddb0); color: #8a5300; }
.tone-2 { background: linear-gradient(135deg, #e5f4eb, #c8e8d4); color: #16703f; }
.tone-3 { background: linear-gradient(135deg, #f1e8fb, #dfcdf5); color: #5b2c99; }
.tone-4 { background: linear-gradient(135deg, #fde9ea, #f8cfd3); color: #a3263a; }
.tone-5 { background: linear-gradient(135deg, #e3f3f6, #c4e4ea); color: #12606e; }

.product {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

.product__media {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
}

.product__media img,
.product__media .thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.product__price {
  font-size: 1.6rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  margin: 6px 0 14px;
}

.product__description {
  color: var(--ink-2);
  white-space: pre-line;
}

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 4px;
  padding: 0;
  border: 0;
}

.option {
  position: relative;
}

.option input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.option > span {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 68px;
  padding: 8px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-weight: 650;
  line-height: 1.25;
}

.option small {
  font-weight: 500;
  font-size: 0.74rem;
  color: var(--ink-3);
}

.option input:checked + span {
  border-color: var(--brand-600);
  background: var(--brand-50);
  box-shadow: 0 0 0 1px var(--brand-600);
}

.option input:focus-visible + span {
  box-shadow: var(--focus);
}

.option input:disabled {
  cursor: not-allowed;
}

.option input:disabled + span {
  color: var(--ink-3);
  background: var(--surface-2);
}

.option input:disabled + span .option__name {
  text-decoration: line-through;
}

.add-to-cart {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-top: 18px;
}

.note-box {
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 12px 14px;
  font-size: 0.9rem;
  color: var(--ink-2);
}

/* ------------------------------------------------------------------- Cart */

.summary-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-variant-numeric: tabular-nums;
}

.summary-line--total {
  border-top: 1px solid var(--line);
  margin-top: 6px;
  padding-top: 12px;
  font-size: 1.12rem;
  font-weight: 750;
}

.line-problem {
  color: var(--danger);
  font-size: 0.84rem;
  font-weight: 600;
}

/* ------------------------------------------------------------- Timeline */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.timeline li {
  position: relative;
  padding: 0 0 16px 26px;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: -8px;
  width: 2px;
  background: var(--line);
}

.timeline li:last-child::before {
  display: none;
}

.timeline__dot {
  position: absolute;
  left: 0;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--line-strong);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--line-strong);
}

.timeline__dot--submitted { background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.timeline__dot--approved { background: var(--info); box-shadow: 0 0 0 1px var(--info); }
.timeline__dot--fulfilled { background: var(--ok); box-shadow: 0 0 0 1px var(--ok); }
.timeline__dot--cancelled { background: var(--muted); box-shadow: 0 0 0 1px var(--muted); }
.timeline__dot--expired { background: var(--muted); box-shadow: 0 0 0 1px var(--muted); }
.timeline__dot--highlight { background: var(--info); box-shadow: 0 0 0 1px var(--info); }

.timeline__title {
  font-weight: 600;
}

.timeline__meta {
  font-size: 0.82rem;
  color: var(--ink-3);
}

.timeline__internal {
  background: var(--warn-bg);
  border-radius: 6px;
  padding: 6px 10px;
  margin-top: 4px;
}

/* ------------------------------------------------------ Empty / paginator */

.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--ink-3);
}

.empty h2,
.empty h3 {
  color: var(--ink);
}

.empty__icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  color: var(--line-strong);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  color: var(--ink-3);
  font-size: 0.9rem;
}

.pagination__links {
  display: flex;
  gap: 6px;
}

/* ---------------------------------------------------------------- Auth */

.auth {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 40px 16px;
  background:
    radial-gradient(900px 400px at 10% -10%, rgba(27, 95, 168, 0.16), transparent 60%),
    radial-gradient(700px 360px at 110% 110%, rgba(240, 160, 32, 0.14), transparent 60%),
    var(--bg);
}

.auth__card {
  width: 100%;
  max-width: 420px;
  padding: 32px;
}

.auth__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.auth__brand .brand__mark {
  width: 44px;
  height: 44px;
}

.auth__brand strong {
  display: block;
  font-size: 1.2rem;
}

.auth__title {
  margin: 0 0 16px;
  font-size: 1.25rem;
}

/* ------------------------------------------------------------------ Misc */

.footer {
  padding-top: 18px;
  padding-bottom: 28px;
  color: var(--ink-3);
  font-size: 0.84rem;
  border-top: 1px solid var(--line);
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 12px;
}

.kbd-hint {
  font-size: 0.8rem;
  color: var(--ink-3);
}

.option-table input,
.option-table select {
  min-width: 70px;
}

.option-table td {
  vertical-align: top;
}

.option-table .stock-cell {
  white-space: nowrap;
  font-size: 0.88rem;
  padding-top: 18px;
}

.image-preview {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--line);
}

.danger-zone {
  border-color: #f3c4bf;
}

.card--attention {
  border-color: #f4d9a6;
  box-shadow: 0 0 0 3px var(--warn-bg), var(--shadow);
}

/* ------------------------------------------------------------ Responsive */

@media (max-width: 1024px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .sticky {
    position: static;
  }
}

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    display: none;
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--brand-900);
    padding: 8px 16px 16px;
    box-shadow: var(--shadow-lg);
  }

  .nav.is-open {
    display: flex;
  }

  .nav__link {
    padding: 12px;
  }

  .usermenu__panel {
    position: static;
    margin-top: 8px;
    box-shadow: none;
  }

  .usermenu__name {
    display: inline;
  }

  .brand__tag {
    display: none;
  }

  .product,
  .grid-2,
  .shop-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .product {
    gap: 20px;
  }

  .product__media {
    aspect-ratio: 4 / 3;
  }

  .account-card {
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 16px;
  }

  .main {
    padding-top: 20px;
  }

  h1 {
    font-size: 1.4rem;
  }

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

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

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .product-card__body {
    padding: 12px;
  }

  .card__body {
    padding: 16px;
  }

  .toolbar select {
    min-width: 0;
    flex: 1 1 140px;
  }

  .add-to-cart {
    flex-wrap: wrap;
  }

  .auth__card {
    padding: 24px;
  }
}

@media print {
  .topbar,
  .subnav,
  .footer,
  .no-print,
  .messages {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .card {
    box-shadow: none;
    border-color: #bbb;
  }

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

  a {
    color: inherit;
  }
}

/* Messages for admins to copy into their own email ------------------------ */
.compose__intro {
  margin: 0 0 12px;
}

.compose__field + .compose__field {
  margin-top: 12px;
}

.compose__row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.compose__row input {
  flex: 1;
  min-width: 0;
}

.compose__row--label {
  justify-content: space-between;
  margin-bottom: 6px;
}

.compose__row--label .label {
  margin: 0;
}

.compose textarea {
  width: 100%;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.5;
}

.compose input[readonly],
.compose textarea[readonly] {
  background: var(--surface-2, #f6f8fb);
}

.btn.is-copied {
  border-color: var(--ok);
  color: var(--ok);
}

.flash-compose {
  margin-bottom: 24px;
}

