/* =========================================================
   VaivémPet — app (mobile first, preto e branco)
   ========================================================= */
.pet { --tabbar-h: 64px; background: var(--bg); -webkit-tap-highlight-color: transparent; }
.pet-logo { width: 34px; height: 34px; color: var(--fg); --logo-ink: var(--bg); flex: none; }
.pet-wrap { width: 100%; max-width: 640px; margin: 0 auto; padding: 16px 16px 24px; display: grid; gap: 16px; }
.pet-wrap--wide { max-width: 1280px; }
.pet-title { font-family: var(--f-display); font-weight: 500; font-size: clamp(26px, 6vw, 34px); letter-spacing: -.035em; line-height: 1.05; }
.pet-section-title { font-family: var(--f-display); font-weight: 500; font-size: 17px; letter-spacing: -.02em; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pet-section-title a { font-family: var(--f-body); font-size: 13px; color: var(--muted); }

/* ---------- Topo ---------- */
.pet-top { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.pet-top__inner { max-width: 1280px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pet-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.pet-brand span { display: grid; line-height: 1.15; min-width: 0; }
.pet-brand strong { font-family: var(--f-display); font-weight: 600; letter-spacing: -.02em; }
.pet-brand small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pet-role select { appearance: none; -webkit-appearance: none; border: 1px solid var(--line); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%230a0a0a' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center; border-radius: 100px; height: 36px; padding: 0 30px 0 14px; font-size: 13px; cursor: pointer; max-width: 180px; }

/* ---------- Abas inferiores (tutor) ---------- */
.has-tabs { padding-bottom: calc(var(--tabbar-h) + 90px + env(safe-area-inset-bottom)); }
.has-tabs .kd-sign { bottom: calc(var(--tabbar-h) + 10px + env(safe-area-inset-bottom)); }
.has-tabs .kd-cookies { bottom: calc(var(--tabbar-h) + 64px); }
.pet-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); }
.pet-tabs a { position: relative; display: grid; justify-items: center; align-content: center; gap: 3px; text-decoration: none; font-size: 11px; color: var(--muted); transition: color .3s; }
.pet-tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pet-tabs a[aria-current="page"] { color: var(--fg); font-weight: 600; }
.pet-tabs a[aria-current="page"] svg { stroke-width: 2.2; }
.pet-tabs__dot { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 100px; background: var(--danger); color: #fff; font-size: 11px; font-style: normal; display: grid; place-items: center; }
@media (min-width: 720px) { .pet-tabs { left: 50%; right: auto; transform: translateX(-50%); width: 560px; bottom: 12px; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); height: var(--tabbar-h); padding-bottom: 0; } .has-tabs .kd-sign { bottom: calc(var(--tabbar-h) + 22px); } }

/* ---------- Tela inicial ---------- */
.pet-start { background: radial-gradient(circle at 80% -10%, #e9e8e1, var(--bg) 60%); }
.pet-start__main { max-width: 1080px; margin: 0 auto; padding: 48px 20px 40px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; min-height: calc(100vh - 96px); }
.pet-start__hero { display: grid; gap: 20px; justify-items: start; }
.pet-start__brand { display: flex; align-items: center; gap: 12px; font-family: var(--f-display); font-weight: 600; font-size: 22px; letter-spacing: -.03em; }
.pet-start__brand .pet-logo { width: 44px; height: 44px; }
.pet-start__title { font-family: var(--f-display); font-weight: 500; font-size: clamp(34px, 5.4vw, 64px); line-height: 1; letter-spacing: -.045em; }
.pet-start__lead { font-size: 17px; color: var(--muted); max-width: 460px; }
.pet-start__roles { display: grid; gap: 12px; }
.pet-start__note { margin-top: 4px; }
.pet-role-card button { width: 100%; display: grid; grid-template-columns: 48px 1fr 24px; gap: 14px; align-items: center; text-align: left; padding: 18px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color .3s, transform .3s, box-shadow .3s; }
.pet-role-card button:hover { border-color: var(--fg); box-shadow: var(--shadow); }
.pet-role-card__icon { width: 48px; height: 48px; border-radius: 14px; background: var(--soft); display: grid; place-items: center; font-size: 24px; }
.pet-role-card__body { display: grid; gap: 2px; }
.pet-role-card__body strong { font-family: var(--f-display); font-weight: 500; font-size: 17px; }
.pet-role-card__body small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.pet-role-card__go { font-size: 20px; transition: transform .3s; }
.pet-role-card button:hover .pet-role-card__go { transform: translateX(4px); }
@media (max-width: 860px) { .pet-start__main { grid-template-columns: 1fr; padding-top: 32px; gap: 32px; min-height: 0; } }

/* ---------- Cartões e listas ---------- */
.pet-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: grid; gap: 12px; }
.pet-card--dark { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.pet-card--dark .kd-muted, .pet-card--dark .kd-help { color: color-mix(in srgb, var(--bg) 65%, transparent); }
.pet-card--link { text-decoration: none; transition: border-color .3s, box-shadow .3s; }
.pet-card--link:hover { border-color: var(--fg); box-shadow: var(--shadow); }
.pet-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pet-row__body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.pet-row__body strong { font-weight: 600; }
.pet-row__body small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pet-avatar { width: 52px; height: 52px; border-radius: 16px; object-fit: cover; flex: none; background: var(--soft); }
.pet-avatar--empty { display: grid; place-items: center; font-size: 26px; }
.pet-avatar--lg { width: 84px; height: 84px; border-radius: 24px; font-size: 40px; }
.pet-avatar--sm { width: 40px; height: 40px; border-radius: 12px; font-size: 20px; }
.pet-list { display: grid; gap: 10px; }
.pet-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 100px; background: var(--soft); font-size: 12px; }
.pet-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pet-empty { text-align: center; padding: 32px 16px; color: var(--muted); display: grid; gap: 12px; justify-items: center; }

/* Progresso resumido no cartão do atendimento ativo */
.pet-progress { display: grid; grid-template-columns: repeat(var(--steps, 7), 1fr); gap: 4px; }
.pet-progress i { height: 5px; border-radius: 4px; background: color-mix(in srgb, currentColor 18%, transparent); }
.pet-progress i.is-done { background: currentColor; }

/* ---------- Linha do tempo ---------- */
.pet-timeline { list-style: none; display: grid; gap: 0; }
.pet-step { position: relative; display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding-bottom: 18px; }
.pet-step::before { content: ""; position: absolute; left: 15px; top: 30px; bottom: 0; width: 2px; background: var(--line); }
.pet-step:last-child::before { display: none; }
.pet-step__dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); font-size: 15px; z-index: 1; border: 2px solid var(--bg); }
.pet-step.is-done .pet-step__dot { background: var(--fg); filter: grayscale(1) invert(1); }
.pet-step.is-current .pet-step__dot { background: var(--fg); box-shadow: 0 0 0 4px color-mix(in srgb, var(--fg) 15%, transparent); animation: petPulse 2s infinite; }
.pet-step.is-todo { opacity: .45; }
.pet-step__body { display: grid; gap: 4px; padding-top: 5px; }
.pet-step__body strong { font-weight: 600; font-size: 15px; }
.pet-step__body small { color: var(--muted); font-size: 13px; }
.pet-step__photo { width: 100%; max-width: 280px; aspect-ratio: 4/3; object-fit: cover; border-radius: 14px; margin-top: 6px; cursor: zoom-in; }
@keyframes petPulse { 50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--fg) 0%, transparent); } }

/* ---------- Valores ---------- */
.pet-bill { display: grid; gap: 8px; font-size: 14px; }
.pet-bill div { display: flex; justify-content: space-between; gap: 12px; }
.pet-bill dt { color: var(--muted); }
.pet-bill__total { border-top: 1px solid var(--line); padding-top: 10px; font-family: var(--f-display); font-size: 18px; font-weight: 500; }
.pet-bill__total dt { color: var(--fg); }
.pet-due { color: var(--danger); }

/* ---------- Extras ---------- */
.pet-extra { border: 1px dashed var(--fg); border-radius: 16px; padding: 14px; display: grid; gap: 10px; background: var(--surface); }
.pet-extra__head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.pet-extra__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Seletores (agendar) ---------- */
.pet-options { display: grid; gap: 8px; }
.pet-option { position: relative; cursor: pointer; }
.pet-option input { position: absolute; opacity: 0; pointer-events: none; }
.pet-option__box { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); transition: border-color .3s, background .3s, color .3s; }
.pet-option__box > span:not(.pet-avatar):not(.pet-check):not(.pet-option__price) { flex: 1; min-width: 0; display: grid; gap: 2px; }
.pet-option__box small { color: var(--muted); font-size: 13px; }
.pet-option__price { font-family: var(--f-display); font-weight: 500; white-space: nowrap; }
.pet-option:hover .pet-option__box { border-color: var(--fg); }
.pet-option input:checked + .pet-option__box { border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
.pet-option input:focus-visible + .pet-option__box { outline: 2px solid var(--fg); outline-offset: 2px; }
.pet-check { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line); display: grid; place-items: center; flex: none; transition: background .3s, border-color .3s; }
.pet-option input[type="radio"] ~ .pet-option__box .pet-check { border-radius: 50%; }
.pet-option input:checked + .pet-option__box .pet-check { background: var(--fg); border-color: var(--fg); }
.pet-option input:checked + .pet-option__box .pet-check::after { content: "✓"; color: var(--bg); font-size: 13px; }

.pet-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.pet-scroll::-webkit-scrollbar { display: none; }
.pet-pill { position: relative; flex: none; cursor: pointer; }
.pet-pill input { position: absolute; opacity: 0; pointer-events: none; }
.pet-pill span { display: grid; justify-items: center; min-width: 62px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); transition: background .3s, color .3s, border-color .3s; }
.pet-pill small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.pet-pill strong { font-family: var(--f-display); font-size: 20px; font-weight: 500; }
.pet-pill input:checked + span { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.pet-pill input:checked + span small { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.pet-pill input:focus-visible + span { outline: 2px solid var(--fg); outline-offset: 2px; }
.pet-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; min-height: 44px; }
.pet-slots .pet-pill span { min-width: 0; padding: 10px 0; }
.pet-slots .pet-pill strong { font-size: 15px; }
.pet-slots.is-loading { opacity: .4; }

/* Barra de confirmação fixa (agendar) */
.pet-cta { position: sticky; bottom: calc(var(--tabbar-h) + 64px + env(safe-area-inset-bottom)); z-index: 30; background: var(--fg); color: var(--bg); border-radius: 18px; padding: 12px 12px 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.2); }
.pet-cta small { display: block; font-size: 12px; opacity: .7; }
.pet-cta strong { font-family: var(--f-display); font-size: 20px; font-weight: 500; }
.pet-cta .kd-btn { background: var(--bg); color: var(--fg); border-color: var(--bg); }

/* ---------- Upload de foto ---------- */
.pet-photo-input { position: relative; display: flex; align-items: center; gap: 12px; }
.pet-photo-input input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.pet-photo-input label.kd-btn { cursor: pointer; }
.pet-photo-preview { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; background: var(--soft); }
.pet-photo-input input:focus-visible + label { outline: 2px solid var(--fg); outline-offset: 2px; }

/* ---------- Chat ---------- */
.pet-chat { display: grid; gap: 12px; }
.pet-chat__list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; padding: 4px 2px; overscroll-behavior: contain; }
.pet-msg { max-width: 82%; padding: 10px 12px; border-radius: 16px; font-size: 14px; line-height: 1.45; background: var(--soft); align-self: flex-start; border-bottom-left-radius: 4px; overflow-wrap: anywhere; }
.pet-msg.is-mine { align-self: flex-end; background: var(--fg); color: var(--bg); border-bottom-left-radius: 16px; border-bottom-right-radius: 4px; }
.pet-msg time { display: block; font-size: 11px; opacity: .6; margin-top: 4px; text-align: right; }
.pet-msg img { display: block; max-width: 220px; width: 100%; border-radius: 10px; margin-bottom: 6px; cursor: zoom-in; }
.pet-msg__who { display: block; font-size: 11px; font-weight: 600; opacity: .7; margin-bottom: 2px; }
.pet-chat__form { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: end; }
.pet-chat__form textarea { min-height: 44px; max-height: 120px; resize: none; padding: 11px 14px; border-radius: 22px; }
.pet-icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; font-size: 18px; flex: none; }
.pet-icon-btn--dark { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.pet-chat__attach { font-size: 12px; color: var(--muted); grid-column: 1 / -1; }

/* ---------- Painel do petshop ---------- */
.pet-board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.pet-col { background: color-mix(in srgb, var(--soft) 60%, transparent); border-radius: 18px; padding: 10px; display: grid; gap: 8px; align-content: start; min-height: 120px; }
.pet-col__head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px; font-size: 13px; font-weight: 600; }
.pet-col__head span { color: var(--muted); font-weight: 400; }
.pet-ticket { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 8px; text-decoration: none; transition: border-color .3s, box-shadow .3s; }
.pet-ticket:hover { border-color: var(--fg); box-shadow: var(--shadow); }
.pet-ticket__flags { display: flex; gap: 6px; flex-wrap: wrap; }
.pet-flag { font-size: 11px; padding: 2px 8px; border-radius: 100px; background: var(--soft); }
.pet-flag--alert { background: var(--danger); color: #fff; }
.pet-flag--dark { background: var(--fg); color: var(--bg); }
.pet-detail { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 960px) { .pet-detail { grid-template-columns: 1fr; } }

/* ---------- Motorista ---------- */
.pet-stop { display: grid; gap: 12px; }
.pet-stop__leg { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.pet-stop__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pet-stop__actions .kd-btn--block { grid-column: 1 / -1; height: 50px; }
.pet-stop.is-done { opacity: .5; }
.pet-time { font-family: var(--f-display); font-size: 22px; font-weight: 500; letter-spacing: -.02em; }

/* ---------- Avisos (toasts) ---------- */
.pet-toasts { position: fixed; top: calc(70px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 1100; display: grid; gap: 8px; width: min(420px, calc(100vw - 24px)); pointer-events: none; }
.pet-toast { pointer-events: auto; background: var(--fg); color: var(--bg); border-radius: 16px; padding: 12px 14px; display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; box-shadow: 0 12px 30px rgba(0,0,0,.25); text-decoration: none; animation: petToast .4s ease; font-size: 14px; }
.pet-toast b { font-size: 20px; }
.pet-toast small { display: block; opacity: .7; font-size: 12px; }
@keyframes petToast { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- Visualizar foto ---------- */
.pet-lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 92vh; margin: auto; }
.pet-lightbox::backdrop { background: rgba(0,0,0,.85); }
.pet-lightbox img { max-width: 96vw; max-height: 88vh; border-radius: 12px; display: block; }

.pet-offline__box { display: grid; gap: 14px; justify-items: center; text-align: center; max-width: 360px; }
.pet-offline__box img { border-radius: 18px; }
.pet-install { margin-top: 4px; }

@media (prefers-reduced-motion: reduce) { .pet-step.is-current .pet-step__dot { animation: none; } }
