/* Blackfold Portal: Blackfold's dark palette and faces (from projects/blackfold global.css), plain for an admin tool. */
@font-face { font-family: "Anybody Variable"; src: url("/fonts/anybody.woff2") format("woff2"); font-weight: 100 900; font-stretch: 50% 150%; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk Variable"; src: url("/fonts/schibsted-grotesk.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }

:root {
  --stock: #0b0b0c; --board: #141415; --board-2: #1b1b1d;
  --bone: #ecebe6; --bone-2: rgba(236, 235, 230, 0.72); --bone-3: rgba(236, 235, 230, 0.56);
  --rule: rgba(236, 235, 230, 0.13);
  --warn: #e8b86a; --bad: #f08a7e; --good: #9fd4a9;
  --display: "Anybody Variable", "Arial Narrow", sans-serif;
  --body: "Schibsted Grotesk Variable", system-ui, sans-serif;
  --gutter: clamp(16px, 3vw, 40px);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { background: var(--stock); color: var(--bone); -webkit-text-size-adjust: 100%; }
body { font-family: var(--body); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
::selection { background: var(--bone); color: var(--stock); }
a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
:focus-visible { outline: 1.5px solid var(--bone); outline-offset: 3px; border-radius: 2px; }

.wrap { width: min(100% - 2 * var(--gutter), 1280px); margin-inline: auto; }
.top { border-bottom: 1px solid var(--rule); }
.top .wrap { display: flex; gap: 24px; align-items: center; min-height: 56px; }
.brand { font-family: var(--display); font-weight: 760; font-stretch: 128%; letter-spacing: -0.02em; font-size: 18px; text-decoration: none; }
.top nav { display: flex; gap: 18px; flex: 1; }
.top nav a { color: var(--bone-2); text-decoration: none; }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--bone); }
main { padding: 28px 0 64px; }
h1 { font-family: var(--display); font-weight: 720; font-stretch: 118%; letter-spacing: -0.025em; font-size: 28px; line-height: 1.1; margin-bottom: 18px; }
h2 { font-size: 13px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--bone-2); margin: 28px 0 10px; }
p + p { margin-top: 8px; }
.muted { color: var(--bone-2); }
.small { font-size: 13px; }
.label { font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--bone-3); }

.card { background: var(--board); border: 1px solid var(--rule); border-radius: 6px; padding: 18px; }
.card + .card { margin-top: 14px; }
/* In a grid the gap spaces the cards; a stacked-card margin would knock them out of line. */
.grid > .card, .stats > .card { margin-top: 0; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bone-3); padding: 8px 10px; border-bottom: 1px solid var(--rule); }
td { padding: 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
tr:hover td { background: var(--board); }
td.excerpt { color: var(--bone-2); max-width: 46ch; }
.nowrap { white-space: nowrap; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--rule); font-size: 12px; white-space: nowrap; color: var(--bone-2); }
.badge.warn { border-color: rgba(232, 184, 106, 0.5); color: var(--warn); }
.badge.bad { border-color: rgba(240, 138, 126, 0.5); color: var(--bad); }
.badge.good { border-color: rgba(159, 212, 169, 0.45); color: var(--good); }
.stars { letter-spacing: 1px; white-space: nowrap; }

form.inline { display: inline; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 16px; }
label { display: block; font-size: 12px; color: var(--bone-2); margin-bottom: 4px; }
.field { margin-bottom: 12px; }
input, select, textarea {
  font: inherit; color: var(--bone); background: var(--stock); border: 1px solid var(--rule); border-radius: 4px; padding: 7px 9px; width: 100%;
}
textarea { min-height: 110px; resize: vertical; }
textarea.paste { min-height: 320px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.filters select, .filters input { width: auto; }
button, .button {
  font: inherit; font-weight: 600; cursor: pointer; display: inline-block; text-decoration: none;
  background: var(--bone); color: var(--stock); border: 1px solid var(--bone); border-radius: 4px; padding: 7px 14px;
}
button.secondary, .button.secondary { background: transparent; color: var(--bone); border-color: var(--rule); }
button:hover { filter: brightness(0.92); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }

.notice { border-left: 3px solid var(--bone-3); padding: 10px 14px; background: var(--board); margin-bottom: 18px; }
.notice.warn { border-color: var(--warn); }
.notice.bad { border-color: var(--bad); }
.review-text { white-space: pre-wrap; font-size: 16px; line-height: 1.55; }
pre.doc { white-space: pre-wrap; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; color: var(--bone-2); background: var(--stock); border: 1px solid var(--rule); border-radius: 4px; padding: 10px; }
dl.meta { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; }
dl.meta dt { color: var(--bone-3); }

/* Audit: reads well on screen and prints as a clean light document. */
.audit .stat { font-family: var(--display); font-weight: 720; font-stretch: 118%; font-size: 30px; }
.audit .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.audit li { margin: 4px 0 4px 18px; }
@media print {
  :root { color-scheme: light; } /* a dark scheme paints the page margins dark */
  html, body { background: #fff; color: #111; }
  .notice { background: #f3f3f3; color: #111; }
  h1, h2, .label { break-after: avoid; }
  .top, .no-print { display: none !important; }
  main { padding: 0; }
  .card { background: #fff; border-color: #ccc; break-inside: avoid; }
  .muted, h2, .label, th, td.excerpt { color: #444; }
  .badge { color: #333; border-color: #999; }
  a { text-decoration: none; }
}

.login-card { max-width: 420px; margin: 10vh auto 0; }

/* Spacing utilities: the CSP blocks inline styles */
.ml-6 { margin-left: 6px; }
.mt-0 { margin-top: 0; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-8 { margin-top: 8px; }
.mw-220 { max-width: 220px; }

/* CRM ------------------------------------------------------------------ */
.page-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.page-head h1 { margin-bottom: 4px; }
.h1-sub { font-family: var(--body); font-size: 15px; font-weight: 500; letter-spacing: 0; margin-left: 8px; }
h3 { font-size: 16px; font-weight: 650; line-height: 1.3; }
.count { display: inline-block; min-width: 1.6em; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--board-2); color: var(--bone-2); font-size: 11px; letter-spacing: 0.04em; text-align: center; font-variant-numeric: tabular-nums; }
.overdue { color: var(--warn); }
li.overdue > span:first-child { color: inherit; }
.small-button { padding: 3px 10px; font-size: 13px; }

/* Pipeline: five columns on a laptop, a sideways scroll on a phone. */
.pipeline { display: grid; grid-template-columns: repeat(5, minmax(210px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.stage-col { scroll-snap-align: start; min-width: 0; }
.stage-head { padding: 0 2px 10px; border-bottom: 1px solid var(--rule); margin-bottom: 10px; }
.stage-head h2 { margin: 0 0 2px; color: var(--bone); }
.stage-col .empty { padding: 10px 2px; }
.deal-card { display: flex; flex-direction: column; gap: 3px; padding: 12px; margin-bottom: 8px; background: var(--board); border: 1px solid var(--rule); border-radius: 6px; text-decoration: none; transition: border-color 160ms cubic-bezier(0.16, 1, 0.3, 1), background-color 160ms cubic-bezier(0.16, 1, 0.3, 1); }
.deal-card:hover { border-color: rgba(236, 235, 230, 0.32); background: var(--board-2); }
.deal-card.closed { opacity: 0.62; }
.deal-card .badge { align-self: flex-start; margin-top: 4px; }

/* Forms */
.form-narrow { max-width: 620px; }
.field-row { display: grid; gap: 0 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details.card > summary { padding: 2px 0; }

/* Contact */
.contact-grid { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: minmax(0, 1fr); } }
.contact-grid aside > * + * { margin-top: 14px; }
.deal-top { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.moves { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--rule); }
.move-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.move-form label { margin: 0; }
.move-form input, .move-form select { width: auto; }
.move-lose[open] { flex-basis: 100%; }
.move-lose[open] > summary { margin-bottom: 10px; }
.timeline { list-style: none; padding: 0; }
.timeline li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.note-text { white-space: pre-wrap; color: var(--bone-2); margin-top: 2px; max-width: 70ch; overflow-wrap: anywhere; }
.tasks { list-style: none; padding: 0; }
.tasks li { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.today-list { max-width: 820px; }
@media print { .pipeline { display: block; } }

/* Header on narrow screens: nav wraps under the brand instead of pushing the page wide. */
.top form.inline button { white-space: nowrap; }
@media (max-width: 560px) {
  .top .wrap { flex-wrap: wrap; gap: 4px 16px; padding: 8px 0; }
  .top nav { order: 3; flex-basis: 100%; gap: 16px; }
  .top form.inline { margin-left: auto; }
}
/* Quarantine and archive lists */
.button.secondary.warn { border-color: var(--warn); color: var(--warn); }
.held-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.held-list .card { margin: 0; }
.held-list .actions { margin-top: 8px; }
.page-head .actions { margin-top: 0; }
button.danger { background: transparent; color: var(--bad); border-color: var(--bad); }

/* Client app (app.blackfold.studio) ------------------------------------ */
/* Same faces and palette, plainer: one column, bigger type and targets, built for a phone first. */
body.client { font-size: 16px; }
.client-wrap { width: min(100% - 2 * var(--gutter), 760px); }
.client .top .wrap { gap: 12px; flex-wrap: nowrap; padding: 0; }
.client-business { flex: 1; min-width: 0; color: var(--bone-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client .top form.inline { margin-left: auto; }
.client h1 { font-size: clamp(26px, 6vw, 34px); text-wrap: balance; }
.client input, .client textarea { font-size: 16px; padding: 11px 12px; } /* 16px stops iOS zooming into the field */
.client button, .client .button { padding: 11px 18px; min-height: 44px; }
.client .small-button { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.client-narrow { max-width: 460px; margin: 6vh auto 0; }
.client-narrow p + p { margin-top: 10px; }
.wide { width: 100%; }
.field-error { color: var(--bad); font-size: 14px; margin-top: 6px; }
input[aria-invalid="true"] { border-color: var(--bad); }
.client-notice { background: var(--board-2); border: 1px solid rgba(159, 212, 169, 0.45); color: var(--bone); border-radius: 6px; padding: 12px 14px; margin-bottom: 18px; }

.tabs { display: flex; gap: 6px; margin: 4px 0 16px; overflow-x: auto; }
.tabs a { text-decoration: none; color: var(--bone-2); padding: 8px 14px; border-radius: 999px; border: 1px solid var(--rule); white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--stock); background: var(--bone); border-color: var(--bone); font-weight: 600; }

.review-list, .location-list { list-style: none; padding: 0; }
.review-list { border-top: 1px solid var(--rule); }
.review-row { display: grid; gap: 4px; padding: 14px 4px; border-bottom: 1px solid var(--rule); text-decoration: none; transition: background-color 160ms cubic-bezier(0.16, 1, 0.3, 1); }
.review-row:hover { background: var(--board); }
.review-row-head { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; }
.review-row-text { color: var(--bone-2); overflow-wrap: anywhere; }
.review-row-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: space-between; }
.location-list li { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.location-list .actions { margin: 0; gap: 16px; }
.empty-state { padding: 28px 4px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); max-width: 60ch; }
.empty-state p + p { margin-top: 6px; }

.review-quote { margin: 14px 0 0; padding: 16px 18px; background: var(--board); border: 1px solid var(--rule); border-radius: 6px; }
.panel-head { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.reply-box { min-height: 180px; line-height: 1.55; }
.client .actions button { flex: 1 1 200px; }
@media (min-width: 640px) { .client .actions button { flex: 0 0 auto; } }
@media print { body.client { font-size: 13px; } .client .top { display: none; } }
/* Client: Grow kit and billing. */
.ask-qr .qr { display: block; width: 240px; height: 240px; margin: 12px 0; background: #fff; padding: 8px; border-radius: 4px; }
.client textarea[readonly] { color: var(--bone); background: var(--board-2); }
.plan-list { list-style: none; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.plan-list .card + .card { margin-top: 0; }
.plan-price { font-size: 28px; margin: 6px 0; }
@media print { .ask-qr .qr { width: 6cm; height: 6cm; } }
