/* Crosspoint Platform: one stylesheet for sub, admin and publications. Each site sets --accent on <body>. */
:root {
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f0f2f5; --ink: #18202b; --ink-2: #4a5566; --ink-3: #6b7686;
  --line: #dfe3e9; --line-2: #c9cfd8; --accent: #0f5f8c; --accent-ink: #ffffff; --accent-soft: #e5f0f7;
  --ok: #1d7a46; --ok-soft: #e3f4ea; --warn: #8a5a00; --warn-soft: #fbf0d9; --bad: #b42318; --bad-soft: #fde8e6;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
body.site-sub { --accent: #0f5f8c; --accent-soft: #e5f0f7; }
body.site-pubs { --accent: #7a3e12; --accent-soft: #f7ece3; }
body.site-admin { --accent: #3b4a8a; --accent-soft: #e9ecf7; }
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1318; --surface: #171c23; --surface-2: #1e252e; --ink: #e8ecf1; --ink-2: #b4bdc9; --ink-3: #8b95a3;
    --line: #2a323d; --line-2: #3a4450; --ok: #5fd08f; --ok-soft: #12291c; --warn: #f0c060; --warn-soft: #2d2410;
    --bad: #ff8a80; --bad-soft: #331513; --shadow: none; color-scheme: dark;
  }
  body.site-sub { --accent: #5fb3e4; --accent-ink: #08202e; --accent-soft: #11283a; }
  body.site-pubs { --accent: #e8a36f; --accent-ink: #2a1405; --accent-soft: #2e1e12; }
  body.site-admin { --accent: #9aa8f0; --accent-ink: #141a3a; --accent-soft: #1d2242; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--mono); font-size: .9em; }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 5px; overflow-wrap: anywhere; }
pre { background: var(--surface-2); padding: 12px 14px; border-radius: 8px; overflow-x: auto; font: 13px/1.5 var(--mono); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 560px; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.right { text-align: right; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }

/* header / footer */
header.top { background: var(--surface); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; }
.brand .mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; }
.brand small { font-weight: 500; color: var(--ink-3); }
nav.main { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
nav.main a { color: var(--ink-2); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .95rem; }
nav.main a:hover, nav.main a[aria-current] { background: var(--accent-soft); color: var(--accent); }
footer.site { border-top: 1px solid var(--line); margin-top: 64px; padding: 24px 0 40px; color: var(--ink-3); font-size: .9rem; }
footer.site .wrap { display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; }
main { padding: 32px 0; }

/* hero */
.hero { padding: 40px 0 16px; }
.hero p.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 680px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 700; color: var(--accent); margin-bottom: 8px; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card h2, .card h3 { margin-top: 0; }
.card.flat { box-shadow: none; }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.tile { display: block; text-decoration: none; color: inherit; }
.tile:hover { border-color: var(--accent); }
.stat { font-size: 1.8rem; font-weight: 700; line-height: 1.1; }

/* plans */
.plans { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); align-items: stretch; }
.plan { display: flex; flex-direction: column; gap: 12px; position: relative; }
.plan.featured { border: 2px solid var(--accent); }
.plan .badge-top { position: absolute; top: -12px; left: 20px; background: var(--accent); color: var(--accent-ink); font-size: .75rem; font-weight: 700; padding: 2px 10px; border-radius: 99px; }
.price { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.price small { font-size: .95rem; font-weight: 500; color: var(--ink-3); }
.features { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.features li { padding-left: 24px; position: relative; }
.features li::before { content: "✓"; position: absolute; left: 2px; color: var(--ok); font-weight: 700; }
.plan .cta { margin-top: auto; }
.toggle { display: inline-flex; background: var(--surface-2); border-radius: 99px; padding: 4px; gap: 4px; }
.toggle a { padding: 6px 14px; border-radius: 99px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .9rem; }
.toggle a[aria-current] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* buttons + forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 16px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 600 .95rem var(--font); text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: .85rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
form.inline { display: inline; }
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 4px; }
.field { margin-bottom: 16px; }
.field .hint { font-weight: 400; color: var(--ink-3); font-size: .85rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 9px 11px; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 1px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; }
.check input { margin-top: 4px; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }

/* status */
.pill { display: inline-block; font-size: .78rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.flash { padding: 12px 16px; border-radius: 8px; margin: 16px 0; background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.flash.error { background: var(--bad-soft); color: var(--bad); }
.flash.warn { background: var(--warn-soft); color: var(--warn); }
.notice { border-left: 4px solid var(--warn); background: var(--warn-soft); padding: 12px 16px; border-radius: 6px; margin: 16px 0; }
.secret { font-family: var(--mono); background: var(--surface-2); border: 1px dashed var(--line-2); padding: 10px 12px; border-radius: 8px; overflow-wrap: anywhere; user-select: all; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }

/* auth */
.auth { max-width: 420px; margin: 24px auto; }

/* admin shell */
.admin-shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.admin-side { background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px; }
.admin-side .brand { padding: 4px 8px 16px; }
.admin-side nav a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 500; }
.admin-side nav a:hover, .admin-side nav a[aria-current] { background: var(--accent-soft); color: var(--accent); }
.admin-side nav .sep { margin: 14px 10px 4px; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 700; }
.admin-main { padding: 24px; min-width: 0; }
.admin-main > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.crumbs { font-size: .85rem; color: var(--ink-3); margin-bottom: 4px; }
.crumbs a { color: var(--ink-3); }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: baseline; }
.checklist li:last-child { border-bottom: 0; }
@media (max-width: 820px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-side nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .admin-side nav .sep { display: none; }
  .admin-main { padding: 16px; }
}

/* publications */
.doc { display: flex; flex-direction: column; gap: 8px; }
.doc .type { font: 700 .72rem var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.doc h3 a { color: var(--ink); text-decoration: none; }
.doc h3 a:hover { color: var(--accent); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.filters a { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line-2); text-decoration: none; color: var(--ink-2); font-size: .9rem; }
.filters a[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.searchbar { display: flex; gap: 8px; max-width: 560px; }
.prose { max-width: 720px; }
.prose p { white-space: pre-line; }
