:root {
  --bg: #f6f4fb;
  --panel: rgba(253, 252, 255, 0.97);
  --panel-strong: #ffffff;
  --ink: #241f32;
  --muted: #736d88;
  --line: rgba(36, 31, 50, 0.08);
  --line-strong: rgba(36, 31, 50, 0.16);
  --accent: #6f61d8;
  --accent-soft: rgba(111, 97, 216, 0.12);
  --accent-2: #65b8a6;
  --success: #4f9f88;
  --danger: #d56d74;
  --warning: #d09a56;
  --radius: 18px;
  --shadow: 0 20px 55px rgba(20, 30, 50, 0.08);
}

body[data-theme="night"] {
  --bg: #171420;
  --panel: rgba(28, 24, 40, 0.94);
  --panel-strong: #231f32;
  --ink: #f1edff;
  --muted: #afa9c5;
  --line: rgba(241, 237, 255, 0.08);
  --line-strong: rgba(241, 237, 255, 0.18);
  --accent: #9c8dff;
  --accent-soft: rgba(156, 141, 255, 0.18);
  --accent-2: #8fd0c2;
  --success: #8fd0c2;
  --danger: #ff9da2;
  --warning: #f0be6f;
  --shadow: 0 22px 58px rgba(0, 0, 0, 0.34);
}

body[data-theme="dawn"] {
  --bg: #fff6f1;
  --panel: rgba(255, 253, 251, 0.97);
  --panel-strong: #ffffff;
  --ink: #33241e;
  --muted: #8d7468;
  --line: rgba(51, 36, 30, 0.08);
  --line-strong: rgba(51, 36, 30, 0.16);
  --accent: #cf7b68;
  --accent-soft: rgba(207, 123, 104, 0.12);
  --accent-2: #dcb07a;
  --success: #7da78a;
  --danger: #cf7b68;
  --warning: #dcb07a;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(111, 97, 216, 0.1), transparent 28%),
    radial-gradient(circle at bottom right, rgba(101, 184, 166, 0.1), transparent 22%),
    var(--bg);
}

h1, h2, h3, h4 {
  font-family: "Segoe UI", Arial, sans-serif;
}

button, input, select, textarea {
  font: inherit;
}

.welcome-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(244, 246, 251, 0.92);
  backdrop-filter: blur(12px);
}

.welcome-card {
  width: min(980px, 100%);
  padding: 44px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.welcome-card h1 {
  margin-top: 18px;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 0.95;
}

.welcome-card p {
  margin-top: 16px;
  max-width: 720px;
  color: var(--muted);
  font-size: 17px;
}

.welcome-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 22px;
  margin-top: 28px;
}

.welcome-panel,
.panel,
.stat-card,
.hero-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.welcome-panel {
  padding: 22px;
}

.welcome-panel h3 {
  font-size: 30px;
  margin-bottom: 12px;
}

.feature-list,
.list {
  display: grid;
  gap: 10px;
}

.feature-item,
.list-item {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.welcome-actions {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.btn,
.welcome-btn {
  border: none;
  border-radius: 14px;
  padding: 14px 18px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:hover,
.welcome-btn:hover {
  transform: translateY(-1px);
}

.btn-primary,
.welcome-btn.primary {
  background: linear-gradient(135deg, var(--accent), #6f90ff);
  color: #fff;
}

.btn-secondary,
.welcome-btn.secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}

.btn-danger {
  background: rgba(180, 95, 85, 0.12);
  color: var(--danger);
  border: 1px solid rgba(180, 95, 85, 0.2);
}

.app-shell {
  display: none;
  min-height: 100vh;
}

.app-shell.active {
  display: flex;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 296px;
  padding: 24px 18px 20px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.9);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.sidebar-header {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(68, 107, 255, 0.12), rgba(30, 167, 161, 0.12));
  border: 1px solid var(--line);
  margin-bottom: 18px;
}

.sidebar-header h2 {
  margin-top: 10px;
  font-size: 28px;
}

.sidebar-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.nav-group {
  margin-bottom: 18px;
}

.nav-group-title {
  padding: 8px 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(68, 107, 255, 0.06);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(68, 107, 255, 0.14), rgba(30, 167, 161, 0.14));
  border-color: rgba(68, 107, 255, 0.16);
  color: var(--accent);
  font-weight: 700;
}

.nav-index {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
}

.sidebar-footer {
  position: sticky;
  bottom: 0;
  padding-top: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,0.96) 24%);
}

.sidebar-footer .btn {
  width: 100%;
  margin-top: 10px;
}

.save-status {
  margin-top: 10px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
}

.main {
  margin-left: 296px;
  width: calc(100% - 296px);
  padding: 32px;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.page-header {
  margin-bottom: 20px;
}

.page-header h1 {
  font-size: clamp(38px, 5vw, 62px);
  line-height: 0.98;
}

.page-header p,
.mini-note,
.lead {
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
}

.hero-card,
.panel,
.stat-card {
  padding: 22px;
}

.hero-card {
  background: linear-gradient(135deg, rgba(68, 107, 255, 0.12), rgba(30, 167, 161, 0.12)), var(--panel);
}

.hero-title {
  margin-top: 10px;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 0.98;
}

.hero-meta,
.tag-row,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-meta {
  margin-top: 16px;
}

.pill,
.chip,
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.pill,
.chip,
.status.soft {
  background: #fff;
  border: 1px solid var(--line);
}

.status.yes {
  background: rgba(63, 143, 87, 0.12);
  border: 1px solid rgba(63, 143, 87, 0.18);
  color: var(--success);
}

.status.no {
  background: rgba(180, 95, 85, 0.12);
  border: 1px solid rgba(180, 95, 85, 0.18);
  color: var(--danger);
}

.status.pending {
  background: rgba(176, 134, 43, 0.12);
  border: 1px solid rgba(176, 134, 43, 0.18);
  color: var(--warning);
}

.status.overdue {
  background: rgba(207, 91, 83, 0.12);
  border: 1px solid rgba(207, 91, 83, 0.18);
  color: var(--danger);
}

.status.dueSoon {
  background: rgba(211, 154, 54, 0.12);
  border: 1px solid rgba(211, 154, 54, 0.18);
  color: var(--warning);
}

.status.onTrack {
  background: rgba(46, 133, 108, 0.12);
  border: 1px solid rgba(46, 133, 108, 0.18);
  color: var(--success);
}

.cards-4,
.grid-2,
.grid-3,
.field-grid {
  display: grid;
  gap: 18px;
}

.cards-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-2,
.field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stat-value {
  margin-top: 10px;
  font-size: clamp(26px, 3vw, 42px);
  font-weight: 800;
}

.stat-value.micro {
  font-size: clamp(20px, 2vw, 28px);
}

.stat-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  padding: 12px 14px;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.table-wrap {
  overflow-x: auto;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.list-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.progress-shell {
  width: 100%;
  height: 12px;
  background: rgba(25, 32, 44, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.empty {
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  min-width: 220px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.symptom-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.84), transparent 34%),
    linear-gradient(135deg, rgba(111, 97, 216, 0.16), rgba(101, 184, 166, 0.14)),
    var(--panel);
}

.pill.steady,
.status.steady {
  background: rgba(79, 159, 136, 0.12);
  border: 1px solid rgba(79, 159, 136, 0.2);
  color: var(--success);
}

.pill.watch,
.status.watch {
  background: rgba(208, 154, 86, 0.12);
  border: 1px solid rgba(208, 154, 86, 0.2);
  color: var(--warning);
}

.pill.rough,
.status.rough {
  background: rgba(213, 109, 116, 0.12);
  border: 1px solid rgba(213, 109, 116, 0.22);
  color: var(--danger);
}

.pill.flare,
.status.flare {
  background: rgba(111, 97, 216, 0.14);
  border: 1px solid rgba(111, 97, 216, 0.22);
  color: var(--accent);
}

.range-readout {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.section-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.compact-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.choice-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.8);
  overflow: hidden;
}

.choice-chip input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}

.choice-chip span {
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 700;
}

.choice-chip.active,
.choice-chip:has(input:checked) {
  background: linear-gradient(135deg, rgba(111, 97, 216, 0.14), rgba(101, 184, 166, 0.14));
  border-color: rgba(111, 97, 216, 0.24);
  color: var(--accent);
}

.day-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.day-pill {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  text-align: center;
  background: rgba(255, 255, 255, 0.72);
}

.day-pill strong,
.calendar-day strong {
  display: block;
}

.day-pill span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.day-pill.steady,
.calendar-day.steady {
  background: rgba(79, 159, 136, 0.1);
}

.day-pill.watch,
.calendar-day.watch {
  background: rgba(208, 154, 86, 0.1);
}

.day-pill.rough,
.calendar-day.rough {
  background: rgba(213, 109, 116, 0.1);
}

.day-pill.flare,
.calendar-day.flare {
  background: rgba(111, 97, 216, 0.12);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.calendar-day {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.76);
  text-align: left;
  cursor: pointer;
  min-height: 112px;
}

.calendar-day:hover {
  transform: translateY(-1px);
}

.calendar-date {
  display: inline-block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
}

.calendar-day small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.calendar-day.empty {
  background: rgba(255, 255, 255, 0.6);
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 5px;
  display: inline-block;
}

.legend-swatch.steady { background: rgba(79, 159, 136, 0.22); }
.legend-swatch.watch { background: rgba(208, 154, 86, 0.22); }
.legend-swatch.rough { background: rgba(213, 109, 116, 0.22); }
.legend-swatch.flare { background: rgba(111, 97, 216, 0.24); }

.pattern-list {
  display: grid;
  gap: 12px;
}

.pattern-row {
  display: grid;
  grid-template-columns: 140px 1fr 34px;
  gap: 10px;
  align-items: center;
}

.pattern-label,
.pattern-value {
  font-size: 13px;
}

.pattern-bar-shell {
  height: 12px;
  border-radius: 999px;
  background: rgba(36, 31, 50, 0.08);
  overflow: hidden;
}

.pattern-bar {
  height: 100%;
  border-radius: inherit;
}

.pattern-bar.symptom {
  background: linear-gradient(90deg, var(--accent), #9c8dff);
}

.pattern-bar.trigger {
  background: linear-gradient(90deg, var(--accent-2), #9ed4c8);
}

.summary-box {
  margin-top: 10px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 14px;
  overflow-x: auto;
}

.pet-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.8), transparent 34%),
    linear-gradient(135deg, rgba(46, 133, 108, 0.16), rgba(211, 154, 54, 0.14)),
    var(--panel);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-width: 320px;
}

.hero-metric {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
}

.hero-metric strong {
  display: block;
  font-size: 26px;
}

.hero-metric span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.chart-panel {
  overflow: hidden;
}

.donut-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto;
}

.donut-chart {
  width: 160px;
  height: 160px;
  transform: rotate(-90deg);
}

.donut-track,
.donut-ring {
  fill: none;
  stroke-width: 14;
}

.donut-track {
  stroke: rgba(23, 38, 32, 0.08);
}

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.donut-center strong {
  font-size: 28px;
}

.donut-center span {
  width: 84px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.chart-legend {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.mini-bars {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 180px;
  padding-top: 8px;
}

.mini-bar-col {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.mini-bar {
  width: 28px;
  min-height: 18px;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
}

.mini-bar-value,
.mini-bar-label {
  font-size: 11px;
}

.mini-bar-value {
  font-weight: 800;
}

.mini-bar-label {
  color: var(--muted);
}

.line-chart {
  width: 100%;
  height: auto;
}

.line-chart-path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
}

.line-chart-dot {
  fill: var(--accent-2);
}

.line-axis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.pet-card-grid {
  display: grid;
  gap: 14px;
}

.pet-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.82), transparent 34%),
    rgba(255, 255, 255, 0.76);
}

.pet-card-top,
.pet-hero-left {
  display: flex;
  gap: 14px;
  align-items: center;
}

.pet-avatar {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  overflow: hidden;
}

.pet-avatar.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pet-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.pet-card-body {
  margin-top: 16px;
}

.pet-next-row {
  display: grid;
  gap: 8px;
}

.pet-mini-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 10px;
}

.pet-mini-metrics div,
.note-card {
  padding: 12px 13px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
}

.pet-mini-metrics strong {
  display: block;
  font-size: 18px;
}

.pet-mini-metrics span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pet-profile-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.hero-actions {
  display: grid;
  gap: 10px;
  min-width: 180px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  cursor: pointer;
}

.chip.active {
  background: linear-gradient(135deg, rgba(46, 133, 108, 0.14), rgba(211, 154, 54, 0.14));
  border-color: rgba(46, 133, 108, 0.22);
  color: var(--accent);
}

.attachment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.attachment-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.attachment-card small {
  display: block;
  margin: 6px 0 12px;
  color: var(--muted);
}

.attachment-thumb {
  width: 100%;
  height: 120px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(46, 133, 108, 0.08);
  border: 1px dashed rgba(46, 133, 108, 0.18);
  color: var(--accent);
  font-size: 24px;
  font-weight: 800;
  overflow: hidden;
}

.attachment-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.note-card {
  min-height: 120px;
  white-space: pre-wrap;
}

.hero-portfolio {
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.88), transparent 36%),
    linear-gradient(135deg, rgba(47, 126, 99, 0.16), rgba(159, 122, 57, 0.14)),
    var(--panel);
}

.hero-report {
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.86), transparent 36%),
    linear-gradient(135deg, rgba(159, 122, 57, 0.14), rgba(47, 126, 99, 0.14)),
    var(--panel);
}

.visuals .panel {
  overflow: hidden;
}

.occupancy-layout {
  display: grid;
  grid-template-columns: 188px 1fr;
  gap: 18px;
  align-items: center;
}

.donut-wrap {
  display: flex;
  justify-content: center;
}

.donut-wrap.compact {
  max-width: 188px;
  margin: 0 auto;
}

.chart-donut,
.chart-line {
  width: 100%;
  height: auto;
}

.chart-center {
  font-size: 14px;
  fill: #244f43;
  font-weight: 800;
}

.chart-sub {
  font-size: 10px;
  fill: #73776e;
}

.legend-stack {
  display: grid;
  gap: 10px;
}

.legend-card {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 0 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
}

.legend-card strong,
.property-name,
.mini-value {
  font-size: 18px;
  font-weight: 800;
}

.legend-card small,
.property-address {
  color: var(--muted);
  font-size: 12px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-good { background: var(--success); }
.dot-warn { background: var(--warning); }
.dot-soft { background: rgba(24, 33, 26, 0.28); }

.cash-bars {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  min-height: 190px;
  margin-top: 8px;
}

.cash-col {
  text-align: center;
}

.cash-col-stack {
  height: 132px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 6px;
}

.cash-bar {
  width: 22px;
  border-radius: 10px 10px 0 0;
}

.cash-bar.rent {
  background: linear-gradient(180deg, #5aaa89, #2f7e63);
}

.cash-bar.expense {
  background: linear-gradient(180deg, #d5b06c, #9f7a39);
}

.cash-label,
.cash-meta {
  margin-top: 6px;
  font-size: 11px;
}

.cash-label {
  color: var(--muted);
  font-weight: 700;
}

.cash-meta {
  color: var(--ink);
  font-weight: 800;
}

.property-grid {
  display: grid;
  gap: 14px;
}

.property-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
}

.property-card.compact {
  padding: 14px;
}

.property-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.property-address {
  margin-top: 6px;
}

.property-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.property-metrics.single {
  grid-template-columns: 1fr;
}

.property-metrics div,
.highlight-card,
.status-banner.plain {
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(245, 242, 234, 0.72);
}

.property-metrics span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.property-metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 16px;
}

.highlight-card {
  margin-top: 12px;
}

.list-item.stack {
  align-items: flex-start;
}

.list-item.stack > div {
  flex: 1;
}

.status-banner.plain strong {
  display: block;
  margin-bottom: 6px;
}

.mini-value {
  margin-top: 8px;
}

.action-row select {
  min-width: 220px;
}

.code-block {
  display: block;
  padding: 12px 14px;
  border-radius: 14px;
  background: #101621;
  color: #dce7ff;
  overflow-x: auto;
  font-family: Consolas, monospace;
  font-size: 13px;
}

@media (max-width: 1180px) {
  .cards-4,
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .symptom-hero,
  .pet-hero,
  .pet-profile-hero {
    display: grid;
  }
}

@media (max-width: 980px) {
  .app-shell.active {
    display: block;
  }

  .sidebar {
    position: relative;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .main {
    margin-left: 0;
    width: 100%;
    padding: 22px;
  }

  .welcome-grid,
  .grid-2,
  .field-grid,
  .occupancy-layout {
    grid-template-columns: 1fr;
  }

  .hero-metrics {
    min-width: 0;
  }

  .day-strip,
  .calendar-grid,
  .compact-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cash-bars {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .cards-4,
  .grid-3,
  .field-grid.three,
  .property-metrics,
  .cash-bars {
    grid-template-columns: 1fr;
  }

  .hero-metrics,
  .compact-cards,
  .pet-mini-metrics,
  .attachment-grid,
  .mini-bars,
  .line-axis {
    grid-template-columns: 1fr;
  }

  .day-strip,
  .calendar-grid,
  .pattern-row {
    grid-template-columns: 1fr;
  }
}


/* Installable browser PWA additions */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body.drawer-open {
  overflow: hidden;
}

.mobile-topbar,
.mobile-drawer,
.mobile-drawer-scrim,
.mobile-tabbar {
  display: none;
}

.mobile-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 35;
  align-items: center;
  gap: 10px;
  min-height: calc(68px + var(--safe-top));
  padding: calc(10px + var(--safe-top)) 12px 10px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.mobile-title {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 2px;
}

.mobile-title strong,
.mobile-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-title span {
  color: var(--muted);
  font-size: 12px;
}

.mobile-topbar .btn,
.mobile-drawer .btn {
  min-width: 0;
  padding: 10px 12px;
}

.mobile-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 8px 8px calc(8px + var(--safe-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.mobile-tab-btn {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 9px 4px;
  font-size: 12px;
  font-weight: 800;
}

.mobile-tab-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(111, 97, 216, 0.3);
}

.mobile-drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 38;
  background: rgba(23, 37, 31, 0.38);
}

.mobile-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 39;
  width: min(390px, 92vw);
  max-height: 100dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: calc(18px + var(--safe-top)) 16px calc(18px + var(--safe-bottom));
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: -20px 0 50px rgba(23, 37, 31, 0.18);
}

.mobile-drawer-header,
.mobile-drawer-actions {
  display: grid;
  gap: 10px;
}

.mobile-drawer-header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  margin-bottom: 14px;
}

.mobile-drawer-actions {
  margin-bottom: 14px;
}

.app-shell.drawer-open .mobile-drawer,
.app-shell.drawer-open .mobile-drawer-scrim {
  display: block;
}

@media (pointer: coarse), (max-width: 980px) {
  html,
  body {
    height: 100% !important;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: hidden !important;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  body:not(.drawer-open) {
    position: static !important;
    overflow-y: hidden !important;
  }

  .app-shell {
    width: 100%;
    max-width: 100%;
  }

  .main,
  .page-stack,
  .page.active {
    height: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
  }

  .welcome-screen {
    position: fixed;
    inset: 0;
    min-height: 0;
    height: 100dvh !important;
    align-items: flex-start;
    padding: calc(18px + var(--safe-top)) 14px calc(18px + var(--safe-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .welcome-card {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 980px) {
  .app-shell.active {
    display: block;
    position: fixed !important;
    inset: 0 !important;
    width: 100%;
    max-width: 100%;
    height: 100dvh !important;
    max-height: 100dvh !important;
    min-height: 0;
    padding-top: calc(74px + var(--safe-top));
    padding-bottom: calc(78px + var(--safe-bottom));
    overflow-x: hidden;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
  }

  .mobile-topbar {
    display: flex;
  }

  .mobile-tabbar {
    display: grid;
  }

  .sidebar {
    display: none;
  }

  .main {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    padding: 16px;
  }

  .welcome-grid,
  .today-hero,
  .today-visual-grid,
  .grid-2,
  .grid-3,
  .cards-3,
  .cards-4,
  .field-grid,
  .field-grid.three,
  .mobile-drawer-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel,
  .stat-card,
  .mini-card,
  .med-card,
  .welcome-panel {
    padding: 16px;
    border-radius: 16px;
  }

  .page-header h1 {
    font-size: 34px;
    line-height: 1;
  }

  .panel-header,
  .list-item,
  .med-header,
  .action-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .tag-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .table-wrap {
    overflow-x: auto;
    max-width: 100%;
  }
}


.mobile-drawer {
  background: var(--panel-strong, #ffffff) !important;
  border-left: 1px solid var(--line-strong, rgba(36, 31, 50, 0.16));
  box-shadow: -22px 0 54px rgba(36, 31, 50, 0.28);
}

.mobile-drawer-scrim {
  background: rgba(36, 31, 50, 0.48);
  backdrop-filter: blur(2px);
}


@media (display-mode: standalone) and (min-width: 981px) {
  html,
  body {
    height: auto !important;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto !important;
  }

  body:not(.drawer-open) {
    overflow-y: auto !important;
  }

  .app-shell.active {
    display: flex;
    position: static !important;
    inset: auto !important;
    width: 100%;
    min-height: 100vh;
    height: auto !important;
    max-height: none !important;
    padding-top: 0;
    padding-bottom: 0;
    overflow: visible !important;
  }

  .main {
    margin-left: 296px;
    width: calc(100% - 296px);
    padding: 32px;
    overflow: visible !important;
  }

  .sidebar {
    display: block;
    position: fixed;
    inset: 0 auto 0 0;
    width: 296px;
  }

  .mobile-topbar,
  .mobile-tabbar {
    display: none !important;
  }
}
