/* ==========================================================================
   Scrapsheet — Cal.com Design System
   White canvas · Inter + Cal Sans · #111111 CTAs · #f5f5f5 cards · #101010 footer
   ========================================================================== */

/* --- Google Fonts: Inter --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

/* --- CSS Custom Properties mapped to DESIGN-cal.md tokens --- */
:root {
    /* Colors */
    --color-primary:            #111111;
    --color-primary-active:     #242424;
    --color-primary-disabled:   #e5e7eb;
    --color-ink:                #111111;
    --color-body:               #374151;
    --color-muted:              #6b7280;
    --color-muted-soft:         #898989;
    --color-hairline:           #e5e7eb;
    --color-hairline-soft:      #f3f4f6;
    --color-canvas:             #ffffff;
    --color-surface-soft:       #f8f9fa;
    --color-surface-card:       #f5f5f5;
    --color-surface-strong:     #e5e7eb;
    --color-surface-dark:       #101010;
    --color-surface-dark-el:    #1a1a1a;
    --color-on-primary:         #ffffff;
    --color-on-dark:            #ffffff;
    --color-on-dark-soft:       #a1a1aa;
    --color-brand-accent:       #3b82f6;
    --color-success:            #10b981;
    --color-warning:            #f59e0b;
    --color-error:              #ef4444;
    --color-badge-orange:       #fb923c;
    --color-badge-pink:         #ec4899;
    --color-badge-violet:       #8b5cf6;
    --color-badge-emerald:      #34d399;

    /* Border Radius */
    --rounded-xs:   4px;
    --rounded-sm:   6px;
    --rounded-md:   8px;
    --rounded-lg:   12px;
    --rounded-xl:   16px;
    --rounded-pill: 9999px;

    /* Spacing */
    --space-xxs:     4px;
    --space-xs:      8px;
    --space-sm:      12px;
    --space-md:      16px;
    --space-lg:      24px;
    --space-xl:      32px;
    --space-xxl:     48px;
    --space-section: 96px;

    /* Shadows */
    --shadow-xs:  0 1px 2px rgba(0,0,0,0.05);
    --shadow-sm:  0 4px 12px rgba(0,0,0,0.08);
    --shadow-md:  0 8px 24px rgba(0,0,0,0.10);
    --shadow-inset: inset 0 1px 3px rgba(0,0,0,0.06);

    /* Transitions */
    --transition: 0.15s ease;

    /* Font stack */
    --font-display: "Cal Sans", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-body:    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono:    "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;
}

/* --- Base Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-canvas);
    color: var(--color-body);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* --- App Loader --- */
.app-loader {
    position: fixed;
    inset: 0;
    background: var(--color-canvas);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    transition: opacity 0.3s ease;
}
.app-loader.hidden {
    opacity: 0;
    pointer-events: none;
}
.spinner {
    width: 28px;
    height: 28px;
    border: 2.5px solid var(--color-hairline);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.app-loader p {
    font-size: 14px;
    color: var(--color-muted);
    font-weight: 500;
}

/* ==========================================================================
   HEADER / TOP NAV  (top-nav component)
   ========================================================================== */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 64px;
    background: var(--color-canvas);
    border-bottom: 1px solid var(--color-hairline);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}
.logo-icon {
    font-size: 20px;
    line-height: 1;
}
.brand-group {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}
.brand-group h1 {
    font-family: "Playwrite US Trad", cursive;
    font-size: 20px;
    font-weight: 400;
    letter-spacing: normal;
    color: var(--color-ink);
    line-height: 1;
}

/* Team selector — styled as a nav-pill-group internally */
.team-dropdown-wrapper {
    display: flex;
}
.team-dropdown-wrapper select {
    background: var(--color-surface-soft);
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-pill);
    color: var(--color-ink);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    padding: 5px 28px 5px 12px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%236b7280' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color var(--transition);
}
.team-dropdown-wrapper select:hover {
    border-color: var(--color-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

/* User simulator — small label + select */
.sim-user-box {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background: var(--color-surface-soft);
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-pill);
    padding: 4px 12px;
}
.sim-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--color-muted-soft);
    font-weight: 500;
    white-space: nowrap;
}
.sim-user-box select {
    background: transparent;
    border: none;
    color: var(--color-ink);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}

/* Settings icon button — button-icon-circular */
.settings-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--rounded-pill);
    background: var(--color-canvas);
    border: 1px solid var(--color-hairline);
    color: var(--color-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
}
.settings-btn:hover {
    background: var(--color-surface-soft);
    border-color: var(--color-primary);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--rounded-pill);
    border: 1.5px solid var(--color-hairline);
    object-fit: cover;
}

/* Clickable avatar button in header */
.avatar-btn {
    position: relative;
    display: flex;
    align-items: center;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    border-radius: var(--rounded-pill);
    transition: transform 0.15s;
}
.avatar-btn:hover { transform: scale(1.08); }
.avatar-btn:hover .avatar-edit-badge { opacity: 1; }

.avatar-edit-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
}
.avatar-edit-badge svg { color: #fff; }

/* Profile Modal */
.profile-avatar-section { border-bottom: 1px solid var(--color-hairline); padding-bottom: var(--space-lg); }

.profile-avatar-wrap {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.profile-avatar-ring {
    position: relative;
    width: 88px;
    height: 88px;
    flex-shrink: 0;
}

.profile-modal-img {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--color-hairline);
    display: block;
}

.avatar-upload-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    cursor: pointer;
    transition: opacity 0.18s;
}
.profile-avatar-ring:hover .avatar-upload-overlay { opacity: 1; }

.profile-name-email {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.profile-name-email strong { font-size: 1rem; color: var(--color-text-primary); }
.profile-name-email span  { font-size: 0.8rem; color: var(--color-text-muted); }

/* Upload / status message */
.upload-status {
    margin-top: var(--space-sm);
    font-size: 0.82rem;
    padding: 8px 12px;
    border-radius: var(--rounded-md);
    font-weight: 500;
}
.upload-status.success { background: hsl(142 76% 94%); color: hsl(142 60% 28%); }
.upload-status.error   { background: hsl(0 76% 94%);   color: hsl(0 60% 38%); }

/* ==========================================================================
   MAIN CONTAINER & TOOLBAR
   ========================================================================== */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg);
}

.toolbar {
    position: sticky;
    top: 64px;
    z-index: 90;
    background: var(--color-canvas);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-top: calc(-1 * var(--space-xl));
    margin-left: calc(-1 * var(--space-lg));
    margin-right: calc(-1 * var(--space-lg));
    padding-top: var(--space-xl);
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
    padding-bottom: var(--space-md);
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--color-hairline);
}

/* Search — text-input component */
.search-box-wrapper {
    position: relative;
    flex: 1;
    min-width: 260px;
}
.search-box-wrapper input {
    width: 100%;
    height: 40px;
    padding: 0 var(--space-md) 0 40px;
    background: var(--color-canvas);
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-md);
    color: var(--color-ink);
    font-family: var(--font-body);
    font-size: 14px;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.search-box-wrapper input::placeholder {
    color: var(--color-muted);
}
.search-box-wrapper input:focus {
    outline: none;
    border-color: var(--color-ink);
    box-shadow: 0 0 0 3px rgba(17,17,17,0.07);
}
.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    color: var(--color-muted);
    pointer-events: none;
}

/* Filter chips — category-tab / category-tab-active */
.filters-scroll {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

/* nav-pill-group wrapper */
.filter-chips {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--color-surface-soft);
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-pill);
    padding: 4px;
}
.filter-chip {
    padding: 6px 14px;
    background: transparent;
    border: none;
    color: var(--color-muted);
    border-radius: var(--rounded-pill);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
    white-space: nowrap;
}
.filter-chip:hover {
    color: var(--color-ink);
}
.filter-chip.active {
    background: var(--color-canvas);
    color: var(--color-ink);
    box-shadow: var(--shadow-xs);
}

/* Tag filter select */
.filter-select-wrapper select {
    height: 36px;
    background: var(--color-canvas);
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-pill);
    color: var(--color-muted);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    padding: 0 28px 0 14px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%236b7280' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color var(--transition);
}
.filter-select-wrapper select:hover {
    border-color: var(--color-ink);
    color: var(--color-ink);
}

/* View controls */
.view-controls {
    display: flex;
    background: var(--color-surface-soft);
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-md);
    padding: 3px;
    gap: 2px;
}
.view-btn {
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    color: var(--color-muted);
    border-radius: var(--rounded-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), color var(--transition);
}
.view-btn.active {
    background: var(--color-canvas);
    color: var(--color-ink);
    box-shadow: var(--shadow-xs);
}

/* ==========================================================================
   SCRAP FEED GRID
   ========================================================================== */
.feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-lg);
}
.feed-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    max-width: 680px;
}

/* ==========================================================================
   SCRAP CARDS  (feature-card + product-mockup-card)
   ========================================================================== */
.scrap-card {
    background: var(--color-surface-card);
    border-radius: var(--rounded-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow var(--transition), transform var(--transition);
}
.scrap-card:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    align-items: center;
    padding: var(--space-md) var(--space-md) var(--space-sm);
    gap: var(--space-xs);
}
.creator-avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--rounded-pill);
    object-fit: cover;
    flex-shrink: 0;
    border: 1.5px solid var(--color-hairline);
}
.creator-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}
.creator-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-ink);
    line-height: 1.2;
}
.scrap-time {
    font-size: 11px;
    color: var(--color-muted-soft);
    line-height: 1.2;
}

/* Card actions / overflow menu */
.card-actions {
    position: relative;
    flex-shrink: 0;
}
.action-btn {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    color: var(--color-muted);
    cursor: pointer;
    border-radius: var(--rounded-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), color var(--transition);
}
.action-btn:hover {
    background: var(--color-surface-strong);
    color: var(--color-ink);
}
.card-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: var(--color-canvas);
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-md);
    box-shadow: var(--shadow-sm);
    z-index: 50;
    width: 140px;
    overflow: hidden;
}
.card-menu button {
    display: block;
    width: 100%;
    background: transparent;
    border: none;
    color: var(--color-body);
    padding: 9px var(--space-md);
    text-align: left;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition);
}
.card-menu button:hover {
    background: var(--color-surface-soft);
    color: var(--color-ink);
}
.card-menu button.delete-action {
    color: var(--color-error);
}
.card-menu button.delete-action:hover {
    background: #fef2f2;
}

/* Card body */
.card-body {
    padding: var(--space-sm) var(--space-md) var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    flex: 1;
}
.scrap-card-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.3px;
    color: var(--color-ink);
    line-height: 1.35;
}
.scrap-note {
    font-size: 14px;
    color: var(--color-body);
    line-height: 1.55;
    word-break: break-word;
    white-space: pre-wrap;
}
.scrap-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xxs);
    margin-top: 2px;
}
/* badge-pill */
.tag-badge {
    font-size: 12px;
    font-weight: 500;
    background: var(--color-canvas);
    color: var(--color-muted);
    border: 1px solid var(--color-hairline);
    padding: 3px 10px;
    border-radius: var(--rounded-pill);
    cursor: pointer;
    transition: border-color var(--transition), color var(--transition);
    line-height: 1.4;
}
.tag-badge:hover {
    border-color: var(--color-primary);
    color: var(--color-ink);
}

/* Tag suggestions in drawers */
.tag-suggestions-container {
    margin-bottom: var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 2px 0;
}
.tag-suggestions-container.hidden {
    display: none;
}
.tag-suggestions-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-muted-soft);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.tag-suggestions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tag-suggestion-pill {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    background: var(--color-surface-soft);
    color: var(--color-muted);
    border: 1px solid var(--color-hairline);
    padding: 4px 10px;
    border-radius: var(--rounded-pill);
    cursor: pointer;
    transition: all var(--transition);
    line-height: 1.3;
}
.tag-suggestion-pill:hover {
    border-color: var(--color-primary);
    color: var(--color-ink);
    background: var(--color-surface-card);
}
.tag-suggestion-pill.active {
    background: var(--color-primary);
    color: var(--color-on-primary);
    border-color: var(--color-primary);
}
.tag-suggestion-pill.active:hover {
    background: var(--color-primary-active);
    border-color: var(--color-primary-active);
    color: var(--color-on-primary);
}

/* ==========================================================================
   INLINE PREVIEWS  (product-mockup-card style within cards)
   ========================================================================== */
.card-preview {
    border-radius: var(--rounded-md);
    overflow: hidden;
    border: 1px solid var(--color-hairline);
    background: var(--color-canvas);
}

/* Image preview */
.image-preview {
    cursor: zoom-in;
    aspect-ratio: 16 / 10;
    display: block;
}
.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}
.image-preview:hover img {
    transform: scale(1.02);
}

/* Video preview */
.video-preview video {
    width: 100%;
    display: block;
    max-height: 220px;
    background: var(--color-surface-dark);
}

/* YouTube embed */
.embed-preview {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
}
.embed-preview iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Link card - common base to kill browser blue fallback */
.card-preview.link-card,
.card-preview.link-card-simple,
.card-preview.link-overlay-card {
    text-decoration: none !important;
    outline: none;
    color: var(--color-ink) !important;
}

/* Link card — horizontal */
.link-card {
    display: flex;
    text-decoration: none;
    color: var(--color-ink) !important;
    transition: background var(--transition);
}
.link-card:hover {
    background: var(--color-surface-soft);
}
.link-img {
    width: 88px;
    min-width: 88px;
    height: 88px;
    border-right: 1px solid var(--color-hairline);
    overflow: hidden;
}
.link-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.link-meta {
    padding: var(--space-sm) var(--space-md);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-width: 0;
}
.link-domain {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--color-muted-soft) !important;
}
.link-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-ink) !important;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-decoration: none !important;
}

/* Simple link card (no image) */
.link-card-simple {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    text-decoration: none;
    color: var(--color-ink) !important;
    transition: background var(--transition);
}
.link-card-simple:hover {
    background: var(--color-surface-soft);
}
.link-icon {
    font-size: 18px;
    flex-shrink: 0;
    color: var(--color-muted);
}
.link-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.link-text .link-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-ink) !important;
    margin: 0;
    text-decoration: none !important;
}
.link-url {
    font-size: 11px;
    color: var(--color-muted-soft) !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Full-width Image Link Card (Overlay style) */
.link-overlay-card {
    position: relative;
    display: block;
    cursor: pointer;
    text-decoration: none !important;
}
.link-overlay-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}
.link-overlay-card:hover img {
    transform: scale(1.02);
}
.link-meta-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(16, 16, 16, 0.95) 0%, rgba(16, 16, 16, 0.6) 65%, rgba(16, 16, 16, 0.15) 85%, transparent 100%);
    padding: var(--space-md) var(--space-md) var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: 4px;
    pointer-events: none;
}
.link-meta-overlay .link-domain {
    color: #e4e4e7 !important;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}
.link-meta-overlay .link-title {
    color: var(--color-on-dark) !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    text-decoration: none !important;
}

.inline-link {
    color: var(--color-brand-accent);
    text-decoration: none;
}
.inline-link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   FLOATING ACTION BUTTON  (button-primary style)
   ========================================================================== */
.fab-btn {
    position: fixed;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 56px;
    background: #ffffff;
    color: #111111;
    border: 3.5px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 90;
    
    /* Gradient border using background-image and background-clip */
    background-image: linear-gradient(#ffffff, #ffffff), linear-gradient(135deg, #06b6d4 0%, #10b981 50%, #fb923c 100%);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 0 12px rgba(6, 182, 212, 0.25);
    transition: transform var(--transition), box-shadow var(--transition);
    animation: breathing-glow-gradient 3s infinite ease-in-out;
}
.fab-btn:hover {
    transform: translateX(-50%) scale(1.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12), 0 0 22px rgba(6, 182, 212, 0.6);
}
.fab-btn.recording {
    background-image: linear-gradient(#ffffff, #ffffff), linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    animation: breathing-recording-gradient 0.8s infinite ease-in-out;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.8);
}

@keyframes breathing-glow-gradient {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 0 12px rgba(6, 182, 212, 0.25);
    }
    50% {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 0 24px rgba(219, 39, 119, 0.4), 0 0 12px rgba(6, 182, 212, 0.35);
    }
}

@keyframes breathing-recording-gradient {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
    }
    50% {
        transform: scale(1.12);
        box-shadow: 0 0 30px rgba(239, 68, 68, 0.9);
    }
}

/* ==========================================================================
   ADD SCRAP DRAWER  (sheet pattern)
   ========================================================================== */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17,17,17,0.4);
    z-index: 190;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.add-scrap-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-canvas);
    border-top: 1px solid var(--color-hairline);
    border-top-left-radius: var(--rounded-xl);
    border-top-right-radius: var(--rounded-xl);
    z-index: 200;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 90vh;
    max-height: 90dvh;
    display: flex;
    flex-direction: column;
}
.add-scrap-drawer.active {
    transform: translateY(0);
}
/* Pull handle */
.add-scrap-drawer::before {
    content: "";
    display: block;
    width: 32px;
    height: 4px;
    background: var(--color-surface-strong);
    border-radius: var(--rounded-pill);
    margin: 10px auto 0;
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-xl);
    border-bottom: 1px solid var(--color-hairline-soft);
}
.drawer-header h2 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.3px;
    color: var(--color-ink);
}
.close-drawer {
    width: 32px;
    height: 32px;
    background: var(--color-surface-soft);
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-pill);
    color: var(--color-muted);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background var(--transition);
}
.close-drawer:hover {
    background: var(--color-surface-strong);
    color: var(--color-ink);
}

.drawer-body {
    padding: var(--space-xl);
    overflow-y: auto;
    flex: 1;
}

/* ==========================================================================
   TABS  (nav-pill-group + category-tab pattern)
   ========================================================================== */
.tab-header {
    display: flex;
    gap: 4px;
    margin-bottom: var(--space-xl);
    background: var(--color-surface-soft);
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-pill);
    padding: 4px;
}
.tab-btn {
    flex: 1;
    padding: 8px 14px;
    background: transparent;
    border: none;
    color: var(--color-muted);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--rounded-pill);
    cursor: pointer;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.tab-btn.active {
    background: var(--color-canvas);
    color: var(--color-ink);
    box-shadow: var(--shadow-xs);
}
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ==========================================================================
   FORM ELEMENTS  (text-input component)
   ========================================================================== */
.form-group {
    margin-bottom: var(--space-md);
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-ink);
    margin-bottom: 6px;
    line-height: 1.4;
}
.form-group input[type="text"],
.form-group input[type="url"],
.form-group textarea,
.form-group select {
    width: 100%;
    min-height: 40px;
    background: var(--color-canvas);
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-md);
    color: var(--color-ink);
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: 14px;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--color-muted);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-ink);
    box-shadow: 0 0 0 3px rgba(17,17,17,0.07);
}

.file-dropzone {
    display: block;
    border: 1.5px dashed var(--color-hairline);
    border-radius: var(--rounded-md);
    padding: var(--space-xl);
    text-align: center;
    cursor: pointer;
    color: var(--color-muted);
    font-size: 14px;
    transition: border-color var(--transition), background var(--transition);
}
.file-dropzone:hover {
    border-color: var(--color-primary);
    background: var(--color-surface-soft);
    color: var(--color-ink);
}
.file-dropzone input {
    display: none;
}

.image-upload-preview {
    max-height: 160px;
    border-radius: var(--rounded-md);
    margin-top: var(--space-sm);
    display: block;
    max-width: 100%;
    border: 1px solid var(--color-hairline);
}
.video-upload-preview {
    width: 100%;
    border-radius: var(--rounded-md);
    margin-top: var(--space-sm);
    max-height: 180px;
    display: block;
    background: var(--color-surface-dark);
}

/* Metadata loader */
.meta-loader {
    font-size: 13px;
    color: var(--color-muted);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}
.meta-loader::before {
    content: "";
    width: 12px;
    height: 12px;
    border: 2px solid var(--color-hairline);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* Metadata preview card */
.meta-preview-card {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-surface-soft);
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-md);
    align-items: center;
}
.meta-preview-card img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: var(--rounded-sm);
    border: 1px solid var(--color-hairline);
    flex-shrink: 0;
}
.meta-preview-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.meta-title-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--color-muted-soft);
    font-weight: 500;
}
#meta-preview-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 var(--space-md);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    border-radius: var(--rounded-md);
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid transparent;
}
/* button-primary */
.btn-primary {
    background: var(--color-primary);
    color: var(--color-on-primary);
    border-color: var(--color-primary);
}
.btn-primary:hover {
    background: var(--color-primary-active);
    border-color: var(--color-primary-active);
}
/* button-secondary */
.btn-outline {
    background: var(--color-canvas);
    color: var(--color-ink);
    border-color: var(--color-hairline);
}
.btn-outline:hover {
    border-color: var(--color-primary);
    background: var(--color-surface-soft);
}
.btn-sm {
    height: 32px;
    padding: 0 12px;
    font-size: 12px;
    border-radius: var(--rounded-sm);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    margin-top: var(--space-xl);
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-hairline-soft);
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(17,17,17,0.45);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.modal.active {
    opacity: 1;
    pointer-events: auto;
}
.modal-content {
    background: var(--color-canvas);
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-xl);
    width: 100%;
    max-width: 540px;
    max-height: 85vh;
    max-height: 85dvh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
}
.modal-sm { max-width: 380px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-xl) var(--space-xl) var(--space-md);
}
.modal-header h2,
.modal-header h3 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: var(--color-ink);
}
.close-modal {
    width: 32px;
    height: 32px;
    background: var(--color-surface-soft);
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-pill);
    color: var(--color-muted);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background var(--transition);
}
.close-modal:hover {
    background: var(--color-surface-strong);
    color: var(--color-ink);
}
.modal-body {
    padding: var(--space-sm) var(--space-xl) var(--space-xl);
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    border-top: 1px solid var(--color-hairline-soft);
}

/* ==========================================================================
   SETTINGS MODAL CONTENT
   ========================================================================== */
.settings-section {
    margin-bottom: var(--space-xl);
}
.settings-section h3 {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--color-muted-soft);
    margin-bottom: var(--space-sm);
}
.active-team-card {
    background: var(--color-surface-card);
    border-radius: var(--rounded-lg);
    padding: var(--space-md) var(--space-lg);
    border: 1px solid var(--color-hairline);
}
.active-team-label {
    font-size: 12px;
    color: var(--color-muted-soft);
    font-weight: 500;
}
.active-team-card h2 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: var(--color-ink);
    margin: 4px 0 var(--space-sm);
}
.invite-share-box {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-sm);
    background: var(--color-canvas);
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-md);
    padding: var(--space-xs) var(--space-md);
    font-size: 13px;
    color: var(--color-body);
}
.invite-share-box code {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-primary);
    background: var(--color-surface-soft);
    padding: 2px 8px;
    border-radius: var(--rounded-sm);
}

.team-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-bottom: var(--space-sm);
}
.team-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--color-surface-soft);
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-md);
}
.team-list-item.active {
    border-color: var(--color-primary);
    background: var(--color-canvas);
}
.team-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.team-item-info strong {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-ink);
}
.team-item-info span {
    font-size: 12px;
    color: var(--color-muted);
}
.team-item-info code {
    font-family: var(--font-mono);
    color: var(--color-brand-accent);
}
.current-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-success);
}
.settings-actions {
    display: flex;
    gap: var(--space-xs);
}

/* Members list */
.members-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.member-list-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 9px var(--space-sm);
    border-radius: var(--rounded-md);
    transition: background var(--transition);
}
.member-list-item:hover {
    background: var(--color-surface-soft);
}
.member-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--rounded-pill);
    object-fit: cover;
    border: 1.5px solid var(--color-hairline);
    flex-shrink: 0;
}
.member-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}
.member-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-ink);
}
.member-email {
    font-size: 12px;
    color: var(--color-muted-soft);
}
.member-role {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--color-muted-soft);
    background: var(--color-surface-soft);
    border: 1px solid var(--color-hairline);
    padding: 2px 8px;
    border-radius: var(--rounded-pill);
}

/* ==========================================================================
   LIGHTBOX
   ========================================================================== */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17,17,17,0.90);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
}
.lightbox-overlay.active { display: flex; }
.close-lightbox {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--rounded-pill);
    width: 36px;
    height: 36px;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */
.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-section) var(--space-xl);
    background: var(--color-surface-card);
    border: 1.5px dashed var(--color-hairline);
    border-radius: var(--rounded-lg);
    gap: var(--space-sm);
    max-width: 420px;
    margin: var(--space-xxl) auto;
}
.empty-icon {
    font-size: 40px;
    margin-bottom: var(--space-xs);
}
.empty-state h3 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: var(--color-ink);
}
.empty-state p {
    font-size: 14px;
    color: var(--color-body);
    margin-bottom: var(--space-sm);
    line-height: 1.55;
}

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

/* ==========================================================================
   RESPONSIVE  —  Mobile-first phone optimization
   ========================================================================== */
/* ==========================================================================
   FOOTER  (footer component — surface-dark, on-dark-soft)
   ========================================================================== */
.app-footer {
    background: var(--color-surface-dark);
    color: var(--color-on-dark-soft);
    padding: 64px var(--space-lg) 0;
    margin-top: var(--space-section);
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--space-xxl);
    padding-bottom: var(--space-xxl);
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.footer-brand {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}
.footer-logo {
    font-size: 22px;
}
.footer-wordmark {
    font-family: "Playwrite US Trad", cursive;
    font-size: 18px;
    font-weight: 400;
    letter-spacing: normal;
    color: var(--color-on-dark);
}
.footer-tagline {
    font-size: 14px;
    color: var(--color-on-dark-soft);
    line-height: 1.6;
    max-width: 280px;
}
.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
}
.footer-col {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}
.footer-col-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--color-on-dark);
    margin-bottom: var(--space-xxs);
}
.footer-col a {
    font-size: 14px;
    color: var(--color-on-dark-soft);
    text-decoration: none;
    transition: color var(--transition);
}
.footer-col a:hover {
    color: var(--color-on-dark);
}
.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-lg) 0;
    font-size: 13px;
    color: rgba(161,161,170,0.6);
}

@media (max-width: 768px) {
    .app-footer {
        padding: var(--space-xxl) var(--space-md) 0;
        margin-top: var(--space-xxl);
    }
    .footer-inner {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
    .footer-links {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-lg);
    }
    .footer-tagline { max-width: 100%; }
}
@media (max-width: 768px) {
    .app-header {
        padding: 0 var(--space-sm);
        gap: var(--space-xxs);
    }
    .header-left {
        gap: var(--space-xs);
    }
    .brand-group {
        gap: var(--space-xs);
    }
    .team-dropdown-wrapper select {
        font-size: 12px;
        padding: 4px 22px 4px 8px;
        background-position: right 6px center;
    }
    .header-right {
        gap: var(--space-xs);
    }
    .brand-group h1 {
        font-size: 16px;
    }
    .sim-user-box {
        display: none;
    }
    .settings-btn {
        width: 32px;
        height: 32px;
    }
    .user-avatar {
        width: 28px;
        height: 28px;
    }

    .app-container {
        padding: var(--space-md) var(--space-md);
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-sm);
        margin-top: calc(-1 * var(--space-md));
        margin-left: calc(-1 * var(--space-md));
        margin-right: calc(-1 * var(--space-md));
        padding-top: var(--space-md);
        padding-left: var(--space-md);
        padding-right: var(--space-md);
        padding-bottom: var(--space-sm);
        margin-bottom: var(--space-md);
    }
    .search-box-wrapper {
        min-width: 100%;
    }

    /* Horizontal scroll for filter chips — native app feel */
    .filters-scroll {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        max-width: 100%;
        padding-bottom: 2px;
    }
    .filters-scroll::-webkit-scrollbar { display: none; }
    .filter-chips { flex-shrink: 0; }
    .filter-select-wrapper { flex-shrink: 0; }

    .view-controls { display: none; }

    /* Single-column feed */
    .feed-grid {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }

    /* Compact cards */
    .scrap-card { border-radius: var(--rounded-md); }
    .card-header { padding: var(--space-sm); }
    .card-body {
        padding: var(--space-xs) var(--space-sm) var(--space-sm);
    }
    .scrap-card-title { font-size: 14px; }
    .scrap-note { font-size: 13px; }
    .link-img { width: 72px; min-width: 72px; height: 72px; }

    /* Drawer */
    .add-scrap-drawer {
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        padding-bottom: env(safe-area-inset-bottom, 16px);
    }
    .drawer-header { padding: var(--space-md) var(--space-md); }
    .drawer-body { padding: var(--space-md) var(--space-md) var(--space-xl); }
    .tab-header { margin-bottom: var(--space-md); }
    .tab-btn { font-size: 12px; padding: 7px 10px; }

    /* FAB */
    .fab-btn {
        bottom: calc(var(--space-md) + env(safe-area-inset-bottom, 0px));
        width: 52px;
        height: 52px;
        border-width: 3px;
        border-radius: 50%;
    }

    /* Modals */
    .modal {
        align-items: flex-end;
        padding: 0;
    }
    .modal-content {
        max-width: 100%;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        max-height: 90vh;
        max-height: 90dvh;
    }
}

/* --- SVG Vector Icons Styling --- */
.logo-icon svg {
    display: inline-block;
    vertical-align: middle;
    width: 20px;
    height: 20px;
    color: var(--color-ink);
}
.footer-logo svg {
    display: inline-block;
    vertical-align: middle;
    width: 22px;
    height: 22px;
    color: var(--color-on-dark);
}
.search-icon svg {
    display: block;
    width: 16px;
    height: 16px;
}
.tab-btn svg {
    display: inline-block;
    vertical-align: middle;
    width: 15px;
    height: 15px;
}
.link-icon svg {
    display: block;
    width: 18px;
    height: 18px;
}
.empty-icon svg {
    display: block;
    width: 44px;
    height: 44px;
    margin: 0 auto;
    color: var(--color-muted);
}

/* --- Auth View --- */
/* ======================================================
   AUTH SCREEN — Full-screen split layout
   Desktop: left decorative panel + right form
   Mobile: single column, full-screen card
   ====================================================== */
.auth-container {
    position: fixed;
    inset: 0;
    background: #101010;
    z-index: 2000;
    display: flex;
    align-items: stretch;
    overflow: hidden;
}
.auth-container.hidden {
    display: none;
}

/* The card fills the screen; on desktop it becomes the right column */
.auth-card {
    background: #101010;
    width: 100%;
    max-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* ── Desktop split panel (left decorative side) ── */
.auth-card::before {
    content: '';
    display: none; /* hidden on mobile, shown on desktop via override */
}

/* On desktop (≥ 900px) use a grid so the card becomes right-column */
@media (min-width: 900px) {
    .auth-container {
        display: grid;
        grid-template-columns: 1fr 520px;
        background: #101010;
    }
    /* Decorative left panel sits inside auth-container before auth-card */
    .auth-container::before {
        content: '';
        background: #ffffff;
        display: block;
        position: relative;
        overflow: hidden;
    }
    /* Big brand word on the left panel */
    .auth-container::after {
        content: 'Scrapsheet';
        font-family: "Playwrite US Trad", cursive;
        font-size: clamp(48px, 6vw, 80px);
        font-weight: 400;
        color: #111111;
        position: absolute;
        left: 0;
        top: 50%;
        width: calc(100% - 520px);
        transform: translateY(-50%);
        text-align: center;
        pointer-events: none;
        z-index: 2001;
        line-height: 1.2;
        padding: 0 48px;
        letter-spacing: -2px;
    }
    .auth-card {
        background: #101010;
        border-radius: 0;
        border: none;
        box-shadow: none;
        height: 100vh;
        height: 100dvh;
    }
    /* On desktop the wave curve and top white section form a compact header */
    .auth-top-section {
        padding: 40px 48px 0 48px;
        flex: 0 0 auto;
    }
    .auth-title-container {
        margin-top: var(--space-lg);
        margin-bottom: var(--space-lg);
        text-align: left;
    }
    #auth-main-title {
        font-size: 44px;
    }
    .auth-bottom-section {
        padding: 48px 48px 48px 48px;
        justify-content: center;
        gap: var(--space-lg);
    }
    .auth-wave-container {
        bottom: -28px;
    }
    .auth-switch-link {
        font-size: 14px;
    }
}

/* ── Shared section styles ── */
.auth-top-section {
    background: #ffffff;
    padding: var(--space-lg) var(--space-lg) 0 var(--space-lg);
    position: relative;
    display: flex;
    flex-direction: column;
    z-index: 10;
    flex: 0 0 auto;
}
.auth-top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.auth-logo-text {
    font-family: "Playwrite US Trad", cursive;
    font-size: 16px;
    font-weight: 400;
    color: #111111;
}
.auth-switch-link {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #6b7280;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: color var(--transition);
}
.auth-switch-link:hover {
    color: #111111;
}
.auth-switch-icon {
    width: 16px;
    height: 16px;
}
.auth-title-container {
    margin-top: var(--space-lg);
    margin-bottom: var(--space-xl);
    text-align: center;
}
#auth-main-title {
    font-family: var(--font-body);
    font-size: 38px;
    font-weight: 600;
    color: #111111;
    letter-spacing: -1px;
    line-height: 1.1;
}
.auth-wave-container {
    position: absolute;
    bottom: -32px;
    left: 0;
    width: 100%;
    height: 48px;
    z-index: 2;
    pointer-events: none;
}
.auth-wave-container svg {
    width: 100%;
    height: 100%;
    display: block;
}
.auth-bottom-section {
    background: #101010;
    padding: 48px var(--space-lg) var(--space-lg) var(--space-lg);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.auth-form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xxs);
    margin-bottom: var(--space-md);
}
.auth-form-group label {
    font-size: 12px;
    font-weight: 500;
    color: #9ca3af;
    padding-left: var(--space-xs);
}
.auth-form-group input {
    background: #1e1e1e;
    border: 1px solid #374151;
    border-radius: var(--rounded-pill);
    height: 44px;
    padding: 0 var(--space-md);
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 14px;
    transition: border-color var(--transition);
}
.auth-form-group input::placeholder {
    color: #4b5563;
}
.auth-form-group input:focus {
    outline: none;
    border-color: #ffffff;
}
.auth-btn-submit {
    width: 100%;
    height: 46px;
    border-radius: var(--rounded-pill);
    background: #111111;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 3.5px solid transparent;
    background-image: linear-gradient(#111111, #111111), linear-gradient(135deg, #06b6d4 0%, #10b981 50%, #fb923c 100%);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: transform var(--transition);
    margin-top: var(--space-md);
}
.auth-btn-submit:active {
    transform: scale(0.98);
}
.auth-btn-icon {
    width: 18px;
    height: 18px;
}
.auth-error {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: var(--color-error);
    padding: 10px 12px;
    border-radius: var(--rounded-md);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: var(--space-sm);
}

/* Mobile: full-screen single column */
@media (max-width: 899px) {
    .auth-container {
        padding: 0;
        background: #101010;
        display: flex;
    }
    .auth-card {
        max-width: 100%;
        max-height: 100%;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
        border: none;
        box-shadow: none;
    }
    .auth-bottom-section {
        padding-bottom: var(--space-xl);
        justify-content: flex-start;
    }
}

/* --- Voice Transcript Overlay --- */
.voice-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 17, 17, 0.4);
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    transition: opacity 0.25s ease;
}
.voice-overlay.hidden {
    display: none;
}
.voice-card {
    background: var(--color-canvas);
    border: 1px solid var(--color-hairline);
    border-radius: var(--rounded-xl);
    padding: var(--space-xl);
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    text-align: center;
}
.voice-status {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-brand-accent);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.voice-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--color-ink);
    line-height: 1.5;
    min-height: 48px;
    font-style: italic;
}
.voice-hint {
    font-size: 11px;
    color: var(--color-muted-soft);
}
/* Reacting Holographic AI Voice Orb */
.voice-orb-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 180px;
    margin: var(--space-md) 0;
}
.voice-orb {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    /* Translucent glassmorphic gradient orb */
    background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.1) 25%, rgba(6, 182, 212, 0.12) 50%, rgba(219, 39, 119, 0.20) 75%, rgba(37, 99, 235, 0.30) 100%);
    box-shadow: 
        inset -6px -6px 15px rgba(37, 99, 235, 0.15),
        inset 6px 6px 12px rgba(255, 255, 255, 0.4),
        0 4px 30px rgba(6, 182, 212, 0.12),
        0 8px 40px rgba(219, 39, 119, 0.1);
    overflow: hidden;
    transition: transform 0.12s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.12s cubic-bezier(0.2, 0.8, 0.2, 1);
    animation: orb-spin 16s linear infinite;
}

/* Layered swirling pseudo-elements inside the orb - higher blur and lower opacity for dreamy mist effect */
.voice-orb::before,
.voice-orb::after {
    content: '';
    position: absolute;
    top: -25%;
    left: -25%;
    width: 150%;
    height: 150%;
    border-radius: 42%;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.3) 0%, rgba(219, 39, 119, 0.3) 45%, rgba(139, 92, 246, 0.25) 100%);
    animation: orb-swirl 10s infinite linear;
    mix-blend-mode: color-dodge;
    filter: blur(16px);
}
.voice-orb::after {
    border-radius: 38%;
    background: linear-gradient(225deg, rgba(59, 130, 246, 0.25) 0%, rgba(236, 72, 153, 0.3) 50%, rgba(16, 185, 129, 0.2) 100%);
    animation: orb-swirl-back 7s infinite linear;
    mix-blend-mode: screen;
}

/* Refining/thinking animation states */
.voice-card.refining .voice-orb {
    animation: orb-spin 3s linear infinite, orb-refining-pulse 1.5s infinite ease-in-out;
}
.voice-card.refining .voice-orb::before,
.voice-card.refining .voice-orb::after {
    background: linear-gradient(135deg, rgba(219, 39, 119, 0.4) 0%, rgba(139, 92, 246, 0.4) 50%, rgba(251, 146, 60, 0.4) 100%);
    animation-duration: 4s;
}

.voice-card.refining .voice-status {
    color: var(--color-badge-pink);
    animation: pulse-status 1.5s infinite ease-in-out;
}

@keyframes orb-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes orb-swirl {
    0% { transform: rotate(0deg) translate(0, 0) scale(1); }
    50% { transform: rotate(180deg) translate(4px, -8px) scale(1.06); }
    100% { transform: rotate(360deg) translate(0, 0) scale(1); }
}
@keyframes orb-swirl-back {
    0% { transform: rotate(360deg) translate(0, 0) scale(1); }
    50% { transform: rotate(180deg) translate(-4px, 8px) scale(0.94); }
    100% { transform: rotate(0deg) translate(0, 0) scale(1); }
}
@keyframes orb-refining-pulse {
    0%, 100% { transform: scale(1); filter: saturate(1); }
    50% { transform: scale(1.05); filter: saturate(1.3); }
}
@keyframes pulse-status {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
