:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0b0c10;
  color: #f5f5f7;
  --bg: #0b0c10;
  --surface: #111319;
  --surface-2: #171a22;
  --surface-3: #1d202a;
  --border: #292d38;
  --border-strong: #383d4a;
  --text: #f5f5f7;
  --muted: #9ca3b2;
  --faint: #717887;
  --accent: #7c6cff;
  --accent-hover: #9184ff;
  --accent-soft: rgba(124, 108, 255, .13);
  --good: #56d77b;
  --good-soft: rgba(86, 215, 123, .12);
  --warn: #e9b75f;
  --warn-soft: rgba(233, 183, 95, .12);
  --bad: #ef6a73;
  --bad-soft: rgba(239, 106, 115, .12);
  --radius: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
code, pre { font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace; }
::selection { background: rgba(124, 108, 255, .32); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.brand { display: inline-flex; align-items: center; min-height: 30px; }
.brand-logo { display: inline-flex; align-items: center; line-height: 0; }
.brand-logo-image { display: block; width: auto; height: 30px; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.brand-logo-image-light { display: none; }
:root[data-theme="light"] .brand-logo-image-dark { display: none; }
:root[data-theme="light"] .brand-logo-image-light { display: block; }
.auth-brand .brand-logo-image, .verify-brand .brand-logo-image { height: 34px; }
.drawer-head .brand-logo-image { height: 27px; }
.button { min-height: 40px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-weight: 650; transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:active:not(:disabled) { transform: translateY(0); }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button.primary { background: var(--accent); color: #fff; border-color: #7062ec; }
.button.primary:hover:not(:disabled) { background: var(--accent-hover); }
.button.secondary { background: var(--surface-2); border-color: var(--border); color: #e8e8ec; }
.button.secondary:hover:not(:disabled) { background: var(--surface-3); border-color: var(--border-strong); }
.button.danger { background: #b93d49; border-color: #d5535f; color: #fff; }
.button.danger:hover:not(:disabled) { background: #cc4854; }
.button.danger.ghost { background: transparent; color: #f08b94; border-color: rgba(239,106,115,.35); }
.button.discord { background: #5865f2; border-color: #6874f5; color: #fff; }
.button.compact { min-height: 34px; padding: 0 11px; font-size: 12px; }
.button.full { width: 100%; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 20px; }

.eyebrow { display: block; color: #aaa3ff; font-size: 11px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 7px; }
.muted { color: var(--muted); }
.back-link { display: inline-block; color: var(--muted); margin-bottom: 14px; font-size: 13px; }
.back-link:hover { color: var(--text); }

.marketing-page { min-height: 100vh; background: radial-gradient(circle at 52% -18%, rgba(124,108,255,.12), transparent 34%), var(--bg); }
.marketing-nav { width: min(1180px, calc(100% - 40px)); height: 72px; margin: 0 auto; display: flex; align-items: center; gap: 28px; border-bottom: 1px solid rgba(255,255,255,.06); }
.marketing-nav nav { display: flex; gap: 24px; margin-left: auto; color: var(--muted); font-size: 13px; }
.marketing-nav nav a:hover { color: var(--text); }
.marketing-nav > .button { margin-left: 0; }
.hero-section { width: min(1180px, calc(100% - 40px)); min-height: 650px; margin: 0 auto; padding: 95px 0 85px; display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(420px, .96fr); gap: 80px; align-items: center; }
.hero-copy h1 { max-width: 700px; margin: 0; font-size: clamp(42px, 5.3vw, 72px); line-height: 1.01; letter-spacing: -.055em; font-weight: 780; }
.hero-copy > p { max-width: 650px; margin: 24px 0 0; color: #b1b5c0; font-size: 18px; line-height: 1.65; }
.hero-actions { display: flex; gap: 10px; margin-top: 32px; }
.trust-line { display: flex; flex-wrap: wrap; gap: 16px 22px; margin-top: 34px; color: var(--faint); font-size: 12px; }
.trust-line span { position: relative; padding-left: 13px; }
.trust-line span::before { content: ""; position: absolute; left: 0; top: 7px; width: 4px; height: 4px; background: #7770d9; border-radius: 50%; }
.hero-console { border: 1px solid var(--border); background: linear-gradient(180deg, #12141a, #0f1116); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.console-head, .console-foot { min-height: 48px; display: flex; align-items: center; gap: 9px; padding: 0 16px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.console-head strong { color: var(--text); }
.console-head small { margin-left: auto; color: var(--faint); }
.system-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px rgba(86,215,123,.08); }
.flow-stack { padding: 26px; }
.flow-node { min-height: 84px; display: grid; grid-template-columns: 36px 1fr auto; gap: 13px; align-items: center; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: #15171e; }
.flow-node.active { border-color: rgba(124,108,255,.58); background: var(--accent-soft); }
.flow-node > span { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--border); background: #0e1015; border-radius: 8px; color: var(--faint); font: 700 11px "Cascadia Code", monospace; }
.flow-node div { display: flex; flex-direction: column; }
.flow-node small { color: var(--muted); margin-top: 2px; }
.flow-node b { font-size: 11px; font-weight: 650; color: #b8b3ff; padding: 5px 8px; border: 1px solid rgba(124,108,255,.22); border-radius: 6px; }
.flow-link { width: 1px; height: 22px; margin-left: 42px; background: var(--border-strong); }
.console-foot { border-top: 1px solid var(--border); border-bottom: 0; justify-content: space-between; }
.section-wrap { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 95px 0; border-top: 1px solid rgba(255,255,255,.06); }
.section-heading { max-width: 650px; margin-bottom: 42px; }
.section-heading h2 { margin: 0; font-size: clamp(32px, 4vw, 48px); letter-spacing: -.04em; line-height: 1.08; }
.section-heading p { color: var(--muted); font-size: 16px; margin: 15px 0 0; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.feature-grid article { min-height: 220px; padding: 26px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: rgba(17,19,25,.42); }
.feature-grid article:hover { background: #12151c; }
.feature-index { color: #7770d9; font: 700 11px "Cascadia Code", monospace; }
.feature-grid h3 { margin: 35px 0 10px; font-size: 18px; }
.feature-grid p { margin: 0; color: var(--muted); line-height: 1.65; }
.feature-grid code { color: #bbb6ff; }
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.plan-card { padding: 28px; min-height: 300px; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; }
.plan-card.featured { border-color: #5f57b7; box-shadow: inset 0 1px rgba(255,255,255,.04); }
.plan-card > span { color: #aaa3ff; font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.plan-card h3 { margin: 12px 0 26px; font-size: 25px; letter-spacing: -.03em; }
.plan-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 13px; color: #b5b9c4; }
.plan-card li::before { content: "✓"; color: var(--good); margin-right: 9px; }
.marketing-footer { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 34px 0 46px; border-top: 1px solid rgba(255,255,255,.06); display: grid; grid-template-columns: auto 1fr auto; gap: 28px; align-items: center; color: var(--muted); }
.marketing-footer p { margin: 0; }
.marketing-footer nav { display: flex; gap: 18px; }
.marketing-footer nav a:hover { color: var(--text); }

.auth-page, .verification-page { min-height: 100vh; padding: 32px 20px; display: grid; place-items: center; background: radial-gradient(circle at 50% 0%, rgba(124,108,255,.1), transparent 38%), var(--bg); position: relative; }
.auth-brand, .verify-brand { position: absolute; left: 32px; top: 26px; }
.auth-card { width: min(850px, 100%); display: grid; grid-template-columns: 1.1fr .9fr; border: 1px solid var(--border); border-radius: 14px; background: #101218; overflow: hidden; box-shadow: var(--shadow); }
.auth-copy, .auth-action { padding: 46px; }
.auth-copy { border-right: 1px solid var(--border); }
.auth-copy h1 { font-size: 38px; letter-spacing: -.045em; line-height: 1.08; margin: 0; }
.auth-copy p { color: var(--muted); margin: 18px 0 0; line-height: 1.7; }
.auth-copy code { color: #bbb6ff; }
.auth-action { display: flex; flex-direction: column; justify-content: center; gap: 16px; background: #0e1015; }
.auth-status { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.fine-print { color: var(--faint); font-size: 11px; line-height: 1.55; margin: 0; }

.app-layout { min-height: 100vh; display: grid; grid-template-columns: 222px minmax(0, 1fr); grid-template-rows: 58px minmax(0, 1fr); }
.topbar { grid-column: 1 / -1; position: sticky; top: 0; z-index: 40; height: 58px; display: flex; align-items: center; gap: 10px; padding: 0 17px; background: rgba(11,12,16,.94); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.topbar .brand { width: 205px; }
.topbar-spacer { flex: 1; }
.user-chip { height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 5px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); max-width: 230px; }
.user-chip img { width: 24px; height: 24px; border-radius: 6px; }
.user-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.user-chip small { color: #aaa3ff; font-size: 10px; text-transform: uppercase; }
.sidebar { grid-row: 2; position: sticky; top: 58px; height: calc(100vh - 58px); border-right: 1px solid var(--border); background: #0e1015; display: flex; flex-direction: column; padding: 14px 11px; }
.sidebar nav, .drawer nav { display: grid; gap: 3px; }
.sidebar nav a, .drawer nav a { min-height: 38px; display: flex; align-items: center; padding: 0 11px; border-radius: 7px; color: #9ca3b2; font-size: 13px; font-weight: 580; }
.sidebar nav a:hover, .sidebar nav a.active, .drawer nav a:hover { background: var(--surface-2); color: var(--text); }
.sidebar nav a.active { box-shadow: inset 2px 0 var(--accent); }
.sidebar-foot { margin-top: auto; padding: 12px 10px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 9px; color: var(--faint); font-size: 11px; }
.app-content { min-width: 0; padding: 32px clamp(20px, 3.3vw, 48px) 60px; }
.page-stack { width: min(1240px, 100%); margin: 0 auto; display: grid; gap: 18px; }
.page-stack.compact-gap { gap: 12px; }
.page-heading { min-height: 70px; display: flex; gap: 25px; justify-content: space-between; align-items: flex-start; margin-bottom: 3px; }
.page-heading h1 { margin: 0; font-size: 29px; line-height: 1.15; letter-spacing: -.035em; }
.page-heading p { margin: 7px 0 0; color: var(--muted); max-width: 700px; }
.heading-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 20px; min-width: 0; }
.panel h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.panel h3 { margin: 0 0 14px; font-size: 14px; }
.panel > p { color: var(--muted); }
.panel-head { min-height: 36px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.panel-head.responsive { align-items: center; }
.panel-intro { color: var(--muted); margin: -7px 0 18px; }
.panel-grid { display: grid; gap: 14px; }
.panel-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.admin-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card { min-height: 118px; padding: 17px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); display: flex; flex-direction: column; }
.stat-card > span { color: var(--muted); font-size: 11px; }
.stat-card strong { margin-top: 12px; font-size: 25px; letter-spacing: -.04em; font-weight: 720; }
.stat-card small { margin-top: auto; color: var(--faint); }
.result-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.result-bars div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 16px; display: flex; justify-content: space-between; }
.result-bars span { color: var(--muted); }
.definition-list { margin: 0; display: grid; }
.definition-list div { min-height: 39px; display: flex; justify-content: space-between; align-items: center; gap: 15px; border-top: 1px solid var(--border); }
.definition-list div:first-child { border-top: 0; }
.definition-list dt { color: var(--muted); }
.definition-list dd { margin: 0; font-weight: 620; }
.event-list { display: grid; }
.event-list article { min-height: 53px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--border); }
.event-list article:first-child { border-top: 0; }
.event-list article div { display: flex; flex-direction: column; }
.event-list small, .event-list time { color: var(--faint); font-size: 11px; }

.status-badge { display: inline-flex; min-height: 24px; align-items: center; padding: 0 8px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); background: var(--surface-2); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.status-badge[data-tone="good"] { color: #86e8a1; border-color: rgba(86,215,123,.25); background: var(--good-soft); }
.status-badge[data-tone="bad"] { color: #f3949c; border-color: rgba(239,106,115,.25); background: var(--bad-soft); }
.status-badge[data-tone="warn"] { color: #f2ca80; border-color: rgba(233,183,95,.25); background: var(--warn-soft); }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.application-card { min-height: 220px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 18px; display: flex; flex-direction: column; transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.application-card:hover { transform: translateY(-2px); border-color: var(--border-strong); background: #14171e; }
.application-card-head { display: flex; justify-content: space-between; gap: 12px; }
.app-ident { display: flex; align-items: center; min-width: 0; gap: 10px; }
.app-glyph, .server-glyph { flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); border: 1px solid rgba(124,108,255,.26); color: #bbb6ff; font-size: 11px; font-weight: 800; }
.app-ident h2 { margin: 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-ident small { display: block; color: var(--faint); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.application-card dl { margin: 24px 0 15px; display: grid; gap: 7px; }
.application-card dl div { display: flex; justify-content: space-between; gap: 10px; }
.application-card dt { color: var(--faint); }
.application-card dd { margin: 0; color: #c7cad2; }
.card-link { margin-top: auto; color: #aaa3ff; font-size: 12px; }
.limit-note { color: var(--faint); font-size: 11px; margin: 0; }

form label, .form-panel label, .verification-card label { display: grid; gap: 6px; color: #c9ccd4; font-size: 12px; }
label > span { font-weight: 620; }
input, select, textarea { width: 100%; color: var(--text); background: #0c0e13; border: 1px solid var(--border-strong); border-radius: 7px; min-height: 40px; padding: 8px 10px; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
textarea { resize: vertical; min-height: 90px; }
input:hover, select:hover, textarea:hover { border-color: #474d5c; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label small { color: var(--faint); font-size: 10px; }
.form-panel { display: grid; gap: 15px; }
.form-panel.embedded { padding: 0; border: 0; background: transparent; }
.form-grid { display: grid; gap: 13px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.form-note { padding: 13px; border: 1px solid var(--border); border-radius: 8px; background: #0e1015; }
.form-note strong { font-size: 12px; }
.form-note p { color: var(--muted); margin: 4px 0 0; font-size: 11px; }
.check-field { grid-template-columns: 18px 1fr; align-items: start; gap: 8px !important; min-height: 36px; padding: 8px 0; }
.check-field input { width: 16px; min-height: 16px; height: 16px; margin-top: 2px; accent-color: var(--accent); }
.readonly-field { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px; min-height: 48px; padding: 7px 9px 7px 13px; border: 1px solid var(--border); border-radius: 8px; background: #0e1015; }
.readonly-field > span { color: var(--faint); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.readonly-field code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #c4c1ee; font-size: 11px; }
.readonly-field.top-gap { margin-top: 14px; }

.tabs { display: flex; gap: 3px; min-width: 0; overflow-x: auto; padding: 4px; border: 1px solid var(--border); background: #0e1015; border-radius: 9px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 0 0 auto; min-height: 33px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; }
.tabs button:hover { color: var(--text); background: var(--surface-2); }
.tabs button.active { color: #fff; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border); }
.admin-tabs { position: sticky; top: 70px; z-index: 15; }
.guild-list, .job-list, .grant-list { display: grid; gap: 7px; }
.guild-list article, .job-list article, .grant-list article { min-height: 56px; display: flex; align-items: center; gap: 12px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; background: #0e1015; }
.guild-list article.active { border-color: rgba(86,215,123,.3); }
.guild-list article > div:first-child, .job-list article > div:first-child, .grant-list article > div:first-child { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.guild-list small, .job-list small, .grant-list small { color: var(--faint); font-size: 10px; }
.job-actions { display: flex; gap: 5px; }
.recovery-start { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px; margin: 16px 0; padding: 14px; background: var(--bad-soft); border: 1px solid rgba(239,106,115,.2); border-radius: 8px; }

.notice { min-height: 44px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); display: flex; gap: 8px; align-items: center; }
.notice.error { border-color: rgba(239,106,115,.28); background: var(--bad-soft); color: #f3a0a7; }
.notice.success { border-color: rgba(86,215,123,.25); background: var(--good-soft); color: #91eaa8; }
.notice.warning { align-items: flex-start; flex-direction: column; border-color: rgba(233,183,95,.25); background: var(--warn-soft); color: #e7cc9d; }
.notice button { margin-left: auto; background: transparent; border: 0; color: inherit; text-decoration: underline; cursor: pointer; }
.empty-state { min-height: 130px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 7px; color: var(--muted); }
.empty-state strong { color: var(--text); }
.empty-state p { margin: 0 0 6px; }
.danger-zone { border-color: rgba(239,106,115,.22); }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th { height: 37px; padding: 0 10px; text-align: left; color: var(--faint); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); }
td { min-height: 49px; padding: 10px; border-bottom: 1px solid var(--border); color: #c8cbd2; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255,255,255,.015); }
td strong { color: var(--text); display: block; }
td small { color: var(--faint); display: block; margin-top: 2px; }
.table-actions { display: flex; gap: 5px; white-space: nowrap; }
.search-form { display: flex; gap: 7px; width: min(360px, 100%); }
.search-form input { min-height: 34px; height: 34px; }
.user-detail { border-color: #464252; }
.admin-login { width: min(520px, 100%); }
.code-output pre { max-height: 300px; overflow: auto; padding: 14px; margin: 0; background: #090b0f; border: 1px solid var(--border); border-radius: 8px; color: #c9c5ff; white-space: pre-wrap; word-break: break-all; }

.verification-card { width: min(520px, 100%); padding: 30px; border: 1px solid var(--border); border-radius: 13px; background: #111319; box-shadow: var(--shadow); display: grid; gap: 18px; }
.verification-card h1 { margin: 0; font-size: 28px; letter-spacing: -.035em; }
.verification-card > p { margin: -8px 0 0; color: var(--muted); line-height: 1.65; }
.verification-identity { display: flex; gap: 14px; align-items: center; }
.server-glyph { width: 52px; height: 52px; font-size: 13px; }
.verification-identity h1 { font-size: 23px; }
.verification-identity p { color: var(--muted); margin: 2px 0 0; }
.scope-panel { padding: 14px; border: 1px solid var(--border); background: #0d0f14; border-radius: 8px; }
.scope-panel > strong { font-size: 11px; color: var(--muted); }
.scope-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.scope-list span { padding: 4px 8px; background: var(--accent-soft); border: 1px solid rgba(124,108,255,.2); color: #beb9ff; border-radius: 6px; font: 700 11px "Cascadia Code", monospace; }
.scope-panel p { margin: 0; color: var(--faint); font-size: 11px; }
.text-action { text-align: center; color: var(--muted); font-size: 11px; text-decoration: underline; }
.result-card { text-align: center; justify-items: center; }
.result-symbol { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; background: var(--good-soft); border: 1px solid rgba(86,215,123,.25); color: var(--good); font-size: 22px; }
.result-symbol[data-status="error"], .result-symbol[data-status="cancelled"] { background: var(--bad-soft); border-color: rgba(239,106,115,.25); color: var(--bad); }

.legal-page { min-height: 100vh; background: var(--bg); padding-bottom: 80px; }
.legal-document { width: min(760px, calc(100% - 40px)); margin: 70px auto 0; }
.legal-document h1 { margin: 0 0 30px; font-size: 42px; letter-spacing: -.045em; }
.legal-document h2 { margin: 34px 0 8px; font-size: 18px; }
.legal-document p { margin: 0; color: #b0b4bf; font-size: 15px; line-height: 1.8; }
.legal-document code { color: #bbb6ff; }

.dialog-backdrop, .drawer-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.62); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; animation: fade-in .14s ease; }
.dialog { width: min(440px, 100%); padding: 22px; border: 1px solid var(--border-strong); border-radius: 11px; background: #151820; box-shadow: var(--shadow); animation: dialog-in .16s ease; }
.dialog h2 { margin: 0; font-size: 19px; }
.dialog p { color: var(--muted); margin: 9px 0 22px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 7px; }
.drawer-backdrop { place-items: stretch end; padding: 0; }
.drawer { width: min(300px, 86vw); height: 100%; padding: 14px; background: #0e1015; border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 15px; animation: drawer-in .18s ease; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; min-height: 42px; }
.drawer .button.full { margin-top: auto; }
.mobile-only { display: none; }

.skeleton { background: linear-gradient(90deg, #14171d 25%, #1b1e26 42%, #14171d 58%); background-size: 300% 100%; animation: shimmer 1.25s ease infinite; }
.stat-skeleton { height: 118px; border-radius: var(--radius); border: 1px solid var(--border); }
.app-skeleton { height: 220px; border-radius: var(--radius); border: 1px solid var(--border); }
.detail-skeleton { height: 340px; }
.boot-screen { min-height: 100vh; display: flex; justify-content: center; align-items: center; gap: 10px; color: var(--muted); }
.spinner { width: 17px; height: 17px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }

@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes dialog-in { from { transform: translateY(8px) scale(.985); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: none; } }

@media (max-width: 1100px) {
  .hero-section { grid-template-columns: 1fr; gap: 45px; padding-top: 70px; }
  .hero-console { width: min(620px, 100%); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .admin-stats { grid-template-columns: repeat(4, 1fr); }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .marketing-nav nav { display: none; }
  .marketing-nav { width: min(100% - 28px, 1180px); }
  .hero-section, .section-wrap, .marketing-footer { width: min(100% - 28px, 1180px); }
  .hero-section { min-height: auto; padding: 60px 0; }
  .hero-copy h1 { font-size: clamp(39px, 11vw, 58px); }
  .hero-copy > p { font-size: 16px; }
  .plan-grid { grid-template-columns: 1fr; }
  .marketing-footer { grid-template-columns: 1fr; }
  .marketing-footer nav { flex-wrap: wrap; }
  .app-layout { display: block; }
  .desktop-sidebar, .desktop-only { display: none; }
  .mobile-only { display: grid; }
  .topbar { position: sticky; width: 100%; }
  .topbar .brand { width: auto; }
  .app-content { padding: 24px 16px 50px; }
  .panel-grid.two, .form-grid.three { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .auth-card { grid-template-columns: 1fr; }
  .auth-copy { border-right: 0; border-bottom: 1px solid var(--border); }
  .auth-copy, .auth-action { padding: 30px; }
}

@media (max-width: 620px) {
  body { font-size: 13px; }
  .marketing-nav { height: 62px; }
  .marketing-nav .brand { flex: 1; }
  .marketing-nav > .button { font-size: 11px; }
  .hero-section { padding-top: 45px; }
  .hero-copy h1 { font-size: 39px; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .trust-line { display: grid; gap: 9px; }
  .hero-console { border-radius: 10px; }
  .flow-stack { padding: 15px; }
  .flow-node { grid-template-columns: 32px 1fr; min-height: 78px; }
  .flow-node b { grid-column: 2; justify-self: start; }
  .feature-grid { grid-template-columns: 1fr; }
  .section-wrap { padding: 65px 0; }
  .page-heading { flex-direction: column; gap: 12px; }
  .page-heading .button { width: 100%; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .stat-card { min-height: 105px; }
  .stat-card strong { font-size: 21px; }
  .card-grid { grid-template-columns: 1fr; }
  .form-grid.two { grid-template-columns: 1fr; }
  .panel { padding: 16px; }
  .readonly-field { grid-template-columns: 1fr auto; }
  .readonly-field > span { grid-column: 1 / -1; }
  .result-bars { grid-template-columns: 1fr; }
  .user-chip { max-width: 155px; }
  .user-chip small { display: none; }
  .topbar { padding: 0 10px; }
  .auth-brand, .verify-brand { left: 18px; top: 18px; }
  .auth-page, .verification-page { padding: 84px 14px 30px; place-items: start center; }
  .verification-card { padding: 22px; }
  .recovery-start { grid-template-columns: 1fr; }
  .job-list article, .guild-list article, .grant-list article { flex-wrap: wrap; }
  .job-actions { width: 100%; }
  .job-actions .button { flex: 1; }
  .panel-head.responsive { align-items: stretch; flex-direction: column; }
  .search-form { width: 100%; }
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legal-document { margin-top: 45px; }
  .legal-document h1 { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

.boot-error-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.boot-error-card { width: min(560px, 100%); padding: 28px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.boot-error-card h1 { margin: 0 0 10px; font-size: 24px; letter-spacing: -.03em; }
.boot-error-card p { margin: 0 0 14px; color: var(--muted); }
.boot-error-card code { display: block; margin: 0 0 18px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 7px; background: #0c0e13; color: #f3949c; overflow-wrap: anywhere; }
