:root {
  color-scheme: light dark;            /* default: follow the system */
--bg:          light-dark(#edf2f7, #0f1722);
  --paper:       light-dark(#f8fafc, #131d28);
  --tint:        light-dark(#e2e8f0, #1e293b);
  --ink:         light-dark(#0f172a, #f1f5f9);
  --ink-soft:    light-dark(#334155, #94a3b8);
  --muted:       light-dark(#64748b, #94a3b8);
  --line:        light-dark(#cbd5e1, #334155);
  --line-strong: light-dark(#94a3b8, #475569);
  --hover:       light-dark(rgba(15, 23, 42, 0.05), rgba(241, 245, 249, 0.08));
  --accent:      light-dark(#2563eb, #38bdf8);
  --on-accent:   light-dark(#ffffff, #0f172a);
  --out:         light-dark(#9a3550, #e58aa3);
  --on-out:      light-dark(#ffffff, #2a0b15);
  /* --bg:          light-dark(#eff2ee, #121c1f);
  --paper:       light-dark(#fafbf9, #182428);
  --tint:        light-dark(#e1e7e2, #1f2d31);
  --ink:         light-dark(#16262b, #e6ede9);
  --ink-soft:    light-dark(#3a4e53, #b9c7c4);
  --muted:       light-dark(#5b6b6f, #95a5a5);
  --line:        light-dark(#d3dad5, #2b3b3f);
  --line-strong: light-dark(#a9b6b0, #4a5e62);
  --hover:       light-dark(rgba(22, 38, 43, 0.06), rgba(230, 237, 233, 0.08));
  --accent:      light-dark(#1e6b5c, #5cc4ae);
  --on-accent:   light-dark(#ffffff, #0b1a17);
  --out:         light-dark(#9a3550, #e58aa3);
  --on-out:      light-dark(#ffffff, #2a0b15); */
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"]  { color-scheme: dark; }

/* Toggle button */
.btn.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 32px;
  height: 32px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  line-height: 1;
}

.theme-btn svg {
  display: block;        /* removes the inline baseline gap under the icon */
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Show the icon for the mode you'd switch TO */
:root[data-theme="dark"]  .theme-btn .icon-moon,
:root[data-theme="light"] .theme-btn .icon-sun {
  display: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    400 16px/1.5 "Schibsted Grotesk",
    "Noto Sans Lao",
    "Phetsarath OT",
    "Saysettha OT",
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
}

h1,
h2,
p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Buttons and inputs */
.btn {
  font: inherit;
  font-weight: 500;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

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

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

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

.btn.small {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.9rem;
}

.btn.danger {
  color: var(--out);
  border-color: transparent;
}

.btn.danger-solid {
  background: var(--out);
  border-color: var(--out);
  color: var(--on-out);
}

.btn.danger-solid:hover {
  filter: brightness(1.08);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

input,
select,
textarea {
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 9px 12px;
  min-height: 42px;
}

textarea {
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
}

.field {
  display: block;
}

.field > span {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 4px;
}

.field input,
.field textarea {
  display: block;
  width: 100%;
}

.error {
  color: var(--out);
  font-size: 0.9rem;
  font-weight: 500;
}

.error:empty {
  display: none;
}

/* Login */
.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-box {
  width: 100%;
  max-width: 360px;
  display: grid;
  gap: 16px;
}

.login-box h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.lede {
  color: var(--muted);
}

.login-box .btn {
  width: 100%;
}

/* App shell */
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px 72px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding-bottom: 6px;
}

.top h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.user {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.role {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 1px 10px;
  font-size: 0.8rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 20px 0 8px;
}

.toolbar input[type="search"] {
  flex: 1 1 240px;
  min-width: 0;
}

#add-btn {
  margin-left: auto;
}

.count {
  color: var(--muted);
  font-size: 0.9rem;
  min-height: 1.4em;
  margin-bottom: 16px;
}

/* Catalog grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 36px 24px;
}

.media {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: var(--tint);
}

.media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media.is-out img {
  filter: grayscale(0.7);
  opacity: 0.75;
}

.ph {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 3rem;
  font-weight: 600;
  color: var(--muted);
}

.stock {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
}

.stock i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: block;
}

.stock.in i {
  background: var(--accent);
}

.stock.out i {
  border: 2px solid var(--out);
}

.row {
  display: flex;
  flex-wrap: wrap;                 /* price drops below the name when space runs out */
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 12px;                   /* row-gap, column-gap */
  margin-top: 12px;
}

.name {
  flex: 1 1 12ch;                  /* grows to fill, but wraps the price once name would be narrower than this */
  min-width: 0;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: break-word;       /* only breaks a word if it can't fit on a line at all */
  text-wrap: balance;              /* even line lengths for multi-line names */
}

.price {
  flex: 0 1 auto;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cat {
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: 2px;
}

.desc {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-top: 8px;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.link {
  margin-left: auto;
  color: var(--accent);
  font-weight: 500;
}

.empty {
  padding: 64px 0;
  text-align: center;
  color: var(--muted);
  display: grid;
  gap: 8px;
  justify-items: center;
}

.empty h2 {
  color: var(--ink);
  font-size: 1.2rem;
}

.empty .btn {
  margin-top: 8px;
}

/* Dialogs */
dialog {
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .8rem; /* padding moves inside the form so the footer can stick */
  background: var(--paper);
  color: var(--ink);
  width: min(600px, calc(100vw - 32px));
  max-height: calc(100vh - 32px); /* fallback */
  max-height: calc(100dvh - 32px);
  overflow: hidden; /* scrolling happens inside the form, not the dialog */
}

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

dialog.narrow {
  width: min(440px, calc(100vw - 32px));
}

dialog::backdrop {
  background: rgba(10, 20, 22, 0.55);
}

dialog h2 {
  font-size: 1.25rem;
  margin: 0;
  overflow-wrap: anywhere;
}

/* Item form: fixed header + scrolling body + sticky footer */
#item-form {
  display: flex;
  flex-direction: column;
  max-height: inherit;
  min-height: 0;
}

#item-form > h2 {
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--line);
}

#item-form > .fields {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden; /* never scroll sideways */
  padding: 16px 24px;
  overscroll-behavior: contain;
}

#item-form > .error,
#item-form > .meta {
  margin: 0;
  padding: 10px 24px 0;
}

#item-form > .error:empty {
  display: none;
}

/* Grid: minmax(0, 1fr) is the actual overflow fix */
.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.fields > * {
  min-width: 0; /* let grid children shrink */
}

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

/* Fields */
.field {
  display: block;
  min-width: 0;
}

.field > span {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 4px;
}

.field input,
.field textarea,
.field select {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.field textarea {
  resize: vertical;
}

.field input[type="file"] {
  font-size: 0.875rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Checkbox row (your markup uses .checkbox-field; the old CSS only had .check) */
.checkbox-field {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  min-height: 40px;
}

.checkbox-field > span {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.checkbox-field input,
.check input {
  width: 20px;
  height: 20px;
  min-height: 0;
  padding: 0;
  margin: 0;
  flex: none;
  accent-color: var(--accent);
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
}

/* Nested grid for simple price/stock fields: no extra padding or scroll */
#simple-fields {
  overflow: visible;
  padding: 0;
}

/* Variant rows (adjust to your actual row markup) */
.variant-rows {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.variant-rows > li {
  display: flex;
  flex-wrap: wrap; /* wraps on narrow screens instead of overflowing */
  align-items: center;
  gap: 8px;
}

.variant-rows > li input {
  flex: 1 1 100px;
  min-width: 0;
  width: auto;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 20px 16px;
  text-align: center;
  border: 2px dashed var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--paper) 95%, var(--ink));
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--paper));
}

.dropzone:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Prevents dragleave flicker when the cursor passes over child elements */
.dropzone > *:not(input) {
  pointer-events: none;
}

/* Hide the native input visually but keep it focusable and accessible.
   Selector is deliberately specific so it beats `.field input` (width: 100%). */
.dropzone > input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.dz-icon {
  color: var(--accent);
  margin-bottom: 4px;
}

.dz-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.dz-or {
  font-weight: 400;
  color: var(--muted);
}

.dz-hint {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Image gallery */
.gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}

.gallery:empty {
  display: none;
}

.gallery-item {
  min-width: 0;
}

.gallery-item img {
  display: block;
  width: 100%;
  max-width: 100%; /* replaces the fixed 300px */
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
}

.gallery-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 0;
}

.preview img {
  display: block;
  max-width: 100%;
  max-height: 120px;
  border-radius: 8px;
}

.preview .bad {
  color: var(--out);
  font-size: 0.875rem;
}

/* Messages */
.meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.meta:empty {
  display: none;
}

/* Footer */
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: var(--paper);
  flex: none;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.toast.show {
  opacity: 1;
}

/* Navigation */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
  border-bottom: 1px solid var(--line);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0 22px;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0 10px;
  margin-bottom: -1px;
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

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

.tab[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

.pill {
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 999px;
  min-width: 20px;
  padding: 0 7px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
}

.nav .btn {
  margin: 4px 0;
}

/* Shared dashboard pieces */
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.section-title a,
.rows a,
.detail-box a {
  color: var(--accent);
  font-weight: 500;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  margin: 28px 0 8px;
}

.stats,
.stats dd {
  margin-left: 0;
}

.stat dt {
  color: var(--muted);
  font-size: 0.9rem;
}

.stat dd {
  margin: 2px 0 0;
}

.stat .big {
  display: block;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.stat .sub,
.sub {
  color: var(--muted);
  font-size: 0.875rem;
}

.stat .sub,
.rows .block {
  display: block;
}

.panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 36px 56px;
  margin-top: 36px;
}

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rows li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.rows .val {
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.note {
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: 24px;
  max-width: 70ch;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}

.badge i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: block;
}

.badge.shipped i {
  background: var(--accent);
}

.badge.pending i {
  border: 2px solid var(--accent);
}

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

.badge.cancelled i {
  border: 2px solid var(--out);
}

/* Orders table */
.table-wrap {
  overflow-x: auto;
}

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

.orders th {
  text-align: left;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  padding: 8px 14px 8px 0;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}

.orders td {
  padding: 12px 14px 12px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: baseline;
}

.orders .id {
  font-weight: 600;
  white-space: nowrap;
}

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

.orders tr.is-open > td {
  border-bottom-color: transparent;
}

.orders tr.detail > td {
  padding: 0 0 20px;
}

.detail-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  gap: 20px 40px;
  padding: 4px 0 8px;
}

.detail-box h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 6px;
}

.detail-box p {
  margin: 0 0 4px;
  overflow-wrap: anywhere;
}

.lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.lines li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lines img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  flex: none;
  background: var(--tint);
}

.stockline {
  margin-top: 10px !important;
  font-size: 0.9rem;
}

.stockline.short {
  color: var(--out);
  font-weight: 500;
}

.detail-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Discount Code Table */
.row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
td.actions {
  white-space: nowrap;
  text-align: right;
}
table.orders tr.is-muted td {
  opacity: 0.6;
}
table.orders tr.is-muted td:last-child {
  opacity: 1; /* keep Delete usable-looking */
}

/* Discount badges (these only set color; layout comes from your .badge) */
.badge.is-on,
.badge.is-off,
.badge.is-expired {
  color: var(--badge-color);
}
.badge.is-on      { --badge-color: #1a7f4b; }
.badge.is-off     { --badge-color: var(--muted); }
.badge.is-expired { --badge-color: var(--out); }

.badge.is-on i,
.badge.is-off i,
.badge.is-expired i {
  background: var(--badge-color);
}

/* Code cell */
.orders .code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

/* Actions column */
.discounts td.actions {
  white-space: nowrap;
  text-align: right;
  padding-right: 0;
  vertical-align: middle;
}
.discounts .row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Expired rows fade, but keep the actions at full strength */
.discounts tr.is-muted td { opacity: 0.6; }
.discounts tr.is-muted td.actions { opacity: 1; }

/* Keep all cells on one baseline now that buttons are taller than text */
.discounts td { vertical-align: middle; }

/* Shipping queue */
.group {
  margin-top: 32px;
}

.order-block {
  border-top: 1px solid var(--line);
  padding: 16px 0 12px;
}

.order-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  margin-bottom: 10px;
}

.order-head h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

.order-head .price {
  margin-left: auto;
}

/* Sales */
.chart {
  margin: 28px 0 0;
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 160px;
  border-bottom: 1px solid var(--line-strong);
}

.bar {
  flex: 1 1 0;
  min-width: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}

.bar.zero {
  background: var(--line-strong);
}

.bar:hover {
  filter: brightness(1.2);
}

.axis {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.8rem;
}

.toprow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.toprow .val {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.meter {
  grid-column: 1 / -1;
  height: 4px;
  border-radius: 2px;
  background: var(--tint);
}

.meter > span {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
}

/* Language switch */
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
}

.lang-switch button {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.lang-switch button + button {
  border-left: 1px solid var(--line-strong);
}

.lang-switch button:hover {
  background: var(--hover);
}

.lang-switch button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
}

.login {
  position: relative;
}

.login .lang-switch {
  position: absolute;
  top: 16px;
  right: 16px;
}

/* Lao script needs a little more line height and no negative tracking */
html[lang="lo"] body {
  line-height: 1.7;
}

html[lang="lo"] h1,
html[lang="lo"] h2,
html[lang="lo"] h3,
html[lang="lo"] .stat .big {
  letter-spacing: 0;
}

@media (max-width: 720px) {
  .hide-sm {
    display: none;
  }

  .detail-box {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .wrap {
    padding: 16px 16px 72px;
  }

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

  #item-form > h2,
  #item-form > .fields,
  .dialog-actions {
    padding-left: 16px;
    padding-right: 16px;
  }

  .dialog-actions .btn {
    flex: 1 1 0;
  }

  #add-btn {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: none;
  }
}
