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

:root {
    --primary: #B03232;         /* Muted deep crimson — Howli's hair */
    --primary-dark: #8A2020;    /* Darker shade for hover/pressed */
    --secondary: #B89040;       /* Warm amber-gold — for enabled/success states */
    --danger: #D95030;          /* Orange-red — clearly distinct from crimson primary */
    /* Near-black with a very slight warm undertone — moody but readable */
    --bg-primary: #141112;
    --bg-secondary: #1c1819;
    --bg-tertiary: #252022;
    /* Warm off-white text — softer than pure white on near-black */
    --text-primary: #ece7e7;
    --text-secondary: #c2bbbb;
    --text-muted: #978e8e;
    /* Warm-tinted borders so form fields are visible */
    --border: #3a3132;
    /* Warm placeholder */
    --placeholder: #857878;
}

body {
    font-family: 'Exo 2', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Layout Wrapper for Sidebars */
.layout-wrapper {
    display: block;
}

/* Main Content */
.main-content {
    min-width: 0;
    padding: 0 160px;
}

/* Ad Sidebars - Fixed to screen edges */
.ad-sidebar {
    width: 160px;
    max-width: 160px;
    position: fixed;
    top: 70px;
    display: flex;
    flex-direction: column;
    z-index: 50;
    overflow: hidden;
}

.ad-sidebar-left {
    left: 0;
}

.ad-sidebar-right {
    right: 0;
}

.ad-sidebar ins {
    display: inline-block !important;
    width: 160px !important;
    max-width: 160px !important;
    height: 600px !important;
    max-height: 600px !important;
    overflow: hidden !important;
}

/* Footer Ad */
.ad-footer {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 1rem 20px;
    text-align: center;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.ad-footer ins {
    min-height: 90px;
    display: block;
}

/* Responsive - Hide sidebars on smaller screens */
@media (max-width: 1200px) {
    .ad-sidebar {
        display: none;
    }

    .main-content {
        padding: 0;
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    min-height: 48px;
    max-width: 100%;
    padding: 0;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
}

.nav-brand {
    display: flex;
    align-items: center;
    height: 100%;
    flex-shrink: 0;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.nav-brand:hover .nav-logo {
    opacity: 0.9;
}

.nav-logo {
    height: 40px;
    width: 40px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.nav-brand-title {
    font-family: 'Cinzel Decorative', 'Cinzel', Georgia, 'Times New Roman', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    letter-spacing: 0.06em;
}

.nav-links-left {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    height: 100%;
}

.nav-links-right {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    height: 100%;
}

.nav-links-left a:not(.btn),
.nav-links-right a:not(.btn) {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    white-space: nowrap;
    font-size: 0.9rem;
}

.nav-links-left a:not(.btn):hover,
.nav-links-right a:not(.btn):hover {
    color: var(--text-primary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0;
    margin: 0;
}

.username {
    display: inline-block;
    font-size: 0.95rem;
    line-height: 1;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: block;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
    justify-content: center;
    align-items: center;
    height: 40px;
}

/* Hidden by default on desktop; shown via media query */
.mobile-nav {
    display: none;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    margin: 3px 0;
    transition: all 0.3s;
    border-radius: 2px;
    display: block;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Buttons */
.btn {
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    text-align: center;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #40444B;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: auto;
}

.btn-discord {
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

/* Vote Buttons */
.btn-vote {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a1a1a !important;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
    border: none;
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
}

.btn-vote:hover {
    background: linear-gradient(135deg, #FFA500 0%, #FF8C00 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 165, 0, 0.4);
    color: #1a1a1a !important;
}

.btn-vote-large {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a1a1a;
    font-weight: 700;
    font-size: 1.2rem;
    padding: 1rem 2.5rem;
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.4);
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-vote-large:hover {
    background: linear-gradient(135deg, #FFA500 0%, #FF8C00 100%);
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(255, 165, 0, 0.5);
    color: #1a1a1a;
}

.btn-vote-footer {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a1a1a;
    font-weight: 700;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
    border: none;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
    margin-bottom: 1rem;
}

.btn-vote-footer:hover {
    background: linear-gradient(135deg, #FFA500 0%, #FF8C00 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 165, 0, 0.4);
    color: #1a1a1a;
}

.hero-vote-cta {
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.vote-subtext {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.footer-vote-section {
    margin-bottom: 1.5rem;
}

.vote-help-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    padding: 4rem 0;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 2rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-tertiary);
    padding: 1.5rem 2rem;
    border-radius: 8px;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary);
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.2;
}

/* Server Marquee */
.server-marquee-section {
    padding: 2rem 0 2.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.server-marquee-label {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.25rem;
}

.server-marquee-wrapper {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

.server-marquee-track {
    display: flex;
    gap: 1rem;
    width: max-content;
    animation: marquee-scroll 360s linear infinite;
}

.server-marquee-track--reverse {
    animation: marquee-scroll-reverse 300s linear infinite;
}

.server-marquee-wrapper:hover .server-marquee-track,
.server-marquee-wrapper:hover .server-marquee-track--reverse {
    animation-play-state: paused;
}

@keyframes marquee-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes marquee-scroll-reverse {
    0%   { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

.server-marquee-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.65rem 1rem;
    min-width: 200px;
    flex-shrink: 0;
    transition: border-color 0.2s;
}

.server-marquee-card:hover {
    border-color: var(--primary);
}

.server-marquee-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.server-marquee-icon-fallback {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.server-marquee-info {
    overflow: hidden;
}

.server-marquee-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.server-marquee-members {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 0.1rem;
}

/* Features */
.features {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    text-align: center;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--text-secondary);
}

/* CTA */
.cta {
    text-align: center;
    padding: 4rem 0;
}

.cta h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
}

/* Login */
.login-section {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: var(--bg-secondary);
    padding: 3rem;
    border-radius: 8px;
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.login-card h1 {
    margin-bottom: 1rem;
}

.login-card p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Dashboard */
.dashboard-section {
    padding: 3rem 0;
}

.vote-banner {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 165, 0, 0.15) 100%);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    width: 100%;
    box-sizing: border-box;
}

.vote-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.vote-banner-icon {
    font-size: 3rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.vote-banner-text {
    flex: 1;
    min-width: 200px;
}

.vote-banner-text h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    line-height: 1.3;
}

.vote-banner-text p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.4;
}

.vote-banner-compact {
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.vote-banner-compact .vote-banner-icon {
    font-size: 2rem;
}

.vote-banner-compact .vote-banner-text h3 {
    font-size: 1.1rem;
    margin: 0;
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.guild-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.guild-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.guild-card-invite {
    border: 2px dashed var(--primary);
    background: rgba(88, 101, 242, 0.05);
    transition: all 0.3s ease;
}

.guild-card-invite:hover {
    border-color: var(--primary-dark);
    background: rgba(88, 101, 242, 0.1);
    transform: translateY(-2px);
}

.guild-icon-add {
    background: transparent;
    border: 3px dashed var(--primary);
    color: var(--primary);
}

.guild-header {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 120px;
}

.guild-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 1rem;
    object-fit: cover;
    border: 3px solid var(--border);
    display: block;
}

.guild-icon-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 1rem;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    color: white;
    border: 3px solid var(--border);
}

.guild-header h3 {
    margin: 0;
}

.guild-info {
    margin-bottom: 1rem;
    flex-grow: 1;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.info-item:last-child {
    border-bottom: none;
}

.label {
    color: var(--text-secondary);
}

.status-active {
    color: var(--secondary);
    font-weight: 500;
}

.status-inactive {
    color: var(--text-secondary);
}

/* Guild Detail */
.guild-detail-section {
    padding: 3rem 0;
}

.guild-header-info {
    margin-bottom: 2rem;
}

.guild-header-info h1 {
    margin-bottom: 0.5rem;
}

.breadcrumb {
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--primary-dark);
}

.breadcrumb-separator {
    color: var(--text-secondary);
    margin: 0 0.25rem;
    user-select: none;
}

.analytics-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.guild-id {
    color: var(--text-secondary);
    font-family: monospace;
    font-size: 0.95rem;
    margin: 0;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.setting-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.setting-card h3 {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.3;
    font-size: 1.1rem;
}

.setting-card > p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.setting-value {
    margin-top: auto;
    padding-top: 1rem;
}

.setting-value-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.stat-label-inline {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0.5rem 0 0 0;
    text-align: center;
}

code {
    background: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    display: inline-block;
    word-break: break-all;
    line-height: 1.4;
}

.help-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.role-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.role-badge {
    background: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

.auto-delete-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.auto-delete-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge {
    background: var(--secondary);
    color: var(--bg-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
}

.role-replacement-info,
.welcome-role-info {
    margin-top: 0.5rem;
}

.role-replacement-info p,
.welcome-role-info p {
    margin: 0.5rem 0;
}

.message-preview {
    background: var(--bg-tertiary);
    padding: 0.75rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    font-style: italic;
}

.stat-large {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary);
    line-height: 1.2;
    text-align: center;
    display: block;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
}

/* Setting Forms */
.setting-form {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

input[type="text"],
input[type="number"],
input[type="datetime-local"],
textarea,
select {
    padding: 0.6rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    width: 100%;
    transition: border-color 0.15s;
}

input::placeholder,
textarea::placeholder {
    color: var(--placeholder);
    opacity: 1;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="datetime-local"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
}

input[type="number"] {
    width: auto;
    min-width: 70px;
}

select {
    cursor: pointer;
}

.channel-select,
.role-select {
    max-width: 420px;
}

select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.5rem;
}

textarea {
    resize: vertical;
}

.setting-form label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.setting-form input[type="checkbox"] {
    width: auto;
}

.setting-form button {
    margin-top: 0.5rem;
}

.role-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.btn-remove {
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove:hover {
    background: #C03537;
}

/* Loading Overlay */
.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    text-align: center;
}

.loading-spinner {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.error-message {
    color: var(--danger);
    font-size: 1.2rem;
}

.role-badge,
.auto-delete-item code,
.setting-value code {
    cursor: help;
}

/* Stats */
.stats-section {
    padding: 3rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card-large {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border);
}

.stat-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.stats-info {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.stats-info h2 {
    margin-bottom: 1rem;
}

.stats-info p {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Error */
.error-section {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-card {
    background: var(--bg-secondary);
    padding: 3rem;
    border-radius: 8px;
    text-align: center;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.empty-state h2 {
    margin-bottom: 1rem;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-secondary);
}

.footer p {
    margin: 0.5rem 0;
}

/* New Content Sections */
.how-it-works {
    margin: 4rem 0;
    padding: 3rem 0;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.step-card {
    background: var(--bg-tertiary);
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
}

.step-number {
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 1rem;
}

.step-card h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.step-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.use-cases {
    margin: 4rem 0;
}

.use-case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.use-case-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.use-case-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.use-case-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.testimonials {
    margin: 4rem 0;
    padding: 3rem 0;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.testimonial-card {
    background: var(--bg-tertiary);
    padding: 2rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.testimonial-card p {
    font-style: italic;
    margin-bottom: 1rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.testimonial-author {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.faq-preview {
    margin: 4rem 0;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.faq-item {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.faq-item h3 {
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.faq-item p, .faq-item ul, .faq-item ol {
    color: var(--text-secondary);
    line-height: 1.6;
}

.faq-item ul, .faq-item ol {
    margin: 0.5rem 0 0.5rem 1.5rem;
}

.cta-description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

/* Documentation Pages */
.docs-container, .faq-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 20px;
}

.page-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.docs-nav, .faq-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.docs-nav a, .category-link {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s;
}

.docs-nav a:hover, .category-link:hover {
    background: var(--primary);
}

.docs-nav .highlight-link {
    background: linear-gradient(135deg, #5865f2 0%, #4752c4 100%);
    color: white;
    font-weight: 600;
    animation: pulse 2s ease-in-out infinite;
}

.docs-nav .highlight-link:hover {
    background: linear-gradient(135deg, #4752c4 0%, #3c44a6 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(88, 101, 242, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(88, 101, 242, 0);
    }
}

.docs-section, .faq-category {
    margin: 3rem 0;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.docs-section h2, .faq-category h2 {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
}

.guide-step, .feature-docs, .config-guide, .best-practice, .troubleshooting-item {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.guide-step h3, .feature-docs h3, .config-guide h3, .best-practice h3, .troubleshooting-item h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.guide-step h4, .feature-docs h4, .config-guide h4 {
    margin: 1.5rem 0 0.75rem;
    color: var(--secondary);
    font-size: 1.05rem;
}

.guide-step p, .feature-docs p, .config-guide p, .best-practice p, .troubleshooting-item p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.guide-step ul, .guide-step ol, .feature-docs ul, .feature-docs ol, 
.config-guide ul, .best-practice ul, .troubleshooting-item ul {
    margin: 0.75rem 0 0.75rem 1.5rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.guide-step li, .feature-docs li, .config-guide li, .best-practice li, .troubleshooting-item li {
    margin-bottom: 0.5rem;
}

.guide-step code, .feature-docs code, .faq-item code {
    background: var(--bg-primary);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--secondary);
}

.note, .warning {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid;
}

.note {
    background: rgba(87, 242, 135, 0.1);
    border-color: var(--secondary);
}

.warning {
    background: rgba(237, 66, 69, 0.1);
    border-color: var(--danger);
}

.permission-table {
    margin: 2rem 0;
}

.permission-table table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

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

.permission-table th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
}

.permission-table td {
    color: var(--text-secondary);
}

.permission-notes {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.permission-notes h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.permission-notes ul {
    margin-left: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.permission-notes li {
    margin-bottom: 0.75rem;
}

.resource-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.faq-section {
    text-align: center;
    margin: 3rem 0;
    padding: 2rem;
}

.faq-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Responsive */
/* Switch to mobile menu when nav gets crowded */
@media (max-width: 1280px) {
    /* Mobile Menu */
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }

    /* Hide the desktop nav groups on mobile */
    .nav-links-left,
    .nav-links-right {
        display: none !important;
    }

    /* Single unified mobile drawer */
    .mobile-nav {
        display: flex;
        position: fixed;
        top: 70px;
        right: -100%;
        width: 280px;
        max-width: 85%;
        height: calc(100vh - 70px);
        background: var(--bg-secondary);
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem 1.5rem;
        gap: 0;
        transition: right 0.3s ease;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
        overflow-y: auto;
        border-left: 1px solid var(--border);
        z-index: 999;
    }

    .mobile-nav.active {
        right: 0;
    }

    .mobile-nav a {
        width: 100%;
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--border);
        font-size: 0.95rem;
        color: var(--text-secondary);
        text-decoration: none;
    }

    .mobile-nav a:hover {
        color: var(--text-primary);
    }

    .mobile-nav .btn {
        width: 100%;
        text-align: center;
        margin-top: 0.5rem;
        padding: 0.5rem 1.5rem;
        font-size: 0.95rem;
        border-bottom: none;
    }

    .mobile-nav .user-info {
        width: 100%;
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--border);
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .mobile-nav-divider {
        width: 100%;
        border-top: 2px solid var(--primary);
        margin: 0.75rem 0;
    }

    .username {
        display: block;
        font-size: 0.95rem;
    }

    .avatar {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0.5rem 0;
    }
    
    .navbar .container {
        padding: 0 1rem;
        min-height: 44px;
    }
    
    .nav-brand-title {
        font-size: 1.25rem;
    }
    
    /* Hero Section */
    .hero {
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
        padding: 0 1rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
        padding: 0 1rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .stat-card {
        padding: 1rem 1.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    /* Container */
    .container {
        padding: 0 1rem;
    }
    
    /* Feature Grid */
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .feature-icon {
        font-size: 2rem;
    }
    
    /* Settings Grid */
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    /* Guild Grid */
    .guild-grid {
        grid-template-columns: 1fr;
    }
    
    /* Ad Footer */
    .ad-footer {
        padding: 0.5rem;
    }
    
    /* Page Title */
    .page-title {
        font-size: 1.8rem;
        padding: 0 1rem;
    }
    
    .subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    /* New Content Sections */
    .steps-container, .use-case-grid, .testimonial-grid {
        grid-template-columns: 1fr;
    }
    
    .step-card, .use-case-card, .testimonial-card {
        padding: 1.5rem;
    }
    
    .how-it-works, .testimonials {
        padding: 2rem 1rem;
        margin: 2rem 0;
    }
    
    /* Vote Elements Mobile */
    .vote-banner-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        justify-content: center;
    }
    
    .vote-banner-icon {
        font-size: 2.5rem;
    }
    
    .vote-banner-text {
        min-width: 100%;
        text-align: center;
    }
    
    .vote-banner-text h3,
    .vote-banner-text p {
        text-align: center;
    }
    
    .breadcrumb {
        flex-wrap: wrap;
    }
    
    .hero-vote-cta {
        margin: 1.5rem 0;
    }
    
    .btn-vote-large {
        font-size: 1rem;
        padding: 0.8rem 1.5rem;
    }
    
    .use-cases, .faq-preview {
        margin: 2rem 0;
        padding: 0 0.5rem;
    }
    
    /* Docs & FAQ */
    .docs-nav, .faq-categories {
        flex-direction: column;
        padding: 1rem;
    }
    
    .docs-section, .faq-category {
        padding: 1.5rem 1rem;
    }
    
    .guide-step, .feature-docs, .config-guide, .best-practice, .troubleshooting-item {
        padding: 1rem;
        margin: 1.5rem 0;
    }
    
    /* Tables */
    .permission-table {
        overflow-x: auto;
    }
    
    .permission-table table {
        font-size: 0.85rem;
        min-width: 600px;
    }
    
    .permission-table th, .permission-table td {
        padding: 0.75rem 0.5rem;
    }
    
    /* Buttons */
    .btn-large {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    .faq-actions, .resource-links {
        flex-direction: column;
        align-items: stretch;
    }
    
    .faq-actions .btn, .resource-links .btn {
        width: 100%;
    }
    
    /* CTA */
    .cta {
        padding: 2rem 1rem;
    }
    
    .cta h2 {
        font-size: 1.75rem;
    }
    
    .cta-description {
        font-size: 1rem;
    }
    
    /* Footer */
    .footer {
        padding: 1.5rem 0;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Tablet/Medium screens */
@media (min-width: 769px) and (max-width: 1024px) {
    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }
    
    .nav-links .btn {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
    }
    
    .username {
        display: none;
    }
    
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .steps-container, .use-case-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Custom Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    animation: slideUp 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.modal-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.modal-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.modal-icon.success { color: var(--secondary); }
.modal-icon.error { color: var(--danger); }
.modal-icon.warning { color: #FEE75C; }
.modal-icon.info { color: var(--primary); }

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.modal-btn {
    padding: 0.625rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.modal-btn-primary {
    background: var(--primary);
    color: white;
}

.modal-btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.modal-btn-danger {
    background: var(--danger);
    color: white;
}

.modal-btn-danger:hover {
    background: #c13438;
    transform: translateY(-1px);
}

.modal-btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-btn-secondary:hover {
    background: #404449;
}

/* Premium Badge and Tier Notes */
.premium-badge {
    display: inline-block;
    background: linear-gradient(135deg, #7289da, #5b6eae);
    color: #fff;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.tier-note {
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.1), rgba(114, 137, 218, 0.1));
    border-left: 3px solid var(--primary);
    padding: 0.75rem 1rem;
    margin: 0.75rem 0 1rem 0;
    border-radius: 0 8px 8px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.tier-note a {
    color: var(--primary);
    text-decoration: underline;
}

.tier-note a:hover {
    color: #7289da;
}

.tier-note code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.setting-card-wide {
    grid-column: 1 / -1;
}

/* ═══════════════ Guild Manage Sidebar Layout ═══════════════ */

.guild-manage-layout {
    display: flex;
    min-height: calc(100vh - 70px);
}

.guild-sidebar {
    width: 220px;
    min-width: 220px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.guild-id-small {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0;
}

.sidebar-category {
    display: inline-block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #fff;
    background: var(--primary);
    padding: 0.2rem 0.6rem;
    margin: 0.75rem 0.75rem 0.25rem;
    font-weight: 700;
    border-radius: 3px;
}

.sidebar-link {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.sidebar-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-link.active {
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border-left-color: var(--primary);
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding: 0.5rem 0;
}

/* Collapsible section structure (desktop: always open) */
.mobile-guild-bar {
    display: none;
}

.sidebar-overlay {
    display: none;
}

.sidebar-close {
    display: none;
}

.sidebar-category-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: calc(100% - 1.5rem);
    margin: 0.75rem 0.75rem 0.25rem;
    background: var(--primary);
    border: none;
    cursor: pointer;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #fff;
    padding: 0.2rem 0.5rem 0.2rem 0.6rem;
    font-weight: 700;
    border-radius: 3px;
    transition: background 0.15s;
}

.sidebar-category-btn:hover {
    background: var(--primary-dark);
}

.sidebar-chevron {
    display: block;
    flex-shrink: 0;
    transition: transform 0.2s ease;
    opacity: 0.5;
}

.sidebar-section.open .sidebar-chevron {
    transform: rotate(90deg);
}

.sidebar-section-links {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.25s ease;
}

.sidebar-section.open .sidebar-section-links {
    max-height: 500px;
}

.guild-main-content {
    flex: 1;
    min-width: 0;
    padding: 2rem;
}

/* Panels */
.panel {
    display: none;
}

.panel.active {
    display: block;
}

.panel-header {
    margin-bottom: 1.5rem;
}

.panel-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.panel-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 480px));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.panel-grid.fill {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.panel-grid-2col {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 480px));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.panel-card {
    background: var(--bg-secondary);
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.panel-card-wide {
    grid-column: 1 / -1;
}

.panel-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

.panel-card > p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.panel-section {
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
    overflow: hidden;
}

.panel-grid > form {
    display: flex;
    flex-direction: column;
}

.panel-grid > form > .panel-section {
    flex: 1;
    margin-bottom: 0;
}

.section-header {
    padding: 1rem 1.25rem 0.5rem;
}

.section-header h3 {
    font-size: 1.05rem;
    margin-bottom: 0.15rem;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.section-body {
    padding: 0.75rem 1.25rem 1.25rem;
}

/* Channel routing grid */
.channel-route-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 420px));
    gap: 0.75rem;
}

.channel-route {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.channel-route label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.channel-route select {
    width: 100%;
}

/* Toggle labels */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    font-size: 0.9rem;
    cursor: pointer;
}

/* Input groups */
.input-group {
    margin-top: 0.5rem;
}

.input-group > label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.duration-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.duration-row input[type="number"] {
    width: 100px;
    min-width: 80px;
    text-align: center;
}

.duration-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    min-width: 50px;
}

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

.field-example {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
    padding: 0.5rem 0.65rem;
    background: var(--bg-primary);
    border-radius: 4px;
    border-left: 3px solid var(--primary);
    font-style: italic;
}

/* ── Embed Builder ── */
.embed-mode-toggle {
    margin-bottom: 0.5rem;
}

.embed-builder-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* ── Embed Builder Modal ── */
/* Must sit above all other modals (reaction roles, edit reminder, etc.) */
#embedBuilderModal {
    z-index: 10100;
}

.ebm-modal {
    max-width: 920px;
    width: 95vw;
    padding: 0;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ebm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.ebm-header h3 {
    margin: 0;
}

.ebm-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.ebm-fields-col {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ebm-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ebm-import-area {
    padding: 0 1.25rem 0.75rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.ebm-import-area textarea {
    width: 100%;
    margin-top: 0.5rem;
    font-family: monospace;
    font-size: 0.8rem;
}

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

.embed-builder-fields {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.embed-color-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.embed-color-row input[type="color"] {
    width: 60px;
    height: 36px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-tertiary);
    cursor: pointer;
}

.embed-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.embed-fields-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.embed-fields-container > label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.embed-field-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.65rem;
    background: var(--bg-primary);
    border-radius: 6px;
    margin-bottom: 0.35rem;
}

.embed-field-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.btn-small {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
}

.btn-small:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.badge-embed {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    background: var(--primary);
    color: #fff;
    vertical-align: middle;
    margin-left: 0.35rem;
}

/* ── Discord Embed Preview ── */
.embed-preview-pane > label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.discord-preview {
    background: #313338;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-family: 'gg sans', 'Noto Sans', Helvetica, Arial, sans-serif;
    font-size: 0.9375rem;
    color: #dbdee1;
    line-height: 1.375;
    position: sticky;
    top: 1rem;
}

.discord-msg {
    display: flex;
    gap: 0.75rem;
}

.discord-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    flex-shrink: 0;
}

.discord-msg-body {
    flex: 1;
    min-width: 0;
}

.discord-msg-header {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    margin-bottom: 0.15rem;
}

.discord-bot-name {
    font-weight: 600;
    color: #fff;
    font-size: 0.95rem;
}

.discord-bot-badge {
    font-size: 0.6rem;
    padding: 0.05rem 0.3rem;
    background: #5865F2;
    color: #fff;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
    vertical-align: middle;
}

.discord-timestamp {
    font-size: 0.75rem;
    color: #949ba4;
}

.discord-content {
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.discord-content code {
    background: #2b2d31;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-size: 0.85em;
}

.discord-embed {
    display: flex;
    margin-top: 0.25rem;
    max-width: 520px;
    border-radius: 4px;
    overflow: hidden;
    background: #2b2d31;
}

.discord-embed-color {
    width: 4px;
    flex-shrink: 0;
    background: #5865F2;
}

.discord-embed-body {
    display: flex;
    padding: 0.5rem 0.75rem 0.65rem;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.discord-embed-inner {
    flex: 1;
    min-width: 0;
}

.discord-embed-author {
    font-size: 0.8rem;
    font-weight: 600;
    color: #dbdee1;
    margin-bottom: 0.25rem;
}

.discord-embed-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #00a8fc;
    margin-bottom: 0.25rem;
}

.discord-embed-description {
    font-size: 0.875rem;
    color: #dbdee1;
    margin-bottom: 0.4rem;
    word-break: break-word;
}

.discord-embed-description code {
    background: #1e1f22;
    padding: 0.1rem 0.25rem;
    border-radius: 3px;
    font-size: 0.85em;
}

.discord-embed-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
}

.discord-embed-field {
    flex: 0 0 100%;
    min-width: 0;
}

.discord-embed-field.inline {
    flex: 1 1 30%;
    min-width: 100px;
}

.discord-embed-field-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #dbdee1;
    margin-bottom: 0.1rem;
}

.discord-embed-field-value {
    font-size: 0.8rem;
    color: #b5bac1;
    word-break: break-word;
}

.discord-embed-image-wrap {
    margin-top: 0.4rem;
}

.discord-embed-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 4px;
    object-fit: contain;
}

.discord-embed-thumb-wrap {
    flex-shrink: 0;
}

.discord-embed-thumb {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    object-fit: cover;
}

.discord-embed-footer {
    font-size: 0.75rem;
    color: #949ba4;
    margin-top: 0.35rem;
}

/* ── Embed Builder — Section Headers ── */
.ebm-section-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.9rem 0 0.45rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-secondary);
}
.ebm-section-head::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.ebm-section-head:first-child {
    margin-top: 0;
}

/* ── Embed Builder — Color Palette ── */
.ebm-color-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.ebm-color-row input[type="color"] {
    width: 36px;
    height: 36px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-tertiary);
    cursor: pointer;
    flex-shrink: 0;
}
.ebm-hex-input {
    width: 90px !important;
    font-family: 'Courier New', monospace !important;
    font-size: 0.85rem !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ebm-color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.45rem;
}
.ebm-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    outline: 2px solid transparent;
    outline-offset: 2px;
    transition: transform 0.12s, outline-color 0.12s;
    flex-shrink: 0;
}
.ebm-swatch:hover { transform: scale(1.2); }
.ebm-swatch.active { outline-color: var(--text-primary); }

/* ── Embed Builder — Label row with char count ── */
.ebm-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}
.ebm-label-row label { margin-bottom: 0; }
.ebm-char-count {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    flex-shrink: 0;
    transition: color 0.15s;
}

/* ── Embed Builder — Image Peek ── */
.ebm-img-peek-row {
    display: none;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.35rem;
    padding: 0.4rem 0.6rem;
    background: var(--bg-primary);
    border-radius: 6px;
    border: 1px solid var(--border);
}
.ebm-img-peek-row img {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    object-fit: cover;
    background: var(--bg-tertiary);
    flex-shrink: 0;
}
.ebm-img-peek-row.wide img {
    width: 64px;
    height: 38px;
    border-radius: 4px;
}
.ebm-img-peek-url {
    font-size: 0.7rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}
.ebm-img-peek-remove {
    margin-left: auto;
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.78rem;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}
.ebm-img-peek-remove:hover {
    background: rgba(237,66,69,0.12);
    color: #ED4245;
}

/* URL + upload button row */
.ebm-url-upload-row {
    display: flex;
    gap: 0.4rem;
    align-items: stretch;
}
.ebm-url-upload-row input {
    flex: 1;
    min-width: 0;
}
.ebm-upload-btn {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 0.8rem;
    padding: 0 0.7rem;
}
.ebm-upload-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive sidebar — off-canvas drawer on mobile */
@media (max-width: 768px) {
    .guild-manage-layout {
        flex-direction: column;
    }

    /* Mobile top bar */
    .mobile-guild-bar {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.65rem 1rem;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border);
        position: sticky;
        top: 60px;
        z-index: 10;
    }

    .sidebar-toggle {
        background: none;
        border: none;
        cursor: pointer;
        padding: 0.2rem;
        display: flex;
        flex-direction: column;
        gap: 5px;
        flex-shrink: 0;
    }

    .sidebar-toggle span {
        display: block;
        width: 22px;
        height: 2px;
        background: var(--text-primary);
        border-radius: 2px;
    }

    .mobile-guild-info {
        display: flex;
        flex-direction: column;
        line-height: 1.3;
        min-width: 0;
    }

    .mobile-guild-name {
        font-weight: 600;
        font-size: 0.9rem;
        color: var(--text-primary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-active-panel {
        font-size: 0.72rem;
        color: var(--text-secondary);
    }

    /* Backdrop */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.55);
        z-index: 200;
    }

    .sidebar-overlay.active {
        display: block;
    }

    /* Off-canvas sidebar */
    .guild-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 260px;
        min-width: 260px;
        height: 100dvh;
        z-index: 300;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        border-right: 1px solid var(--border);
        border-bottom: none;
    }

    .guild-sidebar.open {
        transform: translateX(0);
    }

    /* Close button inside sidebar */
    .sidebar-close {
        display: block;
        float: right;
        background: none;
        border: none;
        color: var(--text-secondary);
        font-size: 1rem;
        cursor: pointer;
        padding: 0;
        line-height: 1;
        margin-bottom: 0.4rem;
    }

    .sidebar-close:hover {
        color: var(--text-primary);
    }

    /* Category button — adjust padding for mobile */
    .sidebar-category-btn {
        padding: 0.65rem 1rem 0.4rem;
        font-size: 0.72rem;
    }

    /* Collapsible links */
    .sidebar-section-links {
        overflow: hidden;
        max-height: 0;
        transition: max-height 0.2s ease;
    }

    .sidebar-section.open .sidebar-section-links {
        max-height: 400px;
    }

    /* Restore left-border active indicator */
    .sidebar-link {
        border-left: 3px solid transparent;
        border-bottom: none;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .sidebar-link.active {
        border-left-color: var(--primary);
        border-bottom-color: transparent;
    }

    .sidebar-header {
        padding: 1rem;
    }

    .sidebar-nav {
        display: block;
        padding: 0.5rem 0;
    }

    .sidebar-footer {
        display: block;
        padding: 0.5rem 0;
    }

    .guild-main-content {
        padding: 1rem;
    }

    .panel-grid, .panel-grid-2col {
        grid-template-columns: 1fr;
    }

    .embed-builder-layout {
        grid-template-columns: 1fr;
    }

    .embed-two-col {
        grid-template-columns: 1fr;
    }
}

.reminder-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.reminder-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-tertiary);
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    gap: 0.75rem;
}

.reminder-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
}

.reminder-id {
    font-size: 0.75rem;
    flex-shrink: 0;
}

.reminder-msg {
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.reminder-meta {
    color: var(--text-secondary);
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* Premium-locked panel cards */
.panel-card-locked {
    position: relative;
    opacity: 0.65;
    pointer-events: none;
}
.panel-card-locked .premium-lock-banner {
    pointer-events: all;
}
.premium-lock-banner {
    background: linear-gradient(90deg, #5b6eae 0%, #7289da 100%);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    display: inline-block;
}
.premium-lock-banner a {
    color: #fff;
    text-decoration: underline;
}

/* ── Searchable Select ─────────────────────────────────────────────────────── */
.ss-wrapper {
    position: relative;
    display: block;
    width: 100%;
}
.ss-wrapper.channel-select,
.ss-wrapper.role-select {
    max-width: 420px;
}
.ss-display {
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.15s;
}
.ss-wrapper.open .ss-display {
    border-color: var(--primary);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.ss-input {
    flex: 1;
    background: transparent !important;
    border: none !important;
    padding: 0.6rem 0.75rem !important;
    cursor: pointer;
    outline: none !important;
    width: 1px !important; /* flex will expand it */
    min-width: 0;
    font-size: 0.95rem;
    color: var(--text-primary);
    box-shadow: none !important;
}
.ss-wrapper.open .ss-input {
    cursor: text;
}
.ss-arrow {
    padding: 0 0.6rem;
    color: var(--text-secondary);
    font-size: 0.78rem;
    pointer-events: none;
    transition: transform 0.15s;
    flex-shrink: 0;
}
.ss-wrapper.open .ss-arrow {
    transform: rotate(180deg);
}
.ss-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--primary);
    border-top: none;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 9999;
    box-shadow: 0 6px 18px rgba(0,0,0,0.45);
}
.ss-dropdown.open {
    display: block;
}
.ss-option {
    padding: 0.45rem 0.75rem;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: background 0.1s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ss-option:hover {
    background: rgba(255,255,255,0.07);
}
.ss-option.ss-selected {
    color: var(--primary);
    background: rgba(88,101,242,0.12);
}
.ss-placeholder {
    color: var(--text-secondary);
}
.ss-no-results {
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-style: italic;
}
.ss-highlight {
    background: rgba(88,101,242,0.3);
    border-radius: 2px;
}

.support-discord {
    margin: 2.5rem auto 3rem;
    padding: 1.5rem 1.25rem 2rem;
    max-width: 420px;
    text-align: center;
    background: var(--bg-secondary, #1e1e1e);
    border: 1px solid var(--border, #333);
    border-radius: 10px;
}
.support-discord-intro {
    color: var(--text-secondary, #aaa);
    margin: 0 0 1rem;
    line-height: 1.5;
    font-size: 0.95rem;
}
.support-discord-actions {
    margin: 0 0 1.25rem;
}
.discord-widget-wrap {
    display: flex;
    justify-content: center;
}
.discord-widget-wrap iframe {
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border, #333);
}
