 :root {
  --primary: #18212B;
  --primary-raised: #22303D;
  --secondary: #5F6B78;
  --accent: #3F6F8F;
  --accent-soft: #E8F0F5;
  --critical: #C9364C;
  --critical-soft: #F8E9ED;
  --background: #F3F5F7;
  --surface: #FFFFFF;
  --text: #17212B;
  --on-primary: #FFFFFF;
  --on-accent: #FFFFFF;
  --success: #2D765F;
  --warning: #A96D18;
  --danger: #B52E43;
  --border: #E1E6EB;
  --muted: #687581;
  --field-bg: #F7F9FA;
  --surface-muted: #F5F7F9;
  --shadow: 0 12px 34px rgba(25, 36, 48, .07);
  --shadow-small: 0 6px 18px rgba(25, 36, 48, .06);
  --shadow-float: 0 22px 70px rgba(17, 27, 38, .20);
  --radius: 18px;
  --control-radius: 12px;
  --control-height: 44px;
  --sidebar-width: 272px;
  --sidebar-collapsed-width: 82px;
  --topbar-height: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--background);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
body.nav-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }

.app-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--primary);
  color: var(--on-primary);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  z-index: 40;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 0 8px 24px;
  border-bottom: 1px solid color-mix(in srgb, var(--on-primary) 14%, transparent);
}
.brand > div:last-of-type { min-width: 0; }
.brand img,
.brand-mark {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: contain;
  background: transparent;
  padding: 5px;
}
.brand-mark {
  display: grid;
  place-items: center;
  color: var(--primary);
  font-weight: 900;
}
.brand strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.2;
}
.brand span {
  display: block;
  margin-top: 3px;
  font-size: 9px;
  letter-spacing: .22em;
  opacity: .58;
}
.sidebar nav {
  display: grid;
  gap: 5px;
  margin-top: 24px;
}
.sidebar a {
  padding: 11px 13px;
  border-radius: 11px;
  font-size: 14px;
  color: color-mix(in srgb, var(--on-primary) 72%, transparent);
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.sidebar a:hover,
.sidebar a.active {
  background: color-mix(in srgb, var(--on-primary) 11%, transparent);
  color: var(--on-primary);
}
.sidebar a:active { transform: translateY(1px); }
.sidebar-bottom {
  margin-top: auto;
  display: grid;
  gap: 4px;
  padding-top: 24px;
}
.sidebar-bottom small {
  padding: 10px 13px;
  opacity: .55;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-close,
.sidebar-scrim { display: none; }

.main-content {
  min-width: 0;
  padding: 38px 42px 70px;
}
.mobile-header { display: none; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 26px;
}
.page-head > div:first-child { min-width: 0; }
.page-head h1 {
  overflow-wrap: anywhere;
  font-size: clamp(32px, 4vw, 52px);
  letter-spacing: -.045em;
  margin: 2px 0 4px;
  line-height: 1.02;
}
.page-head p {
  margin: 0;
  color: var(--muted);
  max-width: 720px;
}
.eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .22em;
  color: var(--accent);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card > :first-child { border-top-left-radius: inherit; border-top-right-radius: inherit; }
.card > :last-child { border-bottom-left-radius: inherit; border-bottom-right-radius: inherit; }

.button {
  min-height: var(--control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 15px;
  cursor: pointer;
  font-weight: 750;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease, background .16s ease, border-color .16s ease;
}
.button:hover { transform: translateY(-1px); box-shadow: var(--shadow-small); filter: brightness(1.02); }
.button:active { transform: translateY(0); box-shadow: none; }
.button:focus-visible,
.icon-button:focus-visible,
.text-button:focus-visible,
.widget-size:focus-visible,
.widget-hide:focus-visible,
.file-control:focus-within {
  outline: 3px solid color-mix(in srgb, var(--accent) 22%, transparent);
  outline-offset: 2px;
}
.button.primary { background: var(--accent); color: var(--on-accent); }
.button.secondary { background: var(--primary); color: var(--on-primary); }
.button.ghost { background: transparent; border-color: var(--border); color: var(--text); box-shadow: none; }
.button.ghost:hover { background: var(--surface-muted); }
.button.danger { background: var(--danger); color: #fff; }
.button.full { width: 100%; }
.button[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.button-row,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.form-actions { justify-content: flex-end; margin-top: 20px; }

.icon-button,
.text-button,
.widget-size,
.widget-hide {
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 9px;
}
.icon-button {
  min-width: 40px;
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  font-size: 22px;
}
.icon-button:hover,
.widget-size:hover,
.widget-hide:hover { background: var(--surface-muted); }
.text-button {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 750;
}
.text-button:hover { background: var(--surface-muted); }
.danger-text { color: var(--danger); }

.form-card { padding: 24px; }
.form-card h2 { margin: 0 0 18px; }
.form-card label,
.form-grid label,
.palette-grid label {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 7px;
  font-size: 12px;
  font-weight: 720;
  color: var(--text);
}
.form-card > label { margin-bottom: 14px; }
input,
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: var(--control-height);
  background: var(--field-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--control-radius);
  padding: 10px 11px;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
input::placeholder,
textarea::placeholder { color: color-mix(in srgb, var(--text) 42%, transparent); }
input:hover,
select:hover,
textarea:hover { border-color: color-mix(in srgb, var(--text) 22%, transparent); }
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
  background: var(--surface);
}
textarea { min-height: 96px; resize: vertical; }
select { cursor: pointer; }

/* Custom select: the real field remains in the DOM for forms and validation,
   while the visible menu stays coherent with the kennel theme. */
.custom-select {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
}
.native-select {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.custom-select-trigger {
  width: 100%;
  min-width: 0;
  min-height: var(--control-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--control-radius);
  padding: 10px 38px 10px 11px;
  background: var(--field-bg);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.custom-select-trigger:hover {
  border-color: color-mix(in srgb, var(--text) 22%, transparent);
}
.custom-select-trigger:focus-visible,
.custom-select.is-open .custom-select-trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
  background: var(--surface);
}
.custom-select.is-invalid .custom-select-trigger {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 13%, transparent);
}
.custom-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.custom-select.has-placeholder .custom-select-value {
  color: var(--muted);
  font-weight: 550;
}
.custom-select-chevron {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  opacity: .62;
  transform: translateY(-68%) rotate(45deg);
  pointer-events: none;
  transition: transform .16s ease, opacity .16s ease;
}
.custom-select.is-open .custom-select-chevron {
  opacity: 1;
  transform: translateY(-28%) rotate(225deg);
}
.custom-select-menu {
  position: absolute;
  z-index: 140;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  display: none;
  max-height: min(310px, 45vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--text) 15%, transparent);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface) 97%, var(--background) 3%);
  box-shadow: 0 18px 46px color-mix(in srgb, var(--primary) 18%, transparent);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-5px) scale(.985);
  transform-origin: top center;
  transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
}
.custom-select.opens-upward .custom-select-menu {
  top: auto;
  bottom: calc(100% + 7px);
  transform: translateY(5px) scale(.985);
  transform-origin: bottom center;
}
.custom-select.is-open .custom-select-menu {
  display: block;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.custom-select-option,
.custom-select-group {
  display: flex;
  width: 100%;
  min-width: 0;
}
.custom-select-option {
  position: relative;
  align-items: center;
  min-height: 38px;
  padding: 9px 35px 9px 11px;
  border-radius: 9px;
  color: var(--text);
  cursor: pointer;
  outline: none;
  overflow-wrap: anywhere;
  transition: background .12s ease, color .12s ease;
}
.custom-select-option:hover,
.custom-select-option:focus-visible {
  background: var(--surface-muted);
}
.custom-select-option.is-selected {
  background: color-mix(in srgb, var(--accent) 11%, var(--surface));
  color: color-mix(in srgb, var(--accent) 86%, var(--text));
  font-weight: 800;
}
.custom-select-option.is-selected::after {
  content: '';
  position: absolute;
  right: 13px;
  top: 50%;
  width: 8px;
  height: 4px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-68%) rotate(-45deg);
}
.custom-select-option.is-disabled {
  opacity: .4;
  cursor: not-allowed;
}
.custom-select-option.is-disabled:hover,
.custom-select-option.is-disabled:focus-visible {
  background: transparent;
}
.custom-select-group {
  padding: 9px 10px 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.custom-select.is-disabled { opacity: .58; }
.custom-select.is-disabled .custom-select-trigger { cursor: not-allowed; }
.custom-select-menu::-webkit-scrollbar { width: 9px; }
.custom-select-menu::-webkit-scrollbar-track { background: transparent; }
.custom-select-menu::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 22%, transparent);
  background-clip: padding-box;
}

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  min-height: 20px;
  margin: 0;
  padding: 0;
  border: 1.5px solid color-mix(in srgb, var(--text) 34%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 94%, var(--text) 6%);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.48);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .12s ease;
}
input[type="checkbox"]::before {
  content: "";
  width: 5px;
  height: 9px;
  margin-top: -2px;
  border: solid var(--on-accent);
  border-width: 0 2px 2px 0;
  opacity: 0;
  transform: rotate(45deg) scale(.65);
  transition: opacity .12s ease, transform .12s ease;
}
input[type="checkbox"]:hover {
  border-color: color-mix(in srgb, var(--accent) 72%, var(--text));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent);
}
input[type="checkbox"]:active { transform: scale(.92); }
input[type="checkbox"]:checked {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 24%, transparent);
}
input[type="checkbox"]:checked::before {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}
input[type="checkbox"]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 24%, transparent);
  outline-offset: 2px;
}
input[type="checkbox"]:disabled {
  opacity: .48;
  cursor: not-allowed;
}
input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--accent);
}
input[type="color"] {
  height: 48px;
  padding: 4px;
  cursor: pointer;
  overflow: hidden;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 8px; }

/* Stable custom colour controls. The native Chromium/Windows picker is
   deliberately avoided because it can lock the renderer on some GPU drivers. */
.colour-control {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: stretch;
  min-height: var(--control-height);
  border: 1px solid var(--border);
  border-radius: var(--control-radius);
  background: var(--field-bg);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.colour-control:focus-within,
.colour-control.is-open {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
.colour-control.is-invalid { border-color: var(--danger); }
.colour-swatch-button {
  min-width: 0;
  min-height: 0;
  margin: 4px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: transparent;
  cursor: pointer;
}
.colour-swatch {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 34px;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}
.colour-hex-input {
  min-width: 0;
  min-height: 0 !important;
  height: auto !important;
  padding: 10px 12px !important;
  border: 0 !important;
  border-left: 1px solid var(--border) !important;
  border-radius: 0 var(--control-radius) var(--control-radius) 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.colour-picker-popover {
  position: fixed;
  z-index: 240;
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: 0 22px 58px rgba(0, 0, 0, .22);
}
.colour-picker-popover[hidden] { display: none !important; }
.colour-picker-preview-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
.colour-picker-preview {
  width: 48px;
  height: 48px;
  border-radius: 11px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14);
}
.colour-picker-value {
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  letter-spacing: .04em;
}
.colour-slider-row {
  display: grid !important;
  grid-template-columns: 18px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px !important;
  margin: 0 !important;
  font-size: 11px;
  font-weight: 850;
}
.colour-slider-row output {
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.colour-slider-row input[type="range"] {
  width: 100%;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.colour-slider-row input[data-colour-hue] {
  background: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
}
.colour-slider-row input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .2);
  -webkit-appearance: none;
}
.colour-slider-row input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .2);
}
.colour-picker-close { width: 100%; }

/* File picker: the native 1998 button remains functional but invisible. */
.file-control {
  position: relative;
  min-width: 0;
  min-height: var(--control-height);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--control-radius);
  background: var(--field-bg);
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.file-control:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.file-control input[type="file"] {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}
.file-trigger {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  background: var(--primary);
  color: var(--on-primary);
  border-right: 1px solid var(--border);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.file-name {
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-control.has-file .file-name { color: var(--text); font-weight: 700; }

.form-grid {
  display: grid;
  align-items: start;
  gap: 14px;
  margin-bottom: 14px;
}
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.form-grid > *,
.nutrition-grid > *,
.palette-grid > *,
.branding-upload-grid > * { min-width: 0; }
.field-label-text {
  display: block;
  min-width: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.span-all { grid-column: 1 / -1; }
.compact-grid { margin-top: 8px; }
.check-row {
  display: flex !important;
  grid-auto-flow: column;
  justify-content: flex-start;
  align-items: center !important;
  align-self: end;
  min-height: var(--control-height);
  gap: 10px !important;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--control-radius);
  background: var(--field-bg);
  cursor: pointer;
}
.check-row:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.check-row:focus-within {
  border-color: color-mix(in srgb, var(--accent) 72%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent);
}
.check-row:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 54%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--field-bg));
}
.check-row input { flex: 0 0 auto; }
.field-help { margin-top: -2px; color: var(--muted); font-size: 11px; font-weight: 500; }

.flash-stack {
  position: fixed;
  right: 24px;
  top: 24px;
  z-index: 100;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100vw - 32px));
}
.flash {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--shadow);
  transition: opacity .3s ease, transform .3s ease;
}
.flash.error { background: var(--danger); color: #fff; }
.flash.success { background: #2d6654; color: #fff; }
.flash.fade-out { opacity: 0; transform: translateY(-8px); pointer-events: none; }

.setup-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(440px, 700px);
  gap: clamp(34px, 5vw, 70px);
  align-items: center;
  padding: 60px max(5vw, 30px);
  background: linear-gradient(120deg, var(--primary), #11161b 46%, var(--background) 46%);
}
.setup-intro { color: #fff; max-width: 560px; }
.setup-intro h1 {
  overflow-wrap: anywhere;
  font-size: clamp(44px, 6vw, 76px);
  line-height: .96;
  letter-spacing: -.055em;
  margin: 12px 0 20px;
}
.setup-intro p { color: rgba(255,255,255,.7); font-size: 18px; }
.setup-form { width: 100%; max-width: 760px; }
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top, var(--secondary), var(--primary));
  padding: 24px;
}
.auth-wrap.auth-login {
  position: relative;
  isolation: isolate;
  align-items: center;
  justify-items: start;
  padding: clamp(24px, 6vw, 64px);
  overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--background) 86%, white 14%), color-mix(in srgb, var(--surface) 64%, #dfe5ef 36%));
}
.auth-wrap.auth-login::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(90deg, rgba(243, 245, 249, 0.84) 0%, rgba(243, 245, 249, 0.72) 32%, rgba(243, 245, 249, 0.42) 58%, rgba(243, 245, 249, 0.18) 100%),
    var(--auth-login-bg);
  background-size: cover;
  background-position: center;
}
.auth-wrap.auth-login::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 18% 32%, rgba(255,255,255,.62), transparent 32%),
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(20, 28, 38, .10));
  pointer-events: none;
}
.auth-card { width: min(430px, 100%); }
.auth-wrap.auth-login .auth-card {
  background: color-mix(in srgb, var(--surface) 78%, rgba(255,255,255,.22));
  border-color: color-mix(in srgb, var(--text) 10%, rgba(255,255,255,.38));
  box-shadow: 0 22px 64px rgba(28, 39, 53, .18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.auth-card h1 { font-size: 42px; margin: 4px 0 16px; }
.auth-card-intro {
  margin: -4px 0 22px;
  color: var(--muted);
  font-size: .98rem;
  max-width: 34ch;
}

.toolbar { display: flex; gap: 10px; margin-bottom: 22px; }
.toolbar input { max-width: 500px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.single-column { grid-template-columns: 1fr; }
.dog-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 18px;
  padding: 16px;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.dog-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: 0 22px 58px color-mix(in srgb, var(--primary) 13%, transparent);
}
.dog-card > div:last-child { min-width: 0; }
.dog-card h2 { overflow-wrap: anywhere; margin: 6px 0 2px; }
.dog-card p,
.dog-card small { color: var(--muted); margin: 0; }
.dog-photo {
  width: 92px;
  height: 106px;
  border-radius: 13px;
  overflow: hidden;
  background: var(--primary);
  display: grid;
  place-items: center;
  color: var(--on-primary);
  font-size: 32px;
  font-weight: 800;
}
.dog-photo img { width: 100%; height: 100%; object-fit: cover; }
.status-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  padding: 4px 8px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  white-space: nowrap;
}
.status-pill.active,
.status-pill.pending,
.status-pill.approved,
.status-pill.owner,
.status-pill.assigned { background: #dff2ea; color: #245e4d; }
.status-pill.pregnant,
.status-pill.reserved,
.status-pill.waiting { background: #fff1cf; color: #795619; }
.status-pill.dormant,
.status-pill.disabled,
.status-pill.not_analyzed,
.status-pill.retired,
.status-pill.closed { background: #ececef; color: #666b73; }
.status-pill.critical,
.status-pill.failed,
.status-pill.deceased,
.status-pill.not_suitable { background: color-mix(in srgb, var(--critical) 15%, var(--surface)); color: color-mix(in srgb, var(--critical) 82%, var(--text)); }
.empty-state { padding: 42px; text-align: center; }
.empty { color: var(--muted); font-style: italic; }
.profile-head { display: flex; align-items: center; gap: 18px; min-width: 0; }
.profile-head > div:last-child { min-width: 0; }
.profile-photo {
  flex: 0 0 auto;
  width: 88px;
  height: 88px;
  border-radius: 20px;
  overflow: hidden;
  background: var(--primary);
  display: grid;
  place-items: center;
  color: var(--on-primary);
  font-size: 36px;
  font-weight: 900;
}
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.detail-grid > .card { padding: 24px; min-width: 0; }
.full-span { grid-column: 1 / -1; }
.data-list { margin: 0; }
.data-list > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.data-list > div:last-child { border-bottom: 0; }
.data-list dt { color: var(--muted); }
.data-list dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px 18px;
}
.section-head h2 { margin: 0; }
.section-head > :first-child { min-width: 0; }
.section-head > :last-child:not(:first-child) { justify-self: end; }
.section-head > span:last-child:not(.status-pill) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}
.record-card > .section-head { padding: 22px 24px 6px; }
.record-card > .empty { padding: 24px; }
.timeline { display: grid; }
.timeline article {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr);
  gap: 20px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.timeline article:last-child { border-bottom: 0; }
.timeline time { color: var(--muted); font-size: 12px; }
.timeline h3 { overflow-wrap: anywhere; margin: 3px 0; }
.timeline p { overflow-wrap: anywhere; margin: 4px 0; color: var(--muted); }
.event-type { font-size: 9px; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; color: var(--accent); }
.preline { white-space: pre-line; }
.split-layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.sticky-card { position: sticky; top: 24px; }
.litter-card,
.client-card { padding: 22px; display: flex; justify-content: space-between; align-items: center; gap: 20px; min-width: 0; }
.litter-card > div:first-child,
.client-card > div:first-child { min-width: 0; }
.litter-card h2,
.client-card h2,
.client-card p { overflow-wrap: anywhere; }
.litter-metrics { flex: 0 0 auto; text-align: right; }
.litter-metrics strong { display: block; font-size: 30px; }
.litter-metrics small { color: var(--muted); }
.puppy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 18px; }
.puppy-card { position: relative; min-width: 0; border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.puppy-card h3 { margin: 0 25px 4px 0; overflow-wrap: anywhere; }
.puppy-card p { color: var(--muted); margin: 0 0 8px; }
.collar-dot { position: absolute; right: 16px; top: 16px; width: 17px; height: 17px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); }
.mini-form { display: grid; gap: 7px; margin-top: 14px; }
.mini-form input,
.mini-form select { min-height: 38px; padding: 8px; font-size: 12px; }
.mini-form .custom-select { font-size: 12px; }
.mini-form .custom-select-trigger { min-height: 38px; padding: 8px 34px 8px 10px; }
.mini-form .custom-select-chevron { right: 12px; }
details { margin-top: 14px; }
summary { cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 700; }
.calendar-list article {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: start;
  gap: 20px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.calendar-list article:last-child { border-bottom: 0; }
.calendar-list h3 { overflow-wrap: anywhere; margin: 4px 0; }
.calendar-list p { margin: 0; color: var(--muted); }
.calendar-list > .empty { padding: 24px; }

.schedule-badge {
  width: 96px;
  display: grid;
  gap: 7px;
  align-self: start;
}
.schedule-date {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "weekday month"
    "day day";
  align-items: center;
  gap: 2px 6px;
  padding: 9px 11px 10px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-muted);
  color: var(--text);
  line-height: 1;
}
.schedule-date strong {
  grid-area: day;
  margin-top: 3px;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -.04em;
}
.schedule-date > span {
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.schedule-weekday { grid-area: weekday; color: var(--muted); }
.schedule-month { grid-area: month; justify-self: end; color: var(--accent); }
.schedule-time {
  min-height: 29px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  color: color-mix(in srgb, var(--accent) 82%, var(--text));
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}
.schedule-time::before {
  content: "◷";
  margin-right: 5px;
  font-size: 12px;
  line-height: 1;
}
.schedule-time.is-unscheduled,
.schedule-time.is-deadline {
  border-color: var(--border);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.schedule-time.is-unscheduled::before,
.schedule-time.is-deadline::before { display: none; }

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; }
th,
td { text-align: left; padding: 13px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
thead th { background: color-mix(in srgb, var(--surface) 96%, var(--text) 4%); }
th { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
td { overflow-wrap: anywhere; }
td small { display: block; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
.warning-row { background: color-mix(in srgb, var(--critical) 7%, transparent); }
.inline-edit { display: grid; grid-template-columns: minmax(90px, 1fr) auto minmax(90px, 1fr) minmax(145px, 1fr) auto; gap: 7px; align-items: center; }
.inline-edit input { min-width: 90px; }
.inline-edit span { white-space: nowrap; color: var(--muted); font-size: 12px; }

.dashboard-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
.widget { grid-column: span 4; min-width: 0; min-height: 180px; padding: 18px; transition: opacity .18s ease, transform .18s ease, border-color .18s ease; }
.widget.size-wide { grid-column: span 8; }
.widget.size-large { grid-column: span 12; }
.widget.is-hidden { display: none; }
.widget.dragging { opacity: .45; transform: scale(.98); }
.widget-head { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.widget-head h2 { min-width: 0; overflow-wrap: anywhere; font-size: 14px; margin: 0; flex: 1; }
.drag-handle { cursor: grab; color: var(--muted); user-select: none; }
.widget-size,
.widget-hide { min-width: 34px; min-height: 34px; color: var(--muted); }
.widget-body { padding-top: 16px; }
.big-number { font-size: 48px; line-height: 1; font-weight: 900; letter-spacing: -.05em; margin-bottom: 12px; }
.mini-list { display: grid; }
.mini-list a { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.mini-list a:last-child { border-bottom: 0; }
.mini-list a:hover strong { color: var(--accent); }
.mini-list > a > time { font-weight: 800; color: var(--accent); min-width: 42px; }
.mini-list span { min-width: 0; display: grid; }
.mini-list strong,
.mini-list small { overflow-wrap: anywhere; }
.mini-list small { color: var(--muted); }

.dashboard-calendar-item {
  display: grid !important;
  grid-template-columns: 66px minmax(0, 1fr);
  align-items: center;
  gap: 12px !important;
}
.schedule-badge-compact { width: 66px; gap: 5px; }
.schedule-badge-compact .schedule-date {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "day month";
  align-items: baseline;
  gap: 5px;
  padding: 8px 9px;
}
.schedule-badge-compact .schedule-date strong {
  grid-area: day;
  margin: 0;
  font-size: 22px;
}
.schedule-badge-compact .schedule-date > span {
  grid-area: month;
  justify-self: start;
  font-size: 9px;
  color: var(--accent);
}
.schedule-badge-compact .schedule-time {
  min-height: 24px;
  padding: 5px 6px;
  font-size: 10px;
}
.schedule-badge-compact .schedule-time.is-unscheduled {
  font-size: 8px;
  white-space: normal;
  text-align: center;
  line-height: 1.15;
}
.dashboard-calendar-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.widget-manager { padding: 20px; margin-bottom: 18px; }
.toggle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 16px 0; }
.switch-card {
  min-width: 0;
  display: flex !important;
  align-items: center;
  gap: 12px !important;
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 12px;
  background: var(--field-bg);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}
.switch-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.switch-card:focus-within {
  border-color: color-mix(in srgb, var(--accent) 72%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 9%, transparent);
}
.switch-card:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
  background: color-mix(in srgb, var(--accent) 7%, var(--field-bg));
}
.switch-card input { flex: 0 0 auto; }
.switch-card span { min-width: 0; display: grid; }
.switch-card strong,
.switch-card small { overflow-wrap: anywhere; }
.switch-card small { color: var(--muted); }
.save-indicator {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 80;
  background: var(--primary);
  color: var(--on-primary);
  padding: 9px 13px;
  border-radius: 10px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}
.save-indicator.show { opacity: 1; transform: none; }
.save-indicator.error { background: var(--danger); color: #fff; }

.admin-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.admin-tabs a {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  transition: border-color .16s ease, background .16s ease;
}
.admin-tabs a:hover { background: var(--surface-muted); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.admin-section { padding: 25px; margin-bottom: 20px; scroll-margin-top: 20px; }
.admin-section > h2 { margin-top: 4px; }
.admin-logo { width: 90px; height: 70px; object-fit: contain; border: 1px solid var(--border); border-radius: 12px; padding: 6px; background: var(--field-bg); }
.branding-upload-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .65fr); gap: 14px; align-items: end; margin-bottom: 14px; }
.palette-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.warning-box { border-left: 4px solid var(--warning); background: color-mix(in srgb, var(--warning) 8%, transparent); padding: 14px; margin: 15px 0; border-radius: 8px; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.metric-grid div { min-width: 0; border: 1px solid var(--border); padding: 14px; border-radius: 12px; background: var(--field-bg); }
.metric-grid strong { display: block; font-size: 30px; }
.metric-grid span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
code { background: var(--surface-muted); padding: 2px 5px; border-radius: 5px; overflow-wrap: anywhere; }
.muted { color: var(--muted); }

@media (max-width: 1180px) {
  .dashboard-grid .widget { grid-column: span 6; }
  .dashboard-grid .widget.size-wide,
  .dashboard-grid .widget.size-large { grid-column: span 12; }
  .form-grid.five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .palette-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split-layout { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); }
}

@media (max-width: 980px) {
  .setup-wrap {
    display: block;
    background: var(--background);
    padding: 36px max(4vw, 24px);
  }
  .setup-intro { color: var(--text); margin: 0 auto 28px; max-width: 760px; }
  .setup-intro p { color: var(--muted); }
  .setup-intro h1 { font-size: clamp(42px, 8vw, 64px); }
  .setup-form { margin: 0 auto; }
  .split-layout { grid-template-columns: 1fr; }
  .sticky-card { position: static; }
}

@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(285px, 86vw);
    height: 100dvh;
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: 18px 0 55px rgba(0,0,0,.24);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close {
    display: inline-grid;
    flex: 0 0 auto;
    margin-left: auto;
    color: var(--on-primary);
  }
  .sidebar-close:hover { background: color-mix(in srgb, var(--on-primary) 12%, transparent); }
  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: block;
    border: 0;
    padding: 0;
    background: rgba(8, 10, 13, .48);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
  }
  .sidebar-scrim.open { opacity: 1; pointer-events: auto; }
  .main-content { padding: 18px 16px 55px; }
  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 25;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 54px;
    margin: -18px -16px 20px;
    padding: 8px 12px;
    background: color-mix(in srgb, var(--background) 90%, transparent);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
  }
  .mobile-header strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-head > .button,
  .page-head > .button-row { width: 100%; }
  .page-head > .button { justify-content: center; }
  .page-head > .button-row > * { flex: 1; }
  .detail-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid .widget,
  .dashboard-grid .widget.size-wide,
  .dashboard-grid .widget.size-large { grid-column: 1; }
  .form-grid.three,
  .form-grid.two,
  .form-grid.five { grid-template-columns: 1fr; }
  .palette-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .branding-upload-grid { grid-template-columns: 1fr; }
  .timeline article { grid-template-columns: 82px minmax(0, 1fr); padding-inline: 18px; }
  .client-card { align-items: flex-start; }
  .inline-edit { min-width: 650px; }
  .flash-stack { right: 16px; top: 16px; }
}

@media (max-width: 560px) {
  .main-content { padding-inline: 12px; }
  .mobile-header { margin-inline: -12px; }
  .form-card,
  .admin-section,
  .detail-grid > .card { padding: 19px; }
  .page-head h1 { font-size: 38px; }
  .toolbar { flex-direction: column; }
  .toolbar input { max-width: none; }
  .toolbar .button { width: 100%; }
  .dog-card { grid-template-columns: 76px minmax(0, 1fr); gap: 14px; }
  .dog-photo { width: 76px; height: 90px; }
  .profile-head { align-items: flex-start; }
  .profile-photo { width: 72px; height: 72px; border-radius: 16px; }
  .litter-card,
  .client-card { align-items: flex-start; flex-direction: column; }
  .litter-metrics { text-align: left; }
  .file-control { grid-template-columns: 120px minmax(0, 1fr); }
  .file-trigger { justify-content: center; padding-inline: 10px; }
  .calendar-list article { grid-template-columns: 84px minmax(0, 1fr); gap: 13px; padding: 16px; }
  .schedule-badge { width: 78px; }
  .schedule-date { padding: 8px 9px 9px; }
  .schedule-date strong { font-size: 26px; }
  .schedule-time { min-height: 27px; padding-inline: 6px; font-size: 10px; }
  .schedule-time.is-unscheduled,
  .schedule-time.is-deadline { font-size: 8px; white-space: normal; text-align: center; line-height: 1.15; }
  .timeline article { grid-template-columns: 1fr; gap: 6px; }
  .data-list > div { align-items: flex-start; flex-direction: column; gap: 4px; }
  .data-list dd { text-align: left; }
  .form-actions { align-items: stretch; flex-direction: column-reverse; }
  .form-actions > * { width: 100%; }
  .admin-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .admin-tabs a { flex: 0 0 auto; }
  .palette-grid { grid-template-columns: 1fr 1fr; }
}

/* Inventory uses a responsive editor instead of forcing forms inside a table. */
.inventory-list { overflow: hidden; }
.inventory-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(0, 3fr);
  gap: 16px;
  align-items: end;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.inventory-row:last-child { border-bottom: 0; }
.inventory-item { min-width: 0; display: grid; justify-items: start; gap: 3px; align-self: center; }
.inventory-item strong { overflow-wrap: anywhere; font-size: 16px; }
.inventory-item small { color: var(--muted); }
.inventory-item .status-pill { margin-top: 5px; }
.inventory-edit-form {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(105px, .8fr) minmax(105px, .8fr) minmax(150px, 1.15fr) auto;
  gap: 10px;
  align-items: end;
}
.inventory-edit-form label { min-width: 0; display: grid; gap: 6px; font-size: 11px; font-weight: 720; }
.quantity-control { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.quantity-control span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.inventory-delete-form { margin-top: 4px; }

.widget-body > .muted { display: block; }
.widget-body > a { display: inline-flex; margin-top: 12px; font-weight: 700; }

@media (min-width: 821px) {
  .sidebar .sidebar-close { display: none; }
}

@media (max-width: 1180px) {
  .inventory-row { grid-template-columns: 1fr; align-items: stretch; }

}

@media (max-width: 620px) {
  .inventory-row { padding: 18px; }
  .inventory-edit-form { grid-template-columns: 1fr; }
  .inventory-edit-form .button { width: 100%; }
  .inventory-delete-form { width: 100%; }
  .inventory-delete-form .text-button { width: auto; min-height: 38px; padding-inline: 0; }
}

.split-layout > * { min-width: 0; max-width: 100%; }
@media (max-width: 980px) {
  .split-layout { grid-template-columns: minmax(0, 1fr); }
}

/* Free-text dog references with kennel suggestions. */
.autocomplete-field {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}
.autocomplete-menu {
  position: absolute;
  z-index: 145;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  display: grid;
  max-height: min(300px, 42vh);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--text) 15%, transparent);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface) 97%, var(--background) 3%);
  box-shadow: 0 18px 46px color-mix(in srgb, var(--primary) 18%, transparent);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-5px) scale(.985);
  transform-origin: top center;
  transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
}
.autocomplete-field.opens-upward .autocomplete-menu {
  top: auto;
  bottom: calc(100% + 7px);
  transform: translateY(5px) scale(.985);
  transform-origin: bottom center;
}
.autocomplete-field.is-open .autocomplete-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.autocomplete-menu:empty { display: none; }
.autocomplete-menu button {
  width: 100%;
  min-height: 42px;
  display: grid;
  gap: 1px;
  padding: 8px 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.autocomplete-menu button:hover,
.autocomplete-menu button.is-active {
  background: var(--surface-muted);
}
.autocomplete-menu button strong,
.autocomplete-menu button small {
  min-width: 0;
  overflow-wrap: anywhere;
}
.autocomplete-menu button small { color: var(--muted); font-size: 10px; }

.association-box {
  display: grid;
  gap: 11px;
  margin: 4px 0 14px;
  padding: 14px;
  border: 1px dashed color-mix(in srgb, var(--accent) 38%, var(--border));
  border-radius: 13px;
  background: color-mix(in srgb, var(--accent) 4%, var(--field-bg));
}
.association-box > strong { font-size: 12px; }
.association-box > p { margin: -5px 0 1px; color: var(--muted); font-size: 11px; }
.association-box label { margin: 0 !important; }

.record-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
}
.context-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.context-pill.general {
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  color: color-mix(in srgb, var(--accent) 82%, var(--text));
}
.record-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
/* Global details spacing must not offset action buttons inside record cards. */
.record-actions > form,
.record-actions > details {
  margin: 0;
}
.record-actions > form {
  display: flex;
  align-items: center;
}
.record-actions .inline-editor:not([open]) {
  display: flex;
  align-items: center;
}
.record-actions .inline-editor[open] {
  flex: 0 0 100%;
}
.record-actions .button { min-height: 36px; padding: 8px 11px; font-size: 11px; }

.overdue-card { margin-bottom: 20px; padding: 22px; border-left: 4px solid var(--critical); }
.compact-record-list { display: grid; margin-top: 14px; }
.compact-record-list article {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.compact-record-list article:last-child { border-bottom: 0; }
.compact-record-list article > div:first-child { min-width: 0; display: grid; gap: 2px; }
.compact-record-list strong,
.compact-record-list small { overflow-wrap: anywhere; }
.compact-record-list small { color: var(--muted); }
.calendar-card { min-width: 0; overflow: hidden; }
.calendar-card > .section-head { padding: 22px 24px 6px; }
.calendar-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.calendar-section-head > div:first-child { min-width: 0; }
.calendar-section-head h2 { margin-bottom: 2px; }
.calendar-section-head > div:first-child > span { color: var(--muted); font-size: 12px; }
.calendar-view-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-muted);
}
.calendar-view-button {
  min-height: 34px;
  padding: 7px 13px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.calendar-view-button:hover { color: var(--text); }
.calendar-view-button.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(23, 33, 43, .12);
}
.calendar-view-panel[hidden] { display: none; }
.calendar-grid-scroll {
  overflow-x: auto;
  border-top: 1px solid var(--border);
}
.calendar-month-grid {
  min-width: 840px;
  background: var(--border);
}
.calendar-grid-weekdays,
.calendar-grid-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
}
.calendar-grid-weekdays {
  padding: 0 1px 1px;
  background: var(--surface);
}
.calendar-grid-weekdays span {
  padding: 10px 8px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .08em;
  text-align: center;
  text-transform: uppercase;
}
.calendar-grid-weeks { display: grid; gap: 1px; }
.calendar-grid-day {
  min-width: 0;
  min-height: 138px;
  padding: 9px;
  background: var(--surface);
}
.calendar-grid-day.is-outside { background: var(--surface-muted); }
.calendar-grid-day.is-outside .calendar-grid-day-head,
.calendar-grid-day.is-outside .calendar-grid-items { opacity: .48; }
.calendar-grid-day.is-today { box-shadow: inset 0 0 0 2px var(--accent); }
.calendar-grid-day-head {
  min-height: 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 7px;
}
.calendar-grid-day-head a,
.calendar-grid-day-number {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}
.calendar-grid-day-head a:hover { background: var(--surface-muted); }
.calendar-grid-day-number { color: var(--muted); }
.calendar-grid-day.is-today .calendar-grid-day-head a,
.calendar-grid-day.is-today .calendar-grid-day-number {
  background: var(--accent);
  color: #fff;
}
.calendar-grid-today-label {
  color: var(--accent);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.calendar-grid-items { display: grid; gap: 5px; }
.calendar-grid-item {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 7px 8px 7px 10px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--secondary);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text);
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.calendar-grid-item:hover {
  transform: translateY(-1px);
  border-color: var(--secondary);
  background: var(--surface);
}
.calendar-grid-item.kind-event { border-left-color: var(--accent); }
.calendar-grid-item.kind-document { border-left-color: var(--secondary); }
.calendar-grid-item.kind-vaccination { border-left-color: var(--primary); }
.calendar-grid-item.importance-high {
  border-left-color: var(--warning);
  background: color-mix(in srgb, var(--warning) 8%, var(--surface));
}
.calendar-grid-item.importance-critical {
  border-left-color: var(--critical);
  background: color-mix(in srgb, var(--critical) 8%, var(--surface));
}
.calendar-grid-item span,
.calendar-grid-item small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-grid-item strong {
  overflow: hidden;
  font-size: 10px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-grid-empty { padding: 22px 24px; border-top: 1px solid var(--border); }

@media (max-width: 620px) {
  .calendar-section-head { align-items: stretch; }
  .calendar-view-switch { width: 100%; }
  .calendar-view-button { flex: 1; }
  .calendar-month-grid { min-width: 770px; }
  .calendar-grid-day { min-height: 122px; padding: 7px; }
  .compact-record-list article { align-items: flex-start; flex-direction: column; }
  .compact-record-list .record-actions { width: 100%; }
  .compact-record-list .record-actions form,
  .compact-record-list .record-actions .button { flex: 1; width: 100%; }
  .record-actions form { flex: 1; }
  .record-actions .button { width: 100%; }
}

/* Vaccinations and feeding modules. */
.record-stack { display: grid; gap: 16px; min-width: 0; }
.vaccination-layout,
.feeding-layout { align-items: start; }
/* Standalone record cards need their own internal breathing room.
   The base .card deliberately has no padding because tables and timelines
   manage spacing internally; these records do not. */
.vaccination-card,
.food-card,
.active-rations {
  min-width: 0;
  padding: 22px 24px;
}
.vaccination-head,
.food-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px 20px;
  margin-bottom: 16px;
}
.vaccination-head > :first-child,
.food-card-head > :first-child { min-width: 0; }
.vaccination-head h2,
.food-card-head h2 { margin: 5px 0 3px; }
.vaccination-head p,
.food-card-head p { margin: 0; color: var(--muted); }
.vaccination-deadline {
  min-width: 132px;
  display: grid;
  justify-items: end;
  gap: 4px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-muted);
}
.vaccination-deadline small { color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.vaccination-deadline strong { font-size: 15px; }
.compact-data-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
.compact-data-list > div { min-width: 0; }
.clinical-note {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  color: var(--text);
}
.inline-editor { min-width: 0; }
.inline-editor > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.inline-editor > summary::-webkit-details-marker { display: none; }
.inline-editor[open] { width: 100%; }
.inline-editor[open] > summary { margin-bottom: 12px; }
.inline-editor > form {
  display: grid;
  gap: 12px;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--field-bg);
}
.nutrition-grid {
  display: grid;
  align-items: start;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.nutrition-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin: 14px 0;
}
.nutrition-summary span {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-muted);
}
.nutrition-summary small { color: var(--muted); font-size: 9px; font-weight: 760; text-transform: uppercase; letter-spacing: .05em; }
.nutrition-summary strong { overflow-wrap: anywhere; }
.energy-value {
  min-width: 118px;
  display: grid;
  justify-items: end;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-muted);
  font-size: 25px;
  line-height: 1;
  text-align: right;
}
.energy-value small { display: block; margin-top: 0; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.food-card.is-archived { opacity: .68; }
.active-rations { margin-bottom: 2px; overflow: hidden; }
.food-card { overflow: hidden; }

.dog-feeding-grid {
  display: grid;
  grid-template-columns: minmax(260px, .75fr) minmax(0, 1.55fr);
  gap: 24px;
  margin-top: 8px;
}
.dog-feeding-grid.weight-only { grid-template-columns: minmax(0, 1fr); }
.dog-feeding-column {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--field-bg);
}
.dog-feeding-column > h3 { margin: 0; }
.weight-current {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: baseline;
  gap: 5px;
}
.weight-current strong { font-size: 38px; line-height: 1; color: var(--primary); }
.weight-current span { font-size: 14px; font-weight: 750; }
.weight-current small { justify-self: end; color: var(--muted); }
.mini-panel-form { display: grid; gap: 10px; }
.feeding-plan-list { display: grid; gap: 10px; }
.feeding-plan-list article {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.feeding-plan-list article > div { min-width: 0; }
.feeding-plan-summary { flex: 1 1 280px; }
.feeding-plan-actions {
  flex: 0 0 100%;
  justify-content: flex-end;
  margin-top: 2px;
}
.feeding-plan-actions .feeding-plan-editor[open] { flex: 0 0 100%; }
.feeding-plan-list h4 { margin: 4px 0; font-size: 16px; }
.feeding-plan-list p { margin: 4px 0; }
.feeding-plan-list small { color: var(--muted); }
.feeding-add-panel[open] { margin-top: 4px; }
.form-hint { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.plain-list { display: grid; gap: 7px; margin: 10px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 12px; }

@media (max-width: 1100px) {
  .nutrition-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nutrition-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dog-feeding-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .vaccination-card,
  .food-card,
  .active-rations { padding: 18px; }
  .section-head { grid-template-columns: 1fr; }
  .section-head > :last-child:not(:first-child) { justify-self: start; }
  .vaccination-head,
  .food-card-head { grid-template-columns: 1fr; }
  .vaccination-deadline,
  .energy-value { width: 100%; justify-items: start; text-align: left; }
  .compact-data-list { grid-template-columns: 1fr; }
  .nutrition-grid,
  .nutrition-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feeding-plan-list article { flex-direction: column; }
  .feeding-plan-actions { justify-content: flex-start; }
  .weight-current { grid-template-columns: auto auto; }
  .weight-current small { grid-column: 1 / -1; justify-self: start; }
}

/* Form-grid alignment and narrow-card reflow ---------------------------- */
.form-card,
.inline-editor > form,
.dog-feeding-column,
.mini-form {
  container-name: packos-form;
  container-type: inline-size;
}

@container packos-form (max-width: 430px) {
  .form-grid.three,
  .form-grid.five {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .form-grid.three > :last-child:nth-child(odd),
  .form-grid.five > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
  .nutrition-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container packos-form (max-width: 300px) {
  .form-grid.two,
  .form-grid.three,
  .form-grid.five,
  .nutrition-grid {
    grid-template-columns: 1fr;
  }
  .form-grid.three > :last-child:nth-child(odd),
  .form-grid.five > :last-child:nth-child(odd) {
    grid-column: auto;
  }
}

input[type="date"],
input[type="time"] {
  min-width: 0;
  padding-inline: 10px 7px;
}

@media (max-width: 820px) {
  .form-grid.two,
  .form-grid.three,
  .form-grid.five {
    grid-template-columns: 1fr;
  }
  .form-grid.three > :last-child:nth-child(odd),
  .form-grid.five > :last-child:nth-child(odd) {
    grid-column: auto;
  }
}

@media (max-width: 360px) {
  .nutrition-grid { grid-template-columns: 1fr; }
}


@media (max-width: 900px) {
  .auth-wrap.auth-login {
    justify-items: center;
    padding: 24px;
  }
  .auth-wrap.auth-login::before {
    background-position: 68% center;
    background-image:
      linear-gradient(180deg, rgba(243, 245, 249, 0.80) 0%, rgba(243, 245, 249, 0.58) 42%, rgba(243, 245, 249, 0.66) 100%),
      var(--auth-login-bg);
  }
  .auth-wrap.auth-login .auth-card {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}

/* Language selector ------------------------------------------------------- */
.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid color-mix(in srgb, var(--text) 18%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}
.language-switcher a {
  display: grid;
  place-items: center;
  min-width: 32px;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-decoration: none;
  color: var(--text);
  opacity: .62;
}
.language-switcher a:hover,
.language-switcher a.active {
  background: var(--primary);
  color: var(--on-primary);
  opacity: 1;
}
.sidebar-bottom .language-switcher { margin-bottom: 8px; align-self: flex-start; }
.auth-language-switcher { position: fixed; top: 18px; right: 18px; z-index: 20; }
.mobile-header .language-switcher { margin-left: auto; }
.language-switcher.compact a { min-width: 29px; min-height: 25px; padding: 0 6px; font-size: .66rem; }

/* Calendar time ---------------------------------------------------------- */
.overdue-schedule {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}
.overdue-schedule > * {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.overdue-schedule time:last-of-type {
  background: color-mix(in srgb, var(--critical) 8%, var(--surface));
  color: color-mix(in srgb, var(--critical) 82%, var(--text));
}

@media (min-width: 821px) {
  .mobile-header .language-switcher { display: none; }
}

/* Vaccination history grouped by dog ------------------------------------ */
.status-pill.warning { background: #fff1cf; color: #795619; }

.vaccination-dog-list { gap: 14px; }
.vaccination-dog-group {
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-left: 4px solid transparent;
}
.vaccination-dog-group.is-expired { border-left-color: var(--critical); }
.vaccination-dog-group.is-due-soon { border-left-color: #c98200; }
.vaccination-dog-group.is-ok { border-left-color: color-mix(in srgb, var(--primary) 24%, transparent); }

.vaccination-dog-summary {
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px 20px;
  padding: 20px 22px;
  cursor: pointer;
  user-select: none;
  transition: background .16s ease;
}
.vaccination-dog-summary::-webkit-details-marker { display: none; }
.vaccination-dog-summary:hover { background: var(--surface-muted); }
.vaccination-dog-summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 28%, transparent);
  outline-offset: -3px;
}
.vaccination-dog-identity { min-width: 0; }
.vaccination-dog-identity h2 {
  margin: 4px 0 2px;
  overflow-wrap: anywhere;
}
.vaccination-dog-identity p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.vaccination-dog-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}
.vaccination-group-chevron {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform .18s ease;
}
.vaccination-dog-group[open] .vaccination-group-chevron {
  transform: rotate(225deg) translate(-1px, -1px);
}
.vaccination-dog-body {
  display: grid;
  gap: 12px;
  padding: 0 18px 18px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--background) 34%, var(--surface));
}
.vaccination-card-nested {
  margin-top: 14px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: none;
}

@media (max-width: 620px) {
  .vaccination-dog-summary { grid-template-columns: 1fr; padding: 18px; }
  .vaccination-dog-status { justify-content: space-between; }
  .vaccination-dog-body { padding: 0 12px 12px; }
  .vaccination-card-nested { padding: 16px; }
}

/* Operational dashboard: vaccination and feeding widgets ---------------- */
.widget {
  container-name: dashboard-widget;
  container-type: inline-size;
}
.widget-metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.widget-metric {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-muted);
}
a.widget-metric { transition: border-color .16s ease, transform .16s ease; }
a.widget-metric:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  transform: translateY(-1px);
}
.widget-metric strong {
  min-width: 0;
  font-size: 24px;
  line-height: 1;
  overflow-wrap: anywhere;
}
.widget-metric span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: .055em;
}
.widget-metric.is-critical {
  border-color: color-mix(in srgb, var(--critical) 38%, var(--border));
  background: color-mix(in srgb, var(--critical) 7%, var(--surface));
}
.widget-metric.is-critical strong { color: color-mix(in srgb, var(--critical) 88%, var(--text)); }
.widget-metric.is-warning {
  border-color: color-mix(in srgb, #c98200 38%, var(--border));
  background: color-mix(in srgb, #c98200 8%, var(--surface));
}
.widget-metric.is-warning strong { color: #8c5c00; }

.widget-subsection {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}
.widget-subsection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
}
.widget-subsection-head > span:not(.status-pill) {
  color: var(--muted);
  font-weight: 800;
}
.dashboard-detail-list { display: grid; }
.dashboard-detail-list > a {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.dashboard-detail-list > a:last-child { border-bottom: 0; }
.dashboard-detail-list > a:hover strong { color: var(--accent); }
.dashboard-detail-list > a > span {
  min-width: 0;
  display: grid;
  gap: 1px;
}
.dashboard-detail-list strong,
.dashboard-detail-list small { overflow-wrap: anywhere; }
.dashboard-detail-list small { color: var(--muted); }
.dashboard-detail-list time {
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}
.dashboard-detail-list time.is-critical { color: var(--critical); }
.dashboard-detail-list time.is-warning { color: #8c5c00; }
.widget-footer-link {
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
}
.widget-footer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}
.widget-footer-actions .button.compact {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 11px;
}

.feeding-widget-list {
  display: grid;
  gap: 10px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}
.feeding-widget-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(150px, .45fr) minmax(0, 1.55fr);
  gap: 12px 18px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--field-bg);
}
.feeding-widget-row.has-warning {
  border-color: color-mix(in srgb, #c98200 34%, var(--border));
}
.feeding-widget-dog {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
}
.feeding-widget-dog > strong {
  font-size: 15px;
  overflow-wrap: anywhere;
}
.feeding-widget-dog > small { color: var(--muted); }
.feeding-widget-plans {
  min-width: 0;
  display: grid;
  gap: 6px;
}
.feeding-widget-plans > div {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.feeding-widget-plans > div:last-child { border-bottom: 0; }
.feeding-widget-plans > div > span {
  min-width: 0;
  display: grid;
  gap: 1px;
}
.feeding-widget-plans strong,
.feeding-widget-plans small { overflow-wrap: anywhere; }
.feeding-widget-plans small { color: var(--muted); }
.feeding-dose { justify-items: end; text-align: right; }
.feeding-dose > strong { white-space: nowrap; }

@container dashboard-widget (max-width: 560px) {
  .widget-metric-row { grid-template-columns: 1fr; }
  .feeding-widget-row { grid-template-columns: 1fr; }
  .feeding-widget-dog { padding-bottom: 8px; border-bottom: 1px solid var(--border); }
}

@container dashboard-widget (max-width: 390px) {
  .dashboard-detail-list > a,
  .feeding-widget-plans > div { grid-template-columns: 1fr; }
  .dashboard-detail-list time { justify-self: start; }
  .feeding-dose { justify-items: start; text-align: left; }
}

/* Timeline grouped by dog / litter / kennel-wide context. */
.timeline-group-list {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 14px;
}
.timeline-overview { padding: 20px 22px; }
.timeline-group {
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border-left: 4px solid color-mix(in srgb, var(--primary) 24%, transparent);
}
.timeline-group-general { border-left-color: var(--accent); }
.timeline-group-litter { border-left-color: color-mix(in srgb, var(--secondary) 64%, var(--accent)); }
.timeline-group-summary {
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  cursor: pointer;
  user-select: none;
  transition: background .16s ease;
}
.timeline-group-summary::-webkit-details-marker { display: none; }
.timeline-group-summary:hover { background: var(--surface-muted); }
.timeline-group-summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 32%, transparent);
  outline-offset: -3px;
}
.timeline-group-summary h2 { margin: 3px 0 2px; overflow-wrap: anywhere; }
.timeline-group-summary p { margin: 0; color: var(--muted); font-size: 12px; }
.timeline-group-summary-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
.timeline-group-chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .18s ease;
}
.timeline-group[open] .timeline-group-chevron { transform: rotate(225deg); }
.timeline-group-body {
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 98%, var(--background) 2%);
}
.timeline-group-body.timeline article { padding-inline: 20px; }

@media (max-width: 620px) {
  .timeline-overview { padding: 18px; }
  .timeline-group-summary {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 17px 18px;
  }
  .timeline-group-summary-side { justify-content: space-between; }
  .timeline-group-body.timeline article {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 16px 18px;
  }
}

/* Orders and shipping ----------------------------------------------------- */
.button.compact { min-height: 34px; padding: 8px 11px; font-size: 11px; }
.disabled-link { pointer-events: none; opacity: .45; }
.danger-zone { display: flex; justify-content: flex-end; margin-top: 24px; }
.client-detail-card,
.order-form-section,
.order-detail-card { padding: 24px; min-width: 0; }
.client-detail-card > .section-head,
.order-form-section > .section-head,
.order-detail-card > .section-head { margin-bottom: 20px; }
.compact-list { display: grid; padding: 0 24px 18px; }
.compact-list > div { display: grid; gap: 3px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.compact-list > div:last-child { border-bottom: 0; }
.compact-list small { color: var(--muted); }
.order-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.order-summary-grid > div { display: grid; gap: 4px; padding: 18px 20px; }
.order-summary-grid strong { font-size: 32px; letter-spacing: -.04em; }
.order-summary-grid span { color: var(--muted); font-size: 12px; font-weight: 700; }
.order-filters { display: grid; grid-template-columns: minmax(220px, 1.5fr) minmax(170px, .7fr) minmax(170px, .7fr) auto auto; gap: 12px; align-items: end; padding: 18px; margin-bottom: 18px; }
.order-filters label { display: grid; gap: 7px; }
.order-list-card { overflow: hidden; }
.orders-table td:first-child strong,
.orders-table td:nth-child(2) a { white-space: nowrap; }
.quick-order-status { display: flex; align-items: center; gap: 8px; min-width: 168px; margin: 0; }
.quick-order-status .custom-select { min-width: 168px; font-size: 12px; }
.quick-order-status .custom-select-trigger { min-height: 36px; padding: 8px 32px 8px 10px; border-radius: 10px; }
.quick-order-status .custom-select-chevron { right: 11px; }
.order-form { display: grid; gap: 18px; }
.order-code { padding: 8px 11px; border-radius: 10px; background: var(--surface-muted); font-size: 12px; letter-spacing: .05em; }
.order-items { display: grid; gap: 10px; }
.order-item-row { display: grid; grid-template-columns: minmax(220px, 2fr) minmax(90px, .55fr) minmax(120px, .75fr) minmax(180px, 1.2fr) 42px; gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-muted); }
.order-item-row label { display: grid; gap: 7px; min-width: 0; }
.order-item-row .icon-button { margin-bottom: 1px; }
.order-status-strip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -8px 0 22px; }
.order-status-strip > strong { margin-left: auto; font-size: 24px; }
.order-detail-card address { font-style: normal; line-height: 1.65; margin-bottom: 12px; }
.order-detail-card > p:last-child { margin-bottom: 0; }
.note-box { margin-top: 16px; padding: 14px; border-radius: 12px; background: var(--surface-muted); }
.note-box p { margin: 7px 0 0; }
.order-total-row td { border-top: 2px solid var(--border); }
.order-total-row td:first-child,
.order-grand-total td:first-child { text-align: right; font-weight: 800; }
.order-grand-total td { font-size: 16px; font-weight: 900; background: var(--surface-muted); }
.status-pill.request,
.status-pill.to_confirm,
.status-pill.partial,
.status-pill.due { background: #fff1cf; color: #795619; }
.status-pill.confirmed,
.status-pill.preparing,
.status-pill.ready { background: #e6edf8; color: #35527c; }
.status-pill.shipped { background: #e4eef5; color: #28536a; }
.status-pill.delivered,
.status-pill.paid { background: #dff2ea; color: #245e4d; }
.status-pill.cancelled,
.status-pill.refunded { background: #ececef; color: #666b73; }
.status-pill.not_required { background: var(--surface-muted); color: var(--muted); }

@media (max-width: 1180px) {
  .order-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-filters > :first-child { grid-column: 1 / -1; }
  .order-item-row { grid-template-columns: minmax(0, 1.7fr) minmax(90px, .5fr) minmax(120px, .7fr) 42px; }
  .order-item-row label:nth-of-type(4) { grid-column: 1 / -2; }
}

@media (max-width: 760px) {
  .client-detail-card,
  .order-form-section,
  .order-detail-card { padding: 18px; }
  .order-summary-grid,
  .order-filters { grid-template-columns: 1fr; }
  .order-filters > :first-child { grid-column: auto; }
  .order-item-row { grid-template-columns: 1fr 42px; }
  .order-item-row label { grid-column: 1 / -1; }
  .order-item-row .icon-button { grid-column: 2; grid-row: 1; justify-self: end; }
  .order-status-strip > strong { width: 100%; margin-left: 0; }
  .danger-zone .button { width: 100%; }
}

/* Select menus inside horizontally scrollable tables are rendered in a fixed
   portal so they cannot be clipped by overflow containers or create phantom
   table scrollbars while opening. */
.custom-select-menu.is-portaled {
  position: fixed;
  display: block;
  z-index: 1000;
  top: 0;
  left: 0;
  right: auto;
  bottom: auto;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-5px) scale(.985);
  transform-origin: top center;
}
.custom-select-menu.is-portaled.opens-upward {
  transform: translateY(5px) scale(.985);
  transform-origin: bottom center;
}
.custom-select-menu.is-portaled.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Order controls use the same design language as the rest of PackOS instead
   of looking like generic browser fields dropped into a logistics table. */
.custom-select--filter .custom-select-trigger {
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
}
.custom-select--primary .custom-select-trigger {
  border-color: color-mix(in srgb, var(--accent) 26%, var(--border));
  background: color-mix(in srgb, var(--accent) 4%, var(--field-bg));
}
.custom-select--status-field .custom-select-trigger {
  font-weight: 760;
}
.custom-select--compact .custom-select-trigger {
  font-weight: 800;
  letter-spacing: .035em;
}
.custom-select--status {
  --select-tone: var(--accent);
  display: inline-block;
  width: auto;
  min-width: 168px;
  font-size: 11px;
  font-weight: 820;
}
.custom-select--status .custom-select-trigger {
  min-height: 36px;
  border-radius: 999px;
  padding: 7px 34px 7px 12px;
  border-color: color-mix(in srgb, var(--select-tone) 30%, var(--border));
  background: color-mix(in srgb, var(--select-tone) 10%, var(--surface));
  color: color-mix(in srgb, var(--select-tone) 74%, var(--text));
  font-size: 11px;
  font-weight: 820;
  letter-spacing: .025em;
}
.custom-select--status .custom-select-chevron {
  right: 13px;
  width: 7px;
  height: 7px;
}
.custom-select--status .custom-select-trigger:hover,
.custom-select--status.is-open .custom-select-trigger,
.custom-select--status .custom-select-trigger:focus-visible {
  border-color: color-mix(in srgb, var(--select-tone) 62%, var(--border));
  background: color-mix(in srgb, var(--select-tone) 15%, var(--surface));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--select-tone) 11%, transparent);
}
.custom-select--status[data-value="request"] { --select-tone: #956d1d; }
.custom-select--status[data-value="to_confirm"] { --select-tone: #a86609; }
.custom-select--status[data-value="confirmed"] { --select-tone: #326f8a; }
.custom-select--status[data-value="preparing"] { --select-tone: var(--accent); }
.custom-select--status[data-value="ready"] { --select-tone: #2f7a58; }
.custom-select--status[data-value="shipped"] { --select-tone: #3d64a2; }
.custom-select--status[data-value="delivered"] { --select-tone: #28724f; }
.custom-select--status[data-value="cancelled"] { --select-tone: var(--danger); }
.custom-select--status[data-value="not_required"] { --select-tone: #6f7782; }
.custom-select--status[data-value="due"] { --select-tone: #a86609; }
.custom-select--status[data-value="partial"] { --select-tone: #b77712; }
.custom-select--status[data-value="paid"] { --select-tone: #2f7a58; }
.custom-select--status[data-value="refunded"] { --select-tone: #6f7782; }


/* PackOS 0.6 visual system ------------------------------------------------ */
.ui-icon,
.nav-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  background: var(--background);
  transition: grid-template-columns .22s ease;
}
html.sidebar-collapsed .app-shell { grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr); }

.sidebar {
  background:
    radial-gradient(circle at 12% 2%, rgba(255,255,255,.07), transparent 24%),
    linear-gradient(180deg, #18212B 0%, #141C24 100%);
  padding: 18px 14px;
  border-right: 1px solid rgba(255,255,255,.04);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}
.brand {
  position: relative;
  min-height: 58px;
  padding: 0 4px 17px;
  border-color: rgba(255,255,255,.08);
}
.brand-home { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.brand img,
.brand-mark { width: 44px; height: 44px; border-radius: 13px; padding: 6px; }
.brand-copy { min-width: 0; }
.brand-copy strong { font-size: 14px; }
.brand-copy span { color: rgba(255,255,255,.52); }
.sidebar-collapse-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.sidebar-collapse-toggle:hover {
  color: #fff;
  background: rgba(255,255,255,.075);
}
.sidebar-collapse-toggle .nav-icon {
  transition: transform .18s ease;
}
.sidebar-nav { display: grid; gap: 20px; margin-top: 18px; }
.nav-group { display: grid; gap: 4px; }
.nav-group-label {
  padding: 0 12px 6px;
  color: rgba(255,255,255,.34);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
  white-space: nowrap;
}
.sidebar nav { margin-top: 18px; gap: 20px; }
.sidebar nav a,
.sidebar-system-link {
  position: relative;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: rgba(255,255,255,.66);
  font-size: 13.5px;
  font-weight: 650;
}
.sidebar nav a::before,
.sidebar-system-link::before {
  content: "";
  position: absolute;
  left: -14px;
  width: 3px;
  height: 22px;
  border-radius: 0 5px 5px 0;
  background: transparent;
}
.sidebar nav a:hover,
.sidebar nav a.active,
.sidebar-system-link:hover,
.sidebar-system-link.active {
  color: #fff;
  background: rgba(255,255,255,.075);
}
.sidebar nav a.active::before,
.sidebar-system-link.active::before { background: var(--accent); }
.sidebar nav a.active .nav-icon { color: #fff; }
.sidebar-bottom { gap: 5px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.07); }
.sidebar-user { display: flex; align-items: center; gap: 10px; min-width: 0; margin-top: 8px; padding: 10px; }
.user-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}
.sidebar-user-copy,
.topbar-user-copy { min-width: 0; display: grid; line-height: 1.25; }
.sidebar-user-copy strong { color: #fff; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-copy small { padding: 0; color: rgba(255,255,255,.42); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

html.sidebar-collapsed .brand { justify-content: center; }
html.sidebar-collapsed .brand-home { justify-content: center; }
html.sidebar-collapsed .brand-copy,
html.sidebar-collapsed .nav-label,
html.sidebar-collapsed .nav-group-label,
html.sidebar-collapsed .sidebar-user-copy,
html.sidebar-collapsed .sidebar-bottom .language-switcher { display: none; }
html.sidebar-collapsed .sidebar nav a,
html.sidebar-collapsed .sidebar-system-link { justify-content: center; padding-inline: 8px; }
html.sidebar-collapsed .sidebar-user { justify-content: center; padding-inline: 0; }
html.sidebar-collapsed .sidebar-collapse-toggle .nav-icon { transform: rotate(180deg); }

.main-content { padding: 0 34px 64px; }
.content-shell { width: min(100%, 1600px); margin: 0 auto; padding-top: 32px; }
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 -34px;
  padding: 11px 34px;
  background: rgba(243,245,247,.86);
  border-bottom: 1px solid rgba(218,224,230,.86);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}
.topbar-leading,
.topbar-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-actions { align-self: center; }
.topbar-menu { display: none; }
.topbar-context { min-width: 0; display: grid; line-height: 1.2; }
.topbar-context span { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.topbar-context strong { margin-top: 3px; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-search {
  min-width: 250px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 9px 0 12px;
  color: var(--muted);
  background: rgba(255,255,255,.76);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
}
.topbar-search:hover { background: #fff; border-color: #ccd4dc; }
.topbar-search span { flex: 1; text-align: left; font-size: 13px; }
kbd {
  min-width: 24px;
  display: inline-grid;
  place-items: center;
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-bottom-color: #c8d0d7;
  border-radius: 7px;
  background: #fff;
  color: #697683;
  box-shadow: 0 1px 0 #d8dee4;
  font: 700 10px/1.2 Inter, sans-serif;
}
.button.compact { min-height: 40px; padding: 0 14px; }
.button .ui-icon,
.button .nav-icon { width: 17px; height: 17px; }
.topbar-user { display: flex; align-items: center; gap: 9px; padding: 3px 5px 3px 3px; border-radius: 12px; }
.topbar-user:hover { background: rgba(255,255,255,.72); }
.topbar-user-copy strong { max-width: 130px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-user-copy small { color: var(--muted); font-size: 10px; }
.quick-create {
  position: relative;
  display: flex;
  align-items: center;
  align-self: center;
  margin: 0;
}
.quick-create summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  margin: 0;
}
.quick-create summary.button.compact {
  min-height: 40px;
  padding-inline: 16px;
}
.quick-create summary::-webkit-details-marker { display: none; }
.quick-create-menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 60;
  width: 310px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-float);
}
.quick-create-menu a { display: flex; align-items: center; gap: 12px; padding: 11px; border-radius: 12px; }
.quick-create-menu a:hover { background: var(--surface-muted); }
.quick-create-menu a > .ui-icon { color: var(--accent); }
.quick-create-menu a span { display: grid; }
.quick-create-menu strong { font-size: 13px; }
.quick-create-menu small { margin-top: 2px; color: var(--muted); font-size: 11px; }

.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: clamp(30px, 3.4vw, 46px); letter-spacing: -.04em; }
.eyebrow { color: var(--accent); }
.card { box-shadow: var(--shadow); border-color: var(--border); }
.card:hover { border-color: #d9e0e6; }
.button { font-weight: 750; box-shadow: none; }
.button.primary { background: var(--primary); }
.button.primary:hover { background: #22303d; }
.button.secondary { background: #fff; border-color: var(--border); }
.form-card,
.admin-section { padding: 24px; }
input, select, textarea { background: var(--field-bg); border-color: #dce3e9; }
input:focus, select:focus, textarea:focus { border-color: color-mix(in srgb, var(--accent) 58%, #fff); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }

.table-wrap { border: 1px solid var(--border); border-radius: 15px; background: #fff; box-shadow: none; }
table { border-collapse: separate; border-spacing: 0; }
thead th { position: sticky; top: 0; z-index: 2; background: #f7f9fa; color: #687581; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #f8fafb; }
td, th { border-bottom-color: #edf0f3; }

.overview-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.overview-card {
  position: relative;
  min-height: 122px;
  display: grid;
  align-content: center;
  padding: 19px 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: #fff;
  box-shadow: var(--shadow-small);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.overview-card::after { content: ""; position: absolute; right: -26px; top: -34px; width: 92px; height: 92px; border-radius: 50%; background: rgba(24,33,43,.035); }
.overview-card:hover { transform: translateY(-2px); border-color: #cfd7de; box-shadow: var(--shadow); }
.overview-card span { color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; }
.overview-card strong { margin: 4px 0 1px; font-size: 34px; line-height: 1; letter-spacing: -.04em; }
.overview-card small { color: var(--muted); font-size: 11px; }
.overview-card.needs-attention { border-color: color-mix(in srgb, var(--critical) 24%, var(--border)); background: linear-gradient(135deg, #fff, var(--critical-soft)); }
.overview-card.needs-attention strong { color: var(--critical); }

.dashboard-grid { gap: 16px; }
.widget { box-shadow: var(--shadow-small); }
.widget-head { border-bottom-color: #edf0f3; }
.widget-head h2 { font-size: 13px; }
.big-number { letter-spacing: -.05em; }

.branding-modern-grid { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(300px, 1.2fr); gap: 18px; align-items: stretch; margin: 18px 0; }
.theme-preview { min-height: 112px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px; border: 1px solid var(--border); border-radius: 15px; background: linear-gradient(135deg, #f7f9fa, #fff); }
.theme-preview > div:first-child { display: grid; }
.theme-preview strong { margin: 4px 0 2px; }
.theme-preview small { color: var(--muted); }
.theme-swatches { display: flex; align-items: center; }
.theme-swatches span { width: 32px; height: 54px; margin-left: -6px; border: 3px solid #fff; border-radius: 11px; box-shadow: 0 5px 14px rgba(20,30,40,.08); }
.theme-swatches span:nth-child(1) { background: #18212B; }
.theme-swatches span:nth-child(2) { background: #5F6B78; }
.theme-swatches span:nth-child(3) { background: #3F6F8F; }
.theme-swatches span:nth-child(4) { background: #F3F5F7; }
.theme-swatches span:nth-child(5) { background: #FFFFFF; }

.command-palette { position: fixed; inset: 0; z-index: 200; display: grid; place-items: start center; padding: min(12vh, 110px) 18px 18px; }
.command-backdrop { position: absolute; inset: 0; border: 0; background: rgba(11,17,23,.48); backdrop-filter: blur(5px); }
.command-dialog { position: relative; width: min(640px, 100%); max-height: min(720px, 78vh); overflow: hidden; border: 1px solid rgba(255,255,255,.55); border-radius: 20px; background: #fff; box-shadow: 0 30px 100px rgba(9,15,21,.35); }
.command-search-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 13px 14px; border-bottom: 1px solid var(--border); }
.command-search-row > .ui-icon { color: var(--muted); }
.command-search-row input { min-height: 42px; padding: 0; border: 0; background: transparent; box-shadow: none; font-size: 16px; }
.command-search-row input:focus { box-shadow: none; }
.command-results { max-height: min(570px, 61vh); overflow-y: auto; padding: 9px; }
.command-results h2 { margin: 7px 10px 6px; color: var(--muted); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.command-results > a { display: grid; grid-template-columns: 24px minmax(0,1fr) 20px; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; }
.command-results > a:hover,
.command-results > a.is-selected { background: var(--surface-muted); }
.command-results > a > .ui-icon:first-child { color: var(--accent); }
.command-results > a > .ui-icon:last-child { color: #a0aab3; width: 16px; }
.command-results a span { min-width: 0; display: grid; }
.command-results strong { font-size: 13px; }
.command-results small { margin-top: 1px; color: var(--muted); font-size: 11px; }
.command-empty { padding: 28px; color: var(--muted); text-align: center; }
.command-footer { display: flex; gap: 18px; padding: 10px 14px; border-top: 1px solid var(--border); background: #f8fafb; color: var(--muted); font-size: 10px; }
.command-footer span { display: flex; align-items: center; gap: 4px; }
body.command-open { overflow: hidden; }

@media (max-width: 1100px) {
  .topbar-search { min-width: 42px; width: 42px; padding: 0; justify-content: center; }
  .topbar-search span,
  .topbar-search kbd,
  .topbar-user-copy { display: none; }
  .overview-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  html.sidebar-collapsed .app-shell,
  .app-shell { display: block; }
  .sidebar { width: min(300px, 88vw); padding: 18px 14px; }
  html.sidebar-collapsed .brand-copy,
  html.sidebar-collapsed .nav-label,
  html.sidebar-collapsed .nav-group-label,
  html.sidebar-collapsed .sidebar-user-copy,
  html.sidebar-collapsed .sidebar-bottom .language-switcher { display: initial; }
  html.sidebar-collapsed .sidebar nav a,
  html.sidebar-collapsed .sidebar-system-link { justify-content: flex-start; padding-inline: 12px; }
  html.sidebar-collapsed .sidebar-user { justify-content: flex-start; padding-inline: 10px; }
  .sidebar-collapse-toggle { display: none; }
  .topbar-menu { display: inline-grid; }
  .main-content { padding: 0 16px 50px; }
  .content-shell { padding-top: 22px; }
  .app-topbar { min-height: 62px; margin: 0 -16px; padding: 9px 16px; }
  .topbar-context span { display: none; }
  .topbar-actions { gap: 7px; }
  .quick-create summary span { display: none; }
  .quick-create summary { width: 40px; padding: 0; justify-content: center; }
  .quick-create-menu { position: fixed; top: 68px; right: 12px; width: min(330px, calc(100vw - 24px)); }
  .mobile-header { display: none; }
  .branding-modern-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .overview-strip { grid-template-columns: 1fr 1fr; gap: 9px; }
  .overview-card { min-height: 105px; padding: 15px; }
  .overview-card strong { font-size: 29px; }
  .topbar-user { display: none; }
  .page-head h1 { font-size: 34px; }
  .command-palette { padding: 10px; align-items: start; }
  .command-dialog { margin-top: 6vh; max-height: 84vh; border-radius: 17px; }
  .command-footer { display: none; }
  .theme-preview { align-items: flex-start; flex-direction: column; }
}

/* Secondary actions keep their label readable on the new white surface. */
.button.secondary {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
}
.button.secondary:hover {
  background: var(--surface-muted);
  border-color: #cfd7de;
}

.drag-handle {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  cursor: grab;
}
.drag-handle:hover,
.drag-handle:focus-visible { background: var(--surface-muted); color: var(--text); outline: none; }
.drag-handle:active { cursor: grabbing; }

@media (max-width: 1180px) and (min-width: 821px) {
  .dashboard-grid .widget { grid-column: span 4; }
  .dashboard-grid .widget.size-wide { grid-column: span 8; }
  .dashboard-grid .widget.size-large { grid-column: span 12; }
}

.flash-stack { pointer-events: none; }
.flash { pointer-events: auto; }
.flash.fade-out { pointer-events: none; }

.sidebar-bottom .language-switcher {
  width: min(100%, 240px);
  align-self: center;
  justify-content: center;
  margin-inline: auto;
  background: rgba(255,255,255,.055);
  border-color: rgba(255,255,255,.09);
}
.sidebar-bottom .language-switcher a {
  flex: 0 0 54px;
  justify-content: center;
}
.sidebar-bottom .language-switcher a { color: rgba(255,255,255,.58); }
.sidebar-bottom .language-switcher a:hover,
.sidebar-bottom .language-switcher a.active { background: rgba(255,255,255,.94); color: var(--primary); }

/* Litter growth chart ----------------------------------------------------- */
.growth-card { overflow: hidden; }
.growth-card .section-head { align-items: flex-start; }
.growth-card .section-head p { margin: 4px 0 0; }
.growth-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.growth-summary > span {
  min-width: 84px;
  display: grid;
  justify-items: end;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.growth-summary strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  letter-spacing: -.03em;
}
.growth-chart { margin-top: 18px; }
.growth-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.growth-legend-item {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, opacity .16s ease, transform .16s ease;
}
.growth-legend-item:hover {
  transform: translateY(-1px);
  border-color: #cbd4dc;
  background: var(--surface-muted);
}
.growth-legend-item:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 20%, transparent);
  outline-offset: 2px;
}
.growth-legend-item[aria-pressed="false"] { opacity: .42; }
.growth-legend-swatch {
  width: 22px;
  height: 4px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--series-color);
  box-shadow: 0 0 0 1px rgba(24,33,43,.08);
}
.growth-legend-copy { min-width: 0; display: grid; text-align: left; line-height: 1.15; }
.growth-legend-copy strong { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.growth-legend-copy small { max-width: 180px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 9px; }
.growth-plot-wrap {
  position: relative;
  min-height: 320px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--accent) 4%, transparent), transparent 30%),
    linear-gradient(180deg, #fff, #fbfcfd);
}
.growth-plot { width: 100%; height: auto; min-height: 320px; display: block; }
.growth-grid line { stroke: #e9edf1; stroke-width: 1; vector-effect: non-scaling-stroke; }
.growth-grid line.growth-grid-vertical { stroke: #f0f3f5; }
.growth-grid text,
.growth-axis-title,
.growth-empty-label {
  fill: #7a8793;
  font: 700 11px/1 Inter, ui-sans-serif, sans-serif;
}
.growth-axis-title { font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.growth-line,
.growth-line-halo {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.growth-line-halo { stroke: rgba(255,255,255,.94); stroke-width: 6; }
.growth-line { stroke-width: 3; }
.growth-point {
  stroke: #fff;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: r .12s ease;
}
.growth-point:hover,
.growth-point:focus { r: 7; outline: none; }
.growth-tooltip {
  position: absolute;
  z-index: 4;
  width: 168px;
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  background: rgba(24,33,43,.94);
  color: #fff;
  box-shadow: 0 14px 38px rgba(8,15,24,.24);
  pointer-events: none;
  backdrop-filter: blur(8px);
}
.growth-tooltip strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.growth-tooltip span { color: rgba(255,255,255,.62); font-size: 10px; }
.growth-tooltip b { margin-top: 2px; font-size: 15px; }
.growth-help { display: block; margin-top: 10px; }

@media (max-width: 720px) {
  .growth-card .section-head { display: grid; gap: 12px; }
  .growth-summary { justify-content: flex-start; }
  .growth-summary > span { justify-items: start; }
  .growth-legend { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  .growth-legend-item { flex: 0 0 auto; }
  .growth-plot-wrap { min-height: 270px; overflow-x: auto; }
  .growth-plot { min-width: 720px; min-height: 270px; }
}

/* Pack membership -------------------------------------------------------- */
.pack-view-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 18px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}
.pack-view-switch a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.pack-view-switch a:hover { color: var(--text); background: var(--surface-muted); }
.pack-view-switch a.active { color: #fff; background: var(--primary); }
.status-pill.present { background: #dff2ea; color: #245e4d; }
.status-pill.departed { background: #e7edf3; color: #42566a; }
.puppy-status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
}
.puppy-pack-actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.puppy-pack-actions .text-button { justify-self: center; }
.puppy-membership-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  background: linear-gradient(135deg, #f8fafb, #fff);
}
.puppy-membership-card h2 { margin: 4px 0; }
.puppy-membership-card p { margin: 0; color: var(--muted); }
@media (max-width: 680px) {
  .pack-view-switch { width: 100%; }
  .pack-view-switch a { flex: 1; }
  .puppy-membership-card { align-items: flex-start; flex-direction: column; }
}


/* Dog directory grouping ------------------------------------------------- */
.dog-directory-section { margin-top: 30px; }
.dog-directory-section:first-of-type { margin-top: 10px; }
.directory-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--border);
}
.directory-section-head h2 { margin: 3px 0 2px; font-size: 22px; letter-spacing: -.025em; }
.directory-section-head p { margin: 0; color: var(--muted); font-size: 13px; }
.directory-count {
  min-width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}
.puppy-directory-section { margin-top: 42px; }
.litter-pack-list { display: grid; gap: 18px; }
.litter-pack-group {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 96%, var(--accent) 4%), var(--surface));
  box-shadow: var(--shadow-small);
}
.litter-pack-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 0 2px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
}
.litter-pack-head h3 { margin: 3px 0 2px; font-size: 18px; letter-spacing: -.02em; }
.litter-pack-head p { margin: 0; color: var(--muted); font-size: 12px; }
.litter-puppy-count {
  flex: 0 0 auto;
  padding: 7px 11px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}
.puppy-dog-card { border-color: color-mix(in srgb, var(--accent) 14%, var(--border)); }
.puppy-dog-card:hover { border-color: color-mix(in srgb, var(--accent) 42%, var(--border)); }

@media (max-width: 680px) {
  .directory-section-head,
  .litter-pack-head { align-items: flex-start; }
  .litter-pack-group { padding: 14px; }
  .litter-puppy-count { white-space: nowrap; }
}

/* Active timeline: resident dogs and current litters are separate operational contexts. */
.timeline-section {
  min-width: 0;
  display: grid;
  gap: 12px;
  margin-top: 4px;
}
.timeline-section + .timeline-section {
  margin-top: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.timeline-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 4px 4px 2px;
}
.timeline-section-head h2 { margin: 3px 0 2px; }
.timeline-section-head p { margin: 0; color: var(--muted); font-size: 13px; }
.timeline-section-count {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--primary);
  font-weight: 800;
  font-size: 12px;
}
.timeline-group-resident { border-left-color: color-mix(in srgb, var(--primary) 72%, var(--secondary)); }
.timeline-section-litters .timeline-group { border-left-color: color-mix(in srgb, var(--secondary) 58%, var(--accent)); }

@media (max-width: 620px) {
  .timeline-section-head { align-items: flex-start; }
}

/* Vet Check / VeterinAI */
.virgil-card {
  position: relative;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 10%, transparent), transparent 42%),
    var(--surface);
}
.virgil-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent);
}
.virgil-head,
.virgil-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.virgil-scope { margin: 12px 0 16px; color: var(--muted); }
.virgil-warning { margin: 0 0 16px; }
.virgil-ai-disclosure {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  border-radius: 13px;
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}
.virgil-ai-disclosure p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.vet-check-guide-dialog { width: min(720px, calc(100vw - 32px)); }
.vet-check-guide-content { display: grid; gap: 20px; }
.vet-check-guide-content section { display: grid; gap: 7px; }
.vet-check-guide-content h3 { margin: 0; font-size: 1rem; }
.vet-check-guide-content p { margin: 0; color: var(--muted); line-height: 1.6; }
.vet-check-guide-content strong { color: var(--text); }

.virgil-analysis-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 88%, var(--background));
}
.virgil-analysis-summary > div { display: grid; gap: 3px; }
.virgil-analysis-summary span,
.virgil-actions small { color: var(--muted); font-size: 12px; }
.virgil-stale-note { margin-top: 10px; }
.virgil-answer { line-height: 1.62; overflow-wrap: anywhere; }
.virgil-empty { margin: 14px 0; }
.virgil-actions { margin-top: 16px; align-items: flex-end; }
.virgil-actions form { margin: 0; }
.virgil-actions small { text-align: right; }
.virgil-analysis-dialog {
  width: min(860px, calc(100vw - 32px));
  max-width: 860px;
  max-height: min(88vh, 920px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 100px rgba(9,15,21,.38);
}
.virgil-analysis-dialog::backdrop {
  background: rgba(11,17,23,.52);
  backdrop-filter: blur(5px);
}
.virgil-dialog-shell {
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 920px);
}
.virgil-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 11%, transparent), transparent 48%),
    var(--surface);
}
.virgil-dialog-head h2 { margin: 2px 0 0; }
.virgil-dialog-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.virgil-dialog-shell > .clinical-note { margin: 14px 22px 0; }
.virgil-dialog-content {
  min-height: 0;
  overflow-y: auto;
  padding: 22px;
}
body.virgil-dialog-open { overflow: hidden; }
.virgil-conversation-launch {
  display: flex;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.virgil-conversation-launch .button { width: 100%; }
.virgil-chat-dialog { width: min(1040px, calc(100vw - 32px)); max-width: 1040px; }
.virgil-chat-dialog-content {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 22px 22px;
}
.veterinai-chat-head-actions { display: flex; align-items: center; gap: 10px; }
.veterinai-chat-head-actions form { margin: 0; }
.veterinai-workspace {
  display: grid;
  grid-template-columns: minmax(210px, 250px) minmax(0, 1fr);
  min-height: 0;
  flex: 1;
}
.veterinai-conversation-archive {
  min-height: 0;
  overflow-y: auto;
  padding: 18px 14px;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--background) 72%, var(--surface));
}
.veterinai-archive-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px 12px;
}
.veterinai-archive-head small { color: var(--muted); }
.veterinai-conversation-list { display: grid; gap: 8px; }
.veterinai-conversation-item {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  background: transparent;
}
.veterinai-conversation-item:hover { border-color: var(--border); background: var(--surface); }
.veterinai-conversation-item.selected {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}
.veterinai-conversation-item strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.veterinai-conversation-item > span { color: var(--muted); font-size: 10px; }
.veterinai-conversation-item .status-pill { justify-self: start; padding: 4px 7px; font-size: 9px; }
.compact-copy { margin: 8px 4px; font-size: 12px; }
.veterinai-selected-conversation-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.veterinai-selected-conversation-head > div:first-child { display: grid; gap: 4px; min-width: 0; }
.veterinai-selected-conversation-head strong { overflow-wrap: anywhere; }
.veterinai-selected-conversation-head span { color: var(--muted); font-size: 11px; }
.veterinai-selected-conversation-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.veterinai-selected-conversation-actions form { margin: 0; }
.veterinai-selected-conversation-actions .text-button { white-space: nowrap; }
.memory-pill {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent) !important;
  font-size: 9px !important;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.veterinai-archived-note { display: grid; gap: 10px; margin-top: 16px; }
.veterinai-archived-note p { margin: 0; }
.veterinai-archived-note form { margin: 0; }
.virgil-messages {
  display: grid;
  gap: 10px;
  max-height: min(48vh, 520px);
  overflow: auto;
  margin: 16px 0;
  padding-right: 4px;
}
.virgil-message {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--background);
}
.virgil-message.role-user {
  margin-left: 10%;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}
.virgil-message.role-assistant { margin-right: 6%; }
.virgil-message > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.virgil-message > div { line-height: 1.55; overflow-wrap: anywhere; }
.virgil-chat-form { display: grid; gap: 10px; margin-top: 16px; }
.virgil-chat-form label { display: grid; gap: 7px; }
.virgil-chat-form textarea { min-height: 110px; resize: vertical; }
.button:disabled,
button:disabled { cursor: not-allowed; opacity: .48; }
@media (max-width: 700px) {
  .virgil-head,
  .virgil-actions { align-items: flex-start; flex-direction: column; }
  .virgil-ai-disclosure { align-items: flex-start; flex-direction: column; }
  .virgil-ai-disclosure .button { width: 100%; }
  .veterinai-chat-head { align-items: stretch; }
  .veterinai-chat-head-actions { justify-content: space-between; }
  .veterinai-workspace { grid-template-columns: 1fr; }
  .veterinai-conversation-archive {
    max-height: 190px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .veterinai-conversation-list { grid-auto-flow: column; grid-auto-columns: minmax(190px, 75vw); overflow-x: auto; }
  .veterinai-selected-conversation-head { align-items: stretch; flex-direction: column; }
  .veterinai-selected-conversation-actions { justify-content: space-between; }
  .virgil-analysis-summary { align-items: stretch; flex-direction: column; }
  .virgil-analysis-summary .button { width: 100%; }
  .virgil-actions small { text-align: left; }
  .virgil-analysis-dialog { width: calc(100vw - 20px); max-height: 92vh; border-radius: 16px; }
  .virgil-dialog-shell { max-height: 92vh; }
  .virgil-dialog-head { padding: 17px 16px 14px; }
  .virgil-dialog-shell > .clinical-note { margin: 12px 16px 0; }
  .virgil-dialog-content,
  .virgil-chat-dialog-content { padding: 18px 16px; }
  .virgil-message.role-user,
  .virgil-message.role-assistant { margin-left: 0; margin-right: 0; }
}

/* Safe Markdown rendering for Virgil output */
.virgil-markdown {
  line-height: 1.66;
  overflow-wrap: anywhere;
}
.virgil-markdown > :first-child { margin-top: 0; }
.virgil-markdown > :last-child { margin-bottom: 0; }
.virgil-markdown p { margin: 0 0 1em; }
.virgil-markdown h3,
.virgil-markdown h4,
.virgil-markdown h5,
.virgil-markdown h6 {
  margin: 1.35em 0 .55em;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -.015em;
}
.virgil-markdown h3 { font-size: 1.22rem; }
.virgil-markdown h4 { font-size: 1.08rem; }
.virgil-markdown h5,
.virgil-markdown h6 { font-size: 1rem; }
.virgil-markdown strong { color: var(--text); font-weight: 800; }
.virgil-markdown em { color: color-mix(in srgb, var(--text) 82%, var(--muted)); }
.virgil-markdown ul,
.virgil-markdown ol {
  margin: .15em 0 1em;
  padding-left: 1.45em;
}
.virgil-markdown li { margin: .34em 0; padding-left: .15em; }
.virgil-markdown li::marker { color: var(--accent); font-weight: 800; }
.virgil-markdown blockquote {
  margin: 1em 0;
  padding: .8em 1em;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: color-mix(in srgb, var(--accent) 6%, var(--background));
  color: var(--muted);
}
.virgil-markdown blockquote p { margin: 0; }
.virgil-markdown hr {
  height: 1px;
  margin: 1.4em 0;
  border: 0;
  background: var(--border);
}
.virgil-markdown code {
  padding: .12em .38em;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--background);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .9em;
}
.virgil-markdown pre {
  overflow: auto;
  margin: 1em 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--background);
}
.virgil-markdown pre code {
  padding: 0;
  border: 0;
  background: transparent;
  white-space: pre;
}

/* Generic PackOS dialogs and puppy reservations */
.packos-dialog {
  width: min(860px, calc(100vw - 32px));
  max-width: 860px;
  max-height: min(88vh, 920px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 100px rgba(9,15,21,.38);
}
.packos-dialog::backdrop {
  background: rgba(11,17,23,.52);
  backdrop-filter: blur(5px);
}
.packos-dialog-shell {
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 920px);
}
.packos-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 9%, transparent), transparent 48%),
    var(--surface);
}
.packos-dialog-head h2 { margin: 2px 0 0; }
.packos-dialog-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.packos-dialog-content {
  min-height: 0;
  overflow-y: auto;
  padding: 22px;
}
body.packos-dialog-open { overflow: hidden; }
.button-count {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
}
.view-tabs {
  display: inline-flex;
  gap: 5px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.view-tabs a {
  padding: 8px 13px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}
.view-tabs a.active {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent);
}
.reservation-list { display: grid; gap: 14px; }
.reservation-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 0;
  padding: 0;
  overflow: hidden;
}
.reservation-card-main {
  min-width: 0;
  padding: 22px 24px 24px;
}
.reservation-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
}
.reservation-card-head h2 { margin: 7px 0 0; }
.reservation-card-head h2 a { color: inherit; text-decoration: none; }
.reservation-card-head time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.reservation-card .compact-data-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 22px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
.reservation-card .compact-data-list > div {
  display: grid;
  align-content: start;
  justify-content: stretch;
  gap: 5px;
  min-width: 0;
  padding: 14px 0 4px;
  border-bottom: 0;
}
.reservation-card .compact-data-list dt {
  font-size: 11px;
  font-weight: 720;
}
.reservation-card .compact-data-list dd {
  text-align: left;
  line-height: 1.45;
}
.reservation-card-actions {
  display: grid;
  align-content: start;
  gap: 0;
  min-width: 0;
  padding: 0;
  border-left: 1px solid var(--border);
  background: color-mix(in srgb, var(--background) 56%, var(--surface));
}
.reservation-actions-title {
  margin: 0;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.3;
}
.reservation-action-section {
  min-width: 0;
  display: grid;
  gap: 13px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.reservation-card-actions > :last-child { border-bottom: 0; }
.reservation-action-heading h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .01em;
}
.reservation-action-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.reservation-card-actions form { margin: 0; }
.reservation-association-form,
.reservation-status-actions { display: grid; gap: 10px; }
.reservation-association-form > label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}
.reservation-card-actions .button { width: 100%; }
.reservation-status-actions form { width: 100%; }
.reservation-cancel-action {
  width: 100%;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 8px 12px;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font-size: 11px;
  font-weight: 760;
  transition: background .16s ease, border-color .16s ease;
}
.reservation-cancel-action:hover {
  border-color: color-mix(in srgb, var(--danger) 18%, transparent);
  background: color-mix(in srgb, var(--danger) 7%, transparent);
}
.reservation-cancel-action:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--danger) 18%, transparent);
  outline-offset: 2px;
}
.reservation-notes {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--background) 78%, var(--surface));
  white-space: pre-line;
}
.reservation-edit-launcher { gap: 0; }
.reservation-completion-summary {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: color-mix(in srgb, var(--background) 72%, var(--surface));
}
.reservation-completion-summary span { color: var(--muted); font-size: 12px; }
.status-pill.reservation-confirmed { background: #e6edf8; color: #35527c; }
.status-pill.reservation-fulfilled { background: #dff2ea; color: #245e4d; }
.status-pill.reservation-cancelled { background: #ececef; color: #666b73; }
.litter-reservation-content { display: grid; gap: 22px; }
.litter-reservation-list { display: grid; gap: 10px; }
.litter-reservation-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: color-mix(in srgb, var(--background) 72%, var(--surface));
}
.litter-reservation-row > div { display: grid; gap: 4px; min-width: 0; }
.litter-reservation-row span { color: var(--muted); font-size: 11px; }
.litter-reservation-row p { margin: 5px 0 0; white-space: pre-line; }
.litter-reservation-row form { flex: 0 0 auto; margin: 0; }
.litter-reservation-attach {
  display: grid;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.litter-reservation-attach h3 { margin: 0 0 3px; }
.litter-reservation-attach p { margin: 0; }
.litter-reservation-attach form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin: 0;
}
@media (max-width: 1080px) {
  .reservation-card { grid-template-columns: 1fr; }
  .reservation-card-actions {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
  .reservation-card .compact-data-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .packos-dialog { width: calc(100vw - 20px); max-height: 92vh; border-radius: 16px; }
  .packos-dialog-shell { max-height: 92vh; }
  .packos-dialog-head { padding: 17px 16px 14px; }
  .packos-dialog-content { padding: 18px 16px; }
  .reservation-card-main { padding: 18px 17px 20px; }
  .reservation-card-head { flex-direction: column; gap: 8px; }
  .reservation-card .compact-data-list { grid-template-columns: 1fr; gap: 0; }
  .reservation-card .compact-data-list > div {
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
  }
  .reservation-card .compact-data-list > div:last-child { border-bottom: 0; }
  .litter-reservation-row { align-items: stretch; flex-direction: column; }
  .litter-reservation-attach form { grid-template-columns: 1fr; }
}

/* Client directory ------------------------------------------------------ */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.clients-layout > * { min-width: 0; }
.client-directory-card {
  min-width: 0;
  padding: 0;
  overflow: hidden;
}
.client-directory-head {
  display: grid;
  gap: 18px;
  padding: 22px 24px 20px;
  border-bottom: 1px solid var(--border);
}
.client-directory-head h2 { margin: 3px 0 2px; }
.client-directory-head p { margin: 0; color: var(--muted); font-size: 13px; }
.client-search {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 9px;
  align-items: center;
}
.client-search input { width: 100%; min-width: 0; }
.client-directory { display: grid; }
.client-alpha-group {
  min-width: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  border-bottom: 1px solid var(--border);
}
.client-alpha-group:last-child { border-bottom: 0; }
.client-alpha-marker {
  display: grid;
  align-content: start;
  justify-content: center;
  padding: 18px 8px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .08em;
  border-right: 1px solid var(--border);
}
.client-list { min-width: 0; display: grid; }
.client-list-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "main actions"
    "metrics actions";
  gap: 10px 20px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.client-list-row:last-child { border-bottom: 0; }
.client-list-row:hover { background: color-mix(in srgb, var(--accent) 3%, var(--surface)); }
.client-list-main { grid-area: main; min-width: 0; display: grid; gap: 6px; }
.client-list-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.client-list-title > a {
  min-width: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 850;
  letter-spacing: -.015em;
  overflow-wrap: anywhere;
}
.client-list-title > a:hover { color: var(--accent); }
.client-list-contact {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 14px;
  color: var(--muted);
  font-size: 12px;
}
.client-list-contact span { min-width: 0; overflow-wrap: anywhere; }
.client-list-contact span + span::before {
  content: "·";
  margin-right: 14px;
  color: color-mix(in srgb, var(--muted) 55%, transparent);
}
.client-list-metrics {
  grid-area: metrics;
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.client-list-metrics span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.client-list-metrics strong { color: var(--text); font-size: 12px; letter-spacing: 0; }
.client-list-actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.client-directory-empty { margin: 0; padding: 34px 24px; border: 0; box-shadow: none; }
.client-directory-empty h3 { margin: 0 0 6px; }
.client-directory-empty p { margin: 0 0 16px; color: var(--muted); }

@media (max-width: 1120px) {
  .client-list-row {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "main" "metrics" "actions";
  }
  .client-list-actions { justify-content: flex-start; }
}

@media (max-width: 680px) {
  .client-directory-head { padding: 18px; }
  .client-search { grid-template-columns: minmax(0, 1fr) auto; }
  .client-search .button.ghost { grid-column: 1 / -1; width: 100%; }
  .client-alpha-group { grid-template-columns: 34px minmax(0, 1fr); }
  .client-alpha-marker { padding: 16px 6px; }
  .client-list-row { padding: 15px 14px; }
  .client-list-contact { display: grid; gap: 4px; }
  .client-list-contact span + span::before { content: none; }
  .client-list-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .client-list-actions .button { width: 100%; }
}

/* PackOS 0.8.21 · Platform administration */
.password-change-shell {
  min-height: calc(100vh - 190px);
  display: grid;
  place-items: center;
  padding: 28px 0;
}
.password-change-card {
  width: min(560px, 100%);
  padding: clamp(24px, 4vw, 38px);
}
.password-change-card h1 {
  margin: 6px 0 12px;
  font-size: clamp(30px, 4vw, 42px);
  letter-spacing: -.035em;
}
.password-change-card > p { margin: 0 0 24px; color: var(--muted); line-height: 1.65; }
.password-change-card form { display: grid; gap: 16px; }

.platform-page-head { align-items: flex-end; }
.platform-credentials {
  margin-bottom: 20px;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr);
  gap: 28px;
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}
.platform-credentials h2 { margin: 5px 0 8px; }
.platform-credentials p { margin: 0; color: var(--muted); line-height: 1.55; }
.platform-credential-grid { display: grid; gap: 12px; align-content: center; }
.platform-credential-grid input { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

.platform-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.platform-summary .card { padding: 18px 20px; display: grid; gap: 7px; }
.platform-summary span { color: var(--muted); font-size: 12px; font-weight: 700; }
.platform-summary strong { font-size: 30px; line-height: 1; letter-spacing: -.04em; }

.platform-create-card,
.platform-kennels-card {
  margin-bottom: 20px;
  padding: 24px;
}
.platform-create-head,
.platform-kennels-head { margin-bottom: 20px; }
.platform-create-head h2,
.platform-kennels-head h2 { margin-top: 5px; }
.platform-create-head p {
  max-width: 760px;
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.55;
}
.platform-create-form { display: grid; gap: 22px; }
.platform-create-fields { margin: 0; }
.platform-module-fieldset {
  min-width: 0;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-muted);
}
.platform-module-fieldset legend {
  padding: 0 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}
.platform-module-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 4px 0 0;
}
.platform-create-actions {
  margin-top: 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.platform-create-actions .button { min-width: 240px; }

.platform-kennel-list { display: grid; gap: 14px; }
.platform-kennel-row {
  min-width: 0;
  padding: 20px;
  display: grid;
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  scroll-margin-top: 90px;
}
.platform-kennel-row.is-suspended { background: var(--surface-muted); }
.platform-kennel-header {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.platform-kennel-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
}
.platform-kennel-title h3 { margin: 0 0 3px; font-size: 18px; }
.platform-kennel-title p { margin: 0; color: var(--muted); font-size: 13px; }
.platform-kennel-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 850;
}
.platform-kennel-row.is-suspended .platform-kennel-mark { background: var(--secondary); }
.platform-kennel-status {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 12px;
  text-align: right;
}
.platform-kennel-status .field-help { max-width: 230px; }
.platform-kennel-meta {
  min-width: 0;
  margin: 0;
  padding: 16px 0;
  display: grid;
  grid-template-columns: minmax(210px, 1.3fr) minmax(110px, .65fr) minmax(165px, .9fr) minmax(210px, 1fr);
  gap: 14px 28px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.platform-kennel-meta div { min-width: 0; }
.platform-kennel-meta dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.platform-kennel-meta dd {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.platform-kennel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}
.platform-kennel-actions form { margin: 0; }
.platform-kennel-actions .button { min-width: 130px; }
.platform-kennel-actions .button.danger {
  background: transparent;
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 38%, var(--border));
}
.platform-kennel-actions .button.danger:hover {
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}
.platform-first-access {
  color: #795619;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
}
.platform-edit-dialog { width: min(940px, calc(100vw - 28px)); }
.platform-edit-form { display: grid; gap: 22px; }
.platform-edit-actions {
  margin-top: 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
@media (max-width: 1180px) {
  .platform-module-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .platform-kennel-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .platform-credentials { grid-template-columns: 1fr; }
  .platform-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .platform-module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .platform-create-card,
  .platform-kennels-card { padding: 20px; }
  .platform-kennel-header { display: grid; }
  .platform-kennel-status { justify-content: flex-start; text-align: left; }
  .platform-credentials { padding: 20px; }
}

@media (max-width: 520px) {
  .platform-summary,
  .platform-module-grid,
  .platform-kennel-meta { grid-template-columns: 1fr; }
  .platform-create-card,
  .platform-kennels-card,
  .platform-kennel-row { padding: 16px; }
  .platform-create-actions .button,
  .platform-kennel-actions form,
  .platform-kennel-actions .button { width: 100%; min-width: 0; }
}
