* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    /* Cortex Theme (from Theme.qml) */
    --surface: #000000;
    --surface-low: #0a0a0e;
    --surface-container: #111116;
    --surface-high: #1a1a22;
    --surface-highest: #242430;
    --primary: #3c4ffd;
    --on-primary: #fff;
    --primary-container: #1a24b9;
    --secondary: #a1b8ff;
    --tertiary: #ffab40;
    --error: #ff3b57;
    --success: #A8DAB5;
    --on-surface: #efefef;
    --on-surface-variant: #999999;
    --outline: #49454F;
    --outline-variant: #333340;
    --frosted-bg: rgba(0,0,0,0.7);
    --frosted-bg-light: rgba(18,18,23,0.92);
    --frosted-border: rgba(255,255,255,0.06);
    --shape-xs: 4px; --shape-s: 8px; --shape-m: 12px; --shape-l: 16px;
}
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; background: var(--surface); color: var(--on-surface); min-height: 100vh; }
a { color: var(--secondary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* Frosted card */
.frosted {
    background: var(--frosted-bg-light);
    border: 1px solid var(--frosted-border);
    border-radius: var(--shape-l);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Buttons */
.btn-tonal { padding: 8px 20px; border-radius: var(--shape-s); border: none; background: rgba(60,79,253,0.15); color: var(--secondary); font-size: 13px; font-weight: 500; transition: background 0.15s; }
.btn-tonal:hover { background: rgba(60,79,253,0.25); }
.btn-tonal:disabled { opacity: 0.4; cursor: default; }
.btn-filled { padding: 10px 28px; border-radius: var(--shape-s); border: none; background: var(--primary); color: var(--on-primary); font-size: 14px; font-weight: 500; transition: opacity 0.15s; }
.btn-filled:hover { opacity: 0.85; }
.btn-text { padding: 6px 12px; border-radius: var(--shape-s); border: none; background: transparent; color: var(--on-surface-variant); font-size: 12px; transition: background 0.15s; }
.btn-text:hover { background: var(--surface-high); }

/* Icons */
.icon { font-size: 16px; vertical-align: middle; }
.icon-sm { font-size: 14px; }

/* Login */
#login-screen { display: flex; align-items: center; justify-content: center; height: 100vh; position: relative; background: #000; }
#login-particles { position: absolute; inset: 0; width: 100%; height: 100%; }
.login-card { width: 340px; padding: 32px; text-align: center; position: relative; z-index: 1; }
.login-card h1 { font-size: 20px; font-weight: 500; margin-bottom: 4px; }
.login-card .subtitle { font-size: 12px; color: var(--on-surface-variant); margin-bottom: 28px; }
/* logo handled via img tag now */
.login-field { width: 100%; padding: 10px 14px; margin-bottom: 12px; border-radius: var(--shape-s); border: 1px solid var(--outline-variant); background: var(--surface-container); color: var(--on-surface); font-size: 13px; outline: none; }
.login-field:focus { border-color: var(--primary); }
.login-error { font-size: 11px; color: var(--error); margin-bottom: 8px; min-height: 16px; }
.login-card .btn-filled { width: 100%; margin-top: 4px; }

/* App shell */
#app { display: none; }
header { display: flex; align-items: center; padding: 12px 24px; border-bottom: 1px solid var(--outline-variant); background: var(--surface-container); }
header .brand { display: flex; align-items: center; gap: 8px; }
header .brand .mdi { font-size: 20px; color: var(--primary); }
header .brand span { font-size: 14px; font-weight: 500; }
.header-user { display: flex; align-items: center; gap: 5px; cursor: pointer; padding: 4px 8px; border-radius: var(--shape-s); transition: background 0.15s; }
.header-user:hover { background: var(--surface-high); }
.header-user-icon { font-size: 20px; }
.header-user-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.header-user-name { font-size: 11px; color: var(--on-surface-variant); font-weight: 500; }
.avatar-initials { border-radius: 50%; background: var(--surface-highest); display: flex; align-items: center; justify-content: center; font-weight: 600; color: var(--primary); text-transform: uppercase; flex-shrink: 0; }
/* ── Profile Popup ── */
.profile-popup { position: fixed; z-index: 150; width: 220px; padding: 16px; box-shadow: 0 8px 24px rgba(0,0,0,0.5); }
.profile-popup-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.profile-popup-avatar { flex-shrink: 0; }
.profile-popup-info { min-width: 0; }
.profile-popup-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-popup-initials { font-size: 10px; color: var(--on-surface-variant); }
.profile-popup-actions { border-top: 1px solid var(--outline-variant); padding-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.profile-popup-actions button { text-align: left; width: 100%; font-size: 11px; }
.rounds-post-avatar { flex-shrink: 0; cursor: pointer; }

.profile-avatar-wrap { position: relative; }
.profile-avatar-actions { position: absolute; bottom: -4px; right: -4px; display: flex; gap: 2px; }
.profile-avatar-btn { width: 22px; height: 22px; border-radius: 50%; border: none; background: var(--surface-highest); color: var(--on-surface-variant); font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.15s; border: 1px solid var(--outline-variant); }
.profile-avatar-btn:hover { background: var(--primary); color: var(--on-primary); }
.nav-link.active { background: rgba(60,79,253,0.12); color: var(--secondary); }

/* Desktop nav + hamburger defaults */
.desktop-nav { display: flex; gap: 2px; margin-left: 20px; flex: 1; }
.mobile-menu-btn { display: none; padding: 4px 8px; margin-left: auto; border: none; background: none; color: var(--on-surface); cursor: pointer; }

/* Case list */
.filters { display: flex; gap: 12px; padding: 16px 24px; align-items: center; }
.search-box { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--shape-s); border: 1px solid var(--outline-variant); background: var(--surface-container); flex: 1; max-width: 400px; }
.search-box .mdi { color: var(--on-surface-variant); font-size: 16px; }
.search-box input { border: none; background: transparent; color: var(--on-surface); font-size: 13px; outline: none; flex: 1; }
.case-count { font-size: 11px; color: var(--on-surface-variant); margin-left: auto; }

.case-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; padding: 0 24px 24px; }
.case-card { padding: 14px; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.case-card:hover { border-color: rgba(60,79,253,0.4); }
.case-card .proc { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.case-card .meta { font-size: 11px; color: var(--on-surface-variant); line-height: 1.8; }
.case-card .meta span { margin-right: 10px; }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-done { background: rgba(168,218,181,0.15); color: var(--success); }
.badge-active { background: rgba(60,79,253,0.15); color: var(--secondary); }
.badge-live { background: rgba(255,59,87,0.15); color: var(--error); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity:1 } 50% { opacity:0.6 } }
.badges { display: flex; gap: 6px; margin-top: 6px; }

/* Dashboard */
#dashboard { display: none; padding: 24px; max-width: 1200px; margin: 0 auto; }
.dash-back { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--on-surface-variant); cursor: pointer; margin-bottom: 16px; }
.dash-back:hover { color: var(--on-surface); }
.dash-grid { display: grid; grid-template-columns: 1fr 280px; gap: 16px; margin-bottom: 20px; }
@media (max-width: 768px) { .dash-grid { grid-template-columns: 1fr; } }
.info-card { padding: 20px; }
.info-card h2 { font-size: 18px; font-weight: 500; margin-bottom: 10px; }
.info-table { font-size: 12px; line-height: 2.2; }
.info-table .label { color: var(--on-surface-variant); display: inline-block; width: 80px; }
.info-table .val { color: var(--on-surface); }
.info-table .mono { font-family: monospace; font-size: 11px; color: var(--on-surface-variant); }

/* Teleconf */
.teleconf-card { padding: 16px; }
.teleconf-card h3 { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; color: var(--primary); margin-bottom: 12px; }
.teleconf-status { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.dot { width: 6px; height: 6px; border-radius: 50%; }
.dot-live { background: var(--success); box-shadow: 0 0 6px var(--success); }
.dot-off { background: var(--on-surface-variant); }
.teleconf-label { font-size: 12px; }
.join-link { display: block; padding: 10px; border-radius: var(--shape-s); background: rgba(168,218,181,0.12); color: var(--success); font-size: 13px; font-weight: 500; text-align: center; text-decoration: none; transition: background 0.15s; }
.join-link:hover { background: rgba(168,218,181,0.2); text-decoration: none; }
.join-link.disabled { background: var(--surface-high); color: var(--on-surface-variant); pointer-events: none; }
.teleconf-url { font-size: 10px; font-family: monospace; color: var(--on-surface-variant); margin-top: 8px; word-break: break-all; }

/* Assets */
.section { margin-bottom: 20px; }
.section-head { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; color: var(--primary); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.section-head .mdi { font-size: 14px; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.asset-card { background: var(--surface-high); border: 1px solid var(--outline-variant); border-radius: var(--shape-s); padding: 8px; cursor: pointer; transition: border-color 0.15s; }
.asset-card:hover { border-color: rgba(60,79,253,0.4); }
.asset-card .name { font-size: 10px; font-family: monospace; color: var(--on-surface-variant); margin-bottom: 2px; word-break: break-all; }
.media-grid .asset-card { min-width: 0; overflow: hidden; }
.asset-card .info { font-size: 9px; color: var(--on-surface-variant); }
.media-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.media-grid .asset-card { display: flex; flex-direction: column; }
@media (max-width: 900px) { .media-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .media-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 400px) { .media-grid { grid-template-columns: 1fr; } }
.media-thumb { width: 100%; aspect-ratio: 16/9; border-radius: 4px; overflow: hidden; margin-bottom: 6px; background: #111; position: relative; flex-shrink: 0; }
.media-thumb-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.media-thumb img, .media-thumb canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.asset-thumb { width: 100%; height: 100px; object-fit: cover; border-radius: var(--shape-xs); margin-bottom: 6px; background: var(--surface-low); display: block; }
.asset-thumb-loading { width: 100%; height: 100px; border-radius: var(--shape-xs); margin-bottom: 6px; background: var(--surface-low); display: flex; align-items: center; justify-content: center; color: var(--on-surface-variant); font-size: 11px; }

/* Modals */
.modal { display: none; position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.85); align-items: center; justify-content: center; }
.modal.active { display: flex; }
.modal-content { position: relative; max-width: 90vw; max-height: 90vh; }
.modal-close { position: absolute; top: 10px; right: 10px; z-index: 10; width: 32px; height: 32px; border-radius: 50%; border: none; background: rgba(0,0,0,0.6); color: #fff; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: rgba(0,0,0,0.8); }
#player-modal .modal-content { width: 90vw; max-width: 1100px; background: var(--surface-container); border-radius: var(--shape-l); overflow: hidden; }
#player-modal video { width: 100%; max-height: 78vh; background: #000; display: block; }
.player-bar { padding: 8px 14px; border-top: 1px solid var(--outline-variant); font-size: 11px; font-family: monospace; color: var(--on-surface-variant); }
.player-btn { background: none; border: 1px solid var(--outline-variant); border-radius: 4px; color: var(--on-surface-variant); font-size: 11px; padding: 2px 6px; cursor: pointer; font-family: monospace; }
.player-btn:hover { background: var(--surface-high); color: var(--on-surface); }
.speed-btn.active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
#image-modal { cursor: pointer; }
#image-modal img { max-width: 95vw; max-height: 95vh; object-fit: contain; border-radius: var(--shape-s); }

/* Loading / empty */
.loading { text-align: center; padding: 48px; color: var(--on-surface-variant); font-size: 13px; }
.spinner { width: 20px; height: 20px; border: 2px solid var(--outline-variant); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg) } }
.empty { text-align: center; padding: 64px 24px; color: var(--on-surface-variant); }
.empty .mdi { font-size: 36px; color: var(--outline); display: block; margin-bottom: 12px; }

/* Skeleton loader */
.skeleton {
    background: linear-gradient(90deg, var(--surface-high) 25%, var(--surface-highest) 50%, var(--surface-high) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--shape-s);
}
.skeleton-row { height: 52px; margin-bottom: 8px; border-radius: var(--shape-l); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Home Page ── */
.home-stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 20px; }
.home-stat { padding: 14px; text-align: center; cursor: pointer; transition: border-color 0.15s; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.home-stat:hover { border-color: rgba(60,79,253,0.4); }
.home-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
.home-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.home-sidebar { display: flex; flex-direction: column; gap: 16px; }
.home-section { padding: 16px; }
.home-section-title { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; color: var(--primary); margin-bottom: 12px; }
.home-activity-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--outline-variant); cursor: pointer; transition: background 0.1s; }
.home-activity-item:last-child { border-bottom: none; }
.home-activity-item:hover { background: var(--surface-high); margin: 0 -8px; padding: 8px; border-radius: var(--shape-s); }
.home-rounds-item { padding: 10px 0; border-bottom: 1px solid var(--outline-variant); cursor: pointer; transition: background 0.1s; }
.home-rounds-item:last-of-type { border-bottom: none; }
.home-rounds-item:hover { background: var(--surface-high); margin: 0 -8px; padding: 10px 8px; border-radius: var(--shape-s); }
.news-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--outline-variant); }
.news-item:last-child { border-bottom: none; }
.news-icon { flex-shrink: 0; width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.news-tag { font-size: 9px; padding: 1px 6px; border-radius: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

/* ── Analytics ── */
.analytics-summary { display: flex; gap: 4px; margin-bottom: 16px; }
.analytics-mini-stat { flex: 1; text-align: center; padding: 10px 4px; border-radius: var(--shape-s); background: var(--surface-high); }
.analytics-mini-value { font-size: 16px; font-weight: 600; line-height: 1.3; }
.analytics-mini-label { font-size: 9px; color: var(--on-surface-variant); text-transform: uppercase; letter-spacing: 0.5px; }
.analytics-card { margin-bottom: 14px; padding: 12px; border-radius: var(--shape-s); background: var(--surface-high); }
.analytics-card:last-child { margin-bottom: 0; }
.analytics-card-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.analytics-card-label { font-size: 12px; font-weight: 500; }
.analytics-card-meta { font-size: 10px; color: var(--on-surface-variant); }
/* Day-by-day bar chart */
.analytics-day-chart { display: flex; gap: 3px; align-items: flex-end; }
.analytics-day-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; cursor: default; }
.analytics-day-col.today .analytics-day-track .analytics-day-bar { background: var(--primary); }
.analytics-day-col.today .analytics-day-label { color: var(--primary); font-weight: 600; }
.analytics-day-track { width: 100%; height: 80px; display: flex; align-items: flex-end; }
.analytics-day-value { font-size: 9px; font-weight: 600; color: var(--on-surface-variant); line-height: 1; }
.analytics-day-bar { width: 100%; background: var(--outline-variant); border-radius: 2px 2px 0 0; transition: height 0.3s ease; }
.analytics-day-label { font-size: 8px; color: var(--on-surface-variant); line-height: 1.2; text-align: center; margin-top: 2px; }
/* Pie chart */
.analytics-pie-container { display: flex; gap: 16px; align-items: center; }
.analytics-pie { width: 100px; height: 100px; border-radius: 50%; flex-shrink: 0; position: relative; }
.analytics-pie::after { content: ''; position: absolute; inset: 22px; border-radius: 50%; background: var(--surface-high); }
.analytics-pie-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.analytics-pie-item { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.analytics-pie-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.analytics-pie-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analytics-pie-pct { font-weight: 600; width: 32px; text-align: right; flex-shrink: 0; }
.analytics-pie-count { color: var(--on-surface-variant); font-size: 10px; width: 24px; text-align: right; flex-shrink: 0; }
/* Scope tabs */
.analytics-scope-tabs { display: flex; gap: 2px; background: var(--surface-container); border-radius: var(--shape-s); padding: 2px; }
.analytics-scope-tabs button { padding: 4px 10px; border-radius: var(--shape-xs); border: none; background: transparent; color: var(--on-surface-variant); font-size: 10px; cursor: pointer; font-family: inherit; transition: all 0.15s; display: flex; align-items: center; gap: 3px; }
.analytics-scope-tabs button .mdi { font-size: 12px; }
.analytics-scope-tabs button.active { background: var(--primary); color: var(--on-primary); }
.analytics-scope-tabs button:hover:not(.active) { background: var(--surface-high); }
/* Horizontal bar rows (surgeons, etc.) */
.analytics-proc-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.analytics-proc-row:last-child { margin-bottom: 0; }
.analytics-proc-name { font-size: 11px; width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0; }
.analytics-proc-bar-track { flex: 1; height: 6px; background: var(--surface-container); border-radius: 3px; overflow: hidden; }
.analytics-proc-bar-fill { height: 100%; background: var(--tertiary); border-radius: 3px; transition: width 0.3s ease; }
.analytics-proc-count { font-size: 11px; font-weight: 500; width: 28px; text-align: right; flex-shrink: 0; }
.analytics-fleet-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin-bottom: 8px; }
.fleet-online { background: var(--success); }
.fleet-recent { background: var(--tertiary); }
.fleet-offline { background: var(--outline); }
.analytics-fleet-legend { display: flex; gap: 12px; flex-wrap: wrap; }
.fleet-legend-item { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--on-surface-variant); }
.fleet-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── Privacy Policy ── */
#privacy-view { background: var(--surface); min-height: 100vh; }
.privacy-content { font-size: 13px; line-height: 1.8; color: var(--on-surface); }
.privacy-content h2 { font-size: 16px; font-weight: 600; margin: 28px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--outline-variant); color: var(--on-surface); }
.privacy-content h3 { font-size: 13px; font-weight: 600; margin: 20px 0 8px; color: var(--on-surface); }
.privacy-content p { margin-bottom: 12px; }
.privacy-content ul { margin: 0 0 12px 20px; }
.privacy-content li { margin-bottom: 6px; }
.privacy-content a { color: var(--secondary); }
.privacy-meta { font-size: 11px; color: var(--on-surface-variant); margin-bottom: 20px; padding: 8px 12px; background: var(--surface-high); border-radius: var(--shape-s); }
.privacy-table { width: 100%; border-collapse: collapse; margin: 12px 0 16px; font-size: 12px; }
.privacy-table th { text-align: left; padding: 8px 10px; background: var(--surface-high); border: 1px solid var(--outline-variant); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; color: var(--on-surface-variant); }
.privacy-table td { padding: 8px 10px; border: 1px solid var(--outline-variant); vertical-align: top; }
.privacy-contact { padding: 16px; background: var(--surface-high); border-radius: var(--shape-s); margin: 12px 0; }
.privacy-contact p { margin-bottom: 4px; }
@media (max-width: 768px) {
    #privacy-view { padding: 0; }
    .privacy-content { font-size: 12px; }
    .privacy-table { font-size: 11px; }
    .privacy-table th, .privacy-table td { padding: 6px 8px; }
}

/* ── Help Page ── */
.help-article { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--outline-variant); }
.help-article:last-child { border-bottom: none; }
.help-article-icon { font-size: 20px; color: var(--primary); flex-shrink: 0; margin-top: 2px; }
.help-article-title { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.help-article-body { font-size: 11px; color: var(--on-surface-variant); line-height: 1.6; }

/* ── Native App ── */
.native-app .browser-only { display: none !important; }

/* ── Rounds ── */
.rounds-card { padding: 16px; margin-bottom: 12px; transition: border-color 0.15s, background 0.15s; }
.rounds-card:hover { border-color: rgba(60,79,253,0.4); }
.rounds-card.rounds-pinned { border-color: rgba(255,171,64,0.4); background: rgba(255,171,64,0.04); }
.rounds-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 11px; color: var(--on-surface-variant); }
.rounds-card-header .author { font-weight: 500; color: var(--on-surface); }
.rounds-card-title { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.rounds-card-body { font-size: 12px; color: var(--on-surface-variant); line-height: 1.6; margin-bottom: 8px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.rounds-card-body.rounds-full { -webkit-line-clamp: unset; display: block; }
.rounds-scope-badge { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; border-radius: 10px; font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.rounds-scope-badge.scope-department { background: rgba(60,79,253,0.15); color: var(--secondary); }
.rounds-scope-badge.scope-tenant { background: rgba(168,218,181,0.15); color: var(--success); }
.rounds-scope-badge.scope-public { background: rgba(255,171,64,0.15); color: var(--tertiary); }
.rounds-tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 9px; background: var(--surface-high); color: var(--on-surface-variant); margin-right: 4px; margin-bottom: 4px; cursor: pointer; transition: background 0.15s; }
.rounds-tag:hover { background: var(--surface-highest); }
.rounds-reaction-bar { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.rounds-reaction-btn { display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px; border-radius: 12px; border: 1px solid var(--outline-variant); background: transparent; color: var(--on-surface-variant); font-size: 11px; cursor: pointer; transition: all 0.15s; }
.rounds-reaction-btn:hover { background: var(--surface-high); }
.rounds-reaction-btn.active { border-color: var(--primary); background: rgba(60,79,253,0.12); color: var(--secondary); }
.rounds-attachment-grid { display: flex; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
.rounds-attachment { width: 80px; height: 60px; border-radius: var(--shape-xs); overflow: hidden; background: var(--surface-high); border: 1px solid var(--outline-variant); cursor: pointer; position: relative; display: flex; align-items: center; justify-content: center; }
.rounds-attachment img { width: 100%; height: 100%; object-fit: cover; }
.rounds-attachment .att-icon { font-size: 20px; color: var(--on-surface-variant); }
.rounds-compose { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.85); display: flex; align-items: center; justify-content: center; }
.rounds-compose-inner { width: 600px; max-width: 95vw; max-height: 90vh; overflow-y: auto; padding: 24px; border-radius: var(--shape-l); background: var(--surface-container); border: 1px solid var(--outline-variant); }
.rounds-comment { display: flex; gap: 10px; padding: 10px 0; }
.rounds-comment + .rounds-comment { border-top: 1px solid var(--outline-variant); }
.rounds-comment.reply { margin-left: 44px; }
.rounds-comment-avatar { flex-shrink: 0; width: 42px; height: 42px; cursor: pointer; }
.rounds-comment-content { flex: 1; min-width: 0; }
.rounds-comment-bubble { background: var(--surface-high); border-radius: 0 var(--shape-m) var(--shape-m) var(--shape-m); padding: 8px 12px; }
.rounds-comment-header { display: flex; align-items: baseline; gap: 6px; font-size: 11px; color: var(--on-surface-variant); margin-bottom: 2px; }
.rounds-comment-header .author { font-weight: 600; color: var(--on-surface); font-size: 12px; }
.rounds-comment-body { font-size: 12px; line-height: 1.5; }
.rounds-comment-actions { display: flex; align-items: center; gap: 6px; padding: 2px 0; font-size: 11px; color: var(--on-surface-variant); flex-wrap: wrap; }
.rounds-comment-actions > button { background: none; border: none; color: var(--on-surface-variant); font-size: 11px; font-weight: 500; cursor: pointer; padding: 0; font-family: inherit; transition: color 0.15s; }
.rounds-comment-actions > button:hover { color: var(--secondary); }
.rounds-comment-actions .sep { color: var(--outline); }
.rounds-link-preview { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--shape-s); background: var(--surface-high); border: 1px solid var(--outline-variant); margin: 8px 0; font-size: 11px; cursor: pointer; transition: background 0.15s; }
.rounds-link-preview:hover { background: var(--surface-highest); }
.rounds-filter-bar { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; flex-wrap: wrap; }
.rounds-tabs { display: flex; gap: 2px; margin-bottom: 12px; }
.rounds-tabs button { padding: 6px 14px; border-radius: var(--shape-s); border: none; background: transparent; color: var(--on-surface-variant); font-size: 12px; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.rounds-tabs button.active { background: rgba(60,79,253,0.12); color: var(--secondary); }
.rounds-tabs button:hover { background: var(--surface-high); }
.ac-item.ac-sel { background: var(--surface-high); }
@media (max-width: 768px) {
    .rounds-compose-inner { max-width: 100vw; width: 100vw; max-height: 100vh; border-radius: 0; }
    .rounds-attachment { width: 60px; height: 45px; }
}

/* ── Tablet (< 900px) ── */
@media (max-width: 900px) {
    .dash-grid { grid-template-columns: 1fr !important; }
    .asset-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important; }
    .home-grid { grid-template-columns: 1fr !important; }
}

/* ── Mobile (< 768px) — hamburger menu ── */
@media (max-width: 768px) {
    /* Show hamburger, hide desktop nav and right-side extras */
    .mobile-menu-btn { display: inline-flex !important; }
    .desktop-nav { display: none !important; }
    .header-right { display: none !important; }

    /* Header: just logo + hamburger */
    header { padding: 8px 12px; gap: 4px; flex-wrap: nowrap; }
    header .brand { flex: 1; }
    header .brand span { font-size: 13px; }

    /* Mobile dropdown menu */
    #mobile-menu { display: none; } /* toggled by JS */
    #mobile-menu.open { display: block !important; }
    #mobile-menu button {
        display: block; width: 100%; text-align: left;
        padding: 10px 16px; border: none; background: none;
        color: var(--on-surface); font-size: 14px; font-family: inherit;
        border-bottom: 1px solid var(--outline-variant); cursor: pointer;
    }
    #mobile-menu button:hover, #mobile-menu button.active { background: var(--surface-high); }
    #mobile-menu button .mdi { margin-right: 10px; font-size: 16px; color: var(--primary); }
    #mobile-menu .mobile-search {
        padding: 8px 12px; border-bottom: 1px solid var(--outline-variant);
    }
    #mobile-menu .mobile-search input {
        width: 100%; padding: 8px 12px; border-radius: var(--shape-s);
        border: 1px solid var(--outline-variant); background: var(--surface-high);
        color: var(--on-surface); font-size: 13px; outline: none;
    }

    /* Page containers */
    #list-view, #devices-view, #users-view, #tenants-view, #admin-view, #profile-view, #home-view, #dashboard, #voice-view, #rounds-view, #help-view {
        padding: 12px !important; max-width: 100% !important;
    }

    /* Page headers */
    h2 { font-size: 14px !important; }

    /* Filter rows: stack */
    div[style*="display:flex"][style*="margin-bottom:12px"] { flex-wrap: wrap !important; }

    /* Frosted cards */
    .frosted { border-radius: var(--shape-s) !important; }

    /* Case dashboard */
    .dash-grid { grid-template-columns: 1fr !important; gap: 10px !important; }
    .info-card { padding: 14px !important; }
    .info-table .label { width: 65px; }
    .teleconf-card { padding: 12px !important; }
    .asset-grid { grid-template-columns: 1fr !important; gap: 8px !important; }

    /* Modals fullscreen on mobile */
    .modal-content { max-width: 100vw !important; max-height: 100vh !important; border-radius: 0 !important; }
    #player-modal .modal-content { width: 100vw !important; border-radius: 0 !important; }
    #player-modal video { max-height: 50vh !important; }
    #edit-user-overlay > div, #edit-device-overlay > div, #edit-tenant-overlay > div, #edit-case-overlay > div {
        width: 100vw !important; max-height: 100vh !important; padding: 16px !important; border-radius: 0 !important;
    }
    #compare-modal .modal-content { width: 100vw !important; }
    #compare-modal .modal-content > div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }

    /* Login card */
    .login-card { width: 90vw !important; max-width: 340px; padding: 24px !important; }
    .login-card img { width: 48px !important; height: 48px !important; }
    .login-card h1 { font-size: 18px !important; }

    /* Home page */
    .home-stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .home-grid { grid-template-columns: 1fr !important; }
    .home-sidebar { order: -1; }

    /* Buttons */
    .btn-tonal { font-size: 11px; padding: 6px 12px; }
    .btn-filled { font-size: 12px; padding: 8px 16px; }

    /* Toast */
    #toast { left: 12px !important; right: 12px !important; transform: none !important; text-align: center; }

    /* Voice recording */
    #voice-record-btn { width: 120px !important; height: 120px !important; font-size: 14px !important; }

    /* Invite form grid */
    #invite-form > div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}
