#startup-loader{
    position:fixed;
    inset:0;
    background:#0f172a;
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    z-index:999999;
}

#startup-loader .logo{
    font-size:50px;
    color:#7c5cff;
    margin-bottom:20px;
}

#startup-loader .spinner{
    width:48px;
    height:48px;
    border:4px solid rgba(255,255,255,.15);
    border-top-color:#7c5cff;
    border-radius:50%;
    animation:spin .8s linear infinite;
}

#startup-loader p{
    margin-top:18px;
    color:white;
    font-size:15px;
}

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

#startup-loader.hide{
    opacity:0;
    transition:.3s;
    pointer-events:none;
}
/* ===== Global Action Loader ===== */

.action-loader{
    position:fixed;
    inset:0;
    display:flex;
    justify-content:center;
    align-items:center;
    background:rgba(8,10,20,.55);
    backdrop-filter:blur(8px);
    z-index:999999;
    opacity:1;
    transition:.25s ease;
}

.action-loader.hidden{
    opacity:0;
    visibility:hidden;
    pointer-events:none;
}

.loader-card{
    width:280px;
    padding:30px;
    border-radius:22px;
    text-align:center;

    background:rgba(24,26,40,.95);
    border:1px solid rgba(255,255,255,.08);

    box-shadow:
        0 25px 70px rgba(0,0,0,.4),
        0 0 35px rgba(124,92,255,.18);
}

.loader-card h3{
    margin-top:20px;
    margin-bottom:8px;
    color:white;
}

.loader-card p{
    color:#b7bfd5;
    margin:0;
}

.loader-spinner{
    width:60px;
    height:60px;
    margin:auto;

    border-radius:50%;
    border:5px solid rgba(255,255,255,.12);
    border-top-color:#7c5cff;

    animation:spin .8s linear infinite;
}

@keyframes spin{
    to{
        transform:rotate(360deg);
    }
}
.ai-warning { display: block; }
.ai-warning { background: #fff8e6; border: 1px solid #ffebc2; color: #7a5b00; border-radius: 12px; font-size: 13px; }
.ai-warning strong { margin-right: 6px; }
:root {
  --bg: #f7f7fb;
  --panel: #ffffff;
  --ink: #1f2440;
  --muted: #727892;
  --line: #e8e9f2;
  --brand: #6954df;
  --brand-deep: #4e3bb6;
  --brand-soft: #f0edff;
  --teal: #18a999;
  --orange: #f59342;
  --shadow: 0 10px 30px rgba(40, 38, 78, .08);
  --radius: 18px;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--ink); font-family: "DM Sans", sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(105,84,223,.32); outline-offset: 2px; }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 768px) { .auth-shell { grid-template-columns: minmax(0, 1fr) minmax(380px, .65fr); } }
.auth-art { padding: 58px clamp(30px, 7vw, 120px); background: radial-gradient(circle at 12% 20%, #9c8cff 0, transparent 32%), linear-gradient(135deg, #413492, #5d50ce 54%, #8e7dff); color: white; position: relative; overflow: hidden; }
.auth-art:after { content: ""; position: absolute; width: 480px; height: 480px; border: 1px solid rgba(255,255,255,.21); border-radius: 52% 48% 42% 58%; bottom: -235px; right: -110px; transform: rotate(-20deg); }
.brand { align-items: center; color: inherit; display: inline-flex; font-family: "Plus Jakarta Sans", sans-serif; font-size: 20px; font-weight: 800; gap: 10px; letter-spacing: -.6px; }
.brand-mark { align-items: center; background: var(--brand); border-radius: 10px; color: white; display: inline-flex; font-size: 17px; height: 34px; justify-content: center; width: 34px; }
.auth-art .brand-mark { background: rgba(255,255,255,.18); }
.auth-copy { max-width: 510px; margin-top: clamp(90px, 17vh, 160px); position: relative; z-index: 1; }
.eyebrow { color: var(--brand); font-size: 12px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.auth-art .eyebrow { color: #d9d4ff; }
h1, h2, h3, p { margin-top: 0; }
.auth-copy h1 { font-family: "Plus Jakarta Sans", sans-serif; font-size: clamp(38px, 4.6vw, 62px); letter-spacing: -2.8px; line-height: 1.08; margin: 14px 0 20px; }
.auth-copy p { color: #e0dcff; font-size: 18px; line-height: 1.65; }
.feature-pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.feature-pills span { background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 9px 13px; }
.auth-form-wrap { align-items: center; background: white; display: flex; justify-content: center; padding: 36px; }
.auth-card { max-width: 390px; width: 100%; }
.auth-card h2 { font-family: "Plus Jakarta Sans", sans-serif; font-size: 31px; letter-spacing: -1.25px; margin: 32px 0 8px; }
.subtext { color: var(--muted); line-height: 1.55; }
.form-stack { display: grid; gap: 17px; margin-top: 28px; }
label { color: #414762; display: grid; font-size: 13px; font-weight: 700; gap: 7px; }
input, textarea, select { background: #fff; border: 1px solid #dfe1eb; border-radius: 10px; color: var(--ink); outline: none; padding: 12px 13px; transition: border .15s, box-shadow .15s; width: 100%; }
input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(105,84,223,.1); }
textarea { min-height: 105px; resize: vertical; }
.button { align-items: center; border: 0; border-radius: 10px; display: inline-flex; font-weight: 700; gap: 8px; justify-content: center; min-height: 42px; padding: 0 15px; transition: transform .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--brand); color: white; }
.button-primary:hover { background: var(--brand-deep); }
.button-secondary { background: var(--brand-soft); color: var(--brand-deep); }
.button-ghost { background: transparent; color: var(--muted); }
.button-danger { background: #fff0f0; color: #c95050; }
.button.wide { width: 100%; }
.auth-switch { color: var(--muted); font-size: 14px; margin-top: 21px; text-align: center; }
  .text-link { background: transparent; border: 0; color: var(--brand); cursor: pointer; font-weight: 700; padding: 0; }

.app-shell { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
@media (min-width: 769px) { .app-shell { grid-template-columns: 252px minmax(0, 1fr); } }
.sidebar { background: #20233d; color: #aeb3d0; display: flex; flex-direction: column; min-height: 100vh; padding: 25px 14px; position: sticky; top: 0; }
@media (max-width: 768px) { .sidebar { display: none; position: fixed; top: 0; left: 0; width: 252px; height: 100vh; z-index: 100; box-shadow: 2px 0 8px rgba(0,0,0,0.2); } .sidebar.mobile-open { display: flex; } }
.sidebar .brand { color: #fff; margin: 0 12px 36px; }
.sidebar .brand-mark { background: #7d6cf0; }
.nav-group { display: grid; gap: 4px; }
.nav-label { color: #777d9f; font-size: 10px; font-weight: 700; letter-spacing: .11em; margin: 20px 12px 7px; text-transform: uppercase; }
.nav-item { align-items: center; background: transparent; border: 0; border-radius: 9px; color: inherit; display: flex; font-size: 14px; font-weight: 600; gap: 11px; padding: 11px 12px; text-align: left; width: 100%; }
.nav-item:hover { background: rgba(255,255,255,.05); color: white; }
.nav-item.active { background: #323554; color: #fff; }
.nav-icon { font-size: 17px; line-height: 1; width: 18px; }
.sidebar-spacer { flex: 1; }
.help-card { background: linear-gradient(145deg, #38335e, #292c4a); border-radius: 13px; color: #e4e2fa; margin: 12px 3px 16px; padding: 16px; }
.help-card h3 { font-size: 13px; margin-bottom: 7px; }.help-card p { color: #bbb8db; font-size: 12px; line-height: 1.4; margin-bottom: 12px; }
.help-card button { background: rgba(255,255,255,.13); color: white; font-size: 12px; min-height: 32px; width: 100%; }
.profile-bar { align-items: center; border-top: 1px solid #343752; display: flex; gap: 10px; padding: 17px 10px 0; }
.avatar { align-items: center; background: #f1e4cb; border-radius: 50%; color: #85662e; display: flex; flex: 0 0 auto; font-size: 12px; font-weight: 800; height: 33px; justify-content: center; width: 33px; }
.profile-name { color: #fff; font-size: 12px; font-weight: 700; }.profile-role { color: #9297b8; font-size: 11px; margin-top: 2px; }
.profile-menu { background: transparent; border: 0; color: #c5c9df; font-size: 20px; margin-left: auto; }

.main { min-width: 0; }.topbar { align-items: center; background: rgba(247,247,251,.94); display: flex; gap: 18px; justify-content: space-between; padding: 22px clamp(20px, 4vw, 55px) 15px; position: sticky; top: 0; z-index: 5; }
.breadcrumbs { color: var(--muted); font-size: 13px; }.breadcrumbs strong { color: var(--ink); }.top-actions { align-items: center; display: flex; gap: 12px; }.icon-button { background: white; border: 1px solid var(--line); border-radius: 10px; color: #555a74; height: 40px; width: 40px; }
.page { margin: 0 auto; max-width: 1440px; padding: 21px clamp(20px, 4vw, 55px) 52px; }
.page-heading { align-items: flex-end; display: flex; gap: 20px; justify-content: space-between; margin-bottom: 27px; }.page-heading h1 { font-family: "Plus Jakarta Sans", sans-serif; font-size: 29px; letter-spacing: -1.3px; margin: 5px 0 0; }.page-heading p { color: var(--muted); font-size: 14px; margin: 7px 0 0; }
.metric-grid { display: grid; gap: 17px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }.metric { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }.metric-row { align-items: center; display: flex; justify-content: space-between; }.metric-icon { align-items: center; background: var(--brand-soft); border-radius: 10px; display: flex; font-size: 18px; height: 38px; justify-content: center; width: 38px; }.metric-icon.teal { background: #dcf8f4; }.metric-icon.orange { background: #fff0df; }.metric-icon.pink { background: #ffe9f0; }.metric-label { color: var(--muted); font-size: 12px; font-weight: 700; margin-top: 14px; }.metric-value { font-family: "Plus Jakarta Sans", sans-serif; font-size: 28px; font-weight: 800; letter-spacing: -1px; margin-top: 3px; }.metric-trend { color: var(--teal); font-size: 11px; font-weight: 700; }.metric-trend.neutral { color: var(--muted); }
.content-grid { display: grid; gap: 22px; grid-template-columns: 1fr; margin-top: 26px; }
@media (min-width: 1024px) { .content-grid { grid-template-columns: minmax(0, 1.55fr) minmax(280px, .72fr); } }.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }.card-head { align-items: center; display: flex; justify-content: space-between; padding: 19px 20px 10px; }.card h2 { font-family: "Plus Jakarta Sans", sans-serif; font-size: 16px; letter-spacing: -.4px; margin: 0; }.small-link { background: transparent; border: 0; color: var(--brand); font-size: 12px; font-weight: 700; }
.group-list { display: grid; gap: 10px; padding: 9px 13px 15px; }.group-row { align-items: center; border-radius: 12px; display: flex; gap: 12px; padding: 11px; transition: background .15s; }.group-row:hover { background: #f8f7ff; }.group-cover { align-items: center; border-radius: 11px; color: white; display: flex; font-weight: 700; height: 45px; justify-content: center; width: 45px; }.group-cover.violet { background: linear-gradient(140deg, #8c76ff, #6051cc); }.group-cover.teal { background: linear-gradient(140deg, #49cbbc, #209d9b); }.group-cover.orange { background: linear-gradient(140deg, #ffae5c, #ee7d47); }.group-row-title { font-size: 13px; font-weight: 700; }.group-row-sub { color: var(--muted); font-size: 11px; margin-top: 3px; }.arrow { color: #b6bad0; font-size: 20px; margin-left: auto; }
.activity-list { display: grid; padding: 5px 20px 15px; }.activity { align-items: flex-start; border-bottom: 1px solid #f0f0f5; display: flex; gap: 10px; padding: 13px 0; }.activity:last-child { border-bottom: 0; }.activity-dot { background: var(--brand-soft); border-radius: 50%; font-size: 13px; height: 29px; padding-top: 6px; text-align: center; width: 29px; }.activity-copy { color: #4e536c; font-size: 12px; line-height: 1.4; }.activity-copy strong { color: var(--ink); }.activity-time { color: #a2a6b7; font-size: 10px; margin-top: 3px; }
.study-nudge { background: linear-gradient(135deg, #5f51cb, #8777eb); border-radius: var(--radius); box-shadow: 0 12px 26px rgba(82,68,185,.25); color: white; overflow: hidden; padding: 24px; position: relative; }.study-nudge:after { content: "✦"; color: rgba(255,255,255,.12); font-size: 145px; position: absolute; right: -12px; top: -38px; }.study-nudge > * { position: relative; z-index: 1; }.study-nudge h2 { font-size: 21px; line-height: 1.25; max-width: 210px; }.study-nudge p { color: #dfdbff; font-size: 13px; line-height: 1.55; margin: 11px 0 18px; max-width: 260px; }.study-nudge .button { background: white; color: var(--brand-deep); }

.group-hero { background: linear-gradient(130deg, #f1efff, #faf9ff 55%, #e1fbf7); border: 1px solid #e1ddfa; border-radius: 20px; overflow: hidden; padding: 29px; position: relative; }.group-hero:after { content: ""; border: 46px solid rgba(105,84,223,.08); border-radius: 50%; height: 170px; position: absolute; right: -76px; top: -73px; width: 170px; }.group-hero .eyebrow { color: #6f62b8; }.group-hero h1 { font-family: "Plus Jakarta Sans", sans-serif; font-size: 28px; letter-spacing: -1.4px; margin: 7px 0; }.group-hero p { color: #666a84; line-height: 1.55; margin: 0; max-width: 600px; }.hero-meta { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 20px; }.chip { background: white; border: 1px solid #e9e6f6; border-radius: 999px; color: #5e6380; font-size: 12px; font-weight: 700; padding: 7px 11px; }.tabs { border-bottom: 1px solid var(--line); display: flex; gap: 20px; margin-top: 25px; overflow-x: auto; }.tab { background: transparent; border: 0; color: var(--muted); font-size: 13px; font-weight: 700; padding: 0 2px 12px; white-space: nowrap; }.tab.active { border-bottom: 2px solid var(--brand); color: var(--brand); }
.section-heading { align-items: center; display: flex; justify-content: space-between; margin: 27px 0 15px; }.section-heading h2 { font-family: "Plus Jakarta Sans", sans-serif; font-size: 18px; margin: 0; }.section-heading p { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.resource-grid { display: grid; gap: 15px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }.resource-card { background: white; border: 1px solid var(--line); border-radius: 15px; padding: 17px; }.resource-top { align-items: flex-start; display: flex; justify-content: space-between; }.file-icon { align-items: center; background: #fff0ec; border-radius: 9px; color: #ec715e; display: flex; font-size: 11px; font-weight: 800; height: 38px; justify-content: center; width: 38px; }.file-icon.docx { background: #eaf3ff; color: #5686d9; }.file-icon.file { background: #f3efff; color: var(--brand); }.resource-menu { color: #9ea2b5; }.resource-card h3 { font-size: 14px; line-height: 1.35; margin: 16px 0 6px; }.resource-card p { color: var(--muted); font-size: 12px; line-height: 1.5; margin-bottom: 12px; min-height: 36px; }.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }.tag { background: #f5f5fa; border-radius: 6px; color: #71758d; font-size: 10px; font-weight: 700; padding: 4px 6px; }.resource-footer { align-items: center; border-top: 1px solid #f0f0f5; color: #979bac; display: flex; font-size: 11px; gap: 9px; margin-top: 16px; padding-top: 12px; }.resource-footer span:last-child { margin-left: auto; }
.assignment-list { display: grid; gap: 11px; }.assignment { align-items: center; background: white; border: 1px solid var(--line); border-radius: 13px; display: flex; gap: 14px; padding: 14px; }.assignment-date { background: #fff0f0; border-radius: 10px; color: #d15858; font-size: 11px; font-weight: 800; padding: 9px 7px; text-align: center; width: 52px; }.assignment-title { font-size: 13px; font-weight: 700; }.assignment-sub { color: var(--muted); font-size: 11px; margin-top: 4px; }.assignment .button { font-size: 12px; margin-left: auto; min-height: 34px; }
.discussion-list { display: grid; gap: 14px; }.discussion { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 17px; }.discussion-meta { align-items: center; color: var(--muted); display: flex; font-size: 11px; gap: 7px; }.discussion h3 { font-size: 15px; margin: 10px 0 7px; }.discussion p { color: #666b83; font-size: 13px; line-height: 1.55; margin: 0; }.discussion-replies { color: var(--brand); font-size: 11px; font-weight: 700; margin-top: 12px; }.pinned { background: #fff6dc; border-radius: 5px; color: #b17a18; font-size: 10px; font-weight: 700; padding: 3px 5px; }

/* Comment / reply thread styles */
.comment-thread { margin-top: 14px; display: grid; gap: 12px; padding-left: 8px; border-left: 2px solid #f0eff8; }
.comment-item { display: flex; gap: 12px; align-items: flex-start; }
.comment-avatar { align-items: center; background: #f1eefc; border-radius: 50%; color: #5b3fb8; display: inline-flex; font-weight: 800; height: 34px; justify-content: center; width: 34px; font-size: 12px; }
.comment-body { background: #fbfbfe; border: 1px solid #f0eff8; border-radius: 12px; padding: 10px 12px; flex: 1; }
.comment-meta { color: var(--muted); display: flex; gap: 8px; font-size: 12px; margin-bottom: 6px; align-items: center; }
.discussion-actions { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
.discussion-actions .reply-link { background: transparent; border: 0; color: var(--brand); cursor: pointer; font-weight: 700; }
.inline-reply-form { display: flex; gap: 8px; margin-top: 12px; }
.inline-reply-form input { flex: 1; padding: 10px 12px; border-radius: 10px; border: 1px solid #e9e6f6; }
.inline-reply-form .button { min-height: 36px; padding: 0 12px; }
.no-comments { color: var(--muted); font-size: 13px; margin-top: 10px; }

.study-layout { display: grid; gap: 20px; grid-template-columns: minmax(280px, .72fr) minmax(0, 1.3fr); }.study-panel { padding: 21px; }.study-panel h2 { font-family: "Plus Jakarta Sans", sans-serif; font-size: 19px; letter-spacing: -.6px; }.action-choice { background: white; border: 1px solid var(--line); border-radius: 10px; color: #5d627b; display: flex; font-size: 12px; font-weight: 700; gap: 9px; padding: 11px; text-align: left; width: 100%; }.action-choice + .action-choice { margin-top: 8px; }.action-choice.active { background: var(--brand-soft); border-color: #cfc6ff; color: var(--brand-deep); }.study-answer { min-height: 510px; padding: 25px; display: flex; flex-direction: column; gap: 18px; }.message-list { display: grid; gap: 14px; max-height: calc(100vh - 360px); overflow-y: auto; padding-right: 4px; }.message { border-radius: 16px; padding: 18px; position: relative; max-width: 100%; word-break: break-word; background: #f7f7fb; }.message.user { background: #dfe7ff; justify-self: end; }.message.assistant { background: #ffffff; }.message-label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .03em; margin-bottom: 10px; text-transform: uppercase; }.message.thinking { opacity: 0.8; }
.thinking-buffer { align-items: center; display: inline-flex; gap: 10px; color: var(--brand-deep); font-weight: 700; }
.spinner-small { animation: spin .8s linear infinite; border: 3px solid #e7e2ff; border-radius: 50%; border-top-color: var(--brand); height: 14px; width: 14px; display: inline-block; }
.empty-study { align-items: center; color: var(--muted); display: flex; flex-direction: column; height: 420px; justify-content: center; text-align: center; }.empty-study .spark { align-items: center; background: var(--brand-soft); border-radius: 17px; display: flex; font-size: 28px; height: 64px; justify-content: center; margin-bottom: 16px; width: 64px; }.empty-study h2 { color: var(--ink); font-family: "Plus Jakarta Sans", sans-serif; font-size: 19px; margin-bottom: 8px; }.empty-study p { font-size: 13px; line-height: 1.55; max-width: 340px; }.answer-title { align-items: center; display: flex; gap: 10px; }.answer-title .spark-mini { background: var(--brand-soft); border-radius: 8px; font-size: 17px; padding: 7px; }.answer-title h2 { font-family: "Plus Jakarta Sans", sans-serif; font-size: 18px; margin: 0; }.answer-copy { color: #484e68; font-size: 14px; line-height: 1.8; margin: 25px 0; max-width: 710px; }.source-list { border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; padding-top: 16px; }.source-list span { background: #f5f4fb; border-radius: 7px; color: #666b84; font-size: 11px; font-weight: 700; padding: 7px 9px; }.flashcard { background: linear-gradient(140deg, #f8f7ff, #fff); border: 1px solid #e4dffc; border-radius: 14px; margin-top: 12px; padding: 15px; }.flashcard small { color: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }.flashcard h3 { font-size: 14px; margin: 8px 0; }.flashcard p { color: #5f657d; font-size: 13px; line-height: 1.5; margin: 0; }.quiz-question { border-bottom: 1px solid var(--line); padding: 19px 0; }.quiz-question:first-of-type { padding-top: 25px; }.quiz-question h3 { font-size: 14px; margin: 0 0 11px; }.quiz-option { background: #fafafd; border: 1px solid #e7e7ee; border-radius: 8px; color: #5d627a; display: block; font-size: 12px; margin-top: 7px; padding: 9px; }.plan-item { align-items: flex-start; border-left: 2px solid #cabfff; display: flex; gap: 14px; padding: 0 0 20px 15px; }.plan-item:last-of-type { padding-bottom: 0; }.plan-item strong { color: var(--brand-deep); display: block; font-size: 12px; }.plan-item p { color: #5f657e; font-size: 13px; line-height: 1.5; margin: 5px 0 0; }

.modal-backdrop { align-items: center; background: rgba(25,28,51,.45); display: flex; inset: 0; justify-content: center; padding: 20px; position: fixed; z-index: 20; }
.modal { background: white; border-radius: 18px; box-shadow: 0 20px 60px rgba(20,20,49,.25); max-height: calc(100vh - 40px); max-width: 510px; overflow-y: auto; padding: 25px; width: 100%; }
@media (max-width: 640px) { 
  .modal { max-width: calc(100% - 32px); max-height: calc(100vh - 60px); padding: 20px; } 
  #public-results { max-height: calc(100vh - 300px) !important; } 
}.modal-head { align-items: flex-start; display: flex; justify-content: space-between; }.modal h2 { font-family: "Plus Jakarta Sans", sans-serif; font-size: 20px; margin: 0; }.modal p { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 6px 0 0; }.close { background: transparent; border: 0; color: #9da0b3; font-size: 22px; line-height: 1; }.form-row { display: grid; gap: 13px; grid-template-columns: 1fr 1fr; }.modal .form-stack { margin-top: 21px; }.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 23px; }.file-drop { align-items: center; background: #faf9ff; border: 1px dashed #c8bfff; border-radius: 10px; color: #686e87; cursor: pointer; display: flex; font-size: 12px; font-weight: 700; gap: 10px; padding: 14px; }.file-drop input { display: none; }.file-name { color: var(--brand); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast-region { bottom: 24px; display: grid; gap: 9px; position: fixed; right: 24px; z-index: 40; }.toast { animation: pop .2s ease; background: #282c49; border-radius: 10px; box-shadow: 0 10px 26px rgba(30,31,61,.21); color: white; font-size: 13px; padding: 13px 16px; }.toast.error { background: #b84e57; }@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.empty { background: white; border: 1px dashed #daddeb; border-radius: 13px; color: var(--muted); font-size: 13px; padding: 28px; text-align: center; }
.loading { align-items: center; color: var(--muted); display: flex; justify-content: center; min-height: 260px; }.spinner { animation: spin .8s linear infinite; border: 3px solid #e7e2ff; border-radius: 50%; border-top-color: var(--brand); height: 24px; margin-right: 10px; width: 24px; }@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 480px) { .metric-grid { grid-template-columns: 1fr; }.content-grid, .study-layout { grid-template-columns: 1fr; }.study-answer { min-height: auto; }.help-card { display: none; } }

@media (min-width: 481px) {
  .study-layout { display: grid !important; grid-template-columns: minmax(280px, .72fr) minmax(0, 1.3fr) !important; gap: 20px; align-items: start; }
  .study-layout > .study-panel { grid-column: 1; }
  .study-layout > .study-answer { grid-column: 2; }
}

/* Comprehensive mobile responsive styles for all components */
@media (max-width: 480px) {
  /* Prevent horizontal scroll */
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* Typography */
  h1 { font-size: 1.5rem !important; }
  h2 { font-size: 1.2rem !important; }
  h3 { font-size: 1.1rem !important; }
  p { font-size: 14px; }

  /* Forms */
  input, textarea, select {
    font-size: 16px; /* Prevents iOS zoom */
    min-height: 44px;
    width: 100%;
  }

  label {
    font-size: 13px;
    margin-bottom: 6px;
  }

  .form-stack {
    gap: 14px;
  }

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

  /* Buttons */
  .button {
    min-height: 44px;
    width: 100%;
    font-size: 13px;
  }

  .button:not(.icon-button) {
    padding: 12px;
  }

  /* Modals */
  .modal {
    margin: 10px;
    max-width: calc(100vw - 20px);
    width: auto;
    padding: 16px;
    border-radius: 16px;
  }

  .modal-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .close {
    position: absolute;
    top: 12px;
    right: 12px;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions .button {
    width: 100%;
  }

  .modal-actions .button + .button {
    margin-bottom: 8px;
    margin-top: 0;
  }

  /* Cards and containers */
  .card,
  .resource-card,
  .discussion,
  .assignment {
    padding: 14px;
    margin-bottom: 12px;
  }

  .card-head,
  .section-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  /* Grids */
  .metric-grid,
  .content-grid,
  .resource-grid,
  .assignment-list,
  .discussion-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Study layout */
  .study-layout {
    grid-template-columns: 1fr;
  }

  .study-panel {
    position: static !important;
  }

  .study-answer {
    min-height: auto;
    padding: 14px;
  }

  .message-list {
    max-height: none;
  }

  /* Top actions */
  .topbar {
    flex-wrap: wrap;
    gap: 12px;
  }

  .breadcrumbs {
    order: 2;
    width: 100%;
    font-size: 12px;
  }

  .top-actions {
    order: 1;
    width: 100%;
    justify-content: space-between;
  }

  /* Groups and rows */
  .group-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .group-cover {
    height: 40px;
    width: 40px;
  }

  .arrow {
    order: -1;
    margin-left: 0;
    margin-right: auto;
  }

  /* Hero sections */
  .group-hero {
    padding: 16px;
    border-radius: 18px;
  }

  .group-hero h1 {
    font-size: 1.3rem;
  }

  .group-hero p {
    font-size: 12px;
  }

  .hero-meta {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .hero-meta .chip {
    width: 100%;
  }

  /* Tabs */
  .tabs {
    gap: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab {
    white-space: nowrap;
    font-size: 11px;
    padding: 0 8px 10px;
  }

  /* Resource footer */
  .resource-footer {
    flex-direction: column;
    gap: 8px;
  }

  .resource-footer span:last-child {
    margin-left: 0;
  }

  .resource-footer .button {
    width: 100%;
  }

  /* Assignments */
  .assignment {
    flex-direction: column;
  }

  .assignment .button {
    width: 100%;
    margin-left: 0;
    margin-top: 10px;
  }

  /* Discussions */
  .discussion-meta {
    font-size: 10px;
    flex-wrap: wrap;
  }

  .discussion-actions {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .reply-link {
    width: 100%;
  }

  .comment-item {
    flex-direction: column;
  }

  .comment-avatar {
    display: none;
  }

  .comment-thread {
    margin-left: 8px;
    padding-left: 8px;
    gap: 10px;
  }

  .inline-reply-form {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .inline-reply-form input {
    width: 100%;
  }

  .inline-reply-form .button {
    width: 100%;
  }

  /* Tags and chips */
  .tag {
    font-size: 8px;
    padding: 4px 6px;
  }

  /*.chip {
    font-size: 11px;
    padding: 6px 10px;
    position: relative;
  }*/

 /* .invite-code {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }*/

  /* Messages */
  .message {
    padding: 12px;
    margin-bottom: 8px;
  }

  .message-list {
    gap: 10px;
  }

  /* Response content */
  .study-response {
    font-size: 12px;
  }

  .study-response h3 {
    font-size: 15px;
    margin: 14px 0 8px;
  }

  .study-response h4 {
    font-size: 11px;
  }

  .study-response ul,
  .study-response ol {
    padding: 8px 12px 8px 24px;
    margin: 8px 0 12px;
  }

  .study-response pre {
    padding: 10px;
    font-size: 11px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .study-response code {
    font-size: 10px;
    padding: 2px 4px;
  }

  .study-response blockquote {
    padding: 8px 10px;
    margin: 10px 0;
  }

  /* Toasts */
  .toast {
    font-size: 12px;
    padding: 12px 14px;
  }

  .toast-region {
    left: 12px;
    right: 12px;
    bottom: 80px;
    gap: 8px;
  }

  /* Empty states */
  .empty {
    padding: 20px;
    font-size: 12px;
  }

  /* Loading and spinners */
  .loading {
    min-height: 180px;
  }

  .spinner {
    height: 20px;
    width: 20px;
    margin-right: 8px;
  }

  /* Tables */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 12px;
  }

  /* Images */
  img {
    max-width: 100%;
    height: auto;
  }

  svg {
    max-width: 100%;
    height: auto;
  }

  /* Touch interactions */
  button, a {
    -webkit-tap-highlight-color: transparent;
  }

  /* Page layout */
  .page {
    max-width: 100%;
    padding: 14px 14px 110px;
  }

  .page-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .page-heading > div:last-child {
    width: 100%;
  }

  /* Prevent overflow */
  .app-shell,
  .main {
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* Fix overflow on containers */
  .resource-grid,
  .assignment-list,
  .discussion-list,
  .metric-grid,
  .content-grid {
    width: 100%;
  }
}
/* Google OAuth entry point */
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted, #6b7280); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; height: 1px; flex: 1; background: #e5e7eb; }
.google-sign-in { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 44px; border: 1px solid #d1d5db; border-radius: 9px; background: #fff; color: #273043; font: inherit; font-weight: 600; text-decoration: none; transition: background .15s, box-shadow .15s; }
.google-sign-in:hover { background: #f8fafc; box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.google-sign-in svg { width: 19px; height: 19px; }
