/* Bulwark's own look for bulwark.hexwork.co.uk (layout_bulwark.php) and the captcha page there (layout_verify.php):
   the hot pink of the Bulwark mark on near-black, Archivo for headings. Standalone: it gives the base and the parts that
   app.css and admin.css give Admin > Bulwark (buttons, sheets, pills, forms, tables, the in-page dialog), with the same
   class names, so bulwark.css and the shared views work unchanged on top of it. Phone first: everything works at 320px. */
:root {
  color-scheme: dark;
  --blueprint: #FF3D6E;       /* links, focus, accents */
  --blueprint-deep: #FF7A9C;
  --blood: #F0164E;           /* the mark's pink-red, primary buttons */
  --blood-deep: #C70F3E;
  --ink: #F6F1F3;
  --graphite: #ABA0A6;        /* 7.5:1 on --paper */
  --paper: #07060A;
  --white: #110E13;           /* cards */
  --raised: #19141B;
  --sunk: #0B090D;
  --rule: #2A222C;
  --rule-strong: #43374A;
  --tint: rgba(255, 61, 110, 0.12);
  --fault: #FF6B6B;
  --bad: #FF6B6B;
  --ok: #4ADE80;
  --ok-line: rgba(74, 222, 128, 0.4);
  --pill-ink: var(--graphite);
  --display: "Archivo", "Arial Black", system-ui, sans-serif;
  --body: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --focus: 0 0 0 2px var(--paper), 0 0 0 4px var(--blueprint);
  --radius: 12px;
  --hex: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 1rem/1.55 var(--body); color: var(--ink); background: var(--paper); }
img, svg { max-width: 100%; }
a { color: var(--blueprint); text-underline-offset: 2px; }
a:hover { color: var(--blueprint-deep); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.08; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.9rem, 6vw, 3rem); font-weight: 900; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: 0.9em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 20; padding: 8px 12px; background: var(--raised); color: var(--ink); border-radius: 8px; }
.skip:focus { top: 8px; }
.muted { color: var(--graphite); }
.small { font-size: 0.9rem; }
.fine { font-size: 0.88rem; color: var(--graphite); }
.inline { display: inline; }
.num { text-align: right; white-space: nowrap; }
.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.narrowish { max-width: 880px; }
.table-scroll { width: 100%; overflow-x: auto; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border: 1px solid var(--rule-strong); border-radius: 999px; background: var(--raised); color: var(--ink); font: 600 1rem/1.2 var(--body); text-decoration: none; cursor: pointer; transition: background 0.15s, border-color 0.15s, box-shadow 0.2s, transform 0.15s; }
.btn:hover { background: #241C27; border-color: #5C4C63; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn[disabled], fieldset[disabled] .btn { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--blood); border-color: var(--blood); color: #fff; box-shadow: 0 0 0 1px rgba(255, 61, 110, 0.3), 0 10px 30px -10px rgba(240, 22, 78, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
.btn-primary:hover { background: var(--blood-deep); border-color: var(--blood-deep); color: #fff; }
.btn-primary:focus-visible { box-shadow: var(--focus), 0 10px 30px -10px rgba(240, 22, 78, 0.8); }
.btn-quiet { background: transparent; }
.btn-small { min-height: 36px; padding: 6px 14px; font-size: 0.92rem; }
.btn-big { min-height: 52px; padding: 12px 26px; font-size: 1.05rem; }
.btn-danger { background: transparent; border-color: rgba(255, 107, 107, 0.55); color: var(--fault); }
.btn-danger:hover { background: rgba(255, 107, 107, 0.1); border-color: var(--fault); color: var(--fault); }
.btn-danger-solid { background: #D92D3A; border-color: #D92D3A; color: #fff; }
.btn-danger-solid:hover { background: #B4222E; border-color: #B4222E; color: #fff; }
.btn-discord { background: #5865F2; border-color: #5865F2; color: #fff; }
.btn-discord:hover { background: #4752C4; border-color: #4752C4; color: #fff; }
.bws-dmark { width: 20px; height: 20px; flex-shrink: 0; }
.btn-small .bws-dmark { width: 17px; height: 17px; }

/* ---- Forms ---- */
label { display: block; font-weight: 600; margin: 14px 0 6px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--sunk); border: 1px solid var(--rule-strong); border-radius: 10px; padding: 10px 12px; min-height: 44px; transition: border-color 0.15s, box-shadow 0.15s; }
input:hover, select:hover, textarea:hover { border-color: #5C4C63; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blueprint); box-shadow: 0 0 0 3px rgba(255, 61, 110, 0.22); }
input::placeholder, textarea::placeholder { color: var(--graphite); opacity: 0.85; }
input[type="checkbox"], input[type="radio"] { width: 20px; min-height: 20px; height: 20px; accent-color: var(--blood); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--fault); }
select option { background: var(--white); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.field-err { color: var(--fault); font-size: 0.92rem; margin: 6px 0 0; }
.bw-locked { opacity: 0.7; }

/* ---- Cards, pills, messages, tables ---- */
.sheet { background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px 16px; margin: 0 0 18px; }
@media (min-width: 640px) { .sheet { padding: 24px; } }
.adm-pill { display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 10px 0 9px; border: 1px solid var(--rule-strong); border-radius: 999px; background: rgba(255, 255, 255, 0.03); color: var(--pill-ink); font: 600 0.75rem/1 var(--body); letter-spacing: 0.01em; white-space: nowrap; vertical-align: middle; }
.adm-pill::before { content: ""; width: 9px; height: 8px; flex-shrink: 0; background: currentColor; clip-path: var(--hex); }
.adm-pill-ok { color: var(--ok); border-color: var(--ok-line); background: rgba(74, 222, 128, 0.07); }
.adm-pill-bad { color: var(--fault); border-color: rgba(255, 107, 107, 0.4); background: rgba(255, 107, 107, 0.07); }
.adm-pill-brand { color: var(--blueprint-deep); border-color: rgba(255, 61, 110, 0.45); background: var(--tint); }
.flash { padding: 12px 14px; margin: 0 0 16px; background: var(--white); border: 1px solid var(--rule); border-left: 3px solid var(--blueprint); border-radius: 10px; }
.flash-error { border-left-color: var(--fault); }
.flash-ok { border-left-color: var(--ok); }
.flash p:last-child, .flash ul:last-child { margin-bottom: 0; }
.list { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--rule); border-radius: 10px; }
.list th, .list td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.list thead th { font-size: 0.72rem; color: var(--graphite); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; background: rgba(255, 255, 255, 0.03); }
.list .num { text-align: right; }

/* ---- The in-page confirm dialog (dialog.js) ---- */
.hx-dialog { border: 1px solid var(--rule-strong); border-radius: 16px; background: var(--raised); color: var(--ink); padding: 0; width: min(440px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7); }
.hx-dialog::backdrop { background: rgba(4, 3, 6, 0.75); backdrop-filter: blur(3px); }
.hx-dialog.out { opacity: 0; transform: scale(0.98); transition: opacity 0.12s, transform 0.12s; }
.hx-dlg-body { padding: 22px 20px 18px; margin: 0; }
.hx-dlg-title { font: 800 1.15rem/1.3 var(--display); margin: 0 0 8px; }
.hx-dlg-text { color: var(--graphite); margin: 0 0 10px; }
.hx-dlg-input { margin: 6px 0 4px; }
.hx-dlg-err { color: var(--fault); font-size: 0.9rem; min-height: 1.2em; margin: 0; }
.hx-dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

/* ---- The frame ---- */
.bws { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(1100px 520px at 50% -160px, rgba(240, 22, 78, 0.16), transparent 70%), var(--paper); }
.bws-top { position: sticky; top: 0; z-index: 5; background: rgba(7, 6, 10, 0.82); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
.bws-top-in { max-width: 1160px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bws-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 900 1.3rem/1 var(--display); letter-spacing: -0.02em; }
.bws-brand img { width: 32px; height: 32px; filter: drop-shadow(0 0 10px rgba(240, 22, 78, 0.45)); }
.bws-brand b { color: var(--blood); font-weight: 900; }
.bws-brand:hover { color: var(--ink); }
.bws-nav { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bws-nav-link { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.95rem; padding: 6px 4px; }
.bws-nav-link.is-here { color: var(--blueprint); }
.bws-me { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.bws-me img, .bws-me-init { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; }
.bws-me-init { display: inline-grid; place-items: center; background: var(--raised); border: 1px solid var(--rule-strong); font-weight: 700; font-size: 0.85rem; }
.bws-me-name { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.92rem; }
.bws-signout { margin: 0; }
@media (max-width: 560px) {
  .bws-me-name, .bws-nav-link { display: none; }
  .bws-brand span { font-size: 1.15rem; }
}
.bws-main { flex: 1; width: 100%; max-width: 1160px; margin: 0 auto; padding: 24px 16px 48px; }
.bws-foot { border-top: 1px solid var(--rule); padding: 18px 16px; text-align: center; color: var(--graphite); font-size: 0.88rem; }
.bws-foot p { margin: 0; display: inline-flex; align-items: center; gap: 8px; }

/* ---- Landing ---- */
.bws-hero { text-align: center; padding: 28px 0 40px; max-width: 760px; margin: 0 auto; }
.bws-hero-mark { width: 104px; height: 104px; filter: drop-shadow(0 0 36px rgba(240, 22, 78, 0.55)); margin-bottom: 14px; }
.bws-kicker { color: var(--blueprint); font: 700 0.8rem/1.2 var(--body); text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 10px; }
.bws-hero h1 { font-size: clamp(2.3rem, 9vw, 4.2rem); line-height: 0.98; letter-spacing: -0.03em; }
.bws-hero h1 span { color: var(--blood); }
.bws-lede { color: var(--graphite); font-size: 1.08rem; max-width: 34em; margin: 0 auto 26px; }
.bws-cta { display: flex; flex-direction: column; gap: 12px; align-items: stretch; max-width: 360px; margin: 0 auto; }
@media (min-width: 640px) { .bws-cta { flex-direction: row; justify-content: center; max-width: none; } }
.bws-note { color: var(--graphite); font-size: 0.9rem; margin: 18px auto 0; max-width: 32em; }
.bws-features { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 8px 0 40px; }
@media (min-width: 640px) { .bws-features { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .bws-features { grid-template-columns: repeat(3, 1fr); } }
.bws-feature { position: relative; background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 120px), var(--white); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px 18px 18px; }
.bws-feature-n { display: block; color: var(--blood); font: 800 0.8rem/1 var(--mono); margin-bottom: 12px; }
.bws-feature h3 { margin-bottom: 6px; }
.bws-feature p { color: var(--graphite); margin: 0; font-size: 0.95rem; }
.bws-steps { max-width: 760px; margin: 0 auto; }
.bws-steps ol { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; gap: 10px; }
.bws-steps li { counter-increment: s; position: relative; padding: 14px 16px 14px 56px; background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); }
.bws-steps li::before { content: counter(s); position: absolute; left: 16px; top: 13px; width: 26px; height: 28px; display: grid; place-items: center; background: var(--blood); color: #fff; font: 800 0.9rem/1 var(--display); clip-path: var(--hex); }

/* ---- The server picker and short pages ---- */
.bws-page { max-width: 760px; margin: 0 auto; }
.bws-sub { color: var(--graphite); margin-top: -4px; }
.bws-guilds { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 10px; }
.bws-guild { display: grid; grid-template-columns: 48px 1fr; align-items: center; gap: 12px 14px; padding: 14px; background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); }
.bws-guild h2 { font-size: 1.1rem; margin: 0 0 2px; overflow-wrap: anywhere; }
.bws-guild p { margin: 0; color: var(--graphite); font-size: 0.9rem; }
.bws-guild-act { grid-column: 1 / -1; display: flex; }
.bws-guild-act .btn { flex: 1; }
@media (min-width: 560px) { .bws-guild { grid-template-columns: 48px 1fr auto; } .bws-guild-act { grid-column: auto; } .bws-guild-act .btn { flex: none; } }
.bws-guild.is-new { border-style: dashed; }
.bws-guild.is-paused { opacity: 0.8; }
.bws-gicon { width: 48px; height: 48px; border-radius: 14px; object-fit: cover; background: var(--raised); }
.bws-ginit { display: grid; place-items: center; font: 800 1.2rem/1 var(--display); color: var(--ink); border: 1px solid var(--rule-strong); }
.bws-role { color: var(--blueprint-deep); font-weight: 600; }
.bws-fine { color: var(--graphite); font-size: 0.88rem; }
.bws-card { background: var(--white); border: 1px solid var(--rule); border-radius: 16px; padding: 24px 20px; }
.bws-message { max-width: 480px; margin: 24px auto; text-align: center; }
.bws-message img { filter: drop-shadow(0 0 18px rgba(240, 22, 78, 0.45)); margin-bottom: 8px; }
.bws-message h1 { font-size: 1.6rem; }
.bws-message p { color: var(--graphite); }
.bws-two { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.bws-empty h2 { font-size: 1.2rem; }

/* ---- A server's dashboard on the Bulwark host (bulwark.css draws the rest) ---- */
.bws-dash .page-head { margin-top: 0; }
.bw-owner-only { display: inline-flex; align-items: center; gap: 8px; color: var(--graphite); font-size: 0.9rem; padding: 8px 12px; border: 1px dashed var(--rule-strong); border-radius: 10px; margin: 0 0 12px; }
.bw-owner-only::before { content: ""; width: 10px; height: 11px; background: var(--blueprint); clip-path: var(--hex); flex-shrink: 0; }
.bw-audit-list { list-style: none; padding: 0; margin: 0; }
.bw-audit-list li { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 640px) { .bw-audit-list li { grid-template-columns: 130px 1fr; gap: 12px; } }
.bw-audit-at { color: var(--graphite); font: 500 0.85rem/1.5 var(--mono); }
.bw-audit-detail { display: block; color: var(--graphite); font-size: 0.9rem; overflow-wrap: anywhere; }
.bw-audit-list li.is-refused strong { color: var(--fault); }
