/* TagUrBuddy shared styles. Branding is driven by two CSS custom properties
   (--brand, --brand-bg) that tb.js overrides per workspace. */
:root {
  --brand: #4f46e5;
  --brand-bg: #0b1020;
  --ink: #1a1a2e;
  --muted: #6b7280;
  --surface: #ffffff;
  --line: #e5e7eb;
  --ok: #16a34a;
  --warn: #f59e0b;
  --bad: #dc2626;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: #f4f4f8;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
img { max-width: 100%; }

.wrap { max-width: 480px; margin: 0 auto; padding: 20px 16px 48px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin: 14px 0;
}
.brandbar {
  display: flex; align-items: center; gap: 10px;
  padding: 16px; color: #fff; background: var(--brand);
}
.brandbar img { height: 30px; width: auto; border-radius: 6px; background: #fff; padding: 2px; }
.brandbar strong { font-size: 17px; }

h1 { font-size: 22px; margin: 4px 0 12px; }
h2 { font-size: 17px; margin: 18px 0 8px; }
p.muted, .muted { color: var(--muted); }
small { color: var(--muted); }

label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
input, select, textarea {
  width: 100%; padding: 11px 12px; font: inherit;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); border-color: var(--brand); }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 16px; font: inherit; font-weight: 600;
  border: 0; border-radius: 10px; cursor: pointer;
  background: var(--brand); color: #fff;
}
button.ghost, .btn.ghost { background: #eef0f4; color: var(--ink); }
button.block, .btn.block { width: 100%; }
button:disabled { opacity: .55; cursor: default; }
button.danger { background: var(--bad); }

.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
}
.badge.lost { background: #fee2e2; color: var(--bad); }
.badge.ok { background: #dcfce7; color: var(--ok); }

.pet-photo {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
  border-radius: 12px; background: #eef0f4;
}

.lost-banner {
  background: #fef2f2; border: 1px solid #fecaca; color: #991b1b;
  border-radius: 12px; padding: 14px; margin: 12px 0;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 8px 0 4px; }
.tab { padding: 9px 12px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; }
.tab.active { color: var(--brand); border-color: var(--brand); }

#tb-toasts { position: fixed; left: 0; right: 0; bottom: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 9999; pointer-events: none; }
.tb-toast {
  background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 10px;
  font-size: 14px; max-width: 90vw; opacity: 0; transform: translateY(8px);
  transition: opacity .25s, transform .25s;
}
.tb-toast.show { opacity: 1; transform: none; }
.tb-toast--bad { background: var(--bad); }
.tb-toast--ok { background: var(--ok); }

.center { text-align: center; }
.stack > * + * { margin-top: 10px; }
.hidden, [hidden] { display: none !important; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; margin: 24px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
