/* Pawta · estilos de la app (tokens del sistema de diseño Pawta) */
:root {
  --brand: #0F766E; --brand-2: #2DD4BF; --on-brand: #FFFFFF; --brand-soft: #CCEFE6; --brand-ink: #0F5E57;
  --accent: #FF7A59; --accent-soft: #FFE7DF; --accent-ink: #9A3412;
  --ink: #10302B; --muted: #3B524E; --surface: #F7F8F4; --card: #FFFFFF; --line: #D5DBD3; --soft: #EEF2EE;
  --danger: #B42318; --danger-soft: #FBEBEB;
  --r-sm: 12px; --r-md: 18px; --r-lg: 22px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--surface); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }

.app { max-width: 520px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }
.screen { flex: 1; padding: calc(env(safe-area-inset-top, 0px) + 24px) max(20px, env(safe-area-inset-right, 0px)) 112px max(20px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 16px; }
.screen.plain { padding-bottom: 32px; }
.screen.brand { background: var(--brand); color: var(--on-brand); }

h1 { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; text-wrap: balance; }
h2 { margin: 0; font-size: 17px; font-weight: 800; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.topbar { display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
.back { width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--card); border: 0; display: grid; place-items: center; text-decoration: none; color: var(--ink); }
.link { background: none; border: 0; color: var(--brand); font-weight: 600; min-height: 44px; padding: 0; text-decoration: none; display: inline-flex; align-items: center; }

.btn { border: 0; border-radius: var(--r-sm); min-height: 52px; padding: 0 18px; font-weight: 600; font-size: 16px; background: var(--brand); color: var(--on-brand); display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; width: 100%; }
.btn.secondary { background: var(--card); color: var(--brand); border: 1px solid var(--line); }
.btn.accent { background: var(--accent); color: var(--ink); font-weight: 800; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { min-height: 44px; font-size: 15px; width: auto; }
.btn[disabled] { opacity: 0.55; cursor: default; }

.card { background: var(--card); border-radius: var(--r-lg); padding: 16px; }
.card.tight { padding: 12px 14px; border-radius: var(--r-md); }
.card.hero { background: var(--brand); color: var(--on-brand); }
.card.dashed { border: 1.5px dashed #9FB3AE; text-align: center; align-items: center; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.input { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); min-height: 48px; padding: 0 14px; font-size: 16px; width: 100%; }
textarea.input { padding: 12px 14px; min-height: 84px; resize: vertical; }
.code { letter-spacing: 0.5em; text-align: center; font-size: 26px; font-weight: 800; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; min-height: 40px; padding: 0 14px; font-size: 14px; font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
.seg .chip { border-radius: var(--r-sm); min-height: 44px; }
.seg .chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); }

.pill { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); white-space: nowrap; }
.pill.warn { background: var(--accent-soft); color: var(--accent-ink); }
.pill.off { background: var(--soft); color: var(--muted); }

.avatar { width: 52px; height: 52px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 20px; flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.alt { background: var(--accent-soft); color: var(--accent-ink); }

.pet { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.pet .grow { flex: 1; min-width: 0; }

.timeline { position: relative; padding-left: 22px; display: flex; flex-direction: column; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 14px; bottom: 14px; width: 2px; background: var(--line); }
.tl-item { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 0; text-decoration: none; color: inherit; }
.tl-item::before { content: ""; position: absolute; left: -21px; width: 12px; height: 12px; border-radius: 999px; background: var(--brand); border: 2px solid var(--surface); }
.tl-item.examen::before { background: #fff; border-color: var(--brand); }
.tl-item .grow { flex: 1; min-width: 0; }

.photo-drop { position: relative; background: var(--card); border: 1.5px dashed #9FB3AE; border-radius: var(--r-md); min-height: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--brand); font-weight: 600; font-size: 14px; overflow: hidden; }
.photo-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-drop img { max-height: 180px; max-width: 100%; border-radius: 10px; }
.photo { width: 100%; max-height: 260px; object-fit: contain; background: #FFFDF5; border-radius: var(--r-md); }

.note { background: var(--brand-soft); color: #0F3D38; border-radius: 14px; padding: 12px 14px; font-size: 13px; line-height: 1.4; }
.note.warn { background: var(--accent-soft); color: #7C2D12; }
.error { color: var(--danger); font-size: 14px; }

.nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); padding: 8px max(12px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 10px) max(12px, env(safe-area-inset-left, 0px)); }
.nav-inner { max-width: 520px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 48px; justify-content: center; color: var(--muted); text-decoration: none; font-size: 11.5px; }
.nav a[aria-current="page"] { color: var(--brand); font-weight: 600; }
.nav svg { width: 24px; height: 24px; }

.banner { background: var(--ink); color: #fff; font-size: 14px; padding: calc(env(safe-area-inset-top, 0px) + 10px) 20px 10px; text-align: center; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 14px; font-size: 14px; max-width: calc(100% - 40px); z-index: 30; }
.sheet-bg { position: fixed; inset: 0; background: rgba(16, 48, 43, 0.45); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.sheet { background: var(--card); width: 100%; max-width: 520px; border-radius: 26px 26px 0 0; padding: 22px 20px calc(env(safe-area-inset-bottom, 0px) + 24px); display: flex; flex-direction: column; gap: 12px; }
.badge-founder { background: var(--accent); color: var(--ink); font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; }
.spinner { width: 28px; height: 28px; border-radius: 999px; border: 3px solid var(--brand-soft); border-top-color: var(--brand); animation: spin 0.8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
