:root {
    --gis-primary: #176b52;
    --gis-primary-soft: #e8f4ef;
    --gis-surface: #ffffff;
}

body { background: #f5f7f8; color: #202428; }
.feed-item-action { font-size: .76rem; padding: .18rem .42rem; }
.navbar-brand { letter-spacing: .2px; }
.content-card, .subject-card {
    border: 0;
    border-radius: 1rem;
    background: var(--gis-surface);
    box-shadow: 0 .15rem .5rem rgba(27, 42, 38, .07);
}
.subject-card { transition: transform .15s ease, box-shadow .15s ease; }
.subject-card:hover { transform: translateY(-2px); box-shadow: 0 .35rem 1rem rgba(27, 42, 38, .11); }
.subject-code, .topic-label {
    color: var(--gis-primary);
    background: var(--gis-primary-soft);
    border-radius: 999px;
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .04em;
    padding: .25rem .55rem;
    text-transform: uppercase;
}
.topic-label { background: transparent; padding: 0; margin-bottom: .35rem; }
.item-icon {
    align-items: center;
    border-radius: .7rem;
    display: inline-flex;
    flex: 0 0 2.25rem;
    height: 2.25rem;
    justify-content: center;
}
.item-announcement { background: #e8f4ef; color: #176b52; }
.item-material { background: #e8f0fb; color: #285f9c; }
.item-assignment { background: #fff0db; color: #9a5b00; }
.item-quiz { background: #f1e9fb; color: #69409b; }
.item-meta { color: #79817e; font-size: .78rem; }
.feed-text { color: #3d4542; }
.empty-state { border: 1px dashed #c9d0cd; border-radius: 1rem; color: #6b7470; padding: 2rem; text-align: center; }
.btn-primary {
    --bs-btn-bg: var(--gis-primary);
    --bs-btn-border-color: var(--gis-primary);
    --bs-btn-hover-bg: #11543f;
    --bs-btn-hover-border-color: #11543f;
    --bs-btn-active-bg: #0e4736;
    --bs-btn-active-border-color: #0e4736;
}
.btn-outline-primary {
    --bs-btn-color: var(--gis-primary);
    --bs-btn-border-color: var(--gis-primary);
    --bs-btn-hover-bg: var(--gis-primary);
    --bs-btn-hover-border-color: var(--gis-primary);
    --bs-btn-active-bg: #11543f;
    --bs-btn-active-border-color: #11543f;
}
a { --bs-link-color-rgb: 23, 107, 82; --bs-link-hover-color-rgb: 14, 71, 54; }
.form-page { margin: 0 auto; max-width: 760px; }
.form-page-sm { max-width: 560px; }
.choice-list {
    background: #f8faf9;
    border: 1px solid #dfe5e2;
    border-radius: .75rem;
    list-style: none;
    margin: 0;
    max-height: 13rem;
    overflow-y: auto;
    padding: .55rem .75rem;
}
.choice-list li { padding: .25rem 0; }
.choice-list label { cursor: pointer; display: flex; gap: .55rem; }
.choice-list input { margin-top: .3rem; }
.status-badge {
    border-radius: 999px;
    display: inline-block;
    font-size: .68rem;
    font-weight: 600;
    padding: .15rem .45rem;
}
.status-draft { background: #ecefed; color: #59615e; }
.status-scheduled { background: #fff0db; color: #81500a; }
.status-published { background: #e8f4ef; color: #176b52; }
.status-archived { background: #f1f1f1; color: #818181; }
.archived-item { opacity: .72; }
.closed-activity { filter: grayscale(.65); opacity: .68; }
.sidebar-stack { z-index: 1; }
.topic-list .list-group-item { background: transparent; border-color: #edf0ee; font-size: .875rem; }
.dropdown-item button { width: 100%; }
.form-page-wide { max-width: 920px; }
.part-form { border-left: 3px solid #d9eae4; }
.attempt-history { border-top: 1px solid #edf0ee; }
.attempt-row { border-bottom: 1px solid #edf0ee; padding: .9rem 0; }
.attempt-row:last-child { border-bottom: 0; }
.assignment-instructions, .submitted-content {
    background: #f7f9f8;
    border-left: 3px solid var(--gis-primary);
    border-radius: .4rem;
    padding: 1rem;
}
.active-item-link {
    align-items: center;
    border-top: 1px solid #edf0ee;
    color: inherit;
    display: flex;
    gap: .7rem;
    padding: .7rem 0;
    text-decoration: none;
}
.active-item-link:first-of-type { border-top: 0; }
.active-item-link small { color: #79817e; display: block; font-size: .72rem; }
.active-item-link .item-icon { flex-basis: 2rem; height: 2rem; }
.status-submitted { background: #e8f0fb; color: #285f9c; }
.status-graded { background: #e8f4ef; color: #176b52; }
.quiz-timer {
    background: #202428;
    border-radius: .75rem;
    color: #fff;
    font-size: 1.1rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    padding: .65rem .9rem;
}
.question-card .choice-list { max-height: none; }
.result-score {
    align-items: center;
    background: #f0f1f3;
    border-radius: 1rem;
    color: #374151;
    display: flex;
    justify-content: space-between;
    padding: 1.2rem 1.4rem;
}
.result-score strong { font-size: 1.35rem; }
.feed-topic {
    background: rgba(255, 255, 255, .55);
    border: 1px solid #e3e8e6;
    border-radius: 1rem;
    padding: .8rem .9rem 0;
}
.feed-important { background: #fff9e8; border-color: #efd99a; }
.feed-topic-heading {
    align-items: center;
    background: transparent;
    border: 0;
    color: #303633;
    display: flex;
    font-size: 1rem;
    font-weight: 700;
    justify-content: space-between;
    padding: .15rem .15rem .8rem;
    text-align: left;
    width: 100%;
}
.feed-topic-toggle .topic-chevron { display: inline-block; transition: transform .15s ease; }
.feed-topic-toggle[aria-expanded="false"] .topic-chevron { transform: rotate(-90deg); }
.rich-text > :last-child { margin-bottom: 0; }
.rich-text p { margin-bottom: .7rem; }
.rich-text h4 { font-size: 1.18rem; margin: 1.15rem 0 .55rem; }
.rich-text h5 { font-size: 1.03rem; margin: 1rem 0 .45rem; }
.rich-text h6 { font-size: .92rem; margin: .9rem 0 .4rem; }
.rich-text ul { margin-bottom: .8rem; padding-left: 1.35rem; }
.rich-text a { color: #0d6efd; text-decoration: none; }
.rich-text a:hover, .rich-text a:focus { color: #0a58ca; text-decoration: underline; }
.rich-text code { background: #edf1ef; border-radius: .25rem; color: #35413d; padding: .12rem .3rem; }
.rich-text pre { background: #202428; border-radius: .65rem; color: #f4f7f6; overflow-x: auto; padding: .9rem 1rem; }
.rich-text pre code { background: transparent; color: inherit; padding: 0; }
.rich-text-toolbar { background: #f3f6f4; border: 1px solid #dfe5e2; border-bottom: 0; border-radius: .45rem .45rem 0 0; padding: .3rem; }
.rich-text-toolbar + textarea { border-top-left-radius: 0; border-top-right-radius: 0; }
.rich-text-tool { min-width: 2rem; }
.data-table > :not(caption) > * > * { padding: .68rem .82rem; }
.data-table > :not(caption) > * > *:first-child { padding-left: 1rem; }
.data-table > :not(caption) > * > *:last-child { padding-right: 1rem; }
.quiz-variant-accordion .accordion-button { background: #fff; box-shadow: none; padding: 1rem 1.1rem; }
.quiz-variant-accordion .accordion-button:not(.collapsed) { color: inherit; }
.quiz-variant-accordion .accordion-body { padding: .75rem 1.1rem 1rem; }
.feed-topic .content-card .card-body { padding: 1rem 1.1rem; }
.feed-topic .content-card { border-radius: .8rem; box-shadow: 0 .1rem .35rem rgba(27, 42, 38, .06); }
.feed-topic .feed-text { font-size: .94rem; }
/* Compact activity and scoring views */
.form-page { max-width: 900px; }
.form-page-wide { max-width: 1060px; }
.quiz-answer-row { padding: .8rem 1rem; border-bottom: 1px solid #edf0ee; }
.quiz-answer-row:last-child { border-bottom: 0; }
.earned-points { color: #374151; background: #f0f1f3; font-weight: 600; border-radius: .4rem; padding: .2rem .45rem; display: inline-block; }
.part-score-overview a, .part-score-overview > span { color: inherit; text-decoration: none; font-size: .8rem; border: 1px solid #e3e8e6; border-radius: .4rem; padding: .3rem .5rem; }
.part-score-overview a:hover { background: #f1f7f4; }
.submission-type { font-size: .75rem; font-weight: 600; border-radius: .35rem; padding: .15rem .4rem; }
.submission-file { color: #285f9c; background: #e8f0fb; }
.submission-text { color: #176b52; background: #e8f4ef; }
.submission-quiz { color: #69409b; background: #f1e9fb; }
.submission-registration { color: #9a5b00; background: #fff0db; }
.submission-manual { color: #4c5964; background: #edf0f2; }
.status-returned { color: #8a4a00; background: #fff0db; }
details > summary { cursor: pointer; }
.manual-score-section[open] > summary { border-bottom: 1px solid var(--bs-border-color); }
.assignment-part { scroll-margin-top: 1rem; }
@media (min-width: 768px) { .task-prose p { text-align: justify; } }
/* Keep feed cards compact without changing controls elsewhere. */
.feed-item-header { display: flex; align-items: center; gap: .65rem; }
.feed-item-heading { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.feed-item .item-icon { flex: 0 0 1.8rem; width: 1.8rem; height: 1.8rem; font-size: .95rem; }
.feed-item .item-meta { margin-top: .15rem; font-size: .72rem; }
.feed-item .feed-item-actions { flex-shrink: 0; }
.feed-item.card .card-body { padding: .75rem .9rem; }
.feed-item .feed-text { overflow-wrap: anywhere; }
.return-history { max-width: 42rem; overflow-wrap: anywhere; }
@media (max-width: 767px) {
    .feed-item-header { flex-wrap: wrap; }
    .feed-item-actions { margin-left: 2.45rem; }
}
/* Text previews are enhanced by JS; without JS all text remains accessible. */
.rich-text.text-justified p { text-align: justify; }
.rich-text ol { margin-bottom: .8rem; padding-left: 1.6rem; }
.rich-text li > ul, .rich-text li > ol { margin-top: .25rem; margin-bottom: .25rem; }
.rich-text li > ol { list-style-type: lower-alpha; }
.rich-text li > ul { list-style-type: circle; }
.feed-text-preview { max-height: 10.5rem; overflow: hidden; position: relative; }
.feed-text-preview::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5rem; background: linear-gradient(transparent, white); pointer-events: none; }
.text-expand-button { border: 0; background: none; color: var(--gis-primary); font-size: .8rem; padding: .35rem 0 0; }
.text-expand-button:hover { text-decoration: underline; }
.pair-invitation-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 .25rem;
    border-radius: 999px;
    background: #b42332;
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    vertical-align: middle;
    line-height: 1;
}
