/* Customer dashboard — Neighbourly brand (matches neighbourly.io).
   Monochrome editorial: near-black paper, white ink, grey rules, white as the
   single accent. Token NAMES are kept from the previous inline stylesheet (the
   docs partial and the Swagger theme read them); only values change. */

/* Self-hosted brand fonts (public/fonts, Google Fonts latin subsets, OFL).
   Served same-origin on purpose: the API-reference page is where customers
   paste live keys, and test/integration/dashboard/api_tryit_test.rb forbids
   any third-party script or stylesheet there. */
@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/SchibstedGrotesk-Roman.woff2) format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-style: italic; font-weight: 400 700; font-display: swap; src: url(/fonts/SchibstedGrotesk-Italic.woff2) format("woff2"); }
@font-face { font-family: "Hanken Grotesk";    font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/HankenGrotesk-Roman.woff2) format("woff2"); }
@font-face { font-family: "Hanken Grotesk";    font-style: italic; font-weight: 400 700; font-display: swap; src: url(/fonts/HankenGrotesk-Italic.woff2) format("woff2"); }
@font-face { font-family: "Newsreader";        font-style: normal; font-weight: 400 600; font-display: swap; src: url(/fonts/Newsreader-Roman.woff2) format("woff2"); }
@font-face { font-family: "Newsreader";        font-style: italic; font-weight: 400 600; font-display: swap; src: url(/fonts/Newsreader-Italic.woff2) format("woff2"); }

:root {
  --bg: #0d0d0d;           /* paper      — page background          */
  --panel: #121212;        /* paper-warm — card surface              */
  --panel-2: #181818;      /* inputs / nested panels                 */
  --panel-3: #1f1f1f;
  --line: #262626;         /* rule       — borders / hairlines       */
  --line-strong: #333333;
  --text: #ffffff;         /* ink        — headings, strong text     */
  --body: #b8b8b8;         /* ink-soft   — default body text         */
  --muted: #8f8f8f;        /* muted      — secondary / captions      */
  --brand: #ffffff;        /* accent     — primary buttons, focus    */
  --brand-2: #d4d4d4;      /* accent-strong — hover, emphasis        */
  --brand-hover: #d4d4d4;
  --on-brand: #0d0d0d;
  --good: #a8c9a0; --warn: #e8b87a; --danger: #e59a9a; --radius: 12px;
  --sans: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: 'Schibsted Grotesk', var(--sans);
  --serif: 'Newsreader', Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--body); overflow-x: clip;
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased; font-feature-settings: 'ss01'; }
/* Film grain — same 3% noise the marketing site lays over every page. */
body::after { content: ''; position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: .03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(/%23n)'/%3E%3C/svg%3E"); }
h1, h2, h3 { font-family: var(--display); color: var(--text); font-weight: 500; letter-spacing: -0.025em; }
h1 em, h2 em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--brand-2); letter-spacing: -0.03em; }
strong { color: var(--text); font-weight: 600; }
a { color: var(--text); text-decoration: none; transition: color .2s; }
a:hover { color: var(--brand-2); text-decoration: none; }
::selection { background: #ffffff; color: #0d0d0d; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }
input, select, textarea { color-scheme: dark; font-family: inherit; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }

/* Nav */
.nav { display: flex; align-items: center; gap: 4px; padding: 0 28px; height: 64px;
  background: rgba(13,13,13,.72); border-bottom: 1px solid rgba(255,255,255,.08); position: sticky; top: 0; z-index: 20;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: 9px; margin-right: 20px; color: var(--text); }
.brand .logo-mark { width: 26px; height: 26px; color: var(--text); display: block; flex-shrink: 0; }
.brand-name { font-family: var(--display); font-size: 20px; font-weight: 600;
  letter-spacing: -0.035em; color: var(--text); }
.nav .spacer { flex: 1; }
.nav a.navlink { color: var(--body); font-size: 14px; font-weight: 400; padding: 8px 12px; border-radius: 6px; transition: color .2s, background .2s; }
.nav a.navlink:hover, .nav a.navlink[aria-current="page"] { color: var(--text); background: var(--panel); text-decoration: none; }
.nav .muted { font-size: 13px; }
.nav form { display: inline; }
.wrap { max-width: 920px; margin: 0 auto; padding: 40px 24px 80px; }
h1 { font-size: 30px; line-height: 1.05; margin: 0 0 6px; }
h2 { font-size: 19px; line-height: 1.2; margin: 0 0 14px; }
.sub { color: var(--muted); margin: 0 0 28px; font-size: 15px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-2); margin-bottom: 14px; }
.eyebrow::before { content: ''; width: 28px; height: 1px; background: var(--text); }

/* Surfaces */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 24px; margin-bottom: 22px; transition: border-color .3s; }
.card:hover { border-color: var(--line-strong); }

/* Buttons — the site's white pill. */
.btn { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-family: var(--sans);
  background: var(--brand); color: var(--on-brand); border: 1px solid var(--brand); border-radius: 999px;
  padding: 10px 18px; font-size: 14px; font-weight: 500; line-height: 1.2; transition: background .2s, border-color .2s, color .2s; }
.btn:hover { background: var(--brand-2); border-color: var(--brand-2); color: var(--on-brand); text-decoration: none; }
.btn.ghost { background: transparent; border: 1px solid rgba(255,255,255,.28); color: var(--text); }
.btn.ghost:hover { border-color: rgba(255,255,255,.55); background: rgba(255,255,255,.08); color: var(--text); }
.btn.danger { background: transparent; border: 1px solid rgba(229,154,154,.45); color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); background: rgba(229,154,154,.1); color: var(--danger); }
.btn.google { background: #ffffff; color: #0d0d0d; border-color: #ffffff; font-weight: 500; }
.btn.google:hover { background: #d4d4d4; border-color: #d4d4d4; }

.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 20px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); }
.flash.notice { border-left: 3px solid var(--good); }
.flash.alert  { border-left: 3px solid var(--danger); }
.flash.warn   { border-left: 3px solid var(--warn); }
code, .mono { font-family: var(--mono); font-size: .95em; }
.token-box { display: flex; gap: 10px; align-items: stretch; margin: 14px 0 6px; }
.token-box input { flex: 1; background: var(--panel-2); border: 1px solid var(--line-strong);
  color: var(--text); border-radius: 10px; padding: 12px 14px; font-family: var(--mono); font-size: 13.5px; }
.token-box input:focus { outline: none; border-color: #ffffff; }
.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: transparent; color: var(--body); border: 1px solid var(--line-strong); }
.pill.ok   { background: rgba(168,201,160,.10); color: var(--good);   border-color: rgba(168,201,160,.35); }
.pill.warn { background: rgba(232,184,122,.10); color: var(--warn);   border-color: rgba(232,184,122,.35); }
.pill.bad  { background: rgba(229,154,154,.10); color: var(--danger); border-color: rgba(229,154,154,.35); }
.pill.brand { background: #ffffff; color: #0d0d0d; border-color: #ffffff; }
.muted { color: var(--muted); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
tbody tr:last-child td { border-bottom: 0; }
tr:hover td { background: rgba(255,255,255,.025); }
.endpoint { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; margin: 12px 0; }
.method { font-weight: 700; color: var(--good); font-family: var(--mono); }
pre { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px;
  overflow-x: auto; font-size: 13px; font-family: var(--mono); color: var(--text); }
.center { min-height: calc(100vh - 64px - 120px); display: flex; align-items: center; justify-content: center; }
footer { color: var(--muted); text-align: center; padding: 32px 24px 40px; font-size: 13px; border-top: 1px solid var(--line); margin-top: 40px; }
footer .foot-meta { font-family: var(--mono); font-size: 11px; letter-spacing: .05em; }
footer .powered { display: inline-flex; align-items: center; gap: 7px; margin-left: 12px; padding: 4px 11px;
  border: 1px solid var(--line-strong); border-radius: 999px; font-size: 12px; font-weight: 500; color: var(--body); vertical-align: middle; }
footer .powered .dot { width: 7px; height: 7px; border-radius: 999px; background: #ffffff; }

/* Login */
.login { width: 100%; max-width: 420px; min-width: 0; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 36px 36px 30px;
  box-shadow: 0 50px 90px -46px rgba(0,0,0,.8); animation: fadeUp .8s cubic-bezier(.2,.8,.2,1) backwards; }
.login .logo { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; color: var(--text); }
.login .logo .logo-mark { width: 28px; height: 28px; color: var(--text); }
.login .logo .brand-name { font-size: 21px; }
.login h1 { font-size: 34px; line-height: 1.02; letter-spacing: -0.035em; margin: 0 0 12px; }
.login .sub { margin: 0 0 26px; font-size: 15px; line-height: 1.5; }
.login .btn.google { width: 100%; justify-content: center; padding: 13px 20px; font-size: 15px; }
.login .fine { margin: 20px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.login-foot { display: flex; justify-content: space-between; gap: 16px; margin-top: 18px; padding: 0 6px; font-size: 12.5px; color: var(--muted); }
.login-foot a { color: var(--muted); }
.login-foot a:hover { color: var(--text); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Usage page */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.stat .n { font-size: 30px; font-weight: 500; line-height: 1.05; font-family: var(--display); letter-spacing: -0.03em; color: var(--text); }
.stat .l { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; margin-top: 8px; }
.stat .s { color: var(--muted); font-size: 12px; margin-top: 3px; }
.chart { display: flex; align-items: flex-end; gap: 2px; height: 140px; margin-top: 8px; }
.chart .bar { flex: 1; min-width: 2px; background: var(--text); border-radius: 3px 3px 0 0; opacity: .8; }
.chart .bar:hover { opacity: 1; }
.chart .bar.empty { background: var(--line-strong); opacity: .6; }
.chart-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 6px; }
.meter { height: 6px; background: var(--panel-3); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.meter > span { display: block; height: 100%; background: var(--text); }
.meter > span.warn { background: var(--warn); } .meter > span.danger { background: var(--danger); }
.barrow { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; margin: 7px 0; }
.barrow .track { height: 5px; background: var(--panel-3); border-radius: 999px; overflow: hidden; }
.barrow .track > span { display: block; height: 100%; background: var(--text); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  font-family: var(--mono); border: 1px solid transparent; }
.badge.ok { background: rgba(168,201,160,.10); color: var(--good); border-color: rgba(168,201,160,.3); }
.badge.warn { background: rgba(232,184,122,.10); color: var(--warn); border-color: rgba(232,184,122,.3); }
.badge.err { background: rgba(229,154,154,.10); color: var(--danger); border-color: rgba(229,154,154,.3); }
.seg { display: flex; height: 8px; border-radius: 999px; overflow: hidden; margin: 10px 0; }
.seg > span { display: block; height: 100%; }
.tabs { display: inline-flex; gap: 2px; background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 3px; }
.tabs a { padding: 5px 13px; border-radius: 999px; color: var(--muted); font-size: 13px; }
.tabs a.active { background: var(--text); color: var(--on-brand); }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.active:hover { color: var(--on-brand); }
/* Charts — area sparkline (see AdminHelper#sparkline; mirrors admin.css) */
.spark { color: var(--text); display: block; max-width: 100%; height: auto; overflow: visible; }
.spark .spark-line { filter: none; }
.spark .pt { fill: currentColor; opacity: 0; transition: opacity 120ms ease-out; }
.spark:hover .pt { opacity: .28; }
.spark .pt:hover { opacity: 1; }
.spark .dot-last { fill: currentColor; }
.spark .dot-peak { fill: var(--warn); opacity: .9; }

@media (max-width: 720px) {
  .nav { padding: 0 16px; gap: 0; overflow-x: auto; }
  .brand { margin-right: 8px; }
  .nav .muted { display: none; }
  .wrap { padding: 28px 16px 64px; }
  h1 { font-size: 26px; }
  .login-card { padding: 28px 22px 24px; border-radius: 18px; }
  .login h1 { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
