/* =========================================================
   NekoNikki — tokens de diseno
   Concepto: cuaderno de cuidados. Papel kraft, tinta, y un
   sello hanko rojo reservado unicamente para el gesto de
   "hecho / confirmado".
   ========================================================= */

:root {
  --paper: #efe7d8;
  --paper-soft: #f7f2e7;
  --paper-deep: #e6dcc7;
  --ink: #2b2622;
  --ink-soft: #6b6153;
  --ink-faint: #948a78;
  --indigo: #3b4a6b;
  --indigo-dark: #2b3750;
  --indigo-soft: #dde2ea;
  --hanko: #b4432f;
  --hanko-dark: #8f3324;
  --hanko-soft: #f1ddd6;
  --moss: #5f6f52;
  --moss-soft: #e3e8dc;
  --line: #d8cdb4;
  --line-strong: #c2b594;
  --danger: #a23b2e;
  --amber: #9c6b1f;
  --amber-soft: #f0e4c9;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Work Sans', 'Segoe UI', system-ui, sans-serif;
  --shadow-card: 0 1px 0 rgba(43, 38, 34, 0.06), 0 8px 20px -16px rgba(43, 38, 34, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--paper);
  background-image:
    radial-gradient(rgba(43, 38, 34, 0.035) 1px, transparent 1px),
    radial-gradient(rgba(43, 38, 34, 0.02) 1px, transparent 1px);
  background-size: 26px 26px, 26px 26px;
  background-position: 0 0, 13px 13px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}

h1 {
  font-size: 2rem;
  font-weight: 500;
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

p {
  margin: 0;
}

a {
  color: var(--indigo);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font-family: inherit;
}

:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* =========================================================
   Estructura general
   ========================================================= */

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

.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--indigo);
  color: var(--paper-soft);
  font-size: 1rem;
  line-height: 1;
}

.nav-links {
  display: flex;
  gap: 18px;
  margin-right: auto;
}

.nav-links a {
  color: var(--ink-soft);
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--indigo);
  text-decoration: none;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-user-name {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.outlet {
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.loading {
  color: var(--ink-faint);
  padding: 40px 0;
}

.page-head {
  margin-bottom: 24px;
}

.page-lead {
  color: var(--ink-soft);
  margin-top: 4px;
}

.empty-hint {
  color: var(--ink-faint);
  padding: 12px 0;
}

/* =========================================================
   Botones
   ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.btn--primary {
  background: var(--indigo);
  color: var(--paper-soft);
}

.btn--primary:hover:not(:disabled) {
  background: var(--indigo-dark);
}

.btn--secondary {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn--secondary:hover:not(:disabled) {
  border-color: var(--indigo);
  color: var(--indigo);
}

.btn--ghost {
  background: transparent;
  color: var(--ink-soft);
}

.btn--ghost:hover:not(:disabled) {
  color: var(--ink);
}

.btn--danger {
  background: transparent;
  color: var(--danger);
}

.btn--danger:hover:not(:disabled) {
  background: var(--hanko-soft);
}

.btn--stamp {
  background: var(--paper-soft);
  border-color: var(--hanko);
  color: var(--hanko-dark);
  font-weight: 600;
}

.btn--stamp:hover:not(:disabled) {
  background: var(--hanko);
  color: var(--paper-soft);
}

.btn--small {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.link-btn {
  background: none;
  border: none;
  color: var(--indigo);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px 0;
}

.link-btn:hover {
  text-decoration: underline;
}

.link-btn--danger {
  color: var(--danger);
  margin-left: auto;
}

/* =========================================================
   Login
   ========================================================= */

.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 40px);
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 340px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.auth-card-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--indigo);
  color: var(--paper-soft);
  font-size: 1.6rem;
  margin-bottom: 16px;
}

.auth-card h1 {
  font-size: 1.6rem;
}

.auth-subtitle {
  color: var(--ink-soft);
  margin: 8px 0 28px;
  font-size: 0.9rem;
}

.auth-form,
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* .field pone display:flex, que por especificidad de origen (autor vs
   navegador) anula la regla por defecto que oculta [hidden]. Sin esto,
   los campos condicionales (p. ej. "cada N dias" / "que dias" segun la
   periodicidad elegida) se quedaban visibles aunque estuvieran hidden. */
.field[hidden] {
  display: none;
}

.field--checkbox {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.weekday-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.weekday-check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 5px 9px;
}

.field input[type='text'],
.field input[type='password'],
.field input[type='date'],
.field input[type='datetime-local'],
.field input[type='number'],
.field input[type='file'],
.field select,
.field textarea {
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper-soft);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
}

.field textarea {
  resize: vertical;
  min-height: 60px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--indigo);
}

.form-error {
  color: var(--danger);
  font-size: 0.85rem;
}

.field-note {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* =========================================================
   Hoy
   ========================================================= */

.severity-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.severity-badge--baja {
  background: var(--paper-deep);
  color: var(--ink-faint);
}

.severity-badge--normal {
  background: var(--indigo-soft);
  color: var(--indigo-dark);
}

.severity-badge--importante {
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid var(--amber);
}

.severity-badge--grave {
  background: var(--hanko-soft);
  color: var(--hanko-dark);
  border: 1px solid var(--hanko);
}

.incident-alerts {
  margin-bottom: 20px;
}

.incident-alerts h2 {
  font-size: 1rem;
  margin-bottom: 10px;
}

.incident-alerts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.incident-alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--paper-soft);
  border: 1px solid var(--line);
}

.incident-alert-item--grave {
  background: var(--hanko-soft);
  border-color: var(--hanko);
}

.incident-alert-item--importante {
  background: var(--amber-soft);
  border-color: var(--amber);
}

.incident-alert-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--ink);
  min-width: 0;
}

.incident-alert-link:hover {
  text-decoration: none;
}

.incident-alert-pet {
  font-weight: 600;
  font-size: 0.85rem;
}

.incident-alert-desc {
  font-size: 0.9rem;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.due-soon {
  background: var(--indigo-soft);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 28px;
}

.due-soon h2 {
  font-size: 1rem;
  color: var(--indigo-dark);
  margin-bottom: 10px;
}

.due-soon-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.due-soon-list li {
  font-size: 0.9rem;
  color: var(--ink);
}

.due-soon-date {
  color: var(--indigo-dark);
  font-weight: 500;
  margin-left: 4px;
}

.today-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.today-card {
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-card);
}

.today-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  margin-bottom: 14px;
}

.today-card-head h2 {
  font-size: 1.1rem;
}

.pet-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.pet-avatar--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-deep);
  color: var(--ink-faint);
}

.today-empty {
  color: var(--ink-faint);
  font-size: 0.9rem;
}

.today-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.today-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.today-item:first-child {
  border-top: none;
  padding-top: 0;
}

.today-item.is-done-flash {
  animation: stamp-pop 0.35s ease;
}

@keyframes stamp-pop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

.today-item-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.today-item-name {
  font-weight: 500;
}

.today-item-meta {
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.today-item-note {
  font-size: 0.8rem;
  color: var(--indigo-dark);
  font-style: italic;
  margin-top: 2px;
}

.today-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stamp {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.stamp--pending {
  background: var(--paper-deep);
  color: var(--ink-soft);
}

.stamp--done {
  background: var(--hanko-soft);
  color: var(--hanko-dark);
  border: 1px solid var(--hanko);
}

/* =========================================================
   Michis (listado)
   ========================================================= */

.pet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}

.pet-card {
  display: flex;
  flex-direction: column;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  color: var(--ink);
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.pet-card:hover {
  text-decoration: none;
  border-color: var(--indigo);
  transform: translateY(-2px);
}

.pet-card-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.pet-card-photo--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-deep);
  color: var(--ink-faint);
  font-size: 2rem;
}

.pet-card-body {
  padding: 12px 14px;
}

.pet-card-body h2 {
  font-size: 1.05rem;
}

.pet-card-body p {
  color: var(--ink-faint);
  font-size: 0.85rem;
  margin-top: 2px;
}

.pet-card--add {
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-style: dashed;
  border-color: var(--line-strong);
  color: var(--ink-soft);
  cursor: pointer;
  min-height: 100%;
  box-shadow: none;
}

.pet-card--add:hover {
  border-color: var(--indigo);
  color: var(--indigo);
}

.pet-card-add-icon {
  font-size: 1.6rem;
  line-height: 1;
}

/* =========================================================
   Ficha de michi
   ========================================================= */

.pet-header {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 32px;
}

.pet-header-photo {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.pet-header-photo-btn {
  padding: 0;
  border: none;
  background: none;
  border-radius: 50%;
  flex-shrink: 0;
  cursor: zoom-in;
  transition: opacity 0.15s ease;
}

.pet-header-photo-btn:hover {
  opacity: 0.85;
}

.pet-header-photo--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-deep);
  color: var(--ink-faint);
  font-size: 2rem;
}

.pet-header-info {
  flex: 1;
  min-width: 0;
}

.back-link {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-bottom: 6px;
}

.pet-header-meta {
  color: var(--ink-soft);
  margin-top: 4px;
}

.pet-header-notes {
  color: var(--ink-soft);
  margin-top: 8px;
  font-size: 0.9rem;
}

.pet-sections {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.card-section {
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px;
}

.card-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.item-row {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px 16px;
}

.item-row:first-child {
  border-top: none;
  padding-top: 0;
}

.item-row--inactive {
  opacity: 0.55;
}

.item-row-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.item-row-name {
  font-weight: 500;
}

.item-row-meta {
  font-size: 0.85rem;
  color: var(--ink-faint);
}

.item-row-notes {
  font-size: 0.85rem;
  color: var(--indigo-dark);
  font-style: italic;
  margin-top: 2px;
}

.item-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.incident-row {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 8px 16px;
}

.incident-row:first-child {
  border-top: none;
  padding-top: 0;
}

.incident-row-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.incident-photos {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.incident-photo-thumb {
  width: 56px;
  height: 56px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: zoom-in;
  background: none;
  flex-shrink: 0;
}

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

.item-history {
  grid-column: 1 / -1;
  background: var(--paper);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 4px;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
}

.history-list li {
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.history-meta {
  color: var(--ink-faint);
}

.history-notes {
  color: var(--ink-soft);
  font-style: italic;
}

/* =========================================================
   Peso
   ========================================================= */

.weight-chart {
  margin-bottom: 16px;
}

.sparkline {
  width: 100%;
  height: auto;
  max-width: 420px;
}

.sparkline-line {
  fill: none;
  stroke: var(--indigo);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sparkline-dot {
  fill: var(--paper-soft);
  stroke: var(--indigo);
  stroke-width: 1.5;
}

.sparkline-dot--last {
  fill: var(--hanko);
  stroke: var(--hanko-dark);
}

.weight-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.weight-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.weight-row:first-child {
  border-top: none;
  padding-top: 0;
}

.weight-value {
  font-weight: 600;
  color: var(--indigo-dark);
}

/* =========================================================
   Modal
   ========================================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 38, 34, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 100;
}

.modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--paper-soft);
  border-radius: var(--radius-lg);
  padding: 26px;
  width: 100%;
  max-width: 420px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px -20px rgba(43, 38, 34, 0.5);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--ink-faint);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
}

.modal-close:hover {
  color: var(--ink);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.modal-actions--split {
  justify-content: space-between;
}

.confirm-box p {
  color: var(--ink-soft);
  margin-bottom: 20px;
}

/* =========================================================
   Lightbox (ampliar foto)
   ========================================================= */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 38, 34, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 250;
  cursor: zoom-out;
}

.lightbox-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
}

/* =========================================================
   Toasts
   ========================================================= */

.toast-stack {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  pointer-events: none;
}

.toast {
  background: var(--ink);
  color: var(--paper-soft);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast--success {
  background: var(--moss);
}

.toast--error {
  background: var(--danger);
}

/* =========================================================
   Campo de foto (con recorte)
   ========================================================= */

.photo-field-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.photo-field-preview {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--paper-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.photo-field-preview-placeholder {
  color: var(--ink-faint);
  font-size: 1.3rem;
}

/* =========================================================
   Recortador de imagenes
   ========================================================= */

.cropper-viewport {
  position: relative;
  width: 280px;
  height: 280px;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--paper-deep);
  touch-action: none;
  cursor: grab;
}

.cropper-viewport:active {
  cursor: grabbing;
}

.cropper-image {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  user-select: none;
  pointer-events: none;
}

.cropper-guide {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 240px;
  height: 240px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(43, 38, 34, 0.5);
  border: 2px solid var(--paper-soft);
  pointer-events: none;
}

.cropper-zoom-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.cropper-zoom {
  flex: 1;
  accent-color: var(--indigo);
}

.cropper-zoom-label {
  color: var(--ink-faint);
  font-size: 1rem;
  line-height: 1;
}

.cropper-hint {
  color: var(--ink-faint);
  font-size: 0.8rem;
  margin-top: 12px;
  text-align: center;
}

/* =========================================================
   Acerca de
   ========================================================= */

.about-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--indigo);
  color: var(--paper-soft);
  font-size: 1.4rem;
  margin-bottom: 12px;
}

.about-block {
  max-width: 620px;
  margin-bottom: 28px;
}

.about-block h2 {
  margin-bottom: 10px;
}

.about-block p {
  color: var(--ink-soft);
  margin-bottom: 10px;
  line-height: 1.6;
}

.about-block p:last-child {
  margin-bottom: 0;
}

.about-cast-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

.about-cast-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 96px;
}

.about-cast-photo {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--paper-soft);
  box-shadow: var(--shadow-card);
}

.about-cast-photo--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-deep);
  color: var(--ink-faint);
  font-size: 1.6rem;
}

.about-cast-name {
  font-weight: 500;
  font-size: 0.9rem;
  text-align: center;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 640px) {
  .nav-inner {
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 18px;
  }

  .nav-links {
    order: 3;
    width: 100%;
    margin-right: 0;
  }

  .outlet {
    padding: 22px 16px 48px;
  }

  h1 {
    font-size: 1.6rem;
  }

  .pet-header {
    flex-wrap: wrap;
  }

  .item-row {
    grid-template-columns: 1fr;
  }

  .item-row-actions {
    justify-content: flex-start;
  }
}

/* =========================================================
   Comidas
   ========================================================= */

.meal-history-box {
  margin-top: 14px;
}

.meal-history-title {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0 0 8px;
}

.meal-history li {
  flex-wrap: wrap;
}

.meal-history .incident-photos {
  flex-basis: 100%;
  margin-top: 2px;
}

/* Resumen de comidas dentro de la tarjeta de cada michi en "Hoy" */
.today-meals {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.today-meals-title {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 4px;
}

.today-meals-summary {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: var(--ink);
}

.today-meals-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* ---------- Grupos ---------- */
.group-tag {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--indigo-soft);
  color: var(--indigo-dark);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
}

/* Etiqueta de michi privado (solo lo ve su dueno). */
.private-tag {
  display: inline-block;
  margin-top: 4px;
  margin-left: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--paper-deep);
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
}

.today-card-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.group-link {
  color: var(--ink);
  text-decoration: none;
}

.group-link:hover {
  text-decoration: underline;
}

.invite-code {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
}

.join-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.join-form .field {
  flex: 1 1 200px;
  margin: 0;
}

.join-form input {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-section > p.item-row-meta {
  margin: 0 0 12px;
}

/* ---------- Registro con invitacion ---------- */
.auth-alt {
  margin: 14px 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.auth-invite {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--indigo-soft);
  color: var(--indigo-dark);
  font-size: 0.9rem;
}

/* «Abrir en la app» de una invitacion (solo se pinta en Android). */
.app-open {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: 0 0 14px;
}

.field--check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.field--check input {
  width: auto;
  margin: 0;
}

.pet-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: flex-start;
}

/* ---------- Histórico de michis eliminados ---------- */
.history-link {
  display: inline-block;
  margin-top: 6px;
  color: var(--indigo-dark);
  font-size: 0.9rem;
}

.history-row {
  grid-template-columns: auto 1fr auto;
}

.history-photo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--paper-deep);
  filter: grayscale(0.4);
}

.history-photo--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-faint);
  font-size: 1.4rem;
}

@media (max-width: 640px) {
  .history-row {
    grid-template-columns: auto 1fr;
  }
  .history-row .item-row-actions {
    grid-column: 1 / -1;
  }
}

/* ---------- Estado del michi ---------- */
.status-tag {
  display: inline-block;
  margin-top: 4px;
  margin-left: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
}

.status-tag--deceased {
  background: var(--ink);
  color: var(--paper);
}

.pet-header > .pet-header-info > .status-tag {
  margin-left: 0;
  margin-bottom: 4px;
}

/* Un michi fallecido: foto en tono suave, sin dramatismo. */
.pet-card--deceased .pet-card-photo,
.pet-header--deceased .pet-header-photo {
  filter: grayscale(0.85);
  opacity: 0.85;
}

.status-current {
  font-weight: 500;
  margin: 4px 0 8px;
}

.status-log {
  list-style: none;
  padding: 0;
  margin: 0;
}

.status-log-row {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.status-log-row:first-child {
  border-top: none;
}

.status-log-name {
  font-weight: 500;
}

/* Homenaje en la ficha de un michi fallecido. */
.tribute {
  margin: 0 0 24px;
  padding: 22px 20px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-soft);
}

.tribute-mark {
  font-size: 1.6rem;
  line-height: 1;
  margin-bottom: 8px;
}

.tribute h2 {
  font-size: 1.15rem;
  margin: 0 0 4px;
}

.tribute-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin: 0;
}

.tribute-dates {
  color: var(--ink-soft);
  margin: 4px 0 0;
}
