/* Amez Autocare — Admin dashboard.
   Brand family: dark near-black + electric cyan (#19e3ff), Inter UI / Sora wordmark.
   Product register: cyan is reserved for primary actions, active state, and focus. */

:root {
  --bg: #0b0d13;
  --panel: #12151d;
  --panel-2: #181c27;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #e9edf5;
  --muted: #9aa5b8;
  --accent: #19e3ff;
  --accent-soft: rgba(25, 227, 255, 0.12);
  --accent-ink: #052530; /* text on accent fills */
  --danger: #ff6b81;
  --danger-soft: rgba(255, 107, 129, 0.12);
  --ok: #43dfa0;
  --ok-soft: rgba(67, 223, 160, 0.12);
  --warn: #ffca70;
  --warn-soft: rgba(255, 202, 112, 0.12);
  --violet: #b9a8ff;
  --violet-soft: rgba(185, 168, 255, 0.12);
  --gray: #aab3c2;
  --gray-soft: rgba(170, 179, 194, 0.1);
  --radius: 10px;
  --radius-lg: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --speed: 180ms;
  --z-topbar: 10;
  --z-toast: 20;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

/* The hidden attribute must always win, even over classes that set display. */
[hidden] { display: none !important; }

/* Keep keyboard-focused elements from scrolling underneath the sticky topbar. */
input, select, textarea, button, a, .row { scroll-margin-top: 4.5rem; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9375rem; /* 15px base: compact tool density */
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.noscript { padding: 2rem; text-align: center; color: var(--warn); }

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

/* ------------------------------ Wordmark ------------------------------ */

.wordmark {
  margin: 0;
  font-family: "Sora", var(--font);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.wordmark-chip {
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(25, 227, 255, 0.25);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  margin-left: 0.4rem;
  vertical-align: 2px;
}

/* ------------------------------ Login ------------------------------ */

.login {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 22rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
}

.login-title { margin: 1.25rem 0 0.15rem; font-size: 1.3rem; }
.login-sub { margin: 0 0 1.5rem; color: var(--muted); }

/* ------------------------------ Fields ------------------------------ */

.field { display: block; margin: 0 0 1rem; }
.field:last-child { margin-bottom: 0; }

.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.field-label em {
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
}

input, select, textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.55rem 0.75rem;
  transition: border-color var(--speed) var(--ease);
}

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

input:hover, select:hover, textarea:hover { border-color: rgba(255, 255, 255, 0.28); }

input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

/* Dark-native pickers and dropdowns */
input, select, textarea { color-scheme: dark; }

textarea { resize: vertical; min-height: 4.5rem; }

.field-error {
  display: none;
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: 0.3rem;
}
.field-error:not(:empty) { display: block; }

.form-error {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid rgba(255, 107, 129, 0.3);
  border-radius: var(--radius);
  padding: 0.6rem 0.8rem;
  margin: 0 0 1rem;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--speed) var(--ease),
    border-color var(--speed) var(--ease), color var(--speed) var(--ease),
    transform var(--speed) var(--ease);
}

.btn:hover { background: #1e2330; }
.btn:active { transform: scale(0.98); }

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

.btn[disabled] { opacity: 0.55; cursor: default; pointer-events: none; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover { background: #4feaff; border-color: #4feaff; }

.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--panel-2); }

/* Destructive actions are tertiary: quiet until hovered, so a row with several
   legal transitions still reads as "one primary action + escape hatches". */
.btn-danger {
  background: transparent;
  border-color: transparent;
  color: var(--danger);
}
.btn-danger:hover { background: var(--danger-soft); border-color: rgba(255, 107, 129, 0.35); }

.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8125rem; }
.btn-block { width: 100%; }

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

.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  background: rgba(11, 13, 19, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.tabs { display: flex; gap: 0.25rem; }

.tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: color var(--speed) var(--ease), background-color var(--speed) var(--ease);
}

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

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

.tab.is-active { color: var(--accent); background: var(--accent-soft); }

.tab-count {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 999px;
  padding: 0.18rem 0.42rem;
}

.topbar-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-id { font-size: 0.85rem; color: var(--muted); }

.user-role {
  color: var(--gray);
  background: var(--gray-soft);
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  margin-left: 0.45rem;
  text-transform: capitalize;
}

/* ------------------------------ Layout ------------------------------ */

.content {
  max-width: 64rem;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 4rem;
}

.view-title { font-size: 1.35rem; margin: 0 0 1rem; }
.view-title:focus { outline: none; }

.backlink {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}
.backlink:hover { color: var(--text); }
.backlink:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

/* ------------------------------ Chips & segmented ------------------------------ */

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.1rem; }

.chip {
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
  transition: color var(--speed) var(--ease), background-color var(--speed) var(--ease),
    border-color var(--speed) var(--ease);
}

.chip:hover { color: var(--text); background: var(--panel-2); }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.chip.is-active {
  color: var(--accent);
  border-color: rgba(25, 227, 255, 0.45);
  background: var(--accent-soft);
}

.chip-n { font-weight: 700; margin-left: 0.3rem; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.toolbar-status { margin-left: auto; }
.toolbar-status select { width: auto; padding: 0.4rem 0.6rem; font-size: 0.85rem; }

.seg {
  display: inline-flex;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.2rem;
  gap: 0.2rem;
}

.seg-btn {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: calc(var(--radius) - 3px);
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  transition: color var(--speed) var(--ease), background-color var(--speed) var(--ease);
}

.seg-btn:hover { color: var(--text); }
.seg-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
.seg-btn.is-active { color: var(--accent-ink); background: var(--accent); }

/* ------------------------------ Rows (leads & appointments) ------------------------------ */

.rows { display: flex; flex-direction: column; gap: 0.6rem; }

.day-head {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--muted);
  margin: 0.9rem 0 0.1rem;
}
.day-head:first-child { margin-top: 0; }
.day-head strong { color: var(--text); font-weight: 700; }

.row {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1.1rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: border-color var(--speed) var(--ease);
}

.row:hover { border-color: var(--border-strong); }

.row[aria-busy="true"] { opacity: 0.6; pointer-events: none; }

.row-main { flex: 1 1 16rem; min-width: 0; }

.row-title { font-weight: 600; margin: 0; }

.row-sub { color: var(--muted); font-size: 0.85rem; margin: 0.15rem 0 0; overflow-wrap: anywhere; }

.row-sub a { color: inherit; text-decoration-color: rgba(255, 255, 255, 0.3); }
.row-sub a:hover { color: var(--text); }
.row-sub a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.row-msg {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0.4rem 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-top: 1px dashed var(--border);
  padding-top: 0.4rem;
}

.row-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  flex-shrink: 0;
}

.row-when { color: var(--muted); font-size: 0.8rem; }

.row-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: flex-end; }

/* Inventory item photo — a shelf snapshot, sized to be recognisable in a list
   rather than to be looked at. For an admin the thumbnail is the control. */
.inv-photo { flex: none; }
.inv-thumb {
  display: block;
  width: 3rem; height: 3rem;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel-2);
}
.inv-thumb.is-empty { display: grid; place-items: center; color: var(--muted); border-style: dashed; }
.inv-thumb-btn {
  padding: 0; border: 0; background: none; cursor: pointer;
  border-radius: var(--radius); display: block;
}
.inv-thumb-btn:hover .inv-thumb { border-color: var(--accent); }
.inv-thumb-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.row-time {
  flex-shrink: 0;
  min-width: 5.2rem;
  font-variant-numeric: tabular-nums;
}
.row-time .t-start { font-weight: 700; display: block; }
.row-time .t-end { color: var(--muted); font-size: 0.8rem; }

.row-price { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Clickable list row that navigates to a detail page (e.g. a client). */
.row-link { text-decoration: none; color: inherit; cursor: pointer; align-items: center; }
.row-link:hover { border-color: var(--border-strong); }
.row-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.row-chevron { color: var(--muted); font-size: 1.5rem; line-height: 1; }

/* Detail pages (e.g. a single client) */
.detail-section { margin-top: 1.5rem; }
.detail-line { margin: 0.6rem 0 0; overflow-wrap: anywhere; }
.detail-line:first-child { margin-top: 0; }
.detail-label {
  display: inline-block;
  min-width: 5rem;
  color: var(--muted);
  font-size: 0.8rem;
}
.detail-line a { color: var(--accent); text-decoration: none; }
.detail-line a:hover { text-decoration: underline; }

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

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-new,
.badge-confirmed { color: #7fefff; background: var(--accent-soft); border-color: rgba(25, 227, 255, 0.3); }

.badge-contacted,
.badge-requested { color: var(--warn); background: var(--warn-soft); border-color: rgba(255, 202, 112, 0.3); }

.badge-converted,
.badge-completed { color: var(--ok); background: var(--ok-soft); border-color: rgba(67, 223, 160, 0.3); }

.badge-in_progress { color: var(--violet); background: var(--violet-soft); border-color: rgba(185, 168, 255, 0.3); }

.badge-archived,
.badge-cancelled { color: var(--gray); background: var(--gray-soft); border-color: rgba(170, 179, 194, 0.25); }

.badge-no_show { color: var(--danger); background: var(--danger-soft); border-color: rgba(255, 107, 129, 0.3); }

.loc-chip {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.14rem 0.5rem;
  margin-left: 0.4rem;
  vertical-align: 1px;
}

/* ------------------------------ Empty & skeleton states ------------------------------ */

.empty {
  text-align: center;
  padding: 3rem 1.5rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}

.empty-title { font-weight: 600; margin: 0 0 0.25rem; }
.empty-sub { color: var(--muted); margin: 0; font-size: 0.875rem; }

.skeleton {
  height: 4.25rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(100deg, var(--panel) 40%, var(--panel-2) 50%, var(--panel) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
  from { background-position: 130% 0; }
  to { background-position: -30% 0; }
}

/* ------------------------------ New booking form ------------------------------ */

.form { max-width: 44rem; }

.form-section { border: 0; margin: 0 0 1.4rem; padding: 0; min-width: 0; }
.form-section:last-of-type { margin-bottom: 1rem; }

.form-section legend {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0;
  margin-bottom: 0.7rem;
}

.form-section legend em { font-style: normal; font-weight: 500; text-transform: none; letter-spacing: 0; }

.field-row { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: flex-start; }
.field-row .field { flex: 0 1 auto; }
.field-row .grow { flex: 1 1 12rem; }
.field-row > .btn { margin-top: 1.55rem; }

.subpanel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem;
  margin-bottom: 1rem;
}

.checks { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.875rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.3rem 0.8rem 0.3rem 0.6rem;
  cursor: pointer;
  transition: border-color var(--speed) var(--ease), background-color var(--speed) var(--ease);
}

.check:hover { background: var(--panel-2); }

.check:has(input:checked) {
  border-color: rgba(25, 227, 255, 0.45);
  background: var(--accent-soft);
}

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

.check input {
  width: 0.95rem;
  height: 0.95rem;
  margin: 0;
  accent-color: var(--accent);
}

.form-actions { display: flex; gap: 0.6rem; }

/* ------------------------------ Inventory ------------------------------ */

#inv-form { max-width: 44rem; margin-bottom: 1.4rem; }

.panel-title {
  font-family: "Sora", var(--font);
  font-size: 1.05rem;
  margin: 0 0 1.1rem;
}

/* Low-stock marker on an item row — reuses .loc-chip shape, warns in amber. */
.chip-low {
  color: var(--warn);
  border-color: rgba(255, 202, 112, 0.4);
  background: var(--warn-soft);
}

.usage-section {
  margin-top: 2.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}

.section-head {
  font-family: "Sora", var(--font);
  font-size: 1.1rem;
  margin: 0 0 0.3rem;
}

.section-sub { color: var(--muted); font-size: 0.875rem; margin: 0 0 1.1rem; max-width: 42rem; }

.usage-service-field { max-width: 26rem; margin-bottom: 1.1rem; }

/* Add-a-rate row: item select + qty input sit inline, wrapping on small screens. */
.usage-add-fields { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.usage-add .usage-item { flex: 1 1 14rem; min-width: 0; }
.usage-add .usage-qty { flex: 0 1 9rem; width: auto; }
.usage-add { border-style: dashed; }

/* ------------------------------ Toasts ------------------------------ */

.toasts {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: min(92vw, 26rem);
  pointer-events: none;
}

.toast {
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.8);
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  max-width: 100%;
  animation: toast-in 220ms var(--ease);
}

.toast-error { border-color: rgba(255, 107, 129, 0.45); color: var(--danger); }
.toast-ok { border-color: rgba(67, 223, 160, 0.45); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ------------------------------ API keys ------------------------------ */

#key-form { max-width: 44rem; margin-bottom: 1.4rem; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* Role marker on a key row — reuses .loc-chip shape, tinted cyan. */
.role-chip {
  color: var(--accent);
  border-color: rgba(25, 227, 255, 0.35);
  background: var(--accent-soft);
  text-transform: capitalize;
}

.section-sub code,
.key-reveal-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.section-sub code {
  font-size: 0.85em;
  background: var(--panel-2);
  padding: 0.05rem 0.35rem;
  border-radius: 5px;
}

/* One-time key reveal: the plaintext is shown once, at creation. */
.key-reveal {
  background: var(--accent-soft);
  border: 1px solid rgba(25, 227, 255, 0.3);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  margin-bottom: 1.4rem;
}

.key-reveal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.key-reveal-title { font-weight: 600; margin: 0; }
.key-reveal-warn { color: var(--warn); font-size: 0.85rem; margin: 0 0 0.7rem; }

.key-reveal-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.key-reveal-code {
  flex: 1 1 20rem;
  min-width: 0;
  font-size: 0.85rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
  overflow-wrap: anywhere;
  user-select: all;
}

.key-expires-field { max-width: 22rem; }

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

@media (max-width: 700px) {
  .topbar-inner { padding: 0.6rem 1rem; gap: 0.6rem; }
  .tabs { order: 3; width: 100%; }
  .content { padding: 1.25rem 1rem 4.5rem; }
  .user-id { display: none; }

  .row { flex-wrap: wrap; }
  .row-side { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
  .row-actions { justify-content: flex-start; }
  .row-time { display: flex; gap: 0.4rem; align-items: baseline; min-width: 0; width: 100%; }

  .toolbar-status { margin-left: 0; width: 100%; }
  .toolbar-status select { width: 100%; }
}

/* ------------------------------ Pricing packages ------------------------------ */

/* Live special-offer marker on a package row — reuses .loc-chip shape, promo violet. */
.chip-offer {
  color: var(--violet);
  border-color: rgba(185, 168, 255, 0.4);
  background: var(--violet-soft);
}

/* A package with a live sale: strike the original, highlight the sale price. */
.pkg-price-was {
  text-decoration: line-through;
  color: var(--muted);
  margin-right: 0.4rem;
}
.pkg-price-now {
  color: var(--ok);
  font-weight: 700;
}

/* Inline checkboxes (Featured / Visible) sit next to the badge field in the editor. */
.pkg-check {
  align-self: center;
  white-space: nowrap;
}

/* Helper note under the special-offer fields. */
.pkg-offer-hint {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ------------------------------ Work gallery ------------------------------ */

/* Source toggle (Manual / Auto from Instagram) above the work list. */
.work-source {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0.25rem 0 0.6rem;
}
.work-source-label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

/* Instagram connection panel (shown in Auto-from-Instagram mode). */
.work-ig-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.work-ig-panel .section-sub {
  margin: 0;
  flex: 1;
  min-width: 12rem;
}

/* ------------------------------ Reduced motion ------------------------------ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Wash presets — read-only recipe cards on the Inventory tab. The step list
   leans on the item photos so the routine is recognisable at a glance. */
.presets-section { margin-top: 2.2rem; }
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 0.9rem;
}
.preset-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
}
.preset-name { margin: 0; font-size: 1.02rem; }
.preset-desc { margin: 0.25rem 0 0.6rem; font-size: 0.82rem; color: var(--muted); }
.preset-steps { list-style: none; margin: 0; padding: 0; }
.preset-step {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.55rem 0;
  border-top: 1px solid var(--border);
}
.step-thumb {
  flex: none;
  width: 2.1rem; height: 2.1rem;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel-2);
}
.step-thumb-empty { border-style: dashed; }
.step-main { min-width: 0; }
.step-head { margin: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 0.55rem; align-items: baseline; font-size: 0.85rem; }
.step-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
}
.step-item { font-weight: 600; }
.step-item-missing { color: var(--muted); font-weight: 400; font-style: italic; }
.step-ph, .step-dose {
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  white-space: nowrap;
}
.step-note { margin: 0.2rem 0 0; font-size: 0.78rem; color: var(--muted); }
