:root {
  /* Katxor CV: azul da marca sobre fundo claro; coral reservado a alertas de desaparecimento.
     Layout: faixa azul com pesquisa no topo, grelha de atalhos, cartões de cães. */
  --brand: #176dde;
  --brand-dark: #0b4fae;
  --navy: #0b2a5c;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --ink: #16202e;
  --muted: #5b6878;
  --line: #dfe5ee;
  --tint: #eaf2fd;
  --alert: #c8402c;
  --alert-tint: #fdeeeb;
  --ok: #1d7a46;
  --warn-tint: #fff5e0;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #4f95f0; --brand-dark: #8fbaf6; --navy: #0d1f3d; --bg: #0f141b; --surface: #171e28;
    --ink: #e7edf5; --muted: #9eabbb; --line: #283242; --tint: #17263b; --alert: #f07c69;
    --alert-tint: #3a1f1b; --ok: #6ccf97; --warn-tint: #3a311c; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #4f95f0; --brand-dark: #8fbaf6; --navy: #0d1f3d; --bg: #0f141b; --surface: #171e28;
  --ink: #e7edf5; --muted: #9eabbb; --line: #283242; --tint: #17263b; --alert: #f07c69;
  --alert-tint: #3a1f1b; --ok: #6ccf97; --warn-tint: #3a311c; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
img { max-width: 100%; display: block; }
a { color: var(--brand-dark); }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); letter-spacing: -.01em; }
h2 { font-size: 1.3rem; }
p { margin: 0 0 1em; max-width: 68ch; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 18px; }
.muted { color: var(--muted); }
.error { color: var(--alert); font-weight: 600; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--brand-dark); margin: 0 0 .4em; }

.demo-banner { background: var(--warn-tint); color: var(--ink); text-align: center; font-size: .88rem; padding: 6px 12px; border-bottom: 1px solid var(--line); }

/* ---------- topo ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-row { display: flex; align-items: center; gap: 18px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { border-radius: 9px; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand small { color: var(--muted); font-size: .74rem; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { text-decoration: none; color: var(--ink); padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.nav a:hover, .nav a.active { background: var(--tint); color: var(--brand-dark); }
.account { display: flex; gap: 8px; align-items: center; }
@media (max-width: 760px) {
  .topbar-row { padding-top: 8px; padding-bottom: 8px; gap: 8px; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .account { margin-left: auto; }
}

/* ---------- botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600;
  border-radius: 10px; padding: 11px 18px; border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-outline { border-color: var(--brand); color: var(--brand-dark); background: transparent; }
.btn-ghost { background: transparent; color: var(--ink); padding: 8px 12px; }
.btn-ghost:hover { background: var(--tint); }
.btn-sm { padding: 8px 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: wait; }
.btn-google { width: 100%; background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-google svg { stroke: none; width: 20px; height: 20px; }

/* ---------- topo da página inicial ---------- */
.hero { background: var(--navy); color: #fff; padding: 46px 0 54px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; align-items: center; }
.hero .eyebrow { color: #9cc4fb; }
.hero .lead { color: #d6e4f7; font-size: 1.08rem; }
.search-card { background: var(--surface); color: var(--ink); border-radius: var(--radius); padding: 22px; box-shadow: 0 12px 30px rgba(5, 20, 50, .3); }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; gap: 20px; } .hero { padding: 30px 0 36px; } }

.search label { font-weight: 700; display: block; margin-bottom: 8px; }
.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1; min-width: 0; }
.hint { color: var(--muted); font-size: .86rem; margin: 8px 0 0; }
@media (max-width: 480px) { .search-row { flex-direction: column; } }

input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: 2px solid color-mix(in srgb, var(--brand) 25%, transparent); }

/* ---------- atalhos ---------- */
.actions { display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; margin-top: -26px; position: relative; }
.action { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 10px; text-align: center;
  text-decoration: none; color: var(--ink); font-weight: 600; font-size: .9rem; display: flex; flex-direction: column; align-items: center; gap: 8px;
  box-shadow: 0 2px 6px rgba(10, 30, 60, .06); }
.action svg { width: 28px; height: 28px; fill: none; stroke: var(--brand); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.action:hover { border-color: var(--brand); }
.action-alert svg { stroke: var(--alert); }
.action-alert { border-color: color-mix(in srgb, var(--alert) 35%, var(--line)); }
@media (max-width: 960px) { .actions { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 520px) { .actions { grid-template-columns: repeat(2, 1fr); margin-top: 16px; } }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 22px; }
.stat { background: var(--tint); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; }
.stat b { font-size: 1.6rem; font-variant-numeric: tabular-nums; color: var(--brand-dark); }
.stat span { color: var(--muted); font-size: .9rem; }
.stats:empty { display: none; }

/* ---------- secções ---------- */
.section { margin-top: 38px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h2, .section-head h1 { margin: 0; }
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: start; margin-bottom: 40px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.note-card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius); padding: 20px; }

.faq { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.faq summary { cursor: pointer; padding: 13px 16px; font-weight: 600; }
.faq p { padding: 0 16px 14px; margin: 0; color: var(--muted); }

/* ---------- cartões de cães ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.dog-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; }
.dog-card:hover { border-color: var(--brand); }
.dog-card.is-missing { border-top: 4px solid var(--alert); }
.dog-photo { aspect-ratio: 4 / 3; background: var(--tint); position: relative; display: grid; place-items: center; }
.dog-photo img { width: 100%; height: 100%; object-fit: cover; }
.no-photo { color: var(--muted); font-size: .9rem; }
.dog-body { padding: 12px 14px 14px; display: grid; gap: 2px; font-size: .92rem; }
.dog-name { font-weight: 700; font-size: 1.08rem; }
.kcv { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-weight: 600; color: var(--brand-dark); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.kcv-lg { font-size: 1.15rem; }
.since { color: var(--alert); font-weight: 600; margin-top: 4px; }
.tag { position: absolute; top: 10px; left: 10px; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.tag-missing { background: var(--alert); color: #fff; }
.tag-pending { position: static; display: inline-block; justify-self: start; background: var(--warn-tint); color: var(--ink); margin-top: 6px; }

/* ---------- páginas ---------- */
.page { padding-top: 28px; padding-bottom: 48px; }
.narrow { max-width: 760px; }
.lead-sm { color: var(--muted); }
.filter { display: inline-flex; flex-direction: column; gap: 4px; font-weight: 600; margin-bottom: 16px; min-width: 220px; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 22px; margin-top: 18px; }
.result { margin-top: 10px; }
.steps { padding-left: 1.2em; } .steps li { margin-bottom: 10px; }

.banner-missing, .banner-pending, .banner-info { border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; display: flex; gap: 12px; }
.banner-missing { background: var(--alert-tint); border: 1px solid color-mix(in srgb, var(--alert) 40%, transparent); }
.banner-missing svg { width: 26px; height: 26px; flex: none; fill: none; stroke: var(--alert); stroke-width: 2; }
.banner-pending { background: var(--warn-tint); }
.banner-info { background: var(--tint); }

.dog-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: start; }
.dog-hero-photo { border-radius: var(--radius); overflow: hidden; background: var(--tint); aspect-ratio: 4 / 3; display: grid; place-items: center; }
.dog-hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.dog-title { margin-bottom: 2px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; margin: 16px 0; }
.facts div { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.facts dt { color: var(--muted); font-size: .82rem; }
.facts dd { margin: 0; font-weight: 600; }
.privacy-note { font-size: .88rem; color: var(--muted); }
.dog-bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; margin-top: 26px; align-items: start; }
@media (max-width: 820px) { .dog-layout, .dog-bottom { grid-template-columns: 1fr; } .facts { grid-template-columns: 1fr 1fr; } }

.id-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 6px 18px rgba(10, 30, 60, .08); }
.id-card-head { background: var(--brand); color: #fff; display: flex; align-items: center; gap: 10px; padding: 10px 16px; font-weight: 700; font-size: .92rem; }
.id-card-head img { border-radius: 6px; background: #fff; }
.id-card-body { display: flex; gap: 16px; padding: 16px; align-items: center; flex-wrap: wrap; }
.qr { background: #fff; border-radius: 8px; padding: 4px; border: 1px solid var(--line); line-height: 0; }

.found-form, .auth form { display: grid; gap: 12px; }
.found-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.found-form h2 { margin: 0; }
label { display: grid; gap: 5px; font-weight: 600; font-size: .94rem; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
label.check input { width: auto; margin-top: 4px; }
.form-status { margin: 0; min-height: 1.4em; }
.form-status.ok { color: var(--ok); font-weight: 600; }
.form-status.error { color: var(--alert); font-weight: 600; }

.auth { max-width: 440px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .88rem; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- rodapé ---------- */
.footer { background: var(--navy); color: #d6e4f7; margin-top: 30px; padding: 36px 0 18px; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; }
.footer h3 { color: #fff; font-size: .95rem; }
.footer a { display: block; color: #d6e4f7; text-decoration: none; margin-bottom: 6px; }
.footer a:hover { text-decoration: underline; }
.brand-footer { color: #fff; margin-bottom: 10px; }
.muted-inv { color: #9fb4d1; }
.footer-base { border-top: 1px solid rgba(255, 255, 255, .15); margin-top: 22px; padding-top: 14px; font-size: .8rem; color: #9fb4d1; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
.page > h2 { margin-top: 30px; }

/* ---------- formulários ---------- */
.dog-form, .stack-form { display: grid; gap: 14px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 16px 18px 18px; margin: 0; display: grid; gap: 12px; min-width: 0; }
legend { font-weight: 700; padding: 0 6px; color: var(--brand-dark); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .row-2 { grid-template-columns: 1fr; } }
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 520px) { .photo-grid { grid-template-columns: 1fr 1fr; } }
.photo-slot { display: grid; gap: 6px; cursor: pointer; font-weight: 600; font-size: .86rem; }
.photo-slot input[type=file] { font-size: .8rem; padding: 6px; }
.photo-preview { aspect-ratio: 1; border: 2px dashed var(--line); border-radius: 12px; background: var(--tint); display: grid; place-items: center; overflow: hidden; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview svg { width: 40px; height: 40px; fill: none; stroke: var(--brand); stroke-width: 1.6; }
.photo-label { color: var(--ink); }

/* ---------- área pessoal e profissionais ---------- */
.pro-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 6px 0 10px; }
.pro-tile { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 14px 16px; text-decoration: none; display: flex; flex-direction: column; }
.pro-tile b { font-size: 1.4rem; } .pro-tile span { color: #c9daf3; font-size: .9rem; }
.reports, .queue { display: grid; gap: 10px; }
.report { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--alert); border-radius: var(--radius); padding: 14px 16px; display: flex; gap: 14px; justify-content: space-between; align-items: start; }
.report p { margin: 4px 0 0; }
.pending { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; }
.pending-request { grid-template-columns: 1fr; }
.pending-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pending-photos figure { margin: 0; }
.pending-photos img, .pending-photos .no-photo { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--tint); display: grid; place-items: center; }
.pending-photos figcaption { font-size: .75rem; color: var(--muted); text-align: center; text-transform: capitalize; }
.pending-info { display: grid; gap: 6px; align-content: start; } .pending-info p, .pending-info h3 { margin: 0; }
@media (max-width: 720px) { .pending { grid-template-columns: 1fr; } }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.owner-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.btn-alert { border-color: var(--alert); color: var(--alert); }
.thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.thumbs img { border-radius: 10px; aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.tag-rejected { background: var(--alert-tint); color: var(--alert); }
.stats-4 { grid-template-columns: repeat(4, 1fr); } @media (max-width: 700px) { .stats-4 { grid-template-columns: 1fr 1fr; } }
.ok { color: var(--ok); }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.data th, table.data td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; }
table.data th { color: var(--muted); font-weight: 600; font-size: .82rem; background: var(--tint); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr:last-child td { border-bottom: 0; }
@media (max-width: 760px) {
  .account { flex-wrap: wrap; justify-content: flex-end; gap: 2px; min-width: 0; }
  .account .btn { padding: 6px 8px; font-size: .9rem; }
}
body { overflow-x: hidden; }

/* ---------- árvore genealógica ---------- */
.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.seg { padding: 8px 14px; border-radius: 9px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .92rem; }
.seg:hover { background: var(--tint); }
.seg.is-active { background: var(--brand); color: #fff; }
.tree-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; -webkit-overflow-scrolling: touch; }
.tree-svg { display: block; max-width: none; font-family: var(--font); }
.tree-link { fill: none; stroke-width: 2; }
.line-p { stroke: #7fa8e6; } .line-m { stroke: #e3a1ae; }
.tree-node { stroke-width: 1.5; }
.node-self { fill: var(--navy); stroke: var(--navy); }
.node-male { fill: #eaf2fd; stroke: #7fa8e6; }
.node-female { fill: #fdeef1; stroke: #e3a1ae; }
.node-empty { fill: var(--surface); stroke: var(--line); stroke-dasharray: 5 4; }
.node-cap { font-size: 11px; fill: var(--muted); }
.node-name { font-size: 15px; font-weight: 700; fill: var(--ink); }
.node-kcv { font-size: 10.5px; font-weight: 700; fill: var(--brand-dark); font-family: ui-monospace, Consolas, monospace; }
.node-cap.on-dark, .node-kcv.on-dark { fill: #9cc4fb; } .node-name.on-dark { fill: #fff; }
a .tree-node { cursor: pointer; } a:hover .tree-node, a:focus .tree-node { stroke-width: 3; }
.tree-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin: 10px 0; }
.lg { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; border: 1.5px solid; }
.lg-male { background: #eaf2fd; border-color: #7fa8e6; } .lg-female { background: #fdeef1; border-color: #e3a1ae; } .lg-empty { border-style: dashed; border-color: var(--muted); }
.tree-list { margin-top: 8px; } .tree-list summary { cursor: pointer; font-weight: 600; color: var(--brand-dark); }
.ped-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .ped-grid { grid-template-columns: 1fr; } }
.ped-slot { display: grid; gap: 6px; padding: 10px; border-radius: 10px; border-left: 4px solid; background: var(--bg); }
.slot-male { border-color: #7fa8e6; } .slot-female { border-color: #e3a1ae; }
.ped-label { font-weight: 700; font-size: .9rem; }
.ped-more > summary { cursor: pointer; font-weight: 700; color: var(--brand-dark); padding: 6px 0 12px; }
.ped-more fieldset + fieldset { margin-top: 14px; }
.swipe-hint { display: none; } @media (max-width: 700px) { .swipe-hint { display: block; } }

/* ---- v5: contas, raças FCI, fotos, mosaico ---- */
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.banner-pending, .banner-info, .banner-ok { display: block; }
.banner-ok { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; }
.center { text-align: center; }

/* palavra-passe com "mostrar" */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 48px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: transparent;
  color: var(--muted); border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.pw-toggle:hover, .pw-toggle[aria-pressed="true"] { color: var(--brand-dark); background: var(--tint); }
.pw-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
label small.hint { font-weight: 400; }

/* lista flutuante de raças */
.combo { position: relative; }
.combo input[role=combobox] { width: 100%; }
.combo-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: min(320px, 50vh); overflow-y: auto; margin: 0; padding: 4px;
  list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgb(0 0 0 / .16); }
.combo-list li[role=option] { padding: 9px 10px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.combo-list li[role=option]:hover, .combo-list li.active { background: var(--tint); }
.combo-list small { color: var(--muted); font-size: .76rem; white-space: nowrap; }
.combo-group { padding: 10px 10px 4px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.combo-empty { padding: 12px 10px; color: var(--muted); font-size: .9rem; }
.combo-label { margin-bottom: -6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--tint); color: var(--brand-dark); border-radius: 999px; padding: 4px 4px 4px 12px; font-size: .88rem; font-weight: 600; }
.chip button { border: 0; background: transparent; color: inherit; font-size: 1.1rem; line-height: 1; width: 26px; height: 26px; border-radius: 50%; cursor: pointer; }
.chip button:hover { background: color-mix(in srgb, var(--brand) 18%, transparent); }

/* interruptor (canil) */
.kennel { display: grid; gap: 12px; }
.kennel [data-kennel-fields] { display: grid; gap: 12px; }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { width: 46px; height: 28px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform .15s; }
.switch input:checked + .switch-ui { background: var(--brand); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--brand); outline-offset: 2px; }

/* fotos: tirar com a câmara ou escolher da galeria */
.photo-slot { cursor: default; }
.photo-slot.missing .photo-preview { outline: 2px solid var(--alert); outline-offset: 2px; }
.photo-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.photo-btns .btn { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; font-size: .82rem; padding: 7px 10px; position: relative; }
.photo-btns svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* estatísticas clicáveis */
a.stat { text-decoration: none; color: inherit; transition: transform .12s, box-shadow .12s; }
a.stat:hover, a.stat:focus-visible { transform: translateY(-2px); box-shadow: 0 6px 18px rgb(11 42 92 / .12); }
a.stat span::after { content: " →"; }
.stat-alert b { color: var(--alert); }

/* mosaico de cães */
.mosaic { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.mosaic-lg { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.tile { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--tint); display: grid; place-items: center; text-decoration: none; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.tile:hover img, .tile:focus-visible img { transform: scale(1.06); }
.tile-cap { position: absolute; inset: auto 0 0 0; padding: 18px 8px 6px; color: #fff; background: linear-gradient(transparent, rgb(0 0 0 / .72)); display: grid; line-height: 1.2; }
.tile-cap b { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-cap small { font-size: .72rem; opacity: .9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile.is-missing { outline: 3px solid var(--alert); outline-offset: -3px; }
.chips-filter { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 12px; margin-bottom: 8px; scrollbar-width: thin; }
.chips-filter a { flex: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); background: var(--surface); font-size: .9rem; }
.chips-filter a.active { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (max-width: 520px) { .mosaic, .mosaic-lg { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.tag-offer { background: var(--navy); color: #fff; }
.dog-photo .tag-offer { position: absolute; left: 10px; bottom: 10px; top: auto; }
/* link discreto "Este cão parece perdido?" (cão não dado como desaparecido) */
.found-discreet { margin-top: 4px; }
.found-discreet > summary { list-style: none; cursor: pointer; color: var(--muted); font-size: .92rem; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 0; text-decoration: underline; text-underline-offset: 3px; }
.found-discreet > summary::-webkit-details-marker { display: none; }
.found-discreet > summary::before { content: "⚠"; text-decoration: none; display: inline-block; }
.found-discreet > summary:hover { color: var(--alert); }
.found-discreet[open] > summary { color: var(--ink); text-decoration: none; font-weight: 600; }
.found-discreet .found-form { margin-top: 8px; }

/* ---- v8: página inicial arrumada ---- */
.hero-auth { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.hero-auth .btn { justify-content: center; }
.note-wide { display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.note-wide > div { flex: 1 1 320px; }
.note-wide h3 { margin-bottom: 4px; }
.note-wide p { margin: 0; }
.faq-small { font-size: .88rem; color: var(--muted); padding-top: 0; }
.faq-small h2 { font-size: 1.05rem; color: var(--ink); }
.faq-small .faq summary { font-size: .9rem; padding: 8px 0; }
.faq-small .faq p { font-size: .86rem; }

/* ---- v8: painel do administrador ---- */
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.admin-nav a { padding: 7px 14px; border-radius: 999px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); font-size: .92rem; }
.admin-nav a.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.sr-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.stats-admin { grid-template-columns: repeat(3, 1fr); margin-top: 0; }
@media (max-width: 700px) { .stats-admin { grid-template-columns: 1fr 1fr; } }
.stat-warn b { color: #b7791f; }
.admin h2 { margin-top: 28px; display: flex; align-items: center; gap: 8px; }
.count { background: var(--alert); color: #fff; border-radius: 999px; font-size: .8rem; padding: 2px 9px; }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px 12px; align-items: end;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.filters label { font-size: .84rem; }
.filters select, .filters input:not([type=checkbox]) { width: 100%; }
.filters .check { display: flex; gap: 8px; align-items: center; align-self: center; }
.analysis-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.big-count { margin: 6px 0 12px; font-size: 1rem; }
.big-count b { font-size: 1.7rem; color: var(--brand-dark); font-variant-numeric: tabular-nums; margin-right: 4px; }
table.bars td.bar-col, table.bars th.bar-col { width: 38%; }
.bar { display: block; height: 10px; border-radius: 6px; background: var(--brand); opacity: .85; }
.dog-list { margin-top: 14px; }
.dog-list > summary { cursor: pointer; font-weight: 600; color: var(--brand-dark); padding: 6px 0; }
.users-table tbody tr { cursor: pointer; }
.users-table tbody tr:hover, .users-table tbody tr:focus-visible { background: var(--tint); outline: none; }
.pill { display: inline-block; background: var(--tint); color: var(--brand-dark); border-radius: 999px; font-size: .74rem; font-weight: 700; padding: 2px 9px; vertical-align: middle; }
.pill-lg { font-size: .9rem; padding: 5px 14px; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 8px; }
.detail-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.detail-card h2 { margin: 0 0 4px !important; font-size: 1rem; }
.detail-card .facts { grid-template-columns: 1fr; margin: 8px 0 0; }
.warn-text { color: var(--alert); }
.guest-btns { display: contents; }
body.on-home .guest-btns { display: none; }
.ok-text { color: var(--ok); } .tutor-box .hint { margin: 0; }
/* linha "Tutor" no topo da ficha do cão (administrador) */
.tutor-line { margin-bottom: 6px; }
.tutor-row { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; }
.tutor-label { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); }
.tutor-name { font-weight: 700; }
.tutor-btns { display: inline-flex; gap: 6px; }
.btn-xs { padding: 4px 10px; font-size: .8rem; min-height: 0; border-radius: 8px; }
.tutor-edit { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tutor-edit input { flex: 1 1 220px; }
.tutor-line .form-status { margin: 6px 0 0; font-size: .86rem; }
.tutor-line .form-status:empty { display: none; }

/* cartão do cão pequeno, ao lado do nome e do KCV */
.dog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dog-head .dog-title { margin-bottom: 0; }
.id-card-mini { flex: none; border-radius: 12px; box-shadow: 0 3px 10px rgba(10, 30, 60, .08); }
.id-card-mini .id-card-head { padding: 4px 8px; font-size: .68rem; gap: 5px; }
.id-card-mini .qr { margin: 6px; border: 0; padding: 0; }
.dog-bottom:has(> :only-child) { grid-template-columns: minmax(0, 1fr); max-width: 640px; }
.id-card-wrap { flex: none; width: 118px; }
.qr-caption { margin: 5px 0 0; font-size: .62rem; line-height: 1.3; color: var(--muted); text-align: center; }

/* filtros do painel: um botão "funil" que abre todos os filtros */
.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.filter-btn { display: inline-flex; align-items: center; gap: 6px; }
.filter-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.filter-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.filter-count { background: var(--alert); color: #fff; border-radius: 999px; font-size: .72rem; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-soft { background: transparent; border: 1px dashed var(--line); color: var(--muted); padding-right: 12px; }
.filters-pop { box-shadow: 0 10px 28px rgb(11 42 92 / .12); }
.filters-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }

/* lista de cães do painel: ordenar e filtrar por coluna */
table.sortable th { white-space: nowrap; vertical-align: bottom; }
.th-sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font: inherit; color: inherit; }
.th-sort:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.sort-ico::after { content: "↕"; opacity: .35; font-size: .85em; }
th[aria-sort="ascending"] .sort-ico::after { content: "▲"; opacity: 1; color: var(--brand); }
th[aria-sort="descending"] .sort-ico::after { content: "▼"; opacity: 1; color: var(--brand); }
tr.col-filters th { padding-top: 0; padding-bottom: 8px; }
tr.col-filters input, tr.col-filters select { width: 100%; min-width: 80px; padding: 5px 6px; font-size: .78rem; font-weight: 400; border-radius: 7px; }
table.sortable td .kcv { white-space: nowrap; }

/* mosaico de cães: cartão com foto do rosto, nome, KCV, raça e sexo */
.tile-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.tile-card:hover, .tile-card:focus-visible { transform: translateY(-2px); box-shadow: 0 8px 22px rgb(11 42 92 / .12); }
.tile-photo { position: relative; aspect-ratio: 1; background: var(--tint); display: grid; place-items: center; overflow: hidden; }
.tile-photo img { width: 100%; height: 100%; object-fit: cover; }
.tile-photo .tag { position: absolute; left: 8px; top: 8px; }
.tile-body { display: grid; gap: 2px; padding: 10px 12px 12px; }
.tile-name { font-size: 1.02rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-body .kcv { font-size: .86rem; }
.tile-meta { font-size: .82rem; color: var(--muted); line-height: 1.3; }
.tile-card.is-missing { border-color: var(--alert); box-shadow: 0 0 0 2px var(--alert); }

/* revisão de cães validados */
.banner-review { display: flex; gap: 12px; align-items: flex-start; background: #fff7e6; border: 1px solid #f0c36d; color: #5c3d00; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; }
.banner-review svg { flex: none; width: 22px; height: 22px; color: #b7791f; fill: none; stroke: currentColor; stroke-width: 2; }
.banner-review .btn-row { margin-top: 10px; }
.banner-review a { color: inherit; font-weight: 600; }
.review-form { margin-top: 12px; padding: 14px 16px; border: 1px solid #f0c36d; background: #fff7e6; border-radius: var(--radius); display: grid; gap: 10px; }
.review-form p { margin: 0; }
.btn-danger { background: var(--alert); border-color: var(--alert); }
@media (prefers-color-scheme: dark) { .banner-review, .review-form { background: #3a2c10; border-color: #8a6420; color: #f5deb0; } }
.report-done { opacity: .7; border-left-color: var(--line) !important; }
.report .pill { margin-left: 6px; }
.small-check { font-size: .86rem; display: flex; gap: 8px; align-items: center; margin: -4px 0 10px; }
/* seguimento dos avisos (administrador) */
.report-admin { display: block; }
.report-admin .report-main > p { margin: 6px 0; }
.pill-new { background: var(--alert-tint); color: var(--alert); }
.pill-warn { background: #fff1d6; color: #8a5a00; }
.pill-ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.followup { background: var(--tint); border-radius: 8px; padding: 8px 10px; }
.report-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.report-form { display: grid; gap: 8px; margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.report-form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
/* conversa interna administrador ⇄ tutor */
.thread-title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 12px 0 4px; }
.thread { display: grid; gap: 6px; margin: 4px 0 10px; }
.msg { max-width: 80%; padding: 8px 12px; border-radius: 14px; display: grid; gap: 2px; }
.msg-me { justify-self: end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg-them { justify-self: start; background: var(--tint); color: var(--ink); border-bottom-left-radius: 4px; }
.msg-who { font-size: .7rem; opacity: .8; }
.msg-body { white-space: pre-wrap; }
.reply-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 6px; }
.reply-form textarea { flex: 1; min-height: 44px; }
.report .report-main { flex: 1; min-width: 0; }

/* ---- ficha do cão (estilo cartão de perfil) ---- */
.dog-hero-card { background: linear-gradient(160deg, var(--brand), #0f56b8); color: #fff; border-radius: 22px; padding: 26px 18px 20px;
  display: grid; justify-items: center; text-align: center; gap: 10px; margin-bottom: 16px; box-shadow: 0 10px 30px rgb(23 109 222 / .25); }
.dog-avatar { width: 132px; height: 132px; border-radius: 50%; overflow: hidden; border: 4px solid #fff; background: #fff; box-shadow: 0 6px 18px rgb(0 0 0 / .2); display: grid; place-items: center; }
.dog-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dog-avatar .no-photo { color: var(--muted); font-size: .8rem; }
.dog-hero-card .dog-title { color: #fff; margin: 4px 0 0; font-size: clamp(1.6rem, 4vw, 2.2rem); display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; justify-content: center; }
.dog-hero-card .dog-title .kcv { color: #fff; opacity: .9; font-size: .55em; }
.dog-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chip-light, .chip-dark, .chip-status { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 12px; font-size: .86rem; font-weight: 600; }
.chip-light { background: #fff; color: var(--brand-dark); }
.chip-dark { background: rgb(11 42 92 / .55); color: #fff; }
.chip-dark svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.chip-status { background: #fff3d6; color: #7a4d00; }
.chip-status.is-missing { background: var(--alert); color: #fff; }
.dog-hero-card .tutor-line { background: rgb(255 255 255 / .12); border-radius: 12px; padding: 8px 12px; margin-top: 4px; }
.dog-hero-card .tutor-label, .dog-hero-card .tutor-name, .dog-hero-card .tutor-line .muted { color: #fff; }
.dog-hero-card .tutor-line .btn-outline { background: #fff; }
.dog-hero-card .tutor-line .form-status { color: #fff; }

.dog-grid { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 16px; align-items: start; }
.dog-col { display: grid; gap: 16px; min-width: 0; }
.dog-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.dog-card h2 { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; color: var(--brand-dark); margin: 0 0 12px; }
.dog-card h2 svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.gallery3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.g-item { all: unset; cursor: pointer; display: grid; gap: 6px; border: 2px solid var(--line); border-radius: 14px; padding: 6px; background: var(--bg); text-align: center; }
.g-item.active { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent); }
.g-item:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.g-item[disabled] { cursor: default; opacity: .6; }
.g-img { aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--tint); display: grid; place-items: center; }
.g-img img { width: 100%; height: 100%; object-fit: cover; }
.g-label { font-size: .84rem; font-weight: 600; }
.info-list { margin: 0; display: grid; }
.info-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.info-list > div:last-child { border-bottom: 0; }
.info-list dt { color: var(--muted); font-size: .92rem; }
.info-list dd { margin: 0; font-weight: 700; text-align: right; }
.dog-side { display: grid; gap: 12px; justify-items: center; position: sticky; top: 84px; }
.dog-side .id-card-wrap { width: 150px; }
.dog-side .btn-block { width: 100%; justify-content: center; display: inline-flex; gap: 8px; align-items: center; }
.dog-side .btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.dog-side .privacy-note { text-align: center; font-size: .8rem; }
.back-row { margin-top: 18px; }
.back-row .btn { width: 100%; justify-content: center; }
/* fotos em ecrã inteiro com carrossel */
.lightbox { border: 0; padding: 0; margin: 0; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: 100vw; max-height: 100dvh; background: #000; color: #fff; overflow: hidden; }
.lightbox[open] { display: grid; grid-template-rows: auto 1fr auto; }
.lightbox::backdrop { background: #000; }
.lb-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: linear-gradient(rgb(0 0 0 / .6), transparent); z-index: 2; }
.lb-label { font-weight: 700; }
.lb-count { opacity: .75; font-size: .9rem; margin-right: auto; }
.lb-close { all: unset; cursor: pointer; width: 42px; height: 42px; display: grid; place-items: center; font-size: 1.4rem; border-radius: 50%; background: rgb(255 255 255 / .12); }
/* a foto ocupa a área disponível e é reduzida para caber inteira (nunca cortada) */
.lb-stage { position: relative; min-height: 0; min-width: 0; overflow: hidden; }
.lb-stage img { position: absolute; inset: 0 8px; width: calc(100% - 16px); height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lb-nav { all: unset; cursor: pointer; position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; display: grid; place-items: center;
  font-size: 2.4rem; line-height: 1; border-radius: 50%; background: rgb(255 255 255 / .14); color: #fff; z-index: 2; }
.lb-nav:hover, .lb-close:hover { background: rgb(255 255 255 / .28); }
.lb-nav:focus-visible, .lb-close:focus-visible, .lb-dot:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.lb-prev { left: 12px; } .lb-next { right: 12px; }
.lb-dots { display: flex; justify-content: center; gap: 10px; padding: 14px 0 calc(14px + env(safe-area-inset-bottom)); }
.lb-dot { all: unset; cursor: pointer; width: 10px; height: 10px; border-radius: 50%; background: rgb(255 255 255 / .4); }
.lb-dot.active { background: #fff; transform: scale(1.25); }
.lightbox.single .lb-nav, .lightbox.single .lb-dots { display: none; }
.dog-avatar img { cursor: zoom-in; }
.g-item:not([disabled]) { cursor: zoom-in; }
body.no-scroll { overflow: hidden; }
@media (max-width: 600px) { .lb-nav { width: 44px; height: 44px; font-size: 2rem; } }
.dog-page .owner-actions { margin: 0; }
@media (max-width: 760px) {
  .dog-grid { grid-template-columns: 1fr; }
  .dog-side { position: static; grid-template-columns: 150px 1fr; align-items: center; justify-items: stretch; }
  .dog-side .privacy-note { grid-column: 1 / -1; }
  .info-list dt { font-size: .86rem; }
}
/* galeria de 3 ângulos por baixo da foto principal */
.gallery-under { margin-top: 10px; }
.dog-hero-photo img[data-hero-photo] { cursor: zoom-in; }

/* link "Voltar" no fim de cada página */
.back-nav { padding-top: 8px; padding-bottom: 28px; }
.back-nav a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; color: var(--brand-dark); padding: 8px 0; }
.back-nav a:hover { text-decoration: underline; }
body.on-home .back-nav { display: none; }

/* ---- caixa de mensagens ---- */
.inbox-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: #fff; margin-right: 4px; flex: none; transition: transform .15s; }
.inbox-btn:hover, .inbox-btn:focus-visible { transform: scale(1.06); }
.inbox-btn svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.inbox-badge { position: absolute; top: -4px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--alert); color: #fff;
  font-size: .72rem; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--surface); line-height: 1; }
.inbox-btn.has-unread { animation: inbox-pop .4s ease-out; }
@keyframes inbox-pop { 0% { transform: scale(.8); } 70% { transform: scale(1.1); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .inbox-btn.has-unread { animation: none; } }
.convos { display: grid; gap: 8px; margin-bottom: 18px; }
.convo { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-decoration: none; color: inherit; }
.convo:hover { border-color: var(--brand); }
.convo.unread { border-left: 4px solid var(--alert); }
.convo.unread b { font-weight: 800; }
.convo-icon { flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--tint); display: grid; place-items: center; color: var(--brand); }
.convo-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; }
.convo-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.convo-main small { color: var(--muted); font-size: .78rem; }
.convo-last { color: var(--muted); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convo.unread .convo-last { color: var(--ink); }
.convo-side { display: grid; justify-items: end; gap: 4px; font-size: .74rem; color: var(--muted); }
.inbox-count { background: var(--alert); color: #fff; border-radius: 999px; min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; font-weight: 800; font-size: .75rem; }
.new-msg { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 8px; }
.new-msg label { flex: 1 1 240px; }
.convo-title { margin-bottom: 4px; }
.convo-box { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: grid; gap: 8px; }
.convo-box .thread { max-height: 55vh; overflow-y: auto; padding-right: 4px; }

/* ficha do cão: cabeçalho com a foto do rosto num círculo */
.dog-sheet { max-width: 900px; }
.dog-header { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; }
.dog-face { all: unset; cursor: zoom-in; flex: none; width: 128px; height: 128px; border-radius: 50%; overflow: hidden; border: 5px solid #fff;
  box-shadow: 0 4px 16px rgb(11 42 92 / .22), 0 0 0 1px var(--line); background: var(--tint); display: grid; place-items: center; }
.dog-face img { width: 100%; height: 100%; object-fit: cover; }
.dog-face .no-photo { font-size: .8rem; color: var(--muted); }
.dog-face:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.dog-header-info { flex: 1; min-width: 0; }
.dog-header-info .dog-title { margin: 2px 0 0; overflow-wrap: anywhere; }
.dog-header-info .kcv { white-space: nowrap; }
.dog-header .id-card-wrap { flex: none; }
.dog-sheet .gallery-under { margin: 0 0 18px; max-width: 520px; }
@media (max-width: 600px) {
  .dog-header { flex-wrap: wrap; gap: 12px 14px; }
  .dog-face { width: 96px; height: 96px; border-width: 4px; }
  .dog-header-info .kcv-lg { font-size: .95rem; }
  .dog-header-info .dog-title { font-size: 1.6rem; }
  .dog-header .id-card-wrap { margin-left: auto; }
}
.convo-sub { margin-bottom: 12px; }
.finder-card { margin-top: 10px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--alert); border-radius: 12px; padding: 10px 12px; color: var(--ink); }
.finder-card p { margin: 4px 0 0; }
.small-link { font-size: .82rem; margin-left: 6px; }

/* Espaço das fotos (painel do administrador) */
.storage-box { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.storage-box p { margin: 8px 0 0; }
.meter { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--ok); border-radius: inherit; }
.meter-warn span { background: #d99a1a; }
.meter-alert span { background: var(--alert); }

/* Fotos novas a aguardar aprovação */
.photo-change .pending-photos { grid-template-columns: repeat(2, 1fr); }
.photo-change figure.is-new { outline: 3px solid var(--ok); outline-offset: -3px; border-radius: 10px; }

/* Pedidos a aprovar (caixa de mensagens do administrador) */
.notices-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.notice .convo-icon { background: #fff4e0; color: #b26a00; }
.notice:not(.unread) { opacity: .7; }

/* Login unificado: Google, Facebook e formas de entrar */
.social-login { display: grid; gap: 10px; }
.btn-facebook { width: 100%; background: #1877f2; color: #fff; border-color: #1877f2; }
.btn-facebook:hover { background: #166fe5; }
.btn-facebook svg { stroke: none; width: 20px; height: 20px; }
.login-methods ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.login-method { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.login-method > span { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.login-method svg { width: 18px; height: 18px; color: var(--ok); }
.login-method:not(.on) b { color: var(--muted, #667); font-weight: 600; }

/* Transferência de tutor */
.search-inline { display: flex; gap: 8px; }
.search-inline input { flex: 1; min-width: 0; }
.transfer-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 10px 0; background: var(--surface); color: var(--ink); }
.transfer-card h3 { margin: 0 0 6px; }
.transfer-card blockquote { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--line); color: var(--muted); }
.transfer-log { padding-left: 18px; }
.transfer-history { margin: 10px 0; }
.transfer-history summary { cursor: pointer; font-weight: 600; }

/* ícones dentro de avisos (ok / à espera / informação) com tamanho fixo */
.banner-ok svg, .banner-pending svg, .banner-info svg, .transfer-card svg { width: 18px; height: 18px; flex: none;
  vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 2; }

/* Anúncios: adoção, venda e cruzamento */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 14px; }
.tab { padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; }
.tab.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.price { font-weight: 700; color: var(--brand-dark, var(--brand)); }
.listing-card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: var(--radius); padding: 16px 18px; margin: 14px 0; }
.listing-card h2 { margin: 0 0 8px; font-size: 1.15rem; }
.listing-phone a { font-weight: 600; }
.listing-box { border: 1px dashed var(--line); border-radius: 10px; padding: 12px; margin-top: 10px; }
.radio-row { border: 0; padding: 0; margin: 8px 0; display: grid; gap: 6px; }

/* Denunciar */
.report-box { margin: 18px 0 4px; font-size: .92rem; }
.report-box summary { cursor: pointer; color: var(--muted); text-decoration: underline; width: fit-content; }
.report-box form { margin-top: 10px; }
label.small { font-size: .9rem; }

/* =================================================================
   v56 – aspeto mais limpo
   ================================================================= */
/* topo: uma só linha; conta num menu */
.account { gap: 6px; }
.acct-menu { position: relative; }
.acct-btn { list-style: none; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px 4px 4px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: .92rem; }
.acct-btn::-webkit-details-marker { display: none; }
.acct-btn:hover, .acct-menu[open] .acct-btn { border-color: var(--brand); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--tint); color: var(--brand-dark); display: grid; place-items: center; font-weight: 800; }
.acct-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.caret { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 14px 34px rgb(11 42 92 / .16); padding: 6px; display: grid; z-index: 40; }
.menu-pop a, .menu-pop button { all: unset; cursor: pointer; padding: 10px 12px; border-radius: 9px; color: var(--ink); font-size: .95rem; }
.menu-pop a:hover, .menu-pop button:hover, .menu-pop a:focus-visible, .menu-pop button:focus-visible { background: var(--tint); }
.menu-who { margin: 0 0 4px; padding: 8px 12px 10px; border-bottom: 1px solid var(--line); display: grid; }
.menu-who b { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; }
.menu-who small { color: var(--muted); font-size: .8rem; }
.menu-out { color: var(--alert) !important; border-top: 1px solid var(--line); margin-top: 4px; border-radius: 0 0 9px 9px !important; }
.inbox-btn { width: 38px; height: 38px; margin-right: 0; }

/* barra de abas no fundo (só telemóvel) */
.tabbar { display: none; }
@media (max-width: 760px) {
  .topbar-row { flex-wrap: nowrap; min-height: 58px; gap: 8px; }
  .topbar .nav { display: none; }
  .brand small { display: none; }
  .brand img { width: 32px; height: 32px; }
  .acct-name, .caret { display: none; }
  .acct-btn { padding: 2px; border: 0; background: transparent; }
  .account { margin-left: auto; flex-wrap: nowrap; }
  .account .btn { padding: 7px 10px; font-size: .9rem; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--surface); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; text-decoration: none; color: var(--muted); font-size: .7rem; font-weight: 600; border-radius: 10px; }
  .tabbar svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a.active { color: var(--brand-dark); }
  .tabbar a.active svg { stroke-width: 2.2; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .footer { margin-top: 10px; }
  .back-nav { padding-bottom: 10px; }
  .back-nav a { font-size: .92rem; }
  .demo-banner { font-size: .76rem; padding: 4px 10px; }
}

/* página inicial: 4 atalhos */
.actions { grid-template-columns: repeat(4, 1fr); }
.action { flex-direction: row; justify-content: flex-start; text-align: left; padding: 14px 16px; gap: 12px; font-size: .95rem; }
.action svg { flex: none; width: 26px; height: 26px; }
@media (max-width: 960px) { .actions { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) {
  .actions { margin-top: 14px; gap: 8px; }
  .action { padding: 12px; gap: 10px; font-size: .88rem; line-height: 1.25; }
  .action svg { width: 22px; height: 22px; }
  .hero { padding: 22px 0 26px; }
  .hero h1 { font-size: 1.45rem; }
  .search-card { padding: 16px; }
  .stats { gap: 8px; margin-top: 14px; }
  .stat { padding: 10px 12px; }
  .stat b { font-size: 1.3rem; }
  .stat span { font-size: .78rem; line-height: 1.25; }
  .section { margin-top: 28px; }
  .section-head h2 { font-size: 1.15rem; }
}
.tile-since { font-size: .78rem; color: var(--alert); font-weight: 600; margin-top: 2px; }
.tile-card.is-missing { box-shadow: none; border: 2px solid var(--alert); }

/* cartões de cães: um só estilo, compactos (corrige regra antiga com margem interna) */
a.dog-card { padding: 0; border-radius: var(--radius); gap: 0; }
a.dog-card.is-missing { border: 2px solid var(--alert); }
@media (max-width: 520px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dog-photo { aspect-ratio: 1; }
  .dog-body { padding: 8px 10px 10px; font-size: .8rem; line-height: 1.35; }
  .dog-name { font-size: .98rem; }
  .dog-body .kcv { font-size: .8rem; }
  .tag { font-size: .68rem; padding: 2px 8px; top: 8px; left: 8px; }
}

/* ficha do cão: painel "Gerir" e links discretos juntos */
.manage { margin-top: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; max-width: 560px; }
.manage-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 10px; }
.manage-main { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.manage-main .btn { white-space: normal; text-align: center; line-height: 1.2; padding: 10px 12px; }
.manage-main .btn:only-child { grid-column: 1 / -1; }
.manage-more { display: grid; margin-top: 10px; border-top: 1px solid var(--line); padding-top: 4px; }
.manage-more a, .manage-more button { all: unset; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 10px 4px; color: var(--ink); font-size: .94rem;
  border-bottom: 1px solid var(--line); }
.manage-more > :last-child { border-bottom: 0; }
.manage-more a::after, .manage-more button::after { content: "›"; margin-left: auto; color: var(--muted); font-size: 1.2rem; }
.manage-more a:hover, .manage-more button:hover { color: var(--brand-dark); }
.manage-more svg { width: 19px; height: 19px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.manage-more .is-alert, .manage-more .is-alert svg { color: var(--alert); stroke: var(--alert); }
.dog-sheet .listing-card { max-width: 560px; }
.dog-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 22px; margin-top: 22px; padding-top: 12px; border-top: 1px solid var(--line); max-width: 900px; }
.dog-foot .privacy-note { flex-basis: 100%; margin: 0 0 4px; }
.dog-foot .found-discreet, .dog-foot .report-box { margin: 0; font-size: .88rem; }
.dog-foot details[open] { flex-basis: 100%; }
.dog-foot .report-box summary { list-style: none; padding: 6px 0; }
.dog-foot .report-box summary::-webkit-details-marker { display: none; }
.dog-sheet > p:has(> a[href$="/genealogia"]) { margin: 4px 0 0; }
@media (max-width: 600px) {
  .dog-header { gap: 10px 12px; margin-bottom: 12px; }
  .dog-sheet .gallery-under { gap: 8px; }
  .g-item { padding: 4px; border-radius: 12px; }
  .g-label { font-size: .76rem; }
  .facts { gap: 8px 14px; font-size: .94rem; }
}
@media (max-width: 760px) { .guest-btns .btn-ghost { display: none; } }
@media (max-width: 520px) {
  .report { flex-direction: column; gap: 10px; }
  .report > .btn, .report > button { align-self: flex-start; }
}
.tutor-btns { flex-wrap: wrap; }
/* Anúncios: filtros no botão do funil */
.funnel-pop { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.page .grid + .note-card, .page .center + .note-card { margin-top: 22px; }
p.center { max-width: none; }
