/* ─── Demo mode banner ─────────────────────────────────────────────────────── */

.demo-mode-bar {
  background: #1a1206;
  border-bottom: 1px solid #7c5c1e;
  color: #c8a055;
  font-family: var(--f-mono);
  font-size: .68rem;
  letter-spacing: .04em;
  padding: .45rem 1.25rem;
  text-align: center;
}
.demo-mode-bar .demo-creds {
  color: #e8c070;
  font-weight: 500;
}

/* ─── Beta layout ─────────────────────────────────────────────────────────── */

.beta-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Header ──────────────────────────────────────────────────────────────── */

.b-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border-hi);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.b-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 56px;
}

.b-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.b-brand {
  font-family: var(--f-serif);
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.b-back {
  font-family: var(--f-mono);
  font-size: .8rem;
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: .02em;
  white-space: nowrap;
}
.b-back:hover { color: var(--text); }

.b-header-right {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
}

/* Account dropdown */
.b-account {
  position: relative;
}

.b-account-trigger {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: none;
  border: 1px solid var(--border-hi);
  color: var(--text);
  font-family: var(--f-mono);
  font-size: .8rem;
  letter-spacing: .03em;
  padding: .4rem .8rem;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  white-space: nowrap;
  min-height: 36px;
}
.b-account-trigger:hover {
  border-color: var(--accent);
  color: var(--text);
}

.b-caret {
  flex-shrink: 0;
  opacity: .6;
  transition: transform .2s;
}
.b-account-trigger[aria-expanded="true"] .b-caret {
  transform: rotate(180deg);
}

.b-account-menu {
  display: none;
  position: absolute;
  top: calc(100% + .5rem);
  right: 0;
  min-width: 190px;
  background: var(--surface);
  border: 1px solid var(--border-hi);
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
  z-index: 200;
}
.b-account-menu.open { display: block; }

.b-account-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .875rem 1.1rem;
  font-family: var(--f-mono);
  font-size: .8rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: background .1s, color .1s;
}
.b-account-item:hover {
  background: var(--surface-hi);
  color: var(--text);
}

.b-account-item-label { flex: 1; }

.b-account-item-hint {
  font-size: .7rem;
  color: var(--text-faint);
  background: var(--surface-hi);
  padding: .1rem .4rem;
  letter-spacing: .02em;
}

.b-account-divider {
  height: 1px;
  background: var(--border);
  margin: .25rem 0;
}

.b-account-signout { color: var(--text-dim); }
.b-account-signout:hover { color: var(--error, #e05c5c); }

/* Theme button */
.b-theme-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  padding: .25rem;
  min-width: 32px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s;
}
.b-theme-btn:hover { color: var(--text); }

/* ─── Main content ────────────────────────────────────────────────────────── */

.b-main {
  flex: 1;
  padding: 0 0 2.5rem;
}

/* ─── Footer ──────────────────────────────────────────────────────────────── */

.b-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
  text-align: center;
  font-family: var(--f-mono);
  font-size: .78rem;
  color: var(--text-dim);
  letter-spacing: .04em;
}
.b-footer a { color: var(--text-dim); text-decoration: none; }
.b-footer a:hover { color: var(--text); }
.b-footer-sep { margin: 0 .6rem; opacity: .4; }

/* ─── Home wrap ───────────────────────────────────────────────────────────── */

.bh-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ─── Greeting ────────────────────────────────────────────────────────────── */

.bh-greeting {
  padding: 2.25rem 0 1.5rem;
}
.bh-greeting-text {
  font-family: var(--f-serif);
  font-size: 1.85rem;
  font-weight: 300;
  color: var(--text);
  margin: 0 0 .3rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.bh-greeting-date {
  font-family: var(--f-mono);
  font-size: .8rem;
  color: var(--text-dim);
  margin: 0;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ─── Cards ───────────────────────────────────────────────────────────────── */

.bh-card {
  background: var(--surface);
  border: 1px solid var(--border-hi);
  margin-bottom: 1.25rem;
}

/* ─── Briefing ────────────────────────────────────────────────────────────── */

.bh-briefing-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  padding: 1rem 1.1rem;
  font-family: var(--f-mono);
  font-size: .82rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-dim);
  cursor: pointer;
  text-align: left;
  transition: color .15s;
}
.bh-briefing-toggle:hover { color: var(--text); }

.bh-toggle-caret {
  flex-shrink: 0;
  opacity: .5;
  transition: transform .2s;
}

.bh-briefing-body {
  padding: 0 1.1rem 1.1rem;
  border-top: 1px solid var(--border);
}

.bh-briefing-content {
  font-size: .95rem;
  line-height: 1.7;
  color: var(--text-dim);
}
.bh-briefing-content a {
  color: var(--accent);
  text-decoration: underline;
}
.bh-briefing-content p { margin: 0 0 .8rem; }
.bh-briefing-content p:last-child { margin: 0; }

.bh-briefing-ts {
  font-family: var(--f-mono);
  font-size: .7rem;
  color: var(--text-faint);
  margin: .875rem 0 0;
  letter-spacing: .03em;
}

/* ─── Scan button ─────────────────────────────────────────────────────────── */

.bh-scan-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  width: 100%;
  padding: 1.1rem 1rem;
  margin-bottom: 1.75rem;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--f-mono);
  font-size: .95rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: opacity .15s;
  min-height: 58px;
}
.bh-scan-btn:hover { opacity: .88; }

/* ─── Section headers ─────────────────────────────────────────────────────── */

.bh-section { margin-bottom: 2rem; }

.bh-section-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--f-mono);
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 .875rem;
}

.bh-section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--bg);
  font-size: .65rem;
  min-width: 20px;
  height: 20px;
  padding: 0 .35rem;
  letter-spacing: 0;
}

/* ─── Animal list ─────────────────────────────────────────────────────────── */

.bh-animal-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--border-hi);
}

.bh-animal-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .875rem 1rem;
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: background .1s;
  min-height: 72px;
}
.bh-animal-card:hover { background: var(--surface-hi); }

.bh-animal-photo {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--surface-hi);
  display: flex;
  align-items: center;
  justify-content: center;
}
.bh-animal-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bh-animal-photo-placeholder {
  font-size: 1.35rem;
  opacity: .4;
}

.bh-animal-info {
  flex: 1;
  min-width: 0;
}

.bh-animal-name {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: .2rem;
}

.bh-status-badge {
  font-family: var(--f-mono);
  font-size: .65rem;
  letter-spacing: .04em;
  padding: .15rem .45rem;
  text-transform: uppercase;
}
.bh-status-badge.status-available { background: rgba(80,180,100,.15); color: #50b464; }
.bh-status-badge.status-hold      { background: rgba(220,80,60,.12);  color: #dc503c; }
.bh-status-badge.status-stray     { background: rgba(200,140,40,.15); color: #c88c28; }
.bh-status-badge.status-other     { background: var(--surface-hi); color: var(--text-faint); }

.bh-animal-meta {
  font-family: var(--f-mono);
  font-size: .75rem;
  color: var(--text-dim);
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bh-animal-flag {
  font-family: var(--f-mono);
  font-size: .7rem;
  color: var(--warn, #c88c28);
  letter-spacing: .03em;
  margin-top: .25rem;
}

.bh-card-chevron {
  flex-shrink: 0;
  opacity: .3;
  margin-left: auto;
}

.bh-view-all {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--f-mono);
  font-size: .78rem;
  letter-spacing: .05em;
  color: var(--text-dim);
  text-decoration: none;
  padding: .875rem;
  border: 1px solid var(--border-hi);
  border-top: none;
  background: var(--surface);
  transition: color .15s;
  min-height: 48px;
}
.bh-view-all:hover { color: var(--accent); }

/* ─── Zone list ───────────────────────────────────────────────────────────── */

.bh-zone-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--border-hi);
}

.bh-zone-card {
  display: flex;
  align-items: center;
  background: var(--surface);
  transition: background .1s;
  min-height: 60px;
}
.bh-zone-card:hover { background: var(--surface-hi); }

.bh-zone-main-link {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  text-decoration: none;
  color: inherit;
}

.bh-zone-care-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: .5rem .875rem;
  margin-right: .875rem;
  font-family: var(--f-mono);
  font-size: .75rem;
  color: var(--accent);
  border: 1px solid var(--accent);
  text-decoration: none;
  white-space: nowrap;
  min-height: 36px;
  transition: background .1s, color .1s;
}
.bh-zone-care-btn:hover { background: var(--accent); color: #fff; }

.bh-zone-name {
  flex: 1;
  font-size: .95rem;
  color: var(--text);
}

.bh-zone-count {
  font-family: var(--f-mono);
  font-size: .78rem;
  color: var(--text-dim);
  letter-spacing: .03em;
}

/* ─── Stats footer ────────────────────────────────────────────────────────── */

.bh-stats-footer {
  font-family: var(--f-mono);
  font-size: .78rem;
  color: var(--text-dim);
  letter-spacing: .04em;
  padding: .625rem 0 1.25rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.bh-stats-sep { opacity: .35; }
.bh-stats-footer a { color: var(--text-dim); text-decoration: none; }
.bh-stats-footer a:hover { color: var(--accent); }

/* ─── Management stats row ────────────────────────────────────────────────── */

.bh-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  border: 1px solid var(--border-hi);
  margin-bottom: 1.5rem;
}

.bh-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.1rem .5rem;
  background: var(--surface);
  text-align: center;
}

.bh-stat-num {
  font-family: var(--f-serif);
  font-size: 2rem;
  font-weight: 300;
  color: var(--text);
  line-height: 1;
  margin-bottom: .35rem;
  letter-spacing: -0.02em;
}
.bh-stat-num.bh-stat-green { color: #50b464; }
.bh-stat-num.bh-stat-amber { color: #c88c28; }
.bh-stat-num.bh-stat-red   { color: #dc503c; }

.bh-stat-label {
  font-family: var(--f-mono);
  font-size: .68rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ─── All clear state ─────────────────────────────────────────────────────── */

.bh-all-clear {
  padding: 2rem 1rem;
  text-align: center;
}
.bh-all-clear p {
  font-family: var(--f-mono);
  font-size: .88rem;
  color: var(--text-dim);
  margin: 0 0 .875rem;
}
.bh-all-clear a {
  font-family: var(--f-mono);
  font-size: .8rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: .04em;
}

/* ─── Quick links ─────────────────────────────────────────────────────────── */

.bh-quicklink-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--border-hi);
}

.bh-quicklink {
  display: flex;
  align-items: center;
  padding: 1rem 1.1rem;
  background: var(--surface);
  font-size: .95rem;
  color: var(--text);
  text-decoration: none;
  transition: background .1s, color .1s;
  min-height: 56px;
}
.bh-quicklink:hover {
  background: var(--surface-hi);
  color: var(--text);
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 400px) {
  .bh-stats-row { grid-template-columns: repeat(2, 1fr); }
  .bh-greeting-text { font-size: 1.55rem; }
}

@media (min-width: 600px) {
  .bh-zone-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .bh-zone-card { border: none; }
}
