/* What every signed-in page shares: colors, the top bar, and a site's header and tabs.
   Loaded before /css/admin.css on admin pages and before /stats/stats.css on a site's dashboard,
   so moving between them never shifts or restyles the frame. */
:root {
  --bg: #f6f2ec; --card: #ffffff; --ink: #2a1a10; --ink-2: #5b4a3e; --muted: #86766a;
  --line: #e8dfd4; --bar: #c4621a; --bar-soft: #f3dcc8; --accent: #2f7d4a; --danger: #b3261e; --live: #2f9e55;
  --radius: 12px; --page: 1200px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17120e; --card: #221b16; --ink: #f3ebe3; --ink-2: #cdbfb2; --muted: #9b8b7e;
    --line: #3a2f27; --bar: #f08f45; --bar-soft: #4a3020; --accent: #6fcf8f; --danger: #ff8a80; --live: #4fd07a;
  }
}
:root[data-theme="dark"] {
  --bg: #17120e; --card: #221b16; --ink: #f3ebe3; --ink-2: #cdbfb2; --muted: #9b8b7e;
  --line: #3a2f27; --bar: #f08f45; --bar-soft: #4a3020; --accent: #6fcf8f; --danger: #ff8a80; --live: #4fd07a;
}

* { box-sizing: border-box; }
/* Room for a scrollbar on every page, so short and long pages line up. */
html { scrollbar-gutter: stable; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; }
[hidden] { display: none !important; }

/* The top bar */
.top { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between;
  max-width: var(--page); margin: 0 auto; padding: 14px 16px; }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.nav a, .nav button { color: var(--ink-2); text-decoration: none; padding: 6px 10px; border-radius: 999px;
  font: inherit; font-size: .9rem; background: none; border: 1px solid transparent; cursor: pointer; }
.nav a:hover, .nav button:hover { color: var(--ink); }
.nav a[aria-current="page"] { background: var(--card); color: var(--ink); border-color: var(--line); }
.nav form { margin: 0; }

.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: 1px 8px; border-radius: 999px;
  background: var(--bar-soft); color: var(--ink); vertical-align: 2px; }
.badge.off { background: var(--line); color: var(--muted); }
.badge.live { background: color-mix(in srgb, var(--live) 18%, transparent); color: var(--ink); }

/* A site's header: name, address, status, and its tabs (admin.site-head) */
.site-head h1 { font-size: 1.4rem; margin: 0 0 4px; }
.site-head-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-start; justify-content: space-between; }
.site-head-row form { margin: 0; }
.site-meta { color: var(--muted); font-size: .88rem; margin: 0; }
.site-meta a { color: inherit; }
.site-nav { display: flex; gap: 2px 4px; margin: 12px 0 0; border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a { padding: 8px 12px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--ink-2);
  text-decoration: none; font-weight: 600; font-size: .92rem; white-space: nowrap; }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--bar); }
.site-nav .ext { font-weight: 400; }
.site-nav .ext:first-of-type { margin-left: auto; }
.publish-button { font: inherit; font-size: .9rem; font-weight: 600; padding: 8px 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--bar); background: var(--bar); color: #fff; }
.publish-button.unpublish { background: var(--card); color: var(--ink); border-color: var(--line); }

/* "?" hints: <span class="hint-tip" tabindex="0" data-tip="...">?</span> */
.hint-tip { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; font-size: .7rem;
  font-weight: 700; color: var(--muted); border: 1px solid var(--line); cursor: help; position: relative; vertical-align: 1px;
  margin-left: 4px; }
.hint-tip:hover::after, .hint-tip:focus::after { content: attr(data-tip); position: absolute; z-index: 30; left: 50%; top: 22px;
  transform: translateX(-50%); width: max-content; max-width: 280px; padding: 8px 10px; border-radius: 8px;
  background: var(--ink); color: var(--card); font-size: .8rem; font-weight: 400; line-height: 1.4; text-align: left;
  white-space: normal; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
