/*
 * LINEONE Hair — Dashboard Shell (polish layer)
 * Loads AFTER brand.css. Additive only: extends tokens, adds skeletons,
 * sticky topbar, command palette, toasts, collapsible sidebar, micro-
 * interactions. Existing class names from brand.css remain authoritative.
 */

/* ──────────────────────────────────────────────────────────────
   1.  Extended tokens
   ────────────────────────────────────────────────────────────── */
:root {
  /* Motion */
  --loh-ease: cubic-bezier(.2,.7,.2,1);
  --loh-ease-out: cubic-bezier(.16,1,.3,1);
  --loh-dur-fast: 120ms;
  --loh-dur-base: 200ms;
  --loh-dur-slow: 360ms;

  /* Radius (square brand, small radius reserved for floating UI) */
  --loh-radius-none: 0;
  --loh-radius-sm: 2px;
  --loh-radius-md: 6px;
  --loh-radius-lg: 10px;
  --loh-radius-full: 999px;

  /* Shadow scale */
  --loh-shadow-xs: 0 1px 0 rgba(43,61,66,.04), 0 1px 2px rgba(43,61,66,.05);
  --loh-shadow-card: 0 1px 0 rgba(43,61,66,.04), 0 2px 8px rgba(43,61,66,.06);
  --loh-shadow-card-hover: 0 1px 0 rgba(43,61,66,.04), 0 8px 24px rgba(43,61,66,.10);
  --loh-shadow-pop: 0 12px 40px rgba(43,61,66,.18), 0 2px 8px rgba(43,61,66,.10);
  --loh-shadow-ring: 0 0 0 3px rgba(51,87,73,.18);

  /* Brand glow */
  --loh-glow-gold: 0 0 0 3px rgba(137,118,75,.22);

  /* Layout extensions */
  --loh-topbar-h: 56px;
  --loh-sidebar-collapsed-w: 64px;

  /* Skeleton */
  --loh-skel-base: #ECEDEB;
  --loh-skel-shimmer: #F6F6F2;
}

/* ──────────────────────────────────────────────────────────────
   2.  Body / shell wrapper
   ────────────────────────────────────────────────────────────── */
.loh-main { padding-top: var(--loh-topbar-h); }

/* When the sidebar is collapsed, push main content closer */
body.loh-sidebar-collapsed .loh-main { margin-left: var(--loh-sidebar-collapsed-w); }
body.loh-sidebar-collapsed .loh-topbar { left: var(--loh-sidebar-collapsed-w); }

/* ──────────────────────────────────────────────────────────────
   3.  Topbar — sticky header with command launcher
   ────────────────────────────────────────────────────────────── */
.loh-topbar {
  position: fixed;
  top: 0;
  left: var(--loh-sidebar-width);
  right: 0;
  height: var(--loh-topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--loh-border);
  display: flex;
  align-items: center;
  gap: var(--loh-space-md);
  padding: 0 var(--loh-space-lg);
  z-index: 80;
}
.loh-topbar__crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--loh-text-secondary);
  letter-spacing: .3px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.loh-topbar__crumbs a {
  color: var(--loh-text-secondary);
  text-decoration: none;
  transition: color var(--loh-dur-fast) var(--loh-ease);
}
.loh-topbar__crumbs a:hover { color: var(--loh-hunter-green); }
.loh-topbar__crumbs .sep { opacity: .35; }
.loh-topbar__crumbs .current {
  color: var(--loh-text-primary);
  font-weight: 600;
}

/* Command launcher button */
.loh-cmd-launcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px 0 12px;
  background: var(--loh-bg-primary);
  border: 1px solid var(--loh-border);
  color: var(--loh-text-secondary);
  font-family: var(--loh-font);
  font-size: 12px;
  cursor: pointer;
  border-radius: var(--loh-radius-md);
  transition: all var(--loh-dur-fast) var(--loh-ease);
  min-width: 220px;
}
.loh-cmd-launcher:hover {
  background: #fff;
  border-color: var(--loh-hunter-green-light);
  color: var(--loh-text-primary);
  box-shadow: var(--loh-shadow-xs);
}
.loh-cmd-launcher svg {
  width: 14px; height: 14px;
  flex-shrink: 0;
  opacity: .55;
}
.loh-cmd-launcher .kbd {
  margin-left: auto;
}
.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 10px;
  font-weight: 600;
  color: var(--loh-text-secondary);
  background: #fff;
  border: 1px solid var(--loh-border);
  border-bottom-width: 2px;
  border-radius: 3px;
  line-height: 1;
}

/* Topbar status dot — Shopify sync indicator */
.loh-topbar__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--loh-text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.loh-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--loh-success);
  box-shadow: 0 0 0 3px rgba(45,106,79,.18);
}
.loh-status-dot.is-warn  { background: var(--loh-warning); box-shadow: 0 0 0 3px rgba(212,134,11,.22); }
.loh-status-dot.is-error { background: var(--loh-danger);  box-shadow: 0 0 0 3px rgba(196,30,58,.22); }

.loh-topbar__user-btn {
  width: 34px; height: 34px;
  border-radius: var(--loh-radius-full);
  background: var(--loh-champagne-gold);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 12px;
  border: none;
  cursor: pointer;
  transition: transform var(--loh-dur-fast) var(--loh-ease), box-shadow var(--loh-dur-fast) var(--loh-ease);
}
.loh-topbar__user-btn:hover { transform: translateY(-1px); box-shadow: var(--loh-glow-gold); }

/* ──────────────────────────────────────────────────────────────
   4.  Sidebar enhancements — collapsible groups, collapse mode
   ────────────────────────────────────────────────────────────── */
.loh-sidebar {
  box-shadow: 4px 0 24px rgba(43,61,66,.08);
}
.loh-sidebar__nav {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.18) transparent;
}
.loh-sidebar__nav::-webkit-scrollbar { width: 6px; }
.loh-sidebar__nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.18);
  border-radius: 3px;
}

/* Collapsible group header */
.loh-sidebar__group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  padding: var(--loh-space-lg) var(--loh-space-lg) var(--loh-space-sm);
  cursor: pointer;
  color: rgba(255,255,255,.35);
  font-family: var(--loh-font);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: color var(--loh-dur-fast) var(--loh-ease);
}
.loh-sidebar__group:hover { color: rgba(255,255,255,.7); }
.loh-sidebar__group .caret {
  width: 10px; height: 10px;
  transition: transform var(--loh-dur-base) var(--loh-ease);
  opacity: .6;
}
.loh-sidebar__group[aria-expanded="false"] .caret { transform: rotate(-90deg); }
.loh-sidebar__group-body {
  overflow: hidden;
  max-height: 1000px;
  transition: max-height var(--loh-dur-base) var(--loh-ease);
}
.loh-sidebar__group[aria-expanded="false"] + .loh-sidebar__group-body {
  max-height: 0;
}

/* Nav item — active state with gold accent bar */
.loh-nav-item {
  position: relative;
  border-left: none !important;
  overflow: hidden;
  transition: background var(--loh-dur-fast) var(--loh-ease), color var(--loh-dur-fast) var(--loh-ease);
}
.loh-nav-item::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  background: var(--loh-champagne-gold);
  opacity: 0;
  transition: opacity var(--loh-dur-fast) var(--loh-ease);
}
.loh-nav-item.active::before { opacity: 1; }
.loh-nav-item.active {
  background: rgba(255,255,255,.06);
}
.loh-nav-item .kbd {
  margin-left: auto;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.55);
  border-color: rgba(255,255,255,.1);
  opacity: 0;
  transition: opacity var(--loh-dur-fast) var(--loh-ease);
}
.loh-nav-item:hover .kbd { opacity: 1; }

/* Pinned/Recents row */
.loh-sidebar__pinned {
  display: flex;
  gap: 6px;
  padding: var(--loh-space-sm) var(--loh-space-lg);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.loh-sidebar__pinned-item {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.65);
  text-decoration: none;
  border-radius: var(--loh-radius-sm);
  transition: all var(--loh-dur-fast) var(--loh-ease);
}
.loh-sidebar__pinned-item:hover {
  background: rgba(255,255,255,.12);
  color: #fff;
  transform: translateY(-1px);
}
.loh-sidebar__pinned-item svg { width: 14px; height: 14px; }

/* Collapse toggle button on the sidebar bottom */
.loh-sidebar__collapse-btn {
  position: absolute;
  top: 24px;
  right: -12px;
  width: 24px; height: 24px;
  background: var(--loh-bg-sidebar);
  border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.7);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  z-index: 102;
  transition: all var(--loh-dur-fast) var(--loh-ease);
  box-shadow: 2px 2px 8px rgba(0,0,0,.18);
}
@media (min-width: 769px) {
  .loh-sidebar__collapse-btn { display: inline-flex; }
}
.loh-sidebar__collapse-btn:hover { background: var(--loh-hunter-green-light); color: #fff; }
.loh-sidebar__collapse-btn svg {
  width: 12px; height: 12px;
  transition: transform var(--loh-dur-base) var(--loh-ease);
}
body.loh-sidebar-collapsed .loh-sidebar__collapse-btn svg { transform: rotate(180deg); }

/* Collapsed sidebar state */
body.loh-sidebar-collapsed .loh-sidebar { width: var(--loh-sidebar-collapsed-w); }
/* collapsed rail keeps the 8-dot symbol only — the wordmark needs width it hasn't got */
body.loh-sidebar-collapsed .loh-sidebar__logo-sym { height: 24px; }
body.loh-sidebar-collapsed .loh-sidebar__logo { padding: 18px 8px 14px; }
body.loh-sidebar-collapsed .loh-sidebar__logo-img,
body.loh-sidebar-collapsed .loh-sidebar__logo-text,
body.loh-sidebar-collapsed .loh-sidebar__group,
body.loh-sidebar-collapsed .loh-sidebar__user > div:not(.loh-sidebar__user-avatar),
body.loh-sidebar-collapsed .loh-sidebar__user > span,
body.loh-sidebar-collapsed .loh-sidebar__footer button,
body.loh-sidebar-collapsed .loh-sidebar__pinned,
body.loh-sidebar-collapsed .loh-nav-item span:not(.nav-icon),
body.loh-sidebar-collapsed .loh-nav-item .kbd { display: none; }
body.loh-sidebar-collapsed .loh-nav-item {
  padding: 12px 0;
  justify-content: center;
}
body.loh-sidebar-collapsed .loh-nav-item:hover { padding-left: 0; }
body.loh-sidebar-collapsed .loh-sidebar__footer {
  padding: var(--loh-space-sm);
  display: flex;
  justify-content: center;
}

/* Tooltip when collapsed (pure CSS) */
body.loh-sidebar-collapsed .loh-nav-item[data-tooltip] {
  position: relative;
}
body.loh-sidebar-collapsed .loh-nav-item[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--loh-cold-grey);
  color: #fff;
  padding: 5px 9px;
  font-size: 11px;
  border-radius: var(--loh-radius-sm);
  white-space: nowrap;
  z-index: 1000;
  box-shadow: var(--loh-shadow-pop);
}

/* ──────────────────────────────────────────────────────────────
   5.  Card upgrades — entrance + hover lift + interactive state
   ────────────────────────────────────────────────────────────── */
.loh-card {
  border-radius: var(--loh-radius-sm);
  box-shadow: var(--loh-shadow-xs);
  transition: box-shadow var(--loh-dur-fast) var(--loh-ease),
              border-color var(--loh-dur-fast) var(--loh-ease);
}
.loh-card:hover {
  box-shadow: var(--loh-shadow-card-hover);
  border-color: #DDE2DC;
}
.loh-card.is-interactive { cursor: pointer; }

.loh-metric {
  border-radius: var(--loh-radius-sm);
  box-shadow: var(--loh-shadow-xs);
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--loh-dur-fast) var(--loh-ease);
}
.loh-metric::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--loh-hunter-green), var(--loh-champagne-gold), var(--loh-hunter-green));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--loh-dur-base) var(--loh-ease-out);
}
.loh-metric:hover {
  box-shadow: var(--loh-shadow-card);
}
.loh-metric:hover::after { transform: scaleX(1); }
.loh-metric__value {
  font-variant-numeric: tabular-nums;
}

/* ──────────────────────────────────────────────────────────────
   6.  Buttons — press feedback, focus ring
   ────────────────────────────────────────────────────────────── */
.loh-btn {
  position: relative;
  border-radius: var(--loh-radius-sm);
  transition: background var(--loh-dur-fast) var(--loh-ease),
              color var(--loh-dur-fast) var(--loh-ease),
              box-shadow var(--loh-dur-fast) var(--loh-ease);
}
.loh-btn:focus-visible {
  outline: none;
  box-shadow: var(--loh-shadow-ring);
}
.loh-btn--primary:focus-visible { box-shadow: var(--loh-shadow-ring); }
.loh-btn--gold:focus-visible { box-shadow: var(--loh-glow-gold); }

/* Spinner inside button */
.loh-btn.is-loading { pointer-events: none; opacity: .85; }
.loh-btn.is-loading::after {
  content: "";
  width: 12px; height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  margin-left: 6px;
  animation: loh-spin .7s linear infinite;
}
@keyframes loh-spin { to { transform: rotate(360deg); } }

/* Inputs — better focus ring */
.loh-input:focus, .loh-select:focus {
  box-shadow: var(--loh-shadow-ring);
  border-color: var(--loh-hunter-green);
}

/* ──────────────────────────────────────────────────────────────
   7.  Skeleton loaders — replace plain "Loading..." text
   ────────────────────────────────────────────────────────────── */
.loh-skel {
  display: block;
  background: linear-gradient(90deg, var(--loh-skel-base) 0%, var(--loh-skel-shimmer) 50%, var(--loh-skel-base) 100%);
  background-size: 200% 100%;
  animation: loh-shimmer 1.4s linear infinite;
  border-radius: var(--loh-radius-sm);
}
.loh-skel--line { height: 12px; margin: 6px 0; }
.loh-skel--text { height: 14px; margin: 4px 0; width: 80%; }
.loh-skel--title { height: 18px; margin: 6px 0 12px; width: 60%; }
.loh-skel--number { height: 28px; width: 100px; margin: 4px auto; }
.loh-skel--avatar { width: 32px; height: 32px; border-radius: 50%; }
.loh-skel--row { height: 18px; margin: 8px 0; }
.loh-skel--block { height: 80px; }
@keyframes loh-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Inline spinner */
.loh-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--loh-border);
  border-top-color: var(--loh-hunter-green);
  border-radius: 50%;
  animation: loh-spin .7s linear infinite;
  vertical-align: middle;
}
.loh-spinner--lg { width: 24px; height: 24px; border-width: 3px; }

/* ──────────────────────────────────────────────────────────────
   8.  Command palette (⌘K)
   ────────────────────────────────────────────────────────────── */
.loh-cmd {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  background: rgba(43,61,66,.40);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: loh-fade-in var(--loh-dur-fast) var(--loh-ease) both;
}
.loh-cmd.is-open { display: flex; }
@keyframes loh-fade-in { from { opacity: 0; } to { opacity: 1; } }

.loh-cmd__panel {
  width: 100%;
  max-width: 620px;
  background: #fff;
  border-radius: var(--loh-radius-lg);
  box-shadow: var(--loh-shadow-pop);
  overflow: hidden;
  animation: loh-pop-in var(--loh-dur-base) var(--loh-ease-out) both;
  display: flex;
  flex-direction: column;
  max-height: 70vh;
}
@keyframes loh-pop-in {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to   { opacity: 1; transform: translateY(0)     scale(1); }
}

.loh-cmd__search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--loh-border);
}
.loh-cmd__search svg {
  width: 18px; height: 18px;
  color: var(--loh-text-secondary);
  flex-shrink: 0;
}
.loh-cmd__input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--loh-font);
  font-size: 16px;
  color: var(--loh-text-primary);
  background: transparent;
}
.loh-cmd__input::placeholder { color: var(--loh-text-muted); }
.loh-cmd__esc {
  font-size: 10px;
  color: var(--loh-text-muted);
  letter-spacing: .5px;
  text-transform: uppercase;
}

.loh-cmd__list {
  overflow-y: auto;
  padding: 6px;
}
.loh-cmd__group-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--loh-text-muted);
  padding: 12px 12px 6px;
}
.loh-cmd__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--loh-radius-md);
  cursor: pointer;
  color: var(--loh-text-primary);
  text-decoration: none;
  transition: background var(--loh-dur-fast) var(--loh-ease);
}
.loh-cmd__item:hover,
.loh-cmd__item.is-active {
  background: var(--loh-bg-primary);
}
.loh-cmd__item.is-active {
  background: #EAF1ED;
}
.loh-cmd__item svg {
  width: 16px; height: 16px;
  color: var(--loh-hunter-green);
  opacity: .85;
  flex-shrink: 0;
}
.loh-cmd__item-label {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}
.loh-cmd__item-meta {
  font-size: 11px;
  color: var(--loh-text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.loh-cmd__item-shortcut {
  display: flex; gap: 4px;
}
.loh-cmd__empty {
  padding: 32px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--loh-text-muted);
}

.loh-cmd__footer {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 16px;
  border-top: 1px solid var(--loh-border);
  background: var(--loh-bg-primary);
  font-size: 11px;
  color: var(--loh-text-muted);
}
.loh-cmd__footer .hint {
  display: inline-flex; align-items: center; gap: 5px;
}

/* ──────────────────────────────────────────────────────────────
   9.  Toast notifications
   ────────────────────────────────────────────────────────────── */
.loh-toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9500;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 360px;
}
.loh-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
  border-radius: var(--loh-radius-md);
  border: 1px solid var(--loh-border);
  border-left: 3px solid var(--loh-hunter-green);
  box-shadow: var(--loh-shadow-pop);
  animation: loh-toast-in var(--loh-dur-base) var(--loh-ease-out) both;
  min-width: 280px;
}
.loh-toast.is-leaving { animation: loh-toast-out var(--loh-dur-base) var(--loh-ease) forwards; }
@keyframes loh-toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes loh-toast-out {
  to { opacity: 0; transform: translateX(20px); }
}
.loh-toast--success { border-left-color: var(--loh-success); }
.loh-toast--warning { border-left-color: var(--loh-warning); }
.loh-toast--error   { border-left-color: var(--loh-danger); }
.loh-toast--info    { border-left-color: var(--loh-info); }

.loh-toast__icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}
.loh-toast--success .loh-toast__icon { color: var(--loh-success); }
.loh-toast--warning .loh-toast__icon { color: var(--loh-warning); }
.loh-toast--error   .loh-toast__icon { color: var(--loh-danger); }
.loh-toast--info    .loh-toast__icon { color: var(--loh-info); }

.loh-toast__body { flex: 1; min-width: 0; }
.loh-toast__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--loh-text-primary);
  margin-bottom: 1px;
}
.loh-toast__msg {
  font-size: 12px;
  color: var(--loh-text-secondary);
  line-height: 1.4;
}
.loh-toast__close {
  background: none;
  border: none;
  color: var(--loh-text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  line-height: 1;
  transition: color var(--loh-dur-fast) var(--loh-ease);
}
.loh-toast__close:hover { color: var(--loh-text-primary); }

/* ──────────────────────────────────────────────────────────────
   10.  Page header polish — gold accent above the title
   ────────────────────────────────────────────────────────────── */
.loh-page-header {
  position: relative;
  padding-top: 10px;
}
.loh-page-header h1 {
  font-weight: 700;
  letter-spacing: -.3px;
}

/* ──────────────────────────────────────────────────────────────
   11.  Empty states
   ────────────────────────────────────────────────────────────── */
.loh-empty {
  text-align: center;
  padding: 36px 18px;
  color: var(--loh-text-muted);
}
.loh-empty__icon {
  width: 36px; height: 36px;
  opacity: .35;
  margin: 0 auto 10px;
}
.loh-empty__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--loh-text-secondary);
  margin-bottom: 4px;
}
.loh-empty__msg {
  font-size: 12px;
}

/* ──────────────────────────────────────────────────────────────
   12.  Table polish
   ────────────────────────────────────────────────────────────── */
.loh-table tr {
  transition: background var(--loh-dur-fast) var(--loh-ease);
}

/* ──────────────────────────────────────────────────────────────
   13.  Focus + accessibility
   ────────────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--loh-hunter-green);
  outline-offset: 2px;
}
.loh-nav-item:focus-visible {
  outline: none;
  background: rgba(255,255,255,.1);
  box-shadow: inset 3px 0 0 var(--loh-champagne-gold);
}

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

/* ──────────────────────────────────────────────────────────────
   14.  Mobile adjustments
   ────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* The hamburger is position:fixed at left:12px and 40px wide, so it floats
     OVER the topbar. Without this clearance the breadcrumb renders directly
     underneath it — the overlap you see as "…board / Purchase Orders". */
  .loh-topbar { left: 0; padding: 0 12px 0 64px; }
  .loh-cmd-launcher { min-width: 0; padding: 0 8px; }
  .loh-cmd-launcher .kbd, .loh-cmd-launcher .label { display: none; }
  .loh-cmd-launcher svg { margin: 0; }
  /* Long breadcrumbs must truncate, not push the launcher off the screen. */
  .loh-topbar__crumbs {
    font-size: 11px; min-width: 0; flex: 1;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .loh-topbar__status { display: none; }
  .loh-cmd__panel { max-width: 92%; max-height: 80vh; }
  body.loh-sidebar-collapsed .loh-main { margin-left: 0; }
  body.loh-sidebar-collapsed .loh-topbar { left: 0; }

  /* iOS zooms the entire page when you focus an input whose font-size is
     under 16px, and never zooms back out. This one line is the difference
     between a form feeling native and feeling like a website. */
  input, select, textarea { font-size: 16px; }

  /* Keep the home indicator off the bottom of the content. */
  .loh-content { padding-bottom: calc(var(--loh-space-xl) + env(safe-area-inset-bottom)); }

  /* Apple's minimum comfortable target is 44px; the desktop rows are shorter. */
  .loh-nav-item { min-height: 44px; }

  /* Momentum scrolling, and stop a horizontal scroll inside a pane from
     dragging the whole page sideways with it. */
  .loh-content { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
}

/* ──────────────────────────────────────────────────────────────
   15.  Mobile tab bar
   ──────────────────────────────────────────────────────────────
   Four personalised destinations + More, fixed to the bottom. Built by
   renderMobileTabs() in nav.js; hidden entirely above 768px so the desktop
   shell is untouched. */
.loh-tabbar { display: none; }

@media (max-width: 768px) {
  .loh-tabbar {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 90;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--loh-border);
    /* The bar sits above the home indicator rather than under it. */
    padding-bottom: env(safe-area-inset-bottom);
  }
  .loh-tabbar__item {
    flex: 1 1 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 3px;
    min-height: 49px;                 /* iOS standard tab-bar height */
    padding: 7px 2px 6px;
    background: none; border: 0;
    font-family: inherit;
    color: var(--loh-cool-gray);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: color .15s;
  }
  .loh-tabbar__item.is-active { color: var(--loh-hunter-green); }
  .loh-tabbar__item:active { opacity: .55; }
  .loh-tabbar__icon { display: block; line-height: 0; }
  .loh-tabbar__icon svg { width: 22px; height: 22px; }
  .loh-tabbar__label {
    font-size: 10px; letter-spacing: .2px; font-weight: 600;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }

  /* Content must clear the bar, or the last row of every page is unreachable. */
  html.loh-has-tabbar .loh-content {
    padding-bottom: calc(49px + var(--loh-space-lg) + env(safe-area-inset-bottom));
  }
  /* The drawer opens above the tab bar, not behind it. */
  .loh-sidebar { z-index: 95; }
  .loh-sidebar-overlay { z-index: 94; }
}

/* ── Sidebar: pins + workload badges (2026-08-20) ───────────────────────── */
.loh-nav-row { position: relative; display: block; }
.loh-nav-row .loh-nav-item { padding-right: 30px; }
.loh-nav-pin {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border: none; background: none; cursor: pointer;
  color: rgba(255,255,255,.28); font-size: 13px; line-height: 1; padding: 0;
  border-radius: 999px; opacity: 0; transition: opacity .12s, color .12s;
}
.loh-nav-row:hover .loh-nav-pin,
.loh-nav-pin:focus-visible { opacity: 1; }
.loh-nav-pin:hover { color: #E9D9A8; background: rgba(255,255,255,.08); }
.loh-nav-pin.on { opacity: 1; color: #E9D9A8; }          /* pinned stays lit */
.loh-nav-badge {
  margin-left: auto; min-width: 19px; height: 19px; padding: 0 6px;
  border-radius: 999px; background: #C41E3A; color: #fff;
  font-size: 10.5px; font-weight: 700; line-height: 19px; text-align: center;
  font-variant-numeric: tabular-nums; flex: 0 0 auto;
}
.loh-nav-item.active .loh-nav-badge { background: #fff; color: #034011; }
/* collapsed rail: no pins, badge shrinks to a dot on the icon */
body.loh-sidebar-collapsed .loh-nav-pin { display: none; }
body.loh-sidebar-collapsed .loh-nav-row .loh-nav-item { padding-right: 0; }
body.loh-sidebar-collapsed .loh-nav-badge {
  position: absolute; top: 4px; right: 8px; min-width: 8px; width: 8px; height: 8px;
  padding: 0; font-size: 0; line-height: 0;
}

/* Shortcut hints sit quietly until you go looking for them — next to a red
   badge an always-on "G P" chip reads like a status code, not a hint. */
.loh-nav-row .kbd { opacity: 0; transition: opacity .12s; }
.loh-nav-row:hover .kbd { opacity: .55; }
.loh-nav-item.active .kbd { opacity: .4; }
