/* ── UNA Suite - Global Styles ─────────────────────── */

:root {
    --una-blue: #003399;
    --una-blue-light: #0052cc;
    --una-blue-dark: #002266;
    --una-gold: #ffcc00;
    --una-bg: #f0f2f5;
    --una-white: #ffffff;
    --una-gray: #8696a0;
    --una-gray-light: #e9edef;
    --una-green: #25d366;
    --una-green-dark: #128c7e;
    --chat-sent: #dcf8c6;
    --chat-received: #ffffff;
    --text-primary: #111b21;
    --text-secondary: #667781;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--una-bg);
    color: var(--text-primary);
    overscroll-behavior: none;
    -webkit-font-smoothing: antialiased;
}

/* ── Login ─────────────────────────────────────────── */

.login-body {
    background: linear-gradient(135deg, var(--una-blue-dark) 0%, var(--una-blue) 50%, var(--una-blue-light) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 40px 24px;
}

.login-logo {
    text-align: center;
    margin-bottom: 40px;
}

.una-logo {
    font-size: 56px;
    font-weight: 800;
    color: white;
    letter-spacing: 8px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.login-subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    margin-top: 8px;
    letter-spacing: 1px;
}

.login-tagline {
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    margin-top: 4px;
}

.login-form {
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 28px 24px;
    border: 1px solid rgba(255,255,255,0.2);
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    color: rgba(255,255,255,0.9);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 10px;
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.input-group input::placeholder {
    color: rgba(255,255,255,0.5);
}

.input-group input:focus {
    border-color: var(--una-gold);
}

.error-msg {
    color: #ff6b6b;
    font-size: 13px;
    text-align: center;
    margin-bottom: 12px;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--una-gold);
    color: var(--una-blue-dark);
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
}

.login-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.login-footer {
    text-align: center;
    margin-top: 32px;
}

.eu-badge {
    color: rgba(255,255,255,0.8);
    font-size: 13px;
}

.eu-flag {
    font-size: 16px;
}

.login-note {
    color: rgba(255,255,255,0.5);
    font-size: 11px;
    margin-top: 12px;
}

.install-hint {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 24px 0 8px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 14px;
    padding: 14px 16px;
}

.install-hint-icon {
    flex-shrink: 0;
    color: rgba(255,255,255,0.75);
    margin-top: 1px;
}

.install-hint-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    line-height: 1.4;
}

.install-hint-text strong {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.install-hint-text em {
    font-style: normal;
    font-weight: 600;
    color: #fff;
}

/* ── Dashboard ─────────────────────────────────────── */

.dashboard-body {
    background: var(--una-bg);
    min-height: 100vh;
}

.dashboard-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px;
    padding-top: calc(var(--safe-top) + 8px);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.una-logo-small {
    font-size: 24px;
    font-weight: 800;
    color: var(--una-blue);
    letter-spacing: 4px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-size: 13px;
    color: var(--una-blue);
    text-decoration: none;
}
.user-name:hover {
    opacity: 0.75;
}

.logout-link {
    font-size: 13px;
    color: var(--una-blue);
    text-decoration: none;
}

.dashboard-welcome {
    padding: 8px 0 12px;
}

.dashboard-welcome h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.institution-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 12px;
    background: var(--una-blue);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.app-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    margin-bottom: 16px;
}

.app-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 11px 16px;
    background: white;
    border-bottom: 1px solid var(--una-gray-light);
    text-decoration: none;
    color: inherit;
    transition: background 0.1s;
    gap: 14px;
}
.app-card:last-child { border-bottom: none; }

.app-card.active:active {
    background: var(--una-bg);
}

.app-card.disabled {
    opacity: 0.5;
    cursor: default;
}

.app-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
}

/* Per-app icon colours */
.app-card[href="/social"]               .app-icon { background: #f97316; box-shadow: 0 3px 8px rgba(249,115,22,.3); }
.app-card[href="/social/feed"]          .app-icon { background: #db2777; box-shadow: 0 3px 8px rgba(219,39,119,.3); }
.app-card[href="/social/calls"]         .app-icon { background: #16a34a; box-shadow: 0 3px 8px rgba(22,163,74,.3); }
.app-card[href="https://outlook.office.com/mail/"] .app-icon { background: #0078d4; box-shadow: 0 3px 8px rgba(0,120,212,.3); }
.app-card[href="/work"]                 .app-icon { background: #0d9488; box-shadow: 0 3px 8px rgba(13,148,136,.3); }
.app-card[href="/study"]                .app-icon { background: #8b5cf6; box-shadow: 0 3px 8px rgba(139,92,246,.3); }
.app-card[href="/reels"]                .app-icon { background: #e11d48; box-shadow: 0 3px 8px rgba(225,29,72,.3); }
.app-card[href="/play"]                 .app-icon { background: #7c3aed; box-shadow: 0 3px 8px rgba(124,58,237,.3); }
.app-card[href="/contacts"]             .app-icon { background: #f59e0b; box-shadow: 0 3px 8px rgba(245,158,11,.3); }
.app-card[href="/drive"]                .app-icon { background: #2563eb; box-shadow: 0 3px 8px rgba(37,99,235,.3); }

.app-card.disabled .app-icon {
    background: var(--una-gray-light);
    color: var(--una-gray);
    box-shadow: none;
}

.app-icon svg {
    width: 20px;
    height: 20px;
}

.app-info {
    flex: 1;
    min-width: 0;
}

.app-info h3 {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 6px;
}

.app-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #e11d48;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.app-info p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 1px;
}

/* Chevron on each row */
.app-card::after {
    content: '';
    display: block;
    width: 7px; height: 7px;
    border-right: 2px solid var(--una-gray);
    border-top: 2px solid var(--una-gray);
    transform: rotate(45deg);
    flex-shrink: 0;
    margin-left: 4px;
}

.dashboard-footer {
    text-align: center;
    padding: 12px 0 32px;
}

.dashboard-footer .eu-badge {
    color: var(--text-secondary);
}

/* ── Social / Conversation List ────────────────────── */

.social-body {
    background: var(--una-bg);
    height: 100vh;
    overflow: hidden;
}

.social-container {
    max-width: 480px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.social-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    padding-top: calc(var(--safe-top) + 12px);
    background: var(--una-blue);
    color: white;
}

.social-header h1 {
    flex: 1;
    font-size: 20px;
    font-weight: 600;
}

.back-btn {
    color: white;
    text-decoration: none;
    padding: 8px;
    margin-left: -8px;
}

.new-chat-btn {
    background: none;
    border: none;
    color: white;
    padding: 8px;
    cursor: pointer;
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 70px;
}

.conv-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: white;
    border-bottom: 1px solid var(--una-gray-light);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: background 0.1s;
}

.conv-item:active {
    background: var(--una-gray-light);
}

.conv-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--una-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}

.conv-avatar.group {
    background: var(--una-green-dark);
}

.conv-details {
    flex: 1;
    margin-left: 14px;
    min-width: 0;
}

.conv-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.conv-name {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conv-time {
    font-size: 12px;
    color: var(--text-secondary);
    flex-shrink: 0;
    margin-left: 8px;
}

.conv-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.conv-preview {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.conv-unread {
    background: var(--una-green);
    color: white;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    margin-left: 8px;
}

.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-secondary);
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* ── Modal ─────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal {
    background: white;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--una-gray-light);
}

.modal-header h2 {
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
}

.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--una-gray-light);
}

.modal-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.modal-tab.active {
    color: var(--una-blue);
    border-bottom-color: var(--una-blue);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.modal-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 12px 0 8px;
}

.user-list {
    display: flex;
    flex-direction: column;
}

.user-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--una-gray-light);
    cursor: pointer;
}

.user-item:active {
    opacity: 0.7;
}

.user-item .conv-avatar {
    width: 44px;
    height: 44px;
    font-size: 16px;
}

.user-item-info {
    margin-left: 12px;
    flex: 1;
}

.user-item-name {
    font-size: 15px;
    font-weight: 600;
}

.user-item-email {
    font-size: 12px;
    color: var(--text-secondary);
}

.online-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--una-green);
}

.group-name-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--una-gray-light);
    border-radius: 10px;
    font-size: 15px;
    outline: none;
}

.group-name-input:focus {
    border-color: var(--una-blue);
}

.user-item-check {
    width: 22px;
    height: 22px;
    border: 2px solid var(--una-gray);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-item-check.checked {
    background: var(--una-blue);
    border-color: var(--una-blue);
}

.user-item-check.checked::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

.create-group-btn {
    width: 100%;
    padding: 14px;
    background: var(--una-blue);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 16px;
    cursor: pointer;
}

/* ── Chat ──────────────────────────────────────────── */

.chat-body {
    background: #e5ddd5;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.chat-container {
    max-width: 480px;
    margin: 0 auto;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    padding-top: calc(var(--safe-top) + 10px);
    background: var(--una-blue);
    color: white;
}

.chat-header .back-btn {
    padding: 6px;
    margin-left: -6px;
}

.chat-header-info {
    margin-left: 8px;
}

.chat-header-info h2 {
    font-size: 17px;
    font-weight: 600;
}

.typing-indicator {
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    font-style: italic;
}

.messages-area {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}


.message-bubble {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 4px;
    position: relative;
    word-wrap: break-word;
}

.message-sent {
    align-self: flex-end;
    background: var(--chat-sent);
    border-radius: 8px 2px 8px 8px;
}

.message-received {
    align-self: flex-start;
    background: var(--chat-received);
    border-radius: 2px 8px 8px 8px;
}

.message-sender {
    font-size: 12px;
    font-weight: 600;
    color: var(--una-blue);
    margin-bottom: 2px;
}

.message-text {
    font-size: 15px;
    line-height: 1.35;
}

.message-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.message-time {
    font-size: 11px;
    color: var(--text-secondary);
}

.read-receipt {
    font-size: 14px;
    color: #53bdeb;
}

.read-receipt.unread {
    color: var(--una-gray);
}

.message-input-area {
    display: flex;
    align-items: flex-end;
    padding: 8px 12px;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
    background: var(--una-gray-light);
    gap: 8px;
    flex-shrink: 0;
}

#messageInput {
    flex: 1;
    min-width: 0;
    padding: 10px 16px;
    border: none;
    border-radius: 20px;
    background: white;
    font-size: 16px;
    line-height: 1.35;
    outline: none;
    font-family: inherit;
    resize: none;
    overflow-y: auto;
    max-height: 140px;
    /* one line tall by default; JS grows it as the user types */
    height: 40px;
    box-sizing: border-box;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--una-blue);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.send-btn:active {
    opacity: 0.8;
}

.send-btn svg {
    width: 22px;
    height: 22px;
    margin-left: 2px;
}

/* ── Bottom Nav ────────────────────────────────────── */

.bottom-nav {
    display: flex;
    background: white;
    border-top: 1px solid var(--una-gray-light);
    padding-bottom: var(--safe-bottom);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    text-decoration: none;
    color: var(--una-gray);
    font-size: 11px;
    gap: 2px;
}

.nav-item.active {
    color: var(--una-blue);
}

.nav-item.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

/* ── Utility ───────────────────────────────────────── */

.loading-spinner {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* ── UNI Play ───────────────────────────────────────── */

.play-body {
    background: var(--una-bg);
    height: 100vh;
    overflow: hidden;
}

.play-container {
    max-width: 480px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.play-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    padding-top: calc(var(--safe-top) + 12px);
    background: var(--una-blue);
    color: white;
}

.play-header h1 {
    font-size: 20px;
    font-weight: 600;
}

.play-scorebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    background: var(--una-blue-dark);
    color: white;
}

.score-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.score-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.6);
}

.score-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--una-gold);
    line-height: 1.1;
}

.snake-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 3px;
    color: rgba(255,255,255,0.5);
}

.canvas-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f0f2f5;
}

#gameCanvas {
    display: block;
    touch-action: none;
}

.game-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 34, 102, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: opacity 0.2s;
}

.game-overlay.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
    color: white;
}

.overlay-emoji {
    font-size: 52px;
    line-height: 1;
    margin-bottom: 12px;
}

.overlay-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 4px;
    margin-bottom: 8px;
}

.overlay-sub {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 28px;
}

.play-btn {
    background: var(--una-gold);
    color: var(--una-blue-dark);
    border: none;
    border-radius: 30px;
    padding: 14px 48px;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 2px;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
}

.play-btn:active {
    transform: scale(0.96);
    opacity: 0.9;
}

/* D-pad */
.dpad {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0 calc(10px + var(--safe-bottom));
    background: var(--una-blue-dark);
    gap: 2px;
}

.dpad-row {
    display: flex;
    justify-content: center;
    gap: 2px;
}

.dpad-middle {
    align-items: center;
}

.dpad-btn {
    width: 52px;
    height: 52px;
    background: rgba(255,255,255,0.12);
    border: none;
    border-radius: 12px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.1s;
}

.dpad-btn:active {
    background: rgba(255,255,255,0.28);
}

.dpad-center {
    width: 52px;
    height: 52px;
}

@media (min-width: 481px) {
    .social-container,
    .chat-container,
    .bottom-nav {
        border-left: 1px solid var(--una-gray-light);
        border-right: 1px solid var(--una-gray-light);
    }
}

/* ── Play Gallery ────────────────────────────────────── */

.play-gallery-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.add-game-btn {
    color: white;
    padding: 8px;
    display: flex;
    align-items: center;
}

.game-gallery {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: calc(24px + var(--safe-bottom));
}

.game-card {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 14px;
    padding: 16px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: transform 0.1s;
    position: relative;
    gap: 14px;
}

.game-card:active {
    transform: scale(0.98);
}

.game-card-add {
    border: 2px dashed var(--una-gray-light);
    background: transparent;
    box-shadow: none;
}

.game-card-emoji {
    font-size: 36px;
    line-height: 1;
    flex-shrink: 0;
    width: 48px;
    text-align: center;
}

.game-card-info {
    flex: 1;
    min-width: 0;
}

.game-card-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.game-card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-card-meta {
    font-size: 11px;
    color: var(--una-blue);
    font-weight: 600;
    margin-top: 4px;
}

.game-card-play {
    color: var(--una-blue);
    flex-shrink: 0;
}

.game-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: var(--una-gray);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    line-height: 1;
}

.game-delete-btn:hover {
    background: #fee;
    color: #c00;
}

/* ── Play Embed ──────────────────────────────────────── */

.play-embed-container {
    max-width: 480px;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.game-embed {
    flex: 1;
    width: 100%;
    border: none;
    background: #000;
}

/* ── Add Game Form ───────────────────────────────────── */

.add-game-form {
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: calc(32px + var(--safe-bottom));
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group textarea {
    padding: 12px 14px;
    border: 1.5px solid var(--una-gray-light);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    background: white;
    color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--una-blue);
}

.form-group textarea {
    resize: vertical;
    min-height: 140px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 13px;
}

.form-hint {
    font-size: 12px;
    color: var(--una-gray);
    margin-top: 2px;
}

.optional {
    font-weight: 400;
    font-size: 11px;
    color: var(--una-gray);
    text-transform: none;
    letter-spacing: 0;
}

.form-group.hidden {
    display: none;
}

/* Emoji picker */
.emoji-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.emoji-option input {
    display: none;
}

.emoji-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    font-size: 22px;
    border-radius: 10px;
    border: 2px solid var(--una-gray-light);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.emoji-option input:checked + span {
    border-color: var(--una-blue);
    background: #eef2ff;
}

/* Type toggle */
.type-toggle {
    display: flex;
    gap: 8px;
}

.type-btn {
    flex: 1;
    padding: 10px;
    border: 1.5px solid var(--una-gray-light);
    border-radius: 10px;
    background: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.type-btn.active {
    border-color: var(--una-blue);
    background: #eef2ff;
    color: var(--una-blue);
}

/* Submit */
.submit-btn {
    background: var(--una-blue);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.submit-btn:active {
    opacity: 0.9;
    transform: scale(0.98);
}

/* ── UNI Drive ───────────────────────────────────────── */

.drive-body {
    background: var(--una-bg);
    min-height: 100vh;
}

.drive-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: calc(24px + var(--safe-bottom));
}

.drive-upload-icon {
    color: white;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.drive-info-bar {
    display: flex;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--una-blue-dark);
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    font-weight: 600;
}

/* Drop zone */
.drop-zone {
    margin: 16px;
    border: 2px dashed var(--una-blue-light);
    border-radius: 14px;
    background: white;
    padding: 28px 16px;
    text-align: center;
    color: var(--una-blue);
    transition: background 0.15s, border-color 0.15s;
    cursor: pointer;
}

.drop-zone.drag-over {
    background: #eef2ff;
    border-color: var(--una-blue);
}

.drop-zone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.drop-zone-inner p {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Upload progress */
.upload-progress {
    margin: 0 16px 8px;
    background: white;
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.upload-progress.hidden { display: none; }

.upload-progress-bar {
    flex: 1;
    height: 4px;
    background: var(--una-gray-light);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.upload-progress-bar::after {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: var(--pct, 0%);
    background: var(--una-blue);
    border-radius: 2px;
    transition: width 0.2s;
}

/* File list */
.drive-list {
    margin: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.drive-item {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    gap: 12px;
}

.drive-item-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
    width: 36px;
    text-align: center;
}

.drive-item-info {
    flex: 1;
    min-width: 0;
}

.drive-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drive-item-meta {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.drive-item-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.drive-action-btn {
    background: none;
    border: none;
    color: var(--una-gray);
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: background 0.1s, color 0.1s;
}

.drive-action-btn:hover,
.drive-action-btn:active {
    background: var(--una-gray-light);
    color: var(--una-blue);
}

.drive-delete-btn:hover,
.drive-delete-btn:active {
    background: #fee;
    color: #c00;
}

/* Empty state */
.drive-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 8px;
}

.drive-empty-icon {
    font-size: 52px;
    margin-bottom: 8px;
}

.drive-empty p {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
}

.drive-empty-sub {
    font-size: 13px !important;
    font-weight: 400 !important;
    color: var(--una-gray) !important;
}

/* ── UNI Work ────────────────────────────────────────── */

.work-body { background: var(--una-bg); min-height: 100vh; }

.work-container, .work-profile-page {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.work-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; padding-top: calc(var(--safe-top) + 12px);
    background: var(--una-blue); color: white; flex-shrink: 0;
}
.work-header h1 { font-size: 20px; font-weight: 600; }
.work-edit-link { color: var(--una-gold); font-size: 14px; font-weight: 700; text-decoration: none; padding: 4px 8px; }
.work-me-btn { display: flex; align-items: center; }

/* Avatars */
.work-avatar-xs {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: white;
}
.work-avatar-sm {
    width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 700; color: white;
}

/* Tab bar */
.work-tabbar {
    display: flex; background: white;
    border-bottom: 1px solid var(--una-gray-light);
    flex-shrink: 0;
}
.work-tab {
    flex: 1; padding: 10px 4px; border: none; background: none;
    font-size: 12px; font-weight: 600; color: var(--una-gray);
    cursor: pointer; display: flex; flex-direction: column;
    align-items: center; gap: 3px; border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
}
.work-tab.active { color: var(--una-blue); border-bottom-color: var(--una-blue); }

/* Panels */
.work-panel {
    flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: calc(16px + var(--safe-bottom));
}
.work-panel.hidden { display: none; }

/* ── Feed ── */
.post-create-box {
    display: flex; align-items: center; gap: 12px;
    background: white; margin: 12px; border-radius: 14px;
    padding: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.07);
}
.post-create-trigger {
    flex: 1; background: var(--una-bg); border: 1.5px solid var(--una-gray-light);
    border-radius: 30px; padding: 10px 16px; text-align: left;
    font-size: 14px; color: var(--una-gray); cursor: pointer;
}
.post-compose {
    background: white; margin: 0 12px 12px; border-radius: 14px;
    padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.07);
}
.post-compose.hidden { display: none; }
.post-compose-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.compose-name { font-size: 14px; font-weight: 700; }
.compose-sub  { font-size: 12px; color: var(--text-secondary); }
.post-compose textarea {
    width: 100%; border: 1.5px solid var(--una-gray-light); border-radius: 10px;
    padding: 12px; font-size: 15px; font-family: inherit; resize: none; outline: none;
    transition: border-color .2s;
}
.post-compose textarea:focus { border-color: var(--una-blue); }
.compose-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.compose-cancel {
    padding: 9px 18px; border: 1.5px solid var(--una-gray-light);
    border-radius: 8px; background: none; font-size: 14px; font-weight: 600;
    color: var(--text-secondary); cursor: pointer;
}
.compose-submit {
    padding: 9px 22px; background: var(--una-blue); color: white;
    border: none; border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer;
}

/* Post card */
.post-card {
    background: white; margin: 0 12px 10px; border-radius: 14px;
    padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.post-card-header {
    display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px;
}
.post-avatar {
    width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 700; color: white; text-decoration: none;
}
.post-meta { flex: 1; min-width: 0; }
.post-author {
    font-size: 14px; font-weight: 700; color: var(--text-primary); text-decoration: none;
    display: block;
}
.post-headline { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-time     { font-size: 11px; color: var(--una-gray); margin-top: 1px; }
.post-delete-btn {
    background: none; border: none; color: var(--una-gray); font-size: 13px;
    cursor: pointer; padding: 4px 6px; border-radius: 6px; flex-shrink: 0;
}
.post-delete-btn:hover { background: #fee; color: #c00; }
.post-content { font-size: 15px; line-height: 1.55; color: var(--text-primary); white-space: pre-wrap; }
.post-actions { display: flex; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--una-gray-light); }
.like-btn {
    display: flex; align-items: center; gap: 5px; background: none; border: none;
    font-size: 13px; font-weight: 600; color: var(--una-gray); cursor: pointer;
    padding: 4px 8px; border-radius: 8px; transition: background .1s, color .1s;
}
.like-btn:hover { background: #eef2ff; color: var(--una-blue); }
.like-btn.liked  { color: var(--una-blue); }
.like-count { min-width: 14px; }

/* ── People ── */
.people-header {
    padding: 10px 16px; font-size: 12px; font-weight: 600;
    color: var(--text-secondary); border-bottom: 1px solid var(--una-gray-light);
    background: white;
}
.people-list { display: flex; flex-direction: column; }
.person-card {
    display: flex; align-items: center; gap: 12px;
    background: white; border-bottom: 1px solid var(--una-gray-light);
    padding: 14px 16px;
}
.person-avatar {
    width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; font-weight: 700; color: white; text-decoration: none;
}
.person-info  { flex: 1; min-width: 0; }
.person-name  {
    font-size: 15px; font-weight: 700; color: var(--text-primary);
    text-decoration: none; display: block;
}
.person-headline { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.connect-btn {
    padding: 7px 14px; border: 1.5px solid var(--una-blue); border-radius: 20px;
    background: none; color: var(--una-blue); font-size: 13px; font-weight: 700;
    cursor: pointer; white-space: nowrap; transition: all .15s; flex-shrink: 0;
}
.connect-btn.connected {
    background: var(--una-blue); color: white;
}

/* ── Opportunities ── */
.opp-add-box { padding: 12px 12px 4px; }
.opp-add-trigger {
    width: 100%; padding: 12px; border: 2px dashed var(--una-blue-light);
    border-radius: 12px; background: none; color: var(--una-blue);
    font-size: 14px; font-weight: 700; cursor: pointer;
}
.opp-form-wrap {
    background: white; margin: 0 12px 12px; border-radius: 14px;
    padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.07);
}
.opp-form-wrap.hidden { display: none; }
.opp-form-row { margin-bottom: 10px; }
.opp-form-row input, .opp-form-row textarea, .opp-form-row select {
    width: 100%; padding: 10px 12px; border: 1.5px solid var(--una-gray-light);
    border-radius: 10px; font-size: 14px; font-family: inherit; outline: none;
    background: white; color: var(--text-primary); transition: border-color .2s;
}
.opp-form-row input:focus, .opp-form-row textarea:focus, .opp-form-row select:focus { border-color: var(--una-blue); }
.opp-form-cols { display: flex; gap: 8px; }
.opp-form-cols input, .opp-form-cols select { flex: 1; }
.opp-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.opp-list { padding: 4px 12px 0; display: flex; flex-direction: column; gap: 10px; }
.opp-card {
    background: white; border-radius: 14px; padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.opp-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.opp-badge {
    font-size: 12px; font-weight: 700; padding: 3px 10px;
    border-radius: 12px; display: inline-block;
}
.opp-badge-research { background: #e8f0fe; color: #1a56c4; }
.opp-badge-job      { background: #fef9e7; color: #b06a00; }
.opp-badge-phd      { background: #f3e8ff; color: #6b21a8; }
.opp-badge-event    { background: #e6f7ef; color: #1a6b3c; }
.opp-title       { font-size: 16px; font-weight: 700; margin-bottom: 4px; color: var(--text-primary); }
.opp-institution { font-size: 13px; color: var(--una-blue); font-weight: 600; margin-bottom: 6px; }
.opp-desc        { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 8px; }
.opp-footer      { display: flex; justify-content: space-between; font-size: 12px; color: var(--una-gray); }
.opp-deadline    { color: #b06a00; font-weight: 600; }
.opp-delete-btn  {
    background: none; border: none; color: var(--una-gray); font-size: 13px;
    cursor: pointer; padding: 2px 6px; border-radius: 6px;
}
.opp-delete-btn:hover { background: #fee; color: #c00; }

/* ── Profile page ── */
.profile-hero {
    background: white; padding: 28px 20px 24px; text-align: center;
    border-bottom: 1px solid var(--una-gray-light);
}
.profile-avatar-lg {
    width: 88px; height: 88px; border-radius: 50%; margin: 0 auto 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px; font-weight: 800; color: white;
    box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
.profile-name         { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.profile-headline-text{ font-size: 14px; color: var(--text-secondary); margin-bottom: 10px; line-height: 1.4; }
.profile-badges       { display: flex; justify-content: center; gap: 8px; margin-bottom: 10px; }
.profile-badge-inst   { font-size: 12px; background: #eef2ff; color: var(--una-blue); padding: 3px 10px; border-radius: 12px; font-weight: 600; }
.profile-badge-role   { font-size: 12px; padding: 3px 10px; border-radius: 12px; font-weight: 600; }
.profile-badge-faculty{ background: #fef3c7; color: #92400e; }
.profile-badge-student{ background: #d1fae5; color: #065f46; }
.profile-conn-count   { font-size: 13px; font-weight: 700; color: var(--una-blue); margin-bottom: 14px; }
.profile-actions      { display: flex; gap: 10px; justify-content: center; }
.connect-btn-lg {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 22px; border: 2px solid var(--una-blue); border-radius: 24px;
    background: none; color: var(--una-blue); font-size: 14px; font-weight: 700;
    cursor: pointer; transition: all .15s;
}
.connect-btn-lg.connected { background: var(--una-blue); color: white; }
.message-btn-lg {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 22px; border: 2px solid var(--una-gray-light); border-radius: 24px;
    background: none; color: var(--text-secondary); font-size: 14px; font-weight: 700;
    text-decoration: none; transition: all .15s;
}
.message-btn-lg:hover { border-color: var(--una-blue); color: var(--una-blue); }
.profile-section {
    background: white; margin: 10px 12px; border-radius: 14px;
    padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.profile-section-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; color: var(--text-primary); }
.profile-bio { font-size: 14px; line-height: 1.6; color: var(--text-secondary); }
.skills-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-tag {
    background: #eef2ff; color: var(--una-blue); font-size: 13px;
    font-weight: 600; padding: 5px 12px; border-radius: 14px;
}

/* ── Profile edit ── */
.profile-edit-form { padding: 0; }
.edit-input, .edit-textarea {
    width: 100%; padding: 12px 14px;
    border: 1.5px solid var(--una-gray-light); border-radius: 10px;
    font-size: 15px; font-family: inherit; outline: none; background: white;
    color: var(--text-primary); transition: border-color .2s;
}
.edit-input:focus, .edit-textarea:focus { border-color: var(--una-blue); }
.edit-textarea { resize: vertical; min-height: 100px; }
.edit-hint { font-size: 12px; color: var(--una-gray); margin-top: 6px; }
.avatar-color-picker { display: flex; flex-wrap: wrap; gap: 10px; }
.avatar-color-opt input { display: none; }
.avatar-color-opt span {
    display: flex; align-items: center; justify-content: center;
    width: 52px; height: 52px; border-radius: 50%;
    font-size: 16px; font-weight: 800; color: white; cursor: pointer;
    border: 3px solid transparent; transition: border-color .15s;
}
.avatar-color-opt input:checked + span { border-color: var(--una-gold); }

/* ── UNI Reels ───────────────────────────────────────── */

.reels-body { background: #000; overflow: hidden; height: 100vh; }

.reels-wrapper { position: relative; height: 100vh; overflow: hidden; }

/* Floating header */
.reels-header {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; padding-top: calc(var(--safe-top) + 12px);
    background: var(--una-blue);
    color: white;
    pointer-events: none;
}
.reels-header > * { pointer-events: auto; }
.reels-back-btn, .reels-upload-btn { color: white; padding: 6px; display: flex; }
.reels-title { font-size: 18px; font-weight: 800; color: white; letter-spacing: 1px; }

/* Feed */
.reels-feed {
    height: 100vh; overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
}
.reels-feed::-webkit-scrollbar { display: none; }

/* Each slide */
.reel-slide {
    height: 100vh; position: relative;
    scroll-snap-align: start; scroll-snap-stop: always;
    overflow: hidden; background: #111;
}

.reel-video {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
}

/* Dark gradient at bottom */
.reel-gradient {
    position: absolute; inset: 0;
    background: linear-gradient(
        to top,
        rgba(0,0,0,.75) 0%,
        rgba(0,0,0,.2) 40%,
        transparent 70%
    );
    pointer-events: none;
}

/* Tap area */
.reel-tap-area {
    position: absolute; inset: 0; z-index: 5; cursor: pointer;
}

/* Pause icon */
.reel-pause-icon {
    position: absolute; inset: 0; z-index: 6;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
    animation: fade-out .7s forwards;
}
.reel-pause-icon.hidden { display: none; }
@keyframes fade-out { 0%{opacity:1} 60%{opacity:1} 100%{opacity:0} }

/* Info (bottom-left) */
.reel-info {
    position: absolute; bottom: calc(24px + var(--safe-bottom));
    left: 14px; right: 72px; z-index: 10;
}
.reel-author-row {
    display: flex; align-items: center; gap: 8px;
    text-decoration: none; margin-bottom: 8px;
}
.reel-avatar {
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: white;
    border: 2px solid rgba(255,255,255,.6);
}
.reel-author-name {
    font-size: 15px; font-weight: 700; color: white;
    text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.reel-caption {
    font-size: 14px; color: rgba(255,255,255,.92); line-height: 1.45;
    text-shadow: 0 1px 4px rgba(0,0,0,.5);
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
    overflow: hidden; margin-bottom: 6px;
}
.reel-views {
    display: flex; align-items: center; gap: 4px;
    font-size: 12px; color: rgba(255,255,255,.7);
}

/* Action bar (right side) */
.reel-actions {
    position: absolute; right: 10px;
    bottom: calc(28px + var(--safe-bottom));
    z-index: 10;
    display: flex; flex-direction: column; align-items: center; gap: 20px;
}
.reel-action-btn {
    background: none; border: none; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 4px;
}
.reel-action-icon {
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(0,0,0,.3); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.reel-action-btn:active .reel-action-icon { background: rgba(0,0,0,.55); }
.reel-action-count { font-size: 12px; font-weight: 700; color: white; }

/* Heart burst animation */
.heart-burst {
    position: absolute; font-size: 28px;
    animation: heart-pop .7s ease forwards;
    pointer-events: none; top: -10px; left: 50%;
    transform: translateX(-50%);
}
@keyframes heart-pop {
    0%   { opacity:1; transform:translateX(-50%) scale(0.5); }
    50%  { opacity:1; transform:translateX(-50%) scale(1.4) translateY(-16px); }
    100% { opacity:0; transform:translateX(-50%) scale(1) translateY(-32px); }
}

/* Comment panel */
.comment-panel {
    position: fixed; bottom: 0; left: 50%; z-index: 50;
    width: 100%; max-width: 480px;
    transform: translateX(-50%) translateY(100%);
    transition: transform .32s cubic-bezier(.4,0,.2,1);
    background: white; border-radius: 20px 20px 0 0;
    height: 60vh; display: flex; flex-direction: column;
    box-shadow: 0 -4px 24px rgba(0,0,0,.18);
}
.comment-panel.open { transform: translateX(-50%) translateY(0); }
.comment-panel-handle {
    width: 40px; height: 4px; border-radius: 2px;
    background: var(--una-gray-light); margin: 10px auto 0;
}
.comment-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px 8px; border-bottom: 1px solid var(--una-gray-light);
}
.comment-panel-title { font-size: 15px; font-weight: 700; }
.comment-panel-close {
    background: none; border: none; font-size: 18px;
    color: var(--una-gray); cursor: pointer; padding: 4px;
}
.comment-list {
    flex: 1; overflow-y: auto; padding: 8px 0;
    -webkit-overflow-scrolling: touch;
}
.comment-loading { text-align: center; padding: 24px; font-size: 14px; color: var(--una-gray); }
.comment-item {
    display: flex; gap: 10px; padding: 10px 16px; align-items: flex-start;
}
.comment-avatar {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: white;
}
.comment-body { flex: 1; }
.comment-name  { font-size: 13px; font-weight: 700; margin-right: 6px; }
.comment-text  { font-size: 14px; color: var(--text-primary); }
.comment-time  { display: block; font-size: 11px; color: var(--una-gray); margin-top: 2px; }
.comment-input-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; padding-bottom: calc(10px + var(--safe-bottom));
    border-top: 1px solid var(--una-gray-light);
}
.comment-input-avatar {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: white;
}
.comment-input-row input {
    flex: 1; border: 1.5px solid var(--una-gray-light); border-radius: 20px;
    padding: 9px 14px; font-size: 14px; outline: none; font-family: inherit;
    transition: border-color .2s;
}
.comment-input-row input:focus { border-color: var(--una-blue); }
.comment-input-row button {
    background: var(--una-blue); border: none; color: white;
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    flex-shrink: 0;
}

/* Backdrop */
.comment-backdrop {
    position: fixed; inset: 0; z-index: 40;
    background: rgba(0,0,0,.4);
}
.comment-backdrop.hidden { display: none; }

/* 10s limit note */
.reels-limit-note {
    background: rgba(0,0,0,0.45);
    color: rgba(255,255,255,0.9);
    font-size: 12px;
    text-align: center;
    padding: 6px 16px;
}
.reels-limit-note strong { color: white; }

/* Empty state */
.reels-empty {
    height: 100vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 12px;
    color: white; text-align: center; padding: 32px;
}
.reels-empty-icon { font-size: 64px; }
.reels-empty h2   { font-size: 24px; font-weight: 800; }
.reels-empty p    { font-size: 15px; color: rgba(255,255,255,.7); max-width: 280px; line-height: 1.5; }
.reels-empty-btn  {
    margin-top: 8px; padding: 14px 36px;
    background: var(--una-gold); color: var(--una-blue-dark);
    border-radius: 30px; font-size: 16px; font-weight: 800;
    text-decoration: none; transition: opacity .2s;
}
.reels-empty-btn:active { opacity: .85; }

/* Upload page */
.reels-upload-page { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; background: var(--una-bg); }
.reel-upload-form  { padding: 16px; display: flex; flex-direction: column; gap: 16px; padding-bottom: calc(24px + var(--safe-bottom)); }
.reel-video-picker {
    border: 2px dashed var(--una-blue-light); border-radius: 16px;
    background: white; cursor: pointer; overflow: hidden;
    min-height: 220px; display: flex; align-items: center; justify-content: center;
}
.reel-picker-idle { text-align: center; padding: 40px 20px; }
.reel-picker-icon { font-size: 48px; margin-bottom: 12px; }
.reel-picker-label { font-size: 16px; font-weight: 700; color: var(--una-blue); }
.reel-picker-sub   { font-size: 13px; color: var(--una-gray); margin-top: 4px; }
.reel-preview-video {
    width: 100%; max-height: 340px; object-fit: contain;
    background: #000; display: block;
}
.reel-preview-video.hidden { display: none; }
.reel-upload-field { display: flex; flex-direction: column; gap: 6px; }
.reel-upload-field label { font-size: 13px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .5px; }
.reel-upload-field textarea {
    padding: 12px 14px; border: 1.5px solid var(--una-gray-light);
    border-radius: 10px; font-size: 15px; font-family: inherit; resize: none;
    outline: none; transition: border-color .2s;
}
.reel-upload-field textarea:focus { border-color: var(--una-blue); }

/* ── Drive: Cloud source selector ───────────────────────── */
.drive-source-bar {
    display: flex;
    gap: 8px;
    padding: 10px 16px 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.drive-source-bar::-webkit-scrollbar { display: none; }

.drive-source-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--una-gray-light);
    background: white;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s;
    flex-shrink: 0;
}
.drive-source-chip.active {
    background: var(--chip-color, var(--una-blue));
    border-color: var(--chip-color, var(--una-blue));
    color: white;
}
.drive-source-chip.unavailable {
    opacity: 0.45;
    cursor: pointer;
}
.chip-icon { font-size: 15px; }
.chip-badge {
    background: #e0e0e0;
    color: #555;
    font-size: 10px;
    font-weight: 800;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 2px;
}
.drive-source-chip.active .chip-badge {
    background: rgba(255,255,255,0.3);
    color: white;
}

/* Cloud unavailable state */
.drive-cloud-unavailable {
    text-align: center;
    padding: 60px 32px;
    color: var(--text-secondary);
}
.drive-cloud-unavailable h3 { font-size: 20px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.drive-cloud-unavailable p  { font-size: 14px; line-height: 1.6; margin-bottom: 20px; }

/* Breadcrumb navigation */
.drive-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 16px 0;
    font-size: 13px;
    flex-wrap: wrap;
}
.drive-bc-item {
    color: var(--una-blue);
    text-decoration: none;
    font-weight: 600;
}
.drive-bc-item.current { color: var(--text-secondary); font-weight: 500; }
.drive-bc-sep { color: var(--una-gray); }

/* Folder items in file list */
.drive-item-folder .drive-item-name { color: var(--una-blue); font-weight: 600; }
.drive-folder-link { color: var(--una-blue); text-decoration: none; font-weight: 600; }
.drive-folder-link:hover { text-decoration: underline; }

/* ── UNI Contact ────────────────────────────────────────── */
.contacts-body      { background: var(--una-bg); min-height: 100vh; }
.contacts-container { max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; min-height: 100vh; }

.contacts-header {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    padding-top: calc(var(--safe-top) + 12px);
    background: var(--una-blue);
    color: white;
    position: sticky; top: 0; z-index: 10;
}
.contacts-header h1 { flex: 1; font-size: 20px; font-weight: 800; color: white; }
.contacts-header .back-btn { color: white; }
.contacts-new-group-btn {
    background: rgba(255,255,255,0.15); color: white; border: none;
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
}

/* Tabs */
.contacts-tabs {
    display: flex; gap: 0;
    background: white;
    border-bottom: 1px solid var(--una-gray-light);
}
.contacts-tab {
    flex: 1; padding: 12px; border: none; background: none;
    font-size: 14px; font-weight: 600; color: var(--text-secondary);
    cursor: pointer; border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
}
.contacts-tab.active { color: var(--una-blue); border-bottom-color: var(--una-blue); }

/* Search */
.contacts-search-wrap {
    position: relative; padding: 10px 16px 4px;
    background: white;
}
.contacts-search-wrap .search-icon {
    position: absolute; left: 28px; top: 50%; transform: translateY(-50%);
    color: var(--text-secondary); pointer-events: none;
}
.contacts-search {
    width: 100%; padding: 9px 12px 9px 34px;
    border: 1.5px solid var(--una-gray-light); border-radius: 20px;
    font-size: 14px; outline: none; background: var(--una-bg);
    box-sizing: border-box;
    transition: border-color .2s;
}
.contacts-search:focus { border-color: var(--una-blue); }

/* Tab panels */
.contacts-tab-panel { display: none; flex: 1; overflow-y: auto; }
.contacts-tab-panel.active { display: block; }

/* People list */
.contacts-list { padding: 8px 0; }
.contact-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px;
    background: white; border-bottom: 1px solid var(--una-gray-light);
    transition: background .1s;
}
.contact-item:active { background: var(--una-bg); }
.contact-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 16px; flex-shrink: 0;
}
.contact-info { flex: 1; min-width: 0; }
.contact-name { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.contact-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact-actions { display: flex; gap: 4px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.contact-action-btn {
    width: 36px; height: 36px; border-radius: 50%;
    border: 1.5px solid var(--una-gray-light); background: white;
    display: flex; align-items: center; justify-content: center;
    color: var(--una-blue); text-decoration: none; cursor: pointer;
    transition: background .15s, color .15s;
    padding: 0;
}
.contact-action-btn:hover { background: var(--una-bg); }
.contact-action-btn:active { background: var(--una-gray-light); }
.contact-delete-btn { color: #e53935; border-color: #fecdd3; }

/* Groups */
.contacts-groups-list { padding: 12px 16px; display: flex; flex-direction: column; gap: 12px; }
.contact-group-card {
    background: white; border-radius: 14px;
    border: 1px solid var(--una-gray-light);
    padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.cg-header { display: flex; align-items: center; gap: 10px; }
.cg-emoji  { font-size: 24px; flex-shrink: 0; }
.cg-info   { flex: 1; min-width: 0; }
.cg-name   { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.cg-meta   { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.cg-members { display: flex; flex-wrap: wrap; gap: 6px; }
.cg-member-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 12px;
}
.cg-member-avatar.sm { width: 28px; height: 28px; font-size: 10px; }
.cg-member-more {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--una-gray-light); color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
}
.cg-add-form   { display: flex; gap: 8px; }
.cg-add-select {
    flex: 1; padding: 7px 10px; border: 1.5px solid var(--una-gray-light);
    border-radius: 8px; font-size: 13px; outline: none;
    background: var(--una-bg);
}
.cg-add-btn {
    padding: 7px 14px; background: var(--una-blue); color: white;
    border: none; border-radius: 8px; font-size: 13px; font-weight: 700;
    cursor: pointer;
}

/* Empty state */
.contacts-empty {
    text-align: center; padding: 60px 32px; color: var(--text-secondary);
}
.contacts-empty-icon { font-size: 56px; margin-bottom: 12px; }
.contacts-empty p    { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.contacts-empty-sub  { font-size: 13px; color: var(--text-secondary); margin-top: 4px; font-weight: 400; }

/* Modal */
.modal-backdrop          { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; }
.modal-backdrop.hidden   { display: none; }
.contacts-modal.hidden   { display: none; }
.contacts-modal {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 600px; max-height: 88vh;
    background: white; border-radius: 20px 20px 0 0;
    z-index: 51; display: flex; flex-direction: column;
    overflow: hidden;
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px 12px; border-bottom: 1px solid var(--una-gray-light);
    flex-shrink: 0;
}
.modal-header h2 { font-size: 18px; font-weight: 800; color: var(--una-blue); }
.modal-close { background: none; border: none; font-size: 18px; color: var(--text-secondary); cursor: pointer; }
.modal-form {
    overflow-y: auto; padding: 16px 20px 32px;
    display: flex; flex-direction: column; gap: 16px;
}
.modal-field { display: flex; flex-direction: column; gap: 6px; }
.modal-field label { font-size: 12px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .5px; }
.modal-input {
    padding: 10px 14px; border: 1.5px solid var(--una-gray-light);
    border-radius: 10px; font-size: 15px; font-family: inherit; outline: none;
    transition: border-color .2s;
}
.modal-input:focus { border-color: var(--una-blue); }
.emoji-row { display: flex; flex-wrap: wrap; gap: 8px; }
.emoji-opt {
    font-size: 22px; width: 42px; height: 42px; border-radius: 10px;
    border: 2px solid transparent; background: var(--una-bg);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: border-color .15s;
}
.emoji-opt.selected { border-color: var(--una-blue); }
.modal-members-list {
    display: flex; flex-direction: column; gap: 4px;
    max-height: 220px; overflow-y: auto;
    border: 1.5px solid var(--una-gray-light); border-radius: 10px; padding: 8px;
}
.modal-member-row {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 4px; cursor: pointer; border-radius: 8px;
    transition: background .1s;
}
.modal-member-row:hover { background: var(--una-bg); }
.modal-member-row input { accent-color: var(--una-blue); }
.modal-submit {
    padding: 14px; background: var(--una-blue); color: white;
    border: none; border-radius: 12px; font-size: 16px; font-weight: 800;
    cursor: pointer; transition: opacity .2s;
}
.modal-submit:active { opacity: .85; }

/* ── Shared app footer ──────────────────────────────────── */
.eu-footer {
    text-align: center;
    padding: 14px 16px;
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: .3px;
}
.eu-footer span { font-size: 14px; vertical-align: middle; margin-right: 4px; }

/* ── Work: People groups section ────────────────────────── */
.people-section-label {
    padding: 10px 16px 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--text-secondary);
}
.people-groups-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid var(--una-gray-light);
    margin-bottom: 4px;
}
.people-group-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: white;
    border-bottom: 1px solid var(--una-gray-light);
}
.pg-emoji { font-size: 24px; flex-shrink: 0; }
.pg-info  { flex: 1; min-width: 0; }
.pg-name  { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.pg-meta  { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.connect-group-btn {
    padding: 7px 13px;
    border-radius: 20px;
    border: 1.5px solid var(--una-blue);
    background: white;
    color: var(--una-blue);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s, color .15s;
}
.connect-group-btn.connected {
    background: var(--una-blue);
    color: white;
    border-color: var(--una-blue);
}
.connect-group-btn:disabled { opacity: .6; cursor: default; }

/* ── Drive: Repository setup ────────────────────────────── */
.drive-repo-setup {
    text-align: center;
    padding: 40px 24px;
    color: var(--text-secondary);
}
.drive-repo-setup h3 { font-size: 20px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.drive-repo-setup p  { font-size: 14px; line-height: 1.6; margin-bottom: 20px; }

.repo-preset-list { display: flex; flex-direction: column; gap: 0; margin-bottom: 20px; border: 1.5px solid var(--una-gray-light); border-radius: 14px; overflow: hidden; text-align: left; }
.repo-preset-btn {
    width: 100%; display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; background: white; border: none;
    border-bottom: 1px solid var(--una-gray-light);
    cursor: pointer; transition: background .1s;
}
.repo-preset-btn:last-child { border-bottom: none; }
.repo-preset-btn:active { background: var(--una-bg); }
.repo-preset-icon { font-size: 22px; flex-shrink: 0; }
.repo-preset-info { flex: 1; min-width: 0; text-align: left; }
.repo-preset-name { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.repo-preset-path { font-size: 11px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

.repo-custom-label { font-size: 12px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; text-align: left; }
.repo-path-form  { display: flex; gap: 8px; }
.repo-path-input {
    flex: 1; padding: 10px 14px; border: 1.5px solid var(--una-gray-light);
    border-radius: 10px; font-size: 14px; font-family: inherit; outline: none;
    transition: border-color .2s;
}
.repo-path-input:focus { border-color: var(--una-blue); }
.repo-path-btn {
    padding: 10px 18px; background: var(--una-blue); color: white;
    border: none; border-radius: 10px; font-size: 14px; font-weight: 700; cursor: pointer;
}
.repo-unset .chip-badge { background: #f59e0b; color: white; }
.drive-repo-change-btn {
    background: none; border: none; font-size: 16px; cursor: pointer;
    padding: 2px 4px; line-height: 1;
}

/* ── Drive: info note ───────────────────────────────────── */
.drive-info-note {
    margin: 20px 16px 8px;
    padding: 14px 16px;
    background: #f0f4ff;
    border: 1px solid #c7d4f7;
    border-radius: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}
.drive-info-note-title {
    font-weight: 700;
    color: var(--una-blue);
    margin-bottom: 8px;
    font-size: 13px;
}
.drive-info-note-list {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.drive-info-note-list li strong { color: var(--text-primary); }

/* ── Social Feed ────────────────────────────────────────── */
.feed-compose-card {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid var(--una-gray-light);
}
.feed-compose-trigger {
    flex: 1; padding: 10px 14px;
    border: 1.5px solid var(--una-gray-light); border-radius: 24px;
    background: var(--una-bg); font-size: 14px; color: var(--text-secondary);
    text-align: left; cursor: pointer;
    transition: border-color .2s;
}
.feed-compose-trigger:hover { border-color: var(--una-blue); }

.feed-compose-panel {
    background: white; border-bottom: 1px solid var(--una-gray-light);
}
.feed-compose-panel.hidden { display: none; }
.feed-compose-inner { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.feed-compose-top   { display: flex; align-items: center; gap: 10px; }
.feed-compose-name  { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.feed-compose-sub   { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.feed-compose-inner textarea {
    width: 100%; padding: 10px 12px; border: 1.5px solid var(--una-gray-light);
    border-radius: 10px; font-size: 15px; font-family: inherit; resize: none;
    outline: none; transition: border-color .2s; box-sizing: border-box;
}
.feed-compose-inner textarea:focus { border-color: var(--una-blue); }
.feed-img-label {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 600; color: var(--una-blue);
    cursor: pointer; padding: 4px 0;
}
.feed-img-preview {
    width: 100%; max-height: 260px; object-fit: cover;
    border-radius: 10px; border: 1px solid var(--una-gray-light);
}
.feed-img-preview.hidden { display: none; }
.feed-compose-actions { display: flex; justify-content: flex-end; gap: 8px; }
.feed-cancel-btn {
    padding: 9px 18px; border-radius: 20px;
    border: 1.5px solid var(--una-gray-light); background: white;
    font-size: 14px; font-weight: 600; color: var(--text-secondary); cursor: pointer;
}
.feed-post-btn {
    padding: 9px 22px; border-radius: 20px;
    border: none; background: var(--una-blue); color: white;
    font-size: 14px; font-weight: 700; cursor: pointer;
}
.feed-post-btn:disabled { opacity: .6; }

/* Feed list */
.feed-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }

/* Feed card */
.feed-card {
    background: white; margin: 10px 12px;
    border-radius: 14px; border: 1px solid var(--una-gray-light);
    overflow: hidden;
}
.feed-card-header {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px 8px;
}
.feed-card-meta { flex: 1; min-width: 0; }
.feed-card-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.feed-card-time { font-size: 11px; color: var(--text-secondary); margin-top: 1px; }
.feed-delete-btn {
    background: none; border: none; color: var(--text-secondary);
    cursor: pointer; padding: 4px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: color .15s;
}
.feed-delete-btn:hover { color: #e53935; }
.feed-card-content {
    padding: 0 14px 10px; font-size: 15px; line-height: 1.55; color: var(--text-primary);
    white-space: pre-wrap; word-break: break-word;
}
.feed-card-image {
    width: 100%; max-height: 340px; object-fit: cover; display: block;
    border-top: 1px solid var(--una-gray-light);
}

/* Actions bar */
.feed-card-actions {
    display: flex; gap: 16px; padding: 8px 14px;
    border-top: 1px solid var(--una-gray-light);
}
.feed-like-btn, .feed-comment-btn {
    display: flex; align-items: center; gap: 5px;
    background: none; border: none; font-size: 14px; font-weight: 600;
    color: var(--text-secondary); cursor: pointer;
    padding: 4px 6px; border-radius: 8px;
    transition: color .15s, background .15s;
}
.feed-like-btn:hover, .feed-comment-btn:hover { background: var(--una-bg); }
.feed-like-btn.liked { color: #e11d48; }

/* Comments */
.feed-comments-section { border-top: 1px solid var(--una-gray-light); background: var(--una-bg); }
.feed-comments-section.hidden { display: none; }
.feed-comments-list { padding: 10px 12px 4px; display: flex; flex-direction: column; gap: 8px; }
.feed-no-comments { font-size: 13px; color: var(--text-secondary); padding: 4px 0; }
.feed-comment-item { display: flex; align-items: flex-start; gap: 8px; }
.feed-comment-bubble {
    background: white; border-radius: 12px; padding: 7px 11px;
    border: 1px solid var(--una-gray-light); font-size: 13px; max-width: calc(100% - 44px);
}
.feed-comment-author { font-weight: 700; color: var(--text-primary); margin-right: 6px; }
.feed-comment-text   { color: var(--text-primary); line-height: 1.4; }
.feed-comment-input-row {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px 10px;
}
.feed-comment-input {
    flex: 1; padding: 8px 14px; border: 1.5px solid var(--una-gray-light);
    border-radius: 20px; font-size: 13px; font-family: inherit; outline: none;
    background: white; transition: border-color .2s;
}
.feed-comment-input:focus { border-color: var(--una-blue); }

/* Avatar sizes */
.feed-avatar {
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 14px;
}
.feed-avatar.sm { width: 28px; height: 28px; font-size: 10px; }

/* Empty state */
.feed-empty { text-align: center; padding: 60px 32px; color: var(--text-secondary); }
.feed-empty p { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.feed-empty-sub { font-size: 14px; color: var(--text-secondary); margin-top: 6px; font-weight: 400; }

/* ── Feed: Recipient picker ─────────────────────────────── */
.feed-recipients-wrap {
    background: var(--una-bg);
    border-radius: 10px;
    padding: 8px 12px;
    display: flex; flex-direction: column; gap: 6px;
}
.feed-recipients-row {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--text-secondary);
}
.feed-recipients-label { flex: 1; font-weight: 600; color: var(--text-primary); }
.feed-recipients-toggle {
    background: none; border: 1.5px solid var(--una-blue); border-radius: 14px;
    color: var(--una-blue); font-size: 12px; font-weight: 700;
    padding: 3px 10px; cursor: pointer;
}
.feed-recipient-chips {
    display: flex; flex-wrap: wrap; gap: 5px;
}
.feed-recipient-chips.hidden { display: none; }
.rp-chip {
    display: inline-flex; align-items: center; gap: 4px;
    background: #e8eeff; color: var(--una-blue);
    border-radius: 14px; padding: 3px 10px;
    font-size: 12px; font-weight: 600;
}
.rp-chip-remove {
    background: none; border: none; color: var(--una-blue);
    cursor: pointer; font-size: 11px; padding: 0; line-height: 1;
}

/* Picker panel */
.feed-recipient-picker {
    border: 1.5px solid var(--una-gray-light); border-radius: 12px;
    background: white; overflow: hidden;
    max-height: 280px; display: flex; flex-direction: column;
}
.feed-recipient-picker.hidden { display: none; }
.rp-search-wrap { padding: 8px 10px; border-bottom: 1px solid var(--una-gray-light); }
.rp-search {
    width: 100%; padding: 7px 12px; border: 1.5px solid var(--una-gray-light);
    border-radius: 20px; font-size: 13px; outline: none; box-sizing: border-box;
    transition: border-color .2s;
}
.rp-search:focus { border-color: var(--una-blue); }
.rp-section-label {
    padding: 6px 12px 2px;
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .6px; color: var(--text-secondary);
}
.rp-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; cursor: pointer;
    transition: background .1s;
}
.rp-item:hover { background: var(--una-bg); }
.rp-item input[type="checkbox"] { accent-color: var(--una-blue); flex-shrink: 0; }
.rp-item-icon { font-size: 18px; flex-shrink: 0; }
.rp-item-name { font-size: 14px; color: var(--text-primary); flex: 1; }
.rp-done-btn {
    margin: 8px 12px 10px; padding: 8px;
    background: var(--una-blue); color: white;
    border: none; border-radius: 8px; font-size: 14px; font-weight: 700;
    cursor: pointer; flex-shrink: 0;
}

/* Recipient label on post cards */
.feed-to-label {
    color: var(--una-blue); font-weight: 600; margin-left: 4px;
}

/* ── Social Settings ─────────────────────────────────────── */
.settings-body {
    flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 12px 0 calc(70px + env(safe-area-inset-bottom, 0px));
    background: var(--una-bg);
}

/* Toast */
.settings-toast {
    margin: 0 16px 12px; padding: 12px 16px;
    border-radius: 10px; font-size: 14px; font-weight: 600;
    transition: opacity .5s;
}
.settings-toast.success { background: #d1fae5; color: #065f46; }
.settings-toast.error   { background: #fee2e2; color: #991b1b; }

/* Profile hero */
.settings-profile-hero {
    display: flex; align-items: center; gap: 14px;
    padding: 20px 16px 12px;
    background: white; margin-bottom: 12px;
    border-bottom: 1px solid var(--una-gray-light);
}
.settings-avatar {
    width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 22px; font-weight: 700;
}
.settings-hero-name { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.settings-hero-sub  { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }

/* Sections */
.settings-section {
    background: white; margin-bottom: 12px;
    border-top: 1px solid var(--una-gray-light);
    border-bottom: 1px solid var(--una-gray-light);
}
.settings-section-title {
    padding: 12px 16px 4px;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .6px; color: var(--text-secondary);
}

/* Form fields */
.settings-form { padding: 4px 16px 14px; }
.settings-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.settings-field label {
    font-size: 12px; font-weight: 600; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: .4px;
}
.settings-input {
    padding: 10px 14px; border: 1.5px solid var(--una-gray-light);
    border-radius: 10px; font-size: 15px; font-family: inherit; outline: none;
    transition: border-color .2s;
}
.settings-input:focus { border-color: var(--una-blue); }
.settings-save-btn {
    width: 100%; padding: 12px; background: var(--una-blue); color: white;
    border: none; border-radius: 10px; font-size: 15px; font-weight: 700;
    cursor: pointer; transition: opacity .2s; margin-top: 4px;
}
.settings-save-btn:active { opacity: .85; }

/* Avatar photo upload */
.settings-avatar-upload-row {
    display: flex; align-items: center; gap: 16px;
    padding: 8px 16px 14px;
}
.settings-avatar-preview {
    width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 22px; font-weight: 700; overflow: hidden;
}
.settings-avatar-preview.avatar-has-photo { padding: 0; }
.settings-avatar-upload-info { display: flex; flex-direction: column; gap: 4px; }
.settings-upload-btn {
    display: inline-block; padding: 9px 18px;
    background: var(--una-blue); color: white; border-radius: 10px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    transition: opacity .2s;
}
.settings-upload-btn:active { opacity: .8; }
.settings-upload-hint { font-size: 12px; color: var(--text-secondary); margin: 0; }
.settings-save-btn:disabled { opacity: .45; cursor: default; }

/* Info rows */
.settings-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 13px 16px; border-bottom: 1px solid var(--una-gray-light);
}
.settings-row:last-child { border-bottom: none; }
.settings-row-label { font-size: 15px; color: var(--text-primary); }
.settings-row-value { font-size: 15px; color: var(--text-secondary); }

/* Sign out */
.settings-signout-btn {
    display: block; text-align: center; padding: 14px 16px;
    font-size: 15px; font-weight: 700; color: #e11d48;
    text-decoration: none;
}

/* ── Avatar photo support (universal) ──────────────────── */
.avatar-has-photo {
    padding: 0 !important;
    overflow: hidden;
}
.feed-avatar img, .feed-avatar.sm img,
.work-avatar-xs img, .work-avatar-sm img,
.post-avatar img, .person-avatar img,
.contact-avatar img, .reel-avatar img,
.settings-avatar img, .profile-avatar-lg img,
.settings-avatar-preview img,
.cg-member-avatar img, .calls-avatar img,
.conv-avatar img {
    width: 100%; height: 100%; object-fit: cover;
    border-radius: 50%; display: block;
}

/* ── Calls page ─────────────────────────────────────────── */
.calls-banner {
    display: flex; align-items: center; gap: 12px;
    margin: 12px 16px 0;
    padding: 12px 14px;
    background: #e8f0fe; border-radius: 12px;
    border: 1px solid #c7d7fc;
}
.calls-banner-icon { color: #2563eb; flex-shrink: 0; }
.calls-banner-title { font-size: 13px; font-weight: 700; color: #1e3a8a; }
.calls-banner-sub   { font-size: 12px; color: #3b5bdb; margin-top: 1px; }

.calls-search-wrap {
    padding: 12px 16px 6px;
}
.calls-search-input {
    width: 100%; padding: 10px 14px;
    border: 1.5px solid var(--una-gray-light);
    border-radius: 10px; font-size: 15px;
    font-family: inherit; outline: none;
    box-sizing: border-box;
    transition: border-color .2s;
}
.calls-search-input:focus { border-color: var(--una-blue); }

.calls-list {
    flex: 1; overflow-y: auto;
    padding: 6px 0 12px;
}
.calls-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--una-gray-light);
}
.calls-avatar {
    width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 15px; font-weight: 700; overflow: hidden;
}
.calls-info { flex: 1; min-width: 0; }
.calls-name { font-size: 15px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calls-sub  { font-size: 12px; color: var(--text-secondary); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.calls-btns { display: flex; gap: 8px; flex-shrink: 0; }
.calls-btn {
    width: 38px; height: 38px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; transition: opacity .15s;
}
.calls-btn:active { opacity: .75; }
.calls-btn-audio { background: #22c55e; color: white; }
.calls-btn-video { background: #3b82f6; color: white; }

.calls-empty {
    padding: 40px 16px; text-align: center;
    color: var(--text-secondary); font-size: 14px;
}

/* ── UNI Study ──────────────────────────────────────────── */
.study-body { background: var(--una-bg); min-height: 100vh; }
.study-container {
    max-width: 480px; margin: 0 auto;
    padding-top: calc(var(--safe-top) + 0px);
    display: flex; flex-direction: column; min-height: 100vh;
}
.study-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px;
    padding-top: calc(var(--safe-top) + 12px);
    background: var(--una-blue);
    color: white;
    position: sticky; top: 0; z-index: 10;
}
.study-header h1 { font-size: 18px; font-weight: 700; color: white; }
.study-header .back-btn { color: white; }
.study-header-btn {
    width: 36px; height: 36px; border-radius: 50%;
    border: none; background: rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: white;
}

/* Setup */
.study-setup {
    padding: 32px 24px; display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.study-setup-icon { font-size: 52px; line-height: 1; }
.study-setup-title { font-size: 22px; font-weight: 700; text-align: center; }
.study-setup-desc { font-size: 14px; color: var(--text-secondary); text-align: center; line-height: 1.5; }
.study-how-card {
    width: 100%; background: white; border-radius: 14px;
    padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.07);
}
.study-how-title { font-size: 13px; font-weight: 700; margin-bottom: 10px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-secondary); }
.study-how-list { margin: 0 0 10px 16px; padding: 0; font-size: 14px; line-height: 1.8; color: var(--text-primary); }
.study-how-note { font-size: 12px; color: var(--text-secondary); margin: 0; }
.study-setup-form { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.study-url-input {
    width: 100%; padding: 12px 14px; border: 1.5px solid var(--una-gray-light);
    border-radius: 12px; font-size: 14px; font-family: inherit; outline: none;
    box-sizing: border-box;
}
.study-url-input:focus { border-color: #8b5cf6; }
.study-connect-btn {
    padding: 13px; background: #8b5cf6; color: white;
    border: none; border-radius: 12px; font-size: 15px; font-weight: 700;
    cursor: pointer; transition: opacity .2s;
}
.study-connect-btn:active { opacity: .85; }

/* Error banner */
.study-error {
    display: flex; align-items: center; gap: 8px;
    margin: 12px 16px 0; padding: 10px 14px;
    background: #fff0f0; border-radius: 10px;
    font-size: 13px; color: #b91c1c;
    border: 1px solid #fca5a5;
}

/* Today strip */
.study-today-strip {
    background: white; margin: 12px 16px 0;
    border-radius: 14px; padding: 14px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
}
.study-today-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .6px; color: #8b5cf6; margin-bottom: 8px;
}
.study-today-free { font-size: 14px; color: var(--text-secondary); }
.study-today-events { display: flex; flex-direction: column; gap: 8px; }
.study-today-pill {
    display: flex; flex-direction: column; gap: 2px;
    background: #f5f3ff; border-radius: 10px;
    padding: 10px 12px; border-left: 3px solid #8b5cf6;
}
.study-today-time { font-size: 12px; font-weight: 700; color: #8b5cf6; }
.study-today-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.study-today-loc { font-size: 12px; color: var(--text-secondary); }

/* Week scroll */
.study-week-scroll { flex: 1; overflow-y: auto; padding: 12px 16px 24px; }
.study-day-group { margin-bottom: 16px; }
.study-day-group.today .study-day-name { color: #8b5cf6; }
.study-day-header {
    display: flex; align-items: baseline; gap: 8px;
    margin-bottom: 8px;
}
.study-day-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.study-day-date { font-size: 12px; color: var(--text-secondary); }
.study-event-card {
    display: flex; gap: 12px; align-items: flex-start;
    background: white; border-radius: 12px;
    padding: 12px 14px; margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.study-event-time {
    font-size: 12px; font-weight: 700; color: var(--text-secondary);
    min-width: 44px; padding-top: 1px; flex-shrink: 0;
}
.study-event-end { font-weight: 400; }
.study-event-body { flex: 1; }
.study-event-title { font-size: 14px; font-weight: 600; color: var(--text-primary); line-height: 1.3; }
.study-event-loc {
    display: flex; align-items: center; gap: 3px;
    font-size: 12px; color: var(--text-secondary); margin-top: 4px;
}
.study-empty {
    text-align: center; padding: 48px 16px;
    color: var(--text-secondary); font-size: 14px;
}
.study-empty-sub { font-size: 12px; margin-top: 4px; }

/* Study — university-specific instruction cards */
.study-uni-card {
    width: 100%;
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
}
.study-uni-toggle {
    width: 100%; display: flex; align-items: center; gap: 10px;
    padding: 14px 16px; border: none; background: none;
    cursor: pointer; text-align: left;
}
.study-uni-logo { font-size: 20px; flex-shrink: 0; }
.study-uni-toggle-label {
    flex: 1; font-size: 14px; font-weight: 700; color: var(--text-primary);
}
.study-uni-chevron {
    flex-shrink: 0; color: var(--text-secondary);
    transition: transform .2s;
}
.study-uni-body {
    padding: 0 16px 14px;
    border-top: 1px solid var(--una-gray-light);
}

/* ── User app shortcuts ─────────────────────────────── */

.user-apps-section {
    margin-top: 8px;
}

.user-apps-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    padding: 0 20px 6px;
}

.user-app-card {
    position: relative;
    padding-right: 40px;
}

.user-app-link {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    text-decoration: none;
    color: inherit;
}

.user-app-icon {
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--una-card) !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1) !important;
    border: 1px solid var(--una-border);
}

.user-app-delete-form {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
}

.user-app-delete-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 6px;
    line-height: 1;
    border-radius: 50%;
}

.user-app-delete-btn:hover {
    background: rgba(225,29,72,0.1);
    color: #e11d48;
}

.add-app-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 12px 20px 4px;
    padding: 10px;
    background: none;
    border: 1.5px dashed var(--una-border);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    width: calc(100% - 40px);
    transition: border-color 0.2s, color 0.2s;
}

.add-app-btn:hover {
    border-color: var(--una-primary);
    color: var(--una-primary);
}

.emoji-input {
    font-size: 22px !important;
    text-align: center;
    max-width: 80px;
}

/* ── Admin dashboard link ───────────────────────────── */

.admin-dashboard-link {
    display: flex;
    justify-content: center;
    margin: 8px 0 4px;
}

.admin-dashboard-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid var(--una-blue);
    color: var(--una-blue);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: background 0.15s, color 0.15s;
}

.admin-dashboard-btn:hover {
    background: var(--una-blue);
    color: #fff;
}
.study-uni-body.hidden { display: none; }

/* ── Cloudflare tunnel banner ───────────────────────────── */
.tunnel-banner {
    display: flex; align-items: center; justify-content: space-between;
    background: #f0fdf4; border: 1px solid #bbf7d0;
    border-radius: 12px; padding: 10px 14px;
    margin-bottom: 12px; gap: 10px;
}
.tunnel-banner-left {
    display: flex; align-items: center; gap: 10px;
    min-width: 0; color: #166534;
}
.tunnel-banner-label {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .5px; color: #16a34a; line-height: 1;
}
.tunnel-banner-url {
    font-size: 12px; color: #166534; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 220px; margin-top: 2px;
}
.tunnel-copy-btn {
    flex-shrink: 0; padding: 6px 12px;
    background: #16a34a; color: white;
    border: none; border-radius: 8px;
    font-size: 12px; font-weight: 700;
    cursor: pointer; transition: opacity .15s;
}
.tunnel-copy-btn:active { opacity: .8; }

/* ── Icon Grid Dashboard (ig-*) ─────────────────────── */

.ig-body {
    background: #111827;
    min-height: 100vh;
    min-height: 100dvh;
}

.ig-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 0 env(safe-area-inset-bottom, 16px);
    padding-top: env(safe-area-inset-top, 0px);
}

/* Header */
.ig-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
}

.ig-logo {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 4px;
}

.ig-header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ig-username {
    color: rgba(255,255,255,0.75);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}

.ig-username:active { opacity: .6; }

.ig-signout {
    color: rgba(255,255,255,0.45);
    font-size: 12px;
    text-decoration: none;
}

.ig-signout:active { opacity: .6; }

/* Welcome banner */
.ig-welcome {
    padding: 4px 20px 20px;
}

.ig-welcome-name {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.ig-welcome-inst {
    font-size: 12px;
    color: rgba(255,255,255,0.45);
    margin-top: 3px;
    font-weight: 400;
}

/* App grid */
.ig-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px 8px;
    padding: 0 12px;
}

.ig-divider {
    grid-column: 1 / -1;
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 2px 0;
}

/* Individual app tile */
.ig-app {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

.ig-app:active .ig-icon {
    opacity: 0.75;
    transform: scale(0.93);
}

/* Icon square */
.ig-icon {
    width: 62px;
    height: 62px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    position: relative;
    transition: opacity 0.12s, transform 0.12s;
    flex-shrink: 0;
}

/* Emoji icon variant (My Apps) */
.ig-icon-emoji {
    font-size: 28px;
    background: #1f2937;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border-radius: 16px;
    width: 62px;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* App label */
.ig-label {
    font-size: 11px;
    color: rgba(255,255,255,0.82);
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.1px;
    line-height: 1.2;
    max-width: 64px;
    word-break: break-word;
}

/* Unread badge */
.ig-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #111827;
    line-height: 1;
}

/* Section label (My Apps) */
.ig-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255,255,255,0.35);
    padding: 22px 16px 10px;
}

/* User-app wrapper (has delete button overlay) */
.ig-user-app {
    position: relative;
}

.ig-user-app-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.ig-delete-form {
    position: absolute;
    top: -6px;
    right: 2px;
}

.ig-delete-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(239,68,68,0.9);
    border: 2px solid #111827;
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-weight: 700;
}

/* Admin row */
.ig-admin-row {
    display: flex;
    justify-content: center;
    padding: 24px 0 0;
}

.ig-admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 18px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.55);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.ig-admin-btn:active {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* ── UNI Mail ────────────────────────────────────────── */

.mail-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-secondary);
    padding: 16px 16px 8px;
}

.mail-accounts {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 12px;
}

.mail-account-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border-radius: 14px;
    padding: 13px 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.mail-provider-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.mail-icon-outlook { background: #0078d4; }
.mail-icon-gmail   { background: #ea4335; }
.mail-icon-yahoo   { background: #6001d2; }
.mail-icon-proton  { background: #6d4aff; }
.mail-icon-icloud  { background: #3a86ff; }
.mail-icon-custom  { background: #64748b; }

.mail-account-info {
    flex: 1;
    min-width: 0;
}

.mail-account-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mail-account-url {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mail-account-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.mail-open-btn {
    display: inline-block;
    padding: 6px 14px;
    background: var(--una-blue);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border-radius: 20px;
    text-decoration: none;
    white-space: nowrap;
}
.mail-open-btn:active { opacity: 0.75; }

.mail-remove-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.mail-remove-btn:active { background: var(--una-gray-light); }

/* Empty state */
.mail-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px 32px;
    color: var(--text-secondary);
    text-align: center;
    gap: 8px;
}

.mail-empty-icon {
    color: var(--una-gray);
    margin-bottom: 8px;
    opacity: 0.5;
}

.mail-empty p {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.mail-empty-sub {
    font-size: 13px !important;
    font-weight: 400 !important;
    color: var(--text-secondary) !important;
}

/* Add modal preset buttons */
.mail-preset-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f7f8fa;
    border: none;
    border-radius: 12px;
    padding: 13px 14px;
    margin-bottom: 8px;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s;
}
.mail-preset-btn:active { background: #eef0f4; }

.mail-preset-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.mail-preset-outlook .mail-preset-icon { background: #0078d4; }
.mail-preset-gmail   .mail-preset-icon { background: #ea4335; }
.mail-preset-yahoo   .mail-preset-icon { background: #6001d2; }
.mail-preset-proton  .mail-preset-icon { background: #6d4aff; }
.mail-preset-icloud  .mail-preset-icon { background: #3a86ff; }

.mail-preset-label {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.mail-preset-arrow {
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* Custom provider section */
.mail-custom-section {
    margin-top: 4px;
    border-top: 1px solid var(--una-gray-light);
    padding-top: 12px;
}

.mail-custom-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 10px 0;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    user-select: none;
}

.mail-custom-toggle svg:first-child {
    flex-shrink: 0;
}

.mail-custom-toggle span { flex: 1; }

#customChevron {
    transition: transform 0.2s;
}

.mail-custom-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px 0 4px;
}

.mail-custom-form.hidden { display: none; }

.mail-custom-input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--una-gray-light);
    border-radius: 10px;
    font-size: 14px;
    background: #f7f8fa;
    color: var(--text-primary);
    outline: none;
}
.mail-custom-input:focus {
    border-color: var(--una-blue);
    background: #fff;
}

.mail-custom-submit {
    padding: 12px;
    background: var(--una-blue);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.mail-custom-submit:active { opacity: 0.8; }

/* ── Chat file attachments ──────────────────────────── */

.chat-attach-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--una-gray);
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.chat-attach-btn:active { background: var(--una-gray-light); color: var(--una-blue); }

.chat-file-preview {
    background: #f0f4ff;
    border-top: 1px solid #dde4f5;
    padding: 6px 14px;
}
.chat-file-preview-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.chat-file-preview-name {
    font-size: 12px;
    color: var(--una-blue);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-file-preview-remove {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    flex-shrink: 0;
}

/* Image attachment in bubble */
.chat-file-img-wrap { display: block; margin-bottom: 4px; }
.chat-file-img {
    max-width: 220px;
    max-height: 220px;
    border-radius: 10px;
    display: block;
    object-fit: cover;
}

/* Generic file pill */
.chat-file-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255,255,255,0.25);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 10px;
    padding: 7px 10px;
    text-decoration: none;
    color: inherit;
    max-width: 220px;
    margin-bottom: 4px;
}
.message-received .chat-file-pill {
    background: rgba(0,51,153,0.06);
    border-color: rgba(0,51,153,0.15);
    color: var(--text-primary);
}
.chat-file-pill-ext {
    background: var(--una-blue);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 4px;
    flex-shrink: 0;
}
.chat-file-pill-name {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}
