:root {
  --bg: #1a2332;
  --bg-accent: #243447;
  --surface: #f4f0e8;
  --border: #d4cbb8;
  --text: #1a2332;
  --muted: #6b7280;
  --accent: #2f6f4e;
  --accent-soft: #d8ebe0;
  --danger: #b42318;
  --header: #102033;
  --header-text: #f4f0e8;
}

* { box-sizing: border-box; }

html:has(.shelter-shell) {
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 18%, #2c4a3a 0%, transparent 42%),
    radial-gradient(circle at 88% 12%, #3a4f6b 0%, transparent 40%),
    linear-gradient(160deg, var(--bg), #0f1724 70%);
  color: var(--text);
  font: 16px/1.5 "IBM Plex Sans", "Segoe UI", sans-serif;
}

#app {
  min-height: 100vh;
}

.login-layout {
  min-height: 100vh;
}

.login-layout.auth-standalone,
body:has(.auth-standalone) {
  background:
    radial-gradient(120% 80% at 10% -10%, var(--color-primary-50, #eff6ff) 0%, transparent 55%),
    radial-gradient(90% 60% at 100% 0%, var(--color-surface-selected, #eff6ff) 0%, transparent 50%),
    var(--color-page-bg, #f4f7fa);
  color: var(--color-text-primary, #172033);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.875rem;
  line-height: 1.42;
  -webkit-font-smoothing: antialiased;
}

/* --- Auth (design/assets/auth.css) --- */

.auth {
  display: grid;
  place-items: center;
  min-block-size: 100vh;
  padding: 1.5rem 1rem;
}

.auth__panel {
  display: grid;
  gap: 1.25rem;
  inline-size: min(100%, 24rem);
}

.auth__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.auth__brand-mark {
  display: grid;
  place-items: center;
  inline-size: 2.5rem;
  block-size: 2.5rem;
  border-radius: 0.5rem;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: -0.02em;
}

.auth__brand-text {
  display: grid;
  gap: 0.125rem;
}

.auth__product {
  color: #172033;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.auth__module {
  color: #506486;
  font-size: 0.8125rem;
  line-height: 1.3;
}

.auth__card {
  display: grid;
  gap: 1.25rem;
  padding: 1.5rem;
  border: 0.0625rem solid #d7dfea;
  border-radius: 0.625rem;
  background: #fff;
  box-shadow: 0 0.25rem 0.75rem #17203314;
}

.auth__header {
  display: grid;
  gap: 0.5rem;
}

.auth__title {
  margin: 0;
  color: #172033;
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.auth__subtitle {
  margin: 0;
  color: #506486;
  font-size: 0.875rem;
  line-height: 1.45;
}

.auth__form {
  display: grid;
  gap: 1rem;
}

.auth-field {
  display: grid;
  gap: 0.25rem;
  min-inline-size: 0;
}

.auth-field__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.auth-field__label {
  color: #506486;
  font-size: 0.8125rem;
  font-weight: 500;
}

.auth-field__hint {
  margin: 0;
  color: #7e8ea9;
  font-size: 0.75rem;
  line-height: 1.4;
}

.auth-field__error {
  margin: 0;
  min-height: 1.1em;
  color: #dc2626;
  font-size: 0.75rem;
  line-height: 1.4;
}

.auth-input {
  box-sizing: border-box;
  inline-size: 100%;
  min-block-size: 2.5rem;
  padding: 0 0.75rem;
  border: 0.0625rem solid #c8ced8;
  border-radius: 0.375rem;
  background: #fff;
  color: #172033;
  font: inherit;
  line-height: 1.25;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.auth-input::placeholder {
  color: #92a4c3;
}

.auth-input:hover {
  border-color: #3b82f6;
}

.auth-input:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 0.1875rem #93c5fd73;
}

.auth-input[readonly] {
  background: #f3f5f8;
  color: #506486;
}

.auth-input--code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.35em;
  text-align: center;
  padding-inline: 1rem;
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-block-size: 2.5rem;
  padding: 0 0.75rem;
  border: 0.0625rem solid transparent;
  border-radius: 0.375rem;
  background: none;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}

.auth-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.auth-btn--primary {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.auth-btn--primary:hover:not(:disabled) {
  border-color: #1d4ed8;
  background: #1d4ed8;
}

.auth-btn--secondary {
  border-color: #c8ced8;
  background: #fff;
  color: #172033;
}

.auth-btn--secondary:hover:not(:disabled) {
  border-color: #bfdbfe;
  background: #f3f5f8;
}

.auth-btn--ghost {
  color: #2563eb;
}

.auth-btn--ghost:hover:not(:disabled) {
  background: #eff6ff;
}

.auth-btn--sm {
  min-block-size: 1.75rem;
  padding: 0 0.5rem;
  font-size: 0.8125rem;
}

.auth-btn--full {
  inline-size: 100%;
}

.auth-notice {
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem;
  border: 0.0625rem solid #bfdbfe;
  border-radius: 0.5rem;
  background: #eff6ff;
}

.auth-notice--warning {
  border-color: #f9cf6c;
  background: #fff9eb;
}

.auth-notice__title {
  color: #172033;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
}

.auth-notice__message {
  margin: 0;
  color: #506486;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.auth-demo {
  display: grid;
  gap: 0.5rem;
  padding-block-start: 0.25rem;
}

.auth-demo__label {
  margin: 0;
  color: #7e8ea9;
  font-size: 0.75rem;
}

.auth-demo__list {
  display: grid;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-demo__item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
  inline-size: 100%;
  padding: 0.5rem 0.75rem;
  border: 0.0625rem solid #d7dfea;
  border-radius: 0.375rem;
  background: #f3f5f8;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: border-color 0.12s, background-color 0.12s;
}

.auth-demo__item:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.auth-demo__email {
  color: #172033;
  font-size: 0.8125rem;
  font-weight: 500;
}

.auth-demo__meta {
  color: #7e8ea9;
  font-size: 0.75rem;
}

.auth-resend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  color: #7e8ea9;
  font-size: 0.8125rem;
}

.auth-roles {
  display: grid;
  gap: 0.5rem;
}

.auth-role {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.75rem;
  border: 0.0625rem solid #d7dfea;
  border-radius: 0.5rem;
  background: #fff;
  cursor: pointer;
}

.auth-role:has(input:checked) {
  border-color: #3b82f6;
  background: #eff6ff;
}

.auth-role input {
  margin-block-start: 0.2rem;
  accent-color: #2563eb;
}

.auth-role__title {
  color: #172033;
  font-size: 0.875rem;
  font-weight: 600;
}

.auth-role__hint {
  margin: 0.125rem 0 0;
  color: #7e8ea9;
  font-size: 0.75rem;
  line-height: 1.4;
}

.auth-actions {
  display: grid;
  gap: 0.5rem;
}

.auth-note {
  margin: 0;
  color: #7e8ea9;
  font-size: 0.75rem;
  line-height: 1.45;
}

@media (max-width: 30rem) {
  .auth {
    padding: 1rem 0.75rem;
    align-items: start;
  }

  .auth__card {
    padding: 1.25rem 1rem;
    box-shadow: 0 0.0625rem 0.125rem #1720330f;
  }

  .auth__title {
    font-size: 1.125rem;
  }

  .auth-input--code {
    font-size: 1.125rem;
    letter-spacing: 0.28em;
  }

  .auth-demo__item {
    grid-template-columns: 1fr;
    gap: 0.125rem;
  }
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-shell__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: var(--header);
  color: var(--header-text);
}

.app-shell__brand {
  font-family: "IBM Plex Serif", Georgia, serif;
  font-size: 22px;
  font-weight: 700;
}

.app-shell__user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-shell__staff {
  font-size: 14px;
}

.app-shell__logout {
  border: 1px solid rgba(244, 240, 232, 0.35);
  background: transparent;
  color: var(--header-text);
  padding: 6px 12px;
  font: inherit;
  cursor: pointer;
}

.app-shell__logout:hover {
  background: rgba(244, 240, 232, 0.08);
}

.app-shell__main {
  flex: 1;
  padding: 24px;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.page__title {
  margin: 0 0 8px;
  font-family: "IBM Plex Serif", Georgia, serif;
  font-size: 28px;
}

.page__lead {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 640px) {
  .app-shell__header { flex-wrap: wrap; }
}

/* --- GraviPets warehouse (design/assets tokens + stock density) --- */

.shelter-shell {
  min-height: 100vh;
  background: #f4f7fa;
  color: #172033;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.875rem;
  line-height: 1.42;
}

.shelter-shell {
  --color-page-bg: #eef2f7;
  --color-surface: #ffffff;
  --color-surface-muted: #e8edf4;
  --color-text-primary: #0f172a;
  --color-text-secondary: #334155;
  --color-text-tertiary: #475569;
  --color-text-placeholder: #64748b;
  --color-border: #b6c2d4;
  --color-border-strong: #8fa0b8;
  --color-primary-50: #dbeafe;
  --color-primary-200: #93c5fd;
  --color-primary-500: #2563eb;
  --color-primary-600: #1d4ed8;
  --color-primary-700: #1e3a8a;
  --color-danger-50: #fee2e2;
  --color-danger-100: #fecaca;
  --color-danger-500: #dc2626;
  --color-danger-600: #b91c1c;
  --color-danger-700: #991b1b;
  --color-warning-50: #fef3c7;
  --color-warning-300: #f59e0b;
  --color-warning-500: #d97706;
  --color-warning-700: #92400e;
  --focus-ring: 0 0 0 0.1875rem #93c5fd73;
  --radius-sm: 0.375rem;
  --radius-lg: 0.625rem;
  --shadow-sm: 0 0.0625rem 0.125rem #1720330f;
  --shadow-md: 0 0.25rem 0.75rem #17203314;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --control-height-filter: 2.25rem;
  --control-height-form: 2.5rem;
  --control-height-action: 2.5rem;
  --page-max-width: 82.5rem;
  --page-padding-x: 1.5rem;
  --header-height: 3.5rem;
}

.shelter-shell .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-block-size: var(--control-height-action);
  padding: 0 var(--space-3);
  border: 0.0625rem solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.shelter-shell .button--primary {
  border-color: var(--color-primary-600);
  background: var(--color-primary-600);
  color: #fff;
}
.shelter-shell .button--secondary {
  border-color: var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text-primary);
}
.shelter-shell .button--ghost { color: var(--color-primary-600); }
.shelter-shell .button--quiet { color: var(--color-text-secondary); }
.shelter-shell .button--sm { min-block-size: 1.75rem; padding: 0 var(--space-2); font-size: 0.8125rem; }

.shelter-shell .control {
  box-sizing: border-box;
  inline-size: 100%;
  min-block-size: var(--control-height-form);
  padding: 0 var(--space-3);
  border: 0.0625rem solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: inherit;
  font: inherit;
}
.shelter-shell .control--filter { min-block-size: var(--control-height-filter); }
.shelter-shell .control--sm { min-block-size: var(--control-height-filter); inline-size: auto; }
.shelter-shell .control--qty {
  inline-size: 3.5rem;
  min-block-size: var(--control-height-filter);
  padding: 0 var(--space-2);
  text-align: end;
  font-variant-numeric: tabular-nums;
}
.shelter-shell .control--qty.is-filled { border-color: var(--color-primary-600); font-weight: 600; }

.shelter-shell .app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-block-end: 0.0625rem solid var(--color-border);
  background: var(--color-surface);
}
.shelter-shell .app-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  max-inline-size: var(--page-max-width);
  min-block-size: var(--header-height);
  margin: 0 auto;
  padding: 0 var(--page-padding-x);
}
.shelter-shell .app-brand {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}
.shelter-shell .app-brand__name { font-size: 0.9375rem; font-weight: 700; }
.shelter-shell .app-brand__module { color: var(--color-text-tertiary); font-size: 0.8125rem; }
.shelter-shell .app-nav { display: flex; gap: var(--space-4); }
.shelter-shell .app-nav__item {
  position: relative;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}
.shelter-shell .app-nav__item[aria-current="page"]::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -1.0625rem;
  block-size: 0.125rem;
  border-radius: 0.0625rem 0.0625rem 0 0;
  background: var(--color-primary-600);
}
.shelter-shell .app-header__spacer { flex: 1; }
.shelter-shell .app-header__user { color: var(--color-text-tertiary); font-size: 0.8125rem; }

.shelter-shell .page {
  max-inline-size: var(--page-max-width);
  margin: 0 auto;
  padding: var(--space-5) var(--page-padding-x) var(--space-8);
  display: grid;
  gap: var(--space-4);
  background: transparent;
  border: 0;
}
.shelter-shell .page--with-cartbar { padding-block-end: 6rem; }
.shelter-shell .page-header { display: flex; align-items: flex-end; gap: var(--space-4); }
.shelter-shell .page-header__title { margin: 0; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.015em; }
.shelter-shell .page-header__description { margin: 0; color: var(--color-text-secondary); }
.shelter-shell .page-header__actions { display: flex; gap: var(--space-2); margin-inline-start: auto; }

.shelter-shell .surface {
  border: 0.0625rem solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}
.shelter-shell .filters { padding: var(--space-3); display: grid; gap: var(--space-3); }
.shelter-shell .filters--compact { padding: var(--space-2) var(--space-3); }
.shelter-shell .filters--embedded {
  padding: var(--space-3);
  border: 0;
  background: transparent;
}
.shelter-shell .filters__row { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.shelter-shell .filters__search { margin-inline-start: auto; inline-size: min(18rem, 45%); }
.shelter-shell .filters__search--grow {
  margin-inline-start: 0;
  inline-size: 100%;
}

.shelter-shell .segmented {
  display: inline-flex;
  padding: 0.125rem;
  border: 0.0625rem solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-muted);
  gap: 0.125rem;
}
.shelter-shell .segmented__item {
  min-block-size: 1.875rem;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: 0.25rem;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
}
.shelter-shell .segmented__item.is-active {
  background: var(--color-surface);
  color: var(--color-text-primary);
  box-shadow: var(--shadow-sm);
}

.shelter-shell .facets { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.shelter-shell .facet {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-block-size: var(--control-height-filter);
  padding: 0 var(--space-2) 0 var(--space-3);
  border: 0.0625rem solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
}
.shelter-shell .facet.is-active {
  border-color: var(--color-primary-200);
  background: var(--color-primary-50);
  color: var(--color-primary-700);
}
.shelter-shell .facet__count {
  min-inline-size: 1.25rem;
  padding: 0.0625rem 0.375rem;
  border-radius: 999px;
  background: var(--color-surface-muted);
  color: var(--color-text-tertiary);
  font-size: 0.75rem;
  text-align: center;
}
.shelter-shell .facet--danger .facet__count { background: var(--color-danger-50); color: var(--color-danger-700); }
.shelter-shell .facet--warning .facet__count { background: var(--color-warning-50); color: var(--color-warning-700); }
.shelter-shell .facets__reset { margin-inline-start: auto; }

.shelter-shell .table-wrap { overflow-x: auto; border-radius: var(--radius-lg); }
.shelter-shell .table { inline-size: 100%; border-collapse: collapse; }
.shelter-shell .table thead th {
  padding: var(--space-2) var(--space-3);
  border-block-end: 0.0625rem solid var(--color-border);
  background: var(--color-surface-muted);
  color: var(--color-text-tertiary);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-align: start;
  text-transform: uppercase;
}
.shelter-shell .table td {
  padding: var(--space-2) var(--space-3);
  border-block-end: 0.0625rem solid var(--color-border);
  vertical-align: middle;
}
.shelter-shell .table .is-numeric { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.shelter-shell .table .is-actions { inline-size: 1%; white-space: nowrap; text-align: end; }

.shelter-shell .row:hover { background: var(--color-surface-muted); }
.shelter-shell .row--expired, .shelter-shell .row--low {
  background: #fef2f2;
  box-shadow: inset 0.1875rem 0 0 var(--color-danger-600);
}
.shelter-shell .row--expiring {
  background: #fffbeb;
  box-shadow: inset 0.1875rem 0 0 var(--color-warning-500);
}
.shelter-shell .row__name { display: grid; gap: 0.0625rem; }
.shelter-shell .row__title { font-weight: 600; }
.shelter-shell .row__meta { color: var(--color-text-tertiary); font-size: 0.75rem; }
.shelter-shell .row__link {
  padding: 0; border: 0; background: none; color: inherit; font: inherit;
  text-align: start; cursor: pointer;
}
.shelter-shell .stock { font-weight: 600; }
.shelter-shell .limit { color: var(--color-text-tertiary); }

.shelter-shell .badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  min-block-size: 1.375rem;
  padding: 0.0625rem 0.4375rem;
  border: 0.0625rem solid transparent;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.shelter-shell .badge__dot {
  inline-size: 0.375rem;
  block-size: 0.375rem;
  border-radius: 50%;
  background: currentColor;
}
.shelter-shell .badge--danger { border-color: var(--color-danger-100); background: var(--color-danger-50); color: var(--color-danger-700); }
.shelter-shell .badge--warning { border-color: var(--color-warning-300); background: var(--color-warning-50); color: var(--color-warning-700); }
.shelter-shell .badge--quiet { color: var(--color-text-tertiary); font-weight: 400; }
.shelter-shell .badge--quiet .badge__dot { display: none; }
.shelter-shell .badge--cancelled { border-color: var(--color-border); background: var(--color-surface-muted); color: var(--color-text-tertiary); }

.shelter-shell .empty {
  display: grid;
  gap: 0.25rem;
  padding: var(--space-8) var(--space-4);
  text-align: center;
}
.shelter-shell .empty__title { margin: 0; font-size: 1rem; font-weight: 600; }
.shelter-shell .empty__text { margin: 0; color: var(--color-text-secondary); }

.shelter-shell .cartbar-stack {
  position: fixed;
  inset-block-end: 0;
  inset-inline: 0;
  z-index: 30;
  display: grid;
  justify-items: center;
  pointer-events: none;
}
.shelter-shell .cartbar-stack .cartbar,
.shelter-shell .cartbar-stack .cart-toast {
  pointer-events: auto;
}
.shelter-shell .cart-toast {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  max-inline-size: min(28rem, calc(100% - 2rem));
  margin: 0 1rem 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 0.0625rem solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  line-height: 1.35;
}
.shelter-shell .cart-toast__title {
  color: var(--color-text-primary);
  font-weight: 600;
}
.shelter-shell .cart-toast__text {
  color: var(--color-text-secondary);
}
.shelter-shell .cartbar {
  inset-inline: 0;
  inline-size: 100%;
  border-block-start: 0.125rem solid var(--color-border-strong);
  background: #ffffff;
  box-shadow: 0 -0.25rem 1.25rem #0f172a33;
}
.shelter-shell .cartbar__noun {
  color: var(--color-text-secondary);
  font-weight: 700;
}
.shelter-shell .cartbar__inner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  max-inline-size: var(--page-max-width);
  min-block-size: 3.5rem;
  margin: 0 auto;
  padding: var(--space-2) var(--page-padding-x);
}
.shelter-shell .cartbar__summary {
  display: grid; gap: 0.0625rem; padding: 0; border: 0; background: none;
  color: inherit; font: inherit; text-align: start; cursor: pointer;
}
.shelter-shell .cartbar__noun { font-size: 0.75rem; color: var(--color-text-tertiary); text-transform: uppercase; }
.shelter-shell .cartbar__count { font-weight: 600; text-decoration: underline; }
.shelter-shell .cartbar__spacer { flex: 1; }
.shelter-shell .cartbar__reason { display: inline-flex; align-items: center; gap: var(--space-2); }
.shelter-shell .cartbar__label { color: var(--color-text-tertiary); font-size: 0.8125rem; }
.shelter-shell .cartbar--hidden { display: none; }

/* Authenticated application: literal GraviPets/design token and layout transfer. */
.shelter-shell {
  --color-surface-selected: #eff6ff;
  --color-success-50: #effbf5;
  --color-success-700: #076e4f;
  --radius-md: 0.5rem;
  --shadow-lg: 0 0.75rem 2rem #17203324;
  min-height: 100vh;
}
.shelter-shell *, .shelter-shell *::before, .shelter-shell *::after { box-sizing: border-box; }
.shelter-shell button,
.shelter-shell input,
.shelter-shell select,
.shelter-shell textarea { font: inherit; color: inherit; }
.shelter-shell a.button { text-decoration: none; }
.shelter-shell :focus-visible { outline: none; box-shadow: var(--focus-ring); }

.shelter-shell .app-header__row {
  display: flex;
  align-items: center;
  max-inline-size: var(--page-max-width);
  margin: 0 auto;
  padding-inline: var(--page-padding-x);
}
.shelter-shell .app-header__row--top {
  min-block-size: var(--header-height);
  gap: var(--space-3);
}
.shelter-shell .app-header__row--nav {
  position: relative;
  min-block-size: 2.75rem;
  overflow: hidden;
}
.shelter-shell .app-header__row--nav::after {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  inline-size: 1.5rem;
  pointer-events: none;
  background: linear-gradient(to right, transparent, var(--color-surface));
}
.shelter-shell .app-nav {
  inline-size: 100%;
  margin: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  white-space: nowrap;
}
.shelter-shell .app-nav__item {
  display: inline-flex;
  align-items: center;
  min-block-size: 2.75rem;
  flex: 0 0 auto;
  padding: 0 0 0.0625rem;
  border: 0;
  background: none;
  cursor: pointer;
}
.shelter-shell .app-nav__item[aria-current="page"] {
  color: var(--color-text-primary);
  font-weight: 600;
}
.shelter-shell .app-nav__item[aria-current="page"]::after { bottom: 0; }
.shelter-shell .app-header__role { color: var(--color-text-tertiary); }

.shelter-shell .filters-meta {
  margin: 0;
  color: var(--color-text-tertiary);
  font-size: 0.8125rem;
}
.shelter-shell .filters-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding-block-start: var(--space-2);
  border-block-start: 0.0625rem solid var(--color-border);
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}
.shelter-shell .filters-notice__text {
  margin-inline-end: auto;
}

.shelter-shell .segmented__item[aria-pressed="true"] {
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.shelter-shell a.segmented__item {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.shelter-shell .facets {
  gap: var(--space-1);
  padding-block-start: var(--space-3);
  border-block-start: 0.0625rem solid var(--color-border);
}
.shelter-shell .facet {
  padding: 0 var(--space-3);
  border-color: transparent;
  border-radius: var(--radius-sm);
  background: none;
  font-size: 0.875rem;
}
.shelter-shell .facet.is-active {
  border-color: var(--color-border);
  background: var(--color-surface-muted);
  color: var(--color-text-primary);
}
.shelter-shell .facet__count { font-weight: 600; }

.shelter-shell .table thead th {
  padding: 0;
  white-space: nowrap;
}
/* Plain <th> text (cart / history) needs its own padding — stock catalogue
   puts padding on .th-sort / .th-label inside; without it adjacent headers
   visually merge («КОЛИЧЕСТВОСРОК ГОДНОСТИ»). */
.shelter-shell .table thead th:not(:has(.th-sort, .th-label, button)) {
  padding: var(--space-2) var(--space-3);
}
.shelter-shell .table thead th.is-actions { padding: var(--space-2) var(--space-3); }
.shelter-shell .th-label {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
}
.shelter-shell .cart-table tr.cart-line--batch-needed td {
  background: var(--color-warning-50);
}
.shelter-shell .journal-card--batch-needed {
  box-shadow: inset 0.125rem 0 0 var(--color-warning-300);
}
.shelter-shell .notice__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-block-start: var(--space-2);
}
.shelter-shell .row__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.shelter-shell .row__link { text-decoration: none; }
.shelter-shell .row__link:hover { text-decoration: underline; }
.shelter-shell .row--expired,
.shelter-shell .row--low {
  background: #fef2f2;
  box-shadow: inset 0.1875rem 0 0 var(--color-danger-600);
}
.shelter-shell .row--expiring {
  background: #fffbeb;
  box-shadow: inset 0.1875rem 0 0 var(--color-warning-500);
}
.shelter-shell .row--expired:hover,
.shelter-shell .row--low:hover { background: var(--color-danger-50); }
.shelter-shell .row--expiring:hover { background: var(--color-warning-50); }
.shelter-shell .stock--alarm { color: var(--color-danger-700); }
.shelter-shell .badge--neutral {
  border-color: var(--color-border);
  background: var(--color-surface-muted);
  color: var(--color-text-secondary);
}

.shelter-shell .table tbody tr:last-child td { border-block-end: 0; }
.shelter-shell .table thead th.is-sorted { color: var(--color-text-secondary); }
.shelter-shell .th-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  inline-size: 100%;
  padding: var(--space-2) var(--space-3);
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}
.shelter-shell .is-numeric .th-sort { justify-content: flex-end; }
.shelter-shell .is-numeric .th-label { justify-content: flex-end; inline-size: 100%; }
.shelter-shell .th-sort__arrow { font-size: 0.6875rem; }
.shelter-shell .catalogue-table--read .is-actions { display: none; }

.shelter-shell .row { cursor: default; }
.shelter-shell .row--open { background: var(--color-surface-muted); }
.shelter-shell .row--group { cursor: default; background: var(--color-surface-muted); }
.shelter-shell .row--group:hover { background: var(--color-surface-muted); }
.shelter-shell .row--group .row__title { font-size: 0.9375rem; }
.shelter-shell .row--member > td:first-child { padding-inline-start: var(--space-6); }
.shelter-shell .row--member .row__title { font-weight: 500; }
.shelter-shell .row__meta { padding-inline-start: 1rem; }
.shelter-shell .row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-block-start: 0.25rem;
  padding-inline-start: 1rem;
}
.shelter-shell .row__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-text-tertiary);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}
.shelter-shell .row__toggle:hover {
  color: var(--color-text-secondary);
  text-decoration: underline;
}
.shelter-shell .button.row__toggle {
  color: var(--color-text-tertiary);
  font-weight: 500;
  text-decoration: none;
}
.shelter-shell .button.row__toggle:hover {
  color: var(--color-text-secondary);
  text-decoration: underline;
}
.shelter-shell .cartbar__error {
  flex: 1 1 12rem;
  color: var(--color-danger, #b42318);
  font-size: 0.8125rem;
  line-height: 1.3;
}
.shelter-shell .cartbar__error--hidden { display: none; }
.shelter-shell .batch__fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}
.shelter-shell .batch__field {
  display: grid;
  gap: 0.125rem;
  min-inline-size: 6rem;
  color: var(--color-text-primary);
  font-size: 0.8125rem;
}
.shelter-shell .batch__field-label {
  color: var(--color-text-tertiary);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.shelter-shell .catalogue-skeleton {
  display: grid;
  gap: 0.75rem;
  padding: var(--space-4);
}
.shelter-shell .catalogue-skeleton__row {
  block-size: 2.75rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--color-surface-muted) 25%, #dfe6f0 50%, var(--color-surface-muted) 75%);
  background-size: 200% 100%;
}
.shelter-shell .overflow-menu { position: relative; display: inline-block; }
.shelter-shell .overflow-menu > summary {
  list-style: none;
  cursor: pointer;
}
.shelter-shell .overflow-menu > summary::-webkit-details-marker { display: none; }
.shelter-shell .overflow-menu__panel {
  position: absolute;
  inset-block-start: calc(100% + 0.25rem);
  inset-inline-end: 0;
  z-index: 20;
  display: grid;
  gap: 0.25rem;
  min-inline-size: 11rem;
  padding: 0.5rem;
  border: 0.0625rem solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}
.shelter-shell .control--patient-selected {
  border-color: var(--color-primary-600);
  background: var(--color-primary-50);
  font-weight: 600;
}
.shelter-shell .tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}
.shelter-shell .tag-chips--catalog {
  max-block-size: 8.5rem;
  overflow: auto;
  padding: 0.125rem;
  margin-block: 0.25rem 0;
}
.shelter-shell .tag-chips--empty { display: none; }
.shelter-shell .tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-block-size: 2rem;
  padding: 0.25rem 0.625rem;
  border: 0.0625rem solid var(--color-border-strong);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  cursor: pointer;
}
.shelter-shell .tag-chip[aria-pressed="true"],
.shelter-shell .tag-chip--selected {
  border-color: var(--color-primary-600);
  background: var(--color-primary-50);
  color: var(--color-primary-700);
  font-weight: 600;
}
.shelter-shell .tag-chip__remove {
  color: var(--color-text-tertiary);
  font-weight: 600;
  line-height: 1;
}
.shelter-shell .tag-editor {
  display: grid;
  gap: 0.5rem;
}
.shelter-shell .tag-editor__add {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.shelter-shell .tag-editor__add .control {
  flex: 1 1 10rem;
  min-inline-size: 8rem;
}

.shelter-shell .batches td {
  padding: 0;
  border-block-end: 0.0625rem solid var(--color-border);
  background: var(--color-surface-muted);
}
.shelter-shell .batches__inner {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-6);
}
.shelter-shell .batches__title {
  color: var(--color-text-tertiary);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.shelter-shell .batch-list { display: grid; gap: 0.25rem; }
.shelter-shell .batch-list__empty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
}
.shelter-shell .batch-list__empty--hidden { display: none; }
.shelter-shell .batch {
  display: grid;
  grid-template-columns: repeat(4, minmax(7rem, 1fr));
  gap: var(--space-3);
  align-items: start;
  padding: var(--space-2) var(--space-3);
  border: 0.0625rem solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  font-size: 0.8125rem;
}
.shelter-shell .batch--expired { border-color: var(--color-danger-100); background: var(--color-danger-50); }
.shelter-shell .batch__qty { font-weight: 600; font-variant-numeric: tabular-nums; }
.shelter-shell .batch__date { color: var(--color-text-secondary); font-variant-numeric: tabular-nums; }
.shelter-shell .batch__note { color: var(--color-text-tertiary); }
.shelter-shell .batch__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  grid-column: 1 / -1;
  justify-content: flex-end;
}
.shelter-shell .batches__tools { margin-block-start: var(--space-3); }
.shelter-shell .is-hidden-cell,
.shelter-shell .batch-list--hidden,
.shelter-shell .batches__tools--hidden,
.shelter-shell .row__toggle--hidden,
.shelter-shell .row__meta--hidden,
.shelter-shell .row__actions--hidden { display: none; }

.shelter-shell .history-filters { padding: var(--space-4); }
.shelter-shell .history-filters__top {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-block-end: var(--space-3);
}
.shelter-shell .history-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-block-end: var(--space-3); }
.shelter-shell .history-chip {
  border: 0.0625rem solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  padding: 0.25rem 0.625rem;
  cursor: pointer;
}
.shelter-shell .history-filters__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}
.shelter-shell .history-table { min-inline-size: 64rem; }
.shelter-shell .journal__cancelled .journal__cell { color: var(--color-text-tertiary); text-decoration: line-through; }
.shelter-shell .journal-cards { display: none; }
.shelter-shell .journal-card {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border-block-end: 0.0625rem solid var(--color-border);
}
.shelter-shell .journal-card__top,
.shelter-shell .journal-card__main,
.shelter-shell .journal-card__meta {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
}
.shelter-shell .journal-card__meta { color: var(--color-text-tertiary); font-size: 0.8125rem; }
.shelter-shell .journal-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.shelter-shell .journal-card--open { background: var(--color-surface-muted); }
.shelter-shell .journal-card--cancelled { opacity: 0.55; text-decoration: line-through; }

.shelter-shell .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  padding: var(--space-4);
}
.shelter-shell .form-grid--compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3);
}
.shelter-shell .field { display: grid; gap: var(--space-1); min-inline-size: 0; }
.shelter-shell .field--wide { grid-column: 1 / -1; }
.shelter-shell .field__label {
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
}
.shelter-shell .field__hint { margin: 0; color: var(--color-text-tertiary); font-size: 0.75rem; }
.shelter-shell .form-footer {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-block-start: 0.0625rem solid var(--color-border);
}
.shelter-shell .form-footer--sticky,
.shelter-shell .cart-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: var(--color-surface, #fff);
  box-shadow: 0 -0.0625rem 0.375rem rgb(0 0 0 / 0.08);
  border: 0.0625rem solid var(--color-border);
  border-radius: var(--radius-lg);
}
.shelter-shell .page--cart {
  padding-block-end: 5.5rem;
}
.shelter-shell .patient-card-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-block-end: var(--space-3);
  padding: var(--space-2) 0;
}
.shelter-shell .patient-card-nav__link {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  border: 0.0625rem solid var(--color-border);
  background: var(--color-surface);
}
.shelter-shell .patient-card-nav__link:hover {
  color: var(--color-text);
  border-color: var(--color-text-tertiary);
}
.shelter-shell .picker__list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  border: 0.0625rem solid var(--color-border);
  border-radius: var(--radius-md);
  list-style: none;
}
.shelter-shell .picker__row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-block-end: 0.0625rem solid var(--color-border);
}
.shelter-shell .picker__row:last-child { border-block-end: 0; }
.shelter-shell .picker__name { font-weight: 500; }
.shelter-shell .picker__meta {
  margin-inline-end: auto;
  color: var(--color-text-tertiary);
  font-size: 0.8125rem;
}
.shelter-shell .picker__more,
.shelter-shell .picker__empty {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-block-start: var(--space-2);
}
.shelter-shell .picker__more--hidden,
.shelter-shell .picker__empty--hidden {
  display: none;
}
.shelter-shell .cart-table th:nth-child(2),
.shelter-shell .cart-table td:nth-child(2) { min-inline-size: 9rem; }
.shelter-shell .cart-table th:nth-child(3),
.shelter-shell .cart-table td:nth-child(3) {
  min-inline-size: 14rem;
}
.shelter-shell .receive-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin-block-start: var(--space-3);
}
/* Base layout before --hidden rules so display:none wins when both classes apply. */
.shelter-shell .cart-issue-by-rx {
  display: grid;
  gap: var(--space-1);
  align-content: start;
}
.shelter-shell .receive-details--hidden,
.shelter-shell .cart-line-batch--hidden,
.shelter-shell .cart-line-receipt--hidden,
.shelter-shell .cart-picker__body--hidden,
.shelter-shell .cart-issue-by-rx--hidden,
.shelter-shell .empty--hidden,
.shelter-shell .table-wrap--hidden,
.shelter-shell .form-grid--hidden,
.shelter-shell .field--hidden,
.shelter-shell .field__hint--hidden,
.shelter-shell .cartbar__reason--hidden,
.shelter-shell .button--hidden {
  display: none;
}
.shelter-shell .button--disabled {
  opacity: 0.55;
  pointer-events: none;
}
.shelter-shell .control--batch-needed {
  border-color: var(--color-warning-300, #fcd34d);
}
.shelter-shell .notice {
  display: grid;
  gap: var(--space-1);
  margin: var(--space-3) var(--space-4);
  padding: var(--space-3);
  border: 0.0625rem solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
/* After .notice so display:none wins over display:grid (same specificity). */
.shelter-shell .notice--hidden {
  display: none;
}
.shelter-shell .notice__title { font-weight: 600; }
.shelter-shell .notice--warning {
  border-color: var(--color-warning-300, #fcd34d);
  background: var(--color-warning-50, #fffbeb);
}
.shelter-shell .notice--warning .notice__title { color: var(--color-warning-700, #b45309); }
.shelter-shell .notice--danger {
  border-color: var(--color-danger-100, #fecaca);
  background: var(--color-danger-50, #fef2f2);
}
.shelter-shell .notice--danger .notice__title { color: var(--color-danger-700, #b91c1c); }

@media (max-width: 48rem) {
  .shelter-shell {
    --control-height-filter: 2.75rem;
    --control-height-form: 2.75rem;
  }
  .shelter-shell .app-header__row { padding-inline: var(--space-3); }
  .shelter-shell .app-header__row--top { flex-wrap: wrap; }
  .shelter-shell .page { padding: var(--space-3); }
  .shelter-shell .page-header { align-items: flex-start; flex-direction: column; }
  .shelter-shell .page-header__actions {
    inline-size: 100%;
    margin-inline-start: 0;
    overflow-x: auto;
  }
  .shelter-shell .filters__row { align-items: stretch; flex-direction: column; }
  .shelter-shell .filters__search { inline-size: 100%; margin-inline-start: 0; }
  .shelter-shell .app-header__row--nav { padding-inline: var(--space-3); }
  .shelter-shell .catalogue-table .is-optional { display: none; }
  .shelter-shell .row__meta { display: none; }
  .shelter-shell .batch { grid-template-columns: 1fr 1fr; }
  .shelter-shell .history-filters__grid,
  .shelter-shell .form-grid,
  .shelter-shell .form-grid--compact { grid-template-columns: 1fr; }
  .shelter-shell .page--cart { padding-block-end: 6rem; }
  .shelter-shell .cart-actions {
    flex-wrap: wrap;
  }
  .shelter-shell .cart-actions .button--primary {
    flex: 1 1 12rem;
  }
  .shelter-shell .history-table { display: none; min-inline-size: 0; }
  .shelter-shell .journal-cards { display: grid; }
}

/* design/assets/app.css — секции карточки */
.shelter-shell .section-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-block-end: 0.0625rem solid var(--color-border);
}
.shelter-shell .section-head__title { margin: 0; font-size: 1rem; font-weight: 600; }
.shelter-shell .section-head__actions { margin-inline-start: auto; }
.shelter-shell .section-body { padding: var(--space-4); display: grid; gap: var(--space-3); }

/* design/assets/gp-patients.css */
.shelter-shell .patient-card .page-header__description { max-inline-size: 40rem; }

.shelter-shell .patient-weight {
  display: block;
  min-block-size: var(--control-height-form);
  padding-block-start: 0.55rem;
  font-size: 1.125rem;
  font-variant-numeric: tabular-nums;
}
.shelter-shell .patient-weight--empty {
  color: var(--color-text-tertiary);
  font-size: 0.875rem;
  font-weight: 400;
}

.shelter-shell .patient-meta,
.shelter-shell .patient-kind-tag {
  color: var(--color-text-tertiary);
  font-weight: 400;
}

.shelter-shell .patient-kind { font-weight: 500; }

.shelter-shell .patient-today-table td,
.shelter-shell .patient-history-table td { vertical-align: top; }

.shelter-shell .patient-history__compose { padding-block-end: var(--space-3); }
.shelter-shell .patient-history__line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.shelter-shell .patient-history__line .control { min-inline-size: 8rem; }
.shelter-shell .patient-history__line .control[type="text"],
.shelter-shell .patient-history__line input.control--filter:not(select) { flex: 1 1 14rem; }
.shelter-shell .patient-history__line .button { min-block-size: 2.75rem; }

.shelter-shell .patient-history__row--issue .patient-kind,
.shelter-shell .patient-history__row--issue .patient-kind-tag {
  color: var(--color-text-tertiary);
}

.shelter-shell .patient-ration__summary {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-6);
  margin-block-end: var(--space-3);
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}
.shelter-shell .patient-ration__summary b {
  color: var(--color-text-tertiary);
  font-weight: 600;
}
.shelter-shell .patient-ration-form { padding-block-start: 0; }
.shelter-shell .form-footer--flush {
  padding-inline: 0;
  border-block-start: 0;
}

.shelter-shell .patient-rx__inactive td { color: var(--color-text-tertiary); }

.shelter-shell .patient-protocols { display: grid; gap: var(--space-3); }

@media (max-width: 48rem) {
  .shelter-shell .patient-card .form-grid { grid-template-columns: 1fr; }
  .shelter-shell .patient-table .is-optional,
  .shelter-shell .patient-history-table .is-optional,
  .shelter-shell .rx-table .is-optional { display: none; }

  .shelter-shell .patient-today .section-head,
  .shelter-shell .patient-rx .section-head,
  .shelter-shell .patient-history .section-head,
  .shelter-shell .patient-ration .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--space-2);
  }
  .shelter-shell .patient-today .section-head__actions,
  .shelter-shell .patient-rx .section-head__actions,
  .shelter-shell .patient-history .section-head__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-inline-start: 0;
    inline-size: 100%;
  }
  .shelter-shell .patient-today .section-head__actions .button,
  .shelter-shell .patient-history__line .button,
  .shelter-shell .patient-protocols .button {
    min-block-size: 2.75rem;
  }
  .shelter-shell .patient-history__line { flex-direction: column; align-items: stretch; }
  .shelter-shell .patient-history__line .control,
  .shelter-shell .patient-history__line .button { inline-size: 100%; min-inline-size: 0; }
  .shelter-shell .patient-ration__summary { gap: var(--space-2) var(--space-4); }
}
