/* ==========================================================================
   My Barback stylesheet
   Plain CSS, no build step. Edit and reload.

   Contents
     1. Tokens        6. Navigation      11. Inventory
     2. Base          7. Cards & stats   12. Timecards & tips
     3. Utilities     8. Buttons         13. Tables & reports
     4. Icons         9. Forms           14. Dialog (bottom sheet)
     5. App shell    10. Feedback        15. Auth pages
   ========================================================================== */

@font-face {
  font-family: "Inter Variable";
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --font: "Inter Variable", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --ink: #18181b;
  --ink-2: #3f3f46;
  --muted: #52525b;
  --subtle: #71717a;
  --faint: #a1a1aa;
  --line: #e4e4e7;
  --line-soft: #f1f1f3;
  --border: #d4d4d8;
  --canvas: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --surface-3: #f4f4f5;

  /* Navigation */
  --charcoal: #16191d;
  --on-dark: #e4e4e7;
  --on-dark-muted: #a1a1aa;

  /* Accent: teal-700 keeps white text at 5.5:1 */
  --accent: #0f766e;
  --accent-hover: #115e59;
  --accent-active: #134e4a;
  --accent-mid: #0d9488;
  --accent-bright: #5eead4;
  --accent-soft: #f0fdfa;
  --accent-ring: rgb(13 148 136 / 0.2);

  --danger: #b91c1c;
  --danger-solid: #dc2626;
  --danger-soft: #fef2f2;
  --danger-line: #fecaca;
  --warn-soft: #fffbeb;
  --warn-line: #fde68a;
  --success-soft: #ecfdf5;
  --success-line: #a7f3d0;

  --radius-xl: 24px;
  --radius-lg: 20px;
  --radius: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgb(16 24 40 / 0.05);
  --shadow-lg: 0 16px 40px -12px rgb(16 24 40 / 0.22);

  --tap: 2.75rem; /* 44px minimum touch target */
  --topbar-h: 3.5rem;
  --tabbar-h: 4.25rem;
  --sidebar-w: 16rem;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* 2. Base ------------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  font-feature-settings: "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, p, figure, ul, ol, dl, dd, fieldset, blockquote {
  margin: 0;
}
h1, h2, h3, h4 {
  font-size: inherit;
  font-weight: inherit;
}
ul, ol {
  padding: 0;
  list-style: none;
}
fieldset {
  min-width: 0;
  padding: 0;
  border: 0;
}
legend {
  padding: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
button, input, select, textarea {
  margin: 0;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}
button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
table {
  border-collapse: collapse;
}
[x-cloak] {
  display: none !important;
}
:focus-visible {
  outline: 2px solid var(--accent-mid);
  outline-offset: 2px;
}
::selection {
  background: #ccfbf1;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 3. Utilities (deliberately few) ------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.stack { display: flex; flex-direction: column; gap: 1rem; }
.row { display: flex; align-items: center; gap: 0.75rem; }
.row.top { align-items: flex-start; }
.row.baseline { align-items: baseline; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 0%; min-width: 0; }
.gap-xs { gap: 0.25rem; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 0.75rem; }
.gap-lg { gap: 1.5rem; }
.grid { display: grid; gap: 1rem; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.small { font-size: 0.875rem; line-height: 1.25rem; }
.tiny { font-size: 0.75rem; line-height: 1rem; }
.medium { font-weight: 500; }
.strong { font-weight: 600; }
.muted { color: var(--muted); }
.subtle { color: var(--subtle); }
.accent-text { color: var(--accent); }
.danger-text { color: var(--danger); }
.num { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }
.desktop-only { display: none; }

@media (min-width: 640px) {
  .sm-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm-row { flex-direction: row; align-items: flex-end; justify-content: space-between; }
}
@media (min-width: 1024px) {
  .lg-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .desktop-only { display: revert; }
  .mobile-only { display: none !important; }
}

/* 4. Icons ------------------------------------------------------------------ */
.icon, .icon-xs, .icon-sm, .icon-lg {
  display: block;
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
}
.icon-xs { width: 0.875rem; height: 0.875rem; }
.icon-sm { width: 1rem; height: 1rem; }
.icon-lg { width: 1.5rem; height: 1.5rem; }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 5. App shell ---------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -4rem;
  left: 0.75rem;
  z-index: 60;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
}
.skip-link:focus { top: 0.75rem; }

.app-main:focus { outline: none; }

.page {
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
  padding: 1.25rem 1rem calc(var(--tabbar-h) + var(--safe-bottom) + 2rem);
}
.page.is-wide { max-width: 64rem; }
.page-header { margin-bottom: 1.25rem; }
.page-title {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.page-subtitle {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--muted);
}
.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--subtle);
}
.section-title {
  font-size: 1rem;
  font-weight: 600;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 2.25rem;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
}
.back-link:hover { color: var(--ink); }

@media (min-width: 640px) {
  .page { padding-left: 1.5rem; padding-right: 1.5rem; }
  .page-title { font-size: 1.875rem; line-height: 2.25rem; }
}
@media (min-width: 1024px) {
  .page { padding-top: 2.5rem; padding-bottom: 3rem; }
  .app-main { padding-left: var(--sidebar-w); }
  .app-main.is-guest { padding-left: 0; }
}

/* 6. Navigation ------------------------------------------------------------------ */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
}
.logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-md);
  background: var(--accent-mid);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.logo-mark.is-sm { width: 2rem; height: 2rem; }
.logo-mark.is-lg { width: 2.75rem; height: 2.75rem; }

/* Mobile top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding-top: var(--safe-top);
  background: var(--charcoal);
  color: #fff;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-h);
  padding: 0 1rem;
}
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.1);
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
}
button.avatar:hover { background: rgb(255 255 255 / 0.16); }
/* Account menu button: initials + chevron so it reads as a menu. */
.account-btn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-height: var(--tap);
  padding: 0 0.5rem 0 0.25rem;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.08);
  color: #fff;
}
.account-btn:hover,
.account-btn[aria-expanded="true"] { background: rgb(255 255 255 / 0.16); }
.account-btn .avatar { background: rgb(255 255 255 / 0.12); }
.avatar.is-teal {
  width: 2.25rem;
  height: 2.25rem;
  background: rgb(13 148 136 / 0.25);
  color: #99f6e4;
}

/* Account dropdown */
.menu-wrap { position: relative; }
.menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 15rem;
  padding: 0.375rem 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
.menu-header {
  padding: 0.5rem 1rem 0.75rem;
  border-bottom: 1px solid var(--line-soft);
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: var(--tap);
  padding: 0 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
}
.menu-item .icon { color: var(--subtle); }
.menu-item:hover { background: var(--surface-2); }
.menu-item.is-danger,
.menu-item.is-danger .icon { color: var(--danger); }
.menu-sep {
  margin-top: 0.375rem;
  padding-top: 0.375rem;
  border-top: 1px solid var(--line-soft);
}

/* Mobile bottom tab bar */
.tabbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  padding-bottom: var(--safe-bottom);
  border-top: 1px solid rgb(255 255 255 / 0.06);
  background: var(--charcoal);
}
.tabbar-inner {
  display: flex;
  max-width: 32rem;
  margin: 0 auto;
}
.tab-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0 0.45rem;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--on-dark-muted);
}
.tab-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 2rem;
  border-radius: 999px;
  transition: background-color 0.15s;
}
.tab-link[aria-current="page"] { color: #fff; }
.tab-link[aria-current="page"] .tab-pill {
  background: rgb(45 212 191 / 0.16);
  color: var(--accent-bright);
}

/* Desktop sidebar */
.sidebar { display: none; }
.nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.nav.is-secondary {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgb(255 255 255 / 0.1);
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: var(--tap);
  padding: 0 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--on-dark);
  text-align: left;
  transition: background-color 0.15s, color 0.15s;
}
.nav-link .icon { color: var(--faint); }
.nav-link:hover { background: rgb(255 255 255 / 0.05); color: #fff; }
.nav-link[aria-current="page"] { background: rgb(255 255 255 / 0.1); color: #fff; }
.nav-link[aria-current="page"] .icon { color: var(--accent-bright); }
.sidebar-user {
  margin-top: auto;
  padding: 0.75rem;
  border-radius: var(--radius);
  background: rgb(255 255 255 / 0.05);
}
.sidebar-user .name { font-size: 0.875rem; font-weight: 600; color: #fff; }
.sidebar-user .email { font-size: 0.75rem; color: var(--on-dark-muted); }

@media (min-width: 1024px) {
  .topbar, .tabbar { display: none; }
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-w);
    padding: 1.5rem 1rem;
    overflow-y: auto; /* short screens: Log out at the bottom stays reachable */
    background: var(--charcoal);
  }
  .sidebar .nav:first-of-type { margin-top: 2rem; }
}

/* Week navigation */
.week-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem;
}
.week-nav-label {
  flex: 1;
  min-width: 0;
  text-align: center;
}
.week-nav-label .title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 600;
}
.week-nav-label .relative {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--subtle);
}
.week-nav-label .relative.is-current { color: var(--accent); }
@media (min-width: 640px) {
  .week-nav-label .title { font-size: 1rem; }
}

/* Segmented control (Week | Month, report tabs) */
.segmented {
  display: flex;
  padding: 0.25rem;
  border-radius: var(--radius-md);
  background: rgb(228 228 231 / 0.7);
}
.segmented > a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 2.25rem;
  padding: 0 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
}
.segmented > a:hover { color: var(--ink); }
.segmented > a[aria-current="page"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* 7. Cards & stats ---------------------------------------------------------------- */
.card {
  border: 1px solid rgb(228 228 231 / 0.85);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.card-body { padding: 1rem; }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line-soft);
}
.card.is-flex {
  display: flex;
  flex-direction: column;
}
.card.is-flex .card-fill { flex: 1; }
.divided > * + * { border-top: 1px solid var(--line-soft); }
@media (min-width: 640px) {
  .card-body, .card-header { padding: 1.25rem; }
}

.stat-icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
}
.tone-teal { background: var(--accent-soft); color: var(--accent); }
.tone-sky { background: #f0f9ff; color: #0369a1; }
.tone-amber { background: #fffbeb; color: #b45309; }
.tone-gray { background: var(--surface-3); color: var(--subtle); }
.stat-value {
  font-size: 1.875rem;
  line-height: 2.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-value.is-sm { font-size: 1.375rem; line-height: 1.875rem; }
.stat-unit { font-size: 0.875rem; color: var(--muted); }
.stat-label { font-size: 0.8125rem; font-weight: 500; color: var(--muted); }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.stat-grid .card { padding: 0.875rem 1rem; }
@media (min-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.625rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25rem;
  white-space: nowrap;
}
.badge-gray { background: var(--surface-3); color: var(--ink-2); }
.badge-teal { background: var(--accent-soft); color: var(--accent-hover); box-shadow: inset 0 0 0 1px rgb(15 118 110 / 0.15); }
.badge-amber { background: #fffbeb; color: #92400e; box-shadow: inset 0 0 0 1px rgb(180 83 9 / 0.15); }
.badge-green { background: #ecfdf5; color: #065f46; box-shadow: inset 0 0 0 1px rgb(4 120 87 / 0.15); }

.progress {
  width: 100%;
  height: 0.5rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}
.progress > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent-mid);
  transition: width 0.3s;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 1.5rem;
  text-align: center;
}
.empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  background: var(--surface-3);
  color: var(--subtle);
}
.empty-title { margin-top: 1rem; font-weight: 600; }
.empty-text { max-width: 24rem; margin-top: 0.25rem; font-size: 0.875rem; color: var(--muted); }
.empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.link-grid {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgb(228 228 231 / 0.85);
  border-radius: var(--radius);
  background: rgb(228 228 231 / 0.85);
}
.link-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.5rem;
  padding: 0 1rem;
  background: var(--surface);
  font-size: 0.875rem;
  font-weight: 500;
  color: #27272a;
}
.link-row:hover { background: var(--surface-2); }
.link-row > .icon { color: var(--subtle); }
.link-row > .icon-sm { color: var(--faint); }
@media (min-width: 640px) {
  .link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.chart-box {
  position: relative;
  height: 13rem;
}

/* 8. Buttons ------------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--tap);
  padding: 0 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
}
.btn-lg { min-height: 3rem; padding: 0 1.25rem; font-size: 1rem; }
.btn-sm { min-height: 2.25rem; padding: 0 0.75rem; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { background: var(--accent-active); }
.btn-secondary { border-color: var(--border); background: var(--surface); color: var(--ink-2); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-secondary:active { background: var(--surface-3); }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { background: var(--danger-solid); color: #fff; }
.btn-danger:hover { background: var(--danger); }
.btn-danger-ghost { color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn.is-armed,
.btn.is-armed:hover {
  border-color: transparent;
  background: var(--danger-solid);
  color: #fff;
}
.btn-dashed {
  width: 100%;
  min-height: 3rem;
  border: 1px dashed var(--border);
  background: rgb(255 255 255 / 0.6);
  color: var(--ink-2);
}
.btn-dashed:hover { border-color: var(--accent-mid); background: var(--surface); color: var(--accent-hover); }
.btn-responsive { width: 100%; }
@media (min-width: 640px) {
  .btn-responsive { width: auto; }
}

.icon-btn {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  border-radius: var(--radius-md);
  color: var(--ink-2);
  transition: background-color 0.15s;
}
.icon-btn:hover { background: var(--surface-3); }
.icon-btn:disabled { opacity: 0.4; pointer-events: none; }

.link {
  font-weight: 500;
  color: var(--accent);
  text-underline-offset: 2px;
}
.link:hover { color: var(--accent-hover); text-decoration: underline; }

/* 9. Forms -------------------------------------------------------------------------- */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #27272a;
}
.optional { font-weight: 400; color: var(--subtle); }
.hint { margin-top: 0.375rem; font-size: 0.875rem; color: var(--subtle); }
.input {
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  /* 16px keeps iOS from zooming into the field */
  font-size: 1rem;
  line-height: 1.5rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.input::placeholder { color: var(--faint); }
.input:focus {
  outline: none;
  border-color: var(--accent-mid);
  box-shadow: 0 0 0 4px var(--accent-ring);
}
.input:disabled { background: var(--surface-2); color: var(--subtle); }
.input[aria-invalid="true"] { border-color: #ef4444; }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px rgb(239 68 68 / 0.15); }
textarea.input { min-height: 6rem; resize: vertical; }
textarea.input.is-short { min-height: 4.25rem; }
select.input {
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.25rem;
}
input[type="date"].input,
input[type="time"].input {
  display: flex;
  align-items: center;
}
input[type="date"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value {
  text-align: left;
}
.input-money { position: relative; }
.input-money > span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  padding-left: 0.875rem;
  color: var(--subtle);
  pointer-events: none;
}
.input-money > .input { padding-left: 1.75rem; }
.input-wrap { position: relative; }
.input-wrap > .input { padding-right: 3rem; }
.input-wrap > button {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  color: var(--subtle);
}
.input-wrap > button:hover { color: var(--ink); }
.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.375rem;
}
.label-row .label { margin-bottom: 0; }
.field-error {
  display: flex;
  align-items: flex-start;
  gap: 0.375rem;
  margin-top: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--danger);
}
.field-error .icon-sm { margin-top: 0.125rem; }
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--tap);
  font-size: 0.875rem;
  color: var(--ink-2);
  cursor: pointer;
}
.checkbox-row input {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  accent-color: var(--accent);
}
.form-actions {
  display: flex;
  gap: 0.5rem;
}
.form-actions > * { flex: 1; }
.search { position: relative; }
.search > .icon {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  color: var(--faint);
  transform: translateY(-50%);
  pointer-events: none;
}
.search > .input {
  min-height: var(--tap);
  padding-right: 2.5rem;
  padding-left: 2.5rem;
}
.search > .input::-webkit-search-cancel-button { display: none; }
.search-clear {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  color: var(--faint);
}
.search-clear:hover { color: var(--ink); }

/* Chips: choice buttons and radio groups (break length, container, unit) */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chips.is-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chips.is-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0 0.875rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-2);
  text-align: center;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover { background: var(--surface-2); }
.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.chip.is-active,
.chip:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.chip:has(input:focus-visible) {
  outline: 2px solid var(--accent-mid);
  outline-offset: 2px;
}
.chip-check {
  display: none;
}
.chip:has(input:checked) .chip-check { display: block; }

/* 10. Feedback: alerts and toasts ------------------------------------------------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
}
.alert > svg { margin-top: 0.125rem; }
.alert-title { font-weight: 600; }
.alert-error { border-color: var(--danger-line); background: var(--danger-soft); color: #7f1d1d; }
.alert-error > svg { color: var(--danger-solid); }
.alert-warn { border-color: var(--warn-line); background: var(--warn-soft); color: #78350f; }
.alert-warn > svg { color: #d97706; }
.alert-success { border-color: var(--success-line); background: var(--success-soft); color: #064e3b; }
.alert-success > svg { color: #047857; }
.alert-info { border-color: var(--line); background: var(--surface); color: var(--ink-2); }
.alert-info > svg { color: var(--subtle); }

.toasts {
  position: fixed;
  top: calc(var(--safe-top) + var(--topbar-h) + 0.5rem);
  right: 0;
  left: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1rem;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  max-width: 28rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  line-height: 1.5;
  pointer-events: auto;
}
.toast p { flex: 1; }
.toast > svg { margin-top: 0.0625rem; }
.toast .is-success { color: var(--accent-mid); }
.toast .is-info { color: var(--subtle); }
.toast .is-error { color: var(--danger-solid); }
.toast.is-error { border-color: var(--danger-line); background: var(--danger-soft); color: #7f1d1d; }
.toast-close {
  margin: -0.375rem -0.375rem -0.375rem 0;
  padding: 0.375rem;
  border-radius: var(--radius-sm);
  color: var(--faint);
}
.toast-close:hover { color: var(--ink); }
@media (min-width: 1024px) {
  .toasts { top: 1.5rem; right: 1.5rem; left: auto; align-items: flex-end; padding: 0; }
}

/* 11. Inventory ------------------------------------------------------------------- */
.inv-bar {
  position: sticky;
  top: calc(var(--safe-top) + var(--topbar-h));
  z-index: 20;
  margin: 1rem -1rem 0;
  padding: 0.5rem 1rem 0.75rem;
  background: var(--canvas);
}
.cat-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: var(--radius);
  background: rgb(228 228 231 / 0.7);
}
.cat-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0 0.125rem;
  border-radius: var(--radius-md);
  color: var(--muted);
  text-align: center;
  transition: background-color 0.15s, color 0.15s;
}
.cat-tab:hover { color: var(--ink); }
.cat-tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
/* Six tabs must fit a 320px phone without scrolling sideways. */
.cat-tab-name { font-size: clamp(0.6875rem, 3.1vw, 0.8125rem); font-weight: 600; line-height: 1.15; }
.cat-tab-count {
  margin-top: 0.125rem;
  font-size: 0.6875rem;
  line-height: 1.15;
  color: var(--subtle);
  font-variant-numeric: tabular-nums;
}
.cat-tab-count.is-done { font-weight: 600; color: var(--accent); }

.save-status {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
  width: 6rem;
  font-size: 0.75rem;
  font-weight: 500;
}
.save-status span { display: flex; align-items: center; gap: 0.375rem; }
.save-status .is-saving { color: var(--subtle); }
.save-status .is-saved { color: var(--accent); }
.save-status .is-error { color: var(--danger); }
.save-status .is-idle { color: var(--faint); }

.list-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.25rem 0.25rem 0.5rem;
}
.list-heading h2 { font-size: 0.875rem; font-weight: 600; }

.product-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.product {
  scroll-margin-top: 12rem;
  transition: box-shadow 0.4s;
}
.product.is-flash { box-shadow: 0 0 0 2px var(--accent-mid); }
.product-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.625rem 0.625rem 1rem;
}
.product-info {
  flex: 1;
  min-width: 0;
  padding: 0.25rem 0;
  text-align: left;
}
.product-name-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.125rem 0.5rem;
}
.product-name { font-weight: 600; overflow-wrap: anywhere; }
.product-detail { display: block; font-size: 0.875rem; color: var(--muted); }
.product-hint { display: block; margin-top: 0.125rem; font-size: 0.75rem; color: var(--subtle); }
.product-hint b { font-weight: 600; font-variant-numeric: tabular-nums; }
.product-note-icon { color: var(--faint); }
.product-error {
  display: flex;
  align-items: flex-start;
  gap: 0.375rem;
  padding: 0 1rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--danger);
}
.product-error .icon-sm { margin-top: 0.125rem; }
.product-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--line-soft);
  border-radius: 0 0 var(--radius) var(--radius);
  background: rgb(250 250 250 / 0.8);
}
.product-details .actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* Beer: full cases + loose bottles/cans */
.beer-total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 3.5rem;
  padding-right: 0.375rem;
  line-height: 1.2;
}
.beer-total b {
  font-size: 1.25rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.case-counts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.625rem;
  padding: 0 0.625rem 0.75rem 1rem;
}
.case-field { min-width: 0; }
.case-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}
.case-counts .stepper input {
  flex: 1;
  width: auto;
  min-width: 0;
}

.export-actions {
  display: grid;
  gap: 0.5rem;
}
@media (min-width: 640px) {
  .export-actions { display: flex; flex-wrap: wrap; }
}

.stepper {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.stepper:focus-within {
  border-color: var(--accent-mid);
  box-shadow: 0 0 0 4px var(--accent-ring);
}
.stepper.is-error { border-color: #f87171; }
.stepper button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  color: var(--ink-2);
}
.stepper button:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.stepper button:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.stepper button:hover { background: var(--surface-2); }
.stepper button:active { background: var(--surface-3); }
.stepper button:disabled { opacity: 0.35; pointer-events: none; }
.stepper input {
  width: 4rem;
  height: var(--tap);
  padding: 0;
  border: 0;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.stepper input:focus { outline: none; }
.stepper input::placeholder { font-weight: 400; color: var(--faint); }
.stepper input:disabled {
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
  opacity: 1;
}

@media (min-width: 640px) {
  .inv-bar { margin-right: -1.5rem; margin-left: -1.5rem; padding-right: 1.5rem; padding-left: 1.5rem; }
}
@media (min-width: 1024px) {
  .inv-bar { top: 0; padding-top: 1rem; }
}

/* 12. Timecards & tips ------------------------------------------------------------- */
.quick-add {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.day-group + .day-group { margin-top: 1.25rem; }
.day-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0.25rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
}
.entry-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
}
.entry-main { flex: 1; min-width: 0; }
.entry-title { font-weight: 600; }
.entry-meta { margin-top: 0.125rem; font-size: 0.875rem; color: var(--muted); }
.entry-figure {
  font-size: 1.125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.entry-figure small { display: block; font-size: 0.75rem; font-weight: 500; color: var(--subtle); }
a.entry-row:hover { background: var(--surface-2); }
a.entry-row:first-child { border-radius: var(--radius) var(--radius) 0 0; }
a.entry-row:last-child { border-radius: 0 0 var(--radius) var(--radius); }
a.entry-row:only-child { border-radius: var(--radius); }

.total-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
}

.calc-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent-active);
}
.calc-panel .value { font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.calc-panel.is-warn { background: var(--warn-soft); color: #78350f; }

.disclosure {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 3.25rem;
  padding: 0 1rem;
  font-weight: 600;
  text-align: left;
}
.disclosure-chevron { transition: transform 0.2s; }
.disclosure[aria-expanded="true"] .disclosure-chevron { transform: rotate(180deg); }

/* 13. Tables & reports ----------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table {
  width: 100%;
  font-size: 0.875rem;
}
.table th,
.table td {
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}
.table thead th {
  background: var(--surface-2);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--subtle);
  white-space: nowrap;
}
.table thead th:first-child { border-top-left-radius: var(--radius); }
.table thead th:last-child { border-top-right-radius: var(--radius); }
.table tbody tr:last-child > * { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table .group-row th {
  padding-top: 1rem;
  background: var(--surface);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}
.table .is-current td,
.table .is-current th { background: var(--accent-soft); }
.change-up { color: #047857; }
.change-down { color: var(--danger); }

/* 14. Dialog (bottom sheet on phones, centered on larger screens) ------------------ */
.sheet {
  width: 100%;
  max-width: none;
  max-height: 92dvh;
  margin: auto 0 0;
  padding: 0;
  overflow-y: auto;
  border: 0;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
.sheet::backdrop { background: rgb(15 17 20 / 0.55); }
.sheet-body { padding: 1.25rem 1.25rem calc(var(--safe-bottom) + 1.25rem); }
.sheet-title { font-size: 1.125rem; font-weight: 600; }
@media (min-width: 640px) {
  .sheet { max-width: 32rem; margin: auto; border-radius: var(--radius-xl); }
  .sheet-body { padding: 1.5rem; }
}

/* 15. Auth pages ---------------------------------------------------------------- */
.auth {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
.auth-hero {
  padding: calc(var(--safe-top) + 2.5rem) 1rem 6rem;
  background: var(--charcoal);
  text-align: center;
}
.auth-hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 28rem;
  margin: 0 auto;
}
.auth-hero h1 {
  margin-top: 2rem;
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
}
.auth-hero p { margin-top: 0.5rem; font-size: 0.875rem; color: var(--on-dark-muted); }
.auth-body { flex: 1; margin-top: -4rem; padding: 0 1rem 3rem; }
.auth-card { max-width: 28rem; margin: 0 auto; padding: 1.25rem; box-shadow: var(--shadow-lg); }
.auth-footer {
  max-width: 28rem;
  margin: 1.5rem auto 0;
  font-size: 0.875rem;
  color: var(--muted);
  text-align: center;
}
@media (min-width: 640px) {
  .auth-hero h1 { font-size: 1.875rem; line-height: 2.25rem; }
  .auth-card { padding: 1.75rem; }
}

/* Error pages */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 28rem;
  margin: 0 auto;
  padding: 4rem 1rem;
  text-align: center;
}
.error-code { font-size: 0.875rem; font-weight: 600; color: var(--accent); }

/* 16. Teams, tasks, and sign-up ------------------------------------------------- */
.warn-text { color: #b45309; }
.mb-4 { margin-bottom: 1rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.02em; }

/* Nav badges for unread tasks */
.tab-pill { position: relative; }
.nav-badge {
  position: absolute;
  top: -0.125rem;
  right: 0.5rem;
  min-width: 1.125rem;
  height: 1.125rem;
  padding: 0 0.3rem;
  border: 2px solid var(--charcoal);
  border-radius: 999px;
  background: #f59e0b;
  color: #1c1917;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 0.875rem;
  text-align: center;
}
.nav-count {
  min-width: 1.375rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #f59e0b;
  color: #1c1917;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.375rem;
  text-align: center;
}
.sidebar-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1.25rem 0.5rem 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--on-dark-muted);
}
.sidebar .sidebar-bar + .nav { margin-top: 1rem; }
.segmented > button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 2.25rem;
  padding: 0 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
}
.segmented > button[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* Avatars */
.avatar.is-light { flex-shrink: 0; background: var(--accent-soft); color: var(--accent-hover); }
.avatar.is-dashed { flex-shrink: 0; border: 1px dashed var(--border); background: var(--surface); color: var(--subtle); }
.avatar.is-xs { width: 1.375rem; height: 1.375rem; background: rgb(255 255 255 / 0.7); color: inherit; font-size: 0.625rem; }
.avatar.is-sm { width: 2rem; height: 2rem; font-size: 0.75rem; }
.avatar.is-lg { width: 3.25rem; height: 3.25rem; font-size: 1.125rem; }

/* Sign-up choice cards */
.choice-cards { display: grid; gap: 0.5rem; }
.choice-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card:has(input:checked) { border-color: var(--accent-mid); box-shadow: 0 0 0 3px var(--accent-ring); }
.choice-card:has(input:focus-visible) { outline: 2px solid var(--accent-mid); outline-offset: 2px; }
.choice-icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--subtle);
}
.choice-card:has(input:checked) .choice-icon { background: var(--accent-soft); color: var(--accent); }

/* Team list in Settings */
.card-subheader {
  padding: 0.75rem 1rem 0.5rem;
  border-top: 1px solid var(--line-soft);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--subtle);
}
.member-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}
.member-row > .grow { min-width: 10rem; }
.member-actions { display: flex; align-items: center; gap: 0.25rem; margin-left: auto; }
.input.input-sm {
  min-height: 2.25rem;
  padding: 0.25rem 2.25rem 0.25rem 0.75rem;
  background-position: right 0.5rem center;
  font-size: 0.875rem;
}
.onboarding { border-color: rgb(13 148 136 / 0.35); background: var(--accent-soft); }

/* Invite / login result */
.copy-box .input { font-size: 0.875rem; }
.login-details { padding: 1rem; border-radius: var(--radius-md); background: var(--surface-2); }
.login-details dl { display: grid; gap: 0.625rem; margin: 0; }
.login-details dt { font-size: 0.75rem; font-weight: 600; color: var(--subtle); }
.login-details dd { margin: 0.125rem 0 0; font-weight: 600; overflow-wrap: anywhere; }

/* Status pills (task answers) */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.125rem 0.625rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25rem;
  white-space: nowrap;
}
.status-pill.is-todo { background: var(--surface-3); color: var(--ink-2); }
.status-pill.is-on_it { background: #f0f9ff; color: #075985; }
.status-pill.is-done { background: #ecfdf5; color: #065f46; }
.status-pill.is-need_help { background: #fffbeb; color: #92400e; }
.status-pill.is-cant_do { background: var(--danger-soft); color: #991b1b; }

/* Task list */
.task-list { display: flex; flex-direction: column; gap: 0.5rem; }
.task-card { display: block; padding: 0.875rem 1rem; transition: border-color 0.15s; }
.task-card:hover { border-color: var(--border); }
.task-card.is-unread { border-color: rgb(13 148 136 / 0.45); }
.task-title { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.unread-dot {
  display: inline-block;
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.375rem;
  border-radius: 999px;
  background: var(--accent-mid);
  vertical-align: middle;
}
.assignee-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0.625rem 0.125rem 0.125rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.assignee-chip.is-todo { background: var(--surface-3); color: var(--ink-2); }
.assignee-chip.is-on_it { background: #e0f2fe; color: #075985; }
.assignee-chip.is-done { background: #d1fae5; color: #065f46; }
.assignee-chip.is-need_help { background: #fef3c7; color: #92400e; }
.assignee-chip.is-cant_do { background: #fee2e2; color: #991b1b; }

/* New task: people picker */
.people-picker { display: grid; gap: 0.5rem; }
.person-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
}
.person-option input { position: absolute; opacity: 0; pointer-events: none; }
.person-option .check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: transparent;
}
.person-option:has(input:checked) { border-color: var(--accent-mid); background: var(--accent-soft); }
.person-option:has(input:checked) .check { border-color: var(--accent); background: var(--accent); color: #fff; }
.person-option:has(input:focus-visible) { outline: 2px solid var(--accent-mid); outline-offset: 2px; }

/* Task answers: big tap targets */
.answer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.answer-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-weight: 600;
  color: var(--ink-2);
  transition: background-color 0.15s, border-color 0.15s;
}
.answer-btn:hover { background: var(--surface-2); }
.answer-btn.is-on_it .icon { color: #0369a1; }
.answer-btn.is-done .icon { color: #047857; }
.answer-btn.is-need_help .icon { color: #d97706; }
.answer-btn.is-cant_do .icon { color: var(--danger-solid); }
.answer-btn.is-current.is-on_it { border-color: #0369a1; background: #f0f9ff; }
.answer-btn.is-current.is-done { border-color: #047857; background: #ecfdf5; }
.answer-btn.is-current.is-need_help { border-color: #d97706; background: #fffbeb; }
.answer-btn.is-current.is-cant_do { border-color: var(--danger-solid); background: var(--danger-soft); }

/* Response thread */
.task-details { white-space: pre-wrap; overflow-wrap: anywhere; }
.thread { display: flex; flex-direction: column; gap: 0.75rem; }
.thread-item { display: flex; align-items: flex-start; gap: 0.625rem; }
.thread-bubble {
  flex: 1;
  min-width: 0;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--line);
  border-radius: 0.25rem var(--radius) var(--radius) var(--radius);
  background: var(--surface);
}
.thread-item.is-mine .thread-bubble { border-color: rgb(13 148 136 / 0.25); background: var(--accent-soft); }
.thread-meta { display: flex; align-items: baseline; gap: 0.5rem; font-size: 0.8125rem; }
.thread-body { margin-top: 0.25rem; white-space: pre-wrap; overflow-wrap: anywhere; }

.bulk-names { min-height: 9rem; line-height: 1.6; }

@media (min-width: 640px) {
  .people-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .answer-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* 17. Ordering (Inventory › Order) ------------------------------------------------ */
.seg-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.375rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.chip.is-sm { min-height: 2rem; gap: 0.25rem; padding: 0 0.75rem; font-size: 0.8125rem; }
.list-heading .chip { flex-shrink: 0; }
.order-field {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}
.order-field .case-label { margin-bottom: 0.25rem; }
.stepper.is-order { border-color: rgb(13 148 136 / 0.45); background: var(--accent-soft); }
.stepper.is-order input { color: var(--accent-hover); }
.product-name-line .badge .icon-xs { margin-right: 0.125rem; }

/* 18. Drinks: recipe search, recipe page, menu builder ------------------------- */
.block { display: block; }

/* Search bar stays put while scrolling the list */
.drink-search-bar {
  position: sticky;
  top: calc(var(--safe-top) + var(--topbar-h));
  z-index: 20;
  margin: 0 -1rem;
  padding: 0.5rem 1rem 0.625rem;
  background: var(--canvas);
}
.input.is-lg { min-height: 3.25rem; font-size: 1.0625rem; }
.filter-chips {
  display: flex;
  gap: 0.375rem;
  margin: 0.625rem -1rem 0;
  padding: 0 1rem 0.125rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chips .chip { flex-shrink: 0; white-space: nowrap; }
.chip-count { margin-left: 0.25rem; font-variant-numeric: tabular-nums; opacity: 0.75; }

/* Recipe list */
.drink-list { overflow: hidden; }
.drink-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 4.25rem;
  padding: 0.75rem 1rem;
  transition: background-color 0.15s;
}
.drink-row:hover { background: var(--surface-2); }
.drink-main { flex: 1; min-width: 0; }
.drink-name-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.125rem 0.5rem; }
.drink-name { font-size: 1.0625rem; font-weight: 600; }
.drink-summary {
  display: block;
  margin-top: 0.125rem;
  overflow: hidden;
  font-size: 0.875rem;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drink-meta { display: block; margin-top: 0.125rem; font-size: 0.75rem; color: var(--subtle); }

/* Recipe page: made to read at arm's length behind the bar */
.recipe-title { font-size: 1.875rem; line-height: 2.25rem; }
.recipe-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}
.recipe-facts > div { padding: 0.875rem 1rem; }
.recipe-facts > div:nth-child(odd) { border-right: 1px solid var(--line-soft); }
.recipe-facts > div:nth-child(n + 3) { border-top: 1px solid var(--line-soft); }
.recipe-facts dt {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--subtle);
}
.recipe-facts dd { margin: 0.25rem 0 0; font-weight: 600; overflow-wrap: anywhere; }
.ingredient-list { display: flex; flex-direction: column; }
.ingredient-list li {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.625rem 0;
  border-top: 1px solid var(--line-soft);
  font-size: 1.125rem;
}
.ingredient-list li:first-child { border-top: 0; padding-top: 0; }
.ingredient-amount {
  font-weight: 700;
  color: var(--accent-hover);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.ingredient-name { font-weight: 500; overflow-wrap: anywhere; }
.step-list { display: flex; flex-direction: column; gap: 0.875rem; counter-reset: step; }
.step-list li {
  position: relative;
  padding-left: 2.5rem;
  font-size: 1.0625rem;
  line-height: 1.6rem;
  counter-increment: step;
}
.step-list li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-size: 0.875rem;
  font-weight: 700;
}
.recipe-blurb {
  padding: 1rem 1.125rem;
  border-left: 3px solid var(--accent-mid);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-style: italic;
  color: var(--ink-2);
}
.recipe-blurb .eyebrow { font-style: normal; }
.add-to-menu { display: grid; gap: 0.75rem; }
.recipe-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.ingredients-input { min-height: 9.5rem; line-height: 1.6; }
.form-grid { display: grid; gap: 1rem; }

/* Menu builder */
.menu-share { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.menu-qr {
  width: 168px;
  height: 168px;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}
.menu-share .copy-box { width: 100%; }
.share-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.menu-share-foot { padding-top: 0.75rem; border-top: 1px solid var(--line-soft); }

.menu-details > summary,
.menu-entry > summary,
.section-tools > summary { list-style: none; cursor: pointer; }
.menu-details > summary::-webkit-details-marker,
.menu-entry > summary::-webkit-details-marker,
.section-tools > summary::-webkit-details-marker { display: none; }
.menu-details > summary { display: flex; align-items: center; gap: 0.75rem; }
.menu-details[open] > summary .btn { visibility: hidden; }
.menu-details-form { border-top: 1px solid var(--line-soft); }
.check-row { display: flex; align-items: flex-start; gap: 0.75rem; cursor: pointer; }
.check-row input {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.125rem;
  accent-color: var(--accent);
}
.check-row .hint { margin-top: 0.125rem; }

.menu-section { scroll-margin-top: 5rem; }
.menu-section-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.75rem 0.75rem 1rem;
  border-bottom: 1px solid var(--line-soft);
}
.icon-btn.is-sm { width: 2.25rem; height: 2.25rem; border-radius: var(--radius-sm); }
.menu-entries > li { scroll-margin-top: 5rem; }
.menu-entry > summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
}
.menu-entry > summary:hover { background: var(--surface-2); }
.menu-entry-name { display: block; font-weight: 600; }
.menu-entry-desc {
  display: -webkit-box;
  margin-top: 0.125rem;
  overflow: hidden;
  font-size: 0.875rem;
  color: var(--muted);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.menu-entry-price { flex-shrink: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.menu-entry-price.is-missing { font-size: 0.8125rem; font-weight: 500; color: var(--faint); }
.menu-entry-chevron { flex-shrink: 0; transition: transform 0.15s; }
.menu-entry[open] .menu-entry-chevron { transform: rotate(180deg); }
.menu-entry[open] > summary { background: var(--surface-2); }
.menu-entry-form { padding: 0.25rem 1rem 1rem; background: var(--surface-2); }
.menu-entry-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; }
.menu-entry-actions .btn-danger-ghost { margin-left: auto; }
.menu-section-empty { padding: 1rem; }
.menu-section-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--line-soft);
}
.section-tools { flex: 1; min-width: 12rem; }
.section-tools > summary { display: inline-flex; }
.section-tools-body { margin-top: 0.5rem; }

/* Menu picker: add drinks to a section */
.pick-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.75rem 1rem;
}
.pick-info { min-width: 12rem; }
.pick-info:hover .drink-name { color: var(--accent-hover); }
.pick-form { display: flex; flex-shrink: 0; align-items: center; gap: 0.5rem; margin-left: auto; }
.input-money.is-compact { width: 6.5rem; }
.input-money.is-compact .input { min-height: 2.25rem; padding-top: 0.25rem; padding-bottom: 0.25rem; border-radius: var(--radius-sm); }
.pick-added { margin-left: auto; }

/* Dashboard: "How do I make..." */
.drink-lookup .section-title { display: flex; align-items: center; gap: 0.5rem; }
.drink-lookup .search { flex: 1; min-width: 0; }

@media (min-width: 640px) {
  .drink-search-bar { margin-right: -1.5rem; margin-left: -1.5rem; padding-right: 1.5rem; padding-left: 1.5rem; }
  .filter-chips { flex-wrap: wrap; margin-right: 0; margin-left: 0; padding: 0; overflow: visible; }
  .recipe-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .recipe-facts > div { border-right: 1px solid var(--line-soft); }
  .recipe-facts > div:last-child { border-right: 0; }
  .recipe-facts > div:nth-child(n + 3) { border-top: 0; }
  .ingredient-list li { grid-template-columns: 7rem minmax(0, 1fr); }
  .add-to-menu { grid-template-columns: minmax(0, 1fr) 9rem auto; align-items: end; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .menu-share { flex-direction: row; align-items: flex-start; }
}
@media (min-width: 1024px) {
  .drink-search-bar { top: 0; padding-top: 1rem; }
}

/* --- Privacy and support pages ------------------------------------------------ */
.logo-link { display: inline-flex; text-decoration: none; color: inherit; }
.legal { max-width: 42rem; line-height: 1.65; }
.legal h2 { font-size: 1.125rem; font-weight: 650; margin: 2rem 0 0.5rem; }
.legal h3 { font-size: 1rem; font-weight: 600; margin: 1.25rem 0 0.25rem; }
.legal p, .legal li { color: var(--muted); }
.legal p + p { margin-top: 0.75rem; }
.legal ul { padding-left: 1.25rem; list-style: disc; display: grid; gap: 0.5rem; }
.legal strong { color: inherit; font-weight: 600; }
