:root {
    --color-primary: #1e3a8a;
    --color-primary-hover: #1e40af;
    --color-primary-active: #1d4ed8;
    --color-primary-text: #ffffff;
    --color-secondary: #334155;
    --color-secondary-hover: #1f2937;
    --color-secondary-text: #ffffff;
    --color-info: #1e40af;
    --color-info-soft: #eaf1ff;
    --color-info-text: #ffffff;
    --color-surface: #ffffff;
    --color-surface-muted: #f2f5fb;
    --color-surface-subtle: #eef2f8;
    --color-surface-strong: #dfe6f3;
    --color-surface-elevated: #fbfdff;
    --color-surface-panel: #f7faff;
    --color-surface-content: #ffffff;
    --color-surface-content-muted: #f6f9ff;
    --color-surface-rich: #f8fbff;
    --color-surface-rich-strong: #eef4ff;
    --color-text: #0f172a;
    --color-text-muted: #475569;
    --color-text-soft: #58657c;
    --color-border: #7488a8;
    --color-border-strong: #5d7398;
    --color-border-soft: #7e93b2;
    --color-focus: #0f52ba;
    --color-focus-ring: rgba(15, 82, 186, 0.28);
    --color-placeholder: #5b6f90;
    --color-disabled-text: #5b6678;
    --color-disabled-surface: #e9eef6;
    --color-disabled-border: #95a9c4;
    --color-danger: #991b1b;
    --color-danger-hover: #7f1d1d;
    --color-danger-text: #ffffff;
    --color-danger-soft: #fde8e8;
    --color-success: #166534;
    --color-success-hover: #14532d;
    --color-success-text: #ffffff;
    --color-success-soft: #e7f8ef;
    --color-warning: #92400e;
    --color-warning-hover: #7c2d12;
    --color-warning-text: #ffffff;
    --color-warning-soft: #fff3df;
    --gradient-primary: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 56%, #4c1d95 100%);
    --gradient-primary-hover: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 40%, #3b1a73 100%);
    --gradient-danger: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    --gradient-secondary: linear-gradient(135deg, #334155 0%, #1f2937 100%);
    --gradient-info: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
    --color-table-header-bg: #e7edf8;
    --color-table-row-alt: #f6f9ff;
    --color-tab-bg: #edf2fb;
    --color-tab-text: #243244;
    --color-tab-active-bg: #1e3a8a;
    --color-tab-active-text: #ffffff;
    --color-chip-bg: #eaf1ff;
    --color-chip-text: #1e3a8a;
    --color-course-priority-healthy-bg: #eff4ff;
    --color-course-priority-healthy-text: #243b6b;
    --color-course-priority-healthy-border: rgba(154, 169, 204, 0.44);
    --color-course-priority-attention-bg: #fef2f2;
    --color-course-priority-attention-text: #991b1b;
    --color-course-priority-attention-border: rgba(185, 28, 28, 0.22);
    --color-course-priority-recent-bg: #eff6ff;
    --color-course-priority-recent-text: #1d4ed8;
    --color-course-priority-recent-border: rgba(59, 130, 246, 0.22);
    --color-course-priority-closed-bg: #fff7ed;
    --color-course-priority-closed-text: #9a3412;
    --color-course-priority-closed-border: rgba(217, 119, 6, 0.22);
    --color-breadcrumb-bg: #eef3fb;
    --color-breadcrumb-text: #334155;
    --color-floating-menu-bg: #ffffff;
    --color-floating-menu-text: #0f172a;
    --color-tooltip-bg: #0f172a;
    --color-tooltip-text: #ffffff;
    --color-stats-surface: #f5f9ff;
    --color-stats-text: #1e293b;
    --color-stats-muted: #475569;

    --bg: #fefefe;
    --bg-elevated: var(--color-surface);
    --bg-soft: var(--color-surface-muted);
    --bg-dark: #0a0a0b;
    --bg-dark-soft: #101017;
    --ink: var(--color-text);
    --ink-soft: var(--color-text-muted);
    --line: var(--color-border);
    --line-strong: var(--color-border-strong);
    --shadow-xs: 0 2px 6px rgba(10, 10, 11, 0.04);
    --shadow-sm: 0 16px 34px rgba(10, 10, 11, 0.07);
    --shadow-md: 0 28px 60px rgba(10, 10, 11, 0.1);
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --brand: var(--color-primary);
    --brand-strong: var(--color-primary-active);
    --success: var(--color-success);
    --success-soft: var(--color-success-soft);
    --danger: var(--color-danger);
    --danger-soft: var(--color-danger-soft);
    --warning: var(--color-warning);
    --warning-soft: var(--color-warning-soft);
    --violet: #4c1d95;
    --violet-soft: rgba(176, 163, 194, 0.2);
    --rose-soft: #aa8e9d;
    --text-primary: var(--color-text);
    --text-muted: var(--color-text-muted);
}

* {
    -webkit-tap-highlight-color: transparent;
}

body.drawing-mode,
body.drawing-mode * {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.issue-board-list,
.issue-board-list--flat {
    display: grid;
    gap: 28px;
}

.discussion-thread.issue-row {
    width: min(100%, 900px);
    margin-inline: auto;
    justify-self: center;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transform: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.discussion-thread.issue-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
}

.discussion-thread__question {
    display: grid;
    gap: 18px;
    padding: 24px;
    border-bottom: 1px solid #eeeeee;
}

.issues-page .issue-toolbar__searchline,
.issues-page .issue-toolbar__controls--modern {
    width: 100%;
}

.issues-page .issue-toolbar__controls--modern {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    margin-left: 0;
}

.issues-page .issue-board-summary--course {
    margin-top: -2px;
}

.issues-page .issue-board-list--flat {
    align-content: start;
}

.discussion-thread__question-bar,
.discussion-thread__question-actions,
.discussion-thread__badges,
.discussion-thread__question-footer,
.discussion-thread__meta,
.thread-response__header,
.thread-response__header-actions,
.thread-composer__footer,
.thread-composer__tools,
.thread-composer__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.discussion-thread__question-bar,
.thread-response__header,
.thread-composer__footer {
    align-items: flex-start;
    justify-content: space-between;
}

.discussion-thread__badges,
.discussion-thread__question-actions,
.thread-response__header-actions,
.thread-composer__tools,
.thread-composer__actions {
    align-items: center;
}

.discussion-thread__status,
.discussion-thread__pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    border: 1px solid var(--color-border);
    background: var(--color-surface-subtle);
    color: var(--color-text-muted);
}

.discussion-thread__status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    flex: 0 0 auto;
}

.discussion-thread__status--resolved {
    color: var(--color-success);
    background: var(--color-success-soft);
    border-color: color-mix(in srgb, var(--color-success) 36%, #ffffff);
}

.discussion-thread__status--resolved .discussion-thread__status-dot {
    background: var(--color-success);
}

.discussion-thread__status--pending {
    color: var(--color-danger);
    background: var(--color-danger-soft);
    border-color: color-mix(in srgb, var(--color-danger) 36%, #ffffff);
}

.discussion-thread__status--pending .discussion-thread__status-dot {
    background: var(--color-danger);
}

.discussion-thread__pill--important {
    color: var(--color-warning);
    background: var(--color-warning-soft);
    border-color: color-mix(in srgb, var(--color-warning) 36%, #ffffff);
}

.discussion-thread__pill--course {
    color: var(--color-primary);
    background: color-mix(in srgb, var(--color-primary) 12%, #ffffff);
    border-color: color-mix(in srgb, var(--color-primary) 32%, #ffffff);
}

.discussion-thread__title {
    margin: 0;
    font-size: clamp(1.25rem, 2vw, 1.4rem);
    line-height: 1.3;
    letter-spacing: -0.03em;
    color: #0f172a;
}

.discussion-thread__meta {
    gap: 10px;
    color: #94a3b8;
    font-size: 0.9rem;
}

.discussion-thread__meta span {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.discussion-thread__meta span + span::before {
    content: '·';
    color: #cbd5e1;
}

.discussion-thread__content {
    color: #1f2937;
}

.discussion-thread__content,
.thread-response__content {
    overflow-wrap: anywhere;
}

.discussion-thread__attachments,
.thread-response__attachments {
    margin-top: 4px;
}

.discussion-thread__topics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.discussion-thread__topics--summary {
    margin-top: 8px;
}

.discussion-thread__topic-chip,
.discussion-thread__topic-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(14, 116, 144, 0.18);
    background: rgba(236, 253, 245, 0.9);
    color: #155e75;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.discussion-thread__topics--summary .discussion-thread__topic-chip {
    min-height: 28px;
    padding-inline: 10px;
    font-size: 0.75rem;
}

.discussion-thread__topic-editor {
    display: grid;
    gap: 16px;
    margin-top: 6px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.98));
}

.discussion-thread__topic-editor-header,
.discussion-thread__topic-editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.discussion-thread__topic-editor-copy {
    display: grid;
    gap: 4px;
}

.discussion-thread__topic-editor-copy strong {
    color: #0f172a;
    font-size: 0.98rem;
    line-height: 1.4;
}

.discussion-thread__topic-form {
    display: grid;
    gap: 16px;
}

.discussion-thread__topic-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.discussion-thread__topic-option {
    position: relative;
    display: inline-flex;
}

.discussion-thread__topic-input {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    border: 0;
}

.discussion-thread__topic-pill {
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.discussion-thread__topic-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.discussion-thread__topic-input:checked + .discussion-thread__topic-pill {
    border-color: rgba(13, 148, 136, 0.42);
    background: linear-gradient(135deg, #0f766e, #0d9488);
    color: #f8fafc;
    box-shadow: 0 12px 24px rgba(15, 118, 110, 0.18);
}

.discussion-thread__topic-input:focus-visible + .discussion-thread__topic-pill {
    outline: 2px solid rgba(15, 118, 110, 0.42);
    outline-offset: 2px;
}

.discussion-thread__question-footer {
    justify-content: flex-end;
}

.discussion-thread__separator {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 24px 0;
    color: #94a3b8;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.discussion-thread__separator::before,
.discussion-thread__separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.discussion-thread__responses {
    display: grid;
    gap: 16px;
    padding: 18px 24px 24px;
}

.thread-response {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 16px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #22c55e;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.thread-response:hover,
.thread-attachment:hover,
.thread-attachment:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
}

.thread-response--empty {
    grid-template-columns: 1fr;
    border-left-color: #cbd5e1;
    border-style: dashed;
    box-shadow: none;
    background: #fcfcfd;
}

.thread-response__avatar {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2563eb 0%, #22c55e 100%);
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.thread-response__panel,
.thread-response__identity,
.thread-response__empty-copy,
.thread-response__detail,
.thread-composer,
.thread-composer__header-copy,
.thread-composer__form,
.thread-attachment__meta,
.thread-code {
    display: grid;
    gap: 10px;
}

.thread-response__panel,
.thread-composer__form,
.thread-composer__input,
.rich-preview,
.rich-preview__content,
.composer-preview,
.issue-reply-form__preview {
    min-width: 0;
}

.thread-response__identity strong,
.thread-response__empty-copy strong,
.thread-composer__header-copy strong {
    font-size: 1rem;
    line-height: 1.2;
    color: #0f172a;
}

.thread-response__identity span,
.thread-composer__header-copy span,
.thread-response__note,
.thread-response__empty-copy p,
.thread-composer__hint {
    color: #64748b;
    line-height: 1.6;
}

.thread-composer__hint.is-error,
.composer-card-saas__hint.is-error {
    color: #b91c1c;
}

.thread-response__note,
.thread-response__empty-copy p {
    margin: 0;
}

.discussion-thread__question--response-trigger {
    cursor: pointer;
}

.discussion-thread__question--response-trigger .discussion-thread__question-actions,
.discussion-thread__question--response-trigger .discussion-thread__question-actions * {
    cursor: auto;
}

.thread-response__collapsed {
    position: relative;
    padding: 18px 18px 78px;
    border-radius: 18px;
    border: 1px solid rgba(37, 99, 235, 0.12);
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.92), rgba(255, 255, 255, 0.98));
    cursor: pointer;
    overflow: hidden;
}

.thread-response__preview-content,
.thread-response__note--preview {
    max-height: 10rem;
    overflow: hidden;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 40%, rgba(0, 0, 0, 0.94) 56%, rgba(0, 0, 0, 0.72) 70%, rgba(0, 0, 0, 0.36) 84%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 0%, #000 40%, rgba(0, 0, 0, 0.94) 56%, rgba(0, 0, 0, 0.72) 70%, rgba(0, 0, 0, 0.36) 84%, transparent 100%);
}

.thread-response__collapsed::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 132px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(247, 250, 255, 0.18) 16%, rgba(249, 251, 255, 0.48) 38%, rgba(250, 252, 255, 0.82) 66%, rgba(255, 255, 255, 0.98) 100%),
        linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.04) 18%, rgba(255, 255, 255, 0.04) 82%, rgba(255, 255, 255, 0.18) 100%);
    pointer-events: none;
}

.thread-response__collapsed-actions {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 18px;
    z-index: 1;
    display: flex;
    justify-content: flex-start;
    pointer-events: none;
}

.thread-response__cta {
    pointer-events: auto;
}

html[data-theme='dark'] .thread-response__collapsed {
    border-color: rgba(148, 163, 184, 0.18);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.74), rgba(15, 23, 42, 0.92));
}

html[data-theme='dark'] .thread-response__collapsed::after {
    background:
    linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.2) 16%, rgba(15, 23, 42, 0.42) 38%, rgba(15, 23, 42, 0.78) 66%, rgba(15, 23, 42, 0.98) 100%),
        linear-gradient(90deg, rgba(15, 23, 42, 0.2) 0%, rgba(15, 23, 42, 0.05) 18%, rgba(15, 23, 42, 0.05) 82%, rgba(15, 23, 42, 0.2) 100%);
}

.thread-response__toggle[aria-expanded='true'] {
    border-color: rgba(15, 23, 42, 0.12);
    background: rgba(15, 23, 42, 0.06);
    color: #0f172a;
}

.thread-response__detail {
    display: grid;
    gap: 10px;
}

.thread-response__footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.thread-response__footer .issue-vote-form {
    margin-left: auto;
}

.thread-response__vote-label {
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 700;
}

.thread-composer {
    display: grid;
    gap: 16px;
    padding: 0 24px 24px;
}

.thread-composer.is-active {
    padding-top: 4px;
}

.thread-composer__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.thread-composer__form {
    gap: 14px;
}

.thread-composer__input {
    border: 1px solid #dbe3ee;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

.thread-composer__textarea {
    width: 100%;
    min-height: 110px;
    padding: 16px 18px;
    border: 0;
    background: transparent;
    color: #0f172a;
    resize: none;
}

.thread-composer__textarea:focus {
    outline: none;
}

.thread-composer__input:focus-within {
    border-color: rgba(37, 99, 235, 0.4);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.thread-composer__footer {
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f8fafc;
}

.thread-composer__tools {
    flex: 1 1 420px;
}

.thread-composer__actions {
    justify-content: flex-end;
}

.thread-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.thread-attachment {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-width: min(280px, 100%);
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
    color: inherit;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.thread-attachment__thumb {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.82rem;
    font-weight: 800;
}

.thread-attachment__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thread-attachment__thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #0f172a;
}

.thread-attachment__meta {
    min-width: 0;
}

.thread-attachment__meta--stacked strong,
.thread-attachment__meta--stacked small {
    white-space: normal;
}

.thread-attachment--video {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    min-width: min(420px, 100%);
    cursor: pointer;
}

.thread-attachment__media {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    background: #0f172a;
}

.thread-attachment__video {
    display: block;
    width: 100%;
    max-height: 360px;
    background: #0f172a;
    pointer-events: none;
}

.thread-attachment__play-badge {
    position: absolute;
    right: 14px;
    bottom: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.76);
    color: #ffffff;
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    pointer-events: none;
}

.thread-attachment__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid #dbe3ee;
    background: #f8fafc;
    color: #0f172a;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
}

.thread-attachment__meta strong,
.thread-attachment__meta small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.thread-attachment__meta strong {
    color: #111827;
}

.thread-attachment__meta small {
    color: #64748b;
}

.thread-prose {
    max-width: 100%;
    color: #1f2937;
    font-size: 15px;
    line-height: 1.7;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.thread-prose > :first-child {
    margin-top: 0;
}

.thread-prose > :last-child {
    margin-bottom: 0;
}

.thread-prose p,
.thread-prose ul,
.thread-prose ol,
.thread-prose pre,
.thread-prose blockquote,
.thread-prose .thread-math--display {
    margin: 0 0 1rem;
}

.thread-prose ul,
.thread-prose ol {
    padding-left: 1.35rem;
}

.thread-prose li + li {
    margin-top: 0.35rem;
}

.thread-prose h2,
.thread-prose h1,
.thread-prose h3,
.thread-prose h4,
.thread-prose h5 {
    margin: 1.25rem 0 0.75rem;
    color: #0f172a;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.thread-prose a {
    color: #2563eb;
    text-decoration: none;
}

.thread-prose a:hover {
    text-decoration: underline;
}

.thread-prose code {
    padding: 0.14rem 0.38rem;
    border-radius: 8px;
    background: #f1f5f9;
    color: #0f172a;
    font-family: Consolas, 'SFMono-Regular', Monaco, monospace;
    font-size: 0.92em;
}

.thread-prose blockquote {
    padding: 0.9rem 1rem;
    border-left: 4px solid rgba(37, 99, 235, 0.34);
    border-radius: 14px;
    background: rgba(37, 99, 235, 0.05);
    color: #334155;
}

.thread-prose table {
    display: block;
    width: max-content;
    min-width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    border: 1px solid #dbe3ee;
    border-radius: 14px;
    background: #ffffff;
}

.thread-prose th,
.thread-prose td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
    text-align: left;
}

.thread-prose th {
    font-weight: 700;
    color: #0f172a;
    background: #f8fafc;
}

.thread-prose td {
    color: #334155;
}

.thread-prose tr:last-child td {
    border-bottom: 0;
}

.thread-prose th[align='center'],
.thread-prose td[align='center'] {
    text-align: center;
}

.thread-prose th[align='right'],
.thread-prose td[align='right'] {
    text-align: right;
}

.thread-prose blockquote > :last-child {
    margin-bottom: 0;
}

.thread-prose pre {
    max-width: 100%;
    overflow-x: auto;
}

.thread-prose img,
.rich-preview__content img {
    max-width: 100%;
    height: auto;
}

.rich-preview__content > * {
    max-width: 100%;
}

.thread-code {
    gap: 0;
}

.thread-code__label {
    padding: 10px 14px;
    border: 1px solid #dbe3ee;
    border-bottom: 0;
    border-radius: 14px 14px 0 0;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.thread-code pre {
    margin: 0;
    padding: 16px 18px;
    overflow: auto;
    max-width: 100%;
    border: 1px solid #dbe3ee;
    border-radius: 14px;
    background: #0f172a;
    color: #e2e8f0;
}

.thread-code__label + pre {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.thread-code pre code {
    padding: 0;
    background: transparent;
    color: inherit;
}

.thread-math {
    display: inline-block;
    padding: 0.1rem 0.32rem;
    border-radius: 8px;
    background: #f8fafc;
    font-family: 'Times New Roman', serif;
}

.thread-math--display {
    display: block;
    padding: 14px 16px;
    text-align: center;
    overflow-x: auto;
    overflow-y: hidden;
}

.thread-math .katex {
    max-width: 100%;
}

.thread-math--display .katex-display {
    margin: 0;
    overflow: visible;
}

.thread-math--display .katex-display > .katex {
    display: inline-block;
    max-width: none;
    min-width: max-content;
    padding-bottom: 0.08rem;
}

.rich-composer-hint {
    color: var(--ink-soft);
    font-size: 0.88rem;
    line-height: 1.55;
}

.rich-preview {
    display: grid;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid rgba(37, 99, 235, 0.14);
    background: rgba(37, 99, 235, 0.05);
}

.rich-preview__content {
    font-size: 0.95rem;
}

.rich-preview__intro {
    display: grid;
    gap: 4px;
}

.rich-preview__intro strong {
    font-size: 0.88rem;
    color: #0f172a;
}

.rich-preview__intro span {
    color: var(--ink-soft);
    line-height: 1.5;
}

.discussion-thread .issue-actions {
    position: relative;
}

.discussion-thread .issue-actions__toggle {
    width: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
    list-style: none;
}

.discussion-thread .issue-actions__toggle::-webkit-details-marker {
    display: none;
}

.discussion-thread .issue-actions__menu {
    right: 0;
    left: auto;
}

html[data-theme='dark'] .discussion-thread.issue-row,
html[data-theme='dark'] .discussion-thread.issue-row:hover,
html[data-theme='dark'] .discussion-thread.issue-row.is-open {
    border-color: rgba(148, 163, 184, 0.18);
    background: linear-gradient(180deg, rgba(10, 17, 30, 0.96), rgba(7, 12, 22, 0.98));
    box-shadow: 0 22px 46px rgba(2, 6, 23, 0.32);
}

html[data-theme='dark'] .discussion-thread__title,
html[data-theme='dark'] .thread-prose,
html[data-theme='dark'] .thread-response__identity strong,
html[data-theme='dark'] .thread-response__empty-copy strong,
html[data-theme='dark'] .thread-composer__header-copy strong,
html[data-theme='dark'] .thread-attachment__meta strong {
    color: #f8fafc;
}


html[data-theme='dark'] .thread-prose blockquote,
html[data-theme='dark'] .rich-preview {
    border-color: rgba(96, 165, 250, 0.2);
    background: rgba(21, 34, 55, 0.92);
    color: #dbe7f5;
}

html[data-theme='dark'] .rich-composer-hint,
html[data-theme='dark'] .rich-preview__intro span {
    color: #94a3b8;
}

html[data-theme='dark'] .rich-preview__intro strong {
    color: #f8fafc;
}

html[data-theme='dark'] .thread-prose code {
    background: rgba(148, 163, 184, 0.14);
    color: #f8fafc;
}

html[data-theme='dark'] .thread-code__label {
    border-color: rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.92);
    color: #94a3b8;
}

html[data-theme='dark'] .thread-code pre {
    border-color: rgba(148, 163, 184, 0.18);
    background: #020617;
}
html[data-theme='dark'] .discussion-thread__meta,
html[data-theme='dark'] .thread-response__identity span,
html[data-theme='dark'] .thread-response__note,
html[data-theme='dark'] .thread-response__empty-copy p,
html[data-theme='dark'] .thread-composer__header-copy span,
html[data-theme='dark'] .thread-composer__hint,
html[data-theme='dark'] .thread-attachment__meta small {
    color: #cbd5e1;
}

@media (max-width: 900px) {
    .discussion-thread__question,
    .discussion-thread__responses,
    .thread-composer {
        padding-left: 20px;
        padding-right: 20px;
    }

    .discussion-thread__separator {
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (max-width: 720px) {
    .discussion-thread.issue-row {
        border-radius: 14px;
    }

    .discussion-thread__question,
    .discussion-thread__responses,
    .thread-composer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .discussion-thread__separator {
        padding-left: 16px;
        padding-right: 16px;
    }

    .discussion-thread__question {
        padding-top: 18px;
        padding-bottom: 18px;
    }

    .discussion-thread__separator {
        padding-top: 18px;
        gap: 10px;
    }

    .thread-response {
        grid-template-columns: 40px minmax(0, 1fr);
        gap: 12px;
        padding: 16px;
    }

    .thread-response--empty {
        grid-template-columns: 1fr;
    }

    .thread-response__avatar {
        width: 40px;
        height: 40px;
        font-size: 0.8rem;
    }

    .thread-attachment {
        min-width: 100%;
    }

    .thread-composer__footer,
    .thread-composer__actions,
    .thread-composer__tools,
    .discussion-thread__question-bar,
    .thread-response__header {
        flex-direction: column;
        align-items: stretch;
    }

    .thread-composer__footer,
    .discussion-thread__question-bar,
    .thread-response__header {
        justify-content: flex-start;
    }

    .thread-composer__tools {
        flex: 1 1 auto;
    }

    .discussion-thread__question-actions {
        justify-content: flex-start;
    }

    .discussion-thread__question--compact .discussion-thread__question-bar {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
    }

    .discussion-thread__question--compact .discussion-thread__badges {
        flex: 1 1 auto;
        min-width: 0;
    }

    .discussion-thread__question--compact .discussion-thread__question-actions {
        flex: 0 0 auto;
        align-self: flex-start;
        margin-left: auto;
        justify-content: flex-end;
    }

    .thread-composer__actions .topbar-button,
    .discussion-thread__question-actions .topbar-button,
    .discussion-thread__question-actions .issue-inline-button {
        width: 100%;
    }

    .discussion-thread__question--compact .discussion-thread__question-actions .topbar-button,
    .discussion-thread__question--compact .discussion-thread__question-actions .issue-inline-button {
        width: auto;
    }

    .discussion-thread__title {
        font-size: 1.18rem;
    }
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html[data-theme='dark'] {
    color-scheme: dark;
}

html[data-theme='light'] {
    color-scheme: light;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 8% 4%, rgba(131, 167, 220, 0.2), transparent 34%),
        radial-gradient(circle at 92% 18%, rgba(176, 163, 194, 0.18), transparent 30%),
        linear-gradient(180deg, #ffffff 0%, var(--bg) 58%, #f9fbff 100%);
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[role='button']:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--color-focus-ring);
}

img {
    display: block;
    max-width: 100%;
}

[hidden] {
    display: none !important;
}

.file-input--hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 28px;
    padding: 24px 18px 20px;
    background: linear-gradient(180deg, var(--bg-dark) 0%, #101827 100%);
    color: #f8fafc;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
}

.sidebar-brand__mark {
    display: inline-flex;
    width: 64px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-brand__mark img {
    width: 50px;
    height: 28px;
    object-fit: contain;
}

.sidebar-brand__copy {
    display: grid;
    gap: 4px;
}

.sidebar-brand__copy strong {
    font-size: 0.98rem;
}

.sidebar-brand__copy small,
.sidebar-nav__label,
.sidebar-course-summary small,
.sidebar-footer__meta,
.sidebar-footer__email {
    color: rgba(226, 232, 240, 0.7);
}

.sidebar-nav {
    display: grid;
    align-content: start;
    gap: 22px;
}

.sidebar-nav__group {
    display: grid;
    gap: 8px;
}

.sidebar-nav__label {
    padding: 0 12px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.sidebar-nav__divider {
    height: 1px;
    margin: 0 12px;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-link,
.sidebar-logout {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 14px;
    color: rgba(241, 245, 249, 0.88);
    transition: background-color 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.sidebar-link:hover,
.sidebar-logout:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
}

.sidebar-link.is-active {
    background: linear-gradient(135deg, rgba(131, 167, 220, 0.28), rgba(176, 163, 194, 0.2));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.sidebar-course-summary {
    margin: 6px 12px 0;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    display: grid;
    gap: 4px;
}

.sidebar-course-summary strong {
    font-size: 1.6rem;
}

.sidebar-footer {
    display: grid;
    gap: 10px;
    padding: 14px 12px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.sidebar-user__avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    color: #f8fafc;
    font-weight: 800;
    overflow: hidden;
}

.sidebar-user__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-user__copy {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.sidebar-user__copy strong,
.sidebar-user__copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-role {
    display: inline-flex;
    width: fit-content;
    min-height: 32px;
    align-items: center;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.sidebar-role--student {
    color: #fecaca;
    background: rgba(220, 38, 38, 0.18);
}

.sidebar-role--teacher {
    color: #bbf7d0;
    background: rgba(22, 163, 74, 0.18);
}

.sidebar-footer__email,
.sidebar-footer__meta {
    font-size: 0.86rem;
}

.app-workspace {
    min-width: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 28px 32px 20px;
    backdrop-filter: blur(12px);
    background: rgba(254, 254, 255, 0.86);
    border-bottom: 1px solid rgba(182, 195, 228, 0.5);
}

.app-topbar__copy {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.app-topbar__eyebrow,
.panel__eyebrow,
.metric-tile__label,
.sync-banner__eyebrow,
.issue-detail__eyebrow {
    display: inline-flex;
    width: fit-content;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.app-topbar__title,
.panel__title,
.course-overview-panel__title,
.auth-card__title,
.issue-detail__title {
    margin: 0;
    letter-spacing: -0.04em;
    line-height: 1;
}

.app-topbar__title {
    font-size: clamp(1.85rem, 2.8vw, 2.4rem);
}

.app-topbar__subtitle,
.panel__text,
.course-overview-panel__text,
.metric-tile__hint,
.auth-card__text,
.auth-card__note,
.empty-state p,
.issue-row__preview,
.issue-answer__body p,
.issue-detail__question p,
.course-summary-card__text,
.recent-issue__copy small,
.sync-banner__text,
.composer-card-saas__hint {
    margin: 0;
    color: var(--ink-soft);
    line-height: 1.65;
}

.app-topbar__actions,
.panel__header,
.issue-toolbar,
.issue-toolbar__filters,
.issue-toolbar__actions,
.issue-toolbar__searchline,
.course-overview-panel__topline,
.course-overview-grid,
.student-progress,
.composer-card-saas__footer,
.composer-card-saas__meta,
.issue-row__headline,
.issue-row__meta,
.issue-detail__header,
.issue-detail__meta,
.issue-detail__attachments,
.issue-moderation__topline,
.issue-moderation__actions,
.issue-reply-form__actions,
.chart-legend,
.sync-banner,
.sync-banner__actions,
.settings-grid,
.settings-toolbar,
.panel__header--stacked-mobile,
.recent-issues,
.auth-card,
.auth-card__actions,
.auth-feature-list,
.insight-listing,
.dashboard-main-grid,
.metric-grid,
.course-summary-card__stats,
.course-summary-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.topbar-button,
.issue-inline-button,
.issue-filter,
.course-summary-card__link,
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 16px;
    border: 1px solid var(--color-border-strong);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 0.92rem;
    font-weight: 700;
    box-shadow: var(--shadow-xs);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.topbar-button:hover,
.issue-inline-button:hover,
.issue-filter:hover,
.course-summary-card__link:hover,
.theme-toggle:hover {
    transform: translateY(-1px);
    border-color: var(--color-focus);
    background: var(--color-surface-muted);
    box-shadow: var(--shadow-sm);
}

.topbar-button:disabled,
.issue-inline-button:disabled,
.topbar-button.is-disabled {
    cursor: not-allowed;
    opacity: 1;
    background: var(--color-disabled-surface);
    border-color: var(--color-disabled-border);
    color: var(--color-disabled-text);
    transform: none;
    box-shadow: var(--shadow-xs);
}

.issue-inline-button--subtle {
    border-color: transparent;
    background: transparent;
    color: var(--color-primary);
    box-shadow: none;
    padding-inline: 0;
}

.issue-inline-button--subtle:hover {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

.theme-toggle {
    gap: 10px;
}

.theme-toggle__dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--gradient-primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-primary) 26%, transparent);
}

.topbar-button--primary,
.course-summary-card__link,
.issue-filter.is-active {
    color: var(--color-primary-text);
    border-color: transparent;
    background: var(--gradient-primary);
}

.topbar-button--primary:hover,
.course-summary-card__link:hover,
.issue-filter.is-active:hover {
    background: var(--gradient-primary-hover);
}

.topbar-button:focus-visible,
.issue-inline-button:focus-visible,
.issue-filter:focus-visible,
.course-summary-card__link:focus-visible,
.theme-toggle:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
    box-shadow: 0 0 0 5px var(--color-focus-ring);
}

.topbar-button--quiet {
    background: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text);
}

.topbar-button--danger,
.issue-inline-button--danger {
    color: var(--color-danger-text);
    border-color: transparent;
    background: var(--gradient-danger);
}

.app-content {
    padding: 28px 32px 40px;
    display: grid;
    gap: 20px;
}

.flash-stack {
    display: grid;
    gap: 10px;
}

.flash {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-xs);
    font-weight: 600;
    color: var(--color-text);
}

.flash--success {
    color: var(--color-success);
    background: var(--color-success-soft);
    border-color: color-mix(in srgb, var(--color-success) 40%, #ffffff);
}

.flash--error {
    color: var(--color-danger);
    background: var(--color-danger-soft);
    border-color: color-mix(in srgb, var(--color-danger) 40%, #ffffff);
}

.panel,
.metric-tile,
.course-summary-card,
.issue-row,
.sync-banner,
.auth-card,
.settings-card {
    border: 1px solid var(--line);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-sm);
}

.panel,
.course-summary-card,
.settings-card,
.issue-row,
.auth-card,
.sync-banner {
    backdrop-filter: blur(6px);
}

.panel,
.sync-banner,
.auth-card {
    border-radius: var(--radius-lg);
}

.panel {
    padding: 22px;
}

.panel__header {
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 18px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.metric-grid--saas,
.metric-grid--inline {
    align-items: stretch;
}

.metric-grid--inline {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 18px;
}

.metric-tile {
    padding: 18px;
    border-radius: 20px;
    display: grid;
    gap: 8px;
}

.metric-tile__value {
    font-size: clamp(1.55rem, 2vw, 2.1rem);
    letter-spacing: -0.04em;
}

.metric-tile--danger {
    background: linear-gradient(180deg, rgba(220, 38, 38, 0.05), rgba(255, 255, 255, 1));
}

.metric-tile--success {
    background: linear-gradient(180deg, rgba(22, 163, 74, 0.05), rgba(255, 255, 255, 1));
}

.metric-tile--info {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.05), rgba(255, 255, 255, 1));
}

.dashboard-page,
.course-page,
.issues-page,
.settings-page {
    display: grid;
    gap: 20px;
}

.dashboard-main-grid,
.course-overview-grid,
.settings-grid--top {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
    gap: 20px;
}

.chart-panel {
    min-height: 420px;
}

.chart-surface {
    position: relative;
    min-height: 300px;
    border-radius: 20px;
    background: linear-gradient(180deg, #fbfcff 0%, #f6f8fc 100%);
    overflow: hidden;
}

.chart-skeleton {
    position: absolute;
    inset: 0;
    display: grid;
    gap: 14px;
    align-content: center;
    padding: 30px;
}

.chart-skeleton span {
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(229, 234, 242, 0.8), rgba(240, 244, 250, 1), rgba(229, 234, 242, 0.8));
    background-size: 200% 100%;
    animation: shimmer 1.4s linear infinite;
}

.chart-svg {
    width: 100%;
    height: 100%;
}

.chart-grid-line,
.chart-axis-line {
    stroke: rgba(203, 213, 225, 0.7);
    stroke-width: 1;
}

.chart-label {
    fill: #7b8698;
    font-size: 12px;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.chart-series-line {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 6px 18px rgba(15, 23, 42, 0.08));
}

.chart-series-point {
    stroke: #fff;
    stroke-width: 2;
}

.chart-legend {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.chart-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: var(--bg-soft);
    color: var(--ink-soft);
    font-size: 0.84rem;
    font-weight: 600;
    white-space: nowrap;
    appearance: none;
    box-shadow: none;
    transition: transform 0.16s ease, border-color 0.16s ease, opacity 0.16s ease, background-color 0.16s ease;
}

.chart-legend__item:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
}

.chart-legend__item.is-muted {
    opacity: 0.55;
}

.chart-legend__swatch {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex: 0 0 auto;
}

.recent-panel {
    display: grid;
    align-content: start;
}

.recent-issues {
    display: grid;
    gap: 10px;
}

.recent-issue {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #fbfcfe;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.recent-issue:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.recent-issue__state,
.issue-row__status {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-top: 6px;
}

.recent-issue__state--pending,
.issue-row__status--pending,
.issue-state--pending {
    background: var(--danger);
}

.recent-issue__state--answered,
.issue-row__status--answered,
.issue-state--answered {
    background: var(--success);
}

.recent-issue__state--important,
.issue-row__status--important,
.issue-state--important {
    background: var(--warning);
}

.course-directory,
.issue-board-panel,
.composer-card-saas,
.course-overview-panel,
.tutor-card,
.insight-card,
.settings-activity-panel {
    display: grid;
    gap: 16px;
}

.course-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.course-summary-card {
    border-radius: 22px;
    padding: 18px;
    display: grid;
    gap: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 255, 0.9));
}

.course-summary-card__header,
.course-summary-card__stats,
.sync-banner,
.sync-banner__actions,
.issue-moderation__actions,
.settings-toolbar,
.auth-card,
.auth-feature-list,
.insight-listing {
    justify-content: space-between;
}

.course-summary-card__status,
.issue-chip,
.issue-state,
.course-summary-card__slug,
.tutor-banner__status {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.course-summary-card__status,
.issue-chip,
.issue-state,
.course-summary-card__slug {
    border: 1px solid var(--line);
    background: var(--bg-soft);
}

.course-summary-card__status--attention,
.issue-chip--important {
    color: #9a3412;
    background: var(--warning-soft);
    border-color: rgba(217, 119, 6, 0.18);
}

.issue-state,
.issue-chip--course,
.course-summary-card__slug {
    color: var(--ink-soft);
}

.issue-state {
    gap: 8px;
    padding-inline: 12px;
}

.issue-state--pending {
    color: #991b1b;
    background: var(--danger-soft);
    border-color: rgba(220, 38, 38, 0.16);
}

.issue-state--answered {
    color: #166534;
    background: var(--success-soft);
    border-color: rgba(22, 163, 74, 0.18);
}

.issue-state--important {
    color: #9a3412;
    background: var(--warning-soft);
    border-color: rgba(217, 119, 6, 0.18);
}

.course-summary-card__title,
.issue-row__title,
.auth-feature-list strong,
.empty-state h3 {
    margin: 0;
    font-size: 1.06rem;
    letter-spacing: -0.03em;
}

.course-summary-card__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.course-summary-card__stats span,
.insight-listing span {
    display: grid;
    gap: 4px;
    color: var(--ink-soft);
    font-size: 0.86rem;
}

.course-summary-card__stats strong,
.insight-listing strong,
.issue-board-summary strong {
    color: var(--ink);
    font-size: 1.15rem;
}

.sync-banner {
    padding: 18px 20px;
    align-items: center;
}

.sync-banner__title {
    margin: 6px 0 0;
    font-size: 1.2rem;
}

.course-side-stack {
    display: grid;
    gap: 20px;
}

.course-overview-panel__topline {
    justify-content: space-between;
}

.course-overview-panel__title {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.course-summary-card__status--closed {
    color: #9a3412;
    background: rgba(217, 119, 6, 0.12);
    border-color: rgba(217, 119, 6, 0.2);
}

.student-progress {
    margin-top: 4px;
}

.student-metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 20px;
}

.student-metric-button {
    width: 100%;
    padding: 18px 18px 16px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.04), rgba(255, 255, 255, 1));
    color: var(--ink);
    text-decoration: none;
    text-align: left;
    display: grid;
    gap: 6px;
    box-shadow: var(--shadow-xs);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.student-metric-button:hover {
    transform: translateY(-1px);
    border-color: #c5d0e0;
    box-shadow: var(--shadow-sm);
}

.student-metric-button.is-active,
.student-metric-button[aria-expanded='true'] {
    border-color: rgba(59, 130, 246, 0.28);
    box-shadow: var(--shadow-sm);
}

.student-metric-button--danger {
    background: linear-gradient(180deg, rgba(220, 38, 38, 0.06), rgba(255, 255, 255, 1));
}

.student-metric-button--success {
    background: linear-gradient(180deg, rgba(22, 163, 74, 0.06), rgba(255, 255, 255, 1));
}

.student-metric-button__label {
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.student-metric-button__value {
    font-size: clamp(1.8rem, 3.2vw, 2.4rem);
    letter-spacing: -0.06em;
}

.student-metric-button__hint {
    color: var(--ink-soft);
    line-height: 1.5;
}

.student-question-panels {
    display: grid;
    gap: 16px;
}

.student-question-panel,
.composer-card-saas--student,
.course-lock-panel {
    scroll-margin-top: 120px;
}

.student-question-panel.is-active {
    border-color: rgba(59, 130, 246, 0.16);
}

.course-lock-panel {
    border: 1px solid rgba(217, 119, 6, 0.22);
    background: linear-gradient(180deg, rgba(217, 119, 6, 0.08), rgba(255, 255, 255, 1));
}

.composer-card-saas--student,
.tutor-card--student,
.insight-card--student,
.course-overview-panel--student {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.04), rgba(255, 255, 255, 1));
}

.student-progress__card {
    min-width: 150px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #fbfcfe;
    display: grid;
    gap: 4px;
}

.student-progress__card span {
    color: var(--ink-soft);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.student-progress__card strong {
    font-size: 1.4rem;
    letter-spacing: -0.04em;
}

.student-progress__card--pending strong {
    color: var(--danger);
}

.student-progress__card--answered strong {
    color: var(--success);
}

.composer-card-saas__grid,
.issue-reply-form,
.settings-form,
.issue-board-list,
.month-stack,
.auth-card__copy,
.auth-card__panel,
.auth-feature-list,
.course-side-stack,
.empty-state {
    display: grid;
    gap: 14px;
}

.composer-card-saas__title,
.composer-card-saas__editor,
.settings-input,
.issue-toolbar__search input,
.issue-reply-form__textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    color: var(--ink);
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.composer-card-saas__title,
.settings-input,
.issue-toolbar__search input {
    min-height: 48px;
    padding: 0 14px;
}

.composer-card-saas__editor,
.issue-reply-form__textarea {
    min-height: 140px;
    padding: 14px;
    resize: vertical;
}

.composer-card-saas__title:focus,
.composer-card-saas__editor:focus,
.settings-input:focus,
.issue-toolbar__search input:focus,
.issue-reply-form__textarea:focus {
    outline: none;
    border-color: rgba(131, 167, 220, 0.75);
    box-shadow: 0 0 0 4px rgba(131, 167, 220, 0.16);
}

.composer-card-saas__footer,
.settings-toolbar,
.issue-toolbar,
.issue-toolbar__searchline,
.issue-detail__header {
    align-items: center;
    justify-content: space-between;
}

.composer-card-saas__footer.is-dragover {
    border-color: rgba(59, 130, 246, 0.32);
    background: rgba(59, 130, 246, 0.06);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.12);
}

.composer-card-saas__meta {
    align-items: center;
}

.composer-card-saas__topics {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(248, 250, 252, 0.92);
}

.composer-card-saas__topics-copy {
    display: grid;
    gap: 4px;
}

.composer-card-saas__topics-copy strong {
    color: #0f172a;
    font-size: 1rem;
}

.composer-card-saas__topics-copy span {
    color: #475569;
    font-size: 0.92rem;
    line-height: 1.5;
}

.composer-preview--saas {
    display: grid;
    gap: 10px;
}

.composer-preview__visuals {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.composer-preview__visuals.is-single {
    grid-template-columns: minmax(0, 1fr);
}

.composer-preview__visual {
    display: grid;
    gap: 0;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #fbfcfe;
}

.composer-preview__visual-link {
    display: block;
    color: inherit;
    text-decoration: none;
    cursor: zoom-in;
}

.composer-preview__visual-link--video {
    cursor: pointer;
}

.composer-preview__visual-link:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.42);
    outline-offset: 4px;
    border-radius: 16px;
}

.composer-preview__visual-frame {
    position: relative;
    min-height: 180px;
    padding: 10px;
    background: #ffffff;
}

.composer-preview__visuals.is-single .composer-preview__visual-frame {
    min-height: 280px;
}

.composer-preview__visual img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    border-radius: 12px;
    background: #ffffff;
}

.composer-preview__visual video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    border-radius: 12px;
    background: #0f172a;
    pointer-events: none;
}

.composer-preview__play-badge {
    position: absolute;
    right: 18px;
    bottom: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 700;
    pointer-events: none;
}

.composer-preview__visual figcaption {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
}

.composer-preview__visual figcaption strong {
    font-size: 0.92rem;
    color: #0f172a;
}

.composer-preview__visual figcaption span {
    color: var(--ink-soft);
    line-height: 1.5;
}

.composer-preview__visual--sketch .composer-preview__visual-frame {
    background: #f8fafc;
}

.composer-preview__intro {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.14);
    background: rgba(59, 130, 246, 0.06);
}

.composer-preview__intro strong {
    font-size: 0.9rem;
}

.composer-preview__intro span {
    color: var(--ink-soft);
    line-height: 1.55;
}

@media (max-width: 760px) {
    .composer-preview__visuals {
        grid-template-columns: minmax(0, 1fr);
    }

    .composer-preview__visual-frame {
        min-height: clamp(148px, 48vw, 200px);
    }

    .composer-preview__visuals.is-single .composer-preview__visual-frame {
        min-height: clamp(200px, 78vw, 320px);
    }
}

.composer-file,
.issue-file {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #fbfcfe;
}

.issue-file {
    grid-template-columns: 48px minmax(0, 1fr);
}

.composer-file__thumb,
.issue-file__icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-soft);
    color: var(--brand-strong);
    font-size: 0.8rem;
    font-weight: 800;
}

.composer-file__thumb img,
.issue-file__icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.composer-file__thumb video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    background: #0f172a;
}

.composer-file__meta,
.issue-file__copy,
.recent-issue__copy,
.issue-row__content {
    min-width: 0;
}

.composer-file__meta strong,
.issue-file__copy strong,
.recent-issue__copy strong,
.issue-row__title {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.composer-file__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid var(--line-strong);
    background: #fff;
    font-weight: 700;
}

.composer-existing-attachments {
    display: grid;
    gap: 12px;
}

.composer-file__meta--stacked {
    display: grid;
    gap: 2px;
}

.composer-file__meta--stacked strong,
.composer-file__meta--stacked small {
    white-space: normal;
}

.composer-file__status {
    color: var(--ink-soft);
}

.composer-file--existing.is-marked-for-removal {
    border-style: dashed;
    border-color: rgba(220, 38, 38, 0.34);
    background: rgba(254, 242, 242, 0.92);
}

.composer-file--existing.is-marked-for-removal .composer-file__thumb,
.composer-file--existing.is-marked-for-removal .composer-file__meta {
    opacity: 0.62;
}

.composer-file--sketch {
    align-items: stretch;
}

.composer-file__thumb--sketch {
    background: #ffffff;
    border: 1px solid var(--line);
}

.sketch-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(10px);
}

.sketch-modal__dialog {
    width: min(1120px, 100%);
    display: grid;
    gap: 18px;
    padding: 22px;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(248, 250, 252, 0.98);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.26);
}

.sketch-modal__header,
.sketch-modal__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.sketch-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.sketch-toolbar__group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sketch-toolbar .topbar-button.is-active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--brand) 0%, var(--violet) 100%);
}

.sketch-color {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 2px solid transparent;
    background: var(--sketch-color, #111827);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), var(--shadow-xs);
}

.sketch-color.is-active {
    border-color: rgba(15, 23, 42, 0.14);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
}

.sketch-size-control {
    display: grid;
    gap: 6px;
    min-width: 160px;
    color: var(--ink-soft);
    font-size: 0.84rem;
    font-weight: 700;
}

.sketch-stage {
    position: relative;
    min-height: min(68vh, 620px);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.02);
    touch-action: none;
    overscroll-behavior: contain;
    -webkit-user-select: none;
    user-select: none;
}

.whiteboard-container {
    position: relative;
    overflow: hidden;
    touch-action: none;
}

.sketch-stage.is-dragover {
    box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.22);
}

.sketch-modal__canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.sketch-modal__canvas--background {
    z-index: 1;
}

.sketch-modal__canvas--drawing {
    z-index: 2;
}

.sketch-stage__hint {
    position: absolute;
    right: 18px;
    bottom: 18px;
    z-index: 3;
    max-width: min(360px, calc(100% - 36px));
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: 4px;
    pointer-events: none;
}

.sketch-stage__hint strong {
    font-size: 0.94rem;
}

.sketch-stage__hint span {
    color: var(--ink-soft);
    line-height: 1.5;
}

.sketch-pointer-preview {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 4;
    border-radius: 999px;
    pointer-events: none;
    border: 2px solid rgba(15, 23, 42, 0.72);
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85), 0 10px 18px rgba(15, 23, 42, 0.16);
    transform: translate(-9999px, -9999px);
}

.sketch-pointer-preview.is-pen {
    border-color: color-mix(in srgb, var(--sketch-pointer-color, #111827) 72%, #0f172a 28%);
    background: color-mix(in srgb, var(--sketch-pointer-color, #111827) 20%, #ffffff 80%);
}

.sketch-pointer-preview.is-eraser {
    border-color: rgba(220, 38, 38, 0.9);
    border-style: dashed;
    background:
        radial-gradient(circle at center, rgba(255, 255, 255, 0.92) 0 38%, rgba(248, 113, 113, 0.24) 39%, rgba(248, 113, 113, 0.08) 100%);
}

body.has-sketch-modal {
    overflow: hidden;
}

.status-overlay {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(8px);
}

.status-overlay__dialog {
    width: min(420px, 100%);
    padding: 22px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(248, 250, 252, 0.98);
    box-shadow: var(--shadow-md);
    display: grid;
    justify-items: center;
    gap: 10px;
    text-align: center;
}

.status-overlay__spinner {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 3px solid rgba(59, 130, 246, 0.18);
    border-top-color: var(--brand);
    animation: spin 0.9s linear infinite;
}

.toast-host {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 75;
    display: grid;
    gap: 10px;
}

.toast {
    min-width: 280px;
    max-width: min(420px, calc(100vw - 36px));
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(248, 250, 252, 0.98);
    box-shadow: var(--shadow-md);
    color: var(--ink);
    transform: translateY(10px);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
    transform: translateY(0);
    opacity: 1;
}

.toast--success {
    border-color: rgba(22, 163, 74, 0.18);
    background: rgba(240, 253, 244, 0.98);
}

.toast--error {
    border-color: rgba(220, 38, 38, 0.2);
    background: rgba(254, 242, 242, 0.98);
}

.toast--actionable {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
}

.toast__content {
    display: grid;
    gap: 8px;
}

.toast__title,
.toast__message {
    margin: 0;
}

.toast__title {
    font-size: 0.94rem;
    line-height: 1.3;
}

.toast__message {
    color: var(--ink-soft);
    font-size: 0.9rem;
    line-height: 1.45;
}

.toast__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.toast__button,
.toast__dismiss {
    min-height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(37, 99, 235, 0.16);
    background: rgba(239, 246, 255, 0.9);
    color: #1d4ed8;
    font-size: 0.84rem;
    font-weight: 700;
    padding: 0 12px;
}

.toast__dismiss {
    align-self: start;
    border-color: transparent;
    background: transparent;
    color: var(--ink-soft);
}

.discussion-thread.is-live-fresh {
    border-color: rgba(37, 99, 235, 0.34);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12), var(--shadow-md);
}

.issue-toolbar {
    align-items: flex-start;
    justify-content: space-between;
}

.issue-toolbar__filters,
.issue-toolbar__actions {
    gap: 8px;
}

.issue-filter {
    min-height: 36px;
    padding-inline: 12px;
    border-radius: 999px;
    background: var(--bg-soft);
}

.issue-toolbar__search {
    flex: 1 1 280px;
    max-width: 360px;
}

.issue-board-summary {
    display: flex;
    align-items: baseline;
    gap: 10px;
    color: var(--ink-soft);
}

.month-cluster {
    display: grid;
    gap: 12px;
}

.month-cluster__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 4px;
    color: var(--ink-soft);
}

.month-cluster__header strong {
    display: block;
    color: var(--ink);
}

.month-cluster__meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.issue-board-list {
    gap: 12px;
}

.issue-row {
    border-radius: 20px;
    overflow: hidden;
    transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.issue-row--pending {
    border-color: rgba(220, 38, 38, 0.18);
    background: linear-gradient(180deg, rgba(254, 242, 242, 0.98), #ffffff);
}

.issue-row--answered {
    border-color: rgba(22, 163, 74, 0.18);
    background: linear-gradient(180deg, rgba(240, 253, 244, 0.98), #ffffff);
}

.issue-row--important {
    border-color: rgba(245, 158, 11, 0.24);
    background: linear-gradient(180deg, rgba(255, 247, 237, 0.98), #ffffff);
}

.issue-row:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.issue-row.is-open {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-md);
}

.issue-row--pending.is-open {
    border-color: rgba(220, 38, 38, 0.28);
}

.issue-row--answered.is-open {
    border-color: rgba(22, 163, 74, 0.28);
}

.issue-row--important.is-open {
    border-color: rgba(245, 158, 11, 0.32);
}

.issue-row__summary {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
    padding: 16px 18px;
    border: 0;
    background: transparent;
    text-align: left;
}

.issue-row__headline,
.issue-row__meta {
    align-items: center;
}

.issue-row__headline {
    gap: 8px;
}

.issue-row__meta {
    gap: 8px;
    justify-content: flex-end;
    color: var(--ink-soft);
    font-size: 0.84rem;
}

.issue-chip {
    color: var(--ink-soft);
}

.issue-row__detail {
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.issue-detail {
    display: grid;
    gap: 18px;
    padding: 20px 18px 18px;
}

.issue-detail__meta {
    color: var(--ink-soft);
    font-size: 0.84rem;
}

.issue-detail__body,
.issue-answer,
.issue-moderation,
.empty-state,
.auth-card {
    border-radius: 18px;
}

.issue-detail__question {
    padding: 16px;
    border-radius: 18px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
}

.issue-detail__question--pending {
    background: rgba(254, 242, 242, 0.88);
    border-color: rgba(220, 38, 38, 0.16);
}

.issue-detail__question--answered {
    background: rgba(240, 253, 244, 0.92);
    border-color: rgba(22, 163, 74, 0.18);
}

.issue-detail__question--important {
    background: rgba(255, 247, 237, 0.94);
    border-color: rgba(245, 158, 11, 0.22);
}

.issue-detail__attachments {
    gap: 10px;
}

.issue-answer {
    padding: 16px;
    border: 1px solid rgba(22, 163, 74, 0.16);
    background: rgba(22, 163, 74, 0.05);
}

.issue-answer--pending {
    border-color: rgba(220, 38, 38, 0.16);
    background: rgba(254, 242, 242, 0.82);
}

.issue-answer--answered {
    border-color: rgba(22, 163, 74, 0.16);
    background: rgba(240, 253, 244, 0.9);
}

.issue-answer--important {
    border-color: rgba(245, 158, 11, 0.22);
    background: rgba(255, 247, 237, 0.9);
}

.issue-answer--empty {
    border-color: var(--line);
    background: #fbfcfe;
}

.issue-answer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    color: var(--ink-soft);
    font-size: 0.84rem;
}

.issue-answer__label {
    font-weight: 700;
    color: var(--ink);
}

.issue-answer__quick-reply {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(148, 163, 184, 0.36);
}

.issue-moderation {
    padding: 16px;
    border: 1px solid var(--line);
    background: #fbfcfe;
    display: grid;
    gap: 14px;
}

.issue-inline-button {
    min-height: 36px;
    padding-inline: 12px;
    border-radius: 12px;
}

.issue-reply-form__textarea {
    min-height: 120px;
}

.author-reveal__value {
    color: var(--ink-soft);
    font-size: 0.88rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.settings-card {
    border-radius: 22px;
    padding: 0;
}

.settings-card--embedded {
    padding: 18px;
}

.settings-form {
    gap: 12px;
}

.settings-form--inline {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.settings-form label,
.settings-toolbar label {
    display: grid;
    gap: 6px;
}

.settings-form--maintenance {
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(182, 195, 228, 0.45);
    background: linear-gradient(180deg, rgba(131, 167, 220, 0.08), rgba(176, 163, 194, 0.08));
}

.settings-switch {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(182, 195, 228, 0.55);
    background: rgba(255, 255, 255, 0.92);
    cursor: pointer;
}

.settings-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.settings-switch > span {
    display: grid;
    gap: 4px;
}

.settings-switch > span strong {
    font-size: 0.98rem;
    letter-spacing: -0.02em;
}

.settings-switch__track {
    width: 54px;
    height: 30px;
    border-radius: 999px;
    background: #dce5f8;
    border: 1px solid #c3d0ec;
    position: relative;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.settings-switch__track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(10, 10, 11, 0.18);
    transition: transform 0.2s ease;
}

.settings-switch input:checked + .settings-switch__track {
    background: linear-gradient(135deg, #83a7dc, #7c8cc3);
    border-color: #7c8cc3;
}

.settings-switch input:checked + .settings-switch__track::after {
    transform: translateX(24px);
}

.settings-switch:focus-within {
    outline: 2px solid rgba(131, 167, 220, 0.55);
    outline-offset: 2px;
}

.settings-form label span,
.settings-toolbar label span {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ink-soft);
}

.settings-activity-panel {
    gap: 18px;
}

.settings-access-panel {
    gap: 18px;
}

.settings-access-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.settings-access-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.settings-access-card {
    padding: 18px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.04), rgba(255, 255, 255, 1));
    display: grid;
    gap: 8px;
}

.settings-access-card strong {
    font-size: 1.1rem;
    letter-spacing: -0.03em;
}

.settings-access-card small {
    color: var(--ink-soft);
    line-height: 1.55;
}

.settings-grid--access {
    display: grid;
    grid-template-columns: minmax(300px, 0.95fr) minmax(0, 1.25fr);
    gap: 18px;
}

.settings-access-note {
    border-style: solid;
}

.settings-access-note--success {
    border-color: rgba(22, 163, 74, 0.16);
    background: rgba(22, 163, 74, 0.05);
}

.settings-table--compact {
    min-width: 640px;
}

.settings-table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 18px;
}

.settings-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
}

.settings-table th,
.settings-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    font-size: 0.9rem;
}

.settings-table th {
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-soft);
    background: #fbfcff;
}

.settings-table tr:last-child td {
    border-bottom: 0;
}

.empty-state {
    padding: 24px;
    border: 1px dashed var(--line-strong);
    background: #fbfcff;
    text-align: left;
}

.empty-state--compact {
    padding: 18px;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at 10% 10%, rgba(131, 167, 220, 0.16), transparent 30%),
        radial-gradient(circle at 88% 0%, rgba(176, 163, 194, 0.15), transparent 28%),
        linear-gradient(180deg, #fefefe 0%, #f4f7fd 100%);
}

.auth-shell__toolbar {
    width: min(1120px, 100%);
    display: flex;
    justify-content: flex-end;
    margin-bottom: 14px;
}

.auth-shell__panel {
    width: min(1120px, 100%);
}

.auth-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 0;
    overflow: hidden;
}

.auth-card__copy,
.auth-card__panel {
    padding: 34px;
}

.auth-card__copy {
    display: grid;
    gap: 18px;
    align-content: center;
}

.auth-brand {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: #fbfcff;
}

.auth-brand img {
    width: 104px;
    height: 54px;
    padding: 6px 10px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(131, 167, 220, 0.24), rgba(176, 163, 194, 0.2));
    object-fit: contain;
}

.auth-brand div {
    display: grid;
    gap: 4px;
}

.auth-brand strong {
    font-size: 1rem;
    letter-spacing: -0.03em;
}

.auth-brand span {
    color: var(--ink-soft);
    font-size: 0.88rem;
}

.auth-card__panel {
    background: linear-gradient(180deg, rgba(182, 195, 228, 0.28) 0%, rgba(255, 255, 255, 0.92) 100%);
    border-left: 1px solid var(--line);
}

.auth-card__eyebrow {
    display: inline-flex;
    width: fit-content;
    min-height: 32px;
    align-items: center;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(131, 167, 220, 0.16);
    color: #4d6096;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-card__title {
    font-size: clamp(2.3rem, 5vw, 4.2rem);
}

.auth-card__actions {
    gap: 10px;
}

.auth-card__button {
    min-height: 48px;
    width: fit-content;
}

.auth-feature-list {
    align-content: start;
    gap: 16px;
}

.auth-feature-list article {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.auth-feature-list article:last-child {
    border-bottom: 0;
}

.auth-feature-list p {
    margin: 6px 0 0;
    color: var(--ink-soft);
    line-height: 1.6;
}

.auth-loading-inline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink-soft);
}

.auth-loading-inline__dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--brand);
    animation: pulse 1s ease-in-out infinite;
}

.maintenance-page {
    position: relative;
    width: min(980px, 100%);
    min-height: min(760px, calc(100vh - 56px));
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 30px;
}

.maintenance-page__ambient {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.maintenance-page__blob {
    position: absolute;
    border-radius: 999px;
    filter: blur(1px);
    opacity: 0.55;
    animation: maintenanceFloat 8s ease-in-out infinite;
}

.maintenance-page__blob--one {
    width: 280px;
    height: 280px;
    top: -40px;
    left: -20px;
    background: radial-gradient(circle, rgba(131, 167, 220, 0.44), rgba(131, 167, 220, 0));
}

.maintenance-page__blob--two {
    width: 250px;
    height: 250px;
    right: -40px;
    top: 24%;
    background: radial-gradient(circle, rgba(176, 163, 194, 0.38), rgba(176, 163, 194, 0));
    animation-delay: 1.2s;
}

.maintenance-page__blob--three {
    width: 220px;
    height: 220px;
    left: 34%;
    bottom: -70px;
    background: radial-gradient(circle, rgba(182, 195, 228, 0.45), rgba(182, 195, 228, 0));
    animation-delay: 2.1s;
}

.maintenance-card {
    position: relative;
    z-index: 1;
    width: min(700px, 100%);
    padding: clamp(24px, 5vw, 44px);
    border-radius: 28px;
    border: 1px solid rgba(182, 195, 228, 0.48);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 255, 0.96));
    box-shadow: 0 28px 56px rgba(10, 10, 11, 0.1);
    text-align: center;
    display: grid;
    gap: 14px;
}

.maintenance-card__icon {
    width: 72px;
    height: 72px;
    margin: 0 auto;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 2rem;
    background: linear-gradient(135deg, rgba(131, 167, 220, 0.3), rgba(176, 163, 194, 0.35));
    border: 1px solid rgba(176, 163, 194, 0.3);
}

.maintenance-card__eyebrow {
    display: inline-flex;
    margin: 0 auto;
    min-height: 32px;
    align-items: center;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(176, 163, 194, 0.4);
    background: rgba(176, 163, 194, 0.14);
    color: #675977;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.maintenance-card__title {
    margin: 0;
    font-size: clamp(1.9rem, 3.5vw, 2.8rem);
    letter-spacing: -0.04em;
    line-height: 1.1;
}

.maintenance-card__lead {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.72;
    color: #364065;
}

.maintenance-card__text {
    margin: 0;
    color: var(--ink-soft);
    line-height: 1.75;
}

.maintenance-card__actions {
    display: flex;
    justify-content: center;
    margin-top: 6px;
}

.maintenance-card__footnote {
    color: #6d789f;
    font-size: 0.9rem;
}

@keyframes shimmer {
    to {
        background-position: -200% 0;
    }
}

@keyframes pulse {
    0%,
    100% {
        opacity: 0.35;
        transform: scale(0.9);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes maintenanceFloat {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

html[data-theme='dark'] {
    --color-primary: #60a5fa;
    --color-primary-hover: #93c5fd;
    --color-primary-active: #bfdbfe;
    --color-primary-text: #081427;
    --color-secondary: #cbd5e1;
    --color-secondary-hover: #e2e8f0;
    --color-secondary-text: #0b1629;
    --color-info: #93c5fd;
    --color-info-soft: #132745;
    --color-info-text: #081427;
    --color-surface: #0b1629;
    --color-surface-muted: #13213a;
    --color-surface-subtle: #162844;
    --color-surface-strong: #1f3454;
    --color-surface-elevated: #0f1c31;
    --color-surface-panel: #101d33;
    --color-surface-content: #111b2d;
    --color-surface-content-muted: #172338;
    --color-surface-rich: #152237;
    --color-surface-rich-strong: #1a2a43;
    --color-text: #f8fbff;
    --color-text-muted: #d0dbed;
    --color-text-soft: #a9bdd9;
    --color-border: rgba(173, 192, 219, 0.3);
    --color-border-strong: rgba(202, 218, 241, 0.5);
    --color-border-soft: rgba(190, 206, 229, 0.4);
    --color-focus: #93c5fd;
    --color-focus-ring: rgba(96, 165, 250, 0.35);
    --color-placeholder: #9ab0cf;
    --color-disabled-text: #9cb0cb;
    --color-disabled-surface: #19283f;
    --color-disabled-border: #324968;
    --color-danger: #fca5a5;
    --color-danger-hover: #fecaca;
    --color-danger-text: #1f0b0b;
    --color-danger-soft: rgba(127, 29, 29, 0.5);
    --color-success: #86efac;
    --color-success-hover: #bbf7d0;
    --color-success-text: #082012;
    --color-success-soft: rgba(20, 83, 45, 0.42);
    --color-warning: #fcd34d;
    --color-warning-hover: #fde68a;
    --color-warning-text: #231307;
    --color-warning-soft: rgba(120, 53, 15, 0.5);
    --gradient-primary: linear-gradient(135deg, #93c5fd 0%, #60a5fa 56%, #c4b5fd 100%);
    --gradient-primary-hover: linear-gradient(135deg, #bfdbfe 0%, #93c5fd 56%, #ddd6fe 100%);
    --gradient-danger: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
    --gradient-secondary: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
    --gradient-info: linear-gradient(135deg, #93c5fd 0%, #60a5fa 100%);
    --color-table-header-bg: #1b2f4d;
    --color-table-row-alt: #102139;
    --color-tab-bg: #1a2d49;
    --color-tab-text: #d0dbed;
    --color-tab-active-bg: #60a5fa;
    --color-tab-active-text: #081427;
    --color-chip-bg: #1a3252;
    --color-chip-text: #bfdbfe;
    --color-course-priority-healthy-bg: rgba(20, 43, 74, 0.96);
    --color-course-priority-healthy-text: #e6f0ff;
    --color-course-priority-healthy-border: rgba(96, 165, 250, 0.26);
    --color-course-priority-attention-bg: rgba(91, 28, 28, 0.94);
    --color-course-priority-attention-text: #fecaca;
    --color-course-priority-attention-border: rgba(248, 113, 113, 0.28);
    --color-course-priority-recent-bg: rgba(23, 37, 84, 0.96);
    --color-course-priority-recent-text: #bfdbfe;
    --color-course-priority-recent-border: rgba(125, 211, 252, 0.28);
    --color-course-priority-closed-bg: rgba(124, 45, 18, 0.94);
    --color-course-priority-closed-text: #fed7aa;
    --color-course-priority-closed-border: rgba(251, 146, 60, 0.3);
    --color-breadcrumb-bg: #182a43;
    --color-breadcrumb-text: #d0dbed;
    --color-floating-menu-bg: #0f1c31;
    --color-floating-menu-text: #f8fbff;
    --color-tooltip-bg: #f8fbff;
    --color-tooltip-text: #0b1629;
    --color-stats-surface: #10213a;
    --color-stats-text: #f8fbff;
    --color-stats-muted: #cbd5e1;

    --bg: #07111d;
    --bg-elevated: var(--color-surface);
    --bg-soft: var(--color-surface-muted);
    --bg-dark: #040913;
    --bg-dark-soft: #0a1220;
    --ink: var(--color-text);
    --ink-soft: var(--color-text-soft);
    --line: var(--color-border);
    --line-strong: var(--color-border-strong);
    --shadow-xs: 0 1px 2px rgba(2, 6, 23, 0.34);
    --shadow-sm: 0 18px 44px rgba(2, 6, 23, 0.34);
    --shadow-md: 0 28px 60px rgba(2, 6, 23, 0.46);
    --brand: var(--color-primary);
    --brand-strong: var(--color-primary-hover);
    --success: var(--color-success);
    --success-soft: var(--color-success-soft);
    --danger: var(--color-danger);
    --danger-soft: var(--color-danger-soft);
    --warning: var(--color-warning);
    --warning-soft: var(--color-warning-soft);
    --violet: #b0a3c2;
    --violet-soft: rgba(176, 163, 194, 0.24);
    --text-primary: var(--color-text);
    --text-muted: var(--color-text-muted);
}

html[data-theme='dark'] body {
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.14), transparent 24%),
        radial-gradient(circle at bottom right, rgba(129, 140, 248, 0.14), transparent 22%),
        linear-gradient(180deg, #020617 0%, #07111d 52%, #0a1425 100%);
}

html[data-theme='dark'] .app-workspace {
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.96) 0%, rgba(7, 17, 29, 0.98) 100%);
}

html[data-theme='dark'] .app-topbar {
    background: rgba(5, 10, 20, 0.82);
    border-bottom-color: rgba(148, 163, 184, 0.12);
}

html[data-theme='dark'] .topbar-button,
html[data-theme='dark'] .issue-inline-button,
html[data-theme='dark'] .issue-filter,
html[data-theme='dark'] .course-summary-card__link,
html[data-theme='dark'] .theme-toggle,
html[data-theme='dark'] .composer-file__remove {
    background: rgba(15, 23, 42, 0.88);
    color: var(--ink);
    border-color: rgba(148, 163, 184, 0.18);
}

html[data-theme='dark'] .topbar-button:hover,
html[data-theme='dark'] .issue-inline-button:hover,
html[data-theme='dark'] .issue-filter:hover,
html[data-theme='dark'] .course-summary-card__link:hover,
html[data-theme='dark'] .theme-toggle:hover,
html[data-theme='dark'] .composer-file__remove:hover {
    border-color: rgba(96, 165, 250, 0.34);
}

html[data-theme='dark'] .topbar-button--primary,
html[data-theme='dark'] .course-summary-card__link,
html[data-theme='dark'] .issue-filter.is-active {
    color: var(--color-primary-text);
    border-color: transparent;
    background: var(--gradient-primary);
}

html[data-theme='dark'] .topbar-button--danger,
html[data-theme='dark'] .issue-inline-button--danger {
    color: var(--color-danger-text);
    border-color: transparent;
    background: var(--gradient-danger);
}

html[data-theme='dark'] .panel,
html[data-theme='dark'] .metric-tile,
html[data-theme='dark'] .course-summary-card,
html[data-theme='dark'] .issue-row,
html[data-theme='dark'] .sync-banner,
html[data-theme='dark'] .auth-card,
html[data-theme='dark'] .settings-card {
    background: var(--bg-elevated);
    border-color: rgba(148, 163, 184, 0.14);
    box-shadow: var(--shadow-sm);
}

html[data-theme='dark'] .metric-tile--danger {
    background: linear-gradient(180deg, rgba(220, 38, 38, 0.1), rgba(10, 17, 30, 0.95));
}

html[data-theme='dark'] .metric-tile--success {
    background: linear-gradient(180deg, rgba(22, 163, 74, 0.1), rgba(10, 17, 30, 0.95));
}

html[data-theme='dark'] .metric-tile--info {
    background: linear-gradient(180deg, rgba(14, 165, 233, 0.1), rgba(10, 17, 30, 0.95));
}

html[data-theme='dark'] .flash {
    background: rgba(10, 17, 30, 0.92);
    border-color: rgba(148, 163, 184, 0.14);
}

html[data-theme='dark'] .flash--success {
    color: #bbf7d0;
    background: rgba(22, 163, 74, 0.12);
    border-color: rgba(74, 222, 128, 0.2);
}

html[data-theme='dark'] .flash--error {
    color: #fecaca;
    background: rgba(220, 38, 38, 0.14);
    border-color: rgba(248, 113, 113, 0.22);
}

html[data-theme='dark'] .chart-surface,
html[data-theme='dark'] .recent-issue,
html[data-theme='dark'] .student-progress__card,
html[data-theme='dark'] .student-metric-button,
html[data-theme='dark'] .composer-file,
html[data-theme='dark'] .issue-file,
html[data-theme='dark'] .issue-answer--empty,
html[data-theme='dark'] .issue-moderation,
html[data-theme='dark'] .empty-state,
html[data-theme='dark'] .auth-brand,
html[data-theme='dark'] .settings-table th {
    background: rgba(15, 23, 42, 0.78);
    border-color: rgba(148, 163, 184, 0.14);
}

html[data-theme='dark'] .chart-surface {
    background: linear-gradient(180deg, rgba(5, 10, 20, 0.9) 0%, rgba(10, 17, 30, 0.98) 100%);
}

html[data-theme='dark'] .chart-skeleton span {
    background: linear-gradient(90deg, rgba(30, 41, 59, 0.92), rgba(51, 65, 85, 0.82), rgba(30, 41, 59, 0.92));
    background-size: 200% 100%;
}

html[data-theme='dark'] .chart-grid-line,
html[data-theme='dark'] .chart-axis-line {
    stroke: rgba(148, 163, 184, 0.18);
}

html[data-theme='dark'] .chart-label {
    fill: #8fa3bf;
}

html[data-theme='dark'] .chart-legend__item {
    border-color: rgba(148, 163, 184, 0.1);
}

html[data-theme='dark'] .chart-legend__item:hover {
    border-color: rgba(96, 165, 250, 0.28);
}

html[data-theme='dark'] .chart-legend__item.is-muted {
    opacity: 0.42;
}

html[data-theme='dark'] .recent-issue:hover,
html[data-theme='dark'] .issue-row:hover,
html[data-theme='dark'] .issue-row.is-open {
    box-shadow: var(--shadow-md);
}

html[data-theme='dark'] .issue-row--pending {
    border-color: rgba(248, 113, 113, 0.24);
    background: linear-gradient(180deg, rgba(69, 10, 10, 0.38), rgba(10, 17, 30, 0.96));
}

html[data-theme='dark'] .issue-row--answered {
    border-color: rgba(74, 222, 128, 0.24);
    background: linear-gradient(180deg, rgba(20, 83, 45, 0.34), rgba(10, 17, 30, 0.96));
}

html[data-theme='dark'] .issue-row--important {
    border-color: rgba(245, 158, 11, 0.28);
    background: linear-gradient(180deg, rgba(120, 53, 15, 0.36), rgba(10, 17, 30, 0.96));
}

html[data-theme='dark'] .issue-row.is-open {
    border-color: rgba(96, 165, 250, 0.24);
}

html[data-theme='dark'] .issue-row--pending.is-open {
    border-color: rgba(248, 113, 113, 0.36);
}

html[data-theme='dark'] .issue-row--answered.is-open {
    border-color: rgba(74, 222, 128, 0.36);
}

html[data-theme='dark'] .issue-row--important.is-open {
    border-color: rgba(245, 158, 11, 0.4);
}

html[data-theme='dark'] .issue-row__detail {
    border-top-color: rgba(148, 163, 184, 0.14);
    background: linear-gradient(180deg, rgba(7, 13, 25, 0.98) 0%, rgba(11, 18, 32, 0.96) 100%);
}

html[data-theme='dark'] .issue-detail__question,
html[data-theme='dark'] .course-summary-card__status,
html[data-theme='dark'] .issue-chip,
html[data-theme='dark'] .issue-state,
html[data-theme='dark'] .course-summary-card__slug,
html[data-theme='dark'] .composer-file__thumb,
html[data-theme='dark'] .issue-file__icon {
    background: rgba(17, 28, 46, 0.92);
    border-color: rgba(148, 163, 184, 0.14);
}

html[data-theme='dark'] .issue-detail__question--pending {
    background: rgba(69, 10, 10, 0.34);
    border-color: rgba(248, 113, 113, 0.22);
}

html[data-theme='dark'] .issue-detail__question--answered {
    background: rgba(20, 83, 45, 0.3);
    border-color: rgba(74, 222, 128, 0.22);
}

html[data-theme='dark'] .issue-detail__question--important {
    background: rgba(120, 53, 15, 0.3);
    border-color: rgba(245, 158, 11, 0.26);
}

html[data-theme='dark'] .issue-answer {
    background: rgba(22, 163, 74, 0.1);
    border-color: rgba(74, 222, 128, 0.18);
}

html[data-theme='dark'] .issue-answer--pending {
    background: rgba(69, 10, 10, 0.34);
    border-color: rgba(248, 113, 113, 0.22);
}

html[data-theme='dark'] .issue-answer--answered {
    background: rgba(20, 83, 45, 0.3);
    border-color: rgba(74, 222, 128, 0.22);
}

html[data-theme='dark'] .issue-answer--important {
    background: rgba(120, 53, 15, 0.3);
    border-color: rgba(245, 158, 11, 0.26);
}

html[data-theme='dark'] .course-summary-card__status--closed,
html[data-theme='dark'] .course-lock-panel {
    color: #fcd34d;
    background: rgba(120, 53, 15, 0.24);
    border-color: rgba(245, 158, 11, 0.24);
}

html[data-theme='dark'] .course-summary-card--attention {
    border-color: rgba(248, 113, 113, 0.28);
}

html[data-theme='dark'] .course-summary-card--attention .course-summary-card__surface {
    background: linear-gradient(180deg, rgba(69, 10, 10, 0.42), rgba(10, 17, 30, 0.96));
}

html[data-theme='dark'] .course-summary-card--healthy {
    border-color: rgba(74, 222, 128, 0.28);
}

html[data-theme='dark'] .course-summary-card--healthy .course-summary-card__surface {
    background: linear-gradient(180deg, rgba(20, 83, 45, 0.34), rgba(10, 17, 30, 0.96));
}

html[data-theme='dark'] .course-summary-card__status--healthy {
    color: #bbf7d0;
    background: rgba(20, 83, 45, 0.34);
    border-color: rgba(74, 222, 128, 0.2);
}

html[data-theme='dark'] .app-health {
    background: rgba(17, 28, 46, 0.92);
    border-color: rgba(148, 163, 184, 0.14);
}

html[data-theme='dark'] .app-health__copy small {
    color: rgba(226, 232, 240, 0.72);
}

html[data-theme='dark'] .app-health--healthy {
    background: rgba(20, 83, 45, 0.3);
    border-color: rgba(74, 222, 128, 0.22);
}

html[data-theme='dark'] .app-health--healthy .app-health__copy strong {
    color: #bbf7d0;
}

html[data-theme='dark'] .app-health--alert {
    background: rgba(69, 10, 10, 0.34);
    border-color: rgba(248, 113, 113, 0.24);
}

html[data-theme='dark'] .app-health--alert .app-health__copy strong {
    color: #fecaca;
}

html[data-theme='dark'] .composer-preview__intro {
    border-color: rgba(96, 165, 250, 0.22);
    background: rgba(37, 99, 235, 0.12);
}

html[data-theme='dark'] .composer-preview__visual {
    border-color: rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.92);
}

html[data-theme='dark'] .composer-preview__visual-frame,
html[data-theme='dark'] .composer-preview__visual img,
html[data-theme='dark'] .composer-preview__visual--sketch .composer-preview__visual-frame {
    background: #ffffff;
}

html[data-theme='dark'] .composer-preview__visual figcaption strong {
    color: #f8fafc;
}

html[data-theme='dark'] .composer-preview__visual figcaption span {
    color: #94a3b8;
}

html[data-theme='dark'] .course-overview-panel--student,
html[data-theme='dark'] .tutor-card--student,
html[data-theme='dark'] .insight-card--student,
html[data-theme='dark'] .composer-card-saas--student,
html[data-theme='dark'] .student-metric-button {
    background: linear-gradient(180deg, rgba(14, 165, 233, 0.08), rgba(10, 17, 30, 0.95));
}

html[data-theme='dark'] .student-metric-button.is-active,
html[data-theme='dark'] .student-metric-button[aria-expanded='true'] {
    border-color: rgba(96, 165, 250, 0.34);
}

html[data-theme='dark'] .composer-file__thumb--sketch,
html[data-theme='dark'] .sketch-modal__canvas {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.18);
}

html[data-theme='dark'] .sketch-modal {
    background: rgba(2, 6, 23, 0.78);
}

html[data-theme='dark'] .sketch-modal__dialog {
    background: rgba(7, 13, 25, 0.98);
    border-color: rgba(148, 163, 184, 0.18);
}

html[data-theme='dark'] .composer-card-saas__title,
html[data-theme='dark'] .composer-card-saas__editor,
html[data-theme='dark'] .settings-input,
html[data-theme='dark'] .issue-toolbar__search input,
html[data-theme='dark'] .issue-reply-form__textarea {
    background: rgba(5, 10, 20, 0.9);
    border-color: rgba(148, 163, 184, 0.16);
    color: var(--ink);
}

html[data-theme='dark'] .composer-card-saas__title::placeholder,
html[data-theme='dark'] .composer-card-saas__editor::placeholder,
html[data-theme='dark'] .settings-input::placeholder,
html[data-theme='dark'] .issue-toolbar__search input::placeholder,
html[data-theme='dark'] .issue-reply-form__textarea::placeholder {
    color: #6f8199;
}

html[data-theme='dark'] .composer-card-saas__footer.is-dragover {
    border-color: rgba(96, 165, 250, 0.3);
    background: rgba(37, 99, 235, 0.12);
}

html[data-theme='dark'] .settings-table-wrap,
html[data-theme='dark'] .settings-table th,
html[data-theme='dark'] .settings-table td,
html[data-theme='dark'] .auth-card__panel,
html[data-theme='dark'] .auth-feature-list article {
    border-color: rgba(148, 163, 184, 0.14);
}

html[data-theme='dark'] .auth-card__panel {
    background: linear-gradient(180deg, rgba(9, 16, 30, 0.96) 0%, rgba(13, 22, 39, 0.98) 100%);
}

html[data-theme='dark'] .auth-card__eyebrow {
    background: rgba(37, 99, 235, 0.16);
    color: #bfdbfe;
}

html[data-theme='dark'] .auth-brand img {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.22), rgba(14, 165, 233, 0.16));
}

html[data-theme='dark'] .settings-access-card,
html[data-theme='dark'] .status-overlay__dialog,
html[data-theme='dark'] .toast {
    background: rgba(10, 17, 30, 0.96);
    border-color: rgba(148, 163, 184, 0.16);
}

html[data-theme='dark'] .settings-access-note--success {
    background: rgba(22, 163, 74, 0.1);
    border-color: rgba(74, 222, 128, 0.2);
}

html[data-theme='dark'] .sketch-toolbar .topbar-button.is-active {
    background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
}

html[data-theme='dark'] .sketch-color.is-active {
    border-color: rgba(148, 163, 184, 0.18);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.14);
}

html[data-theme='dark'] .sketch-stage__hint {
    background: rgba(7, 13, 25, 0.92);
    border-color: rgba(148, 163, 184, 0.14);
}

html[data-theme='dark'] .status-overlay {
    background: rgba(2, 6, 23, 0.66);
}

html[data-theme='dark'] .toast--success {
    background: rgba(20, 83, 45, 0.92);
}

html[data-theme='dark'] .toast--error {
    background: rgba(127, 29, 29, 0.92);
}

html[data-theme='dark'] .theme-toggle__dot {
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.14);
}

@media (max-width: 1280px) {
    .dashboard-main-grid,
    .course-overview-grid,
    .settings-grid--top,
    .settings-grid--access {
        grid-template-columns: 1fr;
    }

    .metric-grid,
    .metric-grid--inline,
    .settings-access-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

body.has-reply-modal {
    overflow: hidden;
}

.issue-reply-modal {
    z-index: 34;
}

.issue-reply-modal__dialog {
    width: min(1040px, 100%);
    display: grid;
    gap: 18px;
}

.issue-reply-modal__header {
    margin-bottom: 0;
}

.issue-reply-modal__copy {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.issue-reply-modal__title {
    margin: 0;
}

.issue-reply-modal__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    color: var(--ink-soft);
    font-size: 0.9rem;
}

.issue-reply-modal__context {
    display: grid;
    gap: 8px;
    padding: 16px 18px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(243, 247, 255, 0.96));
}

.issue-reply-modal__summary {
    margin: 0;
    color: var(--ink);
    line-height: 1.75;
}

.issue-reply-form--modal {
    gap: 18px;
}

.issue-reply-form--modal .issue-reply-form__textarea {
    min-height: 220px;
}

/* Premium refresh: maintenance, home and thread visuals */
.maintenance-card__icon {
    width: 86px;
    height: 86px;
    border-radius: 22px;
    background: linear-gradient(140deg, rgba(131, 167, 220, 0.28), rgba(176, 163, 194, 0.26));
    border-color: rgba(131, 167, 220, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52), 0 10px 24px rgba(10, 10, 11, 0.1);
}

.maintenance-card__icon img {
    width: 64px;
    height: 34px;
    object-fit: contain;
    filter: drop-shadow(0 6px 12px rgba(10, 10, 11, 0.16));
}

.dashboard-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.95fr);
    align-items: stretch;
    gap: 18px;
    border-radius: 28px;
    border: 1px solid rgba(182, 195, 228, 0.55);
    background:
        radial-gradient(circle at 8% -24%, rgba(131, 167, 220, 0.3), transparent 42%),
        radial-gradient(circle at 92% 120%, rgba(176, 163, 194, 0.24), transparent 38%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.96));
    box-shadow: 0 22px 44px rgba(10, 10, 11, 0.08);
}

.dashboard-hero__copy {
    display: grid;
    gap: 10px;
    align-content: center;
    min-height: 180px;
}

.dashboard-hero__stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.dashboard-hero__stat {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(182, 195, 228, 0.54);
    background: rgba(255, 255, 255, 0.92);
}

.dashboard-hero__stat span {
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #66729c;
    font-weight: 700;
}

.dashboard-hero__stat strong {
    font-size: 1.5rem;
    letter-spacing: -0.04em;
}

.dashboard-hero__stat--attention {
    border-color: rgba(184, 62, 62, 0.22);
    background: linear-gradient(180deg, rgba(255, 237, 237, 0.8), rgba(255, 255, 255, 0.96));
}

.dashboard-hero__stat--fresh {
    border-color: rgba(124, 140, 195, 0.34);
    background: linear-gradient(180deg, rgba(233, 238, 255, 0.9), rgba(255, 255, 255, 0.96));
}

.course-directory {
    border-radius: 30px;
    border: 1px solid rgba(182, 195, 228, 0.48);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 255, 0.94));
}

.course-summary-grid {
    gap: 18px;
}

.course-summary-card {
    border-radius: 24px;
    border: 1px solid rgba(182, 195, 228, 0.58);
    padding: 0;
    overflow: hidden;
    background: transparent;
    box-shadow: 0 14px 28px rgba(10, 10, 11, 0.07);
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.course-summary-card:hover {
    transform: translateY(-4px);
    border-color: rgba(124, 140, 195, 0.65);
    box-shadow: 0 24px 36px rgba(10, 10, 11, 0.11);
}

.course-summary-card__surface {
    display: grid;
    gap: 12px;
    padding: 18px 18px 16px;
    min-height: 170px;
    background:
        radial-gradient(circle at 100% 0%, rgba(176, 163, 194, 0.16), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(245, 248, 255, 0.95));
}

.course-summary-card__title {
    font-size: 1.06rem;
    line-height: 1.3;
}

.course-summary-card__priority {
    display: inline-flex;
    width: fit-content;
    min-height: 30px;
    align-items: center;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(182, 195, 228, 0.58);
    background: rgba(246, 248, 255, 0.95);
    color: #4d5a89;
    font-size: 0.82rem;
    font-weight: 700;
}

.course-summary-card__priority--attention {
    border-color: rgba(184, 62, 62, 0.25);
    background: rgba(255, 238, 238, 0.88);
    color: #9e3f3f;
}

.course-summary-card__priority--recent,
.course-summary-card__priority--closed {
    border-color: rgba(124, 140, 195, 0.34);
    background: rgba(236, 241, 255, 0.92);
    color: #5c6fa8;
}

.course-summary-card__signal-row {
    min-height: 24px;
}

.course-summary-card__signal {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    border: 1px solid rgba(182, 195, 228, 0.55);
    color: #6070a7;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.course-summary-card__link--primary {
    min-height: 42px;
    border-radius: 12px;
    font-size: 0.9rem;
}

.discussion-thread.issue-row {
    border-radius: 22px;
    border: 1px solid rgba(182, 195, 228, 0.58);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 251, 255, 0.95));
    box-shadow: 0 14px 30px rgba(10, 10, 11, 0.08);
}

.discussion-thread.issue-row:hover {
    transform: translateY(-3px);
    border-color: rgba(124, 140, 195, 0.6);
    box-shadow: 0 24px 38px rgba(10, 10, 11, 0.12);
}

.discussion-thread__question {
    gap: 16px;
    padding: 24px;
    border-bottom: 1px solid rgba(182, 195, 228, 0.35);
}

.discussion-thread__title {
    font-size: clamp(1.28rem, 2vw, 1.52rem);
    line-height: 1.26;
}

.discussion-thread__meta {
    color: #7481aa;
}

.discussion-thread__status {
    border-color: rgba(182, 195, 228, 0.65);
    background: rgba(245, 248, 255, 0.96);
    color: #52639a;
}

.thread-response {
    border-radius: 18px;
    border: 1px solid rgba(182, 195, 228, 0.5);
    border-left: 4px solid #83a7dc;
    background: linear-gradient(180deg, rgba(247, 250, 255, 0.95), rgba(255, 255, 255, 0.99));
    box-shadow: 0 10px 24px rgba(10, 10, 11, 0.07);
}

.thread-response__avatar {
    background: linear-gradient(140deg, #7c8cc3 0%, #83a7dc 55%, #b0a3c2 100%);
    box-shadow: 0 8px 18px rgba(124, 140, 195, 0.34);
}

.thread-response__detail {
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.74);
    padding: 10px 12px;
}

.thread-composer__input {
    border-radius: 18px;
    border-color: rgba(182, 195, 228, 0.65);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 250, 255, 0.96));
}

.thread-composer__footer {
    border-color: rgba(182, 195, 228, 0.58);
    background: linear-gradient(180deg, rgba(247, 250, 255, 0.98), rgba(255, 255, 255, 0.96));
}

@media (max-width: 980px) {
    .dashboard-hero {
        grid-template-columns: 1fr;
    }

    .dashboard-hero__stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .dashboard-hero__stats {
        grid-template-columns: 1fr;
    }

    .discussion-thread__question {
        padding: 18px;
    }
}

.issue-reply-form--modal .issue-reply-form__footer {
    padding: 16px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: #fbfcfe;
}

.issue-reply-form--modal .composer-card-saas__meta {
    align-items: flex-start;
}

html[data-theme='dark'] .issue-reply-modal__dialog {
    background: linear-gradient(180deg, rgba(7, 12, 22, 0.98), rgba(6, 10, 18, 0.99));
    border-color: rgba(148, 163, 184, 0.16);
}

html[data-theme='dark'] .issue-reply-modal__context,
html[data-theme='dark'] .issue-reply-form--modal .issue-reply-form__footer {
    background: linear-gradient(180deg, rgba(10, 16, 28, 0.96), rgba(8, 13, 24, 0.98));
    border-color: rgba(148, 163, 184, 0.16);
}

html[data-theme='dark'] .issue-reply-modal__meta,
html[data-theme='dark'] .issue-reply-modal__summary {
    color: #e2e8f0;
}

@media (max-width: 760px) {
    .issue-reply-modal {
        padding: max(10px, env(safe-area-inset-top)) 10px max(14px, env(safe-area-inset-bottom));
    }

    .issue-reply-modal__dialog {
        width: 100%;
        max-height: 100dvh;
        padding: 14px;
        border-radius: 22px;
    }

    .issue-reply-modal__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .issue-reply-form--modal .issue-reply-form__textarea {
        min-height: 180px;
    }
}

@media (max-width: 1080px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        position: static;
        height: auto;
        grid-template-rows: auto;
        gap: 18px;
    }

    .app-topbar,
    .app-content {
        padding-inline: 20px;
    }

    .auth-card {
        grid-template-columns: 1fr;
    }

    .auth-card__panel {
        border-left: 0;
        border-top: 1px solid var(--line);
    }

    .auth-shell__toolbar {
        width: 100%;
    }

    .sidebar-brand__mark {
        width: 56px;
    }
}

@media (max-width: 760px) {
    .app-topbar,
    .app-content {
        padding: 18px;
    }

    .panel,
    .auth-card__copy,
    .auth-card__panel {
        padding: 18px;
    }

    .metric-grid,
    .metric-grid--inline,
    .settings-grid,
    .student-metric-grid,
    .settings-access-grid {
        grid-template-columns: 1fr;
    }

    .app-topbar,
    .panel__header,
    .issue-toolbar,
    .issue-toolbar__searchline,
    .course-overview-panel__topline,
    .issue-detail__header,
    .issue-moderation__actions,
    .composer-card-saas__footer,
    .settings-toolbar,
    .sync-banner {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-button,
    .issue-inline-button,
    .composer-file__remove,
    .course-summary-card__link,
    .student-metric-button,
    .issue-toolbar__search,
    .issue-toolbar__actions,
    .issue-toolbar__actions form,
    .sync-banner__actions,
    .sync-banner__actions a,
    .settings-toolbar,
    .settings-toolbar label,
    .settings-toolbar button {
        width: 100%;
    }

    .issue-row__summary {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .issue-row__meta {
        grid-column: 2 / 3;
        justify-content: flex-start;
    }

    .course-summary-card__stats {
        grid-template-columns: 1fr;
    }

    .settings-form--inline {
        grid-template-columns: 1fr;
    }

    .settings-access-actions,
    .sketch-toolbar,
    .sketch-modal__actions,
    .sketch-toolbar__group--actions {
        flex-direction: column;
        align-items: stretch;
    }

    .chart-legend {
        justify-content: flex-start;
    }

    .sketch-modal {
        padding: 12px;
    }

    .sketch-modal__dialog {
        padding: 16px;
        border-radius: 22px;
    }

    .sketch-stage {
        min-height: min(56vh, 460px);
    }

    .toast-host {
        left: 18px;
        right: 18px;
    }

    .toast {
        min-width: 0;
        max-width: none;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.app-shell--topnav {
    min-height: 100vh;
    display: block;
}

.app-shell--topnav .app-topbar {
    top: 0;
    z-index: 25;
    padding: 16px 28px;
}

.app-topbar__brandline {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    min-width: 0;
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.app-brand__mark {
    width: 52px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(59, 130, 246, 0.08);
}

.app-brand__mark img {
    width: 42px;
    height: 26px;
    object-fit: contain;
}

.app-brand__copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.app-brand__copy strong {
    font-size: 0.96rem;
    line-height: 1.1;
}

.app-brand__copy small {
    color: var(--ink-soft);
    line-height: 1.2;
}

.app-health {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.84);
    box-shadow: var(--shadow-xs);
    color: inherit;
    text-decoration: none;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.app-health[href]:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.app-health.is-static {
    cursor: default;
}

.app-health__dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex: 0 0 auto;
}

.app-health__copy {
    display: grid;
    gap: 2px;
}

.app-health__copy strong {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app-health__copy small {
    color: var(--ink-soft);
    font-size: 0.84rem;
    line-height: 1.2;
}

.app-health--healthy {
    border-color: rgba(22, 163, 74, 0.18);
    background: rgba(240, 253, 244, 0.92);
}

.app-health--healthy .app-health__dot {
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12);
}

.app-health--healthy .app-health__copy strong {
    color: #166534;
}

.app-health--alert {
    border-color: rgba(220, 38, 38, 0.18);
    background: rgba(254, 242, 242, 0.92);
}

.app-health--alert .app-health__dot {
    background: var(--danger);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

.app-health--alert .app-health__copy strong {
    color: #991b1b;
}

.app-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.68);
    backdrop-filter: blur(12px);
}

.app-nav__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    color: var(--ink-soft);
    font-size: 0.9rem;
    font-weight: 700;
    transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.app-nav__link:hover {
    color: var(--ink);
    background: rgba(59, 130, 246, 0.08);
}

.app-nav__link.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--brand) 0%, var(--violet) 100%);
    box-shadow: var(--shadow-xs);
}

.app-user {
    display: inline-grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 0 2px;
    min-width: 0;
}

.app-user__avatar {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-soft);
    color: var(--ink);
    font-weight: 800;
    overflow: hidden;
}

.app-user__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-user__copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.app-user__copy strong,
.app-user__copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-user__copy small {
    color: var(--ink-soft);
}

.theme-toggle {
    width: 42px;
    min-height: 42px;
    padding: 0;
    border-radius: 999px;
}

.theme-toggle__icon {
    font-size: 1.08rem;
    line-height: 1;
}

.app-content--topnav {
    width: min(1440px, calc(100% - 40px));
    margin: 0 auto;
    padding: 24px 0 44px;
}

.course-page {
    gap: 18px;
}

.course-banner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 20px 22px;
}

.course-banner__copy {
    display: grid;
    gap: 8px;
}

.course-banner__eyebrow {
    display: inline-flex;
    width: fit-content;
    color: var(--ink-soft);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.course-banner__title {
    margin: 0;
    font-size: clamp(1.5rem, 2.4vw, 2rem);
    letter-spacing: -0.04em;
    line-height: 1.05;
}

.course-banner__text,
.course-banner__fact {
    margin: 0;
    color: var(--ink-soft);
    line-height: 1.6;
}

.course-banner__aside {
    display: grid;
    gap: 12px;
    justify-items: end;
}

.course-banner__meta,
.course-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.course-banner__fact {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--bg-soft);
    font-size: 0.84rem;
}

.issue-toolbar--course {
    align-items: flex-start;
    gap: 16px;
}

.issue-board-summary--course {
    margin-bottom: 4px;
}

.course-lock-panel--compact {
    padding-block: 16px;
}

.composer-modal {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(10px);
}

.composer-modal__dialog {
    width: min(980px, 100%);
    max-height: min(92vh, 1080px);
    overflow: auto;
    padding: 22px;
    border-radius: 28px;
    border: 1px solid var(--line);
    background: rgba(248, 250, 252, 0.98);
    box-shadow: var(--shadow-md);
}

.composer-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

body.has-compose-modal {
    overflow: hidden;
}

.issue-row__summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
}

.issue-row__toggle {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
    padding: 18px;
    border: 0;
    background: transparent;
    text-align: left;
}

.issue-row__subline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
    color: var(--ink-soft);
    font-size: 0.84rem;
}

.issue-row__author {
    color: var(--ink);
    font-weight: 700;
}

.issue-row__meta {
    min-width: 138px;
    justify-content: flex-end;
}

.issue-row__chevron {
    font-size: 1rem;
    transition: transform 0.16s ease;
}

.issue-row.is-open .issue-row__chevron {
    transform: rotate(180deg);
}

.issue-actions {
    position: relative;
    align-self: stretch;
}

.issue-actions__toggle {
    list-style: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 14px;
    border: 1px solid var(--color-border-strong);
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: var(--shadow-xs);
    font-size: 1.24rem;
    line-height: 1;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.issue-actions__toggle::-webkit-details-marker {
    display: none;
}

.issue-actions__toggle:hover {
    transform: translateY(-1px);
    border-color: var(--color-focus);
    background: var(--color-surface-muted);
    box-shadow: var(--shadow-sm);
}

.issue-actions[open] .issue-actions__toggle {
    border-color: var(--color-focus);
    box-shadow: var(--shadow-sm);
}

.issue-actions__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    padding: 8px;
    border-radius: 18px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    box-shadow: var(--shadow-md);
    display: grid;
    gap: 4px;
    z-index: 8;
}

.issue-actions__menu form {
    margin: 0;
}

.issue-actions__item {
    width: 100%;
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 0 12px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--color-text);
    font-size: 0.92rem;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.issue-actions__item:hover {
    background: var(--color-surface-muted);
}

.issue-actions__item--primary {
    color: var(--color-primary);
    background: color-mix(in srgb, var(--color-primary) 10%, #ffffff);
}

.issue-actions__item--primary:hover {
    background: color-mix(in srgb, var(--color-primary) 18%, #ffffff);
}

.issue-actions__item--danger {
    color: var(--color-danger);
}

.issue-actions__item--danger:hover {
    background: color-mix(in srgb, var(--color-danger) 14%, #ffffff);
}

.sketch-canvas-host {
    position: absolute;
    inset: 0;
    z-index: 1;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

html[data-theme='dark'] .app-nav {
    background: rgba(15, 23, 42, 0.78);
    border-color: rgba(148, 163, 184, 0.18);
}

html[data-theme='dark'] .app-brand__mark,
html[data-theme='dark'] .app-user__avatar,
html[data-theme='dark'] .course-banner__fact,
html[data-theme='dark'] .issue-actions__toggle,
html[data-theme='dark'] .issue-actions__menu,
html[data-theme='dark'] .composer-modal__dialog {
    background: rgba(15, 23, 42, 0.88);
    border-color: rgba(148, 163, 184, 0.18);
}

html[data-theme='dark'] .app-brand__copy small,
html[data-theme='dark'] .app-user__copy small,
html[data-theme='dark'] .course-banner__text,
html[data-theme='dark'] .course-banner__fact,
html[data-theme='dark'] .issue-row__subline {
    color: var(--ink-soft);
}

html[data-theme='dark'] .composer-modal {
    background: rgba(2, 6, 23, 0.58);
}

html[data-theme='dark'] .issue-actions__item:hover {
    background: rgba(17, 28, 46, 0.92);
}

@media (max-width: 960px) {
    .app-shell--topnav .app-topbar {
        padding: 14px 18px;
    }


/* Course refresh */

.course-banner--hero {
    display: flex;
    justify-content: center;
    text-align: center;
    padding: clamp(28px, 4vw, 44px);
    background:
        radial-gradient(circle at top, rgba(37, 99, 235, 0.12), transparent 52%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 248, 255, 0.96));
}

.course-banner__copy--hero {
    width: min(760px, 100%);
    align-items: center;
    gap: 16px;
}

.course-banner__text--hero {
    max-width: 62ch;
    margin: 0 auto;
    font-size: 1.05rem;
}

.course-banner__tutor-link {
    min-width: 220px;
}

.course-banner__support {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.96rem;
}

.issue-toolbar__controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.issue-toolbar__field {
    display: grid;
    gap: 6px;
    min-width: 160px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.issue-toolbar__field span {
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.issue-toolbar__search--wide {
    flex: 1 1 480px;
}

.issue-select {
    appearance: none;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 16px;
    background: #ffffff;
    color: var(--text-primary);
    padding: 12px 14px;
    font: inherit;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.issue-board-list--flat {
    display: grid;
    gap: 16px;
}

.issue-row {
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-left-width: 5px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 255, 0.97));
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.issue-row--pending {
    border-left-color: #f59e0b;
}

.issue-row--answered {
    border-left-color: #10b981;
}

.issue-row:hover,
.issue-row.is-open {
    transform: none;
    box-shadow: 0 24px 55px rgba(15, 23, 42, 0.09);
}

.issue-row__summary {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 22px 24px;
}

.issue-row__toggle {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 16px;
    width: 100%;
    padding: 0;
    background: transparent;
    border: 0;
    text-align: left;
}

.issue-row__content {
    gap: 10px;
}

.issue-row__headline {
    gap: 8px;
}

.issue-row__title {
    font-size: 1.08rem;
    line-height: 1.45;
}

.issue-row__subline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.issue-row__author {
    font-weight: 700;
    color: var(--text-primary);
}

.issue-row__meta {
    align-items: flex-end;
    gap: 10px;
}

.issue-row__toggle-label {
    color: #2563eb;
    font-size: 0.9rem;
    font-weight: 700;
}

.issue-row__quick-action {
    margin-left: auto;
}

.issue-inline-button--danger {
    color: #b91c1c;
}

.issue-row__detail {
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    padding: 0 24px 24px;
    background: transparent;
}

.issue-detail {
    gap: 18px;
}

.issue-detail__header {
    padding-top: 18px;
}

.issue-detail__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.issue-detail__body {
    display: grid;
    gap: 16px;
}

.issue-detail__section {
    display: grid;
    gap: 8px;
}

.issue-detail__label {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.issue-detail__section p {
    margin: 0;
    color: var(--text-primary);
    line-height: 1.75;
}

.issue-row__footer {
    display: flex;
    justify-content: flex-start;
}

.issue-vote-form {
    margin: 0;
}

.issue-vote-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #1d4ed8;
    padding: 10px 16px;
    font: inherit;
    font-weight: 700;
}

.issue-vote-button strong {
    min-width: 1.5rem;
    text-align: right;
}

.issue-vote-button.is-active {
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.34);
}

.issue-answer {
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    padding-top: 16px;
    background: transparent;
}

.issue-answer--empty .issue-answer__body p {
    color: var(--text-muted);
}

.issue-moderation {
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    padding-top: 18px;
}

.topbar-button--icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    font-size: 1.1rem;
}

.sketch-toolbar__group--icons {
    margin-left: auto;
}

.sketch-modal__actions {
    justify-content: flex-end;
}

html[data-theme='dark'] .course-banner--hero {
    background:
        radial-gradient(circle at top, rgba(59, 130, 246, 0.18), transparent 50%),
        linear-gradient(180deg, rgba(9, 15, 29, 0.98), rgba(14, 23, 43, 0.96));
}

html[data-theme='dark'] .issue-select,
html[data-theme='dark'] .issue-row,
html[data-theme='dark'] .issue-vote-button {
    background: rgba(11, 19, 35, 0.96);
    color: #f8fafc;
}

html[data-theme='dark'] .issue-row__subline,
html[data-theme='dark'] .course-banner__support,
html[data-theme='dark'] .issue-detail__meta,
html[data-theme='dark'] .issue-detail__label {
    color: rgba(226, 232, 240, 0.72);
}

@media (max-width: 900px) {
    .issue-toolbar__searchline {
        flex-direction: column;
        align-items: stretch;
    }

    .issue-toolbar__actions {
        width: 100%;
        justify-content: stretch;
    }

    .issue-toolbar__actions > * {
        flex: 1 1 auto;
    }
}

@media (max-width: 760px) {
    .issue-row__summary {
        padding: 18px;
    }

    .issue-row__toggle {
        grid-template-columns: 1fr;
    }

    .issue-row__status {
        display: none;
    }

    .issue-row__meta {
        align-items: flex-start;
    }

    .issue-row__detail {
        padding: 0 18px 18px;
    }

    .issue-toolbar__controls {
        grid-template-columns: 1fr;
    }
}
    .app-topbar,
    .app-topbar__brandline,
    .app-topbar__actions,
    .composer-modal__header,
    .course-banner,
    .course-banner__aside {
        flex-direction: column;
        align-items: flex-start;
    }

    .course-banner {
        grid-template-columns: 1fr;
    }

    .course-banner__aside,
    .course-banner__actions,
    .course-banner__meta {
        justify-items: start;
        justify-content: flex-start;
    }

    .app-nav {
        width: 100%;
        overflow-x: auto;
    }

    .app-content--topnav {
        width: min(100%, calc(100% - 24px));
    }
}

@media (max-width: 760px) {
    .issue-row__summary {
        grid-template-columns: 1fr;
    }

    .issue-row__toggle {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .issue-row__meta {
        grid-column: 2 / 3;
        justify-content: flex-start;
        min-width: 0;
    }

    .issue-actions {
        width: 100%;
    }

    .issue-actions__toggle {
        width: 100%;
    }

    .issue-actions__menu {
        position: static;
        margin-top: 8px;
    }

    .composer-modal {
        padding: 12px;
    }

    .composer-modal__dialog {
        padding: 16px;
        border-radius: 22px;
    }
}

/* Premium course refresh */

.course-banner--hero {
    position: relative;
    justify-content: flex-start;
    text-align: left;
    overflow: hidden;
    padding: clamp(28px, 4vw, 44px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    background:
        radial-gradient(circle at 100% 0%, rgba(37, 99, 235, 0.16), transparent 34%),
        radial-gradient(circle at 0% 100%, rgba(124, 58, 237, 0.12), transparent 30%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 255, 0.96));
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.09);
}

.course-banner--hero::after {
    content: '';
    position: absolute;
    inset: 18px;
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, 0.58);
    pointer-events: none;
}

.course-banner__copy--hero {
    position: relative;
    z-index: 1;
    width: min(760px, 100%);
    align-items: flex-start;
    gap: 18px;
}

.course-banner__hero-top {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.course-banner__badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.course-banner__title {
    max-width: 11ch;
    font-size: clamp(2rem, 4vw, 3.35rem);
    line-height: 0.96;
    letter-spacing: -0.06em;
}

.course-banner__text--hero {
    max-width: 56ch;
    margin: 0;
    font-size: 1rem;
    line-height: 1.78;
    color: #52607a;
}

.course-banner__hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.course-banner__tutor-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb 0%, #6d28d9 100%);
    box-shadow: 0 16px 38px rgba(59, 130, 246, 0.24);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.course-banner__tutor-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 44px rgba(59, 130, 246, 0.28);
}

.course-banner__support {
    max-width: 42ch;
    margin: 0;
    color: #5f6d85;
    font-size: 0.94rem;
    line-height: 1.65;
}

.issue-toolbar--course {
    gap: 18px;
}

.issue-toolbar__searchline {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
}

.issue-toolbar__search--wide {
    flex: 1 1 440px;
    max-width: none;
}

.issue-toolbar__search--wide input {
    min-height: 46px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.issue-toolbar__controls--modern {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    width: min(720px, 100%);
    margin-left: auto;
}

.issue-toolbar__field {
    position: relative;
    gap: 7px;
    padding: 12px 14px 14px;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 255, 0.96));
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.05);
}

.issue-toolbar__field span {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #64748b;
}

.issue-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    min-height: 42px;
    border: 0;
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(241, 245, 249, 0.96), rgba(255, 255, 255, 0.98));
    color: #0f172a;
    padding: 10px 40px 10px 12px;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    background-image:
        linear-gradient(45deg, transparent 50%, #64748b 50%),
        linear-gradient(135deg, #64748b 50%, transparent 50%),
        linear-gradient(180deg, rgba(241, 245, 249, 0.96), rgba(255, 255, 255, 0.98));
    background-position:
        calc(100% - 18px) calc(50% - 2px),
        calc(100% - 12px) calc(50% - 2px),
        0 0;
    background-size: 6px 6px, 6px 6px, 100% 100%;
    background-repeat: no-repeat;
    background-clip: padding-box;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

select.issue-select::-ms-expand {
    display: none;
}

.issue-row {
    border-width: 1px;
    border-left-width: 1px;
    border-radius: 26px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(250, 251, 255, 0.98));
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.05);
}

.issue-row--pending {
    border-color: rgba(248, 113, 113, 0.24);
}

.issue-row--answered {
    border-color: rgba(74, 222, 128, 0.26);
}

.issue-row__summary {
    padding: 20px 22px;
}

.issue-row__headline {
    align-items: center;
}

.issue-row__title {
    font-size: 1.04rem;
    line-height: 1.45;
    letter-spacing: -0.025em;
}

.issue-row__subline {
    gap: 6px 12px;
    font-size: 0.88rem;
    color: #718198;
}

.issue-row__subline span {
    position: relative;
}

.issue-row__subline span + span::before {
    content: '·';
    margin-right: 12px;
    color: #c0cad8;
}

.issue-row__meta {
    gap: 12px;
}

.issue-row__toggle-label {
    color: #475569;
}

.issue-row__detail {
    padding: 0 22px 22px;
}

.issue-detail {
    gap: 16px;
}

.issue-detail__header {
    padding-top: 14px;
}

.issue-detail__section {
    padding: 18px 18px 0;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.issue-detail__section--question {
    background: linear-gradient(180deg, rgba(247, 250, 255, 0.96), rgba(255, 255, 255, 0.98));
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 22px;
    padding: 18px;
}

.issue-detail__attachments {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.issue-file {
    min-height: 88px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.issue-file:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

.issue-file--image {
    cursor: zoom-in;
}

.issue-file__icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    overflow: hidden;
}

.issue-row__footer {
    padding-top: 4px;
}

.issue-vote-cluster {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px 6px 6px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.92);
}

.issue-vote-button {
    width: 38px;
    min-width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(37, 99, 235, 0.12);
    background: linear-gradient(180deg, rgba(241, 245, 249, 0.92), rgba(255, 255, 255, 0.98));
    color: #334155;
}

.issue-vote-button.is-active {
    border-color: rgba(37, 99, 235, 0.28);
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
}

.issue-vote-button__icon {
    font-size: 1rem;
    line-height: 1;
}

.issue-vote-count {
    min-width: 1ch;
    font-size: 0.96rem;
    font-weight: 800;
    color: #0f172a;
}

.issue-answer {
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 255, 0.94));
    padding: 18px;
}

.issue-answer--empty {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.98));
}

.media-lightbox {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 18px;
}

.media-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.82);
    backdrop-filter: blur(10px);
}

.media-lightbox__dialog {
    position: relative;
    z-index: 1;
    width: min(1040px, 100%);
    max-height: calc(100vh - 36px);
    display: grid;
    align-items: stretch;
    gap: 14px;
    padding: 18px;
    border-radius: 28px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(10, 15, 27, 0.94);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.media-lightbox__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    padding-right: 56px;
}

.media-lightbox__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.media-lightbox__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.92);
    color: #f8fbff;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

.media-lightbox__action:hover,
.media-lightbox__action:focus-visible,
.media-lightbox__close:hover,
.media-lightbox__close:focus-visible,
.media-lightbox__external:hover,
.media-lightbox__external:focus-visible {
    background: #cbd5e1;
    border-color: #e2e8f0;
    color: #0b1629;
    outline: none;
}

.media-lightbox__action:active,
.media-lightbox__close:active,
.media-lightbox__external:active {
    transform: translateY(1px);
}

.media-lightbox__action--label {
    font-size: 0.9rem;
}

.media-lightbox__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.92);
    color: #f8fbff;
    font-size: 1.6rem;
    line-height: 1;
}

.media-lightbox__viewport {
    position: relative;
    display: block;
    width: 100%;
    height: clamp(320px, 64vh, 720px);
    max-height: calc(100vh - 220px);
    padding: 12px;
    box-sizing: border-box;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable both-edges;
    touch-action: pan-x pan-y;
    border-radius: 22px;
    background: #020617;
}

.media-lightbox__canvas {
    display: grid;
    place-items: center;
    min-width: 100%;
    min-height: 100%;
}

.media-lightbox__image-frame {
    position: relative;
    overflow: visible;
}

.media-lightbox__image {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    border-radius: 20px;
    background: #020617;
    transform-origin: center center;
    transition: transform 0.22s ease;
    will-change: transform;
}

.media-lightbox__video {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 20px;
    background: #020617;
}

.media-lightbox__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: rgba(226, 232, 240, 0.78);
}

.media-lightbox__caption {
    font-size: 0.94rem;
    font-weight: 600;
}

.media-lightbox__external {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.34);
    background: rgba(2, 6, 23, 0.92);
    color: #f8fbff;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.media-lightbox__loading {
    position: absolute;
    inset: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 2;
    pointer-events: none;
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.64);
    color: #f8fbff;
    font-weight: 600;
}

.media-lightbox__loading-spinner {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid rgba(148, 163, 184, 0.44);
    border-top-color: #f8fbff;
    animation: spin 0.85s linear infinite;
}

body.has-media-lightbox {
    overflow: hidden;
}

html[data-theme='dark'] .course-banner--hero {
    border-color: rgba(148, 163, 184, 0.16);
    background:
        radial-gradient(circle at 100% 0%, rgba(37, 99, 235, 0.22), transparent 34%),
        radial-gradient(circle at 0% 100%, rgba(124, 58, 237, 0.16), transparent 30%),
        linear-gradient(135deg, rgba(7, 11, 20, 0.98), rgba(12, 18, 31, 0.96));
}

html[data-theme='dark'] .course-banner__badge,
html[data-theme='dark'] .issue-toolbar__field,
html[data-theme='dark'] .issue-row,
html[data-theme='dark'] .issue-file,
html[data-theme='dark'] .issue-vote-cluster,
html[data-theme='dark'] .issue-answer,
html[data-theme='dark'] .issue-detail__section--question {
    background-color: rgba(8, 14, 26, 0.94);
}

html[data-theme='dark'] .issue-select,
html[data-theme='dark'] .issue-toolbar__search--wide input {
    background-color: rgba(15, 23, 42, 0.92);
    color: #f8fafc;
}

html[data-theme='dark'] .course-banner__text--hero,
html[data-theme='dark'] .course-banner__support,
html[data-theme='dark'] .issue-row__subline,
html[data-theme='dark'] .issue-detail__meta,
html[data-theme='dark'] .issue-detail__label,
html[data-theme='dark'] .media-lightbox__footer {
    color: rgba(226, 232, 240, 0.74);
}

html[data-theme='dark'] .issue-vote-count,
html[data-theme='dark'] .issue-row__title,
html[data-theme='dark'] .course-banner__title {
    color: #f8fafc;
}

@media (max-width: 900px) {
    .issue-toolbar__controls--modern {
        grid-template-columns: 1fr;
        width: 100%;
        margin-left: 0;
    }

    .course-banner__hero-actions {
        align-items: flex-start;
    }
}

@media (max-width: 760px) {
    .course-banner--hero {
        padding: 22px;
    }

    .course-banner__title {
        max-width: none;
    }

    .issue-row__summary,
    .issue-row__detail {
        padding-left: 18px;
        padding-right: 18px;
    }

    .media-lightbox {
        padding: 10px;
    }

    .media-lightbox__dialog {
        padding: 14px;
        border-radius: 22px;
    }

    .media-lightbox__toolbar,
    .media-lightbox__footer {
        align-items: stretch;
        flex-direction: column;
    }

    .media-lightbox__toolbar {
        padding-right: 48px;
    }

    .media-lightbox__actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .media-lightbox__action {
        width: 100%;
    }

    .media-lightbox__action--label {
        grid-column: 1 / -1;
    }

    .media-lightbox__viewport {
        height: clamp(260px, 52vh, 520px);
        max-height: calc(100vh - 250px);
    }

    .media-lightbox__footer {
        align-items: flex-start;
    }
}

/* Stability overrides */

.app-topbar,
.app-shell--topnav .app-topbar {
    position: static;
}

.app-content--topnav {
    width: min(1440px, calc(100% - 32px));
    padding-top: 18px;
}

.issue-toolbar__controls--modern {
    align-items: stretch;
}

.issue-toolbar__field {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 94px;
}

.issue-toolbar__field .issue-select {
    width: 100%;
    margin-top: auto;
}

.issue-vote-cluster {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.issue-vote-button {
    width: auto;
    min-width: 0;
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #64748b;
}

.issue-vote-button:hover,
.issue-vote-button.is-active {
    transform: none;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.issue-vote-button.is-active {
    color: #2563eb;
}

.issue-vote-button__icon {
    font-size: 1.12rem;
}

.issue-vote-count {
    font-size: 0.96rem;
    line-height: 1;
}

.issue-detail__asset-group,
.issue-answer__attachments,
.issue-reply-form__preview,
.issue-moderation,
.issue-reply-form {
    display: grid;
    gap: 14px;
}

.issue-reply-form__footer {
    align-items: flex-start;
}

.issue-reply-form__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.issue-moderation[hidden] {
    display: none !important;
}

.course-summary-card {
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.course-summary-card__surface {
    display: grid;
    gap: 14px;
    min-height: 100%;
    padding: 22px;
    color: inherit;
    text-decoration: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 255, 0.96));
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.course-summary-card__surface:hover {
    transform: translateY(-2px);
}

.course-summary-card--attention {
    border-color: rgba(239, 68, 68, 0.24);
}

.course-summary-card--attention .course-summary-card__surface {
    background: linear-gradient(180deg, rgba(254, 242, 242, 0.98), rgba(255, 255, 255, 0.96));
}

.course-summary-card--healthy {
    border-color: rgba(22, 163, 74, 0.24);
}

.course-summary-card--healthy .course-summary-card__surface {
    background: linear-gradient(180deg, rgba(240, 253, 244, 0.98), rgba(255, 255, 255, 0.96));
}

.course-summary-card__status--healthy {
    color: #166534;
    background: var(--success-soft);
    border-color: rgba(22, 163, 74, 0.18);
}

.course-summary-card__meta-line {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    color: #64748b;
}

.course-summary-card__pending {
    font-size: clamp(1.8rem, 3vw, 2.2rem);
    line-height: 1;
    letter-spacing: -0.06em;
    color: #0f172a;
}

.course-summary-card__pending.is-alert {
    color: #dc2626;
}

.course-summary-card__pending.is-healthy {
    color: #15803d;
}

.settings-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, 1fr);
    gap: 18px;
    padding: 26px 28px;
    border-radius: 30px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 34%),
        radial-gradient(circle at bottom left, rgba(124, 58, 237, 0.12), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 255, 0.96));
}

.settings-hero__copy {
    display: grid;
    gap: 10px;
    align-content: start;
}

.settings-hero__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.settings-hero__stat {
    display: grid;
    gap: 6px;
    padding: 16px 18px;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}

.settings-hero__stat span {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #64748b;
}

.settings-hero__stat strong {
    font-size: 1.08rem;
    line-height: 1.2;
    color: #0f172a;
}

.settings-hero__stat small {
    color: #64748b;
    line-height: 1.5;
}

.settings-card {
    overflow: hidden;
    border-radius: 28px;
}

.settings-access-panel {
    padding: 26px 28px;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 255, 0.98));
}

.settings-access-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.settings-access-frequency-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.settings-access-frequency-form--backup-import {
    align-items: flex-end;
}

.settings-access-frequency-form--backup-import label {
    min-width: 260px;
}

.settings-access-frequency-form--backup-import input[type='file'] {
    min-height: 48px;
    padding: 10px 14px;
}

.settings-access-frequency-form label {
    display: grid;
    gap: 6px;
    min-width: 220px;
    color: var(--ink-soft);
    font-size: 0.82rem;
    font-weight: 700;
}

.settings-access-frequency-form label span {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.settings-access-grid {
    gap: 14px;
}

.settings-access-card {
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}

.settings-form--inline {
    align-items: end;
}

.sketch-modal {
    place-items: start center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.sketch-modal__dialog {
    margin: 0 auto;
}

html[data-theme='dark'] .app-topbar {
    background: rgba(5, 10, 20, 0.9);
    border-bottom-color: rgba(148, 163, 184, 0.16);
}

html[data-theme='dark'] .issue-toolbar__field {
    background: linear-gradient(180deg, rgba(10, 17, 30, 0.96), rgba(8, 14, 26, 0.98));
    border-color: rgba(148, 163, 184, 0.18);
    box-shadow: none;
}

html[data-theme='dark'] .issue-toolbar__field span,
html[data-theme='dark'] .settings-hero__stat span,
html[data-theme='dark'] .settings-access-frequency-form label,
html[data-theme='dark'] .settings-access-frequency-form label span {
    color: rgba(226, 232, 240, 0.72);
}

html[data-theme='dark'] .issue-select {
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(226, 232, 240, 0.8) 50%),
        linear-gradient(135deg, rgba(226, 232, 240, 0.8) 50%, transparent 50%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(8, 14, 26, 0.98));
    background-color: transparent;
    color: #f8fafc;
}

html[data-theme='dark'] .issue-row__toggle-label,
html[data-theme='dark'] .issue-vote-count,
html[data-theme='dark'] .course-summary-card__pending,
html[data-theme='dark'] .settings-hero__stat strong {
    color: #f8fafc;
}

html[data-theme='dark'] .course-summary-card__surface,
html[data-theme='dark'] .settings-hero,
html[data-theme='dark'] .settings-access-panel,
html[data-theme='dark'] .settings-access-card,
html[data-theme='dark'] .issue-answer,
html[data-theme='dark'] .issue-moderation {
    background: linear-gradient(180deg, rgba(8, 14, 26, 0.96), rgba(7, 12, 22, 0.98));
    border-color: rgba(148, 163, 184, 0.16);
}

html[data-theme='dark'] .issue-vote-button,
html[data-theme='dark'] .issue-vote-button:hover,
html[data-theme='dark'] .issue-vote-button.is-active {
    background: transparent;
    border: 0;
    box-shadow: none;
}

html[data-theme='dark'] .course-summary-card__meta-line,
html[data-theme='dark'] .settings-hero__stat small {
    color: rgba(226, 232, 240, 0.72);
}

@media (max-width: 1080px) {
    .settings-hero {
        grid-template-columns: 1fr;
    }

    .settings-hero__stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .app-topbar,
    .app-topbar__brandline,
    .app-topbar__actions,
    .course-banner,
    .composer-modal__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .app-topbar {
        padding: 16px;
        gap: 14px;
    }

    .app-nav,
    .app-topbar__actions,
    .app-topbar__actions form,
    .app-topbar__actions .topbar-button {
        width: 100%;
    }

    .app-user__copy strong,
    .app-user__copy small {
        white-space: normal;
    }

    .app-content--topnav {
        width: calc(100% - 16px);
        padding-top: 10px;
        padding-bottom: 28px;
    }

    .course-banner--hero {
        padding: 20px;
    }

    .course-banner__copy--hero {
        width: 100%;
        align-items: flex-start;
    }

    .course-banner__title,
    .course-banner__text--hero,
    .course-banner__support {
        max-width: none;
        text-align: left;
    }

    .issue-toolbar__controls--modern,
    .settings-hero__stats,
    .settings-access-grid,
    .course-summary-grid {
        grid-template-columns: 1fr;
    }

    .issue-toolbar__field {
        min-height: 0;
        padding: 10px 12px 12px;
    }

    .issue-row__summary {
        padding: 18px;
    }

    .issue-row__toggle {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .issue-row__meta {
        width: 100%;
        min-width: 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
    }

    .issue-row__toggle-label {
        white-space: nowrap;
        font-size: 0.9rem;
    }

    .issue-detail__attachments,
    .issue-answer__attachments {
        grid-template-columns: 1fr;
    }

    .issue-reply-form__actions,
    .settings-access-actions,
    .settings-access-frequency-form,
    .settings-notification-option,
    .composer-card-saas__meta,
    .sketch-toolbar,
    .sketch-toolbar__group,
    .sketch-modal__actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .composer-card-saas__footer {
        justify-content: flex-start;
    }

    .settings-notification-toggle {
        min-width: 0;
    }

    .settings-access-frequency-form label {
        min-width: 0;
    }

    .course-summary-card__surface,
    .settings-hero,
    .settings-access-panel {
        padding: 18px;
    }

    .rich-preview {
        padding: 10px 12px;
    }

    .sketch-modal {
        padding: max(10px, env(safe-area-inset-top)) 10px max(14px, env(safe-area-inset-bottom));
    }

    .sketch-modal__dialog {
        width: 100%;
        max-width: none;
        padding: 14px;
        gap: 14px;
    }

    .sketch-stage {
        min-height: clamp(340px, 52vh, 460px);
    }

    .sketch-modal__actions .topbar-button {
        width: 100%;
    }
}

.settings-page--premium {
    gap: 24px;
}

.settings-page--premium .settings-hero--premium {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background:
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.18), transparent 28%),
        radial-gradient(circle at bottom right, rgba(245, 158, 11, 0.18), transparent 24%),
        linear-gradient(135deg, #fffaf0 0%, #ffffff 48%, #f4f8ff 100%);
}

.settings-page--premium .settings-hero__copy {
    max-width: 720px;
}

.settings-page--premium .settings-hero__stats--premium {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    width: 100%;
}

.settings-page--premium .settings-hero__stat {
    min-height: 148px;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(10px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.settings-tabs-shell {
    padding: 14px;
    border-radius: 24px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.03), rgba(37, 99, 235, 0.05));
}

.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.settings-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    color: #475569;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.settings-tab:hover {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, 0.22);
}

.settings-tab.is-active {
    border-color: transparent;
    background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 18px 30px rgba(29, 78, 216, 0.22);
}

.settings-panel {
    display: none;
    gap: 20px;
}

.settings-panel.is-active {
    display: grid;
}

.settings-section-heading {
    display: grid;
    gap: 8px;
    max-width: 760px;
}

.settings-grid--premium {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.settings-stack {
    display: grid;
    gap: 16px;
}

.settings-notification-stack {
    display: grid;
    gap: 16px;
}

.settings-notification-option {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.9), rgba(255, 255, 255, 0.98));
}

.settings-notification-option strong {
    display: block;
    margin: 6px 0 8px;
    color: #0f172a;
}

.settings-notification-option .panel__text {
    margin: 0;
}

.settings-notification-toggle {
    flex-shrink: 0;
    min-width: 240px;
}

.settings-notification-toggle[aria-pressed='true'] {
    border-color: rgba(22, 163, 74, 0.28);
    background: rgba(240, 253, 244, 0.94);
    color: #166534;
}

[data-admin-sound-status][data-tone='active'],
[data-admin-browser-status][data-tone='active'] {
    color: #166534;
}

[data-admin-browser-status][data-tone='pending'] {
    color: #1d4ed8;
}

[data-admin-sound-status][data-tone='muted'],
[data-admin-browser-status][data-tone='muted'] {
    color: #475569;
}

[data-admin-browser-status][data-tone='blocked'] {
    color: #b45309;
}

.settings-card--premium {
    padding: 24px;
    border-radius: 26px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.06);
}

.settings-card--premium-soft {
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.98));
}

.settings-grid--topics {
    align-items: start;
}

.settings-topic-group {
    display: grid;
    gap: 18px;
}

.settings-topic-group__summary {
    list-style: none;
    cursor: pointer;
}

.settings-topic-group__summary::-webkit-details-marker {
    display: none;
}

.settings-topic-group__summary .panel__header {
    align-items: center;
}

.settings-topic-group__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    padding: 0 14px;
    min-height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(248, 250, 252, 0.92);
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.settings-topic-group__toggle-label--open,
.settings-topic-group[open] .settings-topic-group__toggle-label--closed {
    display: none;
}

.settings-topic-group[open] .settings-topic-group__toggle-label--open {
    display: inline;
}

.settings-topic-group__body {
    display: grid;
    gap: 18px;
}

.settings-topic-group__courses {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.settings-topic-create,
.settings-topic-row__rename {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
}

.settings-topic-create label,
.settings-topic-row__rename label {
    flex: 1 1 240px;
}

.settings-topic-list {
    display: grid;
}

.settings-topic-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 0;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.settings-topic-row--focused {
    scroll-margin-top: 112px;
    border-radius: 18px;
    padding: 16px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.76), rgba(255, 255, 255, 0.98));
}

.settings-topic-row:first-child {
    padding-top: 0;
    border-top: 0;
}

.settings-topic-row--focused:first-child {
    padding-top: 16px;
}

.settings-topic-row__meta {
    display: grid;
    gap: 6px;
}

.settings-topic-row__meta small {
    color: #64748b;
    font-size: 0.84rem;
    font-weight: 600;
}

.settings-topic-row__actions {
    display: grid;
    gap: 10px;
    justify-items: end;
    flex: 1 1 320px;
}

.settings-topic-empty {
    margin-top: 6px;
}

.settings-access-search {
    align-items: end;
}

.settings-access-search label,
.settings-course-tutor-form label {
    flex: 1 1 260px;
}

.settings-access-search-result {
    margin-top: 18px;
}

.settings-access-search-result__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.settings-course-tutors-panel {
    margin-top: 22px;
}

.settings-staff-responders-panel {
    margin-top: 22px;
}

.settings-staff-note {
    margin-bottom: 18px;
}

.settings-staff-responders-list {
    display: grid;
    gap: 18px;
}

.settings-staff-card {
    display: grid;
    gap: 16px;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.05);
}

.settings-staff-card--new {
    border-style: dashed;
}

.settings-staff-card__summary {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.settings-staff-form {
    display: grid;
    gap: 16px;
}

.settings-staff-form__identity {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.settings-staff-form__courses {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.72);
}

.settings-staff-form__courses legend {
    padding: 0 6px;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #475569;
}

.settings-course-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.settings-course-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.9);
}

.settings-course-checkbox input {
    margin-top: 2px;
}

.settings-staff-form__actions,
.settings-staff-remove {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
}

.settings-access-panel--premium {
    padding: 24px;
    border-radius: 28px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background:
        radial-gradient(circle at top right, rgba(96, 165, 250, 0.16), transparent 24%),
        linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 1));
}

.issue-inbox-panel {
    gap: 20px;
    border-radius: 28px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.1), transparent 22%),
        linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 1));
}

.issue-inbox__topline {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.issue-inbox__summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 14px;
    flex: 1 1 420px;
}

.issue-inbox__metric {
    display: grid;
    gap: 8px;
    min-height: 132px;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.05);
}

.issue-inbox__metric span {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #64748b;
}

.issue-inbox__metric strong {
    font-size: clamp(1.9rem, 3vw, 2.5rem);
    letter-spacing: -0.06em;
    color: #0f172a;
}

.issue-inbox__metric small {
    color: #64748b;
    line-height: 1.55;
}

.issue-inbox__actions {
    display: flex;
    justify-content: center;
}

.issue-board-list--pending {
    gap: 18px;
}

.issue-board-list--pending .discussion-thread.issue-row {
    width: min(100%, 980px);
}

.settings-activity-top5 {
    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.68);
}

.settings-activity-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 12px;
}

.settings-activity-filter label {
    min-width: 150px;
}

.settings-activity-mode {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    background: rgba(248, 250, 252, 0.86);
}

.settings-activity-mode legend {
    margin: 0 4px 0 2px;
    padding: 0;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.settings-activity-mode__option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.9);
    font-size: 0.82rem;
    font-weight: 700;
    color: #334155;
}

.settings-activity-mode__option input {
    margin: 0;
}

.settings-activity-top5__list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.settings-activity-top5__item {
    display: grid;
    gap: 4px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.86);
}

.settings-activity-top5__item strong {
    color: #0f172a;
    font-size: 0.9rem;
}

.settings-activity-top5__item small,
.settings-activity-top5__item span {
    color: #475569;
    font-size: 0.82rem;
}

.settings-grid--stats-panels {
    align-items: start;
}

.stats-bars {
    display: grid;
    gap: 10px;
}

.stats-bars__row {
    display: grid;
    grid-template-columns: 96px 1fr 44px;
    gap: 10px;
    align-items: center;
}

.stats-bars__label,
.stats-bars__value {
    font-size: 0.8rem;
    font-weight: 700;
    color: #334155;
}

.stats-bars__track {
    height: 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.22);
    overflow: hidden;
}

.stats-bars__fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0ea5e9 0%, #2563eb 100%);
}

html[data-theme='dark'] .settings-page--premium .settings-hero--premium,
html[data-theme='dark'] .settings-tabs-shell,
html[data-theme='dark'] .settings-card--premium,
html[data-theme='dark'] .settings-card--premium-soft,
html[data-theme='dark'] .settings-access-panel--premium,
html[data-theme='dark'] .issue-inbox-panel,
html[data-theme='dark'] .issue-inbox__metric,
html[data-theme='dark'] .settings-page--premium .settings-hero__stat {
    border-color: rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.82);
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.32);
}

html[data-theme='dark'] .settings-tab {
    border-color: rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.78);
    color: #cbd5e1;
}

html[data-theme='dark'] .settings-tab.is-active {
    background: linear-gradient(135deg, #1d4ed8 0%, #0f172a 100%);
    color: #ffffff;
}

html[data-theme='dark'] .issue-inbox__metric span,
html[data-theme='dark'] .settings-page--premium .settings-hero__stat span {
    color: #94a3b8;
}

html[data-theme='dark'] .issue-inbox__metric strong,
html[data-theme='dark'] .settings-page--premium .settings-hero__stat strong,
html[data-theme='dark'] .settings-section-heading .panel__title {
    color: #f8fafc;
}

html[data-theme='dark'] .issue-inbox__metric small,
html[data-theme='dark'] .settings-page--premium .settings-hero__stat small {
    color: #cbd5e1;
}

html[data-theme='dark'] .settings-activity-top5,
html[data-theme='dark'] .settings-activity-top5__item {
    border-color: rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.72);
}

html[data-theme='dark'] .settings-activity-mode {
    border-color: rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.74);
}

html[data-theme='dark'] .settings-activity-mode legend {
    color: #94a3b8;
}

html[data-theme='dark'] .settings-activity-mode__option {
    border-color: rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.88);
    color: #cbd5e1;
}

html[data-theme='dark'] .settings-activity-top5__item strong,
html[data-theme='dark'] .stats-bars__label,
html[data-theme='dark'] .stats-bars__value {
    color: #e2e8f0;
}

html[data-theme='dark'] .settings-activity-top5__item small,
html[data-theme='dark'] .settings-activity-top5__item span {
    color: #94a3b8;
}

html[data-theme='dark'] .stats-bars__track {
    background: rgba(148, 163, 184, 0.3);
}

@media (max-width: 960px) {
    .settings-page--premium .settings-hero__stats--premium,
    .settings-grid--premium,
    .issue-inbox__summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-activity-top5__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .settings-page--premium .settings-hero__stats--premium,
    .settings-grid--premium,
    .issue-inbox__summary {
        grid-template-columns: minmax(0, 1fr);
    }

    .settings-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-tab {
        width: 100%;
    }

    .issue-inbox__actions .topbar-button {
        width: 100%;
    }

    .settings-activity-top5__list {
        grid-template-columns: minmax(0, 1fr);
    }

    .settings-activity-mode {
        width: 100%;
        justify-content: flex-start;
        border-radius: 16px;
    }

    .settings-activity-mode__option {
        flex: 1 1 120px;
        justify-content: center;
    }

    .stats-bars__row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

/* Public pages and density refresh */

.public-landing,
.not-found-page {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.14), transparent 30%),
        radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.12), transparent 28%),
        linear-gradient(180deg, #f7f9fe 0%, #eef3fb 100%);
}

.public-landing__backdrop,
.not-found-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.92), transparent 88%);
    pointer-events: none;
}

.public-landing__hero,
.not-found-page__shell {
    position: relative;
    z-index: 1;
    width: min(1120px, 100%);
    display: grid;
    gap: 18px;
    padding: clamp(28px, 4vw, 44px);
    border-radius: 34px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(16px);
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.10);
}

.public-landing__brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    width: fit-content;
    padding: 12px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.public-landing__brand img {
    width: 42px;
    height: 42px;
}

.public-landing__brand strong,
.public-landing__title,
.not-found-page__title {
    color: #0f172a;
}

.public-landing__brand span,
.public-landing__lead,
.not-found-page__lead,
.not-found-page__path {
    color: #526177;
}

.public-landing__eyebrow,
.not-found-page__eyebrow {
    display: inline-flex;
    width: fit-content;
    min-height: 30px;
    align-items: center;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.10);
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.public-landing__title,
.not-found-page__title {
    margin: 0;
    max-width: 16ch;
    font-size: clamp(2.6rem, 6vw, 4.9rem);
    line-height: 0.96;
    letter-spacing: -0.06em;
}

.public-landing__lead,
.not-found-page__lead {
    max-width: 64ch;
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.7;
}

.public-landing__actions,
.not-found-page__actions,
.public-landing__grid,
.course-summary-card__signal-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.public-landing__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 6px;
}

.public-landing__card {
    display: grid;
    gap: 8px;
    min-height: 150px;
    padding: 18px;
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.74);
}

.public-landing__card--accent {
    background: linear-gradient(145deg, rgba(37, 99, 235, 0.14), rgba(255, 255, 255, 0.86));
}

.public-landing__card strong,
.not-found-page__path strong {
    color: #0f172a;
}

.public-landing__card p {
    margin: 0;
    color: #5f6d85;
    line-height: 1.65;
}

.not-found-page__shell {
    max-width: 820px;
    justify-items: start;
}

.not-found-page__mark {
    font-size: clamp(4.5rem, 14vw, 9rem);
    font-weight: 900;
    letter-spacing: -0.08em;
    color: rgba(37, 99, 235, 0.16);
    line-height: 0.9;
}

.not-found-page__path {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.course-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(214px, 1fr));
    gap: 12px;
}

.course-summary-card {
    padding: 0;
    gap: 0;
}

.course-summary-card__surface {
    display: grid;
    gap: 10px;
    height: 100%;
    padding: 16px;
    border-radius: 20px;
}

.course-summary-card__title {
    font-size: 1rem;
    line-height: 1.3;
}

.course-summary-card__text {
    font-size: 0.9rem;
    line-height: 1.55;
}

.course-summary-card__meta-line {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    min-height: 28px;
}

.course-summary-card__signal-row {
    min-height: 28px;
}

.course-summary-card__signal {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.course-summary-card__signal--soft {
    background: rgba(148, 163, 184, 0.12);
    color: #475569;
}

.course-summary-card__link {
    min-height: 34px;
    padding: 0 12px;
    justify-self: start;
    border-radius: 12px;
    font-size: 0.86rem;
}

.discussion-thread.issue-row {
    width: 100%;
    max-width: 1120px;
}

.discussion-thread__question {
    gap: 14px;
    padding: 18px 20px;
}

.discussion-thread__title {
    font-size: clamp(1.06rem, 1.6vw, 1.24rem);
}

.discussion-thread__meta {
    gap: 8px;
    font-size: 0.84rem;
}

.discussion-thread__separator {
    padding: 16px 20px 0;
}

.discussion-thread__responses {
    gap: 12px;
    padding: 14px 20px 20px;
}

.thread-response {
    gap: 14px;
    padding: 16px;
}

.thread-attachments {
    gap: 10px;
}

.thread-attachment {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px;
    min-width: min(220px, 100%);
    padding: 10px 12px;
    border-radius: 12px;
}

.thread-attachment__thumb {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 0.74rem;
}

.thread-attachment__meta strong {
    font-size: 0.94rem;
}

.thread-attachment__meta small {
    font-size: 0.8rem;
}

.issue-toolbar__search--wide input {
    min-height: 40px;
    border-radius: 14px;
}

.issue-toolbar__controls--modern {
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    gap: 10px;
    width: min(100%, 640px);
}

.issue-toolbar__field {
    gap: 5px;
    min-height: auto;
    padding: 8px 10px 10px;
    border-radius: 16px;
}

.issue-toolbar__field span {
    font-size: 0.64rem;
    letter-spacing: 0.08em;
}

.issue-select {
    min-height: 34px;
    padding: 8px 34px 8px 10px;
    border-radius: 12px;
    font-size: 0.88rem;
}

.issues-page .discussion-thread__content,
.issues-page .thread-response__content {
    font-size: 0.93rem;
    line-height: 1.6;
}

.issues-page .discussion-thread__question,
.issues-page .discussion-thread__responses,
.issues-page .thread-composer {
    padding-left: 18px;
    padding-right: 18px;
}

.app-notification {
    display: inline-grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    max-width: min(320px, 100%);
    padding: 0 12px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.84);
    box-shadow: var(--shadow-xs);
    color: inherit;
    text-decoration: none;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.app-notification:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.app-notification:focus-visible,
.discussion-thread__summary-toggle:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16);
}

.app-notification__mark {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #cbd5e1;
}

.app-notification__copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.app-notification__copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.82rem;
    line-height: 1.2;
    color: #0f172a;
}

.app-notification__copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ink-soft);
    font-size: 0.8rem;
    line-height: 1.2;
}

.app-notification__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    background: #0f172a;
    color: #ffffff;
    font-size: 0.74rem;
    font-weight: 800;
}

.app-notification--alert {
    border-color: rgba(220, 38, 38, 0.18);
    background: rgba(254, 242, 242, 0.92);
}

.app-notification--alert .app-notification__mark {
    background: var(--danger);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

.app-notification--brand {
    border-color: rgba(37, 99, 235, 0.18);
    background: rgba(239, 246, 255, 0.94);
}

.app-notification--brand .app-notification__mark {
    background: var(--brand-strong);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.app-notification--warning {
    border-color: rgba(217, 119, 6, 0.18);
    background: rgba(255, 247, 237, 0.94);
}

.app-notification--warning .app-notification__mark {
    background: var(--warning);
    box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.12);
}

.app-live-controls .topbar-button[aria-pressed='true'] {
    border-color: rgba(22, 163, 74, 0.28);
    background: rgba(240, 253, 244, 0.94);
    color: #166534;
}

.course-summary-card__priority {
    margin-top: -2px;
    font-size: 1.14rem;
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.04em;
    color: #0f172a;
}

.course-summary-card__priority--attention {
    color: #b91c1c;
}

.course-summary-card__priority--recent {
    color: #1d4ed8;
}

.course-summary-card__priority--healthy {
    color: #0f172a;
}

.course-summary-card__priority--closed {
    color: #9a3412;
}

.course-summary-card__text {
    margin: 0;
    max-width: 30ch;
}

.course-summary-card__status {
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.discussion-thread.issue-row {
    border-color: rgba(15, 23, 42, 0.07);
    border-radius: 22px;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.05);
}

.discussion-thread.issue-row.is-open {
    border-color: rgba(37, 99, 235, 0.14);
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.08);
}

.discussion-thread__question--compact {
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 0;
}

.discussion-thread__summary-toggle {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.discussion-thread__summary-copy {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.discussion-thread__meta--compact {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: #64748b;
    font-size: 0.8rem;
}

.discussion-thread__meta--compact span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.discussion-thread__meta--compact span + span::before {
    content: '·';
    color: #cbd5e1;
}

.discussion-thread__preview {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    color: #334155;
    line-height: 1.58;
}

.discussion-thread__summary-side {
    display: grid;
    justify-items: end;
    align-content: start;
    gap: 8px;
}

.discussion-thread__summary-signal {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.05);
    color: #334155;
    font-size: 0.74rem;
    font-weight: 700;
}

.discussion-thread__toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.discussion-thread__toggle-label::after {
    content: '+';
    font-size: 1rem;
    line-height: 1;
}

.discussion-thread__summary-toggle[aria-expanded='true'] .discussion-thread__toggle-label {
    background: rgba(15, 23, 42, 0.08);
    color: #0f172a;
}

.discussion-thread__summary-toggle[aria-expanded='true'] .discussion-thread__toggle-label::after {
    content: '-';
}

.discussion-thread__summary-toggle[aria-expanded='true'] .discussion-thread__preview,
.discussion-thread__summary-toggle[aria-expanded='true'] .discussion-thread__topics--summary {
    display: none;
}

.discussion-thread__detail {
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.88), rgba(255, 255, 255, 0.98));
}

.discussion-thread__detail[hidden] {
    display: none !important;
}

.discussion-thread__detail-body {
    padding: 16px 18px 0;
}

.discussion-thread__detail-body > .discussion-thread__attachments,
.discussion-thread__detail-body > .discussion-thread__question-footer {
    margin-top: 12px;
}

.thread-response--teacher {
    border-left-color: #2563eb;
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.9), rgba(255, 255, 255, 0.98));
}

.thread-response--teacher .thread-response__avatar {
    background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.1);
}

.thread-response__badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

html[data-theme='dark'] .public-landing,
html[data-theme='dark'] .not-found-page {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.22), transparent 30%),
        radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.14), transparent 28%),
        linear-gradient(180deg, #08111f 0%, #0b1526 100%);
}

html[data-theme='dark'] .public-landing__hero,
html[data-theme='dark'] .not-found-page__shell,
html[data-theme='dark'] .public-landing__card,
html[data-theme='dark'] .public-landing__brand,
html[data-theme='dark'] .not-found-page__path {
    background: rgba(8, 14, 26, 0.82);
    border-color: rgba(148, 163, 184, 0.16);
    box-shadow: 0 30px 80px rgba(2, 6, 23, 0.34);
}

html[data-theme='dark'] .public-landing__brand strong,
html[data-theme='dark'] .public-landing__title,
html[data-theme='dark'] .not-found-page__title,
html[data-theme='dark'] .public-landing__card strong,
html[data-theme='dark'] .not-found-page__path strong {
    color: #f8fafc;
}

html[data-theme='dark'] .public-landing__brand span,
html[data-theme='dark'] .public-landing__lead,
html[data-theme='dark'] .public-landing__card p,
html[data-theme='dark'] .not-found-page__lead,
html[data-theme='dark'] .not-found-page__path,
html[data-theme='dark'] .course-summary-card__signal--soft {
    color: #cbd5e1;
}

html[data-theme='dark'] .course-summary-card__signal {
    background: rgba(37, 99, 235, 0.18);
    color: #bfdbfe;
}

html[data-theme='dark'] .app-notification {
    background: rgba(8, 14, 26, 0.86);
    border-color: rgba(148, 163, 184, 0.16);
    box-shadow: none;
}

html[data-theme='dark'] .app-notification__copy strong,
html[data-theme='dark'] .course-summary-card__priority {
    color: #f8fafc;
}

html[data-theme='dark'] .app-notification__copy small,
html[data-theme='dark'] .discussion-thread__preview,
html[data-theme='dark'] .discussion-thread__meta--compact,
html[data-theme='dark'] .discussion-thread__summary-signal,
html[data-theme='dark'] .thread-response__badge {
    color: #cbd5e1;
}

html[data-theme='dark'] .app-notification__badge {
    background: #eff6ff;
    color: #0f172a;
}

html[data-theme='dark'] .app-notification--alert {
    background: rgba(69, 10, 10, 0.5);
}

html[data-theme='dark'] .app-notification--brand {
    background: rgba(30, 41, 59, 0.78);
}

html[data-theme='dark'] .app-notification--warning {
    background: rgba(120, 53, 15, 0.42);
}

html[data-theme='dark'] .topbar-button--quiet {
    background: rgba(8, 14, 26, 0.8);
    border-color: rgba(148, 163, 184, 0.18);
}

html[data-theme='dark'] .toast__message,
html[data-theme='dark'] .toast__dismiss {
    color: #cbd5e1;
}

html[data-theme='dark'] .toast__button {
    background: rgba(30, 41, 59, 0.84);
    border-color: rgba(96, 165, 250, 0.18);
    color: #bfdbfe;
}

html[data-theme='dark'] .discussion-thread.is-live-fresh {
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18);
}

html[data-theme='dark'] .course-summary-card__priority--attention {
    color: #fca5a5;
}

html[data-theme='dark'] .course-summary-card__priority--recent {
    color: #93c5fd;
}

html[data-theme='dark'] .course-summary-card__priority--closed {
    color: #fdba74;
}

html[data-theme='dark'] .discussion-thread__summary-toggle[aria-expanded='true'] .discussion-thread__toggle-label {
    background: rgba(148, 163, 184, 0.12);
    color: #f8fafc;
}

html[data-theme='dark'] .discussion-thread__toggle-label {
    background: rgba(37, 99, 235, 0.18);
    color: #bfdbfe;
}

html[data-theme='dark'] .discussion-thread__summary-signal {
    background: rgba(148, 163, 184, 0.12);
}

html[data-theme='dark'] .discussion-thread__detail {
    border-top-color: rgba(148, 163, 184, 0.14);
    background: linear-gradient(180deg, rgba(10, 17, 30, 0.86), rgba(8, 14, 26, 0.98));
}

html[data-theme='dark'] .thread-response--teacher {
    border-left-color: #60a5fa;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(8, 14, 26, 0.98));
}

html[data-theme='dark'] .thread-response--teacher .thread-prose,
html[data-theme='dark'] .thread-response--teacher .thread-prose h1,
html[data-theme='dark'] .thread-response--teacher .thread-prose h2,
html[data-theme='dark'] .thread-response--teacher .thread-prose h3,
html[data-theme='dark'] .thread-response--teacher .thread-prose h4,
html[data-theme='dark'] .thread-response--teacher .thread-prose h5,
html[data-theme='dark'] .thread-response--teacher .thread-response__identity strong,
html[data-theme='dark'] .thread-response--teacher .thread-response__note,
html[data-theme='dark'] .thread-response--teacher .thread-response__vote-label,
html[data-theme='dark'] .thread-response--teacher .issue-vote-count {
    color: #f8fafc;
}

html[data-theme='dark'] .thread-response--teacher .thread-response__identity span {
    color: #cbd5e1;
}

html[data-theme='dark'] .thread-response--teacher .thread-prose a {
    color: #93c5fd;
}

html[data-theme='dark'] .thread-response--teacher .thread-prose blockquote {
    color: #e2e8f0;
    background: rgba(37, 99, 235, 0.12);
}

html[data-theme='dark'] .thread-response--teacher .thread-math {
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
}

html[data-theme='dark'] .thread-response__badge {
    background: rgba(37, 99, 235, 0.18);
    color: #bfdbfe;
}

@media (max-width: 900px) {
    .public-landing__grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .public-landing,
    .not-found-page {
        padding: 16px;
    }

    .public-landing__hero,
    .not-found-page__shell {
        padding: 22px;
        border-radius: 24px;
    }

    .public-landing__title,
    .not-found-page__title {
        max-width: none;
    }

    .issue-toolbar__searchline {
        align-items: stretch;
    }

    .app-notification {
        width: 100%;
        max-width: none;
    }

    .app-live-controls {
        width: 100%;
    }

    .app-live-controls .topbar-button {
        flex: 1 1 220px;
    }

    .toast--actionable {
        grid-template-columns: 1fr;
    }

    .toast__dismiss {
        justify-self: flex-start;
        padding-inline: 0;
    }

    .discussion-thread__summary-toggle {
        grid-template-columns: 1fr;
    }

    .discussion-thread__summary-side {
        justify-items: start;
    }

    .thread-attachment {
        min-width: 100%;
    }
}

/* Final density and interaction overrides */

.course-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(186px, 1fr));
    gap: 10px;
}

.course-summary-card {
    border-radius: 18px;
}

.course-summary-card__surface {
    gap: 8px;
    padding: 13px;
    border-radius: 18px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}

.course-summary-card__surface:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.09);
}

.course-summary-card__surface:active {
    transform: translateY(-1px) scale(0.992);
}

.course-summary-card__title {
    font-size: 0.96rem;
    line-height: 1.24;
}

.course-summary-card__priority {
    margin-top: -1px;
    font-size: 1.02rem;
}

.course-summary-card__text {
    max-width: none;
    font-size: 0.83rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.course-summary-card__status {
    min-height: 22px;
    padding: 0 8px;
    font-size: 0.64rem;
}

.course-summary-card__signal-row {
    gap: 6px;
    min-height: 0;
}

.course-summary-card__signal {
    min-height: 24px;
    padding: 0 8px;
    font-size: 0.7rem;
}

.course-summary-card__link {
    width: 100%;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 10px;
    font-size: 0.82rem;
    box-shadow: 0 10px 20px rgba(29, 78, 216, 0.16);
}

.course-summary-card__surface:hover .course-summary-card__link {
    box-shadow: 0 14px 24px rgba(29, 78, 216, 0.22);
}

.issue-toolbar--course {
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.issue-toolbar__searchline {
    flex: 1 1 280px;
    gap: 8px;
    min-width: min(100%, 280px);
}

.issue-toolbar__search--wide {
    flex: 1 1 240px;
}

.issue-toolbar__search--wide input {
    min-height: 38px;
    border-radius: 999px;
    padding: 0 14px;
}

.issue-toolbar__controls--modern {
    display: flex;
    flex: 0 1 auto;
    flex-wrap: wrap;
    gap: 8px;
    width: auto;
    margin-left: auto;
}

.issue-toolbar__field {
    display: inline-grid;
    gap: 6px;
    min-height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.issue-toolbar__field span {
    font-size: 0.64rem;
    line-height: 1;
    padding-inline: 4px;
}

.issue-select {
    min-height: 38px;
    padding: 8px 34px 8px 12px;
    border-radius: 999px;
    font-size: 0.84rem;
    background-position:
        calc(100% - 14px) calc(50% - 2px),
        calc(100% - 9px) calc(50% - 2px),
        0 0;
    background-size: 5px 5px, 5px 5px, 100% 100%;
    box-shadow: none;
}

.issue-toolbar__new-question,
.issue-create-menu__toggle {
    min-width: 138px;
}

/* Teacher shell and sketch refresh */

.panel__header--compact {
    gap: 10px;
}

.course-directory__priority-shell,
.course-directory__directory-shell {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: 28px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.98));
}

.course-directory__priority-shell {
    background:
        radial-gradient(circle at top right, rgba(248, 113, 113, 0.10), transparent 26%),
        linear-gradient(180deg, rgba(255, 251, 251, 0.98), rgba(255, 255, 255, 1));
}

.course-directory__directory-shell {
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.08), transparent 24%),
        linear-gradient(180deg, rgba(248, 250, 252, 0.94), rgba(255, 255, 255, 0.98));
}

.course-directory__section-header {
    margin-bottom: 0;
}

.course-directory__priority-empty {
    display: grid;
    gap: 6px;
    padding: 18px 20px;
    border-radius: 22px;
    border: 1px dashed rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.86);
    color: #475569;
}

.course-directory__priority-empty strong {
    color: #0f172a;
    font-size: 1rem;
}

.course-summary-grid--priority {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.course-summary-grid--directory {
    grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
}

.app-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px 20px;
    align-items: center;
}

.app-topbar__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
}

.app-topbar__actions > form {
    margin: 0;
}

.app-live-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: min(100%, 420px);
}

.app-live-controls .topbar-button {
    min-width: 0;
}

.sketch-modal__dialog {
    max-height: min(92vh, 980px);
    overflow: hidden;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.sketch-stage {
    min-height: clamp(420px, 58vh, 640px);
    height: 100%;
}

.sketch-toolbar__group--icons {
    justify-content: flex-end;
}

html[data-theme='dark'] .course-directory__priority-shell,
html[data-theme='dark'] .course-directory__directory-shell,
html[data-theme='dark'] .course-directory__priority-empty {
    border-color: rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.82);
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.32);
}

html[data-theme='dark'] .settings-notification-option {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.84), rgba(8, 14, 26, 0.96));
    border-color: rgba(148, 163, 184, 0.16);
}

html[data-theme='dark'] .settings-notification-option strong {
    color: #f8fafc;
}

html[data-theme='dark'] .settings-notification-toggle[aria-pressed='true'] {
    border-color: rgba(74, 222, 128, 0.28);
    background: rgba(20, 83, 45, 0.32);
    color: #bbf7d0;
}

html[data-theme='dark'] .course-directory__priority-empty strong {
    color: #f8fafc;
}

@media (max-width: 980px) {
    .app-topbar {
        grid-template-columns: 1fr;
        align-items: flex-start;
    }

    .app-topbar__actions {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    .app-topbar {
        padding: 14px 16px;
        gap: 12px;
    }

    .app-topbar__brandline {
        display: grid;
        gap: 12px;
        width: 100%;
    }

    .app-nav {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .app-topbar__actions {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 10px;
        width: 100%;
    }

    .app-health,
    .app-notification,
    .app-live-controls {
        grid-column: 1 / -1;
    }

    .app-live-controls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .theme-toggle {
        grid-column: 1 / 2;
        justify-self: start;
    }

    .app-user {
        grid-column: 2 / 3;
        min-width: 0;
    }

    .app-topbar__actions > form {
        grid-column: 1 / -1;
        width: 100%;
    }

    .app-topbar__actions > form .topbar-button {
        width: 100%;
    }

    .course-directory__priority-shell,
    .course-directory__directory-shell {
        padding: 16px;
        border-radius: 24px;
    }

    .course-summary-grid--priority,
    .course-summary-grid--directory {
        grid-template-columns: 1fr;
    }

    .sketch-modal {
        place-items: stretch;
        padding: 0;
    }

    .sketch-modal__dialog {
        width: 100%;
        min-height: 100dvh;
        max-height: none;
        padding: 16px;
        border-radius: 26px 26px 0 0;
    }

    .sketch-modal__header {
        align-items: flex-start;
    }

    .sketch-toolbar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        align-items: start;
    }

    .sketch-toolbar__group {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
        gap: 8px;
    }

    .sketch-toolbar__group--colors,
    .sketch-toolbar__group--icons,
    .sketch-size-control {
        grid-column: 1 / -1;
    }

    .sketch-toolbar__group--colors {
        display: flex;
        justify-content: flex-start;
    }

    .sketch-toolbar__group--icons {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        justify-content: stretch;
    }

    .sketch-stage {
        min-height: 0;
    }

    .sketch-modal__actions {
        justify-content: stretch;
    }

    .sketch-modal__actions .topbar-button {
        width: 100%;
    }
}

.issue-create-menu {
    position: relative;
}

.issue-create-menu__toggle {
    list-style: none;
}

.issue-create-menu__toggle::-webkit-details-marker {
    display: none;
}

.issue-create-menu__panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 30;
    display: grid;
    gap: 6px;
    min-width: 220px;
    padding: 10px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.1);
}

.issue-create-menu__label {
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #64748b;
}

.issue-create-menu__link {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 12px;
    color: #0f172a;
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 700;
    background: rgba(248, 250, 252, 0.98);
    transition: background-color 0.16s ease, transform 0.16s ease;
}

.issue-create-menu__link:hover {
    background: rgba(37, 99, 235, 0.08);
    transform: translateX(2px);
}

.discussion-thread__detail-body {
    padding: 14px 16px 0;
}

.discussion-thread__responses {
    gap: 10px;
    padding: 12px 16px 16px;
}

.thread-response {
    gap: 12px;
    padding: 14px;
}

.thread-response__identity {
    gap: 6px;
}

html[data-theme='dark'] .course-summary-card__surface {
    box-shadow: 0 18px 36px rgba(2, 6, 23, 0.26);
}

html[data-theme='dark'] .course-summary-card__surface:hover {
    box-shadow: 0 22px 40px rgba(2, 6, 23, 0.34);
}

html[data-theme='dark'] .issue-toolbar__field,
html[data-theme='dark'] .issue-create-menu__panel {
    border-color: rgba(148, 163, 184, 0.14);
}

html[data-theme='dark'] .issue-toolbar__field {
    background: transparent;
}

html[data-theme='dark'] .issue-create-menu__panel {
    background: rgba(8, 14, 26, 0.96);
}

html[data-theme='dark'] .issue-create-menu__label {
    color: #94a3b8;
}

html[data-theme='dark'] .issue-create-menu__link {
    color: #f8fafc;
    background: rgba(15, 23, 42, 0.82);
}

html[data-theme='dark'] .issue-create-menu__link:hover {
    background: rgba(37, 99, 235, 0.18);
}

@media (max-width: 900px) {
    .course-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .issue-toolbar__controls--modern {
        width: 100%;
        margin-left: 0;
    }

    .issue-toolbar__field {
        flex: 1 1 calc(50% - 8px);
        justify-content: stretch;
    }

    .issue-toolbar__new-question,
    .issue-create-menu,
    .issue-create-menu__toggle {
        width: 100%;
    }

    .issue-create-menu__panel {
        left: 0;
        right: 0;
        min-width: 0;
    }
}

@media (max-width: 560px) {
    .course-summary-grid {
        grid-template-columns: 1fr;
    }

    .issue-toolbar__field {
        flex: 1 1 100%;
    }
}

@media (max-width: 760px) {
    .issue-toolbar--course {
        align-items: stretch;
        gap: 14px;
    }

    .issue-toolbar__searchline {
        flex: 0 0 auto;
        min-width: 0;
        width: 100%;
        justify-content: flex-start;
        align-items: stretch;
        gap: 12px;
    }

    .issue-toolbar__search--wide,
    .issue-toolbar__search--wide input,
    .issue-toolbar__actions,
    .issue-toolbar__actions > *,
    .issue-toolbar__new-question,
    .issue-toolbar__controls--modern {
        width: 100%;
    }

    .issue-toolbar__search--wide {
        flex: 1 1 auto;
        max-width: none;
    }

    .issue-toolbar__actions {
        flex: 0 0 auto;
        align-items: stretch;
    }

    .discussion-thread.issue-row,
    .thread-response__panel,
    .thread-response__identity,
    .thread-response__content {
        min-width: 0;
    }

    .discussion-thread__meta {
        gap: 8px;
    }

    .discussion-thread__meta span {
        flex-wrap: wrap;
        gap: 6px;
    }

    .discussion-thread__meta span + span::before {
        display: none;
    }

    .thread-response__badge {
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
        line-height: 1.35;
    }

    .thread-response__identity span {
        max-width: 100%;
    }

    .thread-math--display {
        padding: 12px 10px;
    }
}

html[data-theme='dark'] .discussion-thread.issue-row,
html[data-theme='dark'] .discussion-thread.issue-row:hover,
html[data-theme='dark'] .discussion-thread.issue-row.is-open {
    border-color: rgba(148, 163, 184, 0.18);
    background: linear-gradient(180deg, rgba(10, 17, 30, 0.96), rgba(7, 12, 22, 0.98));
    box-shadow: 0 22px 46px rgba(2, 6, 23, 0.32);
}

html[data-theme='dark'] .discussion-thread__question {
    border-bottom-color: rgba(148, 163, 184, 0.12);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.2), rgba(15, 23, 42, 0));
}

html[data-theme='dark'] .discussion-thread__separator {
    color: #8fa3bf;
}

html[data-theme='dark'] .discussion-thread__separator::before,
html[data-theme='dark'] .discussion-thread__separator::after {
    background: rgba(148, 163, 184, 0.18);
}

html[data-theme='dark'] .discussion-thread__title,
html[data-theme='dark'] .discussion-thread__content,
html[data-theme='dark'] .thread-response__identity strong,
html[data-theme='dark'] .thread-response__empty-copy strong,
html[data-theme='dark'] .thread-attachment__meta strong,
html[data-theme='dark'] .thread-response__note,
html[data-theme='dark'] .thread-response__vote-label,
html[data-theme='dark'] .issue-vote-count {
    color: #f8fafc;
}

html[data-theme='dark'] .discussion-thread__meta,
html[data-theme='dark'] .thread-response__identity span,
html[data-theme='dark'] .thread-response__empty-copy p,
html[data-theme='dark'] .thread-attachment__meta small {
    color: #cbd5e1;
}

html[data-theme='dark'] .thread-response {
    border-color: rgba(148, 163, 184, 0.16);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.78), rgba(10, 17, 30, 0.94));
    box-shadow: 0 14px 28px rgba(2, 6, 23, 0.22);
}

html[data-theme='dark'] .thread-response--teacher {
    border-left-color: #60a5fa;
    background: linear-gradient(180deg, rgba(21, 31, 55, 0.96), rgba(10, 17, 30, 0.98));
}

html[data-theme='dark'] .thread-response--empty {
    border-left-color: rgba(148, 163, 184, 0.34);
    background: rgba(15, 23, 42, 0.72);
}

html[data-theme='dark'] .thread-attachment {
    border-color: rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.78);
    box-shadow: none;
}

html[data-theme='dark'] .thread-attachment__action {
    border-color: rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.86);
    color: #f8fafc;
}

html[data-theme='dark'] .thread-attachment__thumb {
    background: rgba(37, 99, 235, 0.16);
    color: #bfdbfe;
}

html[data-theme='dark'] .thread-math,
html[data-theme='dark'] .thread-math--display {
    background: rgba(248, 250, 252, 0.06);
    color: #f8fafc;
}

html[data-theme='dark'] .thread-math--display {
    border: 1px solid rgba(148, 163, 184, 0.16);
}

html[data-theme='dark'] .thread-math .katex,
html[data-theme='dark'] .thread-math--display .katex-display {
    color: inherit;
}

html[data-theme='dark'] .thread-prose table {
    border-color: rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.72);
}

html[data-theme='dark'] .thread-prose th,
html[data-theme='dark'] .thread-prose td {
    border-bottom-color: rgba(148, 163, 184, 0.14);
}

html[data-theme='dark'] .thread-prose th {
    color: #f8fafc;
    background: rgba(15, 23, 42, 0.92);
}

html[data-theme='dark'] .thread-prose td {
    color: #cbd5e1;
}

html[data-theme='dark'] .thread-prose blockquote {
    color: #e2e8f0;
    background: rgba(37, 99, 235, 0.1);
    border-left-color: rgba(96, 165, 250, 0.34);
}

/* Stats dashboard redesign */

.stats-dashboard {
    --stats-bg-a: #f8fbff;
    --stats-bg-b: #edf3fb;
    --stats-ink: #0f172a;
    --stats-muted: #516179;
    --stats-border: rgba(15, 23, 42, 0.08);
    background:
        radial-gradient(circle at 8% -8%, rgba(56, 189, 248, 0.1), transparent 28%),
        radial-gradient(circle at 88% 0%, rgba(14, 165, 233, 0.08), transparent 34%),
        linear-gradient(180deg, var(--stats-bg-a), var(--stats-bg-b));
    border-radius: 26px;
    padding: clamp(14px, 2vw, 22px);
    gap: 14px;
    max-width: 1540px;
    margin-inline: auto;
}

.stats-dashboard .panel {
    border-color: var(--stats-border);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.stats-dashboard .panel__eyebrow {
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    padding-left: 1px;
    line-height: 1.24;
}

.stats-dashboard .panel__title {
    line-height: 1.22;
    letter-spacing: -0.02em;
    padding-left: 1px;
}

.stats-dashboard__hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 12px;
    padding: 18px;
    border-radius: 22px;
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.96), rgba(243, 249, 255, 0.94));
}

.stats-dashboard__kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.stats-kpi-card {
    display: grid;
    gap: 2px;
    padding: 10px 11px;
    border-radius: 13px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.98));
}

.stats-kpi-card__label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #64748b;
    font-weight: 800;
}

.stats-kpi-card__value {
    font-size: clamp(1rem, 1.6vw, 1.32rem);
    line-height: 1.08;
    color: var(--stats-ink);
}

.stats-kpi-card__meta {
    color: var(--stats-muted);
    font-size: 0.72rem;
}

.stats-dashboard__filters {
    position: static;
    padding: 12px 14px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(250, 252, 255, 0.96));
}

.stats-dashboard__filters .panel__header {
    margin-bottom: 8px;
}

.stats-dashboard__filters .panel__title {
    font-size: 1rem;
}

.stats-filters-form {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    align-items: end;
}

.stats-filters-form > label {
    display: grid;
    gap: 4px;
}

.stats-filters-form > label > span {
    font-size: 0.61rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    font-weight: 800;
    color: #64748b;
}

.stats-filters-form .settings-input {
    min-height: 36px;
    height: 36px;
    padding-block: 0;
    font-size: 0.84rem;
    border-radius: 10px;
}

.stats-dashboard__grid {
    gap: 12px;
}

.stats-dashboard__grid--main {
    grid-template-columns: 1fr;
}

.stats-dashboard__grid--secondary,
.stats-dashboard__grid--temporal,
.stats-dashboard__grid--history {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats-dashboard__grid--relative,
.stats-dashboard__grid--insights {
    grid-template-columns: 1fr;
}

.stats-panel {
    padding: 14px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 255, 0.94));
}

.stats-panel--main {
    padding-top: 12px;
}

.stats-panel--state {
    display: grid;
    align-content: start;
}

.stats-panel--insights {
    max-width: 980px;
}

.stats-columns {
    --chart-count: 8;
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--chart-count), minmax(0, 1fr));
    align-items: end;
    gap: 10px;
    height: 196px;
    overflow: hidden;
    padding: 10px 8px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.stats-columns::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.5);
    pointer-events: none;
}

.stats-columns__item {
    display: grid;
    grid-template-rows: auto 1fr auto;
    align-content: stretch;
    justify-items: center;
    gap: 5px;
    min-width: 0;
    height: 100%;
}

.stats-columns__value {
    font-size: 0.76rem;
    color: #0f172a;
    font-weight: 700;
    line-height: 1;
}

.stats-columns__bar {
    display: block;
    width: min(30px, 100%);
    min-height: 5%;
    align-self: end;
    border-radius: 10px 10px 5px 5px;
    background: linear-gradient(180deg, #0ea5e9, #2563eb);
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.22);
}

.stats-columns__bar--accent {
    background: linear-gradient(180deg, #14b8a6, #0f766e);
    box-shadow: 0 8px 16px rgba(15, 118, 110, 0.22);
}

.stats-columns__bar--topic {
    background: linear-gradient(180deg, #fb923c, #ea580c);
    box-shadow: 0 8px 16px rgba(234, 88, 12, 0.22);
}

.stats-columns__bar--weekday {
    background: linear-gradient(180deg, #8b5cf6, #6d28d9);
    box-shadow: 0 8px 16px rgba(109, 40, 217, 0.2);
}

.stats-columns__bar--hour {
    background: linear-gradient(180deg, #ec4899, #be185d);
    box-shadow: 0 8px 16px rgba(190, 24, 93, 0.2);
}

.stats-columns__bar--history {
    background: linear-gradient(180deg, #22c55e, #15803d);
    box-shadow: 0 8px 16px rgba(21, 128, 61, 0.2);
}

.stats-columns__bar--monthly {
    background: linear-gradient(180deg, #0891b2, #0f766e);
    box-shadow: 0 8px 16px rgba(15, 118, 110, 0.2);
}

.stats-columns__label {
    width: 100%;
    max-width: 100%;
    font-size: 0.67rem;
    line-height: 1.2;
    color: #334155;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-bottom: 3px;
}

.stats-columns--main {
    height: 228px;
}

.stats-columns--compact {
    height: 188px;
}

.stats-columns--history {
    height: 158px;
}

.stats-donut {
    display: grid;
    gap: 10px;
    justify-items: center;
}

.stats-donut__chart {
    --pending-color: #ef4444;
    --answered-color: #10b981;
    width: 138px;
    aspect-ratio: 1 / 1;
    border-radius: 999px;
    display: grid;
    place-items: center;
    text-align: center;
    background:
        radial-gradient(circle at center, white 57%, transparent 58%),
        conic-gradient(var(--pending-color) 0 calc(var(--pending-share) * 1%), var(--answered-color) 0 100%);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

.stats-donut__chart strong {
    display: block;
    color: #0f172a;
    font-size: 1.24rem;
    line-height: 1;
}

.stats-donut__chart small {
    color: #475569;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.stats-legend {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 4px;
}

.stats-legend li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #334155;
    font-size: 0.78rem;
}

.stats-legend__dot {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    display: inline-block;
}

.stats-legend__dot--pending {
    background: #ef4444;
}

.stats-legend__dot--answered {
    background: #10b981;
}

.stats-heatmap {
    display: grid;
    gap: 6px;
    overflow: hidden;
}

.stats-heatmap__header,
.stats-heatmap__row {
    display: grid;
    grid-template-columns: 62px repeat(6, minmax(52px, 1fr));
    gap: 6px;
    align-items: center;
}

.stats-heatmap__header span {
    text-align: center;
    font-size: 0.64rem;
    color: #64748b;
    font-weight: 700;
}

.stats-heatmap__row strong {
    font-size: 0.73rem;
    color: #0f172a;
}

.stats-heatmap__cell {
    min-height: 32px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 0.66rem;
    font-weight: 700;
    color: #0f172a;
    background: hsl(190deg 82% calc(95% - (var(--intensity) * 0.45%)));
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.stats-insights-list {
    margin: 0;
    padding-left: 20px;
    display: grid;
    gap: 6px;
    max-width: 860px;
}

.stats-insights-list li {
    color: #1e293b;
    line-height: 1.5;
}

html[data-theme='dark'] .stats-dashboard {
    --stats-bg-a: #020617;
    --stats-bg-b: #0f172a;
    --stats-ink: #f8fafc;
    --stats-muted: #cbd5e1;
    --stats-border: rgba(148, 163, 184, 0.16);
    background:
        radial-gradient(circle at 8% -8%, rgba(59, 130, 246, 0.24), transparent 30%),
        radial-gradient(circle at 90% 0%, rgba(20, 184, 166, 0.22), transparent 34%),
        linear-gradient(180deg, #020617, #0f172a);
}

html[data-theme='dark'] .stats-dashboard__hero,
html[data-theme='dark'] .stats-dashboard__filters,
html[data-theme='dark'] .stats-panel,
html[data-theme='dark'] .stats-kpi-card,
html[data-theme='dark'] .stats-columns,
html[data-theme='dark'] .stats-columns::before {
    background: linear-gradient(180deg, rgba(8, 14, 26, 0.96), rgba(15, 23, 42, 0.92));
    border-color: rgba(148, 163, 184, 0.16);
}

html[data-theme='dark'] .stats-kpi-card__value,
html[data-theme='dark'] .stats-heatmap__row strong,
html[data-theme='dark'] .stats-columns__value,
html[data-theme='dark'] .stats-donut__chart strong {
    color: #f8fafc;
}

html[data-theme='dark'] .stats-kpi-card__meta,
html[data-theme='dark'] .stats-columns__label,
html[data-theme='dark'] .stats-legend li,
html[data-theme='dark'] .stats-insights-list li,
html[data-theme='dark'] .stats-donut__chart small,
html[data-theme='dark'] .stats-heatmap__header span {
    color: #cbd5e1;
}

html[data-theme='dark'] .stats-columns {
    border-bottom-color: rgba(148, 163, 184, 0.2);
}

html[data-theme='dark'] .stats-heatmap__cell {
    color: #f8fafc;
    border-color: rgba(148, 163, 184, 0.14);
    background: hsl(205deg 52% calc(24% + (var(--intensity) * 0.34%)));
}

html[data-theme='dark'] .stats-donut__chart {
    background:
        radial-gradient(circle at center, #0b1220 57%, transparent 58%),
        conic-gradient(#ef4444 0 calc(var(--pending-share) * 1%), #10b981 0 100%);
}

@media (max-width: 1240px) {
    .stats-dashboard__hero {
        grid-template-columns: 1fr;
    }

    .stats-dashboard__kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .stats-filters-form {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .stats-dashboard__grid--secondary,
    .stats-dashboard__grid--temporal,
    .stats-dashboard__grid--history {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .stats-dashboard {
        border-radius: 20px;
        padding: 12px;
    }

    .stats-dashboard__grid--main,
    .stats-dashboard__grid--secondary,
    .stats-dashboard__grid--temporal,
    .stats-dashboard__grid--history,
    .stats-dashboard__grid--relative,
    .stats-dashboard__grid--insights {
        grid-template-columns: 1fr;
    }

    .stats-filters-form {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .stats-columns {
        height: 174px;
        gap: 8px;
    }

    .stats-columns--main {
        height: 206px;
    }
}

@media (max-width: 560px) {
    .stats-filters-form {
        grid-template-columns: 1fr;
    }

    .stats-dashboard__kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-kpi-card__value {
        font-size: 1.02rem;
    }

    .stats-columns {
        grid-auto-flow: column;
        grid-auto-columns: minmax(50px, 1fr);
        grid-template-columns: none;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .stats-heatmap__header,
    .stats-heatmap__row {
        grid-template-columns: 54px repeat(6, minmax(46px, 1fr));
    }

    .stats-heatmap__cell {
        min-height: 30px;
        font-size: 0.64rem;
    }
}

/* Simplified stats dashboard */

.stats-dashboard--simple {
    max-width: 1460px;
}

.stats-dashboard--simple .stats-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 18px;
}

.stats-dashboard--simple .stats-page-header .panel__title {
    margin-bottom: 4px;
    font-size: clamp(1.45rem, 2vw, 2rem);
}

.stats-dashboard--simple .stats-page-header .panel__text {
    max-width: 58ch;
}

.stats-dashboard--simple .stats-kpi-band {
    padding: 12px;
    border-radius: 16px;
}

.stats-dashboard--simple .stats-hero-simple {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
    border-radius: 18px;
}

.stats-dashboard--simple .stats-kpi-simple-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.stats-dashboard--simple .stats-kpi-simple {
    display: grid;
    gap: 2px;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.9);
}

.stats-dashboard--simple .stats-kpi-simple span {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.stats-dashboard--simple .stats-kpi-simple strong {
    font-size: 0.95rem;
    line-height: 1.18;
    color: #0f172a;
}

.stats-dashboard--simple .stats-kpi-simple small {
    font-size: 0.72rem;
    color: #64748b;
}

.stats-dashboard--simple .stats-kpi-simple--ok {
    border-color: rgba(22, 163, 74, 0.28);
    background: rgba(240, 253, 244, 0.9);
}

.stats-dashboard--simple .stats-kpi-simple--warn {
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(255, 251, 235, 0.9);
}

.stats-dashboard--simple .stats-kpi-simple--alert {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(254, 242, 242, 0.9);
}

.stats-dashboard--simple .stats-filters-simple {
    padding: 12px;
    border-radius: 16px;
}

.stats-dashboard--simple .stats-filters-simple__form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 240px) minmax(0, 1.3fr) auto;
    gap: 10px;
    align-items: end;
}

.stats-dashboard--simple .stats-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.stats-dashboard--simple .stats-filter-label {
    width: 100%;
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 800;
    color: #64748b;
}

.stats-dashboard--simple .stats-pill {
    position: relative;
    display: inline-flex;
}

.stats-dashboard--simple .stats-pill input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.stats-dashboard--simple .stats-pill span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.34);
    background: rgba(255, 255, 255, 0.9);
    font-size: 0.82rem;
    font-weight: 700;
    color: #334155;
}

.stats-dashboard--simple .stats-pill input:checked + span {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
}

.stats-dashboard--simple .stats-filter-select {
    display: grid;
    gap: 4px;
}

.stats-dashboard--simple .stats-filter-select[data-stats-course-wrap] {
    display: none;
}

.stats-dashboard--simple .stats-filters-simple__form:has(input[name="scope"][value="course"]:checked) .stats-filter-select[data-stats-course-wrap] {
    display: grid;
}

.stats-dashboard--simple .stats-filter-select > span {
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 800;
    color: #64748b;
}

.stats-dashboard--simple .stats-custom-range {
    grid-column: 1 / span 3;
    border: 1px dashed rgba(148, 163, 184, 0.34);
    border-radius: 12px;
    padding: 8px 10px;
}

.stats-dashboard--simple .stats-custom-range__summary {
    cursor: default;
    font-size: 0.8rem;
    font-weight: 700;
    color: #334155;
}

.stats-dashboard--simple .stats-custom-range__fields {
    display: none;
    margin-top: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.stats-dashboard--simple .stats-custom-range.is-open .stats-custom-range__fields,
.stats-dashboard--simple .stats-filters-simple__form:has(input[name="period"][value="custom"]:checked) .stats-custom-range__fields {
    display: grid;
}

.stats-dashboard--simple .stats-custom-range__fields label {
    display: grid;
    gap: 4px;
}

.stats-dashboard--simple .stats-custom-range__fields span {
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 800;
    color: #64748b;
}

.stats-dashboard--simple .stats-dashboard__grid--main-simple,
.stats-dashboard--simple .stats-dashboard__grid--relative-simple,
.stats-dashboard--simple .stats-dashboard__grid--history-simple,
.stats-dashboard--simple .stats-dashboard__grid--insights-simple {
    grid-template-columns: 1fr;
}

.stats-dashboard--simple .stats-dashboard__grid--secondary-simple,
.stats-dashboard--simple .stats-dashboard__grid--temporal-simple {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats-dashboard--simple .stats-panel {
    padding: 12px;
    border-radius: 14px;
}

.stats-dashboard--simple .stats-columns {
    height: 192px;
    gap: 8px;
}

.stats-dashboard--simple .stats-columns--main {
    height: 232px;
}

.stats-dashboard--simple .stats-columns--history {
    height: 150px;
}

.stats-dashboard--simple .stats-columns__bar {
    width: min(28px, 100%);
}

.stats-dashboard--simple .stats-columns__label {
    font-size: 0.64rem;
}

.stats-dashboard--simple .stats-donut__chart {
    width: 130px;
}

.stats-dashboard--simple .stats-mini-ranking {
    display: grid;
    gap: 6px;
}

.stats-dashboard--simple .stats-mini-ranking__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.88);
}

.stats-dashboard--simple .stats-mini-ranking__row span {
    font-size: 0.8rem;
    color: #334155;
}

.stats-dashboard--simple .stats-mini-ranking__row strong {
    font-size: 0.85rem;
    color: #0f172a;
}

@media (max-width: 1280px) {
    .stats-dashboard--simple .stats-hero-simple {
        grid-template-columns: 1fr;
    }

    .stats-dashboard--simple .stats-kpi-simple-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .stats-dashboard--simple .stats-filters-simple__form {
        grid-template-columns: 1fr 1fr;
    }

    .stats-dashboard--simple .stats-custom-range {
        grid-column: 1 / -1;
    }

    .stats-dashboard--simple .stats-dashboard__grid--secondary-simple,
    .stats-dashboard--simple .stats-dashboard__grid--temporal-simple {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .stats-dashboard--simple .stats-kpi-simple-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-dashboard--simple .stats-filters-simple__form {
        grid-template-columns: 1fr;
    }

    .stats-dashboard--simple .stats-dashboard__grid--secondary-simple,
    .stats-dashboard--simple .stats-dashboard__grid--temporal-simple {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .stats-dashboard--simple .stats-columns {
        grid-auto-flow: column;
        grid-auto-columns: minmax(46px, 1fr);
        grid-template-columns: none;
        overflow-x: auto;
    }
}

/* Accessibility semantic coverage overrides */

.composer-card-saas__title,
.composer-card-saas__editor,
.settings-input,
.issue-toolbar__search input,
.issue-reply-form__textarea,
.issue-select,
.thread-composer__textarea,
.thread-composer__input,
.thread-attachment__action,
.composer-file__remove {
    color: var(--color-text);
    background: var(--color-surface);
    border-color: var(--color-border-soft);
}

.composer-card-saas__title::placeholder,
.composer-card-saas__editor::placeholder,
.settings-input::placeholder,
.issue-toolbar__search input::placeholder,
.issue-reply-form__textarea::placeholder,
.thread-composer__textarea::placeholder {
    color: var(--color-placeholder);
    opacity: 1;
}

.composer-card-saas__title:focus,
.composer-card-saas__editor:focus,
.settings-input:focus,
.issue-toolbar__search input:focus,
.issue-reply-form__textarea:focus,
.issue-select:focus,
.thread-composer__input:focus-within {
    border-color: var(--color-focus);
    box-shadow: 0 0 0 4px var(--color-focus-ring);
}

.theme-toggle {
    display: inline-grid;
    place-items: center;
    gap: 0;
    padding: 0;
}

.theme-toggle__icon {
    display: inline-grid;
    place-items: center;
    width: 1.1em;
    height: 1.1em;
    line-height: 1;
}

.issue-toolbar__field {
    align-items: center;
}

.issue-toolbar__field span {
    width: 100%;
    text-align: center;
}

.issue-filter,
.issue-select {
    text-align: center;
    text-align-last: center;
}

.issue-select {
    padding-left: 18px;
    padding-right: 34px;
}

.media-lightbox__action,
.media-lightbox__close,
.media-lightbox__external {
    display: inline-grid;
    place-items: center;
}

.media-lightbox__close {
    padding: 0;
}

.settings-activity-filter {
    justify-content: center;
}

.settings-activity-mode {
    justify-content: center;
    align-items: center;
}

.settings-activity-mode legend {
    text-align: center;
}

.settings-activity-mode__option {
    justify-content: center;
    text-align: center;
}

.settings-activity-mode__option span {
    display: inline-block;
    min-width: 2.5em;
}

.settings-table,
.thread-prose table {
    border-color: var(--color-border);
    background: var(--color-surface);
}

.settings-table th,
.thread-prose th {
    background: var(--color-table-header-bg);
    color: var(--color-text);
    border-bottom-color: var(--color-border);
}

.settings-table td,
.thread-prose td {
    color: var(--color-text);
    border-bottom-color: var(--color-border-soft);
}

.settings-table tbody tr:nth-child(even) td {
    background: var(--color-table-row-alt);
}

.composer-modal__dialog,
.issue-reply-modal__dialog,
.sketch-modal__dialog,
.status-overlay__dialog,
.media-lightbox__dialog {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}

.flash,
.toast,
.app-notification,
.app-health,
.empty-state,
.settings-activity-top5,
.settings-staff-card,
.settings-access-card,
.issue-inbox__metric,
.course-summary-card__surface,
.stats-panel,
.stats-kpi-card,
.stats-dashboard__hero,
.stats-dashboard__filters,
.stats-dashboard--simple .stats-kpi-simple,
.stats-dashboard--simple .stats-mini-ranking__row,
.stats-dashboard--simple .stats-page-header,
.stats-dashboard--simple .stats-hero-simple,
.stats-dashboard--simple .stats-filters-simple {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}

.flash--success,
.toast--success,
.settings-access-note--success {
    color: var(--color-success);
    background: var(--color-success-soft);
    border-color: color-mix(in srgb, var(--color-success) 40%, #ffffff);
}

.flash--error,
.toast--error,
.app-health--alert,
.app-notification--alert {
    color: var(--color-danger);
    background: var(--color-danger-soft);
    border-color: color-mix(in srgb, var(--color-danger) 40%, #ffffff);
}

.toast--warning,
.app-notification--warning,
.issue-state--important,
.discussion-thread__pill--important,
.course-summary-card__status--attention {
    color: var(--color-warning);
    background: var(--color-warning-soft);
    border-color: color-mix(in srgb, var(--color-warning) 36%, #ffffff);
}

.toast--info,
.app-notification--brand,
.discussion-thread__pill--course,
.issue-chip--course,
.course-banner__badge,
.stats-dashboard--simple .stats-pill input:checked + span {
    color: var(--color-info);
    background: var(--color-info-soft);
    border-color: color-mix(in srgb, var(--color-info) 36%, #ffffff);
}

.toast__button,
.issue-actions__item--primary,
.issue-create-menu__link,
.settings-topic-group__toggle,
.settings-activity-mode__option,
.stats-dashboard--simple .stats-pill span,
.stats-dashboard--simple .stats-custom-range,
.stats-dashboard--simple .stats-mini-ranking__row {
    color: var(--color-secondary);
    background: var(--color-surface-muted);
    border-color: var(--color-border-soft);
}

.topbar-button--quiet,
.topbar-button--icon,
.issue-inline-button,
.issue-filter,
.theme-toggle,
.issue-actions__toggle,
.issue-create-menu__toggle {
    color: var(--color-secondary);
    background: var(--color-surface);
    border-color: var(--color-border-strong);
}

.topbar-button--primary,
.course-summary-card__link,
.issue-filter.is-active,
.app-nav__link.is-active,
.settings-tab.is-active,
.course-banner__tutor-link {
    color: var(--color-primary-text);
    background: var(--gradient-primary);
    border-color: transparent;
}

.topbar-button--danger,
.issue-inline-button--danger,
.issue-actions__item--danger {
    color: var(--color-danger-text);
    background: var(--gradient-danger);
    border-color: transparent;
}

.topbar-button--secondary,
.issue-inline-button--secondary,
.stats-dashboard--simple .stats-kpi-simple--warn {
    color: var(--color-secondary-text);
    background: var(--gradient-secondary);
    border-color: transparent;
}

.settings-tabs-shell,
.settings-tab,
.settings-activity-mode,
.issue-toolbar__field,
.issue-create-menu__panel,
.issue-actions__menu,
.discussion-thread .issue-actions__menu {
    background: var(--color-floating-menu-bg);
    color: var(--color-floating-menu-text);
    border-color: var(--color-border);
}

.settings-tab {
    background: var(--color-tab-bg);
    color: var(--color-tab-text);
    box-shadow: none;
}

.settings-tab.is-active {
    background: var(--color-tab-active-bg);
    color: var(--color-tab-active-text);
}

.discussion-thread__status,
.discussion-thread__pill,
.issue-chip,
.issue-state,
.course-summary-card__status,
.course-summary-card__signal,
.discussion-thread__summary-signal,
.discussion-thread__toggle-label,
.issue-row__toggle-label,
.thread-response__badge,
.stats-dashboard--simple .stats-filter-label,
.stats-dashboard--simple .stats-custom-range__summary,
.stats-dashboard--simple .stats-filter-select > span {
    background: var(--color-chip-bg);
    color: var(--color-chip-text);
    border-color: color-mix(in srgb, var(--color-chip-text) 30%, #ffffff);
}

.app-nav,
.not-found-page__path,
.public-landing__brand,
.course-banner__fact {
    background: var(--color-breadcrumb-bg);
    color: var(--color-breadcrumb-text);
    border-color: var(--color-border-soft);
}

.public-landing__hero,
.not-found-page__shell,
.public-landing__card,
.auth-card,
.maintenance-card,
.settings-card--premium,
.settings-card--premium-soft,
.issue-inbox-panel,
.settings-access-panel--premium,
.course-directory__priority-shell,
.course-directory__directory-shell,
.course-directory__priority-empty,
.stats-dashboard,
.stats-dashboard--simple {
    background: linear-gradient(180deg, color-mix(in srgb, var(--color-surface) 94%, transparent), color-mix(in srgb, var(--color-surface-muted) 94%, transparent));
    color: var(--color-text);
    border-color: var(--color-border);
}

.stats-dashboard,
.stats-panel,
.stats-kpi-card,
.stats-dashboard__hero,
.stats-dashboard__filters,
.stats-dashboard--simple .stats-page-header,
.stats-dashboard--simple .stats-hero-simple,
.stats-dashboard--simple .stats-kpi-simple,
.stats-dashboard--simple .stats-mini-ranking__row,
.stats-dashboard--simple .stats-filters-simple {
    color: var(--color-stats-text);
}

.stats-kpi-card__meta,
.stats-columns__label,
.stats-legend li,
.stats-insights-list li,
.stats-donut__chart small,
.stats-heatmap__header span,
.stats-bars__label,
.stats-bars__value,
.stats-dashboard--simple .stats-kpi-simple span,
.stats-dashboard--simple .stats-kpi-simple small,
.stats-dashboard--simple .stats-mini-ranking__row span {
    color: var(--color-stats-muted);
}

.issue-actions__menu,
.issue-create-menu__panel,
.toast,
.toast__button,
.toast__dismiss {
    color: var(--color-floating-menu-text);
}

.toast__dismiss,
.thread-response__vote-label,
.discussion-thread__meta,
.issue-row__subline,
.issue-detail__meta,
.issue-detail__label,
.course-banner__support,
.public-landing__lead,
.not-found-page__lead,
.public-landing__brand span,
.stats-dashboard__filters .panel__eyebrow,
.stats-dashboard__filters .panel__text,
.empty-state p {
    color: var(--color-text-muted);
}

.empty-state h3,
.issue-row__title,
.issue-detail__section p,
.public-landing__title,
.not-found-page__title,
.stats-kpi-card__value,
.stats-columns__value,
.stats-donut__chart strong,
.stats-heatmap__row strong,
.stats-dashboard--simple .stats-kpi-simple strong,
.stats-dashboard--simple .stats-mini-ranking__row strong {
    color: var(--color-text);
}

.topbar-button:disabled,
.issue-inline-button:disabled,
.topbar-button.is-disabled,
.settings-tab[disabled],
.issue-select:disabled,
.settings-input:disabled,
.composer-card-saas__title:disabled,
.composer-card-saas__editor:disabled,
.issue-reply-form__textarea:disabled,
.stats-dashboard--simple .stats-pill input:disabled + span {
    color: var(--color-disabled-text);
    background: var(--color-disabled-surface);
    border-color: var(--color-disabled-border);
    opacity: 1;
}

.app-notification__badge,
.toast__button {
    background: var(--gradient-secondary);
    color: var(--color-secondary-text);
}

.toast__button:hover,
.issue-create-menu__link:hover,
.issue-actions__item:hover,
.settings-tab:hover,
.issue-filter:hover,
.topbar-button:hover {
    filter: brightness(1.06);
}

[data-tooltip],
.tooltip,
.tooltip-content {
    background: var(--color-tooltip-bg);
    color: var(--color-tooltip-text);
    border: 1px solid color-mix(in srgb, var(--color-tooltip-text) 22%, transparent);
}

.toast,
.issue-actions__menu,
.issue-create-menu__panel,
.discussion-thread .issue-actions__menu,
.media-lightbox__dialog,
.composer-modal__dialog,
.issue-reply-modal__dialog,
.sketch-modal__dialog,
.status-overlay__dialog {
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.24);
}

html[data-theme='dark'] {
    --color-filter-panel-bg: linear-gradient(180deg, rgba(11, 19, 33, 0.98), rgba(9, 16, 28, 0.98));
    --color-filter-control-bg: linear-gradient(180deg, rgba(18, 30, 49, 0.98), rgba(13, 23, 39, 0.98));
    --color-filter-control-hover: linear-gradient(180deg, rgba(24, 39, 63, 0.98), rgba(15, 26, 44, 0.98));
    --color-filter-arrow: #d7e4f5;
    --color-rich-border: rgba(148, 163, 184, 0.18);
    --color-rich-code-bg: #0a1424;
    --color-rich-code-inline: #e6eefb;
    --color-response-teacher-bg: linear-gradient(180deg, rgba(20, 33, 54, 0.98), rgba(11, 20, 35, 0.99));
    --color-response-student-bg: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(10, 17, 30, 0.98));
    --color-response-overlay: linear-gradient(180deg, rgba(10, 17, 30, 0) 0%, rgba(10, 17, 30, 0.18) 16%, rgba(10, 17, 30, 0.44) 36%, rgba(10, 17, 30, 0.82) 68%, rgba(10, 17, 30, 0.98) 100%);
}

html[data-theme='dark'] .issue-toolbar__controls--modern {
    gap: 10px;
}

html[data-theme='dark'] .issue-toolbar__field {
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

html[data-theme='dark'] .issue-toolbar__field span {
    color: #b8c8dd;
}

html[data-theme='dark'] .issue-select,
html[data-theme='dark'] .issue-toolbar__search input,
html[data-theme='dark'] .issue-toolbar__search--wide input {
    border: 1px solid rgba(148, 163, 184, 0.22);
    background-color: transparent;
    color: #f8fbff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

html[data-theme='dark'] .issue-select {
    background-image:
        linear-gradient(45deg, transparent 50%, var(--color-filter-arrow) 50%),
        linear-gradient(135deg, var(--color-filter-arrow) 50%, transparent 50%),
        var(--color-filter-control-bg);
    background-position:
        calc(100% - 14px) calc(50% - 2px),
        calc(100% - 9px) calc(50% - 2px),
        0 0;
    background-size: 5px 5px, 5px 5px, 100% 100%;
    background-repeat: no-repeat;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 0 0 1px rgba(10, 17, 30, 0.18);
}

html[data-theme='dark'] .issue-select:hover,
html[data-theme='dark'] .issue-toolbar__search input:hover,
html[data-theme='dark'] .issue-toolbar__search--wide input:hover {
    border-color: rgba(148, 163, 184, 0.32);
    background-image:
        linear-gradient(45deg, transparent 50%, var(--color-filter-arrow) 50%),
        linear-gradient(135deg, var(--color-filter-arrow) 50%, transparent 50%),
        var(--color-filter-control-hover);
}

html[data-theme='dark'] .issue-select:focus,
html[data-theme='dark'] .issue-select:focus-visible,
html[data-theme='dark'] .issue-toolbar__search input:focus,
html[data-theme='dark'] .issue-toolbar__search input:focus-visible,
html[data-theme='dark'] .issue-toolbar__search--wide input:focus,
html[data-theme='dark'] .issue-toolbar__search--wide input:focus-visible {
    border-color: var(--color-focus);
    box-shadow: 0 0 0 4px var(--color-focus-ring);
    outline: none;
}

html[data-theme='dark'] .issue-select option,
html[data-theme='dark'] select.issue-select option {
    background: #0f1c31;
    color: #f8fbff;
}

html[data-theme='dark'] .issue-board-panel,
html[data-theme='dark'] .issue-board-panel--course,
html[data-theme='dark'] .issue-board-panel--student,
html[data-theme='dark'] .issue-inbox-panel,
html[data-theme='dark'] .course-directory__priority-shell,
html[data-theme='dark'] .course-directory__directory-shell,
html[data-theme='dark'] .course-directory__priority-empty {
    background: linear-gradient(180deg, rgba(12, 20, 35, 0.98), rgba(9, 16, 28, 0.98));
    border-color: rgba(148, 163, 184, 0.14);
}

html[data-theme='dark'] .course-summary-card,
html[data-theme='dark'] .course-summary-card__surface,
html[data-theme='dark'] .issue-row,
html[data-theme='dark'] .discussion-thread.issue-row,
html[data-theme='dark'] .issue-answer,
html[data-theme='dark'] .issue-detail__section--question,
html[data-theme='dark'] .thread-response,
html[data-theme='dark'] .thread-attachment,
html[data-theme='dark'] .issue-file,
html[data-theme='dark'] .issue-vote-cluster {
    border-color: rgba(148, 163, 184, 0.16);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(10, 17, 30, 0.98));
}

html[data-theme='dark'] .discussion-thread__detail,
html[data-theme='dark'] .thread-response__panel,
html[data-theme='dark'] .thread-response__detail,
html[data-theme='dark'] .rich-preview,
html[data-theme='dark'] .rich-preview__content,
html[data-theme='dark'] .thread-code,
html[data-theme='dark'] .thread-code pre,
html[data-theme='dark'] .thread-prose table,
html[data-theme='dark'] .thread-math,
html[data-theme='dark'] .thread-math--display {
    background: var(--color-surface-rich);
    border-color: var(--color-rich-border);
}

html[data-theme='dark'] .thread-response {
    background: var(--color-response-student-bg);
    box-shadow: 0 16px 32px rgba(2, 6, 23, 0.24);
}

html[data-theme='dark'] .thread-response--teacher {
    background: var(--color-response-teacher-bg);
    border-left-color: #60a5fa;
}

html[data-theme='dark'] .thread-response--empty {
    background: linear-gradient(180deg, rgba(18, 29, 46, 0.9), rgba(12, 19, 32, 0.98));
}

html[data-theme='dark'] .thread-response__collapsed {
    border-color: rgba(148, 163, 184, 0.2);
    background: linear-gradient(180deg, rgba(18, 29, 46, 0.88), rgba(11, 20, 35, 0.98));
}

html[data-theme='dark'] .thread-response__collapsed::after {
    background: var(--color-response-overlay), linear-gradient(90deg, rgba(10, 17, 30, 0.18) 0%, rgba(10, 17, 30, 0.04) 20%, rgba(10, 17, 30, 0.04) 80%, rgba(10, 17, 30, 0.18) 100%);
}

html[data-theme='dark'] .discussion-thread__title,
html[data-theme='dark'] .discussion-thread__content,
html[data-theme='dark'] .issue-row__title,
html[data-theme='dark'] .thread-response__identity strong,
html[data-theme='dark'] .thread-response__empty-copy strong,
html[data-theme='dark'] .thread-attachment__meta strong,
html[data-theme='dark'] .thread-prose,
html[data-theme='dark'] .thread-prose h1,
html[data-theme='dark'] .thread-prose h2,
html[data-theme='dark'] .thread-prose h3,
html[data-theme='dark'] .thread-prose h4,
html[data-theme='dark'] .thread-prose h5,
html[data-theme='dark'] .thread-response--teacher .thread-prose,
html[data-theme='dark'] .thread-response--teacher .thread-prose h1,
html[data-theme='dark'] .thread-response--teacher .thread-prose h2,
html[data-theme='dark'] .thread-response--teacher .thread-prose h3,
html[data-theme='dark'] .thread-response--teacher .thread-prose h4,
html[data-theme='dark'] .thread-response--teacher .thread-prose h5 {
    color: #f8fbff;
}

html[data-theme='dark'] .discussion-thread__meta,
html[data-theme='dark'] .issue-row__subline,
html[data-theme='dark'] .issue-detail__meta,
html[data-theme='dark'] .issue-detail__label,
html[data-theme='dark'] .thread-response__identity span,
html[data-theme='dark'] .thread-response__note,
html[data-theme='dark'] .thread-response__empty-copy p,
html[data-theme='dark'] .thread-attachment__meta small,
html[data-theme='dark'] .thread-response__vote-label {
    color: #cbd5e1;
}

html[data-theme='dark'] .thread-prose a,
html[data-theme='dark'] .thread-response--teacher .thread-prose a {
    color: #93c5fd;
}

html[data-theme='dark'] .composer-card-saas__topics,
html[data-theme='dark'] .discussion-thread__topic-editor,
html[data-theme='dark'] .thread-composer__footer {
    background: linear-gradient(180deg, rgba(17, 27, 45, 0.96), rgba(12, 20, 35, 0.98));
    border-color: rgba(148, 163, 184, 0.18);
}

html[data-theme='dark'] .composer-card-saas__topics-copy strong,
html[data-theme='dark'] .discussion-thread__topic-editor-copy strong,
html[data-theme='dark'] .thread-composer__header-copy strong {
    color: #f8fbff;
}

html[data-theme='dark'] .composer-card-saas__topics-copy span,
html[data-theme='dark'] .discussion-thread__topic-editor-copy span,
html[data-theme='dark'] .thread-composer__hint,
html[data-theme='dark'] .thread-composer__header-copy span {
    color: #cbd5e1;
}

html[data-theme='dark'] .discussion-thread__topic-chip,
html[data-theme='dark'] .discussion-thread__topic-pill {
    background: rgba(18, 44, 70, 0.96);
    color: #d8ecff;
    border-color: rgba(125, 164, 219, 0.32);
}

html[data-theme='dark'] .discussion-thread__topic-pill:hover {
    box-shadow: 0 14px 28px rgba(2, 6, 23, 0.3);
    background: rgba(25, 56, 88, 0.98);
}

html[data-theme='dark'] .discussion-thread__topic-input:checked + .discussion-thread__topic-pill {
    border-color: rgba(96, 165, 250, 0.48);
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: #eff6ff;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.28);
}

html[data-theme='dark'] .discussion-thread__topic-input:focus-visible + .discussion-thread__topic-pill {
    outline-color: rgba(96, 165, 250, 0.52);
}

html[data-theme='dark'] .thread-composer__input {
    background: rgba(7, 12, 22, 0.92);
    border-color: rgba(148, 163, 184, 0.18);
    box-shadow: inset 0 1px 2px rgba(2, 6, 23, 0.35);
}

html[data-theme='dark'] .thread-prose code {
    background: rgba(148, 163, 184, 0.12);
    color: var(--color-rich-code-inline);
}

html[data-theme='dark'] .thread-prose pre,
html[data-theme='dark'] .thread-code pre {
    background: var(--color-rich-code-bg);
    color: #eef4ff;
}

html[data-theme='dark'] .thread-prose blockquote,
html[data-theme='dark'] .thread-response--teacher .thread-prose blockquote {
    background: rgba(22, 41, 67, 0.92);
    color: #dbe7f5;
    border-left-color: rgba(96, 165, 250, 0.42);
}

html[data-theme='dark'] .thread-prose table {
    background: var(--color-surface-content);
}

html[data-theme='dark'] .thread-prose th,
html[data-theme='dark'] .thread-prose td {
    border-bottom-color: rgba(148, 163, 184, 0.16);
}

html[data-theme='dark'] .thread-prose th {
    background: var(--color-surface-rich-strong);
    color: #f8fbff;
}

html[data-theme='dark'] .thread-prose td {
    background: rgba(17, 27, 45, 0.9);
    color: #dbe7f5;
}

html[data-theme='dark'] .thread-math,
html[data-theme='dark'] .thread-math--display,
html[data-theme='dark'] .thread-response--teacher .thread-math,
html[data-theme='dark'] .thread-response--teacher .thread-math--display {
    background: rgba(26, 42, 67, 0.92);
    color: #f8fbff;
}

html[data-theme='dark'] .thread-math .katex,
html[data-theme='dark'] .thread-math--display .katex,
html[data-theme='dark'] .thread-math--display .katex-display {
    color: inherit;
}

html[data-theme='dark'] .discussion-thread__pill,
html[data-theme='dark'] .issue-state,
html[data-theme='dark'] .course-summary-card__status,
html[data-theme='dark'] .course-summary-card__slug,
html[data-theme='dark'] .thread-response__badge,
html[data-theme='dark'] .discussion-thread__summary-signal,
html[data-theme='dark'] .discussion-thread__toggle-label {
    background: rgba(24, 50, 82, 0.98);
    color: #dbe9ff;
    border-color: rgba(125, 164, 219, 0.28);
}

.course-summary-card__priority {
    border-color: var(--color-course-priority-healthy-border);
    background: var(--color-course-priority-healthy-bg);
    color: var(--color-course-priority-healthy-text);
}

.course-summary-card__priority--healthy {
    border-color: var(--color-course-priority-healthy-border);
    background: var(--color-course-priority-healthy-bg);
    color: var(--color-course-priority-healthy-text);
}

.course-summary-card__priority--attention {
    border-color: var(--color-course-priority-attention-border);
    background: var(--color-course-priority-attention-bg);
    color: var(--color-course-priority-attention-text);
}

.course-summary-card__priority--recent {
    border-color: var(--color-course-priority-recent-border);
    background: var(--color-course-priority-recent-bg);
    color: var(--color-course-priority-recent-text);
}

.course-summary-card__priority--closed {
    border-color: var(--color-course-priority-closed-border);
    background: var(--color-course-priority-closed-bg);
    color: var(--color-course-priority-closed-text);
}

html[data-theme='dark'] .course-summary-card__priority {
    border-color: var(--color-course-priority-healthy-border);
    background: var(--color-course-priority-healthy-bg);
    color: var(--color-course-priority-healthy-text);
}

html[data-theme='dark'] .course-summary-card__priority--healthy {
    border-color: var(--color-course-priority-healthy-border);
    background: var(--color-course-priority-healthy-bg);
    color: var(--color-course-priority-healthy-text);
}

html[data-theme='dark'] .course-summary-card__priority--attention {
    border-color: var(--color-course-priority-attention-border);
    background: var(--color-course-priority-attention-bg);
    color: var(--color-course-priority-attention-text);
}

html[data-theme='dark'] .course-summary-card__priority--recent {
    border-color: var(--color-course-priority-recent-border);
    background: var(--color-course-priority-recent-bg);
    color: var(--color-course-priority-recent-text);
}

html[data-theme='dark'] .course-summary-card__priority--closed {
    border-color: var(--color-course-priority-closed-border);
    background: var(--color-course-priority-closed-bg);
    color: var(--color-course-priority-closed-text);
}

html[data-theme='dark'] .discussion-thread__pill--important,
html[data-theme='dark'] .issue-state--important,
html[data-theme='dark'] .course-summary-card__status--attention {
    background: rgba(88, 41, 16, 0.96);
    color: #fed7aa;
    border-color: rgba(251, 146, 60, 0.34);
}

html[data-theme='dark'] .discussion-thread__pill--course,
html[data-theme='dark'] .course-banner__badge {
    background: rgba(25, 51, 84, 0.96);
    color: #bfdbfe;
    border-color: rgba(96, 165, 250, 0.34);
}

html[data-theme='dark'] .topbar-button--quiet,
html[data-theme='dark'] .topbar-button--icon,
html[data-theme='dark'] .issue-inline-button,
html[data-theme='dark'] .issue-actions__toggle,
html[data-theme='dark'] .issue-create-menu__toggle,
html[data-theme='dark'] .issue-actions__menu,
html[data-theme='dark'] .issue-create-menu__panel,
html[data-theme='dark'] .discussion-thread .issue-actions__menu {
    background: var(--color-surface-elevated);
    color: #f8fbff;
    border-color: rgba(148, 163, 184, 0.18);
}

html[data-theme='dark'] .issue-create-menu__link,
html[data-theme='dark'] .issue-actions__item,
html[data-theme='dark'] .thread-attachment__action {
    background: rgba(18, 29, 46, 0.96);
    color: #f8fbff;
    border-color: rgba(148, 163, 184, 0.18);
}

html[data-theme='dark'] .issue-create-menu__link:hover,
html[data-theme='dark'] .issue-actions__item:hover,
html[data-theme='dark'] .thread-attachment__action:hover {
    background: rgba(31, 52, 84, 0.98);
}
