/* NAVCOM portal styles — cyan / navy sci-fi theme */

:root {
    --bg-deep: #0a1420;
    --bg: #0d1b2a;
    --bg-panel: #1b263b;
    --bg-panel-2: #152033;
    --bg-elevated: #243447;
    --border: #415a77;
    --border-soft: rgba(65, 90, 119, 0.55);
    --cyan: #00b4d8;
    --cyan-soft: #90e0ef;
    --cyan-dim: rgba(0, 180, 216, 0.15);
    --text: #e0e1dd;
    --text-muted: #9aa6b2;
    --success: #2a9d8f;
    --success-soft: #48c9b0;
    --danger: #e63946;
    --danger-soft: #f76c6c;
    --warn: #e9c46a;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
    --glow: 0 0 20px rgba(0, 180, 216, 0.18);
    --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
    --mono: "Share Tech Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
    --max: 1100px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

.sandbox-banner {
    background: #e9c46a;
    color: #0a1420;
    text-align: center;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.55rem 1rem;
    margin: -20px -20px 16px;
}

body {
    font-family: var(--font);
    background:
        radial-gradient(1200px 500px at 10% -10%, rgba(0, 180, 216, 0.12), transparent 55%),
        radial-gradient(900px 400px at 100% 0%, rgba(42, 157, 143, 0.08), transparent 50%),
        var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

/* Subtle sci-fi grain (kept from original theme) */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url('https://cdn.robertsspaceindustries.com/static/images/noisebg.gif') repeat;
    opacity: 0.04;
    pointer-events: none;
    z-index: -1;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
    color: var(--cyan);
    margin-bottom: 0.6rem;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: 0.01em;
}

h1 { font-size: clamp(1.75rem, 2.5vw, 2.25rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }

p { margin-bottom: 0.85rem; }

.mono {
    font-family: var(--mono);
    letter-spacing: 0.02em;
}

.eyebrow {
    color: var(--cyan-soft);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.hint {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ---------- Header / nav ---------- */
.site-header {
    max-width: var(--max);
    margin: 0 auto 1.25rem;
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.85rem 1.1rem;
    background: linear-gradient(180deg, rgba(27, 38, 59, 0.98), rgba(21, 32, 51, 0.98));
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--glow), var(--shadow);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.brand:hover { text-decoration: none; }

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    background: #050b12;
    border: 1px solid rgba(0, 180, 216, 0.35);
    box-shadow: 0 0 16px rgba(0, 180, 216, 0.45);
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-name {
    color: var(--cyan);
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: 0.04em;
}

.brand-tagline {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.site-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
}

.site-nav a {
    display: inline-block;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    transition: background 0.2s, color 0.2s;
}

.site-nav a:hover {
    background: var(--cyan-dim);
    color: var(--cyan-soft);
    text-decoration: none;
}

.site-nav a.nav-cta {
    background: var(--cyan);
    color: var(--bg-deep);
}

.site-nav a.nav-cta:hover {
    background: var(--cyan-soft);
    color: var(--bg-deep);
}

.site-nav a.nav-muted {
    color: var(--text-muted);
}

/* Legacy bare header/nav (older templates) */
header:not(.site-header) {
    text-align: center;
    padding: 1.25rem;
    background: var(--bg-panel);
    border-radius: var(--radius);
    border: 1px solid var(--border-soft);
    box-shadow: var(--glow);
    margin: 0 auto 1rem;
    max-width: var(--max);
}

nav:not(.site-nav) {
    background: var(--border);
    padding: 0.65rem;
    border-radius: var(--radius-sm);
    margin: 0 auto 1.25rem;
    max-width: var(--max);
}

nav:not(.site-nav) ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin: 0;
}

nav:not(.site-nav) a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

nav:not(.site-nav) a:hover {
    color: var(--cyan);
}

/* ---------- Layout ---------- */
main,
.page {
    max-width: var(--max);
    margin: 0 auto;
}

.page {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.25rem 0.15rem 0.5rem;
}

.page-title {
    margin-bottom: 0.25rem;
    color: var(--cyan);
}

.page-subtitle {
    color: var(--text-muted);
    margin: 0;
}

.page-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.count-pill {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    background: var(--cyan-dim);
    border: 1px solid rgba(0, 180, 216, 0.35);
    color: var(--cyan-soft);
    font-size: 0.8rem;
    font-weight: 700;
}

section,
.panel {
    background: linear-gradient(180deg, rgba(27, 38, 59, 0.96), rgba(21, 32, 51, 0.96));
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 1.25rem 1.35rem;
    margin-bottom: 0;
    box-shadow: var(--shadow);
}

.panel-compact {
    padding: 1.1rem 1.25rem;
}

.panel-head {
    margin-bottom: 1rem;
}

.panel-head-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.panel-title {
    margin-bottom: 0.25rem;
}

.panel-desc {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.95rem;
}

/* ---------- Status / checklist cards (dashboard) ---------- */
.status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.status-card {
    background: rgba(13, 27, 42, 0.55);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-height: 100%;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.status-card:hover {
    border-color: rgba(0, 180, 216, 0.45);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.status-card.is-complete {
    border-color: rgba(42, 157, 143, 0.45);
}

.status-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.status-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
    background: var(--cyan-dim);
    color: var(--cyan-soft);
    border: 1px solid rgba(0, 180, 216, 0.35);
}

.status-card.is-complete .status-icon {
    background: rgba(42, 157, 143, 0.2);
    border-color: rgba(42, 157, 143, 0.5);
    color: var(--success-soft);
}

.status-card h3 {
    margin: 0;
    color: var(--text);
    font-size: 1.05rem;
}

.status-card p {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin: 0;
    flex: 1;
}

.status-card-actions {
    margin-top: 0.35rem;
}

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    border: 1px solid transparent;
}

.badge-success {
    background: rgba(42, 157, 143, 0.2);
    color: var(--success-soft);
    border-color: rgba(42, 157, 143, 0.45);
}

.badge-warn {
    background: rgba(233, 196, 106, 0.15);
    color: var(--warn);
    border-color: rgba(233, 196, 106, 0.4);
}

.badge-muted {
    background: rgba(65, 90, 119, 0.35);
    color: var(--text-muted);
    border-color: var(--border-soft);
}

.consent-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 720px) {
    .consent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.consent-check {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-right: 0.75rem;
    color: var(--text);
    font-size: 0.92rem;
}
.consent-check input { accent-color: var(--cyan); }

/* Compact NAVCOM-ID consent dialog (fits one screen, no page scroll) */
.consent-body {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.consent-dialog {
    width: min(520px, 100%);
    max-height: calc(100dvh - 24px);
    overflow: hidden;
    background: linear-gradient(180deg, rgba(27, 38, 59, 0.98), rgba(21, 32, 51, 0.98));
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--glow), var(--shadow);
    padding: 1rem 1.1rem 0.95rem;
}
.consent-dialog-head {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    margin-bottom: 0.65rem;
}
.consent-dialog-head .consent-brand {
    width: 48px;
    height: 48px;
    border-radius: 12px;
}
.consent-dialog-head .consent-brand img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.consent-dialog-head h1 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--text);
}
.consent-dialog-head .eyebrow { margin-bottom: 0.1rem; }
.consent-signed-in {
    margin: 0.15rem 0 0;
    color: var(--text-muted);
    font-size: 0.82rem;
}
.consent-app-reason {
    margin: 0 0 0.65rem;
    padding: 0.45rem 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 180, 216, 0.28);
    background: var(--cyan-dim);
    color: var(--text);
    font-size: 0.84rem;
}
.consent-dialog .alert {
    margin-bottom: 0.55rem;
    padding: 0.45rem 0.6rem;
    font-size: 0.82rem;
}
.consent-form { margin: 0; }
.consent-list {
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.consent-row label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: rgba(13, 27, 42, 0.45);
    cursor: pointer;
}
.consent-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    border-radius: 3px;
    cursor: pointer;
    accent-color: var(--cyan);
    flex-shrink: 0;
}
.consent-copy {
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
    min-width: 0;
}
.consent-label {
    color: var(--text);
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
}
.consent-why, .consent-rp-why {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.3;
}
.consent-rp-why { color: var(--cyan-soft); }
.consent-copy a { font-size: 0.78rem; font-weight: 700; }
.consent-row.is-blocked label,
.consent-row.is-disabled label {
    opacity: 0.85;
}
.consent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: flex-start;
}
.consent-actions .button { padding: 0.4rem 0.85rem; font-size: 0.9rem; }

@media (max-height: 700px) {
    .consent-dialog { padding: 0.75rem 0.85rem; }
    .consent-why { display: none; }
    .consent-row label { padding: 0.3rem 0.45rem; }
}

/* ---------- Quick links ---------- */
.quick-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.quick-link {
    display: block;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    background: rgba(13, 27, 42, 0.45);
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.quick-link:hover {
    border-color: rgba(0, 180, 216, 0.5);
    background: var(--cyan-dim);
    text-decoration: none;
    transform: translateY(-1px);
}

.quick-link-title {
    display: block;
    color: var(--cyan-soft);
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.quick-link-desc {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ---------- Guild grid (manage-servers) ---------- */
.guild-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.guild-card {
    background: rgba(13, 27, 42, 0.55);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.guild-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.guild-card.is-installed {
    border-color: rgba(42, 157, 143, 0.4);
}

.guild-card.is-missing {
    border-color: rgba(233, 196, 106, 0.28);
}

.guild-card-head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.guild-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--bg-deep);
    background: linear-gradient(145deg, var(--cyan), #0077a8);
    box-shadow: 0 0 12px rgba(0, 180, 216, 0.35);
}

.guild-meta {
    flex: 1;
    min-width: 0;
}

.guild-name {
    margin: 0 0 0.15rem;
    color: var(--text);
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.guild-id {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.guild-copy {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    flex: 1;
}

.guild-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Legacy class names still referenced in older markup */
.guild-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.guild-item {
    background: rgba(13, 27, 42, 0.55);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 1.1rem;
}

/* ---------- Empty state ---------- */
.empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
}

.empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--cyan);
    background: var(--cyan-dim);
    border: 1px solid rgba(0, 180, 216, 0.35);
}

.empty-state h2 {
    color: var(--text);
}

.empty-state p {
    max-width: 36rem;
    margin: 0.5rem auto 1.25rem;
    color: var(--text-muted);
}

.empty-actions {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

/* ---------- Links & buttons ---------- */
a {
    color: var(--cyan-soft);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.button,
a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 1rem;
    background: linear-gradient(180deg, #12c2e0, var(--cyan));
    color: var(--bg-deep);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.92rem;
    border: none;
    cursor: pointer;
    transition: transform 0.15s, filter 0.15s, background 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(0, 180, 216, 0.25);
}

.button:hover,
a.button:hover {
    filter: brightness(1.08);
    text-decoration: none;
    transform: translateY(-1px);
}

.button-green,
a.button-green {
    background: linear-gradient(180deg, #3dbda8, var(--success));
    box-shadow: 0 4px 14px rgba(42, 157, 143, 0.28);
}

.button-blue,
a.button-blue {
    background: linear-gradient(180deg, #12c2e0, var(--cyan));
}

.button-red,
a.button-red {
    background: linear-gradient(180deg, #f25563, var(--danger));
    color: #fff;
    box-shadow: 0 4px 14px rgba(230, 57, 70, 0.28);
}

.button-ghost,
a.button-ghost {
    background: transparent;
    color: var(--cyan-soft);
    border: 1px solid var(--border);
    box-shadow: none;
}

.button-ghost:hover,
a.button-ghost:hover {
    background: var(--cyan-dim);
    border-color: rgba(0, 180, 216, 0.5);
    filter: none;
}

button {
    padding: 0.55rem 1rem;
    background: linear-gradient(180deg, #12c2e0, var(--cyan));
    border: none;
    color: var(--bg-deep);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.2s, transform 0.15s;
}

button:hover {
    filter: brightness(1.08);
}

button[type="submit"] {
    padding: 0.55rem 1rem;
    background: linear-gradient(180deg, #12c2e0, var(--cyan));
    border: none;
    color: var(--bg-deep);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-weight: 700;
    cursor: pointer;
}

button[type="submit"]:hover {
    filter: brightness(1.08);
}

/* ---------- Lists ---------- */
ul {
    margin-left: 1.25rem;
}

li {
    margin-bottom: 0.5rem;
}

/* ---------- Footer ---------- */
.site-footer,
footer {
    max-width: var(--max);
    margin: 1.75rem auto 0;
    text-align: center;
    padding: 1rem 1.1rem;
    background: rgba(27, 38, 59, 0.85);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    color: var(--text-muted);
}

.site-footer-inner {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    justify-content: center;
}

.footer-links a {
    color: var(--cyan-soft);
    font-weight: 600;
    font-size: 0.9rem;
}

.footer-copy {
    margin: 0;
    font-size: 0.85rem;
}

/* ---------- Alerts ---------- */
.alert {
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.25rem;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(42, 157, 143, 0.22);
    border-color: rgba(72, 201, 176, 0.55);
    color: var(--text);
}

.alert-warning {
    background: rgba(230, 57, 70, 0.18);
    border-color: rgba(247, 108, 108, 0.55);
    color: var(--text);
}

.alert-info {
    background: rgba(65, 90, 119, 0.4);
    border-color: rgba(0, 180, 216, 0.45);
    color: var(--text);
}

.auth-links {
    margin-top: 1rem;
}

.register-preferred {
    padding: 1rem 1.15rem;
    background: var(--cyan-dim);
    border: 1px solid rgba(0, 180, 216, 0.35);
    border-radius: var(--radius);
    box-shadow: var(--glow);
}

.register-preferred h3 {
    margin: 0.15rem 0 0.4rem;
}

.captcha-wrap {
    margin: 0.75rem 0;
}
.captcha-wrap altcha-widget {
    display: block;
}

.resend-box {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-soft);
}

.resend-box h3 {
    margin-bottom: 0.5rem;
}

/* ---------- Code ---------- */
.endpoint {
    margin-bottom: 1.5rem;
}

code, pre {
    background: var(--bg-deep);
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    color: var(--cyan-soft);
    font-family: var(--mono);
}

pre {
    padding: 0.9rem;
    overflow-x: auto;
    white-space: pre-wrap;
    border-left: 4px solid var(--cyan);
}

/* ---------- Tables ---------- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.85rem;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

th, td {
    padding: 0.75rem 0.9rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--cyan);
    color: var(--bg-deep);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.8rem;
}

td {
    color: var(--text);
}

tr:nth-child(even) {
    background: rgba(65, 90, 119, 0.15);
}

tr:hover {
    background: rgba(0, 180, 216, 0.08);
}

td img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    vertical-align: middle;
}

/* ---------- Forms ---------- */
.config-form {
    background: rgba(13, 27, 42, 0.35);
    padding: 1.15rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-soft);
    box-shadow: none;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    color: var(--text);
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    color: var(--text);
    font-weight: 600;
}

.checkbox-label input {
    margin-right: 0.5rem;
}

.scope-picker {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    margin: 1rem 0;
}
.scope-picker legend {
    font-weight: 700;
    color: var(--cyan-soft);
}
.scope-row {
    display: grid;
    grid-template-columns: 1.2rem 1fr;
    gap: 0.65rem;
    align-items: start;
    margin: 0.75rem 0;
}
.scope-row textarea {
    width: 100%;
    margin-top: 0.35rem;
}

.ticket-close {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.staff-bot-table th,
.staff-bot-table td {
    white-space: nowrap;
}
.staff-bot-table td:first-child,
.staff-bot-table th:first-child {
    white-space: normal;
}
.staff-bot-table th.sortable {
    cursor: pointer;
    user-select: none;
}
.staff-bot-table th.sortable:hover,
.staff-bot-table th.sortable:focus {
    color: var(--cyan-soft);
    outline: none;
}
.staff-bot-table th.sortable::after {
    content: " ↕";
    font-size: 0.75em;
    color: var(--text-muted);
    font-weight: 400;
}
.staff-bot-table th.sortable.is-asc::after {
    content: " ▲";
    color: var(--cyan);
}
.staff-bot-table th.sortable.is-desc::after {
    content: " ▼";
    color: var(--cyan);
}

select {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.65rem;
    width: 100%;
    font-family: var(--font);
    font-size: 1em;
    transition: border-color 0.2s, box-shadow 0.2s;
}

select:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.18);
}

select option {
    background: var(--bg-panel);
    color: var(--text);
}

select option[disabled].used-option {
    color: #6b7280;
    opacity: 0.6;
    font-style: italic;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="url"],
input[type="search"],
input.otp-input,
.config-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]) {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.7rem;
    width: 100%;
    font-family: var(--font);
    font-size: 1em;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input.otp-input:focus,
.config-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.18);
}

/* Account security — stepped email / OTP UI */
.account-step {
    padding: 1rem 1.1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    background: rgba(13, 27, 42, 0.4);
}
.account-step-active {
    border-color: rgba(0, 180, 216, 0.45);
    box-shadow: 0 0 0 1px rgba(0, 180, 216, 0.12);
}
.account-step-merge {
    border-color: rgba(247, 108, 108, 0.45);
}
.account-step-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
}
.account-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 999px;
    background: rgba(0, 180, 216, 0.18);
    color: var(--cyan-soft);
    font-size: 0.85rem;
    font-weight: 700;
    flex: 0 0 auto;
}
.account-step-merge .account-step-num {
    background: rgba(230, 57, 70, 0.2);
    color: #f76c6c;
}
.account-step-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
input.otp-input {
    letter-spacing: 0.28em;
    font-size: 1.15rem !important;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    max-width: 12rem;
    text-align: center;
}
.account-inline-form {
    margin: 0;
}
.account-inline-form .form-group:last-of-type {
    margin-bottom: 0.85rem;
}
.otp-code-display {
    font-size: 1.5rem;
    letter-spacing: 0.14em;
    margin: 0.75rem 0 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-deep);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    display: inline-block;
}
.otp-code-display code {
    font-size: inherit;
    background: transparent;
    padding: 0;
}
.rsi-steps {
    margin: 0.5rem 0 1rem 1.2rem;
    color: var(--text-muted);
    line-height: 1.55;
}
.rsi-steps li {
    margin-bottom: 0.4rem;
}
.panel form label {
    display: block;
    margin: 0.75rem 0;
    color: var(--text-muted);
}

textarea {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.7rem;
    width: 100%;
    font-family: var(--font);
    font-size: 1em;
    transition: border-color 0.2s, box-shadow 0.2s;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.18);
}

input[type="checkbox"] {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    cursor: pointer;
    accent-color: var(--cyan);
}

/* ---------- Search ---------- */
.page-search,
#search-form {
    padding: 0.75rem;
    background: var(--bg-panel);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    border: 1px solid var(--border-soft);
}

#search-query {
    padding: 0.55rem 0.7rem;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    width: 300px;
    font-family: var(--font);
    font-size: 1em;
}

#search-query:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.18);
}

/* ---------- Manage guild polish (shared) ---------- */
main > section > h1 {
    margin-bottom: 0.75rem;
}

/* ---------- Settings tabs (manage guild) ---------- */
.settings-panel {
    padding: 0;
    overflow: visible;
}

.config-form-tabs {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.65rem 0.75rem;
    background: rgba(13, 27, 42, 0.65);
    border-bottom: 1px solid var(--border-soft);
}

.account-tabs {
    margin: 0 0 1rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
}

.settings-tab {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font);
    font-weight: 700;
    font-size: 0.88rem;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.settings-tab:hover {
    filter: none;
    background: var(--cyan-dim);
    color: var(--cyan-soft);
}

.settings-tab.is-active {
    background: var(--cyan-dim);
    color: var(--cyan-soft);
    border-color: rgba(0, 180, 216, 0.45);
    box-shadow: 0 0 12px rgba(0, 180, 216, 0.12);
}

.settings-pane {
    display: none;
    padding: 1.25rem 1.35rem 0.5rem;
    animation: paneIn 0.18s ease;
}

.settings-pane.is-active {
    display: block;
}

@keyframes paneIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.pane-intro {
    margin-bottom: 1.15rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--border-soft);
}

.pane-intro h2 {
    margin-bottom: 0.3rem;
}

.pane-intro p {
    margin: 0;
    color: var(--text-muted);
}

.field-help {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.help-list {
    margin: 0 0 0.75rem 1.1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.help-list li {
    margin-bottom: 0.25rem;
}

.callout {
    background: rgba(0, 180, 216, 0.08);
    border: 1px solid rgba(0, 180, 216, 0.25);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.callout p {
    margin-bottom: 0.35rem;
}

.mb-0 { margin-bottom: 0 !important; }

.option-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0.5rem 0 1rem;
}

.option-cards-log {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.option-card {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    background: rgba(13, 27, 42, 0.45);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.option-card:hover {
    border-color: rgba(0, 180, 216, 0.45);
    background: var(--cyan-dim);
}

.option-card input[type="checkbox"] {
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.option-card-title {
    display: block;
    color: var(--text);
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.option-card-desc {
    display: block;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 500;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    margin-bottom: 0.85rem;
}

.table-wrap table {
    margin: 0;
    border: none;
    border-radius: 0;
}

.pane-toolbar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.settings-footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    flex-wrap: nowrap;
    padding: 1rem 1.35rem 1.25rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border-soft);
    background: rgba(13, 27, 42, 0.35);
}

.settings-footer .hint {
    margin: 0;
    flex: 1 1 auto;
}

.settings-footer-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    width: 100%;
}

/* Form feedback + validation highlighting */
.form-feedback {
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    margin-bottom: 0.25rem;
}

.form-feedback p {
    margin: 0.35rem 0 0;
}

.form-feedback-error {
    background: rgba(230, 57, 70, 0.16);
    border-color: rgba(247, 108, 108, 0.55);
    color: var(--text);
}

.form-feedback-success {
    background: rgba(42, 157, 143, 0.18);
    border-color: rgba(72, 201, 176, 0.5);
}

/* Footer slot sits above the bottom Save button */
.form-feedback-footer {
    margin: 0;
    width: 100%;
}

.feedback-hints {
    margin: 0.5rem 0 0 1.1rem;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.feedback-actions {
    margin-top: 0.65rem !important;
}

.field-hint {
    margin-top: 0.45rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.field-hint-warn {
    color: var(--warn);
}

.field-hint-ok {
    color: var(--success-soft);
}

select.is-invalid,
input.is-invalid,
textarea.is-invalid,
.has-error select,
.has-error input {
    border-color: var(--danger-soft) !important;
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.18) !important;
}

.settings-tab.tab-error {
    color: var(--danger-soft);
    border-color: rgba(230, 57, 70, 0.55);
    background: rgba(230, 57, 70, 0.12);
}

#orgMappingsTable.ranks-disabled select[name^="rank_"] {
    opacity: 0.45;
    cursor: not-allowed;
}

#orgMappingsTable thead th.col-disabled {
    opacity: 0.45;
    text-decoration: line-through;
}

@media (max-width: 700px) {
    .option-cards {
        grid-template-columns: 1fr;
    }

    .settings-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .settings-tab {
        flex: 0 0 auto;
    }

    .settings-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .settings-footer .button {
        width: 100%;
    }
}

/* ---------- Marketing home ---------- */
.marketing {
    gap: 1.1rem;
}

.hero {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1.25rem;
    align-items: stretch;
}

.hero-card {
    background: linear-gradient(145deg, rgba(27, 38, 59, 0.98), rgba(13, 27, 42, 0.95));
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 1.75rem 1.6rem;
    box-shadow: var(--glow), var(--shadow);
}

.hero-card h1 { margin-bottom: 0.75rem; }
.hero-card h2 { color: var(--cyan); margin-bottom: 0.75rem; }

.hero-lead {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    max-width: 38rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid var(--border-soft);
    background: rgba(13, 27, 42, 0.55);
    color: var(--text-muted);
}
.pill-cyan {
    border-color: rgba(0, 180, 216, 0.4);
    color: var(--cyan-soft);
    background: var(--cyan-dim);
}
.pill-green {
    border-color: rgba(42, 157, 143, 0.45);
    color: var(--success-soft);
    background: rgba(42, 157, 143, 0.15);
}

.plain-list {
    margin: 0 0 1rem 1.15rem;
}
.plain-list li {
    color: var(--text-muted);
    margin-bottom: 0.45rem;
}
.plain-list li strong { color: var(--text); }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.feature-card {
    background: rgba(13, 27, 42, 0.5);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 1.15rem;
    transition: border-color 0.2s, transform 0.2s;
}
.feature-card:hover {
    border-color: rgba(0, 180, 216, 0.45);
    transform: translateY(-2px);
}
.feature-card h3 {
    color: var(--text);
    margin-bottom: 0.4rem;
}
.feature-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}
.feature-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cyan-dim);
    border: 1px solid rgba(0, 180, 216, 0.35);
    color: var(--cyan-soft);
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    counter-reset: step;
}
.step {
    background: rgba(13, 27, 42, 0.5);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 1.1rem;
}
.step::before {
    counter-increment: step;
    content: counter(step);
    display: inline-flex;
    width: 1.75rem;
    height: 1.75rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--cyan);
    color: var(--bg-deep);
    font-weight: 800;
    font-size: 0.9rem;
    margin-bottom: 0.65rem;
}
.step h3 { color: var(--text); font-size: 1.05rem; }
.step p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }

.notice {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(233, 196, 106, 0.4);
    background: rgba(233, 196, 106, 0.1);
    color: var(--text-muted);
    font-size: 0.92rem;
}
.notice strong { color: var(--warn); }

.cmd {
    background: rgba(13, 27, 42, 0.55);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1rem;
    margin-bottom: 0.75rem;
}
.cmd h4 {
    color: var(--cyan-soft);
    font-family: var(--mono);
    font-size: 0.98rem;
    margin-bottom: 0.35rem;
}
.cmd p { margin-bottom: 0.35rem; font-size: 0.92rem; color: var(--text-muted); }
.cmd p:last-child { margin-bottom: 0; }
.cmd .perm {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    margin-bottom: 0.4rem;
    background: rgba(65, 90, 119, 0.4);
    color: var(--text-muted);
    border: 1px solid var(--border-soft);
}
.cmd .perm-admin {
    background: rgba(230, 57, 70, 0.12);
    border-color: rgba(230, 57, 70, 0.35);
    color: #f76c6c;
}
.cmd .perm-all {
    background: rgba(42, 157, 143, 0.12);
    border-color: rgba(42, 157, 143, 0.35);
    color: var(--success-soft);
}

/* ---------- Docs page ---------- */
.docs-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1.25rem;
    align-items: start;
    max-width: 1200px;
}

.docs-toc {
    position: sticky;
    top: 1rem;
    background: linear-gradient(180deg, rgba(27, 38, 59, 0.96), rgba(21, 32, 51, 0.96));
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}
.docs-toc h2 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.65rem;
}
.docs-toc ul { list-style: none; margin: 0; }
.docs-toc li { margin-bottom: 0.25rem; }
.docs-toc a {
    display: block;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
}
.docs-toc a:hover {
    background: var(--cyan-dim);
    color: var(--cyan-soft);
    text-decoration: none;
}
.docs-toc .toc-sub { padding-left: 0.75rem; }
.docs-toc .toc-sub a { font-weight: 500; font-size: 0.82rem; }

.docs-content {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    min-width: 0;
}
.docs-content section {
    scroll-margin-top: 1rem;
}
.docs-content h2 {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 0.85rem;
}

.howto {
    border-left: 3px solid var(--cyan);
    padding: 0.25rem 0 0.25rem 1rem;
    margin: 0.75rem 0 1.1rem;
}
.howto h4 { color: var(--text); margin-bottom: 0.5rem; }
.howto ol { color: var(--text-muted); margin-left: 1.15rem; }

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.col-card {
    background: rgba(13, 27, 42, 0.45);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1rem;
}
.col-card h4 {
    color: var(--cyan-soft);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}
.col-card p,
.col-card ol {
    color: var(--text-muted);
    font-size: 0.92rem;
}
.col-card ol { margin-left: 1.1rem; }

table.docs-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0 1rem;
    font-size: 0.9rem;
}
table.docs-table th,
table.docs-table td {
    text-align: left;
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: top;
    white-space: normal;
}
table.docs-table th {
    background: rgba(0, 180, 216, 0.15);
    color: var(--cyan-soft);
    font-weight: 700;
}
table.docs-table td { color: var(--text-muted); }
table.docs-table td strong { color: var(--text); }

/* Staff accounts: dense rows, table fits the fluid pane */
.staff-accounts-panel {
    padding: 0.7rem 0.85rem;
}
.staff-accounts-search {
    display: flex;
    align-items: flex-end;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}
.staff-accounts-search label {
    flex: 1 1 16rem;
    margin: 0;
}
.staff-accounts-search input[type="search"] {
    width: 100%;
    padding: 0.28rem 0.5rem;
    font-size: 0.88rem;
}
.staff-accounts-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0 0 0.4rem;
}
.staff-accounts-filters .chip {
    display: inline-block;
    padding: 0.12rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.2;
    border: 1px solid rgba(0, 180, 216, 0.35);
    border-radius: 999px;
    color: var(--cyan-soft);
    text-decoration: none;
    background: transparent;
}
.staff-accounts-filters .chip:hover {
    border-color: rgba(0, 180, 216, 0.7);
    color: var(--text);
}
.staff-accounts-filters .chip.is-on {
    background: rgba(0, 180, 216, 0.22);
    border-color: rgba(0, 180, 216, 0.75);
    color: var(--text);
}
.staff-accounts-meta,
.staff-accounts-pager {
    margin: 0.25rem 0 0.45rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.staff-accounts-wrap {
    overflow-x: hidden;
}
table.staff-accounts-table {
    table-layout: fixed;
    width: 100%;
    font-size: 0.78rem;
    line-height: 1.2;
    margin: 0;
}
table.staff-accounts-table th,
table.staff-accounts-table td {
    padding: 0.18rem 0.35rem;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
table.staff-accounts-table .col-id { width: 3.2rem; }
table.staff-accounts-table .col-ver { width: 2.6rem; }
table.staff-accounts-table .col-created { width: 6.4rem; }
table.staff-accounts-table .col-email { width: 22%; }
table.staff-accounts-table .col-actions {
    width: 11.5rem;
    white-space: nowrap;
}
table.staff-accounts-table .col-actions form {
    display: inline-block;
    margin: 0 0.15rem 0 0;
}
table.staff-accounts-table .muted {
    color: var(--text-muted);
    font-weight: 400;
}
.button-compact,
a.button-compact,
table.staff-accounts-table .button,
table.staff-accounts-table button[type="submit"] {
    padding: 0.12rem 0.42rem;
    font-size: 0.72rem;
    line-height: 1.15;
    box-shadow: none;
    transform: none;
}

code {
    font-family: var(--mono);
    background: var(--bg-deep);
    color: var(--cyan-soft);
    padding: 0.12rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ---------- Public identity card (#230) ---------- */
.id-card-page {
    max-width: 36rem;
    margin: 0 auto;
}
.id-card {
    background: linear-gradient(160deg, rgba(27, 38, 59, 0.98), rgba(13, 27, 42, 0.96));
    border: 1px solid rgba(0, 180, 216, 0.35);
    border-radius: var(--radius);
    padding: 1.35rem 1.4rem 1.15rem;
    box-shadow: var(--glow), var(--shadow);
    margin: 0 0 1.25rem;
}
.id-card-mark {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1rem;
}
.id-card-mark h2 {
    margin: 0;
    font-size: 1.35rem;
    color: var(--text);
}
.id-badge {
    margin-left: auto;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(42, 157, 143, 0.2);
    color: var(--success-soft);
    border: 1px solid rgba(42, 157, 143, 0.45);
}
.id-badge-muted {
    background: rgba(13, 27, 42, 0.6);
    color: var(--text-muted);
    border-color: var(--border-soft);
}
.id-card-meta {
    display: grid;
    gap: 0.75rem;
    margin: 0;
}
.id-card-meta dt {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
}
.id-card-meta dd {
    margin: 0;
    color: var(--text);
}
.id-org {
    display: inline-block;
    margin: 0 0.35rem 0.25rem 0;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(0, 180, 216, 0.3);
    font-size: 0.82rem;
    font-family: var(--mono);
}
.id-card-foot,
.id-card-share {
    margin: 0.9rem 0 0;
    font-size: 0.88rem;
    color: var(--text-muted);
    word-break: break-all;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .status-grid,
    .quick-links,
    .hero,
    .feature-grid,
    .steps,
    .docs-layout,
    .two-col {
        grid-template-columns: 1fr;
    }

    .docs-toc {
        position: static;
        max-height: none;
    }
}

@media (max-width: 600px) {
    body {
        padding: 12px;
    }

    .site-header-inner {
        align-items: flex-start;
    }

    .site-nav ul {
        width: 100%;
    }

    .page-header {
        align-items: flex-start;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    table.docs-table {
        white-space: normal;
    }

    /* Members + org mappings: stay real tables that wrap; do not force nowrap / block layout */
    table.members-table,
    .page.page-fluid .table-scroll table.members-table,
    table.org-mappings-table,
    .page.page-fluid .org-mappings-table {
        display: table;
        width: 100% !important;
        max-width: 100%;
        min-width: 0 !important;
        table-layout: fixed;
        white-space: normal;
        overflow-x: visible;
    }
    table.members-table th,
    table.members-table td,
    table.org-mappings-table th,
    table.org-mappings-table td {
        min-width: 0 !important;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    th, td {
        padding: 0.5rem 0.65rem;
        min-width: 110px;
    }
    table.members-table th,
    table.members-table td,
    table.org-mappings-table th,
    table.org-mappings-table td {
        min-width: 0 !important;
        padding: 0.35rem 0.25rem;
    }

    select,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    textarea {
        font-size: 0.95em;
    }

    .page-search,
    #search-form {
        flex-direction: column;
        align-items: stretch;
    }

    #search-query {
        width: 100%;
    }
}


/* Permission status */
.perm-missing { color: #f76c6c; font-weight: 700; }
.perm-ok { color: var(--success-soft); }
.pill-danger {
    border-color: rgba(230, 57, 70, 0.45);
    color: #f76c6c;
    background: rgba(230, 57, 70, 0.12);
}
.text-danger { color: #f76c6c; }
.tab-perm-warn {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(230, 57, 70, 0.4);
    background: rgba(230, 57, 70, 0.1);
    color: var(--text-muted);
    font-size: 0.9rem;
}
.tab-perm-warn strong { color: #f76c6c; }
.members-table { font-size: 0.88rem; }
.members-table td { vertical-align: top; }
.members-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.members-actions input[type="text"] { min-width: 8rem; max-width: 12rem; }
.org-chip,
.role-chip {
    display: inline-block;
    margin: 0.1rem 0.25rem 0.1rem 0;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: rgba(13,27,42,0.55);
    font-size: 0.78rem;
    color: var(--cyan-soft);
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
    vertical-align: top;
}
.org-chip.main { border-color: rgba(0,180,216,0.5); }
.role-chip {
    color: var(--text-muted);
    border-color: rgba(148, 163, 184, 0.35);
}
.chip-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    align-items: flex-start;
    max-width: 100%;
    min-width: 0;
}



/* ---------- Full-width manage layout ---------- */
/* Match header width on full-width manage pages */
body:has(.page-fluid) .site-header {
    max-width: none;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-left: clamp(0.75rem, 1.5vw, 1.5rem);
    padding-right: clamp(0.75rem, 1.5vw, 1.5rem);
    box-sizing: border-box;
}
body:has(.page-fluid) {
    /* clip (not hidden) so horizontal bleed is blocked without creating a scrollport that breaks sticky headers */
    overflow-x: clip;
}

/* Guild manage / wide tables need the full browser width */
.page.page-fluid,
main.page.page-fluid {
    max-width: none;
    width: 100%;
    padding-left: clamp(0.75rem, 1.5vw, 1.5rem);
    padding-right: clamp(0.75rem, 1.5vw, 1.5rem);
    box-sizing: border-box;
}

/* Settings panel / panes stay within the browser width.
   Use overflow-x: clip (not hidden/auto) so sticky thead can pin to the viewport. */
.page.page-fluid .settings-panel {
    overflow: visible;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.page.page-fluid .settings-pane {
    overflow-x: clip;
    overflow-y: visible;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

#membersContainer,
#bansContainer {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: visible;
}

/* Table frame: full available width, small visual edge, never wider than viewport */
.page.page-fluid .table-scroll {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    margin-inline: 0;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: rgba(13, 27, 42, 0.35);
    box-sizing: border-box;
}

/* Members: no scrollport wrapper — sticky headers pin to the window while the page scrolls */
.page.page-fluid .table-scroll.members-table-scroll {
    overflow: visible;
    border-radius: var(--radius-sm);
}

/* Default for other wide tables (org mappings): grow with content + scroll */
.page.page-fluid .table-scroll .docs-table,
.page.page-fluid .table-scroll .filter-table {
    width: max-content;
    min-width: 100%;
    margin: 0;
    border: none;
}

/* Members (and bans using members-table): fit browser width; wrap cell content */
.page.page-fluid .table-scroll .members-table,
.members-table.filter-table,
table.members-table {
    width: 100% !important;
    max-width: 100%;
    min-width: 0 !important;
    table-layout: fixed;
    margin: 0;
    border: none;
}

/* Members: readable columns; wrap long role/org lists so the table never blows out */
.members-table {
    font-size: 0.88rem;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    table-layout: fixed;
    /* first header row height is measured in JS for accurate dual-row sticky */
    --members-sticky-top1: 0px;
    --members-sticky-top2: 2.75rem;
}
.members-table th,
.members-table td {
    padding: 0.5rem 0.55rem;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    vertical-align: top;
    min-width: 0;
    max-width: 100%;
}

/* ── Sticky column headers + filter row (pin to top of viewport) ── */
.members-table thead tr:first-child th {
    position: sticky;
    top: var(--members-sticky-top1);
    z-index: 6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* solid so scrolling rows do not show through */
    background: #152033;
    background-clip: padding-box;
    box-shadow: inset 0 -1px 0 var(--border-soft);
}
.members-table thead tr.filter-row th {
    position: sticky;
    top: var(--members-sticky-top2);
    z-index: 5;
    white-space: normal;
    background: #0f1a28;
    background-clip: padding-box;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid var(--border-soft);
}
.members-table .filter-row .filter-input {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.members-table col.col-discord { width: 12%; }
.members-table col.col-verify { width: 8%; }
.members-table col.col-rsi { width: 10%; }
.members-table col.col-orgs { width: 12%; }
.members-table col.col-rank { width: 7%; }
.members-table col.col-roles { width: 18%; }
.members-table col.col-nick { width: 12%; }
.members-table col.col-actions { width: 21%; }

.members-table td.col-roles,
.members-table td.col-orgs,
.members-table th.col-roles,
.members-table th.col-orgs {
    white-space: normal;
}
.members-table td code {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-all;
    font-size: 0.8em;
}

.members-table td.members-actions,
.members-table th.col-actions {
    white-space: normal;
    min-width: 0;
}
.members-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    min-width: 0;
    max-width: 100%;
}
.members-actions input[type="text"] {
    min-width: 5rem;
    max-width: 100%;
    flex: 1 1 6rem;
}
.members-actions .button {
    flex: 0 1 auto;
}

/* Members row action feedback (kick / ban / revoke / recheck) */
.member-action-status {
    flex: 1 1 100%;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--cyan-soft);
    min-height: 1.25rem;
    line-height: 1.3;
}
.members-table tr.member-row-busy {
    background: rgba(0, 180, 216, 0.08);
    box-shadow: inset 3px 0 0 rgba(0, 180, 216, 0.65);
    animation: memberRowPulse 1.4s ease-in-out infinite;
}
.members-table tr.member-row-success {
    background: rgba(46, 204, 113, 0.1);
    box-shadow: inset 3px 0 0 rgba(46, 204, 113, 0.7);
    transition: background 0.4s ease, box-shadow 0.4s ease;
}
.members-table tr.member-row-error {
    background: rgba(230, 57, 70, 0.1);
    box-shadow: inset 3px 0 0 rgba(230, 57, 70, 0.7);
}
.member-row-spinner {
    display: inline-block;
    width: 0.85rem;
    height: 0.85rem;
    border: 2px solid rgba(0, 180, 216, 0.25);
    border-top-color: var(--cyan-soft, #00b4d8);
    border-radius: 50%;
    animation: memberSpin 0.7s linear infinite;
    flex: 0 0 auto;
}
@keyframes memberSpin {
    to { transform: rotate(360deg); }
}
@keyframes memberRowPulse {
    0%, 100% { background: rgba(0, 180, 216, 0.06); }
    50% { background: rgba(0, 180, 216, 0.14); }
}

/* Linked Roles /verify — first-impression flow */
.verify-body .verify-main {
    max-width: 42rem;
    margin: 0 auto 3rem;
}
.verify-hero {
    margin: 0 0 1.5rem;
    padding: 1.4rem 1.5rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-soft);
    background:
        linear-gradient(165deg, rgba(0, 180, 216, 0.1), transparent 42%),
        linear-gradient(180deg, rgba(27, 38, 59, 0.95), rgba(13, 27, 42, 0.92));
    box-shadow: var(--glow), var(--shadow);
    animation: verifyFade 0.55s ease both;
}
.verify-hero h1 {
    font-size: clamp(1.55rem, 3vw, 2rem);
    margin-bottom: 0.55rem;
}
.verify-lead {
    color: var(--text-muted);
    font-size: 1.02rem;
    max-width: 38rem;
}
.verify-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.35rem;
}
.verify-intro { margin-bottom: 1.1rem; }
.verify-alert { animation: verifyFade 0.4s ease both; }
.verify-card {
    padding: 1.15rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-soft);
    margin-bottom: 1.25rem;
}
.verify-card-success {
    border-color: rgba(42, 157, 143, 0.5);
    background: rgba(42, 157, 143, 0.1);
}
.verify-steps {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    display: grid;
    gap: 0.85rem;
}
.verify-step {
    padding: 1.05rem 1.15rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-soft);
    background: rgba(13, 27, 42, 0.55);
    opacity: 0.72;
    transform: translateY(6px);
}
.verify-step.is-active,
.verify-step.is-done {
    opacity: 1;
    transform: none;
    border-color: rgba(0, 180, 216, 0.4);
    box-shadow: 0 0 0 1px rgba(0, 180, 216, 0.1);
}
.verify-step h3 {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.65rem;
}
.verify-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 999px;
    background: rgba(0, 180, 216, 0.18);
    color: var(--cyan-soft);
    font-size: 0.85rem;
    font-weight: 700;
    flex: 0 0 auto;
}
.verify-code {
    display: block;
    width: 100%;
    overflow-wrap: anywhere;
    letter-spacing: 0.04em;
    font-size: 1.05rem;
}
.verify-spinner {
    display: none;
}
.verify-spinner[hidden] {
    display: none !important;
}
#verify-finish-btn {
    position: relative;
    overflow: hidden;
    min-width: 16.5rem;
    justify-content: center;
    transition: background 0.35s ease, box-shadow 0.35s ease, filter 0.35s ease;
}
#verify-finish-btn.is-checking {
    background: linear-gradient(180deg, #f0c14b, #c58a12);
    box-shadow: 0 4px 14px rgba(197, 138, 18, 0.35);
    color: #1a1408;
    cursor: wait;
    pointer-events: none;
}
#verify-finish-btn.is-complete {
    background: linear-gradient(180deg, #4fd1b8, var(--success));
    box-shadow: 0 0 0 0 rgba(42, 157, 143, 0.55);
    animation: verifyCompletePulse 2.4s ease-in-out infinite;
    pointer-events: none;
}
.verify-arrows {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}
.verify-arrows .arr {
    display: inline-block;
    opacity: 0.28;
    animation: verifyArrowIn 1.1s ease-in-out infinite;
}
.verify-arrows .arr-l { animation-name: verifyArrowL; }
.verify-arrows .arr-r { animation-name: verifyArrowR; }
.verify-arrows .arr:nth-child(1) { animation-delay: 0s; }
.verify-arrows .arr:nth-child(2) { animation-delay: 0.12s; }
.verify-arrows .arr:nth-child(3) { animation-delay: 0.24s; }
.verify-arrows .arr:nth-child(5) { animation-delay: 0.24s; }
.verify-arrows .arr:nth-child(6) { animation-delay: 0.12s; }
.verify-arrows .arr:nth-child(7) { animation-delay: 0s; }
@keyframes verifyArrowL {
    0%, 100% { opacity: 0.15; transform: translateX(-6px); }
    50% { opacity: 1; transform: translateX(2px); }
}
@keyframes verifyArrowR {
    0%, 100% { opacity: 0.15; transform: translateX(6px); }
    50% { opacity: 1; transform: translateX(-2px); }
}
@keyframes verifyCompletePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(42, 157, 143, 0.15), 0 4px 14px rgba(42, 157, 143, 0.28); filter: brightness(1); }
    50% { box-shadow: 0 0 0 8px rgba(42, 157, 143, 0.12), 0 4px 18px rgba(42, 157, 143, 0.45); filter: brightness(1.12); }
}
.verify-step-swap {
    animation: verifyFade 0.35s ease both;
}
#verify-finish-btn[disabled] {
    opacity: 0.95;
    cursor: wait;
}
@media (prefers-reduced-motion: reduce) {
    .verify-spinner { animation: none; }
    .verify-arrows .arr { animation: none; opacity: 0.7; transform: none; }
    #verify-finish-btn.is-complete { animation: none; }
}
.verify-details {
    margin: 1.5rem 0 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: rgba(13, 27, 42, 0.35);
    color: var(--text-muted);
}
.verify-details summary {
    cursor: pointer;
    color: var(--cyan-soft);
    font-weight: 600;
}
.verify-details[open] summary { margin-bottom: 0.65rem; }
.verify-anim {
    animation: verifyRise 0.5s ease both;
    animation-delay: var(--d, 0s);
}
@keyframes verifyFade {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes verifyRise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .verify-hero,
    .verify-anim,
    .verify-alert {
        animation: none !important;
    }
    .verify-step { transform: none; }
}

/* Sticky Actions column (right) — tbody; thead corners need higher z when both sticky */
.page.page-fluid .members-table tbody td.members-actions {
    position: sticky;
    right: 0;
    z-index: 2;
    background: var(--bg-panel);
    box-shadow: -6px 0 10px rgba(0, 0, 0, 0.25);
}
.page.page-fluid .members-table thead tr:first-child th.col-actions {
    position: sticky;
    top: var(--members-sticky-top1);
    right: 0;
    z-index: 8;
    background: #152033;
    box-shadow: -6px 0 10px rgba(0, 0, 0, 0.25), inset 0 -1px 0 var(--border-soft);
}
.page.page-fluid .members-table thead tr.filter-row th.col-actions {
    position: sticky;
    top: var(--members-sticky-top2);
    right: 0;
    z-index: 7;
    background: #0f1a28;
    box-shadow: -6px 0 10px rgba(0, 0, 0, 0.25), 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Org mappings: fit available width like members (no horizontal scrollbar) */
.page.page-fluid .org-mappings-table,
table.org-mappings-table {
    width: 100% !important;
    max-width: 100%;
    min-width: 0 !important;
    table-layout: fixed;
    margin: 0;
    border: none;
    font-size: 0.82rem;
}
.page.page-fluid .org-mappings-table select,
.page.page-fluid .org-mappings-table input[name="org_sid"],
.org-mappings-table select,
.org-mappings-table input[name="org_sid"] {
    max-width: 100%;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}
/* Clip horizontal overflow; multi-role dropdowns are position:fixed so not clipped */
.page.page-fluid .table-wrap:has(.org-mappings-table),
.table-wrap:has(.org-mappings-table) {
    overflow-x: clip;
    overflow-y: visible;
    max-width: 100%;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    padding-bottom: 0.75rem;
}
.page.page-fluid .settings-pane:has(#orgMappingsTable) {
    overflow: visible;
    min-width: 0;
    max-width: 100%;
    /* extra space under the table so bottom-row controls feel reachable */
    padding-bottom: 2.5rem;
}
#pane-orgs .pane-toolbar {
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

.org-mappings-table th,
.org-mappings-table td {
    min-width: 0 !important;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    vertical-align: top;
    padding: 0.4rem 0.3rem;
}
.org-mappings-table thead th {
    font-size: 0.75rem;
    line-height: 1.2;
    white-space: normal;
    hyphens: auto;
}
.org-mappings-table col.col-sid { width: 7.5%; }
.org-mappings-table col.col-aff { width: 9.5%; }
.org-mappings-table col.col-member { width: 11%; }
.org-mappings-table col.col-rank { width: 11%; }
.org-mappings-table col.col-actions { width: 3.5%; }

.org-mappings-table .org-sid-input {
    font-size: 0.78rem;
    padding: 0.3rem 0.35rem;
}
.org-mappings-table td.col-actions {
    text-align: center;
    vertical-align: middle;
}
.org-mappings-table td.col-actions .button {
    padding: 0.25rem 0.45rem !important;
    min-width: 1.75rem;
}

/* Multi-role checkbox dropdown (org / rank role mapping) */
.multi-role-select {
    position: relative;
    min-width: 9.5rem;
    max-width: 14rem;
    z-index: 1;
}
/* Inside org table: fill the fixed column, never force the table wider */
.org-mappings-table .multi-role-select {
    min-width: 0;
    max-width: 100%;
    width: 100%;
}
.org-mappings-table .multi-role-toggle {
    min-height: 2rem;
    padding: 0.28rem 0.4rem !important;
    font-size: 0.75rem;
}
.org-mappings-table .multi-role-summary {
    -webkit-line-clamp: 2;
    font-size: 0.75rem;
}
.multi-role-select:has(.multi-role-dropdown.is-open) {
    z-index: 50;
}
.multi-role-toggle {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    width: 100%;
    min-height: 2.25rem;
    padding: 0.35rem 0.55rem !important;
    text-align: left;
    font-weight: 600;
    font-size: 0.82rem;
    white-space: normal;
}
.multi-role-summary {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: var(--text);
    line-height: 1.25;
}
.multi-role-caret {
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 0.75rem;
}
/* Default: absolute under the button. When opened, JS switches to position:fixed
   clamped to the viewport (and may open upward near the bottom of the page). */
.multi-role-dropdown {
    position: absolute;
    z-index: 40;
    top: calc(100% + 0.25rem);
    left: 0;
    min-width: 14rem;
    max-width: min(20rem, calc(100vw - 1rem));
    max-height: 16rem;
    display: flex;
    flex-direction: column;
    background: var(--bg-panel-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow), 0 12px 32px rgba(0, 0, 0, 0.45);
    padding: 0.45rem;
}
.multi-role-dropdown.is-open {
    position: fixed;
    /* top/left/width/max-height set by JS */
}
.multi-role-dropdown[hidden] {
    display: none !important;
}
.multi-role-filter {
    margin-bottom: 0.35rem;
    flex: 0 0 auto;
}
.multi-role-options {
    overflow-y: auto;
    flex: 1 1 auto;
    max-height: 11rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-height: 0;
}
.multi-role-option {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    padding: 0.3rem 0.35rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text);
    margin: 0;
}
/* Author display:flex overrides the UA [hidden] rule — force hide for filter matches */
.multi-role-option[hidden],
.multi-role-option.is-filtered-out {
    display: none !important;
}
.multi-role-option:hover {
    background: rgba(0, 180, 216, 0.12);
}
.multi-role-option input[type="checkbox"] {
    margin-top: 0.15rem;
    flex: 0 0 auto;
    width: 1rem;
    height: 1rem;
    accent-color: var(--cyan);
}
.multi-role-option span {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.multi-role-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.35rem;
    margin-top: 0.4rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--border-soft);
    flex: 0 0 auto;
}
.multi-role-actions .button {
    padding: 0.3rem 0.55rem !important;
    font-size: 0.8rem !important;
}
.multi-role-empty {
    margin: 0.35rem;
    font-size: 0.85rem;
}
.org-mappings-table td {
    vertical-align: top;
}
.org-aff-cell {
    min-width: 0;
    max-width: 100%;
}
.org-split-label {
    display: flex;
    align-items: flex-start;
    gap: 0.3rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    cursor: pointer;
    margin: 0 0 0.3rem;
    line-height: 1.2;
}
.org-split-label span {
    min-width: 0;
    overflow-wrap: anywhere;
}
.org-split-label input {
    margin-top: 0.15rem;
    flex: 0 0 auto;
}
.org-aff-badge {
    display: inline-block;
    max-width: 100%;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    padding: 0.12rem 0.35rem;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: rgba(13, 27, 42, 0.55);
    color: var(--cyan-soft);
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.2;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.org-aff-badge[data-aff="main"] {
    border-color: rgba(0, 180, 216, 0.55);
    color: var(--cyan-soft);
}
.org-aff-badge[data-aff="affiliate"] {
    border-color: rgba(148, 163, 184, 0.45);
    color: var(--text-muted);
}
.org-aff-badge[data-aff="both"] {
    border-color: rgba(34, 197, 94, 0.4);
    color: #86efac;
}
.org-map-row[data-affiliation="affiliate"] .org-sid-input[readonly] {
    opacity: 0.75;
    cursor: not-allowed;
}

/* Filterable members/bans tables */
.table-scroll { overflow-x: auto; max-width: 100%; min-width: 0; box-sizing: border-box; }
.filter-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.filter-table th.sortable:hover { color: var(--cyan-soft); }
.filter-table .filter-row th { background: rgba(13, 27, 42, 0.65); vertical-align: top; font-weight: 500; }
/* Opaque sticky filter background must win over the translucent default above */
.members-table.filter-table thead tr.filter-row th {
    background: #0f1a28;
}
.filter-input {
    width: 100%;
    min-width: 5.5rem;
    margin: 0.15rem 0;
    padding: 0.35rem 0.45rem;
    font-size: 0.82rem;
    background: var(--bg-deep);
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    color: var(--text);
}
.filter-input:focus { outline: none; border-color: rgba(0, 180, 216, 0.55); }

/* Discord-style welcome preview + emoji picker (2026-07-29) */
.welcome-preview-wrap { margin-top: 1rem; }
.discord-mock {
  background: #313338;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #1e1f22;
  font-family: "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  max-width: 640px;
}
.discord-mock-header {
  background: #2b2d31;
  color: #f2f3f5;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #1e1f22;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.discord-mock-channel-hash { color: #80848e; font-weight: 500; }
.discord-mock-messages { padding: 0.75rem 0.5rem 1rem; }
.discord-message {
  display: flex;
  gap: 0.75rem;
  padding: 0.35rem 0.75rem;
}
.discord-message:hover { background: rgba(0,0,0,0.08); border-radius: 4px; }
.discord-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: #5865f2; color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 1rem;
}
.discord-message-body { min-width: 0; flex: 1; }
.discord-message-meta {
  display: flex; align-items: baseline; gap: 0.4rem; flex-wrap: wrap;
  margin-bottom: 0.15rem;
}
.discord-username { color: #f2f3f5; font-weight: 500; font-size: 1rem; }
.discord-bot-tag {
  background: #5865f2; color: #fff; font-size: 0.625rem; font-weight: 600;
  padding: 0.1rem 0.3rem; border-radius: 3px; text-transform: uppercase;
  letter-spacing: 0.02em; line-height: 1.3;
}
.discord-timestamp { color: #949ba4; font-size: 0.75rem; }
.discord-message-content, .welcome-preview {
  color: #dbdee1; font-size: 0.95rem; line-height: 1.375;
  word-wrap: break-word; white-space: normal;
}
.discord-message-content .d-line { margin: 0; }
.discord-message-content .d-blank { height: 0.35rem; }
.discord-message-content .d-heading { font-weight: 700; color: #f2f3f5; margin: 0.25rem 0; }
.discord-message-content .d-h1 { font-size: 1.5rem; }
.discord-message-content .d-h2 { font-size: 1.25rem; }
.discord-message-content .d-h3 { font-size: 1.1rem; }
.discord-message-content .d-blockquote {
  border-left: 4px solid #4e5058; padding: 0 0.5rem 0 0.75rem; margin: 0.25rem 0;
  color: #dbdee1;
}
.discord-message-content .d-list { margin: 0.25rem 0 0.25rem 1.25rem; padding: 0; }
.discord-message-content .d-list li { margin: 0.1rem 0; }
.discord-message-content .d-inline-code,
.discord-message-content code.d-inline-code {
  background: #1e1f22; color: #dbdee1; padding: 0.1rem 0.3rem;
  border-radius: 3px; font-family: Consolas, "Andale Mono WT", "Andale Mono", monospace;
  font-size: 0.85em;
}
.discord-message-content .d-codeblock {
  background: #1e1f22; border: 1px solid #1e1f22; border-radius: 4px;
  padding: 0.5rem; margin: 0.35rem 0; overflow-x: auto;
  font-family: Consolas, monospace; font-size: 0.85rem; color: #dbdee1;
  white-space: pre-wrap;
}
.discord-message-content .d-mention {
  background: rgba(88,101,242,0.3); color: #c9cdfb; border-radius: 3px;
  padding: 0 2px; font-weight: 500; cursor: pointer;
}
.discord-message-content .d-mention.d-everyone {
  background: rgba(250,168,26,0.15); color: #f0b132;
}
.discord-message-content .d-link { color: #00a8fc; text-decoration: none; }
.discord-message-content .d-link:hover { text-decoration: underline; }
.discord-message-content .d-spoiler {
  background: #1e1f22; color: transparent; border-radius: 3px; cursor: pointer;
  transition: color 0.1s, background 0.1s;
}
.discord-message-content .d-spoiler:hover,
.discord-message-content .d-spoiler:focus {
  color: #dbdee1; background: rgba(255,255,255,0.1);
}
.discord-message-content .d-empty { color: #949ba4; font-style: italic; }

.emoji-cell {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  width: max-content;
  max-width: 100%;
}
/* Single face shows selected emoji as an image (unicode via Twemoji CDN, custom via Discord CDN).
   Avoids Opera/Chromium font fallback that turns regional letters 🇦 into plain "A". */
.rr-emoji-face {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  padding: 0 !important;
  margin: 0;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: rgba(13, 27, 42, 0.75);
  cursor: pointer;
  line-height: 1;
  overflow: hidden;
}
.rr-emoji-face:hover:not(:disabled) {
  border-color: rgba(0, 180, 216, 0.55);
  background: rgba(0, 180, 216, 0.12);
}
.rr-emoji-face:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.rr-emoji-face img {
  width: 1.5rem;
  height: 1.5rem;
  display: block;
  object-fit: contain;
}
.rr-emoji-face.is-empty {
  color: var(--text-muted);
  font-size: 1.15rem;
  opacity: 0.9;
}
/* Hidden form value — still submitted as unicode or <:name:id> */
.emoji-cell input[name="rr_emoji"],
.emoji-cell input.rr-emoji-input,
#reactionRolesTable input[name="rr_emoji"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-width: 0 !important;
  max-width: none !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
#reactionRolesTable th:nth-child(2),
#reactionRolesTable td.emoji-cell {
  width: 1%;
  white-space: nowrap;
  position: relative;
}
.emoji-picker-btn {
  flex-shrink: 0;
  padding: 0.35rem 0.5rem !important;
  min-width: 2.25rem;
}

/* Security — blocked orgs: compact table, SID + X side by side */
.autoban-orgs-table,
#autobanOrgsTable.autoban-orgs-table {
  width: max-content;
  max-width: 100%;
  table-layout: auto;
  margin: 0;
}
.autoban-orgs-table th,
.autoban-orgs-table td {
  width: auto;
  white-space: nowrap;
  vertical-align: middle;
  padding-right: 0.5rem;
}
.autoban-org-row {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}
.autoban-org-sid-input,
#autobanOrgsTable input[name="autoban_org_sid"] {
  width: 25ch !important;
  min-width: 25ch !important;
  max-width: 25ch !important;
  flex: 0 0 25ch !important;
  font-family: var(--mono, ui-monospace, monospace);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0;
}
.autoban-org-remove {
  flex: 0 0 auto;
  margin: 0;
  min-width: 2.25rem;
  padding-left: 0.55rem !important;
  padding-right: 0.55rem !important;
}

/* Locked reaction-roles UI when bot lacks Add Reactions / Manage Roles */
#pane-reactions[data-reactions-locked="1"] #reactionsTableWrap,
#pane-reactions[data-reactions-locked="1"] #reactionsHelp {
  opacity: 0.55;
  pointer-events: none;
  filter: grayscale(0.25);
}
#pane-reactions[data-reactions-locked="1"] #addReactionRoleBtn {
  opacity: 0.5;
  cursor: not-allowed;
}
#pane-reactions input:disabled,
#pane-reactions select:disabled,
#pane-reactions button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.emoji-picker-popover {
  position: fixed; z-index: 10000;
  background: #2b2d31; color: #dbdee1;
  border: 1px solid #1e1f22; border-radius: 8px;
  padding: 0; max-width: 320px; width: 300px;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
}
.emoji-picker-inner { padding: 0.5rem 0.65rem 0.75rem; }
.emoji-picker-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.4rem; color: #f2f3f5;
}
.emoji-picker-x {
  background: transparent; border: none; color: #b5bac1;
  font-size: 1.35rem; cursor: pointer; line-height: 1; padding: 0 0.25rem;
}
.emoji-picker-x:hover { color: #fff; }
.emoji-section-label {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: #949ba4; margin: 0.4rem 0 0.25rem; font-weight: 600;
}
/* Legacy simple grid (non-discord picker only) — no nested scroll when inside discord picker */
.emoji-grid {
  display: flex; flex-wrap: wrap; gap: 0.25rem;
}
.emoji-pick {
  background: transparent; border: 1px solid transparent; border-radius: 6px;
  cursor: pointer; padding: 0.3rem; font-size: 1.25rem; line-height: 1;
  min-width: 2rem; min-height: 2rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.emoji-pick:hover { border-color: #5865f2; background: rgba(88,101,242,0.2); }
.emoji-pick img { display: block; }
.emoji-empty { font-size: 0.8rem; color: #949ba4; padding: 0.25rem; }

/* Per-type action log table */
.action-log-table th, .action-log-table td { vertical-align: middle; }
.action-log-table .al-enabled { width: 1.15rem; height: 1.15rem; }
.action-log-bulk label { display: block; font-size: 0.85rem; margin-bottom: 0.25rem; }


/* ── Discord-style emoji picker ───────────────────────────────── */
/* Single scrollbar: only .emoji-picker-body scrolls; grid grows naturally inside it. */
.discord-emoji-picker,
.emoji-picker-popover.discord-emoji-picker {
  position: fixed;
  z-index: 10000;
  width: 360px;
  max-width: min(360px, calc(100vw - 16px));
  height: min(420px, calc(100vh - 24px));
  max-height: min(420px, calc(100vh - 24px));
  background: #2b2d31;
  color: #dbdee1;
  border: 1px solid #1e1f22;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.55);
  display: flex;
  flex-direction: column;
  overflow-x: hidden; /* never horizontal on shell */
  overflow-y: hidden;
  box-sizing: border-box;
  font-family: "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.discord-emoji-picker[hidden] { display: none !important; }
.discord-emoji-picker .emoji-picker-inner {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0; /* allow body to shrink and scroll */
  height: 100%;
  max-height: none;
  padding: 0;
  overflow: hidden;
}
.discord-emoji-picker .emoji-picker-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem 0.4rem;
  border-bottom: 1px solid #1e1f22;
  flex-shrink: 0;
}
.emoji-search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #1e1f22;
  border-radius: 4px;
  padding: 0.35rem 0.55rem;
  min-width: 0;
}
.emoji-search-icon { font-size: 0.85rem; opacity: 0.7; }
.emoji-search-input {
  flex: 1;
  min-width: 0;
  border: none !important;
  background: transparent !important;
  color: #dbdee1 !important;
  font-size: 0.9rem;
  outline: none;
  padding: 0 !important;
  box-shadow: none !important;
}
.emoji-search-input::placeholder { color: #6d6f78; }
.emoji-picker-tabs {
  display: flex;
  gap: 0.15rem;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid #1e1f22;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  flex-shrink: 0;
}
.emoji-tab {
  background: transparent;
  border: none;
  border-radius: 4px;
  font-size: 1.15rem;
  line-height: 1;
  padding: 0.35rem 0.4rem;
  cursor: pointer;
  opacity: 0.65;
  flex-shrink: 0;
}
.emoji-tab:hover { background: rgba(255,255,255,0.06); opacity: 1; }
.emoji-tab.is-active {
  background: rgba(88,101,242,0.25);
  opacity: 1;
}
.emoji-picker-body {
  flex: 1 1 auto;
  min-height: 0; /* required for nested flex scroll */
  min-width: 0;
  overflow-x: hidden !important; /* never show horizontal scrollbar */
  overflow-y: auto;
  padding: 0.35rem 0.4rem 0.45rem;
  scrollbar-width: thin;
  scrollbar-gutter: stable; /* reserve space for vertical bar so grid never clips */
  box-sizing: border-box;
}
/* Grid fills body width; minmax(0,1fr) prevents 1fr tracks from overflowing */
.discord-emoji-picker .emoji-grid,
.discord-emoji-picker .emoji-grid-dense,
.emoji-grid-dense {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 2px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  max-height: none !important;
  overflow: visible !important;
  height: auto;
  box-sizing: border-box;
}
.discord-emoji-picker .emoji-pick {
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  padding: 0.15rem;
  font-size: 1.25rem;
  line-height: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  aspect-ratio: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  overflow: hidden;
}
.discord-emoji-picker .emoji-pick:hover {
  background: rgba(255,255,255,0.08);
}
.discord-emoji-picker .emoji-pick img {
  width: 24px;
  height: 24px;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.emoji-empty-state {
  color: #949ba4;
  font-size: 0.85rem;
  text-align: center;
  padding: 2rem 1rem;
}
.emoji-truncate-note {
  color: #949ba4;
  font-size: 0.75rem;
  text-align: center;
  padding: 0.5rem;
}
.emoji-picker-foot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  border-top: 1px solid #1e1f22;
  background: #232428;
  min-height: 2.25rem;
  flex-shrink: 0;
}
.emoji-foot-preview {
  font-size: 1.25rem;
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.emoji-foot-preview img { width: 22px; height: 22px; }
.emoji-foot-name {
  color: #dbdee1;
  font-size: 0.85rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* (reaction-role .emoji-cell rules live earlier; avoid conflicting overrides) */

.emoji-tab-guild-icon {
  width: 20px;
  height: 20px;
  border-radius: 30%;
  object-fit: cover;
  display: block;
}
.emoji-tab.emoji-tab-has-icon {
  padding: 0.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.emoji-tab.emoji-tab-letter {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f2f3f5;
  min-width: 1.75rem;
}


/* ---------- NAVCOM-ID Family portfolio (/apps) ---------- */
.family-hero .page-subtitle { max-width: 42rem; }
.family-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-top: 0.5rem;
}
@media (min-width: 720px) {
    .family-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.family-card {
    display: flex;
    gap: 1.15rem;
    align-items: flex-start;
    padding: 1.35rem 1.4rem;
    background: linear-gradient(165deg, rgba(13, 27, 42, 0.85), rgba(8, 18, 30, 0.92));
    border: 1px solid rgba(0, 180, 216, 0.18);
    border-radius: calc(var(--radius) + 4px);
    text-decoration: none;
    color: inherit;
    min-height: 100%;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
}
.family-card:hover {
    border-color: rgba(0, 180, 216, 0.55);
    transform: translateY(-3px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32);
}
.family-card-logo {
    flex: 0 0 auto;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 1rem;
    background: rgba(0, 180, 216, 0.08);
    border: 1px solid rgba(0, 180, 216, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.family-card-logo img {
    width: 3.35rem;
    height: 3.35rem;
    object-fit: contain;
}
.family-card-mark {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--cyan-soft);
}
.family-card-body { flex: 1; min-width: 0; }
.family-card-body h2 {
    margin: 0 0 0.45rem;
    font-size: 1.2rem;
    color: var(--text);
}
.family-card-body p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.45;
}
.family-card-cta {
    display: inline-block;
    margin-top: 0.85rem;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--cyan-soft);
}
