/*
  style.css for chat.polyme (Responsive Update 2025)
  Focus: Mobile-First, Component-Based, Responsive
*/

/* -------------------------------- */
/* 1. Design System & Variables     */
/* -------------------------------- */
:root {
    --font-primary: 'Inter', 'Prompt', sans-serif;
    --font-display: 'Cinzel', 'Inter', 'Prompt', serif;

    /* Brand Colors — POLYME Venus (Jungle Emerald) */
    --color-brand-primary: #059669;            /* Venus deep emerald */
    --color-brand-hover: #047857;              /* Forest deep */
    --color-brand-light: rgba(5, 150, 105, 0.1);
    --color-brand-glow: rgba(16, 185, 129, 0.28);
    --color-brand-soft: #10B981;               /* Venus light mint */
    --color-brand-canopy: #065F46;             /* Jungle canopy */

    /* POLYME 7-planet prism reference (used for footer/legacy accents) */
    --p-sun:     #EA580C;
    --p-mercury: #CA8A04;
    --p-venus:   #059669;
    --p-mars:    #BE123C;
    --p-jupiter: #7C3AED;
    --p-saturn:  #312E81;
    --p-moon:    #64748B;

    /* Light Mode Palette — pearl prism base (matches void) */
    --color-bg: #FAFAFA;
    --color-surface-1: #FFFFFF;
    --color-surface-2: #F3F4F6;
    --color-text: #1F2937;
    --color-text-secondary: #6B7280;
    --color-border: #E5E7EB;
    --color-border-subtle: #EDEDED;

    /* Feedback Colors */
    --color-success: #28A745;
    --color-error: #DC3545;
    --color-info: #007BFF;

    /* Backward-compat aliases (legacy variable names from prior themes). */
    --color-accent: var(--color-brand-primary);
    --color-primary-brand: var(--color-brand-primary);
    --color-surface: var(--color-surface-1);
    --color-surface-darker: var(--color-surface-2);

    /* Spacing & Radius */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 999px;

    /* Transitions & Shadows */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* -------------------------------- */
/* 2. Dark Mode Implementation      */
/* -------------------------------- */
body.dark-mode {
    /* Jungle night — deep forest with emerald accents */
    --color-bg: #0B1410;
    --color-surface-1: #11201A;
    --color-surface-2: #18302A;
    --color-text: #E5F7EE;
    --color-text-secondary: #9DB6AC;
    --color-border: #1F3A33;
    --color-border-subtle: #182C26;
    --color-brand-light: rgba(16, 185, 129, 0.18);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 18px rgba(0, 0, 0, 0.55);
}

/* -------------------------------- */
/* 3. Reset & Base Styles           */
/* -------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    height: 100%;
}

body {
    min-height: 100%;
    font-family: var(--font-primary);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

h1, h2, h3, h4 {
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    color: var(--color-text);
}

h2 {
    font-size: 1.75rem;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

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

a {
    color: var(--color-brand-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-brand-hover);
}

.instruction-link {
    text-decoration: underline;
}

/* -------------------------------- */
/* 4. Forms & Inputs                */
/* -------------------------------- */
.form-group {
    margin-bottom: var(--spacing-md);
}

label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    font-size: 14px;
}

textarea, input[type="text"], input[type="password"], input[type="number"] {
    width: 100%;
    padding: 12px var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background-color: var(--color-surface-1);
    color: var(--color-text);
    font-family: inherit;
    font-size: 15px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

textarea:focus, input:focus {
    outline: none;
    border-color: var(--color-brand-primary);
    box-shadow: 0 0 0 3px var(--color-brand-light);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

/* -------------------------------- */
/* 5. Buttons & Controls            */
/* -------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px var(--spacing-lg);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
    text-align: center;
    gap: var(--spacing-sm);
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

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

.btn-primary {
    background-color: var(--color-brand-primary);
    background-image: linear-gradient(135deg, var(--color-brand-soft) 0%, var(--color-brand-primary) 55%, var(--color-brand-canopy) 100%);
    color: #FFFFFF;
    box-shadow: 0 6px 18px -6px var(--color-brand-glow);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--color-brand-hover);
    box-shadow: 0 8px 22px -4px var(--color-brand-glow);
    filter: brightness(1.05);
}

.btn-secondary {
    background-color: var(--color-surface-2);
    color: var(--color-text);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--color-border);
}

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

.btn-outline {
    background-color: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border);
}
.btn-outline:hover:not(:disabled){
    background-color: var(--color-surface-2);
}

.btn-small {
    padding: 8px var(--spacing-md);
    font-size: 13px;
}

.btn-full-width {
    width: 100%;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0; width: 0; height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--color-border);
    transition: var(--transition-fast);
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: var(--transition-fast);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

input:checked + .toggle-slider {
    background-color: var(--color-brand-primary);
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    font-size: 14px;
    gap: var(--spacing-md);
}
.toggle-row:last-child {
    margin-bottom: 0;
}

/* -------------------------------- */
/* 6. Loader & Utilities            */
/* -------------------------------- */
.hidden {
    display: none !important;
}

#app-loader {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    position: fixed;
    width: 100%;
    background-color: var(--color-bg);
    z-index: 9999;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(5, 150, 105, 0.18);
    border-top-color: var(--color-brand-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* -------------------------------- */
/* 7. Login Page (Landing)          */
/* -------------------------------- */
#login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #1F2937;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 12% 18%, rgba(16, 185, 129, 0.12) 0%, transparent 45%),
        radial-gradient(circle at 88% 12%, rgba(5, 150, 105, 0.10) 0%, transparent 50%),
        radial-gradient(circle at 78% 92%, rgba(6, 95, 70, 0.10) 0%, transparent 55%),
        radial-gradient(ellipse at top, #FFFFFF 0%, #FAFAFA 55%, #F3F4F6 100%);
}
#login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(5, 150, 105, 0.06) 0 1px, transparent 1px),
        radial-gradient(circle at 70% 60%, rgba(16, 185, 129, 0.05) 0 1px, transparent 1px);
    background-size: 120px 120px, 180px 180px;
    opacity: 0.5;
    z-index: 0;
}
#login-page > * { position: relative; z-index: 1; }
#login-page h2, #login-page h3, #login-page h4 {
    color: #0F172A;
}
#login-page p {
    color: #4B5563;
}

.login-main-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.login-wrapper {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    padding: var(--spacing-lg);
}

.info-box {
    padding: var(--spacing-xl) 0;
}

.info-box h2 {
    font-size: clamp(2.2rem, 6vw, 3.5rem);
}

.features-list {
    list-style: none;
    margin-top: var(--spacing-lg);
}

.features-list li {
    display: flex;
    align-items: flex-start;
    margin-bottom: var(--spacing-lg);
    gap: var(--spacing-md);
    opacity: 0;
    transform: translateX(-20px);
    animation: slideIn 0.5s ease-out forwards;
}

.features-list li:nth-child(1) { animation-delay: 0.2s; }
.features-list li:nth-child(2) { animation-delay: 0.3s; }
.features-list li:nth-child(3) { animation-delay: 0.4s; }

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

.features-list i {
    font-size: 1.5rem;
    color: var(--color-brand-primary);
    background-image: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(5, 150, 105, 0.10) 100%);
    padding: 12px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(5, 150, 105, 0.18);
}

.login-box {
    padding: var(--spacing-xl) var(--spacing-lg);
    background-color: #06241B;
    color: white !important;
    position: relative;
    width: 100%;
    max-width: 450px;
    border-radius: var(--radius-lg);
    margin: var(--spacing-xl) auto 0;
    box-shadow: 0 18px 40px -12px rgba(5, 95, 70, 0.45), 0 0 0 1px rgba(16, 185, 129, 0.18);
    background-image:
        radial-gradient(circle at 18% 12%, rgba(16, 185, 129, 0.22) 0%, transparent 55%),
        radial-gradient(circle at 88% 90%, rgba(5, 150, 105, 0.18) 0%, transparent 55%),
        linear-gradient(135deg, #0E2A21 0%, #061612 100%);
    overflow: hidden;
}
.login-box::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        radial-gradient(circle at 30% 25%, rgba(255,255,255,0.04) 0 1px, transparent 1.5px),
        radial-gradient(circle at 70% 80%, rgba(16,185,129,0.10) 0 1px, transparent 1.5px);
    background-size: 90px 90px, 130px 130px;
    pointer-events: none;
    opacity: 0.7;
}
.login-box > * { position: relative; z-index: 1; }

.login-box h1, .login-box p, .login-box label {
    color: white !important;
}

.login-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.login-header h1 {
    font-size: 2.5rem;
    font-weight: 900;
}

.btn-instagram {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
    color: white;
}
.btn-line {
    background-color: #06C755;
    color: white;
}
.btn-dark {
    background-color: #061612;
    color: white;
    border: 1px solid rgba(16, 185, 129, 0.25);
}
.btn-outline-light {
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
    background: transparent;
}
.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* How It Works Section */
.how-it-works-section {
    padding: var(--spacing-xl) var(--spacing-lg);
    text-align: center;
}
.how-it-works-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
    max-width: 1000px;
    margin: var(--spacing-xl) auto 0;
}
.how-it-works-step {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(5, 95, 70, 0.06);
    border: 1px solid rgba(5, 150, 105, 0.08);
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-smooth);
    position: relative;
    overflow: hidden;
}
.how-it-works-step::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--color-brand-soft), var(--color-brand-primary), var(--color-brand-canopy));
    opacity: 0.7;
}
.how-it-works-step:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 30px -8px var(--color-brand-glow);
    border-color: rgba(5, 150, 105, 0.25);
}
.step-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto var(--spacing-md);
}
.step-icon svg {
    width: 100%; height: 100%;
}

/* -------------------------------- */
/* 8. App Shell Layout (Mobile First) */
/* -------------------------------- */
#app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
#main-content {
    flex-grow: 1;
    padding: var(--spacing-lg);
    padding-bottom: 100px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.page-view {
    display: none;
    animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.page-view.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Navigation (Bottom Bar) */
#main-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--color-surface-1);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: var(--spacing-sm) 0;
    border-top: 1px solid var(--color-border-subtle);
}
.logo-container, #nav-account-switcher-container {
    display: none;
}
#nav-menu {
    display: flex;
    justify-content: space-around;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-sm);
    color: var(--color-text-secondary);
    font-size: 12px;
    text-decoration: none;
    transition: color var(--transition-fast);
    flex-grow: 1;
    text-align: center;
}
.nav-item.disabled {
    pointer-events: none;
    opacity: 0.4;
}
.nav-item i {
    font-size: 22px;
    margin-bottom: 4px;
}
.nav-item.active, .nav-item:hover {
    color: var(--color-brand-primary);
}
.nav-logout {
    display: none;
}

/* -------------------------------- */
/* 9. Interactive Cards             */
/* -------------------------------- */
.card {
    background-color: var(--color-surface-1);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border-subtle);
    position: relative; /* For z-index context */
}

.card.is-switcher-open {
    z-index: 11; /* Make card with open switcher appear above others */
}

.interactive-card {
    padding: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(15px) scale(0.98);
    animation: cardEntrance 0.5s var(--transition-smooth) forwards;
    animation-delay: calc(var(--card-index) * 0.05s);
}

@keyframes cardEntrance {
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.card-header {
    display: flex;
    align-items: center;
    padding: var(--spacing-md);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}
.interactive-card.expanded .card-header {
    background-color: var(--color-surface-2);
}
.card-header:hover {
    background-color: var(--color-surface-2);
}
.post-thumbnail {
    width: 55px;
    height: 55px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-right: var(--spacing-md);
    flex-shrink: 0;
    background-color: var(--color-surface-2);
}
.post-thumbnail img, .post-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.post-summary {
    flex-grow: 1;
    min-width: 0;
}
.caption-preview {
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--color-text);
}
.card-header-actions {
    display: flex;
    align-items: center;
    margin-left: var(--spacing-md);
}
.card-indicators {
    display: none;
    gap: var(--spacing-sm);
    margin-right: var(--spacing-md);
}
.btn-toggle-settings {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: transform var(--transition-smooth);
}
.interactive-card.expanded .btn-toggle-settings {
    transform: rotate(180deg);
}
.card-settings-panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--transition-smooth);
    border-top: 1px solid transparent;
}
.interactive-card.expanded .card-settings-panel {
    grid-template-rows: 1fr;
    border-top-color: var(--color-border);
}
.settings-content {
    overflow: hidden;
    padding: 0 var(--spacing-lg);
    visibility: hidden;
    transition: visibility 0s linear var(--transition-smooth), padding var(--transition-smooth);
}
.interactive-card.expanded .settings-content {
    visibility: visible;
    padding: var(--spacing-lg);
    transition-delay: 0s;
}

/* -------------------------------- */
/* 10. Internal Card Components     */
/* -------------------------------- */
.post-settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}
.setting-group {
    padding: var(--spacing-md);
    background-color: var(--color-surface-2);
    border-radius: var(--radius-md);
}
.setting-group h4 {
    font-size: 15px;
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.prompt-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.response-mode-tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--spacing-lg);
}
.response-mode-tab {
    padding: var(--spacing-md);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
    border-bottom: 3px solid transparent;
    margin-bottom: -1px; /* Overlap border */
    gap: var(--spacing-sm);
    display: inline-flex;
    align-items: center;
}
.response-mode-tab.active {
    color: var(--color-brand-primary);
    border-bottom-color: var(--color-brand-primary);
}
.response-mode-content { display: none; }
.response-mode-content.active { display: block; }

.keyword-input-container {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height var(--transition-smooth), opacity var(--transition-smooth), margin-top var(--transition-smooth);
    margin-top: 0;
}
.keyword-input-container.visible {
    max-height: 200px;
    opacity: 1;
    margin-top: var(--spacing-md);
}

.pdf-upload-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}
.pdf-status {
    font-size: 13px;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}
.pdf-status.has-file {
    color: var(--color-success);
    font-weight: 600;
}
.pdf-controls, .pdf-controls-dynamic {
    display: flex;
    gap: var(--spacing-sm);
}


/* -------------------------------- */
/* 11. Status Badges & Tags         */
/* -------------------------------- */
.tag, .status-badge, .card-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    gap: var(--spacing-xs);
}
.status-badge.active {
    background-color: var(--color-brand-light);
    color: var(--color-brand-primary);
}
.status-badge.inactive {
    background-color: var(--color-surface-2);
    color: var(--color-text-secondary);
}
.tag.success {
    background-color: rgba(40, 167, 69, 0.15);
    color: var(--color-success);
}
.pdf-tag {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--color-error);
}
.usage-tag {
    background-color: rgba(0, 123, 255, 0.1);
    color: var(--color-info);
}

/* -------------------------------- */
/* 12. Settings Page & Components   */
/* -------------------------------- */
.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--color-border-subtle);
}
.settings-item:last-child {
    border-bottom: none;
}

.language-switcher {
    display: flex;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--color-border);
}
.lang-btn {
    padding: 6px 12px;
    background-color: var(--color-surface-2);
    color: var(--color-text-secondary);
    border: none;
    cursor: pointer;
    font-size: 13px;
    transition: all var(--transition-fast);
}
.lang-btn:not(:last-child) {
    border-right: 1px solid var(--color-border);
}
.lang-btn.active {
    background-color: var(--color-brand-primary);
    color: #FFFFFF;
}

.language-switcher-container {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
}
#language-switcher-login {
    border-color: rgba(255, 255, 255, 0.3);
}
#language-switcher-login .lang-btn {
    background-color: transparent;
    color: rgba(255, 255, 255, 0.7);
}
#language-switcher-login .lang-btn:not(:last-child) {
    border-right-color: rgba(255, 255, 255, 0.3);
}
#language-switcher-login .lang-btn.active {
    background-color: var(--color-brand-primary);
    color: white;
}

/* --- ✨ NEW/UPDATED: Account Switcher Styles --- */
.account-switcher-container {
    position: relative;
    display: inline-block;
    width: 100%;
}
.account-switcher-trigger {
    display: flex;
    align-items: center;
    width: 100%;
    padding: var(--spacing-sm);
    background-color: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    gap: var(--spacing-sm);
}
.nav-account-switcher-container .account-switcher-trigger {
    background-color: var(--color-surface-2);
    border: none;
}
.current-profile-pic {
    width: 40px; height: 40px; border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.current-profile-info {
    flex-grow: 1;
    color: var(--color-text);
    min-width: 0;
}
.current-profile-info strong {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}
.current-profile-info span {
    font-size: 12px;
    color: var(--color-text-secondary);
}
.item-platform-icon-trigger, .switcher-chevron {
    color: var(--color-text-secondary);
    flex-shrink: 0;
}
.item-platform-icon-trigger { font-size: 18px; }
.switcher-chevron {
    margin-left: var(--spacing-xs);
    transition: transform var(--transition-fast);
}
.account-switcher-trigger[aria-expanded="true"] .switcher-chevron {
    transform: rotate(180deg);
}
.account-switcher-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background-color: var(--color-surface-1);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 10;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity var(--transition-fast), transform var(--transition-fast), visibility 0s var(--transition-fast);
    max-height: 250px;
    overflow-y: auto;
}
.account-switcher-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0s;
}
.account-switcher-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    gap: var(--spacing-sm);
}
.account-switcher-item:hover { background-color: var(--color-surface-2); }
.account-switcher-item.active { background-color: var(--color-brand-light); }
.item-profile-pic { width: 30px; height: 30px; border-radius: 50%; }
.item-name { flex-grow: 1; font-size: 14px; }
.item-platform-icon { margin-left: auto; font-size: 16px; color: var(--color-text-secondary); }

/* --- ✨ NEW: Integration Buttons Grid --- */
.integration-buttons-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}
.integration-buttons-grid .btn {
    justify-content: flex-start;
}

/* Usage Gauge */
.usage-gauge-container {
    margin-bottom: var(--spacing-lg);
}
.usage-gauge {
    width: 100%; height: 24px; background-color: var(--color-surface-2);
    border-radius: var(--radius-full); overflow: hidden;
}
.usage-gauge-bar {
    height: 100%; background-color: var(--color-brand-primary);
    transition: width 1s ease-out; display: flex; align-items: center;
    justify-content: flex-end; padding-right: 8px; color: white; font-size: 12px;
}
.usage-gauge-bar.high-usage { background-color: #ffc107; }
.usage-gauge-bar.over-limit { background-color: var(--color-error); }
.usage-text { font-size: 14px; margin-top: var(--spacing-sm); }
.usage-text.over-limit { color: var(--color-error); font-weight: 600; }

/* Pricing Plans */
.pricing-container {
    display: grid; grid-template-columns: 1fr; gap: var(--spacing-md);
}
.pricing-plan {
    border: 1px solid var(--color-border); padding: var(--spacing-lg);
    border-radius: var(--radius-md); text-align: center;
    transition: all var(--transition-smooth);
    position: relative;
}
.pricing-plan:hover {
    border-color: var(--color-brand-primary);
    box-shadow: 0 10px 28px -8px var(--color-brand-glow);
    transform: translateY(-5px);
}
.price { font-size: 2.5rem; font-weight: 800; color: var(--color-brand-primary); }
#mobile-logout-card { display: block; }

/* -------------------------------- */
/* 13. Modals & Overlays            */
/* -------------------------------- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6); display: flex; justify-content: center;
    align-items: center; z-index: 2000; opacity: 0; visibility: hidden;
    transition: opacity var(--transition-fast), visibility 0s var(--transition-fast);
    padding: var(--spacing-md);
}
.modal-overlay.visible {
    opacity: 1; visibility: visible; transition-delay: 0s;
}
.modal-content {
    background-color: var(--color-surface-1); padding: var(--spacing-lg);
    border-radius: var(--radius-md); box-shadow: var(--shadow-md);
    max-width: 500px; width: 100%; position: relative;
    transform: scale(0.95); transition: transform var(--transition-fast);
}
.modal-overlay.visible .modal-content { transform: scale(1); }
.close-modal-btn {
    position: absolute; top: 10px; right: 10px; background: none;
    border: none; font-size: 24px; cursor: pointer; color: var(--color-text-secondary);
}
.modal-footer {
    display: flex; justify-content: flex-end; gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
}
.result-box {
    background-color: var(--color-surface-2); padding: var(--spacing-md);
    border-radius: var(--radius-sm); min-height: 80px;
}

/* Prompt Library */
#prompt-library-modal .modal-content {
    display: flex; flex-direction: column; max-height: 85vh;
}
#prompt-library-modal .prompt-library-list {
    flex: 1; overflow-y: auto; padding-right: 10px; margin-right: -10px;
}
.prompt-item {
    display: grid; grid-template-columns: auto 1fr auto; align-items: center;
    padding: var(--spacing-md) 0; border-bottom: 1px solid var(--color-border-subtle);
    gap: var(--spacing-md);
}
.prompt-item:hover { background-color: var(--color-surface-2); }
.prompt-item:last-child { border-bottom: none; }
.prompt-icon { font-size: 24px; color: var(--color-brand-primary); }
.prompt-preview code {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
    color: var(--color-text-secondary);
}

/* -------------------------------- */
/* 14. Specific Popups              */
/* -------------------------------- */
#pdpa-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.8); display: flex; justify-content: center;
    align-items: center; z-index: 3000;
}
.pdpa-modal {
    background-color: var(--color-surface-1); padding: var(--spacing-xl);
    border-radius: var(--radius-lg); max-width: 450px; width: 90%;
    text-align: center;
}
#pdpa-overlay.hidden { display: none; }
.pdpa-modal .icon { font-size: 48px; color: var(--color-brand-primary); }
.pdpa-modal .actions { margin-top: var(--spacing-lg); display: flex; flex-direction: column; gap: var(--spacing-md); }
.pdpa-checkbox-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    text-align: left;
    margin-top: var(--spacing-lg);
}
.pdpa-checkbox-label input { display: none; }
.pdpa-checkmark {
    width: 20px; height: 20px; border: 2px solid var(--color-border);
    border-radius: 4px; margin-right: 12px;
    display: inline-block; position: relative;
    transition: all var(--transition-fast);
}
.pdpa-checkbox-label input:checked ~ .pdpa-checkmark {
    background-color: var(--color-brand-primary);
    border-color: var(--color-brand-primary);
}
.pdpa-checkmark::after {
    content: ''; position: absolute; display: none;
    left: 6px; top: 2px; width: 5px; height: 10px;
    border: solid white; border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}
.pdpa-checkbox-label input:checked ~ .pdpa-checkmark::after {
    display: block;
}

#cookie-consent-banner {
    position: fixed; bottom: 0; left: 0; right: 0;
    background-color: var(--color-surface-1); box-shadow: var(--shadow-md);
    padding: var(--spacing-md); z-index: 1500;
    animation: fadeIn 0.5s ease-out;
}
.cookie-consent-content { display: flex; flex-direction: column; gap: var(--spacing-md); }
.cookie-actions { display: flex; gap: var(--spacing-sm); }
/* -------------------------------- */
/* 15. Responsive Design            */
/* -------------------------------- */

@media (min-width: 768px) {
    /* Tablet Adjustments */
    .post-settings-grid {
        grid-template-columns: 1fr 1fr;
    }
    .pricing-container, .how-it-works-grid, .integration-buttons-grid, .line-setup-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    .card-indicators { display: flex; }
    .cookie-consent-content { flex-direction: row; align-items: center; justify-content: space-between; }
    #cookie-consent-banner { left: var(--spacing-lg); right: var(--spacing-lg); bottom: var(--spacing-lg); border-radius: var(--radius-md); }
    .login-wrapper { padding: var(--spacing-xl); }
}

@media (min-width: 1024px) {
    /* Desktop Layout (Sidebar) */
    #app-shell { flex-direction: row; }
    #main-nav {
        position: sticky; top: 0; height: 100vh; width: 260px;
        bottom: auto; left: auto; right: auto;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
        display: flex; flex-direction: column;
        padding: var(--spacing-lg) 0; border-top: none;
    }
    .logo-container {
        display: block; padding: 0 var(--spacing-lg) var(--spacing-lg);
        border-bottom: 1px solid var(--color-border-subtle);
    }
    /* ✨ NEW: Make switcher visible and style it */
    #nav-account-switcher-container {
        display: block;
        padding: var(--spacing-md) var(--spacing-md) 0;
    }
    #nav-menu {
        flex-direction: column; flex-grow: 1; padding: var(--spacing-md);
    }
    .nav-item {
        flex-direction: row; justify-content: flex-start;
        font-size: 15px; padding: 12px var(--spacing-md);
        border-radius: var(--radius-sm); margin-bottom: var(--spacing-xs);
    }
    .nav-item i {
        font-size: 18px; margin-right: var(--spacing-md); margin-bottom: 0;
        width: 20px; /* Align text */
        text-align: center;
    }
    .nav-item.active {
        background-color: var(--color-brand-light); color: var(--color-brand-primary);
    }
    .nav-item:not(.active):hover { background-color: var(--color-surface-2); }
    .nav-logout {
        display: flex; margin: var(--spacing-md); border-top: 1px solid var(--color-border-subtle);
        padding-top: var(--spacing-md);
    }
    #main-content { padding: var(--spacing-xl); padding-bottom: var(--spacing-xl); }
    #mobile-logout-card { display: none; }

    /* Desktop Login Page (Split View) */
    .login-wrapper {
        flex-direction: row; justify-content: space-between; align-items: center;
        min-height: 80vh; margin-top: 0; gap: var(--spacing-xl);
    }
    .info-box, .login-box { flex: 1; padding: var(--spacing-xl); }
    .info-box { max-width: 55%; }
    .login-box { max-width: 450px; margin-top: 0; }
}

/* -------------------------------- */
/* 14. Onboarding (Tutorial)        */
/* -------------------------------- */
#onboarding-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 5000;
    display: none;
}

#onboarding-overlay.visible {
    display: block;
}

.onboarding-highlight {
    position: relative;
    z-index: 5001;
    /* Highlight effect */
    box-shadow: 0 0 0 4px var(--color-brand-primary);
    border-radius: var(--radius-md);
    background-color: var(--color-surface-1) !important; /* Ensure visibility above overlay */
}

.onboarding-tooltip {
    position: fixed;
    background-color: var(--color-surface-1);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    z-index: 5002;
    max-width: 300px;
    display: none;
}

.onboarding-tooltip.visible {
    display: block;
}

/* -------------------------------- */
/* 15. Specific Popups (PDPA, In-App Browser, Cookie) */
/* -------------------------------- */
/* PDPA Modal */
#pdpa-overlay.hidden {
    display: none;
}

#pdpa-overlay {
    /* Uses modal-overlay principles */
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.pdpa-modal {
    background-color: var(--color-surface-1);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    max-width: 450px;
    width: 90%;
    text-align: center;
}

.pdpa-modal .icon {
    font-size: 48px;
    color: var(--color-brand-primary);
}

.pdpa-modal .actions {
    margin-top: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* In-App Browser Popup */
.instruction-popup {
    /* Uses modal-overlay styles but higher z-index */
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 9998;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.instruction-popup.visible {
    opacity: 1;
    visibility: visible;
}

.instruction-popup-content {
    background-color: var(--color-surface-1);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 400px;
}

/* Cookie Consent Banner */
#cookie-consent-banner {
    position: fixed;
    bottom: var(--spacing-md);
    left: var(--spacing-md);
    right: var(--spacing-md);
    background-color: var(--color-surface-1);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    z-index: 1500;
    animation: fadeIn 0.5s ease-out;
}

.cookie-consent-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* --- FIX: Prompt Library Modal Scroll --- */

#prompt-library-modal .modal-content {
    /* 1. ทำให้ modal เป็น flex container ในแนวตั้ง */
    display: flex;
    flex-direction: column;
    
    /* 2. จำกัดความสูงสูงสุดของ modal ไม่ให้เกิน 85% ของความสูงหน้าจอ */
    max-height: 85vh; 
}

#prompt-library-modal .prompt-library-list {
    /* 3. ทำให้ list นี้ยืดตามพื้นที่ที่เหลืออยู่ */
    flex: 1; 

    /* 4. [สำคัญที่สุด] ทำให้ scroll ได้เมื่อเนื้อหาล้น */
    overflow-y: auto; 

    /* 5. (Optional) เพิ่มช่องว่างด้านขวาเล็กน้อย กัน scrollbar ติดเนื้อหา */
    padding-right: 10px;
    margin-right: -10px; /* ชดเชย padding เพื่อให้ layout ไม่เพี้ยน */
}

/* 🎨 (Optional) ตกแต่งเล็กน้อย: เอาเส้นขอบของ item สุดท้ายออก */
#prompt-library-modal .prompt-item:last-child {
    border-bottom: none;
}


/* Styling for the recommended trial offer */
.pricing-plan.recommended {
    border-color: var(--color-brand-primary);
    box-shadow: 0 0 20px var(--color-brand-glow);
    transform: scale(1.03);
}

.pricing-plan.recommended::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--color-brand-primary);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

/* --- ✨ FIX: Compact Nav Account Switcher (Desktop) --- */

/* ทำให้ Container ของปุ่มใน Nav bar กระชับขึ้น */
@media (min-width: 1024px) {
    #nav-account-switcher-container {
        padding: var(--spacing-sm) var(--spacing-md); /* ลด padding บน-ล่าง */
    }

    /* ย่อขนาดรูปโปรไฟล์ในปุ่ม */
    #nav-account-switcher-container .current-profile-pic {
        width: 34px;
        height: 34px;
    }

    /* ปรับข้อมูลตัวอักษรข้างๆ ให้ขนาดพอดีขึ้น */
    #nav-account-switcher-container .current-profile-info strong {
        font-size: 13px; /* ลดขนาดชื่อเล็กน้อย */
    }

    #nav-account-switcher-container .current-profile-info span {
        font-size: 11px; /* ลดขนาด 'Switch Profile' */
    }
}
/* -------------------------------- */
/* ✨ UPDATED: Live/Dev Mode Panic Button */
/* -------------------------------- */

.panic-btn {
    /* ทรงแคปซูล แบบ Dashboard */
    border: 1px solid var(--color-border) !important;
    background-color: var(--color-surface-1) !important;
    color: var(--color-text) !important;
    border-radius: 999px !important; /* แคปซูลมนๆ */
    padding: 6px 16px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px;
    font-family: 'Inter', monospace; /* ให้ฟีล Dev */
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* ไอคอนสถานะ (ตัวไฟจุดๆ) */
.panic-btn i {
    font-size: 10px !important; /* ลดขนาดไอคอนให้เหมือนไฟสถานะ */
    transition: all 0.3s ease;
}

/* --- สถานะปกติ: SYSTEM ON (สีเขียว Live) --- */
.panic-btn:not(.system-paused) {
    border-color: rgba(40, 167, 69, 0.3) !important;
    color: var(--color-text) !important;
}

.panic-btn:not(.system-paused) i {
    color: var(--color-success); /* สีเขียว */
    text-shadow: 0 0 8px rgba(40, 167, 69, 0.6); /* เรืองแสง */
    animation: pulse-green-glow 2s infinite;
}

/* --- สถานะหยุด: SYSTEM PAUSED (สีแดง/ส้ม Dev Mode Warning) --- */
.panic-btn.system-paused {
    background-color: #1a1a1a !important; /* พื้นหลังดำ/เทาเข้ม ให้ดู Tech */
    border-color: var(--color-error) !important;
    color: #ffffff !important;
    box-shadow: 0 0 15px rgba(220, 53, 69, 0.3);
}

.panic-btn.system-paused i {
    color: var(--color-error);
    text-shadow: 0 0 10px rgba(220, 53, 69, 1);
    animation: blink-red-rapid 1s infinite; /* กระพริบถี่ๆ */
}

.panic-btn.system-paused .panic-text {
    color: #ff6b6b; /* สีแดงอ่อนบนพื้นดำ */
}

/* --- Hover Effect --- */
.panic-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* --- Animations --- */
@keyframes pulse-green-glow {
    0% { opacity: 0.6; text-shadow: 0 0 5px rgba(40, 167, 69, 0.4); }
    50% { opacity: 1; text-shadow: 0 0 12px rgba(40, 167, 69, 0.9); transform: scale(1.1); }
    100% { opacity: 0.6; text-shadow: 0 0 5px rgba(40, 167, 69, 0.4); }
}

@keyframes blink-red-rapid {
    0%, 100% { opacity: 1; text-shadow: 0 0 10px rgba(220, 53, 69, 0.8); }
    50% { opacity: 0.3; text-shadow: none; }
}

/* --- Responsive Update --- */
@media (max-width: 768px) {
    .panic-btn {
        padding: 8px !important;
        width: 36px;
        height: 36px;
        justify-content: center;
        border-radius: 50% !important; /* มือถือเป็นวงกลม */
    }
    .panic-text {
        display: none;
    }
    .panic-btn i {
        font-size: 14px !important; /* มือถือไอคอนใหญ่ขึ้นหน่อย */
        margin: 0 !important;
    }
}

/* -------------------------------- */
/* 17. POLYME Prism — Venus / Jungle accents */
/* -------------------------------- */

/* Animated jungle gradient sweep — used for hero headings */
@keyframes jungle-shine { to { background-position: 200% center; } }
@keyframes jungle-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.text-gradient-jungle {
    background: linear-gradient(100deg,
        #10B981 0%,
        #059669 35%,
        #047857 55%,
        #065F46 75%,
        #10B981 100%);
    background-size: 220% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    animation: jungle-shine 12s linear infinite;
}

.kicker {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 6px 16px; border-radius: 99px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(5, 150, 105, 0.18);
    color: var(--color-brand-canopy);
    font-size: 0.7rem; font-weight: 700;
    letter-spacing: 0.26em; text-transform: uppercase;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.kicker-dot {
    display: inline-block; width: 7px; height: 7px; border-radius: 50%;
    background: conic-gradient(from 0deg, #10B981, #059669, #065F46, #10B981);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.45);
    animation: jungle-shine 8s linear infinite;
}

/* Venus glow ring around the login logo (chat product-card vibe) */
#login-page .login-header svg {
    filter: drop-shadow(0 6px 18px rgba(16, 185, 129, 0.55));
    animation: jungle-float 6s ease-in-out infinite;
}
#login-page .login-header h1 {
    background: linear-gradient(100deg, #10B981 0%, #FFFFFF 50%, #10B981 100%);
    background-size: 220% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    animation: jungle-shine 10s linear infinite;
    letter-spacing: 0.04em;
}
#login-page .login-header p {
    color: rgba(229, 247, 238, 0.88) !important;
}

/* "Powered by POLYME" prism dot accent — works on any element with .polyme-dot */
.polyme-dot {
    background: conic-gradient(from 0deg, #EA580C, #CA8A04, #059669, #312E81, #7C3AED, #BE123C, #EA580C);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: jungle-shine 6s linear infinite;
}

/* Subtle prism scanline on the desktop sidebar — anchors the chat to the void brand */
@media (min-width: 1024px) {
    #main-nav {
        background:
            linear-gradient(180deg, rgba(255,255,255,0.92) 0%, rgba(250,250,250,0.92) 100%);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border-right: 1px solid rgba(5, 150, 105, 0.10);
    }
    #main-nav::before {
        content: '';
        position: absolute; top: 0; bottom: 0; right: 0; width: 2px;
        background: linear-gradient(180deg,
            transparent 0%,
            rgba(16, 185, 129, 0.35) 30%,
            rgba(5, 95, 70, 0.35) 70%,
            transparent 100%);
        opacity: 0.6;
        pointer-events: none;
    }
    body.dark-mode #main-nav {
        background: linear-gradient(180deg, rgba(11, 20, 16, 0.92), rgba(17, 32, 26, 0.92));
        border-right-color: rgba(16, 185, 129, 0.18);
    }
}

/* Card prism edge — light top hairline on every .card to echo void's product cards */
.card {
    border-top: 3px solid transparent;
    background-image:
        linear-gradient(var(--color-surface-1), var(--color-surface-1)),
        linear-gradient(90deg, var(--color-brand-soft), var(--color-brand-primary), var(--color-brand-canopy));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: 0 4px 20px -8px rgba(5, 95, 70, 0.10);
}
.card.interactive-card { border-top-color: transparent; }

body.dark-mode .card {
    background-image:
        linear-gradient(var(--color-surface-1), var(--color-surface-1)),
        linear-gradient(90deg, #10B981, #059669, #065F46);
}

/* DM/usage tag in Venus mint, not orange-info */
.tag.success, .pdf-tag, .usage-tag {
    border: 1px solid transparent;
}
.usage-tag {
    background-color: rgba(5, 150, 105, 0.10);
    color: var(--color-brand-canopy);
    border-color: rgba(5, 150, 105, 0.20);
}
body.dark-mode .usage-tag {
    color: var(--color-brand-soft);
}

/* =========================================================
   BRAND WORDMARK — mirrors void's POLYME.DOT lockup
   ========================================================= */
.brand-dot {
    background: conic-gradient(from 0deg,
        #10B981, #34D399, #6EE7B7, #059669, #047857, #065F46, #10B981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    animation: jungle-shine 6s linear infinite;
    font-weight: 900;
}

/* Sidebar brand lockup */
.logo-container .nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    position: relative;
    padding: 4px 2px;
}
.logo-container .nav-brand svg {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 2px 10px rgba(5, 150, 105, 0.28));
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}
.logo-container .nav-brand:hover svg {
    transform: scale(1.1) rotate(-5deg);
}
.logo-container .nav-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.1em;
    color: var(--color-text);
    margin-top: 4px;
}

/* =========================================================
   FOOTER — void-style rich footer in Venus tones
   ========================================================= */
.polyme-footer {
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(5, 150, 105, 0.12);
    padding: 56px 24px 32px;
    margin-top: 80px;
    position: relative;
    z-index: 2;
}
body.dark-mode .polyme-footer {
    background: rgba(11, 20, 16, 0.82);
    border-top-color: rgba(16, 185, 129, 0.18);
}
.polyme-footer .footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
}
@media (max-width: 767px) {
    .polyme-footer .footer-inner {
        grid-template-columns: 1fr 1fr;
    }
    .polyme-footer .footer-inner > :first-child {
        grid-column: 1 / -1;
    }
}
.polyme-footer .footer-brand {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.polyme-footer .footer-brand .brand {
    display: flex;
    align-items: center;
    gap: 10px;
}
.polyme-footer .footer-brand svg {
    filter: drop-shadow(0 2px 10px rgba(5, 150, 105, 0.25));
}
.polyme-footer .footer-brand .brand-title {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--color-text);
    margin-top: 4px;
}
.polyme-footer .footer-brand p {
    color: var(--color-text-secondary);
    font-size: 0.88rem;
    line-height: 1.7;
    max-width: 40ch;
    margin: 0;
}
.polyme-footer .footer-col h4 {
    color: var(--color-text);
    font-weight: 700;
    font-size: 0.74rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 14px;
}
.polyme-footer .footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.polyme-footer .footer-col a {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.3s ease;
}
.polyme-footer .footer-col a:hover {
    color: var(--color-text);
}
.polyme-footer .footer-col a[data-planet="sun"]:hover     { color: var(--p-sun); }
.polyme-footer .footer-col a[data-planet="mercury"]:hover { color: var(--p-mercury); }
.polyme-footer .footer-col a[data-planet="saturn"]:hover  { color: var(--p-saturn); }
.polyme-footer .footer-col a[data-planet="jupiter"]:hover { color: var(--p-jupiter); }
.polyme-footer .footer-col a[data-planet="venus"]:hover   { color: var(--p-venus); }
.polyme-footer .footer-col a[data-planet="mars"]:hover    { color: var(--p-mars); }
.polyme-footer .footer-col a[data-planet="moon"]:hover    { color: var(--p-moon); }
.polyme-footer .footer-bottom {
    max-width: 1200px;
    margin: 32px auto 0;
    padding-top: 24px;
    border-top: 1px solid rgba(5, 150, 105, 0.12);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--color-text-secondary);
    font-size: 0.75rem;
}
.polyme-footer .footer-bottom p { margin: 0; }
.polyme-footer .footer-tag {
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-family: 'Cinzel', monospace;
    color: var(--color-brand-canopy);
}
body.dark-mode .polyme-footer .footer-tag {
    color: var(--color-brand-soft);
}

/* On mobile, lift the footer above the bottom nav bar */
@media (max-width: 1023px) {
    .polyme-footer {
        padding-bottom: calc(32px + 72px);
    }
}

/* =========================================================
   LINE SETUP PAGE — step circles + info grid (Venus green)
   ========================================================= */
.step-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-brand-soft) 0%, var(--color-brand-primary) 100%);
    color: #FFFFFF;
    font-size: 0.85rem;
    font-weight: 800;
    margin-right: var(--spacing-sm);
    box-shadow: 0 4px 12px -4px var(--color-brand-glow);
    flex-shrink: 0;
    vertical-align: middle;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    background-color: var(--color-surface-2);
    border: 1px solid var(--color-border-subtle);
    transition: border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
}
.info-item:hover {
    border-color: var(--color-brand-primary);
    background-color: var(--color-surface-1);
    box-shadow: 0 4px 16px -8px var(--color-brand-glow);
}
.info-item > i {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background-color: var(--color-brand-light);
    color: var(--color-brand-primary);
    font-size: 1.1rem;
}
.info-item > div { flex: 1; min-width: 0; }
.info-item h4 {
    margin: 0 0 4px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text);
}
.info-item p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--color-text-secondary);
}

body.dark-mode .info-item {
    background-color: var(--color-surface-2);
    border-color: var(--color-border);
}
body.dark-mode .info-item > i {
    background-color: rgba(16, 185, 129, 0.14);
    color: var(--color-brand-soft);
}

/* LINE setup page — h3 headings align the circle + text nicely */
#line-setup-page h3 {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 0 var(--spacing-sm);
    font-size: 1.05rem;
}

/* Connect button — LINE brand accent on the primary CTA */
#connect-line-oa-btn {
    background-image: linear-gradient(135deg, #06C755 0%, #059669 55%, #047857 100%);
    box-shadow: 0 6px 18px -6px rgba(6, 199, 85, 0.45);
}
#connect-line-oa-btn:hover:not(:disabled) {
    filter: brightness(1.05);
    box-shadow: 0 8px 22px -4px rgba(6, 199, 85, 0.55);
}

/* Integrate buttons (in settings) — left-align icon/text for clarity */
.integration-buttons-grid .btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
}
.integration-buttons-grid .btn i {
    font-size: 1.2rem;
}