/* Bloc 59 - modern clean UI, legible for all ages */

:root {
    --bg: #f5f7fa;
    --surface: #ffffff;
    --surface-alt: #eef2f7;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --text: #0f172a;
    --text-soft: #475569;
    --text-muted: #94a3b8;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: #dbeafe;
    --accent: #0ea5e9;
    --success: #16a34a;
    --success-soft: #dcfce7;
    --danger: #dc2626;
    --danger-soft: #fee2e2;
    --warning: #f59e0b;
    --warning-soft: #fef3c7;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
}

* { box-sizing: border-box; }
html { font-size: 17px; }
body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    margin: 0;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Inline links - dark with subtle underline, NOT blue */
a {
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: var(--border-strong);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: text-decoration-color 0.15s, color 0.15s;
}
a:hover {
    color: var(--primary);
    text-decoration-color: var(--primary);
}
/* Buttons, nav links, etc. opt out of default link styling */
.btn, .main-nav a, .site-title, .logout, .demo-login-btn,
.flash a, .live-banner a, .demo-banner a, .filter-btn,
.tx-filter, .pagination a, .meta a {
    text-decoration: none;
}

/* Header - dark, separated from body */
.site-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #f1f5f9;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 4px 20px -8px rgba(15, 23, 42, 0.5);
    position: relative;
}
.site-header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 50%, var(--primary) 100%);
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 14px;
    max-width: none;       /* use full screen width */
    padding: 0 16px;
}
.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 0 1 auto;        /* size to content, can shrink */
    min-width: 0;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;        /* right cluster never shrinks */
}
.site-title {
    color: #fff;
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.site-title img {
    width: 38px;
    height: 38px;
    display: block;
}
.site-title-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    white-space: nowrap;
}
.site-title-text .small {
    font-size: 0.68rem;
    font-weight: 500;
    color: #94a3b8;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 2px;
}

.main-nav {
    display: flex;
    gap: 2px;
    flex: 0 1 auto;       /* size to content, scroll if too tight */
    align-items: center;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: #475569 transparent;
    padding-bottom: 2px;
}
.main-nav::-webkit-scrollbar { height: 4px; }
.main-nav::-webkit-scrollbar-track { background: transparent; }
.main-nav::-webkit-scrollbar-thumb { background: #475569; border-radius: 2px; }
.main-nav::-webkit-scrollbar-thumb:hover { background: #64748b; }
.main-nav a {
    color: #cbd5e1;
    text-decoration: none;
    padding: 7px 9px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    transition: color 0.15s, background 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;       /* nav items never compress */
}
.nav-icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}
.nav-label { display: inline; }

/* Mid-desktop: hide subtitle for more breathing room */
@media (max-width: 1300px) {
    .site-title-text .small { display: none; }
    .header-search { width: 180px; }
}

@media (max-width: 1100px) {
    .header-search { width: 140px; }
    .user-menu .user-name { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-width: 950px) {
    .header-search { display: none; }
    .user-menu .user-name { display: none; }
    .site-header .container { gap: 10px; }
}
.main-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}
.main-nav a.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
}
.admin-link {
    color: #fbbf24 !important;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.4);
    margin-left: 6px;
}
.admin-link:hover {
    background: rgba(251, 191, 36, 0.22) !important;
    border-color: rgba(251, 191, 36, 0.7);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 12px;
    border-left: 1px solid #334155;
    flex-shrink: 0;
}
.user-name {
    color: #cbd5e1;
    font-size: 0.88rem;
    font-weight: 500;
}
.logout {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid #334155;
    transition: all 0.15s;
}
.logout:hover {
    color: #fff;
    border-color: var(--danger);
    background: rgba(220, 38, 38, 0.1);
}

/* Demo banner */
.demo-banner {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #78350f;
    padding: 10px 0;
    text-align: center;
    border-bottom: 1px solid #fcd34d;
    font-size: 0.92rem;
}
.demo-banner a { color: #78350f; text-decoration: underline; font-weight: 600; margin-left: 8px; }

/* Live banner */
.live-banner {
    background: linear-gradient(135deg, var(--danger), #b91c1c);
    color: #fff;
    padding: 14px 0;
    text-align: center;
    box-shadow: var(--shadow-lg);
}
.live-banner strong { margin: 0 8px; font-size: 1.05rem; font-weight: 600; }
.live-banner a {
    color: var(--danger);
    background: #fff;
    padding: 8px 18px;
    text-decoration: none;
    margin-left: 14px;
    font-weight: 600;
    border-radius: var(--radius-sm);
}
.live-banner a:hover { background: var(--surface-alt); }
.live-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 1.4s infinite;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.6); }
    70% { box-shadow: 0 0 0 12px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* Main content */
.main-content {
    padding: 40px 24px 80px;
    min-height: 70vh;
}
h1, h2, h3 {
    color: var(--text);
    line-height: 1.25;
    letter-spacing: -0.02em;
}
h1 { font-size: 2rem; margin: 0 0 24px; font-weight: 700; }
h2 { font-size: 1.4rem; margin: 32px 0 16px; font-weight: 650; }
h3 { font-size: 1.1rem; margin: 20px 0 12px; font-weight: 600; }

/* Flash messages */
.flash {
    padding: 14px 20px;
    margin-bottom: 18px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    border: 1px solid;
}
.flash-success { background: var(--success-soft); border-color: #86efac; color: #14532d; }
.flash-error { background: var(--danger-soft); border-color: #fca5a5; color: #7f1d1d; }
.flash-info { background: var(--primary-soft); border-color: #93c5fd; color: #1e3a8a; }

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
.card-accent {
    border-left: 4px solid var(--primary);
}

/* Forms */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
    font-size: 0.9rem;
}
.form-group input[type=text], .form-group input[type=email], .form-group input[type=tel],
.form-group select, .form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.form-help {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 6px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 22px;
    border: none;
    background: var(--primary);
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    line-height: 1.2;
}
.btn:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.btn-secondary:hover { background: var(--surface-alt); border-color: var(--text-muted); color: var(--text); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--success); }
.btn-success:hover { background: #15803d; }
.btn-large { padding: 14px 28px; font-size: 1.05rem; }

/* Tables - wrapped for horizontal scroll on mobile */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 20px;
}
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    min-width: 100%;
}
.table-wrap table { border: none; border-radius: 0; }
th, td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
th { background: var(--surface-alt); font-weight: 600; font-size: 0.82rem; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.04em; position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-alt); }

/* Lists */
.list-item {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 20px 24px;
    margin-bottom: 14px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all 0.15s;
}
.list-item:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.list-item h3 { margin-top: 0; }
.meta {
    color: var(--text-muted);
    font-size: 0.88rem;
}
.priority-urgent {
    border-left: 4px solid var(--danger);
}

/* Topics list */
.topic-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 10px;
    text-decoration: none !important;
    color: var(--text);
    box-shadow: var(--shadow);
    transition: all 0.15s;
}
.topic-row:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
    color: var(--text);
}
.topic-row-main { flex: 1; min-width: 0; }
.topic-title { font-weight: 600; font-size: 1.02rem; line-height: 1.4; }
.topic-row-replies {
    text-align: center;
    flex-shrink: 0;
    min-width: 60px;
    padding-left: 14px;
    border-left: 1px solid var(--border);
}
.reply-count { font-size: 1.5rem; font-weight: 700; color: var(--primary); line-height: 1; }

/* Filter pills */
.filter-btn {
    display: inline-block;
    padding: 6px 14px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    font-size: 0.88rem;
    color: var(--text-soft);
    cursor: pointer;
    text-decoration: none !important;
    transition: all 0.15s;
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-active {
    background: var(--text);
    color: #fff !important;
    border-color: var(--text);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
}
.badge-urgent { background: var(--danger); color: #fff; }
.badge-pin { background: var(--warning-soft); color: #92400e; }
.badge-closed { background: var(--surface-alt); color: var(--text-muted); }
.badge-cat { background: var(--primary-soft); color: #1e40af; }
.badge-admin { background: var(--accent); color: #fff; }

/* Reply card */
.reply-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

/* Topic admin actions on mobile */
.topic-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.topic-admin-actions .btn { padding: 7px 12px; font-size: 0.85rem; }

/* Textarea */
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
    border-radius: var(--radius-sm);
    resize: vertical;
    min-height: 100px;
}
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

/* Masked GDPR data */
.masked-data {
    font-family: monospace;
    color: var(--text-soft);
}
.reveal-btn {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.78rem;
    color: var(--text-soft);
    cursor: pointer;
    margin-left: 4px;
}
.reveal-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Header search */
.header-search {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #334155;
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    width: 220px;
    flex-shrink: 0;
}
.header-search svg { width: 16px; height: 16px; color: #94a3b8; flex-shrink: 0; }
.header-search input {
    background: transparent;
    border: none;
    color: #fff;
    padding: 6px 10px;
    width: 100%;
    font-family: inherit;
    font-size: 0.92rem;
    outline: none;
}
.header-search input::placeholder { color: #94a3b8; }
@media (max-width: 900px) {
    .header-search { display: none; }
}

/* Calendar date block */
.cal-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 78px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 4px 8px;
    line-height: 1.1;
    overflow: hidden;
}
.cal-date .cal-day {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}
.cal-date .cal-mon {
    font-size: 0.78rem;
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}
.cal-date .cal-wd {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.list-item.with-cal {
    display: flex;
    gap: 18px;
    align-items: stretch;
}
.list-item.with-cal .cal-date {
    align-self: flex-start;
}
.list-item.with-cal .item-body {
    flex: 1;
    min-width: 0;
}
.list-item.priority-urgent .cal-date {
    background: var(--danger-soft);
    border-color: #fca5a5;
}
.list-item.priority-urgent .cal-date .cal-mon { color: var(--danger); }

/* Past dates - grayed out */
.cal-date.cal-past {
    background: #f1f5f9;
    border-color: #e2e8f0;
    opacity: 0.6;
}
.cal-date.cal-past .cal-day,
.cal-date.cal-past .cal-mon,
.cal-date.cal-past .cal-wd {
    color: var(--text-muted);
}
.list-item.priority-urgent .cal-date.cal-past {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

/* Vote bar */
.vote-bar {
    background: var(--surface-alt);
    border-radius: 999px;
    height: 14px;
    overflow: hidden;
}
.vote-bar-fill {
    background: linear-gradient(90deg, var(--primary), var(--accent));
    height: 100%;
    transition: width 0.5s;
    border-radius: 999px;
}
.vote-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 1rem;
}
.vote-option:hover { border-color: var(--primary); background: var(--primary-soft); }
.vote-option input[type=radio] { width: 20px; height: 20px; }

/* Notification bell */
.notif-bell {
    background: transparent;
    border: 1px solid #334155;
    color: #cbd5e1;
    border-radius: var(--radius-sm);
    width: 38px;
    height: 38px;
    cursor: pointer;
    position: relative;
    padding: 8px;
}
.notif-bell svg { width: 100%; height: 100%; }
.notif-bell:hover { color: #fff; border-color: var(--primary); }
.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 999px;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}
.notif-panel {
    position: absolute;
    top: 100%;
    right: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 380px;
    max-width: calc(100vw - 32px);
    max-height: 500px;
    overflow-y: auto;
    z-index: 60;
    margin-top: 4px;
}
.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-alt);
}
.notif-header button { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 0.85rem; }
.notif-item {
    display: block;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    text-decoration: none !important;
    background: var(--primary-soft);
}
.notif-item.read { background: var(--surface); }
.notif-item:hover { background: var(--surface-alt); }
.notif-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; }
.notif-body { color: var(--text-soft); font-size: 0.85rem; line-height: 1.4; }
.notif-time { font-size: 0.75rem; color: var(--text-muted); margin-top: 6px; }
.notif-empty { padding: 20px; text-align: center; color: var(--text-muted); }

/* Broadcast / Meeting layout */
.broadcast-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 20px;
    margin-top: 18px;
}
@media (max-width: 900px) {
    .broadcast-grid { grid-template-columns: 1fr; }
}

.audio-meter {
    height: 8px;
    background: var(--surface-alt);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}
#audioMeterBar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #16a34a, #f59e0b, #dc2626);
    transition: width 0.05s;
}
.broadcast-status {
    background: var(--surface-alt);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    margin-bottom: 8px;
}

.chat-box {
    background: var(--surface-alt);
    border-radius: var(--radius-sm);
    padding: 12px;
    flex: 1;
    min-height: 280px;
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 12px;
}
.chat-msg {
    background: var(--surface);
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
    font-size: 0.92rem;
    line-height: 1.4;
}
.chat-meta { margin-bottom: 4px; font-size: 0.82rem; }
.chat-input {
    display: flex;
    gap: 8px;
}
.chat-input input {
    flex: 1;
    padding: 11px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
}
.chat-input input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

/* Camera viewer */
.camera-card { padding: 16px; }
.video-wrap {
    position: relative;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-top: 8px;
}
.video-wrap video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.video-status {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #cbd5e1;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    pointer-events: none;
}

/* Demo login buttons */
.demo-login-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--surface), var(--surface-alt));
    color: var(--text);
    border: 1px solid var(--border-strong);
    padding: 18px 22px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    border-radius: var(--radius);
    transition: all 0.2s;
}
.demo-login-btn:hover {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Stats grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 22px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-decoration: none !important;
    color: var(--text);
    display: block;
    transition: all 0.15s;
}
a.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}
.stat-value {
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stat-label {
    color: var(--text-soft);
    font-size: 0.92rem;
    margin-top: 8px;
}

/* Footer */
.site-footer {
    background: var(--surface);
    color: var(--text-muted);
    padding: 32px 0;
    text-align: center;
    border-top: 1px solid var(--border);
}
.site-footer p { margin: 0; font-size: 0.88rem; }

/* Hamburger menu button (hidden on desktop) */
.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid #334155;
    border-radius: var(--radius-sm);
    width: 44px;
    height: 44px;
    cursor: pointer;
    padding: 10px 8px;
    flex-direction: column;
    justify-content: space-between;
    margin-left: auto;
}
.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: #f1f5f9;
    border-radius: 2px;
    transition: all 0.25s;
}
.menu-toggle.active span:nth-child(1) { transform: translateY(10px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }

/* Mobile */
@media (max-width: 900px) {
    html { font-size: 16px; }
    .container { padding: 0 16px; }
    .site-header { padding: 12px 0; }
    .site-header .container {
        flex-wrap: wrap;
        gap: 10px;
    }
    .site-title { font-size: 1rem; }
    .site-title img { width: 36px; height: 36px; }
    .site-title-text .small { display: none; }

    .menu-toggle { display: flex; order: 5; margin-left: auto; }

    .main-nav {
        display: none;
        flex-direction: column;
        width: 100%;
        background: rgba(15, 23, 42, 0.98);
        padding: 12px 0 8px;
        margin-top: 8px;
        border-top: 1px solid #334155;
        gap: 2px;
        order: 10;
    }
    .main-nav.open { display: flex; }
    .main-nav a {
        padding: 12px 16px;
        font-size: 1rem;
        border-radius: var(--radius-sm);
        white-space: normal;
        gap: 12px;
    }
    .nav-label { display: inline !important; }
    .nav-icon { width: 20px; height: 20px; }
    .user-menu {
        display: flex;
        order: 4;
        gap: 6px;
        padding: 0;
        border-left: none;
    }
    .user-menu .user-name { display: none; }
    .header-search { display: none; }
    .main-content { padding: 24px 16px 60px; }
    h1 { font-size: 1.5rem; margin-bottom: 16px; }
    h2 { font-size: 1.2rem; }
    h3 { font-size: 1.05rem; }
    .card { padding: 18px; border-radius: 10px; }
    .btn { padding: 12px 18px; min-height: 44px; }
    .btn-large { padding: 14px 22px; font-size: 1rem; }
    .form-group input, .form-group select, .form-group textarea {
        font-size: 16px; /* prevents iOS auto-zoom */
        padding: 12px 14px;
    }
    .stat-card { padding: 18px; }
    .stat-value { font-size: 2rem; }
    .list-item { padding: 16px 18px; }
    .demo-banner, .live-banner { font-size: 0.88rem; padding: 10px 0; }
    .live-banner a { display: inline-block; margin-top: 6px; margin-left: 0; }

    /* Stack form rows on mobile */
    form > div[style*="display: flex"] {
        flex-direction: column !important;
    }

    /* Stat grid 2 cols on small */
    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr; }
    .stat-value { font-size: 1.8rem; }
    h1 { font-size: 1.35rem; }
    .container { padding: 0 14px; }
    .main-content { padding: 18px 14px 50px; }
    .demo-banner, .live-banner { font-size: 0.82rem; }
}
