/* Rabbytte — clover field by day, burrow by night.
   Display: Bricolage Grotesque · Body: Atkinson Hyperlegible · URLs: Spline Sans Mono */

:root {
  --paper: #F3F6EE;
  --card: #FDFEFB;
  --ink: #20291C;
  --muted: #5D6B55;
  --line: #D8E0CD;
  --link: #2E6B34;
  --accent: #E0651F;
  --mark: #F6D8BD;
  --shadow: rgba(32, 41, 28, 0.14);

  --display: 'Bricolage Grotesque', 'Avenir Next', system-ui, sans-serif;
  --body: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, sans-serif;
  --mono: 'Spline Sans Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

:root[data-theme="dark"] {
  --paper: #171A11;
  --card: #1E2318;
  --ink: #E9EEDF;
  --muted: #9AA98D;
  --line: #313A28;
  --link: #93CE93;
  --accent: #F07B2E;
  --mark: #4A2E15;
  --shadow: rgba(0, 0, 0, 0.45);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --paper: #171A11;
    --card: #1E2318;
    --ink: #E9EEDF;
    --muted: #9AA98D;
    --line: #313A28;
    --link: #93CE93;
    --accent: #F07B2E;
    --mark: #4A2E15;
    --shadow: rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; width: 100%; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--accent); }

:is(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------------------------------------------------------------- header */
.top {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1.1rem;
  padding: 1rem 1.25rem;
  position: relative;
}

.top-link {
  font: 500 0.92rem var(--body);
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--line);
  padding-bottom: 1px;
}
.top-link:hover { border-color: var(--accent); color: var(--ink); }

.gear {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.gear:hover { border-color: var(--accent); }

/* settings panel */
.panel {
  position: absolute;
  top: 3.4rem;
  right: 1.25rem;
  z-index: 30;
  width: min(330px, calc(100vw - 2rem));
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  padding: 1rem 1.15rem 1.15rem;
  box-shadow: 6px 6px 0 var(--shadow);
}
.panel-h {
  font: 700 0.8rem var(--display);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin: 0.35rem 0 0.55rem;
}
.panel-h:first-child { margin-top: 0; }
.set-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.9rem;
  padding: 0.42rem 0;
  font-size: 0.94rem;
}
.set-row select {
  font: 500 0.9rem var(--body);
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 0.28rem 0.5rem;
}
.set-row input[type="checkbox"] { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); }
.ext-row span { display: flex; flex-direction: column; }
.ext-row small { color: var(--muted); font-size: 0.8rem; line-height: 1.35; }
.set-note { color: var(--muted); font-size: 0.8rem; margin: 0.6rem 0 0; }
.set-note code { font-family: var(--mono); font-size: 0.75rem; }

/* ---------------------------------------------------------------- hero */
.home {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 1.25rem;
  margin-top: clamp(3rem, 16vh, 9.5rem);
  transition: margin-top 0.3s ease;
}
body.searching .home { margin-top: 1.25rem; }

.wordmark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font: 800 clamp(2.7rem, 9vw, 3.9rem)/1 var(--display);
  letter-spacing: -0.025em;
  margin: 0;
}
.wordmark-paw {
  width: clamp(44px, 6.5vw, 60px);
  height: auto;
  transform: rotate(-8deg);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.home:has(.search-wrap:focus-within) .wordmark-paw {
  transform: rotate(3deg) translateY(-7px);
}
.wordmark .tld { color: var(--muted); font-weight: 500; font-size: 0.5em; letter-spacing: 0; }

.tagline {
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 34rem;
  margin: 0.7rem 0 0;
}
body.searching .tagline { display: none; }

/* the signature: the footprint lives in the wordmark now (see .wordmark-paw). */
.search-wrap {
  position: relative;
  display: flex;
  width: min(620px, 100%);
  margin-top: 3rem;
}

.search-wrap input[type="search"] {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  font: 500 1.05rem var(--body);
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--ink);
  border-right: none;
  border-radius: 999px 0 0 999px;
  padding: 0.95rem 1.35rem;
}
.search-wrap input[type="search"]::placeholder { color: var(--muted); }
.search-wrap input[type="search"]:focus { outline: none; }
.search-wrap:focus-within input[type="search"] { border-color: var(--accent); }

.search-wrap .go {
  position: relative;
  z-index: 1;
  font: 700 1rem var(--display);
  color: var(--paper);
  background: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 0 999px 999px 0;
  padding: 0 1.5rem;
  cursor: pointer;
}
.search-wrap:focus-within .go,
.search-wrap .go:hover { background: var(--accent); border-color: var(--accent); }

.stat {
  color: var(--muted);
  font: 400 0.85rem var(--mono);
  margin: 1.1rem 0 0;
  min-height: 1.2em;
}
body.searching .stat { display: none; }

/* ---------------------------------------------------------------- results */
.results {
  width: min(660px, 100%);
  margin: 0 auto;
  padding: 0.5rem 1.25rem 2rem;
  text-align: left;
  flex: 1;
}
.status { color: var(--muted); font-size: 0.95rem; }

.result { margin: 1.7rem 0; }
.r-title {
  font: 700 1.18rem/1.3 var(--display);
  color: var(--link);
  text-decoration: none;
}
.r-title:hover { text-decoration: underline; color: var(--link); }
.r-url {
  font: 400 0.8rem var(--mono);
  color: var(--muted);
  margin: 0.2rem 0 0.35rem;
  overflow-wrap: anywhere;
}
.r-desc { margin: 0; max-width: 62ch; }
.r-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.tag {
  font: 500 0.72rem var(--mono);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.14rem 0.55rem;
}
mark { background: none; color: var(--link); font-weight: 700; padding: 0; }

/* Numbered pagination, Google-style but in Rabbytte clothes. */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.2rem;
}
.pg {
  min-width: 2.2rem;
  padding: 0.45rem 0.7rem;
  font: 700 0.9rem var(--mono);
  color: var(--link);
  background: none;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  text-align: center;
}
.pg:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pg.cur {
  background: var(--link);
  border-color: var(--link);
  color: var(--paper);
  cursor: default;
}
.pg.pn { font-family: var(--display); padding: 0.45rem 1.1rem; }
.pg.gap { border: none; background: none; color: var(--muted); cursor: default; min-width: auto; padding: 0 0.2rem; }

/* ---------------------------------------------------------------- pages (submit, admin) */
.page {
  width: min(600px, 100%);
  margin: 0 auto;
  padding: 0.5rem 1.25rem 2.5rem;
  flex: 1;
}
.page-h { font: 800 2rem/1.15 var(--display); letter-spacing: -0.02em; margin: 0.8rem 0 0.4rem; }
.lede { color: var(--muted); margin: 0 0 1.4rem; }

.card {
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 16px;
  padding: 1.4rem;
  box-shadow: 6px 6px 0 var(--shadow);
}

.f { display: block; margin-bottom: 1rem; font: 700 0.86rem var(--body); }
.f-label { display: block; font: 700 0.86rem var(--body); }
.f input, .f textarea, .check input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  font: 400 1rem var(--body);
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
}
.f textarea { resize: vertical; }
.f input:focus, .f textarea:focus, .check input:focus {
  outline: none;
  border-color: var(--accent);
}

.check {
  border-top: 1.5px dashed var(--line);
  padding-top: 1rem;
  margin-bottom: 1rem;
}
.challenge { font-weight: 400; color: var(--ink); margin: 0.4rem 0 0; }

/* honeypot — visually gone, present for bots */
.hp { position: absolute; left: -6000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.form-msg { color: var(--accent); font-weight: 700; min-height: 1.3em; margin: 0 0 0.6rem; }

.btn {
  display: inline-block;
  font: 700 1rem var(--display);
  border-radius: 999px;
  padding: 0.7rem 1.5rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn.primary {
  width: 100%;
  color: var(--paper);
  background: var(--ink);
  border: 2px solid var(--ink);
}
.btn.primary:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); }
.btn.primary:disabled { opacity: 0.6; cursor: default; }
.btn.ghost {
  color: var(--ink);
  background: none;
  border: 2px solid var(--line);
}
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }

.done { text-align: center; }
.done-big { font: 800 1.6rem var(--display); margin: 0.2rem 0 0.5rem; }

/* admin queue */
.pend { border-bottom: 1.5px dashed var(--line); padding-bottom: 1.2rem; }
.scout {
  margin-top: 0.8rem;
  padding: 0.6rem 0.9rem;
  border-left: 3px solid var(--accent);
  background: var(--paper);
  border-radius: 0 8px 8px 0;
}
.scout-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.scout-title { font-weight: 700; }
.scout .r-desc { margin: 0.25rem 0 0.35rem; }

.pend-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.8rem; }
.pend-actions .btn { padding: 0.45rem 1.1rem; font-size: 0.9rem; }
.pend-actions .approve {
  color: var(--paper);
  background: var(--link);
  border: 2px solid var(--link);
}
.pend-actions .approve:hover { filter: brightness(1.1); }

/* ---------------------------------------------------------------- footer */
.foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  padding: 0.85rem 1.5rem;
  border-top: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font: 400 0.85rem var(--mono);
}
.foot-l, .foot-r { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem 1.4rem; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--accent); text-decoration: underline; }
@media (max-width: 640px) {
  .foot { justify-content: center; text-align: center; }
}

/* ---------------------------------------------------------------- misc */
@media (max-width: 480px) {
  .search-wrap .go { padding: 0 1.1rem; }
  .card { padding: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* "Did you mean" spelling suggestion */
.didyou {
  margin: 0 0 0.5rem;
  padding: 0 1rem;
  color: var(--muted);
  font-style: italic;
}
.didyou a { color: var(--link); font-weight: 700; font-style: normal; text-decoration: underline; }
.didyou a:hover { color: var(--accent); }

/* ---------------------------------------------------------------- results page (/search) */
.serp-top {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 0.85rem 1.2rem;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.serp-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
  flex: none;
}
.serp-mini-ears { width: auto; height: 30px; transform: rotate(-8deg); }
.wordmark-sm { font: 800 1.3rem/1 var(--display); letter-spacing: -0.02em; }
.wordmark-sm .tld { color: var(--muted); font-weight: 500; }

.serp-top { flex-wrap: wrap; }
.serp-top .search-wrap { flex: 1 1 300px; max-width: 620px; margin: 0; }
.serp-submit { white-space: nowrap; }
.serp-top .search-wrap input[type="search"] { height: 44px; font-size: 1rem; }
.serp-top .search-wrap .go { height: 44px; }

.serp-main { max-width: 820px; margin: 0 auto; }

@media (max-width: 640px) {
  .serp-top { gap: 0.6rem; }
  .serp-top .search-wrap { min-width: 100%; order: 2; }
  .serp-submit { order: 3; }
}

/* Sitelinks + rank badge on result cards */
.r-rank {
  float: right;
  font: 500 0.72rem var(--mono);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
}
.r-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 1.4rem;
  margin-top: 0.55rem;
  max-width: 560px;
}
.r-link { text-decoration: none; display: flex; align-items: baseline; gap: 0.5rem; min-width: 0; }
.r-link-t { color: var(--link); font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-link:hover .r-link-t { text-decoration: underline; color: var(--accent); }
.r-link-p { color: var(--muted); font: 400 0.72rem var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scout-links { font-size: 0.85rem; color: var(--muted); margin-top: 0.3rem; }
@media (max-width: 560px) { .r-links { grid-template-columns: 1fr; } }

/* AI Mode: the warren's answer card */
.ai-card {
  margin: 0 0 1.1rem;
  padding: 0.9rem 1.1rem;
  border: 1.5px solid var(--link);
  border-radius: 14px;
  background: var(--card);
}
.ai-card.ai-chip { border: none; background: none; padding: 0; }
.ai-label {
  font: 500 0.72rem var(--mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--link);
  margin-bottom: 0.4rem;
}
.ai-text { margin: 0; line-height: 1.55; }
.ai-sources { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.65rem; }
.ai-sources .tag { text-decoration: none; }
.ai-sources .tag:hover { border-color: var(--accent); color: var(--accent); }

/* Chat page */
.chat-page { display: flex; flex-direction: column; min-height: 100vh; }
.chat-title { font: 700 1rem var(--display); color: var(--muted); }
.chat-main { flex: 1; width: min(760px, 100%); margin: 0 auto; padding: 1.2rem 1.2rem 6.5rem; }
.thread { display: flex; flex-direction: column; gap: 0.9rem; }
.msg { max-width: 85%; padding: 0.75rem 1rem; border-radius: 14px; }
.msg p { margin: 0; line-height: 1.55; }
.msg-u { align-self: flex-end; background: var(--link); color: var(--paper); border-bottom-right-radius: 4px; }
.msg-a { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg-a .ai-label { margin-bottom: 0.35rem; }
.thinking { color: var(--muted); font-style: italic; }
.ai-more { display: inline-block; margin-top: 0.65rem; font-size: 0.9rem; color: var(--link); }
.ai-more:hover { color: var(--accent); }

.chat-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  gap: 0.6rem;
  padding: 0.8rem 1.2rem calc(0.8rem + env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 1px solid var(--line);
}
.chat-bar input {
  flex: 1;
  min-width: 0;
  max-width: 660px;
  margin-left: auto;
  height: 46px;
  padding: 0 18px;
  border: 1.5px solid var(--line);
  border-radius: 23px;
  background: var(--card);
  color: var(--ink);
  font-size: 1rem;
  outline: none;
}
.chat-bar input:focus { border-color: var(--link); }
.chat-bar .go { margin-right: auto; }
@media (min-width: 800px) {
  .chat-bar { justify-content: center; }
  .chat-bar input { margin-left: 0; }
  .chat-bar .go { margin-right: 0; }
}

/* Search-bar tools: mic + AI Mode, tucked inside the pill like Google's */
.search-wrap:has(.bar-tools) input[type="search"] { padding-right: 108px; }
.bar-tools {
  position: absolute;
  right: 122px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
}
.bar-tool {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  padding: 0 10px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 700 0.85rem var(--display);
  text-decoration: none;
  cursor: pointer;
}
.bar-tool:hover { background: var(--paper); color: var(--accent); }
.bar-tool.listening { color: var(--accent); animation: micpulse 1s ease-in-out infinite; }
@keyframes micpulse { 50% { transform: scale(1.15); } }
.ai-mode { border: 1.5px solid var(--line); color: var(--link); }
.ai-mode:hover { border-color: var(--accent); }
@media (max-width: 560px) {
  .search-wrap:has(.bar-tools) input[type="search"] { padding-right: 78px; }
  .bar-tools { right: 88px; gap: 2px; }
  .bar-tool { padding: 0 6px; }
  .ai-word { display: none; }
  .search-wrap .go { padding: 0 1rem; }
}

/* Result favicons with initials fallback */
.r-head { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.r-ico {
  flex: none;
  width: 26px; height: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.r-ico img { width: 18px; height: 18px; }
.fava {
  width: 100%; height: 100%;
  align-items: center; justify-content: center;
  color: #fff;
  font: 700 0.85rem var(--display);
}

/* Inline follow-up under the AI answer */
.ai-follow { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.ai-follow input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 19px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.95rem;
  outline: none;
}
.ai-follow input:focus { border-color: var(--link); }
.ai-follow .go { height: 38px; padding: 0 1.1rem; font-size: 0.9rem; }

.serp-submit { flex: none; font-size: 0.9rem; }

.foot-loc { color: var(--link); }

/* Location tag + map on the results page */
.loc-bar { max-width: 820px; margin: 0.9rem auto 0; padding: 0 1.2rem; }
.loc-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--link);
  font: 700 0.85rem var(--body);
  padding: 0.35rem 0.85rem;
  cursor: pointer;
}
.loc-tag:hover { border-color: var(--accent); color: var(--accent); }
.loc-src { margin-left: 0.6rem; color: var(--muted); font-size: 0.78rem; }
.loc-map { margin-top: 0.7rem; }
.loc-map iframe {
  width: 100%;
  height: 280px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: block;
}
.loc-links { display: flex; gap: 1.4rem; margin-top: 0.5rem; font-size: 0.9rem; }
.loc-links a { color: var(--link); }
.loc-links a:hover { color: var(--accent); }

/* In-site map */
.loc-precise, .loc-enlarge {
  margin-left: 0.7rem;
  border: none;
  background: none;
  color: var(--link);
  font: 700 0.82rem var(--body);
  cursor: pointer;
  text-decoration: underline;
}
.loc-precise:hover, .loc-enlarge:hover { color: var(--accent); }
#siteMap { width: 100%; height: 300px; }
.loc-map {
  margin-top: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: height 0.2s ease;
}
.loc-map.expanded #siteMap { height: 72vh; }
.leaflet-container { font-family: var(--body); }
.r-addr { font-size: 0.9rem; color: var(--muted); margin-top: 0.15rem; }


/* No native clear X in search fields — the bar tools live there now */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }

/* Phone-browsing polish */
.loc-time { margin-top: 0.4rem; font: 400 0.82rem var(--mono); color: var(--muted); }
.wordmark { flex-wrap: wrap; }
input[type="search"], input[type="text"], input[type="url"], input[type="password"], textarea { -webkit-appearance: none; }
.ai-follow input { font-size: 1rem; }
@media (max-width: 560px) {
  #siteMap { height: 230px; }
  .loc-bar, .serp-main { padding-left: 0.9rem; padding-right: 0.9rem; }
  .r-rank { display: none; }
  .serp-top { padding: 0.7rem 0.9rem; }
  .foot { font-size: 0.78rem; }
}

/* All | Images tabs */
.serp-tabs {
  display: flex;
  gap: 1.7rem;
  max-width: 820px;
  margin: 0.3rem auto 0;
  padding: 0 1.2rem;
  border-bottom: 1px solid var(--line);
}
.serp-tabs a {
  padding: 0.5rem 0.15rem;
  margin-bottom: -1px;
  color: var(--muted);
  text-decoration: none;
  font: 500 0.92rem var(--body);
  border-bottom: 2.5px solid transparent;
}
.serp-tabs a:hover { color: var(--ink); }
.serp-tabs a.active { color: var(--link); border-bottom-color: var(--link); font-weight: 700; }

/* Inline image strip in web results */
.img-strip { margin: 1.15rem 0; }
.img-strip-h {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font: 700 0.98rem var(--display);
  margin-bottom: 0.5rem;
}
.img-strip-h a { font: 500 0.85rem var(--body); color: var(--link); text-decoration: none; }
.img-strip-h a:hover { color: var(--accent); }
.img-row { display: flex; gap: 0.6rem; overflow-x: auto; padding-bottom: 0.25rem; }
.img-row a { flex: none; }
.img-row img {
  width: 142px; height: 96px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  display: block;
}
.img-row img:hover { border-color: var(--accent); }

/* Images page grid */
.img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 1rem;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.1rem 1.2rem 2rem;
}
.img-grid .status { grid-column: 1 / -1; }
.img-card { margin: 0; cursor: pointer; }
.img-card img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.img-card:hover img { border-color: var(--accent); }
.img-card figcaption {
  margin-top: 0.35rem;
  font-size: 0.86rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.img-card figcaption span { display: block; color: var(--muted); font: 400 0.74rem var(--mono); }

/* Lightbox viewer */
.lightbox[hidden] { display: none; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(23, 26, 17, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
}
.lb-card {
  position: relative;
  width: 100%;
  max-width: min(720px, 94vw);
  background: var(--paper);
  border-radius: 18px;
  padding: 1.1rem;
}
.lb-card img {
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
  border-radius: 12px;
  background: var(--card);
}
.lb-close {
  position: absolute;
  top: 0.35rem; right: 0.7rem;
  border: none; background: none;
  font-size: 1.9rem;
  color: var(--muted);
  cursor: pointer;
}
.lb-close:hover { color: var(--accent); }
.lb-meta {
  margin-top: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
}
.lb-info { min-width: 0; }
.lb-info a { font: 700 1.05rem var(--display); color: var(--link); text-decoration: none; }
.lb-info a:hover { color: var(--accent); }
.lb-info span { display: block; font: 400 0.8rem var(--mono); color: var(--muted); }
.lb-actions { display: flex; gap: 0.55rem; flex: none; }
.lb-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--link);
}
.lb-icon:hover { color: var(--accent); border-color: var(--accent); }
@media (max-width: 560px) {
  .img-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); padding: 0.9rem; }
  .img-row img { width: 118px; height: 82px; }
}

.img-card { position: relative; }
.img-dl {
  position: absolute;
  top: 7px; right: 7px;
  width: 31px; height: 31px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--link);
  opacity: 0.92;
}
.img-dl:hover { color: var(--accent); border-color: var(--accent); }
#imgPager { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 1.2rem 2rem; }

/* ---------- Warren Admin ---------- */
.admin-page { background: var(--paper); }
.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
}
.gate-card { width: min(380px, 100%); }

.adm { display: flex; min-height: 100vh; width: 100%; }
.adm-side {
  width: 232px;
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-right: 1px solid var(--line);
  padding: 1.1rem 0.9rem;
  position: sticky;
  top: 0;
  height: 100vh;
}
.adm-brand { display: flex; align-items: center; gap: 0.6rem; padding: 0 0.5rem 1rem; }
.adm-brand img { width: 30px; transform: rotate(-8deg); }
.adm-brand strong { font: 800 1.05rem var(--display); display: block; }
.adm-brand span { font: 500 0.62rem var(--mono); letter-spacing: 0.14em; color: var(--accent); }
.adm-nav { display: flex; flex-direction: column; gap: 0.15rem; }
.adm-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  border: none;
  background: none;
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border-left: 3px solid transparent;
  font: 500 0.95rem var(--body);
  color: var(--muted);
  cursor: pointer;
}
.adm-link:hover { color: var(--ink); background: var(--paper); }
.adm-link.active { color: var(--link); border-left-color: var(--link); background: var(--paper); font-weight: 700; }
.adm-badge {
  min-width: 22px;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: 700 0.72rem var(--mono);
  text-align: center;
}
.adm-badge:empty { display: none; }
.adm-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 0.4rem; padding: 0.8rem 0.75rem 0; border-top: 1px solid var(--line); }
.adm-side-foot a, .adm-side-foot button {
  font: 500 0.85rem var(--body);
  color: var(--muted);
  background: none;
  border: none;
  text-align: left;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}
.adm-side-foot a:hover, .adm-side-foot button:hover { color: var(--accent); }

.adm-main { flex: 1; min-width: 0; padding: 1.5rem 1.6rem 2.5rem; max-width: 1160px; }
.adm-view { display: none; }
.adm-view.active { display: block; }
.adm-h { font: 800 1.6rem var(--display); margin: 0 0 1rem; }
.adm-h2 { font: 700 1.05rem var(--display); margin: 0 0 0.7rem; }

.adm-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}
.adm-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.95rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.adm-card .k { font: 500 0.7rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.adm-card .v { font: 800 1.9rem var(--display); color: var(--ink); }
.adm-card .s { font-size: 0.8rem; color: var(--link); }

.adm-mapcard { margin-bottom: 1rem; }
#admMap { height: 340px; border-radius: 12px; }
.adm-note { font-size: 0.8rem; color: var(--muted); margin: 0.55rem 0 0; }

.adm-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.adm-list { list-style: none; margin: 0; padding: 0; }
.adm-list li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
  min-width: 0;
}
.adm-list li:last-child { border-bottom: none; }
.adm-list li a { color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-list li a:hover { color: var(--accent); }
.adm-list li > span:last-child { margin-left: auto; color: var(--muted); font: 500 0.8rem var(--mono); flex: none; }
.adm-empty { color: var(--muted); }
.adm-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.adm-dot.p { background: var(--accent); }
.adm-dot.a { background: var(--link); }

@media (max-width: 840px) {
  .adm { flex-direction: column; }
  .adm-side { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; gap: 0.6rem; overflow-x: auto; padding: 0.7rem 0.9rem; }
  .adm-brand { padding: 0; flex: none; }
  .adm-nav { flex-direction: row; flex: 1; }
  .adm-link { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; border-radius: 8px 8px 0 0; }
  .adm-link.active { border-left: none; border-bottom-color: var(--link); }
  .adm-side-foot { display: none; }
  .adm-cols { grid-template-columns: 1fr; }
  .adm-main { padding: 1rem; }
}
