/* ============================================================
   StackMatch — Main Shared Styles
   Dark theme / IBM Plex / Grid overlay / Neon accent
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=IBM+Plex+Sans:wght@300;400;500;600;700&display=swap');

/* -- CSS Variables -- */
:root {
    --bg: #0a0a0a;
    --surface: #111111;
    --surface-2: #1a1a1a;
    --muted: #888888;    /* alias used by older pages */
    --error: #ff4444;    /* alias used by older pages */
    --surface-3: #222222;
    --border: #222222;
    --border-light: #333333;
    --text: #e0e0e0;
    --text-dim: #888888;
    --text-muted: #555555;
    --accent: #d4ff00;
    --accent-dim: rgba(212, 255, 0, 0.15);
    --accent-glow: rgba(212, 255, 0, 0.3);
    --danger: #ff4444;
    --danger-dim: rgba(255, 68, 68, 0.15);
    --success: #00cc88;
    --success-dim: rgba(0, 204, 136, 0.15);
    --warning: #ffaa00;
    --warning-dim: rgba(255, 170, 0, 0.15);
    --info: #4488ff;
    --info-dim: rgba(68, 136, 255, 0.15);
    --font-mono: 'IBM Plex Mono', monospace;
    --font-sans: 'IBM Plex Sans', sans-serif;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 2px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
    --transition: 0.2s ease;
    --nav-bg: rgba(10,10,10,0.92);
    --nav-dropdown-bg: rgba(10,10,10,0.98);
    --nav-mobile-bg: rgba(10,10,10,0.98);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* -- Light mode overrides -- */
body.light-mode {
    --bg: #f4f4f0;
    --surface: #ffffff;
    --surface-2: #ebebeb;
    --surface-3: #e0e0e0;
    --border: #d0d0d0;
    --border-light: #c0c0c0;
    --text: #111111;
    --text-dim: #555555;
    --text-muted: #888888;
    --muted: #666666;
    --accent: #6b8c00;
    --accent-dim: rgba(107,140,0,0.12);
    --accent-glow: rgba(107,140,0,0.25);
    --shadow: 0 2px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.15);
    --nav-bg: rgba(244,244,240,0.95);
    --nav-dropdown-bg: rgba(255,255,255,0.98);
    --nav-mobile-bg: rgba(244,244,240,0.98);
}

body.light-mode::before { display: none; }

/* Fix hardcoded-background inputs to follow theme */
body.light-mode input[style*="background:#0a0a0a"],
body.light-mode input[style*="background: #0a0a0a"] {
    background: #fff !important;
    color: #111 !important;
}

body.light-mode .section {
    background: var(--surface);
}

body.light-mode [style*="background:#0a0a0a"],
body.light-mode [style*="background: #0a0a0a"] {
    background: var(--surface-2) !important;
}

body.light-mode [style*="background:#111"],
body.light-mode [style*="background: #111"] {
    background: var(--surface) !important;
}

body.light-mode [style*="background:#1a1a1a"],
body.light-mode [style*="background: #1a1a1a"] {
    background: var(--surface-2) !important;
}

/* -- Grid Background Overlay -- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(212,255,0,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(212,255,0,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* -- Links -- */
a { color: var(--accent); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: 0.8; }

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.5px;
    text-decoration: none;
}

.nav-logo span { color: var(--text); font-weight: 400; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
    padding: 8px 14px;
    border-radius: var(--radius);
    transition: all var(--transition);
    text-decoration: none;
}

.nav-link:hover { color: var(--text); background: var(--surface-2); opacity: 1; }
.nav-link.active { color: var(--accent); background: var(--accent-dim); }

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-user-name {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-dim);
}

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
}

.nav-btn-logout {
    font-family: var(--font-mono);
    font-size: 12px;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 6px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}

.nav-btn-logout:hover { border-color: var(--danger); color: var(--danger); }

/* -- Nav Dropdown -- */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle { cursor: pointer; user-select: none; }
.nav-caret { font-size: 10px; margin-left: 3px; }
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--nav-dropdown-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 160px;
    z-index: 1100;
    padding: 4px 0;
}
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.nav-dropdown-item {
    display: block;
    padding: 9px 16px;
    color: var(--text-dim);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 12px;
    transition: all var(--transition);
    white-space: nowrap;
}
.nav-dropdown-item:hover { color: var(--accent); background: var(--accent-dim); opacity: 1; }
.nav-dropdown-item.active { color: var(--accent); }

/* -- Mobile Nav Toggle -- */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 24px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav-links {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--nav-mobile-bg);
        flex-direction: column;
        padding: 16px;
        border-bottom: 1px solid var(--border);
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: all 0.3s ease;
    }
    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }
    .nav-link { width: 100%; text-align: center; padding: 12px; }
}

/* ============================================================
   PAGE WRAPPER
   ============================================================ */
.page-wrap {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 24px 40px;
    min-height: 100vh;
}

.page-wrap-wide {
    max-width: 1400px;
}

.page-wrap-narrow {
    max-width: 720px;
}

/* -- Legacy page/section classes used by older pages -- */
.page {
    position: relative;
    z-index: 1;
    margin: 0 auto;
    padding: 80px 24px 40px;
    min-height: 100vh;
}
.section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
}
.section-title {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 16px;
}
.no-auth {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    text-align: center;
    color: var(--text-dim);
}
.btn-primary {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: var(--accent);
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}
.btn-primary:hover { box-shadow: 0 0 20px var(--accent-glow); opacity: 0.9; }
.btn-sm {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: none;
    color: var(--text-dim);
    border: 1px solid var(--border);
    padding: 5px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}
.btn-sm:hover { border-color: var(--accent); color: var(--accent); }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.page-title .accent { color: var(--accent); }

.page-subtitle {
    font-size: 14px;
    color: var(--text-dim);
    line-height: 1.5;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition);
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.card-title {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.card-meta {
    font-size: 13px;
    color: var(--text-dim);
}

.card-body {
    font-size: 14px;
    color: var(--text-dim);
    line-height: 1.6;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* -- Card Grid -- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

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

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #0a0a0a;
}
.btn-primary:hover { box-shadow: 0 0 20px var(--accent-glow); opacity: 1; }

.btn-secondary {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger {
    background: var(--danger-dim);
    color: var(--danger);
    border: 1px solid transparent;
}
.btn-danger:hover { border-color: var(--danger); }

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }

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

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dim);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 14px;
    transition: border-color var(--transition);
    outline: none;
}

.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-muted); }

textarea.form-input {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

.form-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================================
   BADGES / TAGS
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-accent { background: var(--accent-dim); color: var(--accent); }
.badge-success { background: var(--success-dim); color: var(--success); }
.badge-warning { background: var(--warning-dim); color: var(--warning); }
.badge-danger { background: var(--danger-dim); color: var(--danger); }
.badge-info { background: var(--info-dim); color: var(--info); }
.badge-muted { background: var(--surface-3); color: var(--text-dim); }

/* Skill tier badges */
.badge-tier-1 { background: var(--surface-3); color: var(--text-dim); }
.badge-tier-2 { background: var(--info-dim); color: var(--info); }
.badge-tier-3 { background: var(--accent-dim); color: var(--accent); }

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ============================================================
   STATS
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 6px;
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--surface);
}

.table td { color: var(--text); }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--surface); }

/* ============================================================
   MODALS / OVERLAYS
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 540px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-title {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* ============================================================
   ALERTS / TOASTS
   ============================================================ */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success { background: var(--success-dim); color: var(--success); border: 1px solid rgba(0,204,136,0.2); }
.alert-error { background: var(--danger-dim); color: var(--danger); border: 1px solid rgba(255,68,68,0.2); }
.alert-warning { background: var(--warning-dim); color: var(--warning); border: 1px solid rgba(255,170,0,0.2); }
.alert-info { background: var(--info-dim); color: var(--info); border: 1px solid rgba(68,136,255,0.2); }

.toast-container {
    position: fixed;
    top: 72px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 18px;
    border-radius: var(--radius);
    font-size: 13px;
    font-family: var(--font-mono);
    box-shadow: var(--shadow-lg);
    animation: toast-in 0.3s ease, toast-out 0.3s ease 2.7s forwards;
}

@keyframes toast-in { from { transform: translateX(100%); opacity: 0; } }
@keyframes toast-out { to { transform: translateX(100%); opacity: 0; } }

/* ============================================================
   LOADING / SKELETON
   ============================================================ */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.skeleton {
    background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius);
}

@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 22px; width: 60%; margin-bottom: 12px; }
.skeleton-card { height: 160px; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state-title {
    font-family: var(--font-mono);
    font-size: 16px;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ============================================================
   SWIPE INTERFACE
   ============================================================ */
.swipe-container {
    max-width: 420px;
    margin: 0 auto;
    position: relative;
    height: 520px;
}

.swipe-card {
    position: absolute;
    inset: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    display: flex;
    flex-direction: column;
    cursor: grab;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    user-select: none;
}

.swipe-card:active { cursor: grabbing; }

.swipe-card.swiping-right {
    border-color: var(--success);
    box-shadow: 0 0 30px var(--success-dim);
}

.swipe-card.swiping-left {
    border-color: var(--danger);
    box-shadow: 0 0 30px var(--danger-dim);
}

.swipe-card-name {
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.swipe-card-title {
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 16px;
}

.swipe-card-section {
    margin-bottom: 14px;
}

.swipe-card-section-label {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.swipe-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
}

.swipe-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text-dim);
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
}

.swipe-btn-pass:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-dim); }
.swipe-btn-like:hover { border-color: var(--success); color: var(--success); background: var(--success-dim); }
.swipe-btn-super:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* ============================================================
   MESSAGING
   ============================================================ */
.msg-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    height: calc(100vh - 100px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

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

.msg-sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
}

.msg-contact {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--transition);
}

.msg-contact:hover { background: var(--surface-2); }
.msg-contact.active { background: var(--accent-dim); border-left: 3px solid var(--accent); }

.msg-contact-name {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.msg-contact-preview {
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-area {
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

.msg-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
}

.msg-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.msg-bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: var(--radius-lg);
    font-size: 13px;
    line-height: 1.5;
}

.msg-bubble-sent {
    align-self: flex-end;
    background: var(--accent-dim);
    color: var(--text);
    border-bottom-right-radius: 4px;
}

.msg-bubble-received {
    align-self: flex-start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.msg-bubble-time {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
}

.msg-input-area {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    background: var(--surface);
}

.msg-input {
    flex: 1;
    padding: 10px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 13px;
    outline: none;
}

.msg-input:focus { border-color: var(--accent); }

/* ============================================================
   VISIBILITY SCORE
   ============================================================ */
.visibility-score {
    display: flex;
    align-items: center;
    gap: 12px;
}

.visibility-bar {
    flex: 1;
    height: 8px;
    background: var(--surface-3);
    border-radius: 100px;
    overflow: hidden;
}

.visibility-fill {
    height: 100%;
    border-radius: 100px;
    transition: width 0.5s ease;
}

.visibility-fill.hot { background: var(--danger); }
.visibility-fill.popular { background: var(--warning); }
.visibility-fill.new { background: var(--info); }

.visibility-value {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    min-width: 32px;
}

/* -- field-label (legacy alias for form-label) -- */
.field-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-dim);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================================
   SKILL BADGES (tier badges used on skills.html, preview.html)
   ============================================================ */
.skill-badge {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 4px;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.skill-badge-grey  { background: var(--surface-3); color: var(--text-dim); border: 1px solid var(--border); }
.skill-badge-blue  { background: var(--info-dim);  color: var(--info);     border: 1px solid rgba(68,136,255,.25); }
.skill-badge-gold  { background: var(--accent-dim); color: var(--accent);  border: 1px solid var(--accent-glow); }

/* ============================================================
   UTILITIES
   ============================================================ */
.text-accent { color: var(--accent); }
.text-dim { color: var(--text-dim); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-center { text-align: center; }
.text-mono { font-family: var(--font-mono); }

.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

.hidden { display: none !important; }

/* -- Floating theme toggle (auto-injected on pages without a nav toggle) -- */
.theme-float-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: border-color var(--transition), box-shadow var(--transition);
    padding: 0;
    line-height: 1;
}
.theme-float-btn:hover { border-color: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
}
