/* PBCB Limited — shared kit styles.
   Every tool uses these tokens. A tool sets its own accent by overriding
   --accent / --accent-strong / --accent-ink on <body class="tool-xyz">. */

:root {
  --ink: #1B2420;
  --ink-soft: #4E5A4E;
  --ink-faint: #7A8578;
  --bg: #F5F6F0;
  --surface: #FFFFFF;
  --surface-alt: #EBEDE3;
  --border: #D7DBCC;
  --accent: #35563F;
  --accent-strong: #24402C;
  --accent-ink: #F6F8F1;
  --gold: #B9860A;
  --gold-strong: #96700A;
  --gold-ink: #1B1400;
  --shadow: 0 1px 2px rgba(27,36,32,0.06), 0 8px 24px rgba(27,36,32,0.07);
  --radius: 14px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #E7EBE0;
    --ink-soft: #B0BAA8;
    --ink-faint: #7C8B79;
    --bg: #12160F;
    --surface: #1B2117;
    --surface-alt: #232B1D;
    --border: #333D2B;
    --accent: #74A87F;
    --accent-strong: #8FC199;
    --accent-ink: #0E1A12;
    --gold: #E8B923;
    --gold-strong: #F3C947;
    --gold-ink: #191300;
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #E7EBE0;
  --ink-soft: #B0BAA8;
  --ink-faint: #7C8B79;
  --bg: #12160F;
  --surface: #1B2117;
  --surface-alt: #232B1D;
  --border: #333D2B;
  --accent: #74A87F;
  --accent-strong: #8FC199;
  --accent-ink: #0E1A12;
  --gold: #E8B923;
  --gold-strong: #F3C947;
  --gold-ink: #191300;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
  text-wrap: balance;
  margin: 0;
}
a { color: var(--accent-strong); }

.wrap { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px;
  border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 15px;
  text-decoration: none; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
  transition: background .15s ease, transform .15s ease;
}
.btn:hover { background: var(--accent-strong); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.site-footer {
  margin-top: auto;
  padding: 28px 0 32px;
  color: var(--ink-faint);
  font-size: 13px;
}

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

/* ---------- Tool accents (set by Kit.start via <html data-tool="...">) ---------- */
:root[data-tool="bqbl"] { --accent: var(--gold); --accent-strong: var(--gold-strong); --accent-ink: var(--gold-ink); }

/* ---------- Top bar ---------- */
.kit-bar { background: var(--surface); border-bottom: 1px solid var(--border); border-top: 4px solid var(--accent); }
.kit-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.kit-bar-home { font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--ink); text-decoration: none; }
.kit-bar-nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 14px; }
.kit-bar-nav a { color: var(--ink-soft); text-decoration: none; font-weight: 600; }
.kit-bar-nav a:hover, .kit-bar-nav a[aria-current="page"] { color: var(--accent-strong); }
.kit-bar-who { color: var(--ink-faint); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kit-role { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 2px 7px; border-radius: 999px; background: var(--surface-alt); color: var(--ink-soft); margin-left: 4px; }

/* ---------- Cards, forms, tables ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card h2 { font-size: 20px; margin-bottom: 4px; }
.card .sub { color: var(--ink-soft); font-size: 14px; margin: 0 0 16px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.page-title { margin: 32px 0 6px; font-size: clamp(26px, 5vw, 34px); }
.page-lede { color: var(--ink-soft); margin: 0 0 24px; max-width: 60ch; }

label.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
input, select, textarea {
  font: inherit; font-size: 15px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; min-height: 44px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }

.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-alt); color: var(--ink); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.btn-danger { color: #A23B2E; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.notice { border-radius: 10px; padding: 12px 14px; font-size: 14px; background: var(--surface-alt); color: var(--ink-soft); border: 1px solid var(--border); }
.notice.warn { background: #F6EBD0; color: #5A4310; border-color: #E2C887; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .notice.warn { background: #3A3218; color: #F3E2B0; border-color: #6B5A23; } }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.list li:last-child { border-bottom: none; }
.list .who { flex: 1 1 220px; min-width: 0; }
.list .who .name { font-weight: 600; }
.list .who .email { font-size: 13px; color: var(--ink-faint); overflow-wrap: anywhere; }
.list .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 3px 8px; border-radius: 999px; background: var(--surface-alt); color: var(--ink-soft); }
.pill.mgr { background: var(--accent); color: var(--accent-ink); }
.pill.warn { background: #F6EBD0; color: #5A4310; }
.muted { color: var(--ink-faint); font-size: 13px; }

/* ---------- Toasts ---------- */
.kit-toasts { position: fixed; bottom: 16px; left: 16px; right: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 50; pointer-events: none; }
.kit-toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow); max-width: 420px; }
.kit-toast.err { background: #A23B2E; color: #fff; }
