:root {
    --bg-primary: #0b0f19;
    --bg-card: rgba(23, 32, 54, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-blue: #38bdf8;
    --accent-indigo: #6366f1;
    --accent-purple: #a855f7;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --card-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

/* Background animated globes */
.background-globes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.globe {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.35;
    animation: float 20s infinite alternate ease-in-out;
}

.globe-1 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, #3b82f6, #6366f1);
    top: -100px;
    left: -100px;
}

.globe-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #8b5cf6, #ec4899);
    bottom: -150px;
    right: -100px;
    animation-delay: -7s;
}

.globe-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #06b6d4, #10b981);
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -12s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 40px) scale(1.1); }
}

/* Main Container */
.app-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    padding: 2.5rem 1.5rem;
    margin: 0 auto;
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-title-row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    margin-bottom: 0.35rem;
}

.header-logo-wrapper {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
}

.header-site-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    background: transparent !important;
    filter: drop-shadow(0 4px 14px rgba(56, 189, 248, 0.4));
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
}

.header-site-logo:hover {
    transform: scale(1.1) rotate(3deg);
    filter: drop-shadow(0 6px 20px rgba(56, 189, 248, 0.65));
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--accent-blue);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.app-header h1 {
    font-family: var(--font-heading);
    font-size: 2.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    line-height: 1.15;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 0.25rem;
    margin-bottom: 1.5rem;
}

/* Mode Switcher Tabs */
.mode-tabs {
    display: inline-flex;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 6px;
    border-radius: 16px;
    gap: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    position: relative;
    margin-bottom: 2.4rem;
}

.mode-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1.4rem;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.mode-tab i {
    font-size: 1.05rem;
    transition: transform 0.2s ease;
}

.mode-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.mode-tab:hover i {
    transform: scale(1.1);
}

.mode-tab.active {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #ffffff;
    box-shadow: 0 4px 18px rgba(37, 99, 235, 0.45);
}

.mode-tab[data-mode="appointment"].active {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    box-shadow: 0 4px 18px rgba(124, 58, 237, 0.45);
}

.mode-tab[data-mode="chat"].active {
    background: linear-gradient(135deg, #059669, #10b981);
    box-shadow: 0 4px 18px rgba(16, 185, 129, 0.45);
}

/* Tooltips: Visible on Hover & ALWAYS Visible on Active Tab */
.mode-tab::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -34px;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #0f172a;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 20;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.mode-tab:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.mode-tab.active::after {
    opacity: 1 !important;
    transform: translateX(-50%) translateY(0) !important;
    color: #ffffff !important;
    border-color: rgba(56, 189, 248, 0.6) !important;
    background: #090e1a !important;
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.3) !important;
    font-weight: 600 !important;
}

/* Responsive Mode Tabs for Mobile Devices */
@media (max-width: 640px) {
    .mode-tabs {
        width: 100%;
        max-width: 100%;
        display: flex;
        padding: 4px;
        gap: 4px;
        border-radius: 12px;
        margin-bottom: 2rem;
    }

    .mode-tab {
        flex: 1 1 0;
        min-width: 0;
        justify-content: center;
        gap: 0.35rem;
        padding: 0.55rem 0.35rem;
        font-size: 0.8rem;
        border-radius: 9px;
    }

    .mode-tab span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mode-tab i {
        font-size: 0.85rem;
        flex-shrink: 0;
    }

    .mode-tab::after {
        font-size: 0.68rem;
        padding: 2px 6px;
        bottom: -28px;
    }
}

@media (max-width: 380px) {
    .mode-tab {
        padding: 0.48rem 0.2rem;
        font-size: 0.72rem;
        gap: 0.22rem;
    }

    .mode-tab i {
        font-size: 0.75rem;
    }
}

/* Layout Grid */
.grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

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

/* Section Containers */
.editor-section, .preview-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .preview-section {
        display: contents;
    }

    .vcard-preview-card {
        order: -1;
    }
}

/* Glassmorphic Panel */
.panel {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
}

.panel h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-primary);
}

.panel-header-with-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
}

.panel-header-with-actions h3 {
    margin-bottom: 0;
}

.header-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Profile Panel & Bar */
.profile-panel {
    padding: 1.1rem 1.3rem;
    background: rgba(18, 25, 44, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.profile-bar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.profile-info-pill {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--accent-blue);
    font-size: 0.88rem;
    font-weight: 600;
    flex: 1;
    min-width: 220px;
}

.profile-status-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.82rem;
}

.profile-select {
    flex: 1;
    max-width: 220px;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
}

.profile-select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

.profile-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.btn-profile-action {
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.btn-profile-action:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.btn-profile-danger {
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-profile-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #ffffff;
}

.profile-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.profile-auth-indicator {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #34d399;
}

.btn-lock-profile {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.78rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.2s ease;
}

.btn-lock-profile:hover {
    color: var(--accent-blue);
}

.btn-lock-profile.locked {
    color: var(--accent-amber);
}

/* Appointment Section */
.appointment-section {
    background: rgba(124, 58, 237, 0.06);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 14px;
    padding: 1.1rem;
    margin-bottom: 1.25rem;
    animation: fadeIn 0.3s ease;
}

.section-divider-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-purple);
    background: rgba(168, 85, 247, 0.12);
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    margin-bottom: 0.85rem;
    margin-top: 0.2rem;
}

.form-hint {
    display: block;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 0.35rem;
}

.form-hint strong {
    color: var(--accent-blue);
}

.btn-reset-inline {
    background: transparent;
    border: none;
    color: var(--accent-purple);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-reset-inline:hover {
    background: rgba(168, 85, 247, 0.15);
    color: #ffffff;
}

/* Alarm / Reminder Preview Box */
.alarm-preview-box {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.75rem;
    color: #94a3b8;
    line-height: 1.5;
    word-break: break-word;
}

.alarm-preview-box strong {
    color: var(--accent-purple);
}

.alarm-preview-box .alarm-tag {
    color: var(--accent-blue);
    font-weight: 600;
}

/* Set Appointment Buttons & Banners */
.calendar-set-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: rgba(124, 58, 237, 0.12);
    border: 1px dashed rgba(168, 85, 247, 0.4);
    border-radius: 12px;
    padding: 0.85rem 1.1rem;
    margin-top: 0.85rem;
}

@media (max-width: 600px) {
    .calendar-set-banner {
        flex-direction: column;
        align-items: stretch;
    }
}

.calendar-set-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.calendar-set-info strong {
    font-size: 0.88rem;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.calendar-set-info span {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.btn-calendar-set {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.4rem;
    border-radius: 12px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(124, 58, 237, 0.4);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    user-select: none;
    white-space: nowrap;
}

.btn-calendar-set.btn-sm {
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
    border-radius: 10px;
}

.btn-calendar-set:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(124, 58, 237, 0.55);
    filter: brightness(1.08);
}

.btn-calendar-set:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.calendar-action-wrapper {
    margin-top: 0.9rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
}

.calendar-action-wrapper .btn-calendar-set {
    width: 100%;
    max-width: 280px;
}

.calendar-set-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

/* Modal Confirmation & Calendar Links */
.modal-confirm-calendar {
    max-width: 520px;
}

.confirm-prompt-card {
    text-align: center;
    padding: 0.5rem 0.5rem 0.75rem 0.5rem;
}

.confirm-icon-circle {
    width: 58px;
    height: 58px;
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.35);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.9rem auto;
    color: var(--accent-purple);
    font-size: 1.6rem;
}

.confirm-prompt-card h4 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--text-primary);
    margin-bottom: 0.45rem;
}

.confirm-desc {
    font-size: 0.86rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.event-summary-preview {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.84rem;
}

.summary-label {
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.summary-item strong {
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.confirm-checkbox-box {
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 0.5rem;
}

.custom-checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    cursor: pointer;
    font-size: 0.86rem;
    color: var(--text-primary);
    line-height: 1.45;
}

.custom-checkbox-container input[type="checkbox"] {
    margin-top: 3px;
    accent-color: #a855f7;
    width: 17px;
    height: 17px;
    cursor: pointer;
    flex-shrink: 0;
}

.success-calendar-links {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 1rem;
}

.btn-calendar-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.75rem 1.1rem;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
}

.btn-cal-google {
    background: #ffffff;
    color: #1f2937;
}

.btn-cal-google:hover {
    background: #f1f5f9;
    color: #111827;
}

.btn-cal-outlook {
    background: #0078d4;
    color: #ffffff;
}

.btn-cal-outlook:hover {
    background: #006abc;
    color: #ffffff;
}

.btn-cal-ics {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-cal-ics:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Slot Containers for dynamic reordering */
.slot-container {
    width: 100%;
}

.chat-mode-active #notesGroup {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.1);
}

.chat-mode-active #notesLabel {
    color: #34d399;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.req-badge {
    color: #34d399;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 0.4rem;
}

/* Form Styles */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
    margin-bottom: 1rem;
}

.form-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Photo / Logo Upload & Camera Controls */
.photo-form-group {
    position: relative;
}

.photo-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.photo-main-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.photo-btn-group {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-photo-action {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: var(--accent-blue);
    padding: 0.3rem 0.65rem;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    text-decoration: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
}

.btn-photo-action:hover {
    background: rgba(56, 189, 248, 0.25);
    border-color: var(--accent-blue);
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-photo-action:active {
    transform: scale(0.97);
}

/* Hidden file inputs: rendered in DOM without display:none so mobile touch and click fire native pickers reliably */
.hidden-file-input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    overflow: hidden !important;
    z-index: -999 !important;
    pointer-events: none !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
}

.photo-input-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.photo-input-container input {
    width: 100%;
    padding-right: 2.2rem;
}

.btn-clear-photo {
    position: absolute;
    right: 0.55rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text-secondary);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.15s ease;
}

.btn-clear-photo:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.photo-preview-chip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 10px;
    margin-top: 0.4rem;
    animation: fadeIn 0.2s ease;
}

.photo-thumb-img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.photo-thumb-meta {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.photo-thumb-source {
    font-size: 0.8rem;
    font-weight: 600;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.photo-thumb-size {
    font-size: 0.72rem;
    color: var(--accent-blue);
}

.btn-remove-thumb {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    font-size: 0.72rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.btn-remove-thumb:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
}

.form-input, .form-select, textarea.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus, .form-select:focus, textarea.form-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

textarea.form-input {
    resize: vertical;
    min-height: 70px;
}

/* Dynamic Rows */
.form-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1.25rem 0 0.75rem 0;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--accent-blue);
    font-weight: 600;
    font-size: 0.95rem;
}

.dynamic-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.dynamic-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.dynamic-row select {
    width: 120px;
    flex-shrink: 0;
}

.dynamic-row input {
    flex: 1;
}

/* Primary row vs Secondary row trash button handling */
.dynamic-row.primary-row .btn-remove {
    visibility: hidden;
    pointer-events: none;
    width: 0;
    padding: 0;
    margin: 0;
    border: none;
}

/* Dynamic Social Row & Custom Checkbox Styling */
.dynamic-row.social-row {
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.dynamic-row.social-row select {
    width: 130px;
    flex-shrink: 0;
}

.social-check-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}

.social-check-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.social-check-indicator {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.7);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    font-size: 0.72rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-check-label:hover .social-check-indicator {
    border-color: var(--accent-blue);
    background: rgba(56, 189, 248, 0.1);
}

.social-check-label input[type="checkbox"]:checked + .social-check-indicator {
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

.social-check-label input[type="checkbox"]:focus-visible + .social-check-indicator {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

.dynamic-row.social-row.is-unchecked .social-value {
    opacity: 0.55;
    background: rgba(15, 23, 42, 0.35);
    border-style: dashed;
}

.dynamic-row.social-row.is-unchecked select {
    opacity: 0.65;
}

/* Buttons */
.btn-remove {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-remove:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #ffffff;
}

.btn-add {
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--accent-blue);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-add:hover {
    background: rgba(56, 189, 248, 0.2);
}

.btn-text {
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-text:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.12);
}

.btn-text.btn-danger {
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-text.btn-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ffffff;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

.btn-outline {
    background: transparent;
    color: var(--accent-blue);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.btn-outline:hover {
    background: rgba(56, 189, 248, 0.1);
    border-color: var(--accent-blue);
}

.btn-accent {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-accent:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
    border-radius: 8px;
}

/* Digital Business Card */
.vcard-preview-card {
    width: 100%;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.vcard-preview-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
}

.card-banner {
    height: 110px;
    background: linear-gradient(135deg, #2563eb, #7c3aed, #db2777);
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.85rem 1rem;
    transition: background 0.3s ease;
    gap: 0.5rem;
}

.card-banner.mode-appointment {
    background: linear-gradient(135deg, #7c3aed, #a855f7, #ec4899);
}

.card-banner.mode-chat {
    background: linear-gradient(135deg, #059669, #10b981, #06b6d4);
}

.card-mode-indicator {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.card-mode-indicator:hover {
    background: rgba(0, 0, 0, 0.58);
    border-color: rgba(255, 255, 255, 0.4);
}

.card-mode-indicator:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 3px;
}

.card-body {
    padding: 0 1.75rem 2rem 1.75rem;
    position: relative;
}

.avatar-wrapper {
    margin-top: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: center;
}

.avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    border: 4px solid #172036;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--accent-blue);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    text-align: center;
    margin-bottom: 0.5rem;
}

.profile-info h2 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.title-tag {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
}

.org-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--accent-blue);
    font-size: 0.95rem;
    font-weight: 600;
}

/* Mode Context Preview in Card (Hidden) */
.mode-context-preview {
    display: none !important;
    margin-bottom: 1.2rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    font-size: 0.88rem;
    line-height: 1.4;
    animation: fadeIn 0.25s ease;
}

.mode-context-preview.appointment-context {
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #e9d5ff;
}

.mode-context-preview.chat-context {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #d1fae5;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(56, 189, 248, 0.4);
}

.icon-box {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.item-text {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.item-text .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.item-text .value {
    font-weight: 600;
    font-size: 0.95rem;
}

.external-icon {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* QR Display */
.qr-container-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.25);
    padding: 1.25rem;
    border-radius: 18px;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
}

.qr-box {
    background: #ffffff;
    padding: 0.5rem;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 236px;
    min-height: 236px;
}

#qrCanvas {
    width: 220px !important;
    height: 220px !important;
    display: block;
    border-radius: 6px;
}

.qr-empty-msg {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 220px;
    height: 220px;
    padding: 1.25rem;
    text-align: center;
    color: #475569;
    gap: 0.75rem;
    font-size: 0.85rem;
    line-height: 1.4;
    border-radius: 8px;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    box-sizing: border-box;
}

.qr-empty-msg i {
    font-size: 2.5rem;
    color: #94a3b8;
}

.scan-hint {
    margin-top: 1rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.qr-render-notice {
    margin: 0.6rem 0 0;
    max-width: 280px;
    color: #fbbf24;
    font-size: 0.75rem;
    line-height: 1.4;
    text-align: center;
}

.export-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Email Panel */
.panel-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.email-input-group {
    display: flex;
    gap: 0.75rem;
}

@media (max-width: 500px) {
    .email-input-group {
        flex-direction: column;
    }
}

.status-msg {
    margin-top: 0.8rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.88rem;
    display: none;
}

.status-msg.info {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
}

.status-msg.success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.status-msg.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* Payload Inspector Panel */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.panel-header h3 {
    margin-bottom: 0;
}

.vcard-code {
    background: rgba(10, 15, 26, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 1rem;
    font-family: monospace;
    font-size: 0.85rem;
    color: #38bdf8;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 250px;
    overflow-y: auto;
}

/* Modal Window */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeIn 0.2s ease;
}

.modal-card {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
    overflow: hidden;
}

.modal-contact-book {
    max-width: 620px;
}

.contact-book-status {
    margin: 0 0 0.75rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.contact-book-list {
    max-height: 55vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.contact-book-item {
    padding: 0.85rem 1rem;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 10px;
}

.contact-book-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.contact-book-heading strong {
    color: var(--text-primary);
}

.contact-book-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.4rem;
    font-size: 0.85rem;
}

.contact-book-details a {
    color: var(--accent-blue);
    text-decoration: none;
}

.contact-book-details a:hover {
    text-decoration: underline;
}

.contact-book-timestamp {
    display: block;
    margin-top: 0.45rem;
    color: var(--text-secondary);
    font-size: 0.72rem;
}

.contact-book-shared-info {
    margin: 0.65rem 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
    white-space: pre-wrap;
}

.compatibility-result {
    margin-top: 0.7rem;
    padding: 0.75rem;
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.45;
}

.compatibility-result:empty {
    display: none;
}

.compatibility-result strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.compatibility-result p {
    margin: 0.35rem 0;
}

.compatibility-result-error {
    color: #fca5a5;
}

.form-help-text {
    display: block;
    margin-top: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1.45;
}

.visitor-compatibility-optin .checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin-top: 0.55rem;
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.4;
}

.visitor-compatibility-optin .checkbox-label input {
    flex: 0 0 auto;
    margin-top: 0.15rem;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

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

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
}

/* Camera Capture Modal */
.camera-modal-card {
    max-width: 460px;
    width: 92%;
}

.camera-modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1.25rem;
}

.camera-stream-wrapper {
    position: relative;
    width: 100%;
    max-width: 360px;
    aspect-ratio: 1 / 1;
    background: #000000;
    border-radius: 18px;
    overflow: hidden;
    border: 2px solid rgba(56, 189, 248, 0.35);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

#cameraVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.camera-viewfinder-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.viewfinder-circle {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
    animation: pulseBorder 2.5s infinite;
}

@keyframes pulseBorder {
    0%, 100% { border-color: rgba(255, 255, 255, 0.85); }
    50% { border-color: var(--accent-blue); }
}

.viewfinder-hint {
    color: #ffffff;
    font-size: 0.78rem;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.camera-error-msg {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
    gap: 0.75rem;
    color: #f87171;
    font-size: 0.9rem;
}

.camera-error-msg i {
    font-size: 2.2rem;
    color: #ef4444;
}

.camera-controls-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    margin-top: 1.25rem;
    width: 100%;
}

.btn-camera-snap {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.65rem 1.5rem;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-camera-snap:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.6);
}

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

/* Toast notification */
.toast-notice {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #0f172a;
    color: #f8fafc;
    padding: 0.85rem 1.4rem;
    border-radius: 12px;
    border: 1px solid rgba(56, 189, 248, 0.4);
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 2000;
    animation: slideInUp 0.3s ease;
}

.toast-notice.success {
    border-color: rgba(16, 185, 129, 0.5);
    color: #34d399;
}

.toast-notice.error {
    border-color: rgba(248, 113, 113, 0.55);
    color: #fca5a5;
}

.toast-notice.info {
    border-color: rgba(56, 189, 248, 0.45);
    color: #7dd3fc;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Footer */
.app-footer {
    position: relative;
    z-index: 1;
    margin-top: 3rem;
    padding: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.88rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    width: 100%;
}

/* Ensure [hidden] always wins over display rules */
[hidden] {
    display: none !important;
}

/* Floating save action for unsaved profile edits */
.btn-save-profile {
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border: none;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-save-profile:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5);
}

.floating-save-button {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 900;
    padding: 0.75rem 1.1rem;
    font-size: 0.9rem;
}

@media (max-width: 600px) {
    .floating-save-button {
        right: 1rem;
        bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
        left: 1rem;
        justify-content: center;
    }
}

.header-buttons {
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Validation */
.form-errors {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    border-radius: 10px;
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    line-height: 1.5;
    animation: fadeIn 0.2s ease;
}

.form-input.input-error {
    border-color: #f87171;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.required-badge {
    color: #fca5a5;
    font-size: 0.72rem;
    font-weight: 600;
    margin-left: 0.3rem;
}

/* ===============================================================
   Banner Authentication Pill & Controls (Inside Card Banner)
   =============================================================== */
.card-banner-auth {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 2;
}

.banner-auth-logged-out {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-banner-auth {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.35rem 0.7rem;
    border-radius: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: all 0.2s ease;
}

.btn-banner-auth:hover {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.btn-banner-auth-accent {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.9), rgba(124, 58, 237, 0.9));
    border-color: rgba(147, 197, 253, 0.4);
}

.btn-banner-auth-accent:hover {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-color: #93c5fd;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.5);
}

.banner-auth-logged-in {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-banner-user {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #e0f2fe;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.32rem 0.65rem;
    border-radius: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 155px;
    transition: all 0.2s ease;
}

.btn-banner-user:hover {
    background: rgba(15, 23, 42, 0.95);
    border-color: var(--accent-blue);
    transform: translateY(-1px);
}

.banner-user-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.75rem;
}

.btn-banner-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #f1f5f9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.76rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-banner-icon:hover {
    background: rgba(239, 68, 68, 0.35);
    border-color: #f87171;
    color: #f87171;
    transform: translateY(-1px);
}

.btn-banner-admin {
    width: auto;
    border-radius: 20px;
    padding: 0.3rem 0.65rem;
    gap: 0.35rem;
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.85), rgba(220, 38, 38, 0.85));
    border-color: rgba(253, 186, 116, 0.5);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.3);
}

.btn-banner-admin:hover {
    background: linear-gradient(135deg, #ea580c, #dc2626);
    border-color: #fdba74;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(234, 88, 12, 0.5);
}

/* Secondary save button in header */
.btn-save-existing {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.btn-save-existing:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(56, 189, 248, 0.4);
}

/* Modal Size Modifiers */
.modal-lg {
    max-width: 650px !important;
}

.modal-xl {
    max-width: 960px !important;
}

.auth-modal-card {
    max-width: 420px !important;
}

/* Auth Modal Tabs & Elements */
.auth-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 0.3rem;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-tab {
    flex: 1;
    padding: 0.6rem;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.auth-tab.active {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.auth-form-panel {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.auth-error-msg {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    padding: 0.65rem 0.9rem;
    border-radius: 8px;
    font-size: 0.82rem;
    line-height: 1.4;
}

.auth-status-msg {
    margin-top: 0.5rem;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    font-size: 0.82rem;
}

.auth-status-msg.success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
}

.auth-status-msg.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.btn-block {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.auth-switch-text {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.auth-switch-text a {
    color: var(--accent-blue);
    font-weight: 600;
    text-decoration: none;
}

.auth-switch-text a:hover {
    text-decoration: underline;
}

/* User Settings Modal */
.settings-user-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    margin-bottom: 1.5rem;
}

.settings-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.settings-user-meta h4 {
    margin: 0 0 0.2rem 0;
    font-size: 1.15rem;
    color: var(--text-primary);
}

.settings-user-meta p {
    margin: 0 0 0.5rem 0;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.user-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge-role {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.2rem 0.55rem;
    border-radius: 12px;
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-blue);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-role.admin {
    background: rgba(234, 88, 12, 0.2);
    color: #fdba74;
    border-color: rgba(234, 88, 12, 0.4);
}

.badge-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

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

.settings-subpanel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 1.25rem;
}

.settings-subpanel h4 {
    margin-top: 0;
    margin-bottom: 0.85rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

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

.subpanel-header h4 {
    margin: 0;
}

.subpanel-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 0.85rem;
    line-height: 1.4;
}

.btn-xs {
    padding: 0.25rem 0.55rem;
    font-size: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
}

.settings-profiles-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 220px;
    overflow-y: auto;
}

.settings-profile-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.8rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 0.85rem;
}

.settings-profile-item.active {
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(56, 189, 248, 0.08);
}

.profile-item-meta {
    display: flex;
    flex-direction: column;
}

.profile-item-meta strong {
    color: var(--text-primary);
}

.profile-item-meta span {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.profile-item-actions {
    display: flex;
    gap: 0.35rem;
}

/* ===============================================================
   Admin Dashboard & Controls
   =============================================================== */
.admin-header-title {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.admin-header-title h3 {
    margin: 0;
}

.admin-badge {
    align-self: flex-start;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    background: rgba(234, 88, 12, 0.2);
    border: 1px solid rgba(234, 88, 12, 0.4);
    color: #fdba74;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.admin-tab-nav {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem 1.5rem 0 1.5rem;
    gap: 0.5rem;
    overflow-x: auto;
}

.admin-nav-btn {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    padding: 0.65rem 1rem;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.admin-nav-btn:hover {
    color: var(--text-primary);
}

.admin-nav-btn.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
    background: rgba(56, 189, 248, 0.05);
}

.admin-body {
    padding: 1.5rem;
    min-height: 380px;
}

.admin-tab-pane {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.admin-pane-header h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

/* Global Settings Switch Grid */
.settings-toggle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 650px) {
    .settings-toggle-grid {
        grid-template-columns: 1fr;
    }
}

.toggle-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    gap: 1rem;
}

.toggle-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.toggle-meta strong {
    color: var(--text-primary);
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.toggle-meta span {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

/* iOS-style toggle switches */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.15);
    transition: 0.3s;
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

input:checked + .slider {
    background-color: #2563eb;
    border-color: #3b82f6;
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.admin-save-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.status-inline {
    font-size: 0.85rem;
    color: #34d399;
}

/* User Management Toolbar & Table */
.admin-pane-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 350px;
}

.search-box i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.search-box .form-input {
    padding-left: 2.3rem;
}

.form-input-sm {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    font-size: 0.85rem;
}

.table-responsive {
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.admin-table th {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    vertical-align: middle;
}

.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.user-td-meta {
    display: flex;
    flex-direction: column;
}

.btn-admin-user-profiles:hover .user-td-name,
.btn-admin-user-profiles:focus-visible .user-td-name {
    color: #93c5fd;
    text-decoration: underline;
}

.user-td-name {
    font-weight: 600;
    color: #fff;
}

.user-td-email {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.perm-badges {
    display: flex;
    gap: 0.3rem;
}

.perm-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

.perm-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.perm-checkboxes {
    display: flex;
    gap: 1rem;
    margin-top: 0.4rem;
}

.perm-checkboxes label {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
}

.table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
}

/* Activity History */
.activity-filter-chips {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.chip {
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.chip.active {
    background: rgba(56, 189, 248, 0.18);
    border-color: rgba(56, 189, 248, 0.4);
    color: var(--accent-blue);
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.activity-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.activity-badge.created,
.activity-badge.signup {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.activity-badge.scan,
.activity-badge.render {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
}

.activity-badge.auth,
.activity-badge.login {
    background: rgba(124, 58, 237, 0.15);
    border: 1px solid rgba(124, 58, 237, 0.3);
    color: #c084fc;
}

.activity-badge.updated,
.activity-badge.reset {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.activity-badge.deleted {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.activity-badge.system {
    background: rgba(148, 163, 184, 0.15);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #cbd5e1;
}

/* Feature disabled / restricted state */
.mode-tab.mode-restricted {
    opacity: 0.45;
    cursor: not-allowed !important;
    position: relative;
}

.mode-tab.mode-restricted:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.05);
}

/* ===============================================================
   Mobile Responsive Optimizations:
   - Header Site Brand Logo alongside QR Views
   - Enlarged, Touch-Friendly Upload & Camera Action Buttons
   =============================================================== */
@media (max-width: 768px) {
    .header-title-row {
        gap: 0.75rem;
    }

    .header-site-logo {
        width: 42px;
        height: 42px;
    }

    .photo-label-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
        margin-bottom: 0.65rem;
    }

    .photo-btn-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        width: 100%;
    }

    .btn-photo-action {
        min-height: 48px;
        padding: 0.75rem 1rem;
        font-size: 0.94rem;
        font-weight: 600;
        border-radius: 12px;
        justify-content: center;
        gap: 0.6rem;
        background: rgba(56, 189, 248, 0.16);
        border: 1px solid rgba(56, 189, 248, 0.4);
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
        color: #ffffff;
    }

    .btn-photo-action i {
        font-size: 1.15rem;
        color: var(--accent-blue);
    }
}

@media (max-width: 480px) {
    .header-title-row {
        gap: 0.6rem;
    }

    .header-site-logo {
        width: 36px;
        height: 36px;
    }

    .app-header h1 {
        font-size: 2.1rem;
    }

    .photo-btn-group {
        gap: 0.5rem;
    }

    .btn-photo-action {
        min-height: 50px;
        font-size: 0.95rem;
    }
}

/* ==========================================================================
   QRViews Activity Log & Scan Interactivity (Logged-In User Section)
   ========================================================================== */
.activity-log-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.activity-log-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.activity-count-badge {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
}

.btn-xs {
    padding: 3px 8px;
    font-size: 0.72rem;
    line-height: 1.2;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-outline {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #e2e8f0;
}

.btn-outline:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    color: #ffffff;
}

.activity-log-box {
    max-height: 320px;
    overflow-y: auto;
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.4) transparent;
}

.activity-log-box::-webkit-scrollbar {
    width: 6px;
}
.activity-log-box::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.4);
    border-radius: 3px;
}

.activity-empty-state {
    text-align: center;
    padding: 1.5rem 1rem;
    color: #94a3b8;
}
.activity-empty-state i {
    font-size: 1.8rem;
    color: #64748b;
    margin-bottom: 0.5rem;
    display: block;
}
.activity-empty-state p {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #cbd5e1;
}
.activity-empty-state small {
    font-size: 0.75rem;
    display: block;
    line-height: 1.35;
}

.activity-log-item {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    font-size: 0.78rem;
    color: #e2e8f0;
    transition: border-color 0.2s ease;
}
.activity-log-item:hover {
    border-color: rgba(59, 130, 246, 0.5);
}

.activity-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.activity-timestamp {
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 500;
}

.activity-badges-group {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.scan-method-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.method-contact {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.4);
}
.method-calendar {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}
.method-chat {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.4);
}

.scan-location-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 500;
    background: rgba(14, 165, 233, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(14, 165, 233, 0.3);
}

.activity-user-row {
    margin-bottom: 0.3rem;
    font-size: 0.8rem;
}
.activity-user-row strong {
    color: #f8fafc;
}

.tag-registered {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.65rem;
    margin-left: 4px;
    font-weight: 600;
}
.tag-unregistered {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.65rem;
    margin-left: 4px;
    font-weight: 600;
}

.activity-note-box {
    background: rgba(30, 41, 59, 0.6);
    border-left: 2px solid #3b82f6;
    padding: 0.3rem 0.5rem;
    margin-top: 0.3rem;
    border-radius: 0 4px 4px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}
.activity-note-text {
    font-style: italic;
    color: #cbd5e1;
    font-size: 0.74rem;
}
.btn-inline-note {
    background: none;
    border: none;
    color: #60a5fa;
    font-size: 0.72rem;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.btn-inline-note:hover {
    background: rgba(59, 130, 246, 0.15);
    text-decoration: underline;
}

/* ==========================================================================
   Mobile PWA "Add to Home Screen" Banner
   ========================================================================== */
.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(59, 130, 246, 0.4);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.6);
    padding: 12px 18px;
    animation: pwaSlideUp 0.35s ease-out;
}

@keyframes pwaSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.pwa-install-container {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pwa-banner-logo {
    border-radius: 10px;
    display: block;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.pwa-install-text-col {
    flex: 1;
}

.pwa-banner-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 2px;
}

.pwa-banner-desc {
    font-size: 0.78rem;
    color: #94a3b8;
    line-height: 1.3;
}

.pwa-install-actions-col {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ios-install-hint {
    max-width: 720px;
    margin: 8px auto 0 auto;
    padding-top: 8px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    font-size: 0.78rem;
    color: #38bdf8;
    text-align: center;
}

/* ==========================================================================
   Two-Way Contact Information Exchange Modal
   ========================================================================== */
.exchange-modal-card {
    max-width: 520px;
    width: 92%;
}

.exchange-modal-footer {
    justify-content: center;
}

.exchange-hero-badge {
    text-align: center;
    padding: 0.5rem 0 1rem 0;
}

.exchange-pulse-icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 0.75rem auto;
    background: rgba(16, 185, 129, 0.15);
    border: 2px solid rgba(16, 185, 129, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #10b981;
    animation: pulseIcon 2s infinite ease-in-out;
}

@keyframes pulseIcon {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
}

.exchange-hero-badge h4 {
    font-size: 1.2rem;
    color: #f8fafc;
    margin: 0 0 0.35rem 0;
    font-weight: 700;
}

.exchange-hero-badge p {
    color: #94a3b8;
    font-size: 0.85rem;
    margin: 0;
}

.exchange-summary-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.75rem;
    align-items: center;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    padding: 1rem;
    margin: 0.75rem 0;
}

.exchange-side {
    display: flex;
    flex-direction: column;
}

.exchange-side-label {
    font-size: 0.68rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 2px;
}

.exchange-side strong {
    font-size: 0.95rem;
    color: #f8fafc;
}

.exchange-side-sub {
    font-size: 0.75rem;
    color: #94a3b8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.exchange-arrow {
    color: #3b82f6;
    font-size: 1.1rem;
    text-align: center;
}

.exchange-meta-tags {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.exchange-pill {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.25);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    color: #cbd5e1;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}



