/* ============================================================
   THUNDERFEED — Classroom Social Media Simulator
   Theme: Warm creamy white — clean, editorial, easy to read
   ============================================================ */

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

:root {
    /* Warm creamy palette */
    --tf-bg:          #f5f0e8;
    --tf-surface:     #faf7f2;
    --tf-surface-2:   #f0ebe0;
    --tf-border:      #e2d9cc;
    --tf-border-2:    #cfc5b5;

    /* Accent — warm amber + deep plum */
    --tf-accent:      #c8841a;
    --tf-accent-light:#fdf0d8;
    --tf-accent-2:    #6b3fa0;
    --tf-accent-2-light: #f0e8ff;

    /* Text */
    --tf-text:        #2c2416;
    --tf-text-muted:  #7a6e60;
    --tf-text-faint:  #a89e90;

    /* Status */
    --tf-danger:      #c0392b;
    --tf-success:     #2d7a4f;

    /* Prompt purple */
    --tf-prompt:      #6b3fa0;

    /* Layout */
    --tf-radius:      14px;
    --tf-sidebar-w:   240px;
    --tf-right-w:     280px;
    --tf-font:        'DM Sans', sans-serif;
    --tf-font-display:'DM Serif Display', serif;
}

/* ---- RESET & BASE ---- */
.tf-app, .tf-profile-page, .tf-admin-panel {
    font-family: var(--tf-font);
    color: var(--tf-text);
    background: var(--tf-bg);
    min-height: 100vh;
    box-sizing: border-box;
}

.tf-app *, .tf-profile-page *, .tf-admin-panel * {
    box-sizing: border-box;
}

/* ---- LAYOUT ---- */
.tf-app {
    display: grid;
    grid-template-columns: var(--tf-sidebar-w) 1fr var(--tf-right-w);
    gap: 0;
    max-width: 860px;
    margin: 0 auto;
}

/* Two-column layout (feed + classmates pages — no right panel) */
.tf-app-two-col {
    grid-template-columns: var(--tf-sidebar-w) 1fr;
    max-width: 820px;
}

/* ---- SIDEBAR ---- */
.tf-sidebar {
    background: var(--tf-surface);
    border-right: 1px solid var(--tf-border);
    min-height: 100vh;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.tf-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px 24px;
    border-bottom: 1px solid var(--tf-border);
    margin-bottom: 8px;
}

.tf-logo-bolt { font-size: 1.8em; line-height: 1; }

.tf-logo-text {
    font-family: var(--tf-font-display);
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--tf-accent);
    letter-spacing: -0.01em;
}

.tf-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.tf-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--tf-text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.15s;
}

.tf-nav-item svg {
    width: 20px; height: 20px;
    stroke: currentColor; fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    flex-shrink: 0;
}

.tf-nav-item:hover {
    background: var(--tf-surface-2);
    color: var(--tf-text);
    text-decoration: none;
}

.tf-nav-item.active {
    background: var(--tf-accent-light);
    color: var(--tf-accent);
    text-decoration: none;
}

.tf-nav-admin { color: var(--tf-accent-2); }
.tf-nav-admin:hover, .tf-nav-admin.active {
    background: var(--tf-accent-2-light);
    color: var(--tf-accent-2);
}

.tf-sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid var(--tf-border);
    margin-top: 8px;
}

.tf-sidebar-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 2px solid var(--tf-border);
}

.tf-sidebar-info { display: flex; flex-direction: column; }
.tf-sidebar-info strong { font-size: 0.9rem; color: var(--tf-text); }
.tf-sidebar-info small  { font-size: 0.75rem; color: var(--tf-text-muted); }

/* ---- MAIN ---- */
.tf-main {
    padding: 24px;
    border-right: 1px solid var(--tf-border);
    min-height: 100vh;
}

/* ---- COMPOSE ---- */
.tf-compose {
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    padding: 16px;
    margin-bottom: 20px;
}

.tf-compose-header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.tf-compose-header img {
    width: 40px; height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tf-compose-header textarea {
    flex: 1;
    background: var(--tf-surface-2);
    border: 1px solid var(--tf-border);
    border-radius: 10px;
    color: var(--tf-text);
    font-family: var(--tf-font);
    font-size: 0.95rem;
    padding: 12px;
    resize: none;
    min-height: 80px;
    outline: none;
    transition: border-color 0.2s;
}

.tf-compose-header textarea:focus { border-color: var(--tf-accent); }
.tf-compose-header textarea::placeholder { color: var(--tf-text-faint); }

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

.tf-compose-options { display: flex; gap: 8px; align-items: center; }

.tf-compose-opt {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--tf-text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.15s;
    user-select: none;
}

.tf-compose-opt:hover {
    color: var(--tf-accent);
    background: var(--tf-accent-light);
}

.tf-compose-opt svg {
    width: 18px; height: 18px;
    stroke: currentColor; fill: none;
    stroke-width: 2; stroke-linecap: round;
}

.tf-opt-prompt:hover {
    color: var(--tf-accent-2);
    background: var(--tf-accent-2-light);
}

.tf-char-count {
    text-align: right;
    font-size: 0.75rem;
    color: var(--tf-text-faint);
    margin-top: 6px;
}

.tf-prompt-extras, .tf-expire-extras {
    margin-top: 12px;
    padding: 12px;
    background: var(--tf-accent-2-light);
    border: 1px solid rgba(107,63,160,0.2);
    border-radius: 10px;
}

.tf-image-preview {
    position: relative;
    margin-top: 12px;
    display: inline-block;
}

.tf-image-preview img {
    max-height: 200px;
    border-radius: 10px;
    border: 1px solid var(--tf-border);
}

.tf-remove-image {
    position: absolute; top: 6px; right: 6px;
    background: rgba(0,0,0,0.4);
    color: white; border: none;
    border-radius: 50%; width: 24px; height: 24px;
    cursor: pointer; font-size: 1rem; line-height: 1;
}

.tf-think-warning {
    background: #fef5f5;
    border: 1px solid #f5c6c6;
    border-radius: 10px;
    padding: 14px;
    margin-top: 12px;
    text-align: center;
}

.tf-think-icon { font-size: 2em; margin-bottom: 6px; }
.tf-think-warning p { color: var(--tf-danger); margin: 0 0 10px; font-size: 0.9rem; }

/* ---- ETHICS CARD ---- */
.tf-ethics-card {
    background: linear-gradient(135deg, var(--tf-accent-light), var(--tf-accent-2-light));
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    padding: 14px 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.tf-ethics-icon { font-size: 1.8em; flex-shrink: 0; }

.tf-ethics-text { flex: 1; }
.tf-ethics-text strong {
    display: block;
    font-size: 0.78rem;
    color: var(--tf-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 3px;
}
.tf-ethics-text p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--tf-text-muted);
    line-height: 1.4;
}

.tf-ethics-next {
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    color: var(--tf-text-muted);
    border-radius: 8px;
    width: 32px; height: 32px;
    cursor: pointer; font-size: 1rem; flex-shrink: 0;
    transition: all 0.15s;
}

.tf-ethics-next:hover {
    border-color: var(--tf-accent);
    color: var(--tf-accent);
}

/* ---- FEED & POSTS ---- */
.tf-feed { display: flex; flex-direction: column; gap: 16px; }

.tf-post {
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    padding: 18px;
    transition: border-color 0.2s;
    animation: tf-slide-in 0.3s ease;
}

@keyframes tf-slide-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tf-post:hover { border-color: var(--tf-border-2); }

.tf-post-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.tf-post-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    border: 2px solid var(--tf-border);
}

.tf-post-avatar-link { flex-shrink: 0; }

.tf-post-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tf-post-author {
    font-weight: 600;
    color: var(--tf-text);
    text-decoration: none;
    font-size: 0.95rem;
}

.tf-post-author:hover { color: var(--tf-accent); }
.tf-post-time { font-size: 0.78rem; color: var(--tf-text-muted); }

.tf-post-actions { display: flex; gap: 6px; }

.tf-post-flag, .tf-post-delete {
    background: transparent; border: none;
    cursor: pointer; font-size: 1rem;
    opacity: 0.35; padding: 4px;
    border-radius: 6px; transition: opacity 0.15s;
}

.tf-post-flag:hover, .tf-post-delete:hover {
    opacity: 1;
    background: var(--tf-surface-2);
}

.tf-post-prompt-badge {
    display: inline-block;
    background: var(--tf-accent-2-light);
    color: var(--tf-accent-2);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
    border: 1px solid rgba(107,63,160,0.2);
}

.tf-post-prompt-q {
    background: var(--tf-accent-2-light);
    border-left: 3px solid var(--tf-accent-2);
    padding: 10px 14px;
    border-radius: 0 8px 8px 0;
    font-weight: 600;
    color: var(--tf-accent-2);
    margin-bottom: 10px;
    font-size: 0.92rem;
}

.tf-post-content {
    color: var(--tf-text);
    line-height: 1.6;
    font-size: 0.97rem;
    margin-bottom: 12px;
    white-space: pre-wrap;
}

.tf-post-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 12px;
    border: 1px solid var(--tf-border);
}

.tf-post-expire-notice {
    font-size: 0.8rem;
    color: var(--tf-text-muted);
    margin-bottom: 8px;
}

/* Reactions */
.tf-post-reactions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--tf-border);
}

.tf-reaction-bar { position: relative; }

.tf-react-btn {
    background: var(--tf-surface-2);
    border: 1px solid var(--tf-border);
    color: var(--tf-text);
    border-radius: 20px;
    padding: 6px 16px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.15s;
    font-family: var(--tf-font);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tf-react-btn:hover {
    border-color: var(--tf-accent);
    background: var(--tf-accent-light);
}

.tf-react-btn.tf-reacted {
    border-color: var(--tf-accent);
    background: var(--tf-accent-light);
    color: var(--tf-accent);
}

.tf-reaction-picker {
    position: absolute;
    bottom: calc(100% + 8px); left: 0;
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: 40px;
    padding: 10px 14px;
    display: flex;
    gap: 10px;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 8px 28px rgba(44,36,22,0.18);
    animation: tf-pop 0.15s ease;
    white-space: nowrap;
}

@keyframes tf-pop {
    from { opacity: 0; transform: scale(0.85) translateY(4px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.tf-reaction-emoji {
    cursor: pointer;
    font-size: 26px;
    line-height: 1;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Android Emoji", sans-serif;
    transition: transform 0.15s;
    display: inline-block;
    width: 36px;
    height: 36px;
    text-align: center;
    border-radius: 50%;
    padding: 4px 0;
}
.tf-reaction-emoji:hover {
    transform: scale(1.35);
    background: var(--tf-surface-2);
}

.tf-comment-toggle {
    background: transparent;
    border: 1px solid var(--tf-border);
    color: var(--tf-text-muted);
    border-radius: 20px;
    padding: 5px 14px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s;
    font-family: var(--tf-font);
}

.tf-comment-toggle:hover {
    border-color: var(--tf-border-2);
    color: var(--tf-text);
}

/* Comments */
.tf-comments-section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--tf-border);
}

.tf-comment {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.tf-comment img {
    width: 32px; height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tf-comment-body {
    background: var(--tf-surface-2);
    border-radius: 10px;
    padding: 8px 12px;
    flex: 1;
}

.tf-comment-author {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--tf-text);
    margin-right: 8px;
}

.tf-comment-time { font-size: 0.75rem; color: var(--tf-text-muted); }
.tf-comment-text { font-size: 0.9rem; color: var(--tf-text); margin-top: 3px; }

.tf-add-comment { display: flex; gap: 8px; margin-top: 8px; }

.tf-comment-input {
    flex: 1;
    background: var(--tf-surface-2);
    border: 1px solid var(--tf-border);
    border-radius: 10px;
    color: var(--tf-text);
    font-family: var(--tf-font);
    font-size: 0.88rem;
    padding: 8px 12px;
    resize: none;
    outline: none;
    min-height: 40px;
}

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

/* ---- RIGHT PANEL ---- */
.tf-right-panel {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tf-classmates-card, .tf-copyright-card {
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    padding: 16px;
}

.tf-classmates-card h3, .tf-copyright-card h3 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--tf-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 12px;
}

.tf-classmates-list { display: flex; flex-direction: column; gap: 6px; }

.tf-classmate {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--tf-text);
    font-size: 0.88rem;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background 0.15s;
}

.tf-classmate:hover {
    background: var(--tf-surface-2);
    text-decoration: none;
}

.tf-classmate img { width: 30px; height: 30px; border-radius: 50%; }

.tf-copyright-card p {
    font-size: 0.82rem;
    color: var(--tf-text-muted);
    line-height: 1.5;
    margin: 0 0 8px;
}

/* ---- BUTTONS ---- */
.tf-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 10px;
    font-family: var(--tf-font);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}

.tf-btn-primary {
    background: var(--tf-accent);
    color: #fff;
}
.tf-btn-primary:hover {
    background: #a86e12;
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}

.tf-btn-outline {
    background: transparent;
    color: var(--tf-text);
    border: 1px solid var(--tf-border);
}
.tf-btn-outline:hover {
    border-color: var(--tf-accent);
    color: var(--tf-accent);
}

.tf-btn-danger {
    background: #fef5f5;
    color: var(--tf-danger);
    border: 1px solid #f5c6c6;
}
.tf-btn-danger:hover {
    background: var(--tf-danger);
    color: #fff;
}

.tf-btn-sm { padding: 5px 12px; font-size: 0.82rem; border-radius: 8px; }

.tf-load-more { margin: 20px auto 0; display: block; width: fit-content; }

/* ---- INPUTS ---- */
.tf-input {
    width: 100%;
    background: var(--tf-surface-2);
    border: 1px solid var(--tf-border);
    border-radius: 10px;
    color: var(--tf-text);
    font-family: var(--tf-font);
    font-size: 0.9rem;
    padding: 10px 14px;
    outline: none;
}
.tf-input:focus { border-color: var(--tf-accent); }
.tf-select { appearance: none; cursor: pointer; }

/* ---- MODAL ---- */
.tf-modal {
    position: fixed; inset: 0;
    background: rgba(44,36,22,0.5);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
}

.tf-modal-content {
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    padding: 28px;
    width: 440px;
    max-width: 95vw;
    box-shadow: 0 20px 60px rgba(44,36,22,0.2);
}

.tf-modal-content h3 {
    font-family: var(--tf-font-display);
    margin: 0 0 8px;
    font-size: 1.3rem;
}
.tf-modal-content p { color: var(--tf-text-muted); margin-bottom: 16px; }

.tf-flag-reasons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.tf-flag-reason {
    background: var(--tf-surface-2);
    border: 1px solid var(--tf-border);
    color: var(--tf-text);
    border-radius: 8px;
    padding: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: var(--tf-font);
    transition: all 0.15s;
    text-align: left;
}

.tf-flag-reason:hover, .tf-flag-reason.selected {
    border-color: var(--tf-danger);
    color: var(--tf-danger);
    background: #fef5f5;
}

.tf-modal-footer { display: flex; gap: 8px; justify-content: flex-end; }

/* ---- LOADING ---- */
.tf-loading { text-align: center; padding: 40px; color: var(--tf-text-muted); }

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

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

.tf-empty-state {
    color: var(--tf-text-muted);
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
}

.tf-link { color: var(--tf-accent); font-size: 0.82rem; }

/* ---- PROFILE PAGE ---- */
.tf-profile-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 32px 24px;
}

.tf-back-link {
    color: var(--tf-text-muted);
    font-size: 0.88rem;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 20px;
}
.tf-back-link:hover { color: var(--tf-accent); }

.tf-profile-header {
    display: flex;
    gap: 24px;
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--tf-border);
}

.tf-profile-avatar {
    width: 96px; height: 96px;
    border-radius: 50%;
    border: 3px solid var(--tf-accent);
}

.tf-profile-info { flex: 1; }
.tf-profile-info h1 {
    font-family: var(--tf-font-display);
    font-size: 1.6rem;
    margin: 0 0 8px;
}

.tf-profile-stats { display: flex; gap: 24px; margin: 16px 0; }

.tf-stat { display: flex; flex-direction: column; align-items: center; }
.tf-stat strong { font-size: 1.3rem; font-weight: 700; color: var(--tf-accent); }
.tf-stat span { font-size: 0.78rem; color: var(--tf-text-muted); }

.tf-employer-mode-bar {
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    padding: 16px;
    margin-bottom: 24px;
}

.tf-employer-toggle { display: flex; align-items: center; gap: 14px; }

.tf-toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px; height: 26px;
    flex-shrink: 0;
}
.tf-toggle-switch input { display: none; }

.tf-toggle-slider {
    position: absolute; inset: 0;
    background: var(--tf-surface-2);
    border: 1px solid var(--tf-border);
    border-radius: 30px;
    cursor: pointer;
    transition: 0.2s;
}

.tf-toggle-slider::before {
    content: '';
    position: absolute;
    left: 3px; top: 3px;
    width: 18px; height: 18px;
    background: var(--tf-text-muted);
    border-radius: 50%;
    transition: 0.2s;
}

.tf-toggle-switch input:checked + .tf-toggle-slider {
    background: var(--tf-accent-light);
    border-color: var(--tf-accent);
}

.tf-toggle-switch input:checked + .tf-toggle-slider::before {
    transform: translateX(22px);
    background: var(--tf-accent);
}

.tf-employer-label strong { display: block; font-size: 0.9rem; }
.tf-employer-label small  { color: var(--tf-text-muted); font-size: 0.8rem; }

.tf-employer-alert {
    background: var(--tf-accent-light);
    border: 1px solid rgba(200,132,26,0.3);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.88rem;
    color: var(--tf-accent);
    margin-top: 12px;
}

.tf-employer-view .tf-posts-grid {
    filter: blur(4px);
    pointer-events: none;
    position: relative;
}

.tf-employer-view .tf-posts-grid::after {
    content: '👔 How does this profile appear to an outsider?';
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--tf-accent); font-weight: 700; font-size: 1.1rem;
    filter: none; pointer-events: all;
}

.tf-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.tf-profile-post-card {
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: 12px;
    padding: 14px;
    font-size: 0.9rem;
}

.tf-profile-post-card p {
    color: var(--tf-text); margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tf-profile-post-card small { color: var(--tf-text-muted); font-size: 0.78rem; }
.tf-profile-post-img img { width: 100%; height: 140px; object-fit: cover; border-radius: 8px; margin-bottom: 10px; }
.tf-profile-bio { color: var(--tf-text-muted); font-size: 0.9rem; margin: 4px 0; }
.tf-bio-edit #tf-bio-form textarea { min-height: 60px; margin-bottom: 8px; }

/* ---- LOGIN PROMPT ---- */
.tf-login-prompt { text-align: center; padding: 60px; color: var(--tf-text-muted); }

/* ---- ADMIN PANEL ---- */
.tf-admin-panel {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 24px;
}

.tf-admin-panel h1 {
    font-family: var(--tf-font-display);
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.tf-admin-tabs {
    display: flex; gap: 8px;
    margin: 20px 0 0;
    border-bottom: 1px solid var(--tf-border);
}

.tf-admin-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--tf-text-muted);
    font-family: var(--tf-font);
    font-size: 0.92rem; font-weight: 600;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: -1px;
}

.tf-admin-tab.active {
    color: var(--tf-accent);
    border-bottom-color: var(--tf-accent);
}

.tf-admin-section { display: none; padding-top: 20px; }
.tf-admin-section.active { display: block; }
.tf-admin-desc { color: var(--tf-text-muted); font-size: 0.88rem; margin-bottom: 16px; }

.tf-flag-item {
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.tf-flag-content p { font-size: 0.9rem; color: var(--tf-text); margin: 0 0 4px; }
.tf-flag-content small { color: var(--tf-text-muted); font-size: 0.8rem; }
.tf-flag-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* Post management table */
.tf-post-manage-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.tf-post-manage-table th {
    text-align: left;
    padding: 8px 12px;
    background: var(--tf-surface-2);
    border-bottom: 2px solid var(--tf-border);
    color: var(--tf-text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tf-post-manage-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--tf-border);
    vertical-align: middle;
}

.tf-post-manage-table tr:hover td { background: var(--tf-surface-2); }

.tf-post-excerpt {
    max-width: 320px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--tf-text);
}

/* Gradebook */
.tf-gb-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    align-items: start;
    margin-top: 16px;
}

.tf-gb-prompts h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--tf-text-muted);
    margin: 0 0 10px;
    display: flex; align-items: center; gap: 8px;
}

.tf-badge {
    background: var(--tf-surface-2);
    border: 1px solid var(--tf-border);
    color: var(--tf-text-muted);
    font-size: 0.75rem;
    padding: 1px 7px;
    border-radius: 20px;
    font-weight: 500;
}

.tf-gb-prompt-item {
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.tf-gb-prompt-item:hover { border-color: var(--tf-border-2); }
.tf-gb-prompt-item.active {
    border-color: var(--tf-accent);
    background: var(--tf-accent-light);
}

.tf-gb-prompt-title {
    font-size: 0.88rem; font-weight: 600;
    color: var(--tf-text); margin-bottom: 6px; line-height: 1.3;
}

.tf-gb-prompt-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.tf-gb-status {
    font-size: 0.78rem; font-weight: 600;
    padding: 2px 8px; border-radius: 20px;
}

.tf-gb-complete { background: rgba(45,122,79,0.12); color: var(--tf-success); }
.tf-gb-partial  { background: var(--tf-accent-light); color: var(--tf-accent); }
.tf-gb-none     { background: #fef5f5; color: var(--tf-danger); }

.tf-gb-age { font-size: 0.75rem; color: var(--tf-text-muted); }

.tf-gb-progress-bar {
    height: 4px; background: var(--tf-surface-2);
    border-radius: 4px; overflow: hidden;
}

.tf-gb-progress-fill { height: 100%; border-radius: 4px; transition: width 0.4s ease; }
.tf-gb-progress-fill.tf-gb-complete { background: var(--tf-success); }
.tf-gb-progress-fill.tf-gb-partial  { background: var(--tf-accent); }
.tf-gb-progress-fill.tf-gb-none     { width: 0 !important; }

.tf-gb-responses {
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    overflow: hidden;
}

.tf-gb-responses-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--tf-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px; flex-wrap: wrap;
}

.tf-gb-active-prompt strong { display: block; font-size: 0.92rem; color: var(--tf-text); }
.tf-gb-summary { font-size: 0.78rem; color: var(--tf-text-muted); display: block; margin-top: 2px; }

.tf-gb-filter-btns { display: flex; gap: 6px; }

.tf-gb-filter {
    background: var(--tf-surface-2);
    border: 1px solid var(--tf-border);
    color: var(--tf-text-muted);
    font-family: var(--tf-font);
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s;
}

.tf-gb-filter.active, .tf-gb-filter:hover {
    border-color: var(--tf-accent);
    color: var(--tf-accent);
    background: var(--tf-accent-light);
}

.tf-gb-roster { max-height: 600px; overflow-y: auto; }

.tf-gb-row {
    padding: 12px 16px;
    border-bottom: 1px solid var(--tf-border);
    transition: background 0.15s;
}
.tf-gb-row:last-child { border-bottom: none; }
.tf-gb-row:hover { background: var(--tf-surface-2); }

.tf-gb-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tf-gb-row-student { display: flex; align-items: center; gap: 10px; }

.tf-gb-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 2px solid var(--tf-border);
}

.tf-gb-student-info strong { display: block; font-size: 0.9rem; color: var(--tf-text); }
.tf-gb-student-info small  { color: var(--tf-text-muted); font-size: 0.75rem; }

.tf-gb-check { font-size: 0.8rem; color: var(--tf-success); white-space: nowrap; flex-shrink: 0; }

.tf-gb-missing-badge {
    font-size: 0.78rem; color: var(--tf-danger);
    background: #fef5f5; padding: 3px 10px;
    border-radius: 20px; flex-shrink: 0;
}

.tf-gb-response-text {
    margin-top: 8px; margin-left: 44px;
    background: var(--tf-surface-2);
    border-left: 3px solid var(--tf-accent);
    border-radius: 0 8px 8px 0;
    padding: 8px 12px;
    font-size: 0.88rem; color: var(--tf-text); line-height: 1.5;
    white-space: pre-wrap;
}

.tf-gb-row-missing { opacity: 0.65; }

/* Scenarios */
.tf-scenarios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.tf-scenario-card {
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    padding: 20px;
    transition: border-color 0.2s;
}

.tf-scenario-card:hover { border-color: var(--tf-border-2); }
.tf-scenario-icon { font-size: 2em; margin-bottom: 10px; }

.tf-scenario-card h3 {
    font-size: 1rem; margin: 0 0 8px;
    color: var(--tf-accent);
}

.tf-scenario-card p {
    font-size: 0.85rem; color: var(--tf-text-muted);
    line-height: 1.5; margin: 0 0 14px;
}

.tf-scenario-post-btn {
    background: var(--tf-accent-2-light);
    border: 1px solid rgba(107,63,160,0.25);
    color: var(--tf-accent-2);
    font-family: var(--tf-font);
    cursor: pointer; padding: 6px 12px;
    border-radius: 8px; font-size: 0.82rem;
    font-weight: 600; transition: all 0.15s;
}

.tf-scenario-post-btn:hover { background: rgba(107,63,160,0.15); }

.tf-loading-inline { color: var(--tf-text-muted); font-size: 0.9rem; padding: 20px 0; }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
    .tf-app { grid-template-columns: 1fr; }
    .tf-sidebar {
        position: relative; height: auto; min-height: unset;
        flex-direction: row; flex-wrap: wrap;
        border-right: none; border-bottom: 1px solid var(--tf-border);
    }
    .tf-nav { flex-direction: row; }
    .tf-right-panel { display: none; }
    .tf-gb-layout { grid-template-columns: 1fr; }
}

/* ---- TOAST ---- */
.tf-toast {
    position: fixed; bottom: 24px; right: 24px;
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    color: var(--tf-text);
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(44,36,22,0.15);
    font-family: var(--tf-font);
    z-index: 99999; font-size: 0.9rem;
    animation: tf-slide-in 0.3s ease;
}

/* ---- INITIALS AVATAR ---- */
.tf-initials-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    font-family: var(--tf-font-display);
    flex-shrink: 0;
    user-select: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.tf-initials-avatar-large {
    width: 96px;
    height: 96px;
    font-size: 36px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}

/* ---- COLOR PICKER ---- */
.tf-profile-avatar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.tf-color-picker-wrap { text-align: center; }

.tf-color-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--tf-text-muted);
    padding: 5px 10px;
    border: 1px solid var(--tf-border);
    border-radius: 20px;
    background: var(--tf-surface);
    transition: all 0.15s;
}

.tf-color-label:hover { border-color: var(--tf-accent); color: var(--tf-accent); }

.tf-color-label input[type="color"] {
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    background: none;
}

/* ---- WELCOME MODAL ---- */
.tf-welcome-modal {
    z-index: 99999;
    background: rgba(44,36,22,0.6);
    backdrop-filter: blur(4px);
}

.tf-welcome-content {
    max-width: 520px;
    text-align: center;
    padding: 36px 32px;
}

.tf-welcome-emoji {
    font-size: 3rem;
    margin-bottom: 12px;
    line-height: 1;
}

.tf-welcome-content h2 {
    font-family: var(--tf-font-display);
    font-size: 1.7rem;
    margin: 0 0 6px;
    color: var(--tf-text);
}

.tf-welcome-sub {
    color: var(--tf-text-muted);
    font-size: 0.95rem;
    margin: 0 0 24px;
}

.tf-welcome-items {
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: left;
    margin-bottom: 28px;
}

.tf-welcome-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: var(--tf-surface-2);
    border-radius: 12px;
    padding: 12px 14px;
}

.tf-welcome-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.tf-welcome-item strong { display: block; margin-bottom: 3px; font-size: 0.92rem; }
.tf-welcome-item div { font-size: 0.85rem; color: var(--tf-text-muted); line-height: 1.5; }

.tf-welcome-btn {
    font-size: 1rem;
    padding: 12px 32px;
    border-radius: 12px;
}

/* ---- POST AVATAR in feed (initials) ---- */
.tf-post-avatar-wrap {
    flex-shrink: 0;
}

/* ---- CLASSMATES PAGE ---- */
.tf-classmates-main {
    padding: 24px 32px;
    max-width: 720px;
}

.tf-classmates-header {
    margin-bottom: 20px;
}

.tf-classmates-header h1 {
    font-family: var(--tf-font-display);
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.tf-classmates-header p {
    color: var(--tf-text-muted);
    font-size: 0.9rem;
    margin: 0;
}

/* Pending requests banner */
.tf-pending-banner {
    background: var(--tf-accent-light);
    border: 1px solid rgba(200,132,26,.3);
    border-radius: var(--tf-radius);
    padding: 14px 16px;
    margin-bottom: 20px;
}

.tf-pending-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: var(--tf-accent);
}

.tf-pending-count {
    background: var(--tf-accent);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 20px;
}

.tf-pending-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tf-pending-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--tf-surface);
    border-radius: 10px;
    padding: 10px 12px;
}

.tf-pending-info {
    flex: 1;
}

.tf-pending-info strong {
    display: block;
    font-size: 0.9rem;
    color: var(--tf-text);
}

.tf-pending-info small {
    font-size: 0.78rem;
    color: var(--tf-text-muted);
}

.tf-pending-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
}

/* Filter tabs */
.tf-classmates-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--tf-border);
    padding-bottom: 0;
}

.tf-cm-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--tf-text-muted);
    font-family: var(--tf-font);
    font-size: 0.88rem;
    font-weight: 600;
    padding: 8px 14px;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: -1px;
}

.tf-cm-tab.active {
    color: var(--tf-accent);
    border-bottom-color: var(--tf-accent);
}

.tf-cm-tab:hover {
    color: var(--tf-text);
}

/* Classmates grid */
.tf-classmates-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tf-cm-card {
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: border-color 0.15s;
}

.tf-cm-card:hover {
    border-color: var(--tf-border-2);
}

.tf-cm-avatar {
    flex-shrink: 0;
}

.tf-cm-info {
    flex: 1;
}

.tf-cm-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--tf-text);
    margin-bottom: 3px;
}

.tf-cm-profile-link {
    font-size: 0.82rem;
    color: var(--tf-accent);
    text-decoration: none;
}

.tf-cm-profile-link:hover {
    text-decoration: underline;
}

.tf-cm-locked {
    font-size: 0.82rem;
    color: var(--tf-text-muted);
}

.tf-cm-action {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.tf-cm-status {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.tf-cm-friends {
    background: rgba(45,122,79,.1);
    color: var(--tf-success);
}

.tf-cm-pending {
    background: var(--tf-accent-light);
    color: var(--tf-accent);
}

/* ---- v1.7 FIXES ---- */

/* Fix screen width — constrain the app properly */
.tf-app, .tf-app-two-col {
    max-width: 860px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.tf-main {
    max-width: 600px;
    width: 100%;
}

/* Refresh bar */
.tf-refresh-bar {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.tf-refresh-btn {
    font-size: 0.82rem;
    padding: 6px 16px;
    gap: 6px;
    border-radius: 20px;
}

.tf-refresh-btn svg {
    flex-shrink: 0;
}

/* Single reaction button — bigger emoji */
.tf-react-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--tf-surface-2);
    border: 1px solid var(--tf-border);
    color: var(--tf-text);
    border-radius: 20px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.15s;
    font-family: var(--tf-font);
}

.tf-react-emoji {
    font-size: 1.2rem;
    line-height: 1;
}

.tf-react-btn:hover {
    border-color: var(--tf-accent);
    background: var(--tf-accent-light);
}

.tf-react-btn.tf-reacted {
    border-color: var(--tf-accent);
    background: var(--tf-accent-light);
}

/* reaction picker duplicate removed — see primary definition above */

/* Pinned unanswered prompt */
.tf-pinned-prompt {
    border: 2px solid var(--tf-accent-2) !important;
    background: var(--tf-accent-2-light) !important;
    position: relative;
}

.tf-pinned-prompt .tf-post-prompt-badge {
    background: var(--tf-accent-2);
    color: #fff;
    font-size: 0.82rem;
    padding: 4px 12px;
    animation: tf-pulse 2s ease infinite;
}

@keyframes tf-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.7; }
}

.tf-pinned-prompt::before {
    content: '📌 Answer required for a grade';
    display: block;
    background: var(--tf-accent-2);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 16px;
    margin: -18px -18px 14px -18px;
    border-radius: 12px 12px 0 0;
    text-align: center;
    letter-spacing: 0.03em;
}

/* Post detail modal */
.tf-post-modal {
    align-items: flex-start;
    padding-top: 60px;
}

.tf-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: -1;
}

.tf-post-modal-content {
    max-width: 560px;
    width: 95vw;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    padding: 24px;
}

.tf-modal-close {
    position: absolute;
    top: 12px; right: 14px;
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--tf-text-muted);
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s;
}

.tf-modal-close:hover {
    background: var(--tf-surface-2);
    color: var(--tf-text);
}

.tf-modal-post {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--tf-border);
}

.tf-modal-post .tf-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.tf-modal-post-content {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--tf-text);
    white-space: pre-wrap;
    margin-bottom: 10px;
}

.tf-modal-post-img {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 10px;
}

.tf-modal-reactions {
    font-size: 0.85rem;
    color: var(--tf-text-muted);
}

.tf-modal-comments-header {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--tf-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.tf-modal-comments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tf-modal-comment {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.tf-modal-comment-body {
    background: var(--tf-surface-2);
    border-radius: 10px;
    padding: 8px 12px;
    flex: 1;
    font-size: 0.88rem;
}

/* Profile post cards — clickable indicator */
.tf-profile-post-card {
    transition: all 0.15s;
}

.tf-profile-post-card:hover {
    border-color: var(--tf-accent) !important;
    box-shadow: 0 4px 12px rgba(200,132,26,.15);
    transform: translateY(-1px);
}

.tf-profile-post-card::after {
    content: 'Click to view comments';
    display: block;
    font-size: 0.72rem;
    color: var(--tf-text-faint);
    margin-top: 6px;
    opacity: 0;
    transition: opacity 0.15s;
}

.tf-profile-post-card:hover::after {
    opacity: 1;
}

/* ---- PINNED UNANSWERED PROMPTS ---- */
.tf-post-pinned {
    border: 2px solid var(--tf-accent-2) !important;
    background: var(--tf-accent-2-light) !important;
    order: -1;
}

.tf-post-pinned .tf-post-prompt-badge {
    background: var(--tf-accent-2);
    color: #fff;
    font-size: 0.82rem;
    animation: tf-pulse 2s ease infinite;
}

@keyframes tf-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.7; }
}

.tf-post-pinned .tf-add-comment {
    background: rgba(107,63,160,0.06);
    border-radius: 0 0 10px 10px;
    padding: 10px;
    margin: 0 -16px -16px;
}

/* ---- REFRESH NOTICE ---- */
.tf-refresh-notice {
    background: var(--tf-success);
    color: #fff;
    border-radius: var(--tf-radius);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    font-weight: 500;
    animation: tf-slide-in 0.3s ease;
}

.tf-refresh-notice .tf-btn-primary {
    background: #fff;
    color: var(--tf-success);
    font-size: 0.82rem;
    padding: 5px 14px;
}

.tf-refresh-notice .tf-btn-primary:hover {
    background: #f0fff4;
    transform: none;
}

/* ---- REACTION BUTTON — single emoji display ---- */
.tf-react-emoji {
    font-size: 1.2em;
    line-height: 1;
    display: inline-block;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Android Emoji", sans-serif;
}

.tf-react-btn.tf-reacted {
    border-color: var(--tf-accent);
    background: var(--tf-accent-light);
}

/* ---- PROFILE PAGE — clickable post cards ---- */
.tf-profile-post-card {
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.tf-profile-post-card:hover {
    border-color: var(--tf-accent);
    box-shadow: 0 2px 12px rgba(200,132,26,0.12);
}

/* ---- POST MODAL (profile page click-through) ---- */
.tf-post-modal {
    position: fixed;
    inset: 0;
    background: rgba(44,36,22,0.6);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tf-post-modal-content {
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    width: 100%;
    max-width: 580px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 24px;
    position: relative;
    box-shadow: 0 20px 60px rgba(44,36,22,0.25);
}

.tf-post-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: var(--tf-surface-2);
    border: 1px solid var(--tf-border);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tf-text-muted);
    transition: all 0.15s;
}

.tf-post-modal-close:hover {
    background: var(--tf-danger);
    color: #fff;
    border-color: var(--tf-danger);
}

.tf-post-modal-body {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--tf-border);
}

.tf-post-modal-comments {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tf-post-modal-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.tf-modal-reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--tf-surface-2);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--tf-text);
}

.tf-modal-empty {
    color: var(--tf-text-muted);
    font-size: 0.88rem;
    text-align: center;
    padding: 16px;
}

/* ============================================================
   TEACHER TIME — Admin Panel Styles
   ============================================================ */

.tf-tt-tab {
    font-weight: 700;
}

.tf-tt-tab-live {
    color: #fff !important;
    background: var(--tf-danger) !important;
    border-radius: 8px !important;
    padding: 8px 14px !important;
}

.tf-tt-live-dot {
    color: #fff;
    animation: tf-blink 1s step-start infinite;
    margin-left: 4px;
}

@keyframes tf-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

.tf-tt-hero {
    text-align: center;
    padding: 32px 20px 24px;
}

.tf-tt-hero-icon {
    font-size: 3.5rem;
    margin-bottom: 12px;
    line-height: 1;
}

.tf-tt-hero h2 {
    font-family: var(--tf-font-display);
    font-size: 1.6rem;
    margin: 0 0 8px;
}

.tf-tt-hero p {
    color: var(--tf-text-muted);
    font-size: 0.9rem;
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.5;
}

.tf-tt-setup {
    max-width: 520px;
    margin: 0 auto;
    padding: 24px;
    background: var(--tf-surface);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
}

.tf-tt-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
}

.tf-tt-checkbox-label input { cursor: pointer; width: 18px; height: 18px; }

.tf-tt-option-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.tf-tt-option-letter {
    width: 28px; height: 28px;
    background: var(--tf-accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.tf-tt-start-btn {
    width: 100%;
    margin-top: 20px;
    padding: 14px;
    font-size: 1.05rem;
    font-weight: 700;
    background: var(--tf-danger);
    color: #fff;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.tf-tt-start-btn:hover { background: #a02020; transform: translateY(-1px); }
.tf-tt-start-btn:disabled { opacity: 0.6; transform: none; cursor: wait; }

.tf-tt-active-header {
    text-align: center;
    padding: 32px 20px;
}

.tf-tt-live-badge {
    display: inline-block;
    background: var(--tf-danger);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 6px 18px;
    border-radius: 20px;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
    animation: tf-pulse 1.5s ease infinite;
}

.tf-tt-active-sub {
    color: var(--tf-text-muted);
    margin: 0 0 12px;
}

.tf-tt-end-btn {
    background: var(--tf-success);
    color: #fff;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    padding: 12px 32px;
    border-radius: 12px;
    cursor: pointer;
    margin-top: 12px;
    transition: all 0.15s;
}

.tf-tt-end-btn:hover { background: #1d5e38; }
.tf-tt-end-btn:disabled { opacity: 0.6; cursor: wait; }

.tf-tt-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 24px 0 16px;
    padding-top: 24px;
    border-top: 1px solid var(--tf-border);
}

.tf-tt-results-header h3 { margin: 0; font-size: 1rem; }

.tf-tt-total {
    font-size: 0.85rem;
    color: var(--tf-text-muted);
    background: var(--tf-surface-2);
    padding: 3px 12px;
    border-radius: 20px;
}

.tf-tt-results-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tf-tt-result-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tf-tt-result-label {
    min-width: 140px;
    font-size: 0.9rem;
    color: var(--tf-text);
    flex-shrink: 0;
}

.tf-tt-bar-wrap {
    flex: 1;
    height: 28px;
    background: var(--tf-surface-2);
    border-radius: 6px;
    overflow: hidden;
}

.tf-tt-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--tf-accent), #e8a020);
    border-radius: 6px;
    min-width: 4px;
}

.tf-tt-result-count {
    min-width: 70px;
    text-align: right;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--tf-text);
    flex-shrink: 0;
}

.tf-tt-result-count small { color: var(--tf-text-muted); font-weight: 400; }

/* ============================================================
   TEACHER TIME — Student Overlay (appears on feed page)
   ============================================================ */

.tf-teacher-time-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 10, 5, 0.94);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: tf-overlay-in 0.4s ease;
}

@keyframes tf-overlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.tf-tt-overlay-inner {
    max-width: 560px;
    width: 100%;
    text-align: center;
}

.tf-tt-overlay-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    animation: tf-teacher-pulse 2s ease infinite;
}

@keyframes tf-teacher-pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.08); }
}

.tf-tt-overlay-title {
    font-family: var(--tf-font-display);
    font-size: 2rem;
    color: #fff;
    margin: 0 0 8px;
    font-weight: 400;
}

.tf-tt-overlay-sub {
    color: rgba(255,255,255,0.5);
    font-size: 0.95rem;
    margin: 0 0 32px;
}

/* Poll card inside overlay */
.tf-tt-poll-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 28px;
    margin-top: 8px;
    text-align: left;
}

.tf-tt-poll-question {
    font-size: 1.15rem;
    color: #fff;
    font-weight: 600;
    margin-bottom: 20px;
    line-height: 1.4;
    text-align: center;
}

.tf-tt-poll-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tf-tt-poll-option {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.06);
    border: 2px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.15s;
    color: rgba(255,255,255,0.9);
    font-size: 0.95rem;
    font-family: var(--tf-font);
    text-align: left;
    width: 100%;
}

.tf-tt-poll-option:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.3);
}

.tf-tt-poll-option.selected {
    background: rgba(200, 132, 26, 0.25);
    border-color: var(--tf-accent);
    color: #fff;
}

.tf-tt-poll-option .tf-tt-opt-letter {
    width: 30px; height: 30px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.tf-tt-poll-option.selected .tf-tt-opt-letter {
    background: var(--tf-accent);
    color: #fff;
}

.tf-tt-voted-msg {
    text-align: center;
    margin-top: 14px;
    font-size: 0.85rem;
    color: var(--tf-accent);
}

.tf-tt-change-vote {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: underline;
    font-family: var(--tf-font);
    margin-top: 4px;
    display: block;
    width: 100%;
    text-align: center;
}

.tf-tt-change-vote:hover { color: rgba(255,255,255,0.7); }
