/* Study guide workspace — tabs, cards, split modal */

.sg-ws {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--text-primary, rgba(255, 255, 255, 0.92));
}

.sg-ws-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sg-ws-header-main {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
}

.sg-ws-back {
    flex-shrink: 0;
}

.sg-ws-title-block {
    min-width: 0;
}

.sg-ws-eyebrow {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 0.25rem;
}

.sg-ws-title {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.sg-ws-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.sg-ws-actions .btn {
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
}

.sg-ws-tablist {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.15rem;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.sg-ws-tab {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.sg-ws-tab:hover {
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.05);
}

.sg-ws-tab.is-active {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.sg-ws-panels {
    flex: 1;
    min-height: 280px;
    overflow: auto;
    padding-right: 0.25rem;
}

.sg-ws-panel {
    animation: sgFadeIn 0.2s ease;
}

.sg-ws-panel.hidden {
    display: none !important;
}

@keyframes sgFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.sg-ws-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.sg-ws-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.sg-ws-card:hover {
    border-color: rgba(46, 204, 113, 0.35);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.sg-ws-card-title {
    margin: 0 0 0.65rem 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}

.sg-ws-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 0.2rem;
}

.sg-ws-card-def,
.sg-ws-card-why,
.sg-ws-card-ex {
    margin: 0.5rem 0 0 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.78);
}

.sg-ws-understood {
    margin-top: 0.85rem;
    width: 100%;
}

.sg-ws-prose {
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.78);
}

.sg-ws-prose--large {
    font-size: 0.98rem;
    line-height: 1.65;
}

.sg-ws-p {
    margin: 0 0 0.85rem 0;
}

.sg-ws-muted {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.9rem;
}

.sg-ws-fulltext {
    margin-top: 1.5rem;
    padding: 1rem 1.1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.22);
}

.sg-ws-fulltext-heading {
    margin: 0 0 0.35rem 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
}

.sg-ws-fulltext-lead {
    margin: 0 0 0.85rem 0;
    font-size: 0.88rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.5);
}

.sg-ws-fulltext-body {
    margin-top: 0.25rem;
}

.sg-ws-details {
    margin-bottom: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0.5rem 0.85rem;
    background: rgba(0, 0, 0, 0.15);
}

.sg-ws-details-sum {
    font-weight: 600;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.88);
}

.sg-ws-details-body {
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sg-ws-reveal-hint {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0 0 0.5rem 0;
}

.sg-ws-reveal-btn {
    margin-bottom: 0.75rem;
}

.sg-ws-mcq {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.sg-ws-mcq-q {
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
}

.sg-ws-mcq-opts {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 0.75rem;
}

.sg-ws-mcq-opt {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    transition: background 0.12s;
    font-size: 0.9rem;
}

.sg-ws-mcq-opt:hover {
    background: rgba(255, 255, 255, 0.05);
}

.sg-ws-mcq-opt input {
    margin-top: 0.2rem;
}

.sg-ws-mcq-feedback {
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.sg-ws-feedback-ok {
    color: #2ecc71;
}

.sg-ws-feedback-warn {
    color: #f39c12;
}

.sg-ws-shortanswer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.12);
}

.sg-ws-textarea {
    width: 100%;
    box-sizing: border-box;
    margin: 0.5rem 0;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.25);
    color: inherit;
    font-family: inherit;
    font-size: 0.9rem;
}

.sg-ws-label-block {
    font-weight: 600;
    display: block;
    margin-bottom: 0.35rem;
}

.sg-ws-checklist {
    margin: 0 0 1rem 0;
    padding-left: 1.2rem;
    color: rgba(255, 255, 255, 0.82);
}

.sg-ws-checklist li {
    margin: 0.4rem 0;
}

.sg-ws-review-hero {
    margin-bottom: 1.25rem;
    padding: 1rem 1.15rem;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.12), rgba(52, 152, 219, 0.08));
    border: 1px solid rgba(46, 204, 113, 0.25);
}

.sg-ws-review-title {
    margin: 0 0 0.65rem 0;
    font-size: 1.1rem;
}

.sg-ws-review-list {
    margin: 0;
    padding-left: 1.2rem;
}

.sg-ws-review-list li {
    margin: 0.35rem 0;
}

/* Modal split layout */
.lockin-study-guide-modal.sg-workspace-modal .modal-content {
    max-width: min(1120px, 96vw);
    width: 96vw;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sg-modal-split {
    display: grid;
    grid-template-columns: minmax(240px, 30%) 1fr;
    gap: 1.25rem;
    min-height: 420px;
    max-height: calc(92vh - 140px);
    overflow: hidden;
}

@media (max-width: 820px) {
    .sg-modal-split {
        grid-template-columns: 1fr;
        max-height: none;
    }
}

.sg-modal-input-pane {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    overflow: auto;
    padding-right: 0.35rem;
}

.sg-modal-input-pane .study-guide-hint {
    font-size: 0.88rem;
    line-height: 1.45;
}

.sg-modal-output-pane {
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: auto;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    padding-left: 1.25rem;
}

@media (max-width: 820px) {
    .sg-modal-output-pane {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        padding-top: 1rem;
    }
}

#sg-modal-workspace-mount .sg-ws {
    padding-bottom: 0.5rem;
}

#sg-modal-workspace-mount .sg-ws-header {
    flex-direction: column;
}

#sg-modal-workspace-mount .sg-ws-actions {
    width: 100%;
}

/* Viewer page: full width workspace + Q&A */
.study-guide-viewer-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 0.5rem 2rem;
}

.study-guide-viewer-layout #study-guide-workspace-root {
    min-height: 360px;
}

.sg-print-body {
    padding: 2rem;
    font-family: system-ui, sans-serif;
}
