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

/* Mobile Nav FAB (bottom-left) */
.mobile-nav-fab {
    position: fixed;
    left: 16px;
    bottom: 16px;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    background: var(--primary-color);
    color: #000;
    border: none;
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10010;
}

.mobile-nav-fab i { font-size: 20px; }

:root {
    --primary-color: #ff6788;
    --secondary-color: #ff6788;
    --success-color: #ff6788;
    --danger-color: #ff6788;
    --warning-color: #ff6788;
    --bg-primary: #1a1a1e;
    --bg-secondary: #121214;
    --bg-tertiary: #242429;
    --text-primary: #fff;
    --text-secondary: #b8b8b8;
    --text-muted: #80848e;
    --border-color: #3a3a3f;
    --discord-bg: #313338;
    --discord-lighter: #383a40;
    --discord-message: #2b2d31;
}

body {
    font-family: "Rubik", system-ui;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

#app {
    overflow-x: hidden;
    position: relative;
    width: 100%;
    max-width: 100vw;
}

/* Main content container */
#mainContent {
    position: relative;
    width: 100%;
}

/* Page positioning - default state */
#landingPage,
#builderPage,
#welcomeBuilderPage {
    width: 100%;
}

/* Hide pages by default if they have the hidden class */
#landingPage.hidden,
#builderPage.hidden,
#welcomeBuilderPage.hidden {
    display: none !important;
}

/* During animations, use fixed positioning to overlay pages */
#landingPage.slide-in-left,
#landingPage.slide-in-right,
#landingPage.slide-out-left,
#landingPage.slide-out-right,
#builderPage.slide-in-left,
#builderPage.slide-in-right,
#builderPage.slide-out-left,
#builderPage.slide-out-right,
#welcomeBuilderPage.slide-in-left,
#welcomeBuilderPage.slide-in-right,
#welcomeBuilderPage.slide-out-left,
#welcomeBuilderPage.slide-out-right {
    position: fixed;
    top: var(--navbar-h, 0);
    left: 0;
    right: 0;
    width: 100%;
    height: calc(100vh - var(--navbar-h, 0px));
    overflow-y: auto;
    background: var(--bg-secondary);
}

/* Pages sliding in should be on top */
#landingPage.slide-in-left,
#landingPage.slide-in-right,
#builderPage.slide-in-left,
#builderPage.slide-in-right,
#welcomeBuilderPage.slide-in-left,
#welcomeBuilderPage.slide-in-right {
    z-index: 1000;
}

/* Pages sliding out should be below */
#landingPage.slide-out-left,
#landingPage.slide-out-right,
#builderPage.slide-out-left,
#builderPage.slide-out-right,
#welcomeBuilderPage.slide-out-left,
#welcomeBuilderPage.slide-out-right {
    z-index: 999;
    pointer-events: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #1a1a1e;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #3a3a3f;
    border-radius: 10px;
    border: 2px solid #1a1a1e;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff6788;
}

::-webkit-scrollbar-corner {
    background: #1a1a1e;
}

/* Firefox Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #3a3a3f #1a1a1e;
}

/* Navbar */
.navbar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 10001;
    overflow-x: hidden;
}

.nav-container {
    max-width: 1900px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.nav-brand {
    display: flex;
    align-items: center;
}

.nav-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: flex-end;
}

.global-server-selector {
    display: none;
}

.global-server-selector .server-select-button {
    min-width: 200px;
    max-width: 250px;
    height: 40px;
    font-size: 0.9rem;
}

.global-server-selector .server-select-content {
    gap: 0.5rem;
}

.global-server-selector .server-select-content img {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.nav-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 2rem);
}

/* Tab indicator animation */
.nav-tabs::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.nav-tabs.indicator-0::after {
    opacity: 1;
    width: calc(25% - 0.375rem);
    left: 0;
}

.nav-tabs.indicator-1::after {
    opacity: 1;
    width: calc(25% - 0.375rem);
    left: calc(25% + 0.167rem);
}

.nav-tabs.indicator-2::after {
    opacity: 1;
    width: calc(25% - 0.375rem);
    left: calc(50% + 0.333rem);
}

.nav-tabs.indicator-3::after {
    opacity: 1;
    width: calc(25% - 0.375rem);
    left: calc(75% + 0.5rem);
}

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

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
    white-space: nowrap;
    line-height: 1;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.catsy_logo_img {
    max-width: 20%;
    height: auto;
}

.header_catsy {
    color: #ff6788;
    font-size: x-large;
    margin: 5px 5px 5px 0;
    font-weight: 700;    
}

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

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

.btn-success {
    background: var(--success-color);
    color: #000;
}

.btn-danger {
    background: var(--danger-color);
    color: #000;
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.btn-large {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Sticky actions: Welcome/Leave */
.wel-sticky-actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; pointer-events: none; display: none; }
.wel-sticky-inner { pointer-events: auto; max-width: 980px; margin: 0 auto 1rem; padding: .5rem; display: flex; gap: .5rem; justify-content: flex-start; }
.wel-btn { background: #ff6788; color: #000; border: none; border-radius: 12px; padding: .9rem 1.1rem; font-weight: 800; display: inline-flex; align-items: center; gap: .5rem; }
.wel-btn.secondary { background: #242429; color: #fff; }
.wel-btn.muted { opacity: .5; filter: grayscale(30%); }

@media (max-width: 900px) {
  .wel-sticky-inner { max-width: none; margin: 0 1rem 1rem; justify-content: center; }
  #welBtnSave { width: 52px; padding: .9rem; justify-content: center; }
  #welBtnSave .btn-label { display: none; }
  #welBtnSendTest { width: 52px; padding: .9rem; justify-content: center; }
  #welBtnSendTest .btn-label { display: none; }
}

/* Landing Page */
.landing-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Pink hero redesign */
.hero-pink {
    background: #ff6788;
    color: #000;
    border-radius: 16px;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    align-items: center;
}


.hero-logo { margin-bottom: 0.75rem; }
.hero-logo img { display: block; width: min(480px, 80%); height: auto; }

.hero-tagline {
    font-size: clamp(1.1rem, 2.2vw, 1.6rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.hero-divider {
    border: 0; height: 2px; background: rgba(0,0,0,0.45); width: 80px; margin: 0.5rem 0 1rem 0;
}

.hero-desc {
    color: #161616;
    font-weight: 600;
    max-width: 48ch;
}

.hero-ctas { display: flex; gap: 0.75rem; margin-top: 1.25rem; align-items: center; flex-wrap: wrap; }
.btn-hero { border: none; cursor: pointer; border-radius: 12px; padding: 0.9rem 1.2rem; font-weight: 500; font-size: 1rem; display: inline-flex; gap: 0.5rem; align-items: center; text-decoration: none; }
.btn-invite, .btn-build { background: #121214; color: #fff; }
.btn-discord { width: 48px; height: 48px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: #121214; color: #fff; }
.btn-hero:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(0,0,0,0.25); }

.hero-art { position: relative; aspect-ratio: 5 / 4.5; display: flex; align-items: center; justify-content: center; }
.art-card { position: static; inset: auto; display: flex; align-items: center; justify-content: center; }
.art-card img { max-width: 100%; height: auto; object-fit: contain; display: block; }
.art-card-back { transform: rotate(-6deg) translate(-8%, -6%); opacity: 0.9; filter: saturate(0.9); }
.art-card-front { transform: none; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { height: 260px; }
}

.hero {
    text-align: center;
    padding: 4rem 2rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

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

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.feature-card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(255, 141, 141, 0.15);
}

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

/* Server selector loading state */
.server-list.loading-centered { min-height: 260px; display: flex; align-items: center; justify-content: center; }
.server-loading { text-align: center; color: #949ba4; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 2rem; }
.server-loading i { font-size: 2rem; margin-bottom: 0.5rem; }
.server-loading.error { color: #ff6788; }

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

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

/* New Features Split Section */
.features-split { max-width: 1200px; margin: 3rem auto 4rem; padding: 0 2rem; display: flex; flex-direction: column; gap: 5rem; }
.feature-row { display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: center; }
.feature-row.reverse .feature-media { order: 2; }
.feature-row.reverse .feature-text { order: 1; }

.feature-text h3 { font-size: clamp(1.6rem, 2.8vw, 2.25rem); margin-bottom: 0.75rem; }
.feature-text p { color: #b9bbbe; line-height: 1.7; margin-bottom: 0.75rem; }
.feature-cta { display: inline-flex; align-items: center; gap: .5rem; background: linear-gradient(135deg, #2a2a32, #1f1f24); border: 1px solid #34343b; padding: .85rem 1.1rem; border-radius: 10px; color: #fff; text-decoration: none; font-weight: 600; }
.feature-cta:hover { border-color: #ff6788; box-shadow: 0 6px 18px rgba(255,103,136,.15); transform: translateY(-1px); }

.feature-media { position: relative; }
.feature-card-ui { background: #121214; padding: .5rem;}
.feature-card-ui img { width: 100%; height: auto; display: block; border-radius: 12px; }

.feature-bubble { position: absolute; width: 100px; height: 100px; border-radius: 999px; display: grid; place-items: center; background: #b254ff00; color: #fff;}
.feature-bubble.left { left: -34px; top: 20%; }
.feature-bubble.right { right: -34px; bottom: 22%; }
.catsy_image_bn { max-width: 100%; }

@media (max-width: 900px) {
  .features-split { padding: 0 1rem; gap: 3rem; }
  .feature-row { grid-template-columns: 1fr; gap: 1.5rem; }
  .feature-row.reverse .feature-media { order: 1; }
  .feature-row.reverse .feature-text { order: 2; }
}

/* Builder Page */
.builder-page {
    padding: 1rem;
    max-width: 100%;
    margin: 0 auto;
    height: calc(100vh - 100px);
    overflow: hidden;
}

.builder-container {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    grid-template-areas: "send edit preview";
    gap: 1rem;
    height: 100%;
    max-width: 2200px;
    margin: 0 auto;
}

.right-panels-container {
    display: contents;
}

.preview-panel { grid-area: preview; min-height: 0; }
.send-panel-container { grid-area: send; min-height: 0; }
.editor-panel { grid-area: edit; min-height: 0; }

/* Editor Panel */
.editor-panel, .preview-panel, .send-panel-container {
    background: var(--bg-primary);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.panel-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.mode-tabs {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.send-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tab-button, .send-tab {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    background: var(--bg-secondary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.tab-button.active, .send-tab.active {
    background: var(--primary-color);
    color: #000;
}

.editor-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
}

.editor-content::-webkit-scrollbar {
    width: 12px;
}

.editor-content::-webkit-scrollbar-track {
    background: #1a1a1e;
}

.editor-content::-webkit-scrollbar-thumb {
    background: #3a3a3f;
    border-radius: 6px;
}

.editor-content::-webkit-scrollbar-thumb:hover {
    background: #4a4a4f;
}

.editor-section {
    display: none;
}

.editor-section.active {
    display: block;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="color"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.625rem;
    background: #242429;
    border: 1px solid #242429;
    color: #fff;
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    transition: all 0.2s ease;
    font-weight: 500;
}

.form-group select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b5bac1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.125rem;
    padding-right: 2.5rem;
    cursor: pointer;
}

.form-group select:hover {
    background-color: #2a2a2f;
    border-color: #3a3a3f;
}

.form-group select option {
    background: #1e1f22;
    color: #fff;
    padding: 0.75rem 1rem;
    font-weight: 500;
}

.form-group input[type="color"] {
    width: 60px;
    height: 40px;
    padding: 2px;
    cursor: pointer;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

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

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

.form-divider {
    height: 1px;
    background: #3a3a3f;
    margin: 1.5rem 0;
}

/* Field Management */
#fieldsContainer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.field-item {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    position: relative;
}

.field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.field-header h4 {
    font-size: 0.875rem;
    font-weight: 600;
}

.field-remove {
    background: var(--danger-color);
    color: #000;
    border: none;
    padding: 0.65rem 1.5rem;
    font-size: 0.9rem;
    border-radius: 4px;
    cursor: pointer;
}

.field-inline {
    margin-top: 0.5rem;
}

/* Preview Panel */
.preview-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
    background: var(--discord-bg);
}

.preview-content::-webkit-scrollbar {
    width: 12px;
}

.preview-content::-webkit-scrollbar-track {
    background: #1a1a1e;
}

.preview-content::-webkit-scrollbar-thumb {
    background: #3a3a3f;
    border-radius: 6px;
}

.preview-content::-webkit-scrollbar-thumb:hover {
    background: #4a4a4f;
}

/* Send Panel */
.send-panel {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
}

.send-panel::-webkit-scrollbar {
    width: 12px;
}

.send-panel::-webkit-scrollbar-track {
    background: #1a1a1e;
}

.send-panel::-webkit-scrollbar-thumb {
    background: #3a3a3f;
    border-radius: 6px;
}

.send-panel::-webkit-scrollbar-thumb:hover {
    background: #4a4a4f;
}

.discord-message {
    background: var(--discord-message);
    border-radius: 8px;
    padding: 1rem;
}

.discord-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.discord-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.discord-username {
    font-weight: 600;
    color: white;
    font-size: 0.9rem;
}

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

.message-preview {
    margin-top: 0.5rem;
}

.message-content {
    color: #dbdee1;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.empty-preview {
    color: #949ba4;
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

/* Discord Embed Preview */
.discord-embed {
    display: flex;
    max-width: 720px;
    background: #242429;
    border-left: 4px solid #ff6788;
    border-radius: 4px;
    padding: 0.5rem 1rem 1rem 0.75rem;
    margin-top: 0.5rem;
}

.embed-content {
    flex: 1;
}

.embed-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.embed-author-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.embed-author-name {
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
}

.embed-title {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.embed-description {
    color: #dbdee1;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    white-space: pre-wrap;
}

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

.embed-field {
    color: #dbdee1;
    flex: 1 1 100%;
    min-width: 0;
}

.embed-field-inline {
    flex: 1 1 calc(33.33% - 0.5rem);
    min-width: 150px;
}

.embed-field-name {
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.embed-field-value {
    font-size: 0.875rem;
    white-space: pre-wrap;
}

.embed-thumbnail {
    max-width: 80px;
    max-height: 80px;
    border-radius: 4px;
    margin-left: 1rem;
}

.embed-image {
    max-width: 100%;
    border-radius: 4px;
    margin-top: 0.5rem;
}

.embed-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    color: #949ba4;
    font-size: 0.75rem;
}

.embed-footer-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

/* Send Panel */
.send-panel {
    border-top: 1px solid var(--border-color);
    padding: 1.5rem;
}

/* Responsive layout */
@media (max-width: 1200px) {
  .nav-container { padding: 0.75rem 1rem; }
}

@media (max-width: 1024px) {
  .builder-page { height: auto; overflow: visible; }
  .builder-container {
    grid-template-columns: 1fr;
    grid-template-areas:
      "edit"
      "preview"
      "send";
    height: auto;
  }
  .editor-panel, .preview-panel, .send-panel-container { min-height: auto; }
}

@media (max-width: 768px) {
  .btn-large { padding: 0.6rem 1rem; font-size: 0.95rem; }
  .editor-content, .preview-content, .send-panel { padding: 0.75rem 1rem; }
  .panel-header { padding: 0.75rem 1rem; }
  .mode-tabs, .send-tabs { flex-wrap: wrap; }
  .tab-button, .send-tab { flex: 1 0 45%; text-align: center; }
  .catsy_logo_img { max-width: 40%; }
  
  /* Navigation improvements for mobile */
  .navbar { flex-direction: column; align-items: stretch; gap: 0.5rem; margin-bottom: 0.5rem; }
  .nav-container { flex-direction: column; align-items: stretch; gap: 0.5rem; padding: 0.75rem; }
  .nav-tabs {
    gap: 0.5rem;
    position: static;
    left: auto;
    transform: none;
    width: 100%;
    max-width: 100%;
    padding: 0 0.25rem;
    box-sizing: border-box;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -ms-overflow-style: none;  /* IE/Edge */
    scrollbar-width: none;     /* Firefox */
  }
  .nav-tabs::after { display: none; }
  .nav-tabs::-webkit-scrollbar { display: none; }
  
  .nav-tabs .action-tab {
    font-size: 0.8rem;
    padding: 0.5rem 0.6rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 0 0 auto;
  }
  .nav-tabs .action-tab.active {
    background: transparent !important;
    border-color: transparent !important;
    color: var(--primary-color) !important;
    box-shadow: none !important;
    border-bottom: 2px solid var(--primary-color) !important;
    border-radius: 6px 6px 0 0 !important;
  }
  
  .navbar {
    padding: 0.75rem 0.5rem;
  }
  
  .nav-menu {
    gap: 0.5rem;
  }
  
  .nav-brand img {
    max-width: 100px;
    height: auto;
  }
  
  .user-avatar {
    width: 28px;
    height: 28px;
  }
  
  .btn-new {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }
  
  /* Prevent any element from causing horizontal overflow */
  * {
    max-width: 100%;
  }
  
  input, textarea, select {
    max-width: 100%;
  }
}

/* Ultra-small screens: icon-only tabs */
@media (max-width: 380px) {
  .nav-tabs .action-tab { font-size: 0; padding: 0.5rem; }
  .nav-tabs .action-tab i { font-size: 1rem; margin-right: 0; }
}

.send-content {
    display: none;
}

.send-content.active {
    display: block;
}

/* Warnings & Info */
.warning-box, .info-box {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.warning-box {
    background: #ff950a31;
    color: #fff;
    border: 1px solid #ffa412;
}

.info-box {
    background: linear-gradient(135deg, rgba(255, 103, 136, 0.15) 0%, rgba(255, 103, 136, 0.05) 100%);
    border: 2px solid rgba(255, 103, 136, 0.3);
        color: #ff6788;
}

.info-box strong {
    color: #ffffff;
}

.info-box small,
.form-group small {
    display: block;
    margin-top: 0.25rem;
    line-height: 1.4;
}

/* Webhook Identity Grid */
.webhook-identity-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .webhook-identity-grid {
        grid-template-columns: 1fr;
    }
}

/* Button Rows */
.button-row-item {
    background: var(--secondary-bg);

    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.button-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #242429;
}

.button-row-header h4 {
    margin: 0;
    font-size: 0.95rem;
}

.button-item {
    background: var(--bg-color);

    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.button-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.button-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .button-fields-grid {
        grid-template-columns: 1fr;
    }
}

/* Discord Button Preview */
.discord-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.discord-button {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.55rem 1.3rem;
    font-size: 0.8rem;
    border-radius: 4px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s;
}

.discord-button-primary {
    background: #5865f2;
    color: white;
}

.discord-button-primary:hover {
    background: #4654c0;
}

.discord-button-secondary {
    background: #29292d;
    color: white;
}

.discord-button-secondary:hover {
    background: #3b3b40;
}

.discord-button-success {
    background: #00863a;
    color: white;
}

.discord-button-success:hover {
    background: #047e37;
}

.discord-button-danger {
    background: #d22d39;
    color: white;
}

.discord-button-danger:hover {
    background: #b42831;
}

.discord-button-link {
    background: #29292d;
    color: #fff;
    border: none;
}

.discord-button-link:hover {
    background: #3b3b40;
}

/* Button Actions */
.button-action-config {
    background: var(--bg-color);

    border-radius: 6px;
    margin-top: 0.75rem;
}

.action-response-tabs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.action-tab {
    flex: 1;
    padding: 0.375rem 0.75rem;
    background: var(--secondary-bg);

    border-radius: 4px;
    color: var(--text-color);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.action-tab:hover {
    background: var(--hover-bg);
}

.action-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Embed Card Layout */
.embed-card {
    background: var(--bg-color);
    border: 1px solid rgba(255, 103, 136, 0.4);
    border-left: 4px solid #ff6788;
    border-radius: 12px;
    padding: 1.25rem;
}

.embed-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.embed-card-header h3 {
    margin: 0;
    font-size: 1.125rem;
    color: #ff6788;
    font-weight: 600;
}

.card-delete {
    background: rgba(255, 103, 136, 0.2);
    border: 1px solid rgba(255, 103, 136, 0.6);
    color: #ffb5c8;
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.card-delete:hover {
    background: rgba(255, 103, 136, 0.35);
    color: white;
}

.embed-section {
    position: relative;
    padding: 1rem;

    border-radius: 10px;
    margin-bottom: 1rem;
    background: #242429;
}

.embed-section::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, rgba(255, 103, 136, 0.4), rgba(255, 103, 136, 0));
}

.embed-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ff93ad;
    margin-bottom: 0.75rem;
    letter-spacing: 0.015em;
}

.embed-field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.embed-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.optional-field {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.optional-field[style*="display: none"] {
    opacity: 0;
    transform: translateY(-10px);
}

.optional-field[style*="display: flex"] {
    opacity: 1;
    transform: translateY(0);
}

.embed-field label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.65);
}

.embed-field input,
.embed-field textarea {
    width: 100%;
    background: #1a1a1e;
    border-radius: 8px;
    border-color: #1a1a1e;
    padding: 0.6rem 0.8rem;
    color: #fff;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.embed-field input:focus,
.embed-field textarea:focus {
    border-color: #ff6788;
    box-shadow: 0 0 0 2px rgba(255, 103, 136, 0.25);
    outline: none;
}

.embed-inline-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.embed-color-picker .color-picker-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.embed-color-picker input[type="color"] {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 8px;
    padding: 0;
    background: transparent;
    cursor: pointer;
}

.embed-color-picker input[type="text"] {
    flex: 1;
}

.input-with-actions {
    position: relative;
}

.input-actions {
    position: absolute;
    top: 50%;
    right: 0.35rem;
    transform: translateY(-50%);
    display: flex;
    gap: 0.35rem;
}

.action-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(255, 103, 136, 0.3);
    background: rgba(255, 103, 136, 0.12);
    color: #ffb5c8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border 0.2s ease, color 0.2s ease;
}

.action-icon:hover {
    background: rgba(255, 103, 136, 0.25);
    border-color: rgba(255, 103, 136, 0.6);
    color: white;
}

.action-icon.active {
    background: rgba(255, 103, 136, 0.3);
    border-color: #ff6788;
    color: white;
}

.icon-link::before,
.icon-user::before {
    font-family: "Material Icons";
    font-size: 20px;
    line-height: 1;
}

.icon-link::before {
    content: '\e157';
}

.icon-user::before {
    content: '\e0af';
}

.embed-section .checkbox-label {
    margin-top: 0.75rem;
    color: rgba(255, 255, 255, 0.75);
}

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

@media (max-width: 768px) {
    .embed-section::before {
        display: none;
    }

    .embed-card {
        padding: 1rem;
    }

    .embed-section {
        padding: 0.85rem;
    }

    .input-actions {
        position: static;
        transform: none;
        margin-top: 0.5rem;
    }
}

/* JSON Editor */
.json-editor-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.json-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.json-textarea {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    padding: 1rem;

    border-radius: 6px;
    resize: none;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: #000;
    animation: slideIn 0.3s ease;
    min-width: 300px;
}

.toast-success {
    background: var(--success-color);
}

.toast-error {
    background: var(--danger-color);
}

.toast-info {
    background: var(--secondary-color);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Mobile Preview FAB */
.mobile-preview-fab {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: 52px;
    height: 52px;
    border-radius: 999px;
    display: none;
    align-items: center;
    justify-content: center;
    background: #ff6788;
    color: #000;
    border: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    z-index: 10010;
}

.mobile-preview-fab i { font-size: 20px; }

/* Bottom sheet */
.mobile-preview-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: saturate(120%) blur(2px);
    z-index: 10009;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

.mobile-preview-sheet {
    position: fixed;
    left: 0; right: 0;
    bottom: -80vh;
    height: 70vh;
    background: var(--discord-bg);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: 0 -12px 32px rgba(0,0,0,0.45);
    z-index: 10011;
    transition: transform .25s ease, bottom .25s ease;
    display: flex;
    flex-direction: column;
}

.mobile-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.mobile-sheet-title { font-weight: 600; }

.mobile-sheet-close {
    background: transparent; border: 0; color: #b5bac1; cursor: pointer; font-size: 1.25rem;
}

.mobile-sheet-body {
    flex: 1; overflow: auto; padding: 1rem; background: var(--discord-bg);
}

/* Active state */
.mobile-preview-active #mobilePreviewBackdrop { opacity: 1; pointer-events: auto; }
.mobile-preview-active #mobilePreviewSheet { bottom: 0; }

/* Show FAB only on small screens */
@media (max-width: 768px) {
  .mobile-preview-fab { display: inline-flex; }
  .mobile-nav-fab { display: inline-flex; }
  /* Optionally hide desktop preview panel to save space */
  .preview-panel { display: none; }
  /* Exception: Show preview-panel for changelogPage */
  #changelogPage .preview-panel { display: block !important; }
  /* Hide top nav tabs in favor of burger menu */
  .nav-tabs { display: none !important; }
  
  /* Auto backup actions: icon-only */
  #autoBackupSection .section-actions-row .btn-new { font-size: 0; padding: 0.5rem !important; }
  #autoBackupSection .section-actions-row .btn-new i { font-size: 1rem; margin: 0; }
}

/* Responsive */
@media (max-width: 1200px) {
    .builder-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        height: auto;
        gap: 1rem;
    }
    
    .right-panels-container {
        grid-template-rows: auto auto;
    }

    .preview-panel, .send-panel-container {
        min-height: 400px;
    }
    
    .editor-panel {
        min-height: 500px;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .features {
        grid-template-columns: 1fr;
    }

    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Component Builder Styles */
.components-builder {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.component-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.component-title {
    font-weight: 600;
    color: var(--primary-color);
}

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

.component-section {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;

}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.component-add-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Footer */
.site-footer { background: #0f0f12; border-top: 1px solid #26262c; margin-top: 3rem; }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 2.5rem 2rem; display: grid; grid-template-columns: 1.2fr 2fr; gap: 2rem; align-items: start; }
.footer-brand-head { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.footer-logo { width: 40px; height: 40px; border-radius: 8px; }
.footer-brand-name { font-weight: 800; font-size: 1.1rem; }
.footer-desc { color: #b9bbbe; max-width: 40ch; margin-bottom: .85rem; }
.footer-ctas { display: flex; gap: .5rem; }
.footer-btn { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem .9rem; border-radius: 10px; text-decoration: none; color: #fff; background: #1f1f24; border: 1px solid #2c2c31; font-weight: 600; }
.footer-btn:hover { border-color: #ff6788; box-shadow: 0 6px 18px rgba(255,103,136,.12); transform: translateY(-1px); }
.footer-btn-primary { background: #ff6788; color: #000; border-color: #ff6788; }
.footer-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.footer-col h4 { color: #fff; font-size: .95rem; margin-bottom: .75rem; }
.footer-col ul { list-style: none; display: grid; gap: .5rem; }
.footer-col a { color: #b9bbbe; text-decoration: none; }
.footer-col a:hover { color: #fff; }

@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr; padding: 2rem 1rem; }
  .footer-columns { grid-template-columns: 1fr 1fr; gap: 1.25rem; }
}

@media (max-width: 560px) {
  .footer-columns { grid-template-columns: 1fr; }
}

/* Changelog */
.changelog { max-width: 1200px; margin: 2.5rem auto 0; padding: 0 2rem; }
.changelog-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.changelog h2 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); font-weight: 800; color: #fff; }
.changelog-sub { color: #b9bbbe; }
.changelog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.changelog-card { background: #1a1a1e; border: 1px solid #2c2c31; border-radius: 12px; padding: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.changelog-card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.badge { display: inline-block; font-size: .7rem; font-weight: 800; padding: .25rem .5rem; border-radius: 999px; }
.badge.rel { background: #ff6788; color: #000; }
.badge.pre { background: #ffb703; color: #000; }
.version { color: #b9bbbe; font-weight: 700; }
.changelog-card .title { font-size: 1rem; color: #fff; margin: .25rem 0; }
.changelog-card .content { color: #b9bbbe; font-size: .92rem; line-height: 1.5; }
.changelog-card .meta { color: #8b8f98; font-size: .8rem; margin-top: .25rem; }
.changelog-empty { background: #121214; border: 1px dashed #2c2c31; color: #8b8f98; padding: 1rem; border-radius: 10px; text-align: center; grid-column: 1/-1; }

@media (max-width: 900px) {
  .changelog { padding: 0 1rem; }
  .changelog-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .changelog-grid { grid-template-columns: 1fr; }
}

/* Ensure changelogPage builder-container is full width on mobile */
@media (max-width: 768px) {
  #changelogPage .builder-container {
    grid-template-columns: 1fr !important;
    padding: 0.5rem;
  }
  #changelogPage .preview-content {
    padding: 0.5rem;
  }
}
