:root {
  color-scheme: light;
  --ink: #0b1220;
  --muted: #5b6472;
  --paper: #f4f7fb;
  --surface: #ffffff;
  --line: #d9e1ec;
  --teal: #0ea5e9;
  --teal-dark: #0369a1;
  --mint: #e3f3fd;
  --mint-strong: #a5d8f5;
  --surface-soft: #eaf0f8;
  --coral: #e11d48;
  --coral-soft: #fde4ea;
  --amber: #f59e0b;
  --amber-soft: #fdf0d5;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #e3edff;
  --green: #10b981;
  --shadow: 0 22px 60px rgba(11, 18, 32, 0.12);
  --soft-shadow: 0 14px 34px rgba(11, 18, 32, 0.09);
  --nav-shadow: 0 -14px 34px rgba(11, 18, 32, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
select,
input {
  font: inherit;
}

button {
  border: 0;
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
  background: var(--paper);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  background: var(--blue);
  border-radius: 2px;
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 10px;
  color: var(--teal-dark);
  background: var(--mint);
  border: 1px solid rgba(14, 165, 233, 0.14);
  border-radius: 2px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr);
  gap: 22px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 8px 0 40px;
}

.pet-console {
  display: grid;
  gap: 16px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 14px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: var(--shadow);
}

.pet-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.pet-avatar {
  width: 76px;
  height: 76px;
  overflow: hidden;
  background: var(--mint);
  border: 1px solid var(--line);
  border-radius: 2px;
}

.pet-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 66% 54%;
}

.pet-copy {
  min-width: 0;
}

.pet-copy h2 {
  font-size: 1.9rem;
}

.pet-copy p:last-child {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.pet-check {
  display: grid;
  min-width: 110px;
  min-height: 62px;
  place-items: center;
  padding: 10px;
  color: var(--teal-dark);
  background: var(--mint);
  border: 1px solid rgba(14, 165, 233, 0.16);
  border-radius: 2px;
  text-align: center;
}

.pet-check span {
  font-size: 1.05rem;
  font-weight: 950;
  line-height: 1.1;
}

.pet-check small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

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

.need-tile {
  min-width: 0;
  padding: 13px;
  background: #f1f5fa;
  border: 1px solid var(--line);
  border-radius: 2px;
}

.need-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.need-head span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.need-tile strong {
  display: block;
  margin-bottom: 10px;
  font-size: 1rem;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.quick-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
  font-weight: 850;
}

.quick-action:hover {
  border-color: rgba(37, 99, 235, 0.28);
  background: var(--blue-soft);
}

.routine-tools {
  display: grid;
  grid-template-columns: 1fr 1.32fr;
  gap: 16px;
  padding-top: 2px;
}

.routine-tool {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.routine-form {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr) auto;
  align-items: end;
  gap: 10px;
}

.routine-form .quick-action {
  min-width: 92px;
}

.alert-form {
  grid-template-columns: minmax(92px, 0.68fr) minmax(112px, 0.88fr) minmax(0, 1.2fr) auto;
}

.alert-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.alert-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 8px 10px;
  color: var(--muted);
  background: #f1f5fa;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 0.84rem;
  font-weight: 760;
}

.alert-list strong {
  color: var(--ink);
}

.alert-list .is-urgent {
  color: #9f1239;
  background: #fff1f3;
  border-color: rgba(225, 29, 72, 0.34);
}

.park-console {
  display: grid;
  gap: 16px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 14px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: var(--shadow);
}

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

.park-header p:last-child {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.park-badge {
  display: grid;
  flex: 0 0 110px;
  min-height: 62px;
  place-items: center;
  padding: 10px;
  color: var(--muted);
  background: #f1f5fa;
  border: 1px solid var(--line);
  border-radius: 2px;
  text-align: center;
}

.park-badge.is-active {
  color: var(--teal-dark);
  background: var(--mint);
  border-color: rgba(14, 165, 233, 0.24);
}

.park-badge span {
  font-size: 1.05rem;
  font-weight: 950;
  line-height: 1.1;
}

.park-badge small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.park-controls {
  display: grid;
  grid-template-columns: 1.1fr 0.72fr 0.82fr 0.9fr 0.9fr auto;
  align-items: end;
  gap: 10px;
}

.park-actions {
  display: flex;
  gap: 8px;
  min-width: 0;
}

.park-actions .primary-action,
.park-actions .icon-action {
  min-height: 42px;
  white-space: nowrap;
}

.park-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.summary-tile {
  min-width: 0;
  padding: 12px;
  background: #f1f5fa;
  border: 1px solid var(--line);
  border-radius: 2px;
}

.summary-tile span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.summary-tile strong {
  display: block;
  overflow-wrap: anywhere;
}

.park-feed {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.match-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
}

.match-card.is-recommended {
  border-color: rgba(14, 165, 233, 0.34);
  background: #f1f5fa;
}

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

.match-top strong {
  display: block;
  font-size: 1.02rem;
}

.match-top small {
  color: var(--muted);
  font-weight: 760;
}

.match-score {
  flex: 0 0 auto;
  padding: 5px 8px;
  color: var(--teal-dark);
  background: var(--mint);
  border-radius: 2px;
  font-size: 0.78rem;
  font-weight: 900;
}

.match-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
}

.match-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.match-tags span {
  padding: 5px 7px;
  color: var(--teal-dark);
  background: var(--mint);
  border-radius: 2px;
  font-size: 0.72rem;
  font-weight: 850;
}

.match-card .quick-action {
  min-height: 38px;
}

.listening-studio,
.meaning-panel {
  min-width: 0;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: var(--shadow);
}

.listening-studio {
  overflow: hidden;
}

.studio-media {
  position: relative;
  min-height: 292px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #dce9e4;
}

.studio-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-overlay {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 10px;
  color: #fff;
  background: rgba(11, 18, 32, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 2px;
  font-size: 0.86rem;
  font-weight: 800;
  backdrop-filter: blur(10px);
}

.live-dot {
  width: 9px;
  height: 9px;
  background: var(--amber);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(242, 184, 75, 0.5);
}

.is-recording .live-dot {
  background: var(--coral);
  animation: pulse 1.3s infinite;
}

.studio-controls,
.meaning-panel {
  padding: 22px;
}

.studio-controls {
  display: grid;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 720px;
  margin: 0;
  font-size: 3.05rem;
  line-height: 1.06;
}

h2 {
  margin: 0;
  font-size: 2.25rem;
  line-height: 1.08;
}

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

.primary-action,
.icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 2px;
  cursor: pointer;
  font-weight: 850;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.primary-action {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.22);
}

.primary-action:hover,
.icon-action:hover {
  transform: translateY(-1px);
}

.primary-action:active,
.icon-action:active {
  transform: translateY(0);
}

.primary-action:disabled,
.icon-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  box-shadow: none;
}

.icon-action {
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.signal-surface {
  position: relative;
  width: 100%;
  min-height: 150px;
  overflow: hidden;
  background: #ffffff;
  background-size: 28px 28px;
  border: 1px solid var(--line);
  border-radius: 2px;
}

#wave-canvas {
  display: block;
  width: 100%;
  height: 150px;
}

.listening-timer {
  position: absolute;
  right: 12px;
  top: 10px;
  min-width: 58px;
  padding: 5px 8px;
  color: var(--teal-dark);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  text-align: center;
}

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

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

select,
input[type="range"],
input[type="number"],
input[type="datetime-local"] {
  width: 100%;
}

select,
input[type="number"],
input[type="datetime-local"] {
  height: 42px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-weight: 750;
}

input[type="range"] {
  accent-color: var(--coral);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.gesture-board {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: #f1f5fa;
  border: 1px solid var(--line);
  border-radius: 2px;
}

.gesture-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.gesture-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 40px;
  padding: 8px 9px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 780;
}

.gesture-chip input {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  accent-color: var(--coral);
}

.gesture-chip span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.gesture-chip:has(input:checked) {
  color: var(--ink);
  background: #fff6f3;
  border-color: rgba(225, 29, 72, 0.42);
}

.meaning-panel {
  display: grid;
  gap: 18px;
  align-content: start;
}

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

.confidence {
  display: grid;
  flex: 0 0 96px;
  min-height: 74px;
  place-items: center;
  padding: 10px;
  color: var(--teal-dark);
  background: var(--mint);
  border: 1px solid rgba(14, 165, 233, 0.16);
  border-radius: 2px;
  text-align: center;
}

.confidence span {
  font-size: 1.55rem;
  font-weight: 950;
  line-height: 1;
}

.confidence small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.message-copy,
.next-step p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

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

.metric-tile {
  min-width: 0;
  padding: 14px;
  background: #f1f5fa;
  border: 1px solid var(--line);
  border-radius: 2px;
}

.metric-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.metric-tile strong {
  display: block;
  min-height: 24px;
  margin-bottom: 10px;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.meter {
  height: 8px;
  overflow: hidden;
  background: #e4ebf4;
  border-radius: 2px;
}

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--blue);
  border-radius: inherit;
  transition: width 240ms ease;
}

.next-step,
.history-block {
  display: grid;
  gap: 10px;
  padding-top: 2px;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 900;
}

.history-list {
  display: grid;
  gap: 8px;
  min-height: 42px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 10px 0;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  line-height: 1.35;
}

.history-list strong {
  color: var(--ink);
}

.history-list time {
  color: var(--teal-dark);
  font-weight: 850;
  white-space: nowrap;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 10;
  max-width: min(520px, calc(100% - 28px));
  padding: 12px 14px;
  color: #fff;
  background: rgba(11, 18, 32, 0.92);
  border-radius: 2px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.45);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(225, 29, 72, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(225, 29, 72, 0);
  }
}

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

  .need-grid,
  .quick-actions,
  .routine-tools,
  .park-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .park-controls,
  .routine-form,
  .alert-form {
    grid-template-columns: 1fr;
  }

  .park-feed {
    grid-template-columns: 1fr;
  }

  .meaning-panel {
    order: -1;
  }
}

@media (max-width: 620px) {
  .topbar,
  .workspace {
    width: min(100% - 22px, 1180px);
  }

  .privacy-pill span {
    display: none;
  }

  .studio-controls,
  .meaning-panel {
    padding: 16px;
  }

  .pet-console {
    width: min(100% - 22px, 1180px);
    padding: 14px;
  }

  .park-console {
    width: min(100% - 22px, 1180px);
    padding: 14px;
  }

  .park-header {
    display: grid;
  }

  .park-badge {
    width: 100%;
    min-height: 56px;
    grid-template-columns: auto 1fr;
    justify-items: start;
    column-gap: 8px;
  }

  .park-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .pet-main {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .pet-check {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 56px;
    grid-template-columns: auto 1fr;
    justify-items: start;
    column-gap: 8px;
  }

  .pet-copy h2 {
    font-size: 1.48rem;
  }

  .studio-media {
    min-height: 214px;
  }

  h1 {
    font-size: 2.08rem;
  }

  h2 {
    font-size: 1.72rem;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
  }

  .primary-action {
    grid-column: 1 / -1;
  }

  .control-grid,
  .insight-grid,
  .gesture-grid,
  .need-grid,
  .quick-actions,
  .routine-tools,
  .park-summary {
    grid-template-columns: 1fr;
  }

  .meaning-header {
    display: grid;
  }

  .confidence {
    width: 100%;
    min-height: 62px;
    grid-template-columns: auto 1fr;
    justify-items: start;
    column-gap: 8px;
  }
}

/* Mobile app shell */
body {
  background: #dfe7f2;
}

.app-shell {
  position: relative;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: 140px;
  background: var(--paper);
  overflow-x: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 6;
  width: 100%;
  padding: 12px 14px;
  background: rgba(246, 248, 251, 0.94);
  border-bottom: 1px solid rgba(215, 223, 235, 0.82);
  backdrop-filter: blur(14px);
}

.brand-mark {
  flex-basis: 34px;
  width: 34px;
  height: 34px;
}

.privacy-pill {
  min-height: 32px;
  padding: 5px 9px;
}

.pet-console,
.park-console,
.workspace {
  width: calc(100% - 24px);
  margin: 12px auto;
  padding: 14px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 2px;
  box-shadow: none;
}

.workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.app-shell[data-screen="today"] .park-console,
.app-shell[data-screen="today"] .workspace,
.app-shell[data-screen="park"] .pet-console,
.app-shell[data-screen="park"] .workspace,
.app-shell[data-screen="signals"] .pet-console,
.app-shell[data-screen="signals"] .park-console {
  display: none;
}

.app-shell[data-screen="alerts"] .park-console,
.app-shell[data-screen="alerts"] .workspace {
  display: none;
}

.app-shell[data-screen="today"] .routine-tools {
  display: none;
}

.app-shell[data-screen="today"] .alerts-intro,
.app-shell[data-screen="signals"] .alerts-intro,
.app-shell[data-screen="park"] .alerts-intro {
  display: none;
}

.app-shell[data-screen="alerts"] .pet-hero,
.app-shell[data-screen="alerts"] .photo-manager,
.app-shell[data-screen="alerts"] .snap-result,
.app-shell[data-screen="alerts"] .check-result,
.app-shell[data-screen="alerts"] .gauge-grid,
.app-shell[data-screen="alerts"] .diary-block,
.app-shell[data-screen="alerts"] .pattern-block {
  display: none;
}

.app-shell[data-screen="alerts"] .routine-tools {
  display: grid;
  grid-template-columns: 1fr;
}

h1 {
  font-size: 1.75rem;
  line-height: 1.1;
}

h2,
.pet-copy h2 {
  font-size: 1.55rem;
  line-height: 1.12;
}

.pet-main {
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
}

.pet-avatar {
  width: 58px;
  height: 58px;
}

.pet-check {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 48px;
  grid-template-columns: auto 1fr;
  justify-items: start;
  column-gap: 8px;
}

.care-recommendation {
  display: grid;
  gap: 12px;
  padding: 14px;
  color: #fff;
  background: var(--teal);
  border-radius: 2px;
}

.care-recommendation strong {
  display: block;
  margin-top: 4px;
  font-size: 1.18rem;
  line-height: 1.2;
}

.care-recommendation p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.42;
}

.recommendation-label {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.care-recommendation .primary-action {
  width: 100%;
  color: var(--teal-dark);
  background: #fff;
  box-shadow: none;
}

.alerts-intro {
  display: grid;
  gap: 4px;
  margin-bottom: 2px;
}

.alerts-intro h2 {
  margin: 0;
}

.alerts-intro p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.need-grid,
.quick-actions,
.park-summary,
.routine-tools,
.park-feed {
  grid-template-columns: 1fr;
}

.need-grid {
  gap: 8px;
}

.need-tile {
  padding: 11px;
}

.quick-actions {
  gap: 8px;
}

.quick-action,
.primary-action,
.icon-action {
  min-height: 46px;
  border-radius: 2px;
}

.routine-form,
.alert-form,
.park-controls {
  grid-template-columns: 1fr;
}

.park-header {
  display: grid;
}

.park-badge {
  width: 100%;
  min-height: 48px;
  grid-template-columns: auto 1fr;
  justify-items: start;
  column-gap: 8px;
}

.park-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.park-feed {
  gap: 8px;
}

.match-card {
  padding: 12px;
}

.listening-studio,
.meaning-panel {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.studio-media {
  display: none;
}

.studio-controls,
.meaning-panel {
  padding: 0;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.primary-action {
  grid-column: 1 / -1;
}

.signal-surface {
  min-height: 112px;
}

#wave-canvas {
  height: 112px;
}

.control-grid,
.insight-grid,
.gesture-grid {
  grid-template-columns: 1fr;
}

.meaning-panel {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.meaning-header {
  display: grid;
}

.confidence {
  width: 100%;
  min-height: 54px;
  grid-template-columns: auto 1fr;
  justify-items: start;
  column-gap: 8px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 9;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  width: min(480px, 100%);
  padding: 8px 10px max(8px, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  transform: translateX(-50%);
  backdrop-filter: blur(16px);
}

.bottom-nav-item {
  display: grid;
  place-items: center;
  gap: 3px;
  min-width: 0;
  min-height: 54px;
  color: var(--muted);
  background: transparent;
  border-radius: 2px;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 850;
}

.bottom-nav-item svg {
  width: 20px;
  height: 20px;
}

.bottom-nav-item.is-active {
  color: #fff;
  background: var(--blue);
}

.toast {
  bottom: 82px;
}

@media (min-width: 760px) {
  .app-shell {
    min-height: calc(100vh - 32px);
    margin-top: 16px;
    margin-bottom: 16px;
    border: 1px solid rgba(208, 217, 230, 0.9);
    border-radius: 2px;
  }

  .bottom-nav {
    border-right: 1px solid rgba(208, 217, 230, 0.9);
    border-left: 1px solid rgba(208, 217, 230, 0.9);
  }
}

/* App polish */
body {
  background: #dfe7f2;
}

.app-shell {
  background: var(--paper);
}

.topbar {
  min-height: 62px;
  padding: 12px 14px 10px;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.screen-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  color: var(--blue-dark);
  background: var(--blue-soft);
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 2px;
  box-shadow: 0 8px 18px rgba(11, 18, 32, 0.06);
  font-size: 0.78rem;
  font-weight: 900;
}

.privacy-pill {
  box-shadow: 0 8px 18px rgba(11, 18, 32, 0.05);
}

.pet-console,
.park-console {
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(215, 223, 235, 0.92);
  box-shadow: var(--soft-shadow);
}

.workspace {
  width: calc(100% - 24px);
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.pet-main {
  min-height: 96px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid rgba(215, 223, 235, 0.92);
  border-left: 4px solid var(--blue);
  border-radius: 2px;
}

.pet-avatar {
  border-color: rgba(37, 99, 235, 0.16);
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.08);
}

.pet-check,
.park-badge,
.confidence {
  background: #fff;
  border-color: rgba(37, 99, 235, 0.12);
}

.care-recommendation {
  grid-template-columns: minmax(0, 1fr);
  background: #16324f;
  box-shadow: 0 14px 30px rgba(22, 50, 79, 0.2);
}

.care-recommendation .primary-action {
  min-height: 48px;
  color: #16324f;
  background: #ffffff;
  border: 1px solid #ffffff;
}

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

.need-tile {
  min-height: 98px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(11, 18, 32, 0.04);
}

.need-tile:nth-child(1) .need-head,
.quick-action[data-care-action="walk"] {
  color: var(--teal-dark);
}

.need-tile:nth-child(1) .meter span {
  background: var(--teal);
}

.need-tile:nth-child(2) .need-head,
.quick-action[data-care-action="food"] {
  color: #8a5d00;
}

.need-tile:nth-child(2) .meter span {
  background: var(--amber);
}

.need-tile:nth-child(3) .need-head,
.quick-action[data-care-action="play"] {
  color: #b9392d;
}

.need-tile:nth-child(3) .meter span {
  background: var(--coral);
}

.need-tile:nth-child(4) .need-head,
.quick-action[data-care-action="ok"] {
  color: #1f7d59;
}

.need-tile:nth-child(4) .meter span {
  background: var(--green);
}

.quick-actions {
  gap: 9px;
}

.quick-action {
  min-height: 54px;
  justify-content: flex-start;
  padding: 0 12px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(11, 18, 32, 0.04);
}

.quick-action svg {
  flex: 0 0 auto;
}

.quick-action:active,
.bottom-nav-item:active {
  transform: scale(0.98);
}

.primary-action {
  grid-column: auto;
}

.routine-tools {
  gap: 12px;
}

.routine-tool {
  padding: 12px;
  background: #fff;
  border: 1px solid rgba(215, 223, 235, 0.96);
  border-radius: 2px;
}

.routine-form,
.alert-form {
  gap: 9px;
}

.park-header {
  padding: 12px;
  background: #fff;
  border: 1px solid rgba(215, 223, 235, 0.96);
  border-radius: 2px;
}

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

.park-controls .field:first-child,
.park-actions {
  grid-column: 1 / -1;
}

.park-actions {
  grid-template-columns: minmax(0, 1fr) 86px;
}

.park-actions .primary-action,
.park-actions .icon-action {
  min-width: 0;
  padding: 0 10px;
}

.park-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.summary-tile {
  min-height: 76px;
  padding: 10px;
  background: #fff;
}

.summary-tile span {
  font-size: 0.66rem;
}

.summary-tile strong {
  font-size: 0.9rem;
}

.match-card {
  background: #fff;
  box-shadow: 0 8px 18px rgba(11, 18, 32, 0.04);
}

.match-card.is-recommended {
  background: var(--blue-soft);
  border-color: rgba(37, 99, 235, 0.16);
}

.listening-studio,
.meaning-panel {
  padding: 14px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(215, 223, 235, 0.96);
  border-radius: 2px;
  box-shadow: var(--soft-shadow);
}

.meaning-panel {
  padding-top: 14px;
  border-top: 1px solid rgba(215, 223, 235, 0.96);
}

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

.toolbar .primary-action {
  grid-column: 1 / -1;
}

.toolbar .icon-action {
  min-width: 0;
  padding: 0 8px;
  font-size: 0.86rem;
}

.signal-surface {
  background: #ffffff;
  background-image: none;
}

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

.gesture-chip {
  min-height: 44px;
  font-size: 0.78rem;
}

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

.metric-tile {
  padding: 10px;
  background: #fff;
}

.metric-tile:nth-child(1) .meter span {
  background: var(--blue);
}

.metric-tile:nth-child(2) .meter span {
  background: var(--teal);
}

.metric-tile:nth-child(3) .meter span {
  background: var(--coral);
}

.metric-label {
  font-size: 0.66rem;
}

.metric-tile strong {
  font-size: 0.92rem;
}

.bottom-nav {
  padding: 8px 10px max(9px, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid rgba(215, 223, 235, 0.96);
  box-shadow: var(--nav-shadow);
}

.bottom-nav-item {
  min-height: 56px;
  transition:
    transform 150ms ease,
    color 150ms ease,
    background 150ms ease;
}

.bottom-nav-item.is-active {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}

.toast {
  bottom: calc(132px + env(safe-area-inset-bottom));
}

@media (max-width: 360px) {
  .brand span:last-child {
    display: none;
  }

  .screen-chip {
    display: none;
  }

  .need-grid,
  .gesture-grid,
  .insight-grid,
  .park-summary {
    grid-template-columns: 1fr;
  }
}

/* Foto del cane e stati */
.pet-hero {
  position: relative;
  height: calc(100dvh - 232px);
  min-height: 430px;
  max-height: 760px;
  overflow: hidden;
  background: var(--mint);
  border: 1px solid rgba(215, 223, 235, 0.92);
  border-radius: 2px;
}

.pet-hero img#hero-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-top {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
}

.mood-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 5px 13px;
  border-radius: 2px;
  font-size: 0.82rem;
  font-weight: 900;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 18px rgba(23, 32, 39, 0.18);
}

.pet-hero[data-mood="relaxed"] .mood-chip {
  color: var(--teal-dark);
  background: rgba(223, 246, 241, 0.92);
}

.pet-hero[data-mood="happy"] .mood-chip {
  color: #8a5d00;
  background: rgba(255, 243, 204, 0.94);
}

.pet-hero[data-mood="asking"] .mood-chip {
  color: var(--blue-dark);
  background: rgba(232, 238, 255, 0.94);
}

.pet-hero[data-mood="tense"] .mood-chip {
  color: #b9392d;
  background: rgba(255, 232, 228, 0.95);
}

.hero-photo-btn {
  display: grid;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #fff;
  background: rgba(11, 18, 32, 0.58);
  border-radius: 2px;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.hero-bottom {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  gap: 4px;
  padding: 84px 14px 14px;
  color: #fff;
  background: linear-gradient(180deg, rgba(23, 32, 39, 0) 0%, rgba(23, 32, 39, 0.82) 72%);
}

.hero-eyebrow {
  margin: 0 0 4px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-bottom h2 {
  margin: 0;
  color: #fff;
  font-size: 1.5rem;
  line-height: 1.12;
}

.hero-bottom p:last-child {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.92rem;
  line-height: 1.4;
}

.photo-manager {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #fff;
  border: 1px solid rgba(215, 223, 235, 0.96);
  border-radius: 2px;
}

.photo-manager[hidden] {
  display: none;
}

.photo-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.photo-slots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.photo-slot {
  position: relative;
  display: grid;
  gap: 4px;
  justify-items: center;
  min-width: 0;
  text-align: center;
}

.photo-slot strong {
  font-size: 0.72rem;
  line-height: 1.2;
}

.photo-slot small {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.25;
}

.photo-slot-pick {
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  padding: 0;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px dashed var(--line);
  border-radius: 2px;
  cursor: pointer;
}

.photo-slot.has-photo .photo-slot-pick {
  border-style: solid;
}

.photo-slot-pick img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-slot-remove {
  position: absolute;
  top: -6px;
  right: -4px;
  z-index: 2;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  padding: 0;
  color: #fff;
  background: rgba(11, 18, 32, 0.82);
  border-radius: 2px;
  cursor: pointer;
}

.photo-slot-remove svg {
  width: 13px;
  height: 13px;
}

/* Scatta foto + AI */
.hero-top-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-check-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  color: #fff;
  background: rgba(11, 18, 32, 0.58);
  border-radius: 2px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 850;
  backdrop-filter: blur(8px);
}

.hero-check-btn svg {
  width: 16px;
  height: 16px;
}

.snap-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.snap-button,
.walk-button {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-height: 68px;
  padding: 10px 8px;
  color: #fff;
  border-radius: 2px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 850;
  backdrop-filter: blur(6px);
}

.snap-button {
  background: rgba(37, 99, 235, 0.94);
  box-shadow: 0 14px 30px rgba(23, 32, 39, 0.3);
}

.walk-button {
  background: rgba(11, 18, 32, 0.92);
  box-shadow: 0 14px 30px rgba(23, 32, 39, 0.3);
}

.walk-button.is-active {
  background: rgba(225, 29, 72, 0.95);
}

.snap-button svg,
.walk-button svg {
  width: 22px;
  height: 22px;
}

.snap-button small,
.walk-button small {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.66rem;
  font-weight: 700;
}

.snap-result,
.check-result {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid rgba(215, 223, 235, 0.96);
  border-radius: 2px;
}

.snap-result[hidden],
.check-result[hidden] {
  display: none;
}

.snap-result img,
.check-result img {
  display: block;
  width: 62px;
  height: 62px;
  object-fit: cover;
  border-radius: 2px;
}

.snap-result-copy strong {
  display: block;
  font-size: 1.05rem;
}

.snap-result-copy small,
.check-copy small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.check-result {
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: start;
}

.check-result .icon-action {
  grid-column: 1 / -1;
  min-height: 40px;
}

.check-copy strong {
  display: block;
  margin: 2px 0 6px;
  font-size: 1.02rem;
}

.check-copy ul {
  display: grid;
  gap: 5px;
  margin: 0 0 8px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

/* Serbatoi dei bisogni */
.gauge-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.gauge {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
  padding: 10px 4px;
  background: #fff;
  border: 1px solid rgba(215, 223, 235, 0.96);
  border-radius: 2px;
  cursor: pointer;
  text-align: center;
}

.gauge-tank {
  position: relative;
  display: block;
  width: 34px;
  height: 64px;
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 2px;
}

.gauge-fill {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: block;
  height: 0%;
  border-radius: inherit;
  transition:
    height 240ms ease,
    background 240ms ease;
}

.gauge[data-level="ok"] .gauge-fill {
  background: var(--green);
}

.gauge[data-level="warn"] .gauge-fill {
  background: var(--amber);
}

.gauge[data-level="low"] .gauge-fill {
  background: var(--coral);
}

.gauge[data-level="low"] {
  border-color: rgba(225, 29, 72, 0.4);
}

.gauge strong {
  font-size: 0.78rem;
}

.gauge small {
  min-height: 2em;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 750;
  line-height: 1.25;
}

/* Diario fotografico e pattern */
.diary-block,
.pattern-block {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #fff;
  border: 1px solid rgba(215, 223, 235, 0.96);
  border-radius: 2px;
}

.diary-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.diary-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.diary-item {
  position: relative;
  display: grid;
  flex: 0 0 108px;
  gap: 3px;
  text-align: left;
}

.diary-item img,
.diary-gone {
  display: block;
  width: 108px;
  height: 84px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 2px;
}

.diary-gone {
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--surface-soft);
}

.diary-item strong {
  font-size: 0.72rem;
}

.diary-item small {
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.3;
}

.diary-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  padding: 0;
  color: #fff;
  background: rgba(11, 18, 32, 0.75);
  border-radius: 2px;
  cursor: pointer;
}

.diary-remove svg {
  width: 12px;
  height: 12px;
}

.pattern-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pattern-list li {
  padding: 9px 10px;
  color: var(--ink);
  background: #f1f5fa;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.45;
}

.pattern-list li.is-alert {
  color: #9f1239;
  background: #fff1f3;
  border-color: rgba(225, 29, 72, 0.34);
}

.pattern-list li.is-muted {
  color: var(--muted);
  background: var(--surface-soft);
  font-weight: 650;
}

/* Barra benessere */
.wellness-bar {
  position: fixed;
  left: 50%;
  bottom: calc(73px + env(safe-area-inset-bottom));
  z-index: 9;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: min(480px, 100%);
  min-height: 44px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid rgba(215, 223, 235, 0.96);
  transform: translateX(-50%);
  backdrop-filter: blur(16px);
}

.wellness-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.wellness-label svg {
  width: 14px;
  height: 14px;
}

.wellness-track {
  display: block;
  height: 12px;
  overflow: hidden;
  background: #e4ebf4;
  border-radius: 2px;
}

.wellness-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  transition:
    width 300ms ease,
    background 300ms ease;
}

.wellness-bar[data-level="ok"] .wellness-track span {
  background: var(--green);
}

.wellness-bar[data-level="warn"] .wellness-track span {
  background: var(--amber);
}

.wellness-bar[data-level="low"] .wellness-track span {
  background: var(--coral);
}

.wellness-bar strong {
  font-size: 0.78rem;
  white-space: nowrap;
}

.wellness-bar[data-level="low"] strong {
  color: #b9392d;
}

/* Onboarding */
.onboarding {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 32, 39, 0.5);
  backdrop-filter: blur(6px);
}

.onboarding[hidden] {
  display: none;
}

.onboarding-card {
  display: grid;
  gap: 12px;
  width: min(400px, 100%);
  padding: 22px 18px;
  background: var(--paper);
  border-radius: 2px;
  box-shadow: var(--shadow);
}

.onboarding-mark {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
  border-radius: 2px;
}

.onboarding-card h2 {
  margin: 0;
  font-size: 1.5rem;
}

.onboarding-card > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.onboarding-card input[type="text"] {
  height: 46px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-weight: 750;
}

.onboard-photo {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 120px;
  overflow: hidden;
  padding: 0;
  background: var(--surface-soft);
  border: 1px dashed var(--line);
  border-radius: 2px;
  cursor: pointer;
}

.onboard-photo img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.onboard-photo img[hidden] {
  display: none;
}

.onboard-photo-empty {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 14px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.onboard-photo-empty[hidden] {
  display: none;
}

/* Tema moderno: crema/inchiostro/corallo, angoli netti, tipografia decisa */
h1,
h2,
.pet-copy h2,
.hero-bottom h2,
.onboarding-card h2 {
  letter-spacing: -0.02em;
  font-weight: 850;
}

.eyebrow,
.hero-eyebrow,
.need-head,
.metric-label,
.wellness-label,
.recommendation-label,
.summary-tile span {
  letter-spacing: 0.08em;
}

.brand {
  letter-spacing: -0.01em;
  font-weight: 850;
}

.brand-mark {
  color: var(--paper);
  background: var(--ink);
}

.topbar {
  background: rgba(244, 247, 251, 0.94);
  border-bottom: 1px solid var(--line);
}

.screen-chip {
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  box-shadow: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.privacy-pill {
  box-shadow: none;
}

.pet-console,
.park-console {
  border: 1px solid var(--line);
  box-shadow: none;
}

.pet-hero {
  border: 1px solid var(--ink);
  box-shadow: 6px 6px 0 rgba(11, 18, 32, 0.12);
}

.mood-chip {
  border: 1px solid var(--ink);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
  backdrop-filter: blur(10px);
  box-shadow: 3px 3px 0 rgba(11, 18, 32, 0.28);
}

.pet-hero[data-mood="relaxed"] .mood-chip {
  color: #0369a1;
  background: rgba(227, 243, 253, 0.96);
}

.pet-hero[data-mood="happy"] .mood-chip {
  color: #047857;
  background: rgba(209, 250, 229, 0.96);
}

.pet-hero[data-mood="asking"] .mood-chip {
  color: #1d4ed8;
  background: rgba(227, 237, 255, 0.96);
}

.pet-hero[data-mood="tense"] .mood-chip {
  color: #fff;
  background: rgba(225, 29, 72, 0.96);
}

.hero-check-btn,
.hero-photo-btn {
  background: rgba(11, 18, 32, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.hero-check-btn {
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.76rem;
}

.snap-button {
  background: rgba(37, 99, 235, 0.96);
  border: 1px solid rgba(11, 18, 32, 0.4);
  box-shadow: 4px 4px 0 rgba(11, 18, 32, 0.35);
}

.walk-button {
  background: rgba(11, 18, 32, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 4px 4px 0 rgba(11, 18, 32, 0.35);
}

.walk-button.is-active {
  background: rgba(14, 165, 233, 0.95);
}

.snap-button:active,
.walk-button:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 rgba(11, 18, 32, 0.35);
}

.gauge {
  border: 1px solid var(--line);
  background: var(--surface);
}

.gauge-tank {
  border: 1px solid var(--ink);
  background: var(--surface);
}

.gauge strong {
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.7rem;
}

.diary-block,
.pattern-block,
.photo-manager,
.snap-result,
.check-result {
  border: 1px solid var(--line);
  background: var(--surface);
}

.pattern-list li {
  background: var(--surface);
  border-left: 3px solid var(--mint-strong);
}

.pattern-list li.is-alert {
  border-left-color: var(--coral);
}

.pattern-list li.is-muted {
  border-left-color: var(--line);
}

.wellness-bar {
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--ink);
}

.wellness-track {
  border: 1px solid var(--ink);
  background: var(--surface);
  height: 14px;
}

.bottom-nav {
  background: var(--paper);
  border-top: 1px solid var(--ink);
  box-shadow: none;
}

.bottom-nav-item {
  color: var(--muted);
  border-radius: 2px;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.bottom-nav-item.is-active {
  color: var(--paper);
  background: var(--ink);
  box-shadow: none;
}

.primary-action {
  background: var(--blue);
  border: 1px solid rgba(11, 18, 32, 0.35);
  box-shadow: 3px 3px 0 rgba(11, 18, 32, 0.2);
}

.primary-action:hover {
  transform: none;
  background: var(--blue-dark);
}

.primary-action:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 rgba(11, 18, 32, 0.2);
}

.icon-action {
  border: 1px solid var(--line);
}

.onboarding {
  background: rgba(11, 18, 32, 0.6);
}

.onboarding-card {
  border: 1px solid var(--ink);
  box-shadow: 8px 8px 0 rgba(11, 18, 32, 0.3);
}

.onboarding-mark {
  color: var(--paper);
  background: var(--blue);
}

.toast {
  background: var(--ink);
  border-radius: 2px;
}

/* Cover a tutto schermo su Oggi */
.app-shell[data-screen="today"] .topbar {
  display: none;
}

.app-shell[data-screen="today"] .pet-console {
  gap: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.app-shell[data-screen="today"] .pet-hero {
  height: calc(100dvh - 118px);
  min-height: 460px;
  max-height: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.app-shell[data-screen="today"] .photo-manager,
.app-shell[data-screen="today"] .snap-result,
.app-shell[data-screen="today"] .check-result {
  margin: 10px 12px 0;
}

.app-shell[data-screen="today"] .gauge-grid {
  margin: 10px 12px;
}

.hero-top {
  padding: 14px 12px;
  background: linear-gradient(180deg, rgba(11, 18, 32, 0.55) 0%, rgba(11, 18, 32, 0) 100%);
}

.hero-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 40px;
  padding: 0 12px;
  color: #fff;
  background: rgba(11, 18, 32, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  backdrop-filter: blur(8px);
  font-size: 0.9rem;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.hero-brand svg {
  width: 16px;
  height: 16px;
}

.hero-bottom .mood-chip {
  justify-self: start;
  margin-bottom: 6px;
}

.hero-bottom {
  padding-bottom: 16px;
}

/* Check con video */
.check-intro {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(11, 18, 32, 0.62);
  backdrop-filter: blur(6px);
}

.check-intro[hidden] {
  display: none;
}

.check-intro-card {
  display: grid;
  gap: 12px;
  width: min(400px, 100%);
  padding: 22px 18px;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 2px;
  box-shadow: 8px 8px 0 rgba(11, 18, 32, 0.3);
}

.check-intro-card h2 {
  margin: 0;
  font-size: 1.5rem;
}

.check-intro-card > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.check-intro-card > p strong {
  color: var(--ink);
}

.check-tips {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 12px 12px 12px 28px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 0.86rem;
  line-height: 1.4;
}

/* Cover vetro: overlay eleganti, semaforo brillante, testi thin */
.app-shell {
  padding-bottom: 96px;
}

.app-shell[data-screen="today"] .pet-hero {
  height: calc(100dvh - 74px);
}

.toast {
  bottom: calc(96px + env(safe-area-inset-bottom));
}

.hero-bottom {
  display: grid;
  gap: 0;
  padding: 0;
  background: linear-gradient(180deg, rgba(11, 18, 32, 0) 0%, rgba(11, 18, 32, 0.55) 55%, rgba(11, 18, 32, 0.72) 100%);
}

.hero-bottom h2 {
  margin: 0;
  padding: 0 18px 14px;
  color: #fff;
  font-size: 2.1rem;
  font-weight: 200;
  letter-spacing: -0.01em;
  line-height: 1.08;
}

.hero-panel {
  width: 100%;
  padding: 12px 18px;
  background: rgba(11, 18, 32, 0.8);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-gauges {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.hero-gauges .gauge {
  display: grid;
  gap: 7px;
  justify-items: stretch;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: 0;
  text-align: left;
}

.hero-gauges .gauge strong {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-gauges .gauge-tank {
  position: relative;
  display: block;
  width: 100%;
  height: 5px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.22);
  border: 0;
  border-radius: 999px;
}

.hero-gauges .gauge-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  transition:
    width 300ms ease,
    background 300ms ease;
}

.gauge[data-level="ok"] .gauge-fill {
  background: #22c55e;
}

.gauge[data-level="warn"] .gauge-fill {
  background: #facc15;
}

.gauge[data-level="low"] .gauge-fill {
  background: #ef4444;
}

.hero-wellness {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.hero-wellness strong {
  min-width: 84px;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 300;
  letter-spacing: 0.02em;
}

.wellness-gradient {
  position: relative;
  display: block;
  height: 7px;
  background: linear-gradient(90deg, #ef4444 0%, #facc15 50%, #22c55e 100%);
  border-radius: 999px;
}

#wellness-marker {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 15px;
  height: 15px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 6px rgba(11, 18, 32, 0.55);
  transform: translate(-50%, -50%);
  transition: left 300ms ease;
}

.hero-bottom .snap-row {
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.snap-button,
.walk-button {
  gap: 3px;
  min-height: 76px;
  border: 0;
  border-radius: 0;
  background: rgba(11, 18, 32, 0.8);
  box-shadow: none;
  backdrop-filter: blur(12px);
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.snap-button {
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.snap-button svg,
.walk-button svg {
  width: 20px;
  height: 20px;
  opacity: 0.9;
}

.snap-button small,
.walk-button small {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.66rem;
  font-weight: 300;
}

.snap-button:active,
.walk-button:active {
  transform: none;
  box-shadow: none;
  background: rgba(37, 99, 235, 0.75);
}

.walk-button.is-active {
  background: rgba(14, 165, 233, 0.8);
}

.hero-top {
  padding: 12px 14px;
}

.hero-brand,
.hero-check-btn,
.hero-photo-btn {
  min-height: 42px;
  color: #fff;
  background: rgba(11, 18, 32, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  box-shadow: none;
}

.hero-photo-btn {
  width: 42px;
}

.hero-brand {
  font-weight: 500;
  letter-spacing: 0.02em;
}

.hero-check-btn {
  font-weight: 400;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
}

/* Rifinitura vetro: pannelli 0.5, tutto fisso, glass buttons */
.app-shell[data-screen="today"] {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  padding-bottom: 0;
}

.hero-panel {
  background: rgba(11, 18, 32, 0.5);
  backdrop-filter: blur(18px) saturate(150%);
}

.hero-brand,
.hero-photo-btn {
  background: rgba(11, 18, 32, 0.42);
  backdrop-filter: blur(16px) saturate(150%);
}

.hero-check-btn {
  color: #fff;
  background: rgba(225, 29, 72, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(16px) saturate(150%);
  font-weight: 600;
}

.hero-bottom {
  background: linear-gradient(180deg, rgba(11, 18, 32, 0) 0%, rgba(11, 18, 32, 0.38) 55%, rgba(11, 18, 32, 0.5) 100%);
}

.hero-bottom .snap-row {
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 14px calc(14px + env(safe-area-inset-bottom) * 0.4);
  border-top: 0;
}

.snap-button,
.walk-button {
  min-height: 72px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  backdrop-filter: blur(16px) saturate(170%);
  box-shadow:
    0 8px 22px rgba(11, 18, 32, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.snap-button {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.04) 42%),
    rgba(37, 99, 235, 0.6);
  border-right: 1px solid rgba(255, 255, 255, 0.38);
}

.walk-button {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.04) 42%),
    rgba(22, 163, 74, 0.6);
}

.snap-button:active,
.walk-button:active {
  transform: scale(0.97);
  background-blend-mode: normal;
}

.snap-button:active {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 42%),
    rgba(37, 99, 235, 0.8);
}

.walk-button:active {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 42%),
    rgba(22, 163, 74, 0.8);
}

.walk-button.is-active {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.04) 42%),
    rgba(14, 165, 233, 0.7);
}

/* Fogli fissi: risultati, foto, menu */
.snap-result {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 13;
  width: min(456px, calc(100% - 20px));
  transform: translateX(-50%);
  box-shadow: var(--shadow);
}

.check-result {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 26;
  width: min(420px, calc(100% - 28px));
  max-height: 80vh;
  overflow: auto;
  transform: translate(-50%, -50%);
  box-shadow: var(--shadow);
}

.photo-manager {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 14;
  width: min(456px, calc(100% - 20px));
  max-height: 62vh;
  overflow: auto;
  transform: translateX(-50%);
  box-shadow: var(--shadow);
}

.app-shell[data-screen="today"] .photo-manager,
.app-shell[data-screen="today"] .snap-result,
.app-shell[data-screen="today"] .check-result {
  margin: 0;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sheet-head strong {
  font-size: 1.1rem;
}

.sheet-close {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
}

.sheet-close svg {
  width: 15px;
  height: 15px;
}

.app-menu {
  position: fixed;
  inset: 0;
  z-index: 24;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(11, 18, 32, 0.55);
  backdrop-filter: blur(6px);
}

.app-menu[hidden] {
  display: none;
}

.app-menu-card {
  display: grid;
  gap: 8px;
  width: min(380px, 100%);
  padding: 18px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: var(--shadow);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
  font-weight: 700;
  text-align: left;
}

.menu-item svg {
  width: 18px;
  height: 18px;
  color: var(--blue);
}

.menu-version {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

.info-sheet {
  position: fixed;
  inset: 0;
  z-index: 27;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(11, 18, 32, 0.55);
  backdrop-filter: blur(6px);
}

.info-sheet[hidden] {
  display: none;
}

.info-card {
  display: grid;
  gap: 12px;
  width: min(400px, 100%);
  padding: 22px 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: var(--shadow);
}

.info-card h2 {
  margin: 0;
  font-size: 1.4rem;
}

.info-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

/* Pagina Check: meta ripresa, meta referto */
.check-page {
  position: fixed;
  inset: 0;
  z-index: 28;
  display: grid;
  grid-template-rows: minmax(0, 46%) minmax(0, 1fr);
  width: min(480px, 100%);
  margin: 0 auto;
  background: var(--paper);
}

.check-page[hidden] {
  display: none;
}

.check-cam {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #0b1220;
}

.check-cam video,
.check-cam img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.check-cam video[hidden],
.check-cam img[hidden] {
  display: none;
}

.check-cam-empty {
  display: grid;
  gap: 10px;
  justify-items: center;
  max-width: 300px;
  padding: 18px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.5;
  text-align: center;
}

.check-cam-empty[hidden] {
  display: none;
}

.check-cam-empty svg {
  width: 28px;
  height: 28px;
  color: #ef4444;
}

.check-cam-empty p {
  margin: 0;
}

.check-start {
  position: absolute;
  bottom: 18px;
  left: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 0 22px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.04) 42%),
    rgba(225, 29, 72, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(14px) saturate(160%);
  box-shadow: 0 8px 22px rgba(11, 18, 32, 0.4);
  font-size: 0.95rem;
  font-weight: 500;
  transform: translateX(-50%);
}

.check-start:active {
  transform: translateX(-50%) scale(0.96);
}

.check-rec {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  color: #fff;
  background: rgba(225, 29, 72, 0.85);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.check-rec[hidden] {
  display: none;
}

.check-page-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  color: #fff;
  background: rgba(11, 18, 32, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
}

.check-report {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  overflow: auto;
}

.check-report > strong {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.check-when {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.check-meters {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 2px;
}

.check-meter {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.check-meter > span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.check-meter-track {
  display: block;
  height: 8px;
  overflow: hidden;
  background: var(--surface-soft);
  border-radius: 999px;
}

.check-meter-track > em {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #2563eb);
  border-radius: inherit;
  transition: width 400ms ease;
}

.check-suggestions {
  display: grid;
  gap: 8px;
}

.check-suggestion {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 2px;
}

.check-suggestion svg {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  color: var(--blue);
}

.check-suggestion strong {
  display: block;
  font-size: 0.92rem;
}

.check-suggestion small {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.check-report > small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}
