:root { color-scheme: light; --primary: #1864ab; --accent: #0b7285; --ink: #162b40; --muted: #637487;
  --border: #dde5ed; --surface: #fff; --canvas: #f4f7fa; font-family: 'Avenir Next', 'Segoe UI', sans-serif; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-size: 15px; line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button, .button { background: var(--primary); color: #fff; border: 1px solid transparent; border-radius: 9px;
  padding: 10px 17px; font-weight: 600; cursor: pointer; display: inline-flex; justify-content: center; align-items: center; }
button:hover, .button:hover { background: #124d87; text-decoration: none; }
button:disabled { opacity: .55; cursor: wait; }
.secondary { background: white; border-color: var(--border); color: var(--ink); }
.secondary:hover { background: #eef4fa; }
:focus-visible { outline: 3px solid #5ab8ce; outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(27px, 3vw, 36px); line-height: 1.2; letter-spacing: -.9px; margin-bottom: 12px; }
h2 { font-size: 19px; margin-bottom: 20px; }
h3 { font-size: 16px; margin-bottom: 5px; }
p, small { color: var(--muted); }
small { display: block; font-size: 12px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
.desk-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.desk-sidebar { padding: 30px 20px; background: #102e4a; color: white; display: flex; flex-direction: column; }
.desk-brand { display: flex; align-items: center; gap: 12px; color: inherit; font-weight: 700; font-size: 19px; }
.desk-brand:hover { text-decoration: none; }
.desk-brand > span > span { display: block; font-size: 12px; font-weight: 400; letter-spacing: 1px; opacity: .75; }
.brand-symbol { display: grid; place-items: center; width: 42px; height: 42px; background: #1b7791;
  border-radius: 12px; color: white; font-size: 28px; font-weight: 700; }
.nav-caption { font-size: 10px; letter-spacing: 1.5px; color: #91abc1; margin: 44px 12px 12px; }
nav { display: grid; gap: 5px; }
nav a { display: flex; align-items: center; gap: 13px; padding: 11px 14px; border-radius: 8px; color: #d0dfeb; }
nav a:hover { background: #1a3e5d; text-decoration: none; }
nav a[aria-current] { background: #214e74; color: white; box-shadow: inset 3px 0 #64c5d5; }
nav a > span:first-child { font-size: 20px; width: 22px; text-align: center; }
.nav-count { margin-left: auto; background: #36728a; border-radius: 12px; padding: 0 7px; font-size: 12px; }
.sidebar-note { margin-top: auto; padding: 35px 5px 0; font-size: 11px; color: #c9d7e2; }
.sidebar-note small { color: #97aebf; margin-top: 8px; font-size: 10px; }
.live-dot { display: inline-block; width: 6px; height: 6px; background: #77ceb0; border-radius: 50%; margin-right: 6px; }
.desk-workspace { min-width: 0; }
.desk-topbar { min-height: 84px; padding: 15px 36px; background: white; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.workspace-label { color: var(--muted); font-size: 13px; }
.identity { display: flex; gap: 12px; align-items: center; font-size: 13px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #e4eff7; color: #326790;
  display: grid; place-items: center; font-weight: 700; }
.identity form .actions { margin: 0; }
.identity button { font-size: 12px; padding: 7px 11px; background: white; color: var(--muted); border-color: var(--border); }
#screen { padding: 34px 36px; max-width: 1580px; margin: auto; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading p { margin-bottom: 0; }
.eyebrow { color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: 1.7px; margin-bottom: 12px !important; }
.card { border: 1px solid var(--border); background: var(--surface); border-radius: 14px;
  padding: 24px; margin-bottom: 24px; min-width: 0; box-shadow: 0 3px 8px #152c4610; }
.split { display: grid; grid-template-columns: minmax(280px, .85fr) minmax(0, 1.4fr); gap: 24px; align-items: start; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.card-grid .card { margin-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 24px; }
.stats > div { background: #fff; padding: 20px 24px; border: 1px solid var(--border); border-radius: 12px; }
.stats span { color: var(--muted); font-size: 13px; }
.stats strong { display: block; font-size: 30px; font-weight: 600; margin-top: 4px; }
form { margin: 0; }
label { display: block; margin-bottom: 18px; font-size: 13px; font-weight: 600; }
input, select, textarea { width: 100%; display: block; margin-top: 7px; border: 1px solid #cbd6e1;
  background: white; border-radius: 8px; padding: 10px 12px; color: var(--ink); min-height: 43px; }
input[type=checkbox] { width: 18px; min-height: 18px; display: inline-block; margin: 0 8px 0 0; vertical-align: middle; }
textarea { resize: vertical; }
.check { display: block; }
.hint, .required-note { font-size: 12px; font-weight: 400; color: var(--muted); }
.message, .form-error, .error { color: #b23f34; }
.form-error:empty { display: none; }
.filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; padding-bottom: 22px; }
.filters label { min-width: 130px; flex: 1; margin: 0; }
.filters .form-error { width: 100%; }
.actions { margin-top: 20px; }
.table-scroll { overflow: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: 13px; }
th { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px;
  background: #f7f9fc; white-space: nowrap; }
th, td { padding: 15px 12px; border-bottom: 1px solid #edf0f4; vertical-align: middle; }
td strong { display: block; font-size: 13px; }
td .actions { margin: 0; }
td button { padding: 6px 10px; font-size: 12px; }
.badge { display: inline-flex; background: #edf2f7; color: #536980; padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge.active, .badge.approved, .badge.accepted { color: #197353; background: #e6f5ed; }
.badge.pending { color: #93620c; background: #fff4d9; }
.badge.disabled, .badge.rejected, .badge.revoked { color: #a44840; background: #fbece9; }
.empty { padding: 34px 18px; text-align: center; border: 1px dashed var(--border); border-radius: 10px; }
.empty > span { display: block; font-size: 30px; color: #84a7bf; margin-bottom: 12px; }
.empty p { font-size: 13px; margin: 0; }
.tool-list { display: grid; gap: 16px; }
.tool-item { padding-bottom: 18px; border-bottom: 1px solid var(--border); display: flex; gap: 14px; flex-wrap: wrap; }
.tool-item > div { flex: 1; min-width: 150px; }
.tool-item form { width: 100%; }
.tool-icon { font-size: 25px; color: var(--primary); }
.tool-item p { font-size: 13px; margin-bottom: 8px; }
.request-card { padding: 20px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 16px; }
.request-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.request-card form { margin-top: 16px; }
blockquote { margin: 16px 0; border-left: 3px solid #81b9cf; padding: 10px 14px; background: #f4f8fa; font-size: 13px; }
dl { display: grid; grid-template-columns: 80px 1fr; gap: 10px; font-size: 13px; margin: 0 0 24px; }
dt { color: var(--muted); } dd { margin: 0; overflow-wrap: anywhere; }
.muted { font-size: 13px; }
footer { padding: 10px 36px 30px; color: #718296; font-size: 11px; }
.public-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.public-story { padding: 50px 10%; color: white; background: linear-gradient(135deg, #102e4a, #15516c);
  display: flex; flex-direction: column; justify-content: center; }
.public-story .desk-brand { margin-bottom: 80px; }
.public-story h1 { font-size: clamp(35px, 4vw, 58px); letter-spacing: -1.5px; line-height: 1.15; }
.public-story p { color: #c0d5e1; max-width: 460px; }
.public-story .eyebrow { color: #7bced3; }
.public-story > small { color: #a0bdce; margin-top: 75px; }
.story-route { display: flex; align-items: center; margin-top: 36px; gap: 12px; font-size: 12px; color: #d8e9ee; }
.story-route span { border: 1px solid #52859c; border-radius: 24px; padding: 8px 16px; }
.story-route i { width: 30px; height: 1px; background: #52859c; }
.public-form { display: grid; align-items: center; padding: 50px 12%; background: white; }
.auth-card { max-width: 440px; width: 100%; margin: auto; }
.auth-card h2 { font-size: 30px; margin-bottom: 10px; }
.auth-card form { margin-top: 30px; }
.auth-card .actions button { width: 100%; }
.auth-card > .muted { margin-top: 24px; }
.setup-link { font-size: 12px; }
.invitation-summary { padding: 16px; border-radius: 10px; background: #f0f6fa; overflow-wrap: anywhere; }
.invitation-summary p { margin: 4px 0 0; }
#toast { position: fixed; right: 24px; bottom: 24px; padding: 14px 22px; background: #12344b; color: white;
  border-radius: 12px; box-shadow: 0 4px 20px #0003; max-width: 90vw; z-index: 30; }
#toast:empty { display: none; }
dialog { border: 1px solid var(--border); border-radius: 16px; padding: 28px; width: min(560px, 94vw); color: var(--ink); }
dialog::backdrop { background: #102e4a88; }
dialog .actions { display: flex; gap: 12px; }
@media (max-width: 1100px) {
  .desk-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr); gap: 0; }
  #screen { padding: 26px; }
  .workspace-label { display: none; }
}
@media (max-width: 700px) {
  .desk-shell, .public-page { display: block; }
  .desk-sidebar { padding: 20px 16px; }
  .desk-sidebar .desk-brand { font-size: 16px; }
  .nav-caption, .sidebar-note { display: none; }
  nav { display: flex; overflow: auto; margin-top: 20px; gap: 8px; }
  nav a { flex-shrink: 0; padding: 8px 12px; font-size: 12px; }
  nav a > span:first-child { display: none; }
  .desk-topbar { padding: 14px 18px; min-height: auto; justify-content: flex-end; }
  #screen { padding: 24px 16px; }
  .page-heading { align-items: start; flex-direction: column; }
  .stats { gap: 8px; }
  .stats > div { padding: 12px; }
  .stats span { font-size: 10px; }
  .stats strong { font-size: 24px; }
  .card { padding: 18px; }
  .public-story { padding: 28px; }
  .public-story .desk-brand { margin: 0; }
  .public-story > h1, .public-story > p, .public-story > small, .story-route { display: none; }
  .public-form { padding: 36px 24px; }
  .filters { flex-direction: column; align-items: stretch; }
}
/* Registration remains usable even when the payment connection is unavailable. */
.registration-fee { border-left: 4px solid #2563eb; }
.registration-fee [data-payment-fallback] { overflow-wrap: anywhere; }
.fee-return { max-width: 760px; margin: 8vh auto; padding: 24px; }
