:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #17212b;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #2563eb;
  --primary-soft: #eff6ff;
  --sidebar-bg: #0f172a;
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --danger-soft: rgba(239, 68, 68, 0.12);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --topbar-h: 72px;
  --sidebar-w: 260px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

body {
  min-height: 100vh;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

.prose-box h1 {
    font-size: 32px;
    line-height: 1.2;
    font-weight: 800;
    margin: 18px 0 12px;
}

.prose-box h2 {
    font-size: 26px;
    line-height: 1.25;
    font-weight: 800;
    margin: 16px 0 10px;
}

.prose-box h3 {
    font-size: 22px;
    line-height: 1.3;
    font-weight: 700;
    margin: 14px 0 8px;
}

.prose-box h4 {
    font-size: 19px;
    line-height: 1.35;
    font-weight: 700;
    margin: 12px 0 8px;
}

.prose-box p {
    margin: 0 0 12px;
    line-height: 1.7;
}

.prose-box img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 12px 0;
}

.prose-box ul,
.prose-box ol {
    padding-left: 24px;
    margin: 10px 0;
}

.prose-box table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.prose-box th,
.prose-box td {
    border: 1px solid #ddd;
    padding: 8px;
}
.prose-box span {
    line-height: inherit;
}

.prose-box [style] {
    max-width: 100%;
}

.prose-box h1,
.prose-box h2,
.prose-box h3,
.prose-box h4,
.prose-box h5,
.prose-box h6 {
    color: inherit;
}

.prose-box blockquote {
    border-left: 4px solid #d1d5db;
    padding-left: 12px;
    margin: 14px 0;
    color: #4b5563;
}

.prose-box pre {
    background: #111827;
    color: #f9fafb;
    padding: 12px;
    border-radius: 10px;
    overflow-x: auto;
}

.prose-box mark {
    background: #fef08a;
    padding: 1px 4px;
    border-radius: 4px;
}

.prose-box hr {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin: 18px 0;
}

.workspace-section-title-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.workspace-review-count {
    display: inline-flex;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    margin-left: 6px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    background: #dc2626;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.workspace-review-count.hidden {
    display: none;
}

.workspace-review-modal.hidden {
    display: none;
}

.workspace-review-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.workspace-review-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.workspace-review-modal__panel {
    position: absolute;
    top: 48px;
    right: 32px;
    width: min(920px, calc(100vw - 64px));
    max-height: calc(100vh - 96px);
    overflow: hidden;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
    display: flex;
    flex-direction: column;
}

.workspace-review-modal__head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    border-bottom: 1px solid #e5e7eb;
}

.workspace-review-modal__head h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 900;
    color: #0f172a;
}

.workspace-review-modal__head p {
    margin: 4px 0 0;
    font-size: 13px;
    color: #64748b;
}

.workspace-review-modal__close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 24px;
    cursor: pointer;
}

.workspace-review-modal__body {
    padding: 18px;
    overflow: auto;
}

.workspace-review-card {
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #fff;
    padding: 16px;
    margin-bottom: 14px;
}

.workspace-review-card__top {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.workspace-review-card__top strong {
    display: block;
    font-size: 16px;
    color: #0f172a;
}

.workspace-review-card__meta {
    margin-top: 4px;
    font-size: 12px;
    color: #64748b;
}

.workspace-review-diff {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.workspace-review-diff__col {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f8fafc;
    padding: 12px;
}

.workspace-review-diff__col span {
    display: inline-flex;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.workspace-review-diff__col h4 {
    margin: 0 0 8px;
    font-size: 14px;
    color: #0f172a;
}

.workspace-review-diff__col p {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: #475569;
}

.workspace-review-note {
    min-height: 66px;
    margin-bottom: 12px;
}

.workspace-review-card__actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

@media (max-width: 760px) {
    .workspace-review-modal__panel {
        top: auto;
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        max-height: 86vh;
        border-radius: 22px 22px 0 0;
    }

    .workspace-review-diff {
        grid-template-columns: 1fr;
    }
}

.workspace-review-section-info {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 12px 0;
}

.workspace-review-section-info > div {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f8fafc;
}

.workspace-review-section-info span {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.workspace-review-section-info strong {
    display: block;
    font-size: 13px;
    color: #0f172a;
}

.workspace-review-full {
    margin: 12px 0;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}

.workspace-review-full summary {
    cursor: pointer;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    background: #f8fafc;
}

.workspace-review-full__box {
    padding: 14px;
    max-height: 320px;
    overflow: auto;
    font-size: 14px;
    line-height: 1.7;
}

@media (max-width: 760px) {
    .workspace-review-section-info {
        grid-template-columns: 1fr 1fr;
    }
}

.workspace-page.is-ajax-loading {
    opacity: 0.55;
    pointer-events: none;
    position: relative;
}

.workspace-page.is-ajax-loading::after {
    content: "Loading...";
    position: fixed;
    top: 92px;
    right: 28px;
    z-index: 9999;
    padding: 10px 14px;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
}

.form-help {
    margin-top: 6px;
    font-size: 12px;
    color: #64748b;
}

.quiz-builder-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.quiz-question-list {
    display: grid;
    gap: 14px;
}

.quiz-question-card {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 14px;
    background: #f8fafc;
}

.quiz-question-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.workspace-quiz-row {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.workspace-quiz-row:hover {
    background: #f8fafc;
}

.workspace-quiz-attempt-dialog {
    max-width: 860px;
}

.workspace-quiz-attempt-questions {
    display: grid;
    gap: 14px;
}

.workspace-quiz-question {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #f8fafc;
    padding: 14px;
}

.workspace-quiz-question__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #64748b;
    font-weight: 800;
}

.workspace-quiz-question h4 {
    margin: 0 0 12px;
    font-size: 15px;
    color: #0f172a;
}

.workspace-quiz-options {
    display: grid;
    gap: 8px;
}

.workspace-quiz-option {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    padding: 10px 12px;
    cursor: pointer;
}

.workspace-quiz-option:hover {
    border-color: #2563eb;
}

.workspace-quiz-option__key {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #eef2ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 900;
}

.workspace-quiz-attempt-result {
    margin-top: 14px;
    border: 1px solid #bbf7d0;
    border-radius: 16px;
    background: #f0fdf4;
    padding: 14px;
}

.workspace-quiz-attempt-result h4 {
    margin: 0 0 8px;
}

.workspace-quiz-score {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
}

.workspace-quiz-score strong {
    color: #166534;
}

.workspace-quiz-score span {
    padding: 4px 10px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-weight: 900;
}
.quiz-builder-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 14px;
    background: #f8fafc;
}

.quiz-question-list {
    display: grid;
    gap: 14px;
    margin-top: 14px;
}

.quiz-question-card {
    padding: 14px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 16px;
    background: #ffffff;
}

.quiz-question-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.quiz-question-card__title {
    font-size: 14px;
    font-weight: 700;
}

@media (max-width: 700px) {
    .quiz-builder-head,
    .quiz-question-card__head {
        align-items: stretch;
        flex-direction: column;
    }

    .quiz-builder-head .btn,
    .quiz-question-card__head .btn {
        width: 100%;
    }
}
.workspace-tree-quiz-btn {
    width: 24px;
    height: 24px;
    margin-left: 4px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: #2563eb;
    font-size: 12px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.18s ease;
    flex: 0 0 auto;
}

.workspace-tree-quiz-btn:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    transform: translateY(-1px);
}

.workspace-tree__row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.workspace-tree__link {
    min-width: 0;
}