/* AUNOR Web · views that act on the app's group and alert routes
   (premium-alerts.js and the ones after it). Built on premium.css' tokens. */

:root {
  --alarm: #d92d20;
  --alarm-soft: #fdecea;
  --warn: #b25e09;
  --warn-soft: #fff4e5;
  --calm: #1f6f8b;
  --calm-soft: #e7f2f6;
  --violet: #6d4bc3;
  --violet-soft: #f0ebfb;
}

.portal-icon { flex: 0 0 auto; display: block; }

/* Sidebar: badge with the live-alert count ------------------------------- */
.nav-link[data-view="alerts"]::before { content: "!"; }
.sidebar .nav-link-badged { grid-template-columns: 24px 1fr auto; }
.nav-badge {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  color: #fff;
  background: var(--alarm);
  font: 800 10px/1 var(--body);
  box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.22);
}

.icon-text-button { display: inline-flex; align-items: center; gap: 6px; }
.button[aria-busy="true"] .portal-icon { display: none; }
.text-button { display: inline-flex; align-items: center; gap: 5px; }
.text-button[href] { text-decoration: none; }

/* Heading ---------------------------------------------------------------- */
.alerts-filter { width: auto; min-width: 190px; min-height: 38px; padding: 7px 10px; font-size: 12px; }

.alerts-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}
.alerts-stat {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 11px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.alerts-stat-icon {
  grid-row: 1 / 3;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--muted);
  background: var(--ground);
}
.alerts-stat strong { font: 800 24px/1 var(--display); }
.alerts-stat small { color: var(--muted); font: 600 11px/1.3 var(--body); }
.alerts-stat.is-alarm { border-color: rgba(217, 45, 32, 0.35); background: linear-gradient(135deg, var(--paper), var(--alarm-soft)); }
.alerts-stat.is-alarm .alerts-stat-icon { color: #fff; background: var(--alarm); }
.alerts-stat.is-alarm strong { color: var(--alarm); }
.alerts-stat.is-calm .alerts-stat-icon { color: var(--success); background: var(--success-soft); }
.alerts-stat.is-warn .alerts-stat-icon { color: var(--warn); background: var(--warn-soft); }
.alerts-tabs { max-width: 360px; margin-bottom: 16px; }

/* List + detail ------------------------------------------------------------ */
.alerts-layout {
  display: grid;
  grid-template-columns: minmax(290px, 370px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.alerts-list { display: grid; gap: 8px; }

.alert-row {
  --tone: var(--alarm);
  --tone-soft: var(--alarm-soft);
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--paper);
  text-align: left;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}
.alert-row:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.alert-row.is-selected { border-color: var(--tone); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 16%, transparent); }
.alert-row.is-live { border-left: 4px solid var(--tone); }
.tone-warning { --tone: var(--warn); --tone-soft: var(--warn-soft); }
.tone-violet { --tone: var(--violet); --tone-soft: var(--violet-soft); }
.tone-calm { --tone: var(--calm); --tone-soft: var(--calm-soft); }
.alert-row-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--tone);
  background: var(--tone-soft);
}
.alert-row.is-live .alert-row-icon { color: #fff; background: var(--tone); }
.alert-row-body { min-width: 0; display: grid; gap: 4px; }
.alert-row-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.alert-row-top strong { overflow: hidden; font-size: 13px; line-height: 1.3; text-overflow: ellipsis; }
.alert-row-meta { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.alert-row-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }

.alert-status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border-radius: 4px;
  color: var(--muted);
  background: var(--ground);
  font: 700 9px/1 var(--utility);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.alert-status.live { color: #fff; background: var(--alarm); }
.alert-status.live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--paper);
  animation: alert-pulse 1.4s ease-in-out infinite;
}
.alert-status.closed { color: var(--success); background: var(--success-soft); }
@keyframes alert-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.7); } }

.alert-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--ground);
  font-size: 10.5px;
  font-weight: 600;
}
.alert-chip.is-low, .alert-chip.is-offline { color: var(--warn); background: var(--warn-soft); }
.alert-chip.is-new { color: #fff; background: var(--ink); }

.alerts-calm {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 18px 18px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  text-align: center;
}
.alerts-calm img { width: min(100%, 300px); height: auto; aspect-ratio: 4 / 3; object-fit: cover; margin-bottom: 6px; border-radius: 12px; }
.alerts-calm strong { font: 800 17px/1.2 var(--display); }
.alerts-calm span { max-width: 300px; color: var(--muted); font-size: 12px; }

.alert-detail {
  position: sticky;
  top: 18px;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}
.alert-detail:focus { outline: none; }
.alert-detail-empty {
  min-height: 420px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}
.alert-detail-empty strong { color: var(--ink); font-size: 14px; }
.alert-detail-empty span { max-width: 340px; font-size: 12px; }
.alert-detail > .transport-loading, .alert-detail > .empty-state { margin: 18px; }

.alert-sheet { display: grid; gap: 14px; padding: 20px; }
.alert-back { display: none; justify-self: start; margin: -6px 0 -4px -8px; }
.alert-sheet-head { --tone: var(--alarm); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.alert-sheet-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: var(--tone, var(--alarm));
}
.alert-sheet-title .eyebrow { margin-bottom: 4px; color: var(--tone, var(--alarm)); }
.alert-sheet-title h3 { margin: 0 0 4px; font: 800 21px/1.15 var(--display); letter-spacing: -0.02em; }
.alert-sheet-title p { margin: 0; color: var(--muted); font-size: 12px; }

.alert-banner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 13px 14px;
  border-radius: var(--radius);
  font-size: 12px;
}
.alert-banner strong { display: block; margin-bottom: 2px; font-size: 13px; }
.alert-banner p { margin: 0; }
.alert-banner.is-duress { color: #fff; background: var(--alarm); }
.alert-banner.is-closed { color: var(--ink-0f5a42, #0f5a42); background: var(--success-soft); }
.alert-banner.is-notice { color: var(--warn); background: var(--warn-soft); }
.alert-close-note { margin-top: 6px !important; font-style: italic; }

.alert-map-card { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--ground-deep); }
.alert-map { height: clamp(260px, 38vh, 380px); }
.alert-map-empty {
  min-height: 180px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}
.map-recenter {
  position: absolute;
  z-index: 500;
  right: 10px;
  bottom: 10px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}
.map-recenter:hover { color: var(--alarm); }
.alert-map-empty:not([hidden]) ~ .map-recenter { display: none; }

.map-person { position: relative; width: 40px; height: 48px; display: block; }
.map-pin {
  position: absolute;
  top: 0;
  left: 2px;
  width: 36px;
  height: 36px;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 4px;
  background: var(--alarm);
  box-shadow: 0 6px 14px rgba(16, 37, 46, 0.35);
  transform: rotate(-45deg);
}
.map-person b {
  position: absolute;
  top: 0;
  left: 2px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #fff;
  font: 800 13px/1 var(--display);
}
.map-person-muted .map-pin { background: #6b7c82; }
.map-person-danger::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 4px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(217, 45, 32, 0.35);
  animation: map-ping 1.8s ease-out infinite;
  z-index: -1;
}
@keyframes map-ping { from { transform: scale(0.8); opacity: 1; } to { transform: scale(2.2); opacity: 0; } }

.alert-location-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; }
.alert-address { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; color: var(--alarm); }
.alert-address strong { display: block; color: var(--ink); font-size: 13px; }
.alert-address small { color: var(--muted); font: 600 11px/1.4 var(--utility); }
.alert-location-links { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.alert-updated { display: inline-flex; align-items: center; gap: 5px; margin-right: 6px; color: var(--muted); font-size: 11px; font-weight: 600; }

.alert-vitals { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.alert-vital {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}
.alert-vital strong { display: block; color: var(--ink); font-size: 14px; }
.alert-vital small { display: block; font-size: 11px; line-height: 1.35; }
.alert-vital.is-low { border-color: rgba(178, 94, 9, 0.35); color: var(--warn); background: var(--warn-soft); }
.alert-vital.is-ok { color: var(--success); }
.alert-vital.is-muted strong { color: var(--muted); }

.alert-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; border-radius: var(--radius); background: var(--ground); }
.alert-actions .button { min-height: 40px; }
.alert-actions-note { flex-basis: 100%; margin: 2px 0 0; color: var(--muted); font-size: 11px; }

.alert-block { padding-top: 14px; border-top: 1px solid var(--line); }
.alert-block h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 14px; }
.alert-block-hint { margin: 0 0 10px; color: var(--muted); font-size: 11.5px; }

.alert-protocol { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.alert-protocol li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.alert-protocol li strong { display: block; font-size: 13px; }
.alert-protocol li small { color: var(--muted); font-size: 11px; }
.alert-protocol li.is-claimed { border-color: rgba(31, 111, 139, 0.35); background: var(--calm-soft); }
.alert-protocol li.is-done { background: var(--success-soft); }
.alert-protocol li.is-done strong { color: var(--muted); text-decoration: line-through; }
.task-index { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--ground); font: 800 12px/1 var(--display); }
.is-done .task-index { color: #fff; background: var(--success); }
.task-actions { display: flex; align-items: center; gap: 4px; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin-bottom: 12px; }
.media-tile {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(110deg, var(--ground) 30%, var(--paper) 50%, var(--ground) 70%) 0 0 / 300% 100%;
  animation: media-shimmer 1.4s linear infinite;
}
.media-tile.is-ready, .media-tile.is-broken { animation: none; background: var(--ground-deep); }
.media-tile img, .media-tile video { width: 100%; height: 100%; display: block; object-fit: cover; }
.media-tile time {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
  background: rgba(16, 37, 46, 0.72);
  font: 600 10px/1.3 var(--utility);
}
.media-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(16, 37, 46, 0.7);
  transform: translate(-50%, -50%);
}
.media-tile:hover { border-color: var(--line-strong); }
@keyframes media-shimmer { to { background-position: -300% 0; } }

.alert-audio-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.alert-audio-status { color: var(--muted); font-size: 12px; font-weight: 600; }
.alert-audio-list { display: grid; gap: 2px; max-height: 220px; overflow-y: auto; margin: 0; padding: 0; list-style: none; }
.alert-audio-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 0 4px; border-radius: 6px; }
.alert-audio-list li.is-playing { background: var(--alarm-soft); }
.alert-audio-list li.is-playing .text-button { color: var(--alarm); }
.alert-audio-list time { color: var(--muted); font: 600 11px/1 var(--utility); }

.alert-transcript details { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.alert-transcript summary { font-size: 12px; font-weight: 700; cursor: pointer; }
.alert-transcript ol { display: grid; gap: 6px; max-height: 260px; overflow-y: auto; margin: 10px 0 0; padding: 0; list-style: none; }
.alert-transcript li { display: grid; grid-template-columns: minmax(96px, max-content) 1fr; gap: 8px; font-size: 12.5px; }
.alert-transcript time { color: var(--muted); font: 600 11px/1.5 var(--utility); }

.alert-replies-list { display: grid; gap: 10px; margin: 0 0 12px; padding: 0; list-style: none; }
.alert-replies-list li { display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: start; }
.alert-replies-list li > div { padding: 9px 12px; border-radius: 4px 12px 12px 12px; background: var(--ground); font-size: 13px; }
.alert-replies-list li.is-mine > div { background: var(--calm-soft); }
.alert-replies-list p { display: flex; justify-content: space-between; gap: 10px; margin: 0 0 3px; font-size: 12px; }
.alert-replies-list time { color: var(--muted); font-size: 11px; }
.alert-replies-list .replies-empty { display: block; color: var(--muted); font-size: 12px; }
.reply-audio { margin: 4px 0 0 -9px; }
.alert-reply-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.alert-reply-form textarea { min-height: 44px; }
.alert-reply-form .button { min-height: 44px; }

/* Lightbox ----------------------------------------------------------------- */
.media-dialog { width: min(960px, calc(100% - 28px)); }
.media-stage { min-height: 320px; display: grid; place-items: center; border-radius: var(--radius); background: #0c1b21; }
.media-stage img, .media-stage video { max-width: 100%; max-height: 66vh; display: block; }
.media-stage .transport-loading { background: transparent; border: 0; color: #fff; }
.media-actions { align-items: center; }
.media-counter { margin-right: auto; color: var(--muted); font: 700 11px/1 var(--utility); }

/* Responsive --------------------------------------------------------------- */
@media (max-width: 1180px) {
  .alerts-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1040px) {
  .alerts-layout { grid-template-columns: 1fr; }
  .alert-detail { position: static; }
  .alerts-layout:not(.has-selection) .alert-detail { display: none; }
  .alerts-layout.has-selection .alerts-list { display: none; }
  .alert-back { display: inline-flex; }
}

@media (max-width: 800px) {
  /* Five views no longer fit four fixed columns: the bottom bar scrolls. */
  .sidebar nav {
    grid-template-columns: none;
    grid-auto-columns: minmax(68px, 1fr);
    grid-auto-flow: column;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .sidebar nav::-webkit-scrollbar { display: none; }
  .sidebar .nav-link-badged { grid-template-columns: 1fr; }
  .sidebar .nav-link-badged .nav-badge { position: absolute; top: 4px; right: calc(50% - 22px); min-width: 18px; height: 18px; font-size: 9px; }
  .alerts-heading .heading-actions { width: 100%; }
  .alerts-filter { flex: 1; min-width: 0; }
  .alert-sheet { padding: 16px; }
  .alert-sheet-head { grid-template-columns: auto minmax(0, 1fr); }
  .alert-sheet-head > .alert-status { grid-column: 1 / -1; justify-self: start; }
  .alert-actions .button { flex: 1 1 calc(50% - 8px); }
}

@media (max-width: 520px) {
  .alerts-summary { gap: 8px; }
  .alerts-stat { padding: 10px; column-gap: 8px; }
  .alerts-stat-icon { width: 32px; height: 32px; }
  .alerts-stat strong { font-size: 20px; }
  .alert-reply-form { grid-template-columns: 1fr; }
  .alert-transcript li { grid-template-columns: 1fr; gap: 0; }
}

/* ========================================================================
   Familia (premium-family.js, premium-family-care.js)
   ======================================================================== */
.nav-link[data-view="family"]::before { content: "♡"; }
.map-person-family .map-pin { background: var(--calm); }

.family-panel { display: grid; gap: 16px; }
.family-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
}
.family-card > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.family-card h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; }
.family-card-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.family-card-hint { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.family-empty { margin: 6px 0; color: var(--muted); font-size: 12.5px; }
.family-list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.family-list > li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
}
.family-list > li:last-child { border-bottom: 0; }
.family-list > li > div:first-of-type { min-width: 0; display: grid; gap: 2px; }
.family-list > li:has(> .family-avatar) { justify-content: flex-start; }
.family-list strong { font-size: 13px; }
.family-list small { color: var(--muted); font-size: 11.5px; }
.family-row-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 2px; }
.family-notice { display: grid; grid-template-columns: auto 1fr; gap: 10px; margin-bottom: 12px; padding: 11px 12px; border-radius: var(--radius); color: var(--warn); background: var(--warn-soft); font-size: 12px; }
.family-notice strong { color: var(--ink); }
.family-notice p { margin: 2px 0 0; color: var(--ink); }
.family-details { margin-top: 12px; }
.family-details summary { cursor: pointer; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.family-details[open] summary { margin-bottom: 10px; }
.family-tab-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.family-tab-head p { margin: 0; color: var(--muted); font-size: 13px; }
.family-panel .check-option, .portal-form-dialog .check-option { min-height: 44px; border-radius: var(--radius-sm); font-size: 13px; cursor: pointer; }
.family-panel .check-option:has(input:checked), .portal-form-dialog .check-option:has(input:checked) { border-color: var(--calm); background: var(--calm-soft); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.check-grid.weekdays { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.check-grid.weekdays .check-option { justify-content: center; padding: 6px; }

/* Summary */
.family-summary { display: grid; grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
.family-summary-side { position: sticky; top: 18px; display: grid; gap: 16px; }
.family-map-card { padding: 0; overflow: hidden; }
.family-map-card .family-card-hint { margin: 0; padding: 10px 14px 12px; }
.family-map { height: clamp(300px, 46vh, 460px); background: var(--ground-deep); }
.family-map.is-tall { height: clamp(380px, 64vh, 640px); }
.family-members { display: grid; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.family-member {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.family-member.is-focused { border-color: var(--calm); box-shadow: 0 0 0 3px rgba(31, 111, 139, 0.14); }
.family-avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 3px solid var(--tint-cfd6d8, #cfd6d8);
  border-radius: 50%;
  color: var(--calm);
  background: var(--calm-soft);
  font: 800 15px/1 var(--display);
}
.family-list .family-avatar { width: 34px; height: 34px; border-width: 2px; font-size: 12px; }
.family-avatar.is-green { border-color: #3aa57e; }
.family-avatar.is-yellow { border-color: #e0a526; }
.family-member-body { min-width: 0; display: grid; gap: 5px; }
.family-member-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.family-member-name strong { font-size: 14px; }
.family-badge { padding: 2px 7px; border-radius: 999px; color: var(--muted); background: var(--ground); font-size: 10.5px; font-weight: 700; }
.family-badge.is-minor { color: var(--violet); background: var(--violet-soft); }
.family-member-facts { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; color: var(--muted); font-size: 12px; }
.family-fact, .family-fact > span { display: inline-flex; align-items: center; gap: 5px; }
.family-fact .is-low { color: var(--warn); font-weight: 700; }
.family-fact .is-muted { color: var(--quiet); }
.presence-dot { width: 8px; height: 8px; border-radius: 50%; background: #aab4b7; }
.presence-dot.is-green { background: #3aa57e; }
.presence-dot.is-yellow { background: #e0a526; }
.family-ok-today { display: inline-flex; align-items: center; gap: 5px; margin: 0; color: var(--success); font-size: 12px; font-weight: 600; }
.family-member-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }

/* Zones */
.family-zones { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.8fr); gap: 16px; align-items: start; }
.family-zones-side { position: sticky; top: 18px; }
.zone-dot { width: 12px; height: 12px; flex: 0 0 auto; display: inline-block; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px var(--line-strong); }
.zone-dot.is-safe { background: #2f9070; }
.zone-dot.is-danger { background: #d92d20; }
.zone-bucket h4 { margin: 14px 0 4px; color: var(--muted); font: 700 10px/1 var(--utility); letter-spacing: 0.08em; text-transform: uppercase; }
.zone-row { justify-content: flex-start !important; }
.zone-row > div:first-of-type { flex: 1; }
.zone-row.is-editing { background: var(--calm-soft); border-radius: var(--radius-sm); }
.zone-form-empty { display: grid; justify-items: center; gap: 8px; margin: 6px 0 10px; padding: 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); text-align: center; }
.zone-form-empty p { margin: 0; font-size: 12.5px; }
.place-search { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.place-search input { min-height: 38px; }
.place-results { width: 100%; display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; text-align: left; }
.place-results .text-button { width: 100%; justify-content: flex-start; text-align: left; font-weight: 600; }
.zone-form { margin: 6px 0 12px; padding: 14px; border: 1px solid var(--calm); border-radius: var(--radius); background: var(--tint-fbfdfe, #fbfdfe); }
.zone-form h4 { margin: 0 0 4px; font-size: 14px; }
.zone-form label:not(.segmented label) { margin-top: 12px; }
.zone-form input[type="range"] { min-height: 30px; padding: 0; border: 0; box-shadow: none; accent-color: var(--calm); }
.segmented { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; }
.segmented legend { margin: 10px 0 6px; font-size: 12px; font-weight: 700; }
.segmented label { margin: 0; }
.segmented input { position: absolute; opacity: 0; width: 1px; min-height: 0; }
.segmented label > span { min-height: 38px; display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--paper); font-size: 12.5px; font-weight: 700; cursor: pointer; }
.segmented input:checked + span { border-color: var(--ink); color: #fff; background: var(--ink); }
.segmented input:focus-visible + span { outline: 3px solid rgba(240, 71, 62, 0.28); outline-offset: 2px; }

/* Medication */
.med-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.med-card { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); }
.med-card.is-finished { opacity: 0.8; }
.med-card > header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.med-number { padding: 5px 8px; border-radius: 8px; color: #fff; background: var(--calm); font: 800 11px/1 var(--display); }
.med-card-title strong { display: block; font-size: 14px; }
.med-card-title small { color: var(--muted); font-size: 11.5px; }
.med-medicines { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.med-medicines li { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: var(--radius-sm); background: var(--ground); font-size: 13px; }
.med-medicines span { color: var(--muted); }
.med-today small, .med-week small { display: block; margin-bottom: 5px; color: var(--muted); font: 700 10px/1 var(--utility); letter-spacing: 0.06em; text-transform: uppercase; }
.med-today > div { display: flex; flex-wrap: wrap; gap: 6px; }
.med-slot { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 999px; color: var(--muted); background: var(--ground); font-size: 11.5px; }
.med-slot b { color: var(--ink); }
.med-slot.is-taken, .med-slot.is-taken_late { color: var(--success); background: var(--success-soft); }
.med-slot.is-missed { color: var(--alarm); background: var(--alarm-soft); }
.med-slot.is-pending { color: var(--warn); background: var(--warn-soft); }
.med-times { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--muted); font-size: 12.5px; }
.med-week > div { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.med-day { min-height: 28px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); background: var(--tint-eef0f0, #eef0f0); font-size: 11px; font-weight: 700; }
.med-day.is-done { color: #fff; background: #2f9070; }
.med-day.is-missed { color: #fff; background: #d92d20; }
.med-day.is-today { color: var(--ink-5c3b00, #5c3b00); background: #f3c14b; }
.med-day.is-future { background: var(--tint-f4f4f2, #f4f4f2); }
.med-day.is-outside { background: transparent; border: 1px dashed var(--line); }
.med-card footer { display: flex; flex-wrap: wrap; gap: 8px; }
.med-cal-head { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 10px; }
.med-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; text-align: center; }
.med-cal-grid b { color: var(--muted); font-size: 11px; }
.med-cal-grid .med-day { min-height: 38px; }
.med-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 12px 0 0; color: var(--muted); font-size: 11.5px; }
.med-legend .med-day { width: 14px; min-height: 14px; height: 14px; }
.row-list { display: grid; gap: 6px; margin-bottom: 8px; }
.medicine-row { display: grid; grid-template-columns: 1.2fr 1fr auto; gap: 6px; align-items: center; }
.time-row { display: grid; grid-template-columns: 160px auto; gap: 6px; align-items: center; justify-content: start; }

/* Help & care */
.family-care-grid, .family-home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.family-card.is-wide { grid-column: 1 / -1; }
.mini-tabs { display: inline-flex; gap: 2px; margin: 4px 0 10px; padding: 3px; border-radius: 8px; background: var(--ground); }
.mini-tabs button { min-height: 32px; padding: 6px 12px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 700; }
.mini-tabs button.active { color: var(--ink); background: var(--paper); box-shadow: 0 1px 4px rgba(7, 27, 45, 0.1); }
.help-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.help-item { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.help-item.is-open { border-left: 4px solid var(--warn); }
.help-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--warn); background: var(--warn-soft); }
.help-item.is-done .help-icon { color: var(--muted); background: var(--ground); }
.help-body { min-width: 0; display: grid; gap: 6px; }
.help-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: 13px; }
.help-head time { color: var(--muted); font-size: 11.5px; }
.help-head .alert-status { margin-left: auto; }
.help-message { margin: 0; font-size: 13.5px; }
.help-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; color: var(--muted); font-size: 12px; }
.help-meta span { display: inline-flex; align-items: center; gap: 5px; }
.help-meta a { color: var(--calm); }
.help-responses { display: grid; gap: 4px; margin: 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--ground); list-style: none; font-size: 12.5px; }
.help-responses li { display: flex; flex-wrap: wrap; gap: 6px; }
.help-responses time { margin-left: auto; color: var(--muted); font-size: 11px; }
.help-body .family-row-actions { justify-content: flex-start; }
.help-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; border: 0; }
.help-types legend { margin: 0 0 8px; font-size: 12px; font-weight: 700; }
.help-type input { position: absolute; opacity: 0; width: 1px; min-height: 0; }
.help-type > span { min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--paper); font-size: 13px; font-weight: 700; cursor: pointer; }
.help-type input:checked + span { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }
.help-type input:focus-visible + span { outline: 3px solid rgba(240, 71, 62, 0.28); outline-offset: 2px; }
.help-type label, .portal-form-dialog .help-type { margin: 0; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-button { min-height: 36px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--paper); font-size: 12.5px; font-weight: 700; }
.chip-button:hover { border-color: var(--warn); background: var(--warn-soft); }
.rota-now { display: grid; gap: 3px; margin: 4px 0 10px; padding: 12px; border-radius: var(--radius); background: var(--calm-soft); }
.rota-now.is-done { background: var(--success-soft); }
.rota-now strong { font-size: 14px; }
.rota-now small { color: var(--muted); font-size: 12px; }
.rota-order { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; padding: 0; list-style: none; counter-reset: rota; }
.rota-order li { counter-increment: rota; padding: 5px 10px; border-radius: 999px; background: var(--ground); font-size: 12px; }
.rota-order li::before { content: counter(rota) ". "; color: var(--muted); }
.rota-order li.is-current { color: #fff; background: var(--calm); }
.rota-order li.is-current::before { color: #d8ecf2; }
.rota-pick .rota-index { min-width: 20px; height: 20px; display: inline-grid; place-items: center; border-radius: 50%; color: #fff; background: var(--calm); font-size: 11px; font-weight: 800; }
.rota-pick .rota-index:empty { background: transparent; }
.inline-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; margin-top: 10px; }
.inline-form input { min-height: 38px; font-size: 13px; }
.roulette-card .inline-form, .home-card .inline-form { grid-template-columns: 1fr auto; }
.switch { position: relative; width: 44px; height: 26px; margin: 0 0 0 6px; flex: 0 0 auto; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; opacity: 0; cursor: pointer; }
.switch::before { content: ""; position: absolute; inset: 0; border-radius: 999px; background: var(--tint-c9d0d2, #c9d0d2); transition: background 150ms ease; pointer-events: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--paper); box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform 150ms ease; pointer-events: none; }
.switch:has(input:checked)::before { background: var(--success); }
.switch:has(input:checked)::after { transform: translateX(18px); }
.switch:has(input:disabled) { opacity: 0.45; }
.switch:has(input:focus-visible)::before { outline: 3px solid rgba(240, 71, 62, 0.28); outline-offset: 2px; }
.life-bar { display: flex; overflow: hidden; margin-top: 14px; border-radius: 8px; }
.life-bar span { min-height: 48px; display: grid; place-items: center; padding: 4px; border-right: 2px solid #fff; color: #fff; font-size: 11px; text-align: center; }
.life-bar span b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.life-bar .is-home { background: var(--calm); }
.life-bar .is-zone { background: #2f9070; }
.life-bar .is-out { color: var(--ink); background: var(--tint-e7dccb, #e7dccb); }
.life-hours { display: flex; justify-content: space-between; margin: 4px 0 0; color: var(--muted); font: 600 10px/1 var(--utility); }

/* At home */
.home-list { display: grid; gap: 10px; }
.home-card { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.home-card.is-done { background: var(--tint-f6f8f9, #f6f8f9); }
.home-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.home-card > header strong { display: block; font-size: 14px; }
.home-card > header small { color: var(--muted); font-size: 11.5px; }
.home-items { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.home-items .check-option.is-done span { color: var(--muted); text-decoration: line-through; }
.home-card footer { display: flex; justify-content: flex-end; }
.roulette-options { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.roulette-options li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm); background: var(--ground); font-size: 12.5px; }
.roulette-options li span { color: var(--muted); }
.roulette-options li.is-winner { color: #fff; background: var(--alarm); }
.roulette-options li.is-winner span { color: #ffe1dd; }
.roulette-winner { display: grid; justify-items: center; gap: 2px; padding: 12px; border-radius: var(--radius); background: var(--alarm-soft); text-align: center; }
.roulette-winner small { color: var(--alarm); font: 700 10px/1 var(--utility); letter-spacing: 0.08em; text-transform: uppercase; }
.roulette-winner strong { font: 800 18px/1.2 var(--display); }
.roulette-winner span { color: var(--muted); font-size: 12px; }

/* Shared form dialog */
.portal-form-dialog.is-wide { width: min(760px, calc(100% - 28px)); }
.portal-form-intro { margin: -8px 0 6px; }

@media (max-width: 1040px) {
  .family-summary, .family-zones { grid-template-columns: 1fr; }
  .family-summary-side, .family-zones-side { position: static; }
  .family-summary-side { order: -1; }
}
@media (max-width: 800px) {
  .family-care-grid, .family-home-grid { grid-template-columns: 1fr; }
  .family-heading .heading-actions { width: 100%; }
  .family-tab-head { align-items: flex-start; flex-direction: column; }
  .inline-form { grid-template-columns: 1fr; }
  .medicine-row { grid-template-columns: 1fr auto; }
  .medicine-row input:nth-child(2) { grid-column: 1; }
  .help-types { grid-template-columns: 1fr; }
  .check-grid.weekdays { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.icon-action { width: 36px; height: 36px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 8px; color: var(--muted); background: transparent; }
.icon-action:hover { color: var(--ink); background: var(--ground); }
.icon-action.danger-text:hover { color: var(--alarm); background: var(--alarm-soft); }
.med-card > header { grid-template-columns: auto minmax(0, 1fr); }
.med-card footer { align-items: center; }
.med-admin { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; }

/* ========================================================================
   Chat (premium-chat.js)
   ======================================================================== */
.nav-link[data-view="chat"]::before { content: "✉"; }
.chat-layout {
  height: clamp(520px, calc(100vh - 250px), 820px);
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
}
.chat-sidebar { min-height: 0; display: grid; grid-template-rows: auto 1fr; border-right: 1px solid var(--line); background: #f6f8f9; }
.chat-sidebar input[type="search"] { margin: 12px; width: calc(100% - 24px); min-height: 40px; }
.chat-list { min-height: 0; overflow-y: auto; padding: 0 6px 8px; }
.chat-row {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 0;
  border-radius: var(--radius);
  color: var(--ink);
  background: transparent;
  text-align: left;
}
.chat-row:hover { background: var(--ground); }
.chat-row.is-active { background: var(--paper); box-shadow: inset 3px 0 0 var(--signal), var(--shadow-sm); }
.chat-row.is-locked { opacity: 0.7; }
.chat-row-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--navy-900); background: var(--ground-deep); }
.chat-row-icon svg { width: 22px; height: 22px; fill: currentColor; }
.chat-row-icon[data-kind="family"] { color: var(--ink-6d4bc3, #6d4bc3); background: var(--violet-soft); }
.chat-row-icon[data-kind="sos"], .chat-row-icon[data-kind="general"] { color: var(--alarm); background: var(--alarm-soft); }
.chat-row-icon[data-kind="work"] { color: var(--calm); background: var(--calm-soft); }
.chat-row-icon[data-kind="pets"] { color: var(--ink-b25e09, #b25e09); background: var(--warn-soft); }
.chat-row-body { min-width: 0; display: grid; gap: 2px; }
.chat-row-top { display: flex; justify-content: space-between; gap: 8px; }
.chat-row-top strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.chat-row-top time { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.chat-row-line { display: flex; align-items: center; gap: 4px; overflow: hidden; color: var(--muted); font-size: 12px; white-space: nowrap; }
.chat-row-line { text-overflow: ellipsis; }

.chat-conversation { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto 1fr auto; }
.chat-conversation > .alert-detail-empty, .chat-conversation > .transport-loading, .chat-conversation > .empty-state { grid-row: 2; margin: 18px; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-back { display: none; }
.chat-head-title { min-width: 0; flex: 1; display: grid; }
.chat-head-title strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.chat-head-title small { color: var(--muted); font-size: 11.5px; }
.chat-head-actions { display: flex; gap: 6px; }
.chat-scroll-wrap { position: relative; min-height: 0; }
.chat-messages {
  height: 100%;
  overflow-y: auto;
  padding: 14px 18px 18px;
  background:
    radial-gradient(circle at 1px 1px, rgba(21, 40, 49, 0.05) 1px, transparent 0) 0 0 / 22px 22px,
    var(--tint-f8f6f1, #f8f6f1);
  overscroll-behavior: contain;
}
.chat-older { display: flex; justify-content: center; margin: 0 0 10px; }
.chat-day { display: flex; justify-content: center; margin: 14px 0 8px; }
.chat-day span { padding: 4px 10px; border-radius: 999px; color: var(--muted); background: var(--paper); box-shadow: var(--shadow-sm); font-size: 11px; font-weight: 700; text-transform: capitalize; }
.chat-message { display: flex; align-items: flex-end; gap: 8px; margin-top: 10px; }
.chat-message.is-grouped { margin-top: 3px; }
.chat-message.is-mine { justify-content: flex-end; }
.chat-avatar { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--tone); font: 800 12px/1 var(--display); }
.chat-message.is-grouped .chat-avatar { background: transparent; }
.chat-bubble { max-width: min(560px, 76%); padding: 8px 12px 6px; border-radius: 4px 14px 14px 14px; background: var(--paper); box-shadow: 0 1px 1.5px rgba(21, 40, 49, 0.1); }
.chat-message.is-mine .chat-bubble { border-radius: 14px 4px 14px 14px; color: #fff; background: var(--navy-900); }
.chat-message.is-grouped .chat-bubble { border-radius: 14px; }
.chat-sender { display: block; margin-bottom: 2px; font-size: 12px; }
.chat-bubble p { margin: 0; font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-meta { display: flex; justify-content: flex-end; gap: 4px; margin-top: 2px; color: var(--muted); font-size: 10.5px; }
.chat-message.is-mine .chat-meta { color: #a9bcc2; }
.chat-message.is-pending { opacity: 0.65; }
.chat-message.is-failed .chat-bubble { box-shadow: 0 0 0 2px var(--alarm); }
.chat-message.is-failed .chat-meta .text-button { padding: 0; color: #ffb4ad; }
.chat-report { opacity: 0; transition: opacity 150ms ease; }
.chat-message:hover .chat-report, .chat-report:focus-visible { opacity: 1; }
.chat-empty, .chat-locked { height: 100%; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 30px; color: var(--muted); text-align: center; }
.chat-empty strong, .chat-locked strong { color: var(--ink); font-size: 15px; }
.chat-empty span, .chat-locked span { max-width: 360px; font-size: 12.5px; }
.chat-locked { grid-row: 2; }
.chat-new-pill { position: absolute; bottom: 14px; left: 50%; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 0; border-radius: 999px; color: #fff; background: var(--signal); box-shadow: var(--shadow-md); transform: translateX(-50%); font-size: 12px; font-weight: 700; }
.chat-new-pill svg { transform: rotate(90deg); }
.chat-composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; padding: 10px 14px 8px; border-top: 1px solid var(--line); background: var(--paper); }
.chat-composer textarea { min-height: 44px; max-height: 180px; resize: none; line-height: 1.45; }
.chat-composer .button { min-height: 44px; }
.chat-hint { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 10.5px; }
.chat-quote { margin: 0 0 6px; padding: 10px 12px; border-left: 3px solid var(--line-strong); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--ground); }
.chat-quote strong { font-size: 12px; }
.chat-quote p { margin: 4px 0 0; font-size: 13px; white-space: pre-wrap; }
[data-chat-download-clear] { width: 100%; }

@media (max-width: 1040px) {
  .chat-layout { grid-template-columns: 1fr; height: calc(100vh - 230px); min-height: 480px; }
  .chat-layout:not(.has-selection) .chat-conversation { display: none; }
  .chat-layout.has-selection .chat-sidebar { display: none; }
  .chat-back { display: inline-grid; }
  .chat-report { opacity: 1; }
}
@media (max-width: 800px) {
  .chat-layout { height: calc(100vh - 290px); margin: 0 -6px; }
  .chat-head-actions .button span { display: none; }
  .chat-bubble { max-width: 86%; }
  .chat-hint { display: none; }
}

/* ========================================================================
   Mascotas (premium-pets.js, premium-pets-actions.js) — cacao palette
   ======================================================================== */
:root { --pets: #8a5a3b; --pets-soft: #f4ebe3; }
.nav-link[data-view="pets"]::before { content: "✦"; }
.pets-limits { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pets-panel { gap: 14px; }
.pet-avatar {
  width: var(--size, 44px);
  height: var(--size, 44px);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  color: var(--pets);
  background: var(--pets-soft);
  box-shadow: inset 0 0 0 2px #fff, 0 0 0 1px rgba(138, 90, 59, 0.25);
}
.pet-avatar svg { width: 58%; height: 58%; fill: currentColor; }
.pet-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pet-avatar.is-archived { filter: grayscale(1); opacity: 0.6; }
.pet-avatar.is-all { color: var(--muted); background: var(--ground); }

.pet-strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; }
.pet-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 5px 12px 5px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: 12.5px; font-weight: 700; }
.pet-chip.is-active { border-color: var(--pets); color: #fff; background: var(--pets); }
.pet-chip.is-active .pet-avatar { box-shadow: inset 0 0 0 2px var(--pets); }
.pet-strip-sep { flex: 0 0 1px; margin: 6px 4px; background: var(--line-strong); }
.pets-toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.pets-today { display: grid; gap: 14px; }
.family-card.is-warn-card { border-color: rgba(178, 94, 9, 0.35); background: linear-gradient(180deg, var(--warn-soft), var(--paper) 120px); }
.family-row-actions.is-start { justify-content: flex-start; }

.care-list { display: grid; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; }
.care-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.care-row.is-closed { background: var(--tint-f6f8f9, #f6f8f9); }
.care-row-body { min-width: 0; display: grid; gap: 2px; }
.care-row-title { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; color: var(--ink); background: none; text-align: left; font-size: 13.5px; }
.care-row-title:hover strong { text-decoration: underline; }
.care-type-icon { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; color: var(--pets); background: var(--pets-soft); }
.care-row[data-kind="medication"] .care-type-icon { color: var(--calm); background: var(--calm-soft); }
.care-row[data-kind="veterinary"] .care-type-icon { color: var(--alarm); background: var(--alarm-soft); }
.care-row-body small { color: var(--muted); font-size: 12px; }
.care-row-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }

.handover-list { display: grid; gap: 10px; }
.handover-card { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-left: 4px solid var(--pets); border-radius: var(--radius); background: var(--paper); }
.handover-card > header { display: flex; justify-content: space-between; gap: 8px; }
.handover-kind { display: inline-flex; align-items: center; gap: 6px; color: var(--pets); font: 700 11px/1 var(--utility); letter-spacing: 0.06em; text-transform: uppercase; }
.handover-pets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.handover-pets strong { margin-right: 6px; font-size: 13px; }
.handover-line { margin: 0; font-size: 13px; }
.handover-meta { display: flex; align-items: center; gap: 5px; margin: 0; color: var(--muted); font-size: 12px; }
.handover-card .family-row-actions { justify-content: flex-start; }

.pets-banners { display: grid; gap: 8px; }
.pets-banner { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); background: var(--paper); text-align: left; }
.pets-banner > span:not(.pet-avatar):not(.family-row-actions) { flex: 1; min-width: 0; display: grid; gap: 2px; }
.pets-banner strong { font-size: 13.5px; }
.pets-banner small { color: var(--muted); font-size: 12px; }
.pets-banner.is-alarm { border-color: rgba(217, 45, 32, 0.4); background: var(--alarm-soft); }
.pets-banner.is-alarm strong { color: var(--alarm); }
.pets-banner.is-warn { border-color: rgba(178, 94, 9, 0.35); background: var(--warn-soft); }
.pets-banner.is-calm { border-color: rgba(31, 111, 139, 0.3); background: var(--calm-soft); color: var(--calm); }
.pets-banner.is-calm strong, .pets-banner.is-calm small { color: var(--ink); }
.pets-banner.is-static { cursor: default; }
.pets-tips { margin: 6px 0 0; padding-left: 18px; color: var(--ink); font-size: 12px; }
.pets-question { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.pets-question > small { color: var(--muted); font-size: 12px; }
.pets-question-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pets-question-row > span:not(.pet-avatar) { flex: 1; font-weight: 700; font-size: 13px; }

.agenda-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.agenda-nav strong { font-size: 14px; }
.agenda-spacer { flex: 1; }
.agenda-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.agenda-day { min-width: 0; display: grid; align-content: start; gap: 6px; padding: 10px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.agenda-day.is-today { border-color: var(--pets); box-shadow: inset 0 3px 0 var(--pets); }
.agenda-day header { display: grid; }
.agenda-day header strong { font-size: 12.5px; text-transform: capitalize; }
.agenda-day header small { color: var(--muted); font-size: 11px; }
.agenda-day ul { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.agenda-item button { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 2px 5px; align-items: start; padding: 6px 7px; border: 0; border-radius: 6px; color: var(--ink); background: var(--pets-soft); text-align: left; font-size: 11.5px; line-height: 1.35; }
.agenda-item button span { grid-column: 1 / -1; display: block; overflow-wrap: break-word; hyphens: auto; }
.agenda-item button span svg { display: inline-block; margin: 0 3px -2px 0; }
.agenda-item button > svg { grid-column: 2; grid-row: 1; }
.agenda-item time { font: 700 10.5px/1.4 var(--utility); }
.agenda-item.is-handover button { color: #fff; background: var(--pets); }
.agenda-item.is-completed button { color: var(--muted); background: var(--success-soft); }
.agenda-item.is-not_done button { color: var(--muted); background: var(--ground); text-decoration: line-through; }
.agenda-item[data-kind="medication"] button { background: var(--calm-soft); }

.pet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.pet-card { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); color: var(--ink); background: var(--paper); text-align: left; transition: border-color 150ms ease, box-shadow 150ms ease; }
.pet-card:hover { border-color: var(--pets); box-shadow: var(--shadow-sm); }
.pet-card-body { min-width: 0; display: grid; gap: 3px; }
.pet-card-body strong { font: 800 16px/1.2 var(--display); }
.pet-card-body small { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; }
.pet-card-carer { color: var(--pets) !important; font-weight: 700; }
.pet-card-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }

.pet-detail { display: grid; gap: 14px; }
.pet-detail > .text-button { justify-self: start; }
.pet-detail-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 18px; border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--pets-soft), var(--paper)); }
.pet-detail-head h3 { margin: 0 0 4px; font: 800 26px/1.1 var(--display); }
.pet-detail-head p { margin: 0 0 2px; color: var(--muted); font-size: 13px; }
.pet-detail-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.file-button input[type="file"] { display: none; }
.pet-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.urgent-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; }
.urgent-tile { display: flex; align-items: flex-start; gap: 10px; min-height: 64px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); background: var(--paper); text-align: left; }
.urgent-tile > span { display: grid; gap: 2px; }
.urgent-tile strong { font-size: 13.5px; }
.urgent-tile small { color: var(--muted); font-size: 11.5px; }
.urgent-tile.is-alarm { border-color: rgba(217, 45, 32, 0.4); color: var(--alarm); background: var(--alarm-soft); }
.urgent-tile.is-warn { border-color: rgba(178, 94, 9, 0.35); color: var(--warn); background: var(--warn-soft); }
.urgent-tile.is-alarm strong, .urgent-tile.is-warn strong { color: var(--ink); }
.urgent-tile:hover { box-shadow: var(--shadow-sm); }
.pet-note { display: grid; gap: 2px; margin: 0 0 8px; padding: 9px 11px; border-radius: var(--radius-sm); background: var(--ground); font-size: 13px; }
.pet-note strong { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.pet-note.is-important { background: var(--warn-soft); }
.pet-vet { display: grid; gap: 6px; margin: 4px 0 8px; }
.pet-vet .family-row-actions { justify-content: flex-start; }
.pet-subhead { margin: 14px 0 6px; font-size: 13px; }
.pets-alert-panel { display: grid; gap: 6px; padding: 16px; border-radius: var(--radius-lg); }
.pets-alert-panel h4 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; }
.pets-alert-panel p { margin: 0; font-size: 13px; }
.pets-alert-panel.is-alarm { border: 1px solid rgba(217, 45, 32, 0.4); background: var(--alarm-soft); }
.pets-alert-panel.is-alarm h4 { color: var(--alarm); }
.pets-alert-panel.is-warn { border: 1px solid rgba(178, 94, 9, 0.35); background: var(--warn-soft); }
.pets-alert-panel details summary { cursor: pointer; font-size: 12.5px; font-weight: 700; }
.pets-alert-panel ul { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; }
.pet-history { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.pet-history li { position: relative; display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pet-history li:last-child { border-bottom: 0; }
.pet-history strong { font-size: 13px; }
.pet-history small { display: block; color: var(--muted); font-size: 11.5px; }
.history-dot { width: 10px; height: 10px; margin-top: 4px; border-radius: 50%; background: var(--line-strong); }
.history-dot.is-completed { background: var(--success); }
.history-dot.is-not_done { background: var(--quiet); }
.history-dot.is-handover { background: var(--pets); }
.history-dot.is-alarm { background: var(--alarm); }
.history-dot.is-warn { background: var(--warn); }
.pet-archive { display: flex; justify-content: flex-end; }
.emergency-card { display: grid; gap: 6px; }
.rescue-order { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.form-more { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.form-more summary { cursor: pointer; font-size: 12.5px; font-weight: 700; }

@media (max-width: 1180px) { .agenda-week { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1040px) { .pet-detail-grid { grid-template-columns: 1fr; } }
@media (max-width: 800px) {
  .agenda-week { grid-template-columns: 1fr; }
  .care-row { grid-template-columns: 40px minmax(0, 1fr); }
  .care-row-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .pet-detail-head { grid-template-columns: auto minmax(0, 1fr); }
  .pet-detail-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .rescue-order { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.family-list > li:has(> .pet-avatar) { justify-content: flex-start; }
.family-list > li:has(> .pet-avatar) > .family-row-actions { margin-left: auto; }
.pet-detail-grid .care-row { grid-template-columns: 40px minmax(0, 1fr); }
.pet-detail-grid .care-row-actions { grid-column: 2; justify-content: flex-start; }
.urgent-tile small { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

/* ========================================================================
   Amigos (premium-friends.js)
   ======================================================================== */
.friends-layout { display: grid; grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.05fr); gap: 16px; align-items: start; }
.friends-main, .friends-side { min-width: 0; display: grid; gap: 16px; }
.friends-side { position: sticky; top: 88px; }
.friends-map-card > header { margin: 0; padding: 14px 16px 10px; }

.friends-me { display: grid; gap: 8px; margin: 4px 0 0; padding: 0; list-style: none; }
.friends-me-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.friends-me-row > div { min-width: 0; display: grid; gap: 3px; }
.friends-me-row strong { font-size: 13.5px; }
.friends-me-row small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.friends-me-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--muted); background: var(--ground); }
.friends-me-row.is-active { border-color: color-mix(in srgb, var(--calm) 35%, var(--line)); background: var(--calm-soft); }
.friends-me-row.is-active .friends-me-icon { color: #fff; background: var(--calm); }
.friends-me-row:not(.is-active) strong { color: var(--muted); }
.friends-from-phone { display: inline-flex; align-items: center; gap: 5px; margin-top: 2px; color: var(--quiet, var(--muted)) !important; }
.friends-me-row .family-row-actions { gap: 6px; }

.friends-status { display: grid; gap: 4px; margin: 6px 0 0; padding: 0; list-style: none; }
.friends-status li { display: flex; align-items: flex-start; gap: 6px; padding: 6px 9px; border-radius: 8px; font-size: 12.5px; line-height: 1.4; }
.friends-status li .portal-icon { margin-top: 2px; }
.friends-status .is-sharing { color: var(--calm); background: var(--calm-soft); }
.friends-status .is-walking { color: var(--ink); background: var(--ground); }
.friends-status .is-meeting { color: var(--violet); background: var(--violet-soft); }
.friends-status .is-late { color: var(--alarm); background: var(--alarm-soft); font-weight: 600; }

.friends-opened {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--alarm) 40%, transparent);
  border-left: 4px solid var(--alarm);
  border-radius: var(--radius-lg);
  background: var(--paper);
}
.friends-opened header { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: center; }
.friends-opened h3 { margin: 0; font-size: 16px; }
.friends-opened header p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.friends-opened-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: var(--alarm); }
.friends-opened-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin: 0; }
.friends-opened-fields > div { padding: 9px 11px; border-radius: 10px; background: var(--ground); }
.friends-opened-fields dt { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.friends-opened-fields dd { margin: 2px 0 0; font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.friends-opened-photos { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.friends-opened .family-row-actions { justify-content: flex-start; gap: 6px; }
.friends-photo-full { display: block; width: 100%; max-height: 70vh; object-fit: contain; border-radius: 12px; background: var(--ground); }

@media (max-width: 1040px) {
  .friends-layout { grid-template-columns: 1fr; }
  .friends-side { position: static; }
}
@media (max-width: 560px) {
  .friends-me-row { grid-template-columns: 36px minmax(0, 1fr); }
  .friends-me-row .family-row-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
.friends-opened-list { display: grid; gap: 16px; }
.friends-opened-list:empty { display: none; }

/* ------------------------------------------------- Familia → Recorridos --- */
/* premium-family-history.js */
.family-history { display: grid; gap: 16px; align-items: start; }
.family-history.has-map { grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.15fr); }
.family-history-main { display: grid; gap: 16px; min-width: 0; }
.family-history-side { position: sticky; top: 18px; min-width: 0; }
.history-picker { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.history-picker label { flex: 1 1 200px; margin: 0; }
.history-picker label > span { display: block; margin-bottom: 6px; }
.history-picker .button { flex: none; min-height: 42px; }
.history-notice,
.history-read { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.history-notice .portal-icon,
.history-read .portal-icon { flex: none; margin-top: 2px; }
.history-read { margin-top: 6px; color: var(--ok); }
.history-empty { margin: 0; padding: 14px 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--paper, var(--paper)); }
.history-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; max-height: 232px; overflow-y: auto; }
.history-day { width: 100%; display: grid; gap: 2px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--paper); text-align: left; cursor: pointer; }
.history-day strong { font: 600 13px/1.3 var(--body); }
.history-day small { color: var(--muted); font-size: 11.5px; line-height: 1.35; font-variant-numeric: tabular-nums; }
.history-day:hover { border-color: var(--line-strong); background: var(--mist, var(--mist)); }
.history-day.is-active { border-color: var(--night, #13242c); color: #fff; background: var(--night, #13242c); }
.history-day.is-active small { color: rgba(255, 255, 255, 0.72); }
.history-day-title { margin: 0 0 12px; color: var(--muted); font-size: 12.5px; }
.history-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.history-stats > div { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--mist, var(--mist)); }
.history-stats small { color: var(--muted); font-size: 11.5px; }
.history-stats strong { font: 600 16px/1.2 var(--body); font-variant-numeric: tabular-nums; }
.history-subtitle { margin: 16px 0 8px; font: 600 13px/1.3 var(--body); }
.history-stops { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; max-height: 300px; overflow-y: auto; }
.history-stops li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.history-stops li:last-child { border-bottom: 0; }
.history-stops li > div { min-width: 0; display: grid; gap: 1px; }
.history-stops strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.history-stops small { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.history-stop-index,
.history-stop-pin { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #6b7c82; font: 700 12px/1 var(--body); }
.history-stop-index.is-zone,
.history-stop-pin.is-zone { background: #2f8f6e; }
.history-stop-index.is-danger,
.history-stop-pin.is-danger { background: #d92d20; }
.history-stop-pin { border: 2px solid #fff; box-shadow: 0 2px 6px rgba(16, 37, 46, 0.35); }
.history-actions { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.history-arrow { width: 18px; height: 18px; display: grid; place-items: center; }
.history-arrow svg { fill: var(--ink-1f6f8b, #1f6f8b); stroke: #fff; stroke-width: 2; stroke-linejoin: round; paint-order: stroke; }
@media (max-width: 1040px) {
  .family-history.has-map { grid-template-columns: 1fr; }
  .family-history-side { position: static; order: -1; }
  .family-history-side .family-map.is-tall { height: clamp(280px, 48vh, 420px); }
}
@media (max-width: 520px) {
  .history-stats { grid-template-columns: 1fr 1fr; }
}

/* ---------------------------------------------- Familia → en camino --- */
/* premium-family-trips.js */
.family-summary-main { display: grid; gap: 16px; min-width: 0; align-content: start; }
.trip-card.is-active { border-color: rgba(37, 99, 235, 0.35); background: linear-gradient(180deg, var(--tint-f3f7ff, #f3f7ff), var(--paper) 120px); }
.trip-list { margin: 0; }
.trip-heading { color: var(--ink-2563eb, #2563eb); font-weight: 600; font-size: 13px; }
.family-fact .is-late, .family-fact.is-late { color: var(--ink-b25e09, #b25e09); font-weight: 600; }
.family-fact .is-trip, .is-trip { color: var(--ink-2563eb, #2563eb); }
.trip-mine { color: var(--muted); font-size: 12px; }
.trip-dest-pin { width: 28px; height: 28px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 50%; color: #fff; background: #2563eb; box-shadow: 0 2px 6px rgba(16, 37, 46, 0.35); }

/* ---------------------------------------------------- vehicle tracker --- */
/* premium-vehicles.js */
.vehicle-list { margin: 0; }
.vehicle-badge { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; color: #fff; background: #6b7c82; }
.vehicle-badge.is-ok { background: var(--ok); }
.vehicle-badge.is-danger { background: var(--alarm); }
.vehicle-status { padding: 2px 9px; border-radius: 999px; color: var(--muted); background: var(--mist); font: 600 11.5px/1.5 var(--body); }
.vehicle-status.is-ok { color: var(--ink-1d6b50, #1d6b50); background: var(--ok-soft); }
.vehicle-status.is-danger { color: #fff; background: var(--alarm); }
.vehicle-row.is-moving { border-color: rgba(217, 54, 44, 0.45); background: var(--alarm-soft); }
.vehicle-note { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.vehicle-how { display: grid; gap: 6px; margin: 4px 0 14px; padding-left: 20px; color: var(--ink); font-size: 13px; line-height: 1.5; }
.vehicle-pin { width: 34px; height: 34px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 50%; color: #fff; background: #6b7c82; box-shadow: 0 2px 8px rgba(16, 37, 46, 0.35); }
.vehicle-pin.is-ok { background: var(--ok); }
.vehicle-pin.is-danger { background: var(--alarm); animation: vehicle-pulse 1.6s ease-out infinite; }
@keyframes vehicle-pulse { 0% { box-shadow: 0 0 0 0 rgba(217, 54, 44, 0.55); } 100% { box-shadow: 0 0 0 14px rgba(217, 54, 44, 0); } }
.pair-code { margin: 8px 0 6px; padding: 18px; border-radius: 14px; color: var(--night); background: var(--mist); font: 700 34px/1 var(--display); letter-spacing: 0.12em; text-align: center; font-variant-numeric: tabular-nums; }
.pair-expiry { text-align: center; }
@media (prefers-reduced-motion: reduce) { .vehicle-pin.is-danger { animation: none; } }
