/* =====================================================================
   WorkForge Prep: home, collection, session, results and the question
   editor. One stylesheet, loaded after app.css. Classes start with pp-.
   Same look as the other tools: 12px 32px page padding, white cards with
   gray headers, purple #6b5fe6 actions; green right, red wrong.
   ===================================================================== */

.pp-page {
    padding: 12px 32px 32px;
    color: #1f2330;
}

.pp-header {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.pp-header-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #f1effd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}

.pp-header-text {
    flex: 1;
    min-width: 180px;
}

.pp-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    overflow-wrap: anywhere;
}

.pp-subtitle {
    margin: 2px 0 0;
    color: #6b7280;
    font-size: 14px;
}

.pp-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #6b5fe6;
    text-decoration: none;
    margin-bottom: 14px;
}

    .pp-back:hover {
        text-decoration: underline;
    }

/* Buttons */
.pp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 8px;
    border: 1px solid #d6d9e0;
    background: #fff;
    color: #1f2330;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

    .pp-btn:hover:not(:disabled) {
        background: #f5f6f8;
        color: #1f2330;
        text-decoration: none;
    }

    .pp-btn:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

.pp-btn-primary {
    background: #6b5fe6;
    border-color: #6b5fe6;
    color: #fff;
}

    .pp-btn-primary:hover:not(:disabled) {
        background: #5a4fd4;
        color: #fff;
    }

.pp-btn-danger {
    color: #c62828;
    border-color: #f1c4c4;
}

    .pp-btn-danger:hover:not(:disabled) {
        background: #fdecec;
        color: #b71c1c;
    }

.pp-btn-small {
    padding: 6px 11px;
    font-size: 13px;
}

.pp-icon-btn {
    border: none;
    background: none;
    color: #8a8f9c;
    cursor: pointer;
    padding: 4px 7px;
    border-radius: 6px;
    font-size: 13px;
}

    .pp-icon-btn:hover:not(:disabled) {
        color: #1f2330;
        background: #eef0f3;
    }

    .pp-icon-btn:disabled {
        opacity: 0.35;
        cursor: default;
    }

    .pp-icon-btn-danger:hover:not(:disabled) {
        color: #c62828;
        background: #fdecec;
    }

/* Messages */
.pp-error, .pp-saved, .pp-warning {
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 14px;
}

.pp-error {
    background: #fdecec;
    color: #b71c1c;
    border: 1px solid #f5c6c6;
}

.pp-saved {
    background: #e8f6ee;
    color: #1b6b3a;
    border: 1px solid #bfe5cd;
}

.pp-warning {
    background: #fff8e8;
    color: #7a5200;
    border: 1px solid #f3dfae;
}

.pp-hint {
    font-size: 13px;
    color: #6b7280;
}

.pp-loading {
    padding: 40px;
    text-align: center;
    color: #6b7280;
}

.pp-empty {
    text-align: center;
    padding: 48px 20px;
    background: #fff;
    border: 1px dashed #d6d9e0;
    border-radius: 12px;
    color: #6b7280;
}

    .pp-empty .pp-empty-icon {
        font-size: 40px;
        margin-bottom: 8px;
    }

    .pp-empty h2 {
        font-size: 18px;
        color: #1f2330;
        margin: 0 0 6px;
    }

    .pp-empty .pp-actions {
        justify-content: center;
        margin-top: 14px;
    }

/* Cards, forms, chips */
.pp-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 18px;
    min-width: 0;
}

.pp-card-header {
    padding: 12px 18px;
    background: #eef0f3;
    border-radius: 12px 12px 0 0;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

    .pp-card-header .pp-card-header-end {
        margin-left: auto;
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }

.pp-card-body {
    padding: 18px;
}

.pp-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 14px;
    min-width: 0;
}

    .pp-field > label, .pp-field-label {
        font-size: 13px;
        font-weight: 600;
        color: #3b4050;
    }

    .pp-field input[type=text], .pp-field input[type=number], .pp-field input[type=url], .pp-field input[type=search],
    .pp-field select, .pp-field textarea {
        width: 100%;
        padding: 8px 11px;
        border: 1px solid #d6d9e0;
        border-radius: 8px;
        font-size: 14px;
        background: #fff;
        font-family: inherit;
    }

    .pp-field textarea {
        resize: vertical;
        min-height: 80px;
    }

.pp-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0 16px;
}

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

.pp-actions-end {
    margin-left: auto;
}

.pp-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 10px;
    cursor: pointer;
}

.pp-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pp-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #d6d9e0;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    color: #3b4050;
}

    .pp-chip:hover:not(:disabled) {
        background: #f5f6f8;
    }

    .pp-chip.active {
        background: #6b5fe6;
        border-color: #6b5fe6;
        color: #fff;
    }

    .pp-chip:disabled {
        opacity: 0.45;
        cursor: default;
    }

.pp-chip-count {
    font-size: 12px;
    opacity: 0.75;
}

.pp-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.pp-search {
    flex: 1;
    min-width: 180px;
    max-width: 360px;
    position: relative;
}

    .pp-search i {
        position: absolute;
        left: 11px;
        top: 50%;
        transform: translateY(-50%);
        color: #9aa0ad;
        font-size: 13px;
    }

    .pp-search input {
        width: 100%;
        padding: 8px 12px 8px 32px;
        border: 1px solid #d6d9e0;
        border-radius: 8px;
        font-size: 14px;
    }

.pp-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    background: #f1effd;
    color: #5a4fd4;
    font-size: 12px;
}

.pp-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #eef0f3;
    color: #3b4050;
    white-space: nowrap;
}

.pp-pill-pass {
    background: #e3f5ea;
    color: #1b6b3a;
}

.pp-pill-fail {
    background: #fdecec;
    color: #b71c1c;
}

.pp-pill-attention {
    background: #fff3d6;
    color: #8a5a00;
}

.pp-pill-off {
    background: #eceef2;
    color: #6b7280;
}

.pp-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.pp-stat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    font-size: 14px;
}

    .pp-stat strong {
        font-size: 18px;
    }

.pp-dialog {
    max-width: 620px;
    width: calc(100% - 32px);
    text-align: left;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

    .pp-dialog h2 {
        font-size: 18px;
        margin: 0 0 14px;
    }

.pp-dialog-wide {
    max-width: 920px;
}

.pp-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.pp-file-pick {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 14px;
    border: 1px dashed #c9cdd6;
    border-radius: 10px;
    background: #fafbfc;
    margin-bottom: 14px;
}

.pp-file-name {
    font-size: 14px;
    color: #3b4050;
    overflow-wrap: anywhere;
}

/* ============ Home: collection cards ============ */
.pp-collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.pp-collection-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    color: inherit;
    text-decoration: none;
    min-width: 0;
}

    .pp-collection-card:hover {
        border-color: #c8c2f6;
        box-shadow: 0 2px 10px rgba(107, 95, 230, 0.1);
        color: inherit;
        text-decoration: none;
    }

.pp-collection-title {
    font-size: 16px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.pp-collection-source {
    font-size: 13px;
    color: #6b7280;
}

.pp-collection-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 13px;
    color: #4b5160;
    align-items: center;
}

.pp-collection-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

/* Import report */
.pp-report {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
    font-size: 14px;
}

    .pp-report h3 {
        font-size: 15px;
        margin: 0 0 8px;
    }

    .pp-report ul {
        margin: 4px 0 0;
        padding-left: 20px;
    }

.pp-report-warnings {
    max-height: 200px;
    overflow-y: auto;
    font-size: 13px;
}

.pp-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0 16px;
}

    .pp-options-grid textarea {
        min-height: 70px;
        font-size: 13px;
    }

/* ============ Collection page ============ */
.pp-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 18px;
    overflow-x: auto;
}

.pp-tab {
    border: none;
    background: none;
    padding: 10px 14px;
    font-size: 14px;
    color: #4b5160;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

    .pp-tab:hover {
        color: #1f2330;
    }

    .pp-tab.active {
        color: #5a4fd4;
        border-bottom-color: #6b5fe6;
        font-weight: 600;
    }

.pp-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.pp-start-section {
    margin-bottom: 16px;
}

    .pp-start-section > .pp-field-label {
        display: block;
        margin-bottom: 7px;
    }

.pp-mode-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.pp-mode {
    border: 1px solid #d6d9e0;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    background: #fff;
    text-align: left;
    font-size: 13px;
    color: #4b5160;
}

    .pp-mode strong {
        display: block;
        font-size: 14px;
        color: #1f2330;
        margin-bottom: 3px;
    }

    .pp-mode.active {
        border-color: #6b5fe6;
        background: #f6f5fe;
        box-shadow: 0 0 0 1px #6b5fe6 inset;
    }

.pp-start-summary {
    font-size: 14px;
    color: #4b5160;
    margin: 4px 0 12px;
}

.pp-history-table, .pp-question-table, .pp-group-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

    .pp-history-table th, .pp-question-table th, .pp-group-table th {
        text-align: left;
        font-size: 12px;
        font-weight: 600;
        color: #6b7280;
        padding: 8px 10px;
        border-bottom: 1px solid #e5e7eb;
        white-space: nowrap;
    }

    .pp-history-table td, .pp-question-table td, .pp-group-table td {
        padding: 9px 10px;
        border-bottom: 1px solid #f0f1f4;
        vertical-align: top;
    }

    .pp-history-table tr:last-child td, .pp-question-table tr:last-child td, .pp-group-table tr:last-child td {
        border-bottom: none;
    }

.pp-table-wrap {
    overflow-x: auto;
}

.pp-question-table .pp-q-number {
    width: 56px;
    color: #6b7280;
    white-space: nowrap;
}

.pp-question-table .pp-q-kind {
    width: 150px;
}

.pp-question-table .pp-q-actions {
    width: 80px;
    text-align: right;
    white-space: nowrap;
}

.pp-q-preview {
    overflow-wrap: anywhere;
}

.pp-question-table tr.is-off td {
    color: #9aa0ad;
}

.pp-bar {
    height: 8px;
    border-radius: 999px;
    background: #eceef2;
    overflow: hidden;
    min-width: 80px;
}

.pp-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #8b80f0, #6b5fe6);
}

    .pp-bar-fill.is-pass {
        background: linear-gradient(90deg, #4fc37f, #22a35a);
    }

    .pp-bar-fill.is-fail {
        background: linear-gradient(90deg, #f08b8b, #d64545);
    }

.pp-count-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
}

    .pp-count-list div {
        display: flex;
        justify-content: space-between;
        gap: 12px;
    }

.pp-danger-zone {
    border-color: #f1c4c4;
}

    .pp-danger-zone .pp-card-header {
        background: #fdf1f1;
        color: #b71c1c;
    }

/* ============ Session page ============ */
.pp-session {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 18px;
    align-items: start;
}

.pp-session-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.pp-session-title {
    font-size: 18px;
    font-weight: 700;
    flex: 1;
    min-width: 160px;
    overflow-wrap: anywhere;
}

.pp-timer {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    background: #eef0f3;
}

    .pp-timer.is-low {
        background: #fdecec;
        color: #b71c1c;
    }

.pp-progress {
    height: 6px;
    border-radius: 999px;
    background: #eceef2;
    overflow: hidden;
    margin-bottom: 16px;
}

.pp-progress-fill {
    height: 100%;
    background: #6b5fe6;
    transition: width 0.3s;
}

.pp-question-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px 20px;
}

.pp-question-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    font-size: 13px;
    color: #6b7280;
}

.pp-question-number {
    font-weight: 700;
    color: #1f2330;
    font-size: 15px;
}

.pp-flag-btn.is-flagged {
    color: #c77700;
    border-color: #f3c97a;
    background: #fff8e8;
}

.pp-case-study {
    background: #f8f7ff;
    border: 1px solid #dcd8fb;
    border-radius: 10px;
    margin-bottom: 14px;
}

    .pp-case-study > summary {
        cursor: pointer;
        padding: 10px 14px;
        font-weight: 600;
        font-size: 14px;
        color: #4a3fc4;
    }

.pp-case-study-body {
    padding: 0 14px 12px;
    font-size: 14px;
    max-height: 420px;
    overflow-y: auto;
}

    .pp-case-study-body p {
        margin: 0 0 8px;
    }

.pp-stem {
    font-size: 15px;
    line-height: 1.55;
    margin-bottom: 14px;
}

    .pp-stem p {
        margin: 0 0 8px;
        overflow-wrap: anywhere;
        white-space: pre-wrap;
    }

.pp-stem-bold {
    font-weight: 700;
}

.pp-figure {
    margin: 0 0 14px;
}

    .pp-figure img {
        max-width: 100%;
        height: auto;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        background: #fff;
    }

.pp-original-picture {
    margin-bottom: 14px;
    font-size: 13px;
}

    .pp-original-picture > summary {
        cursor: pointer;
        color: #6b7280;
        margin-bottom: 8px;
    }

.pp-answer {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pp-answer-hint {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 4px;
}

.pp-select-count {
    font-weight: 600;
    color: #3b4050;
}

.pp-select-progress {
    font-weight: 400;
    color: #6b7280;
}

.pp-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #d6d9e0;
    border-radius: 10px;
    cursor: pointer;
    background: #fff;
    font-size: 14px;
}

    .pp-option:hover {
        border-color: #b9b2f3;
    }

    .pp-option input {
        margin-top: 3px;
        flex-shrink: 0;
    }

    .pp-option.is-picked {
        border-color: #6b5fe6;
        background: #f6f5fe;
    }

    .pp-option.is-full {
        opacity: 0.6;
        cursor: default;
    }

    .pp-option.is-key {
        border-color: #22a35a;
        background: #ebf8f0;
    }

    .pp-option.is-wrong {
        border-color: #d64545;
        background: #fdf0f0;
    }

.is-locked .pp-option {
    cursor: default;
}

.pp-option-letter {
    font-weight: 700;
    color: #6b5fe6;
    min-width: 16px;
}

.pp-option-text {
    flex: 1;
    overflow-wrap: anywhere;
}

.pp-option-mark, .pp-part-mark {
    margin-left: auto;
    flex-shrink: 0;
}

.is-key .pp-option-mark, .pp-part-mark {
    color: #22a35a;
}

.is-wrong .pp-option-mark {
    color: #d64545;
}

.pp-slot-row, .pp-target-row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(0, 2fr) auto;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid transparent;
}

    .pp-slot-row.is-right, .pp-target-row.is-right, .pp-position.is-right, .pp-statement-table tr.is-right td {
        background: #ebf8f0;
    }

    .pp-slot-row.is-wrong, .pp-target-row.is-wrong, .pp-position.is-wrong, .pp-statement-table tr.is-wrong td {
        background: #fdf0f0;
    }

    .pp-slot-row.is-right, .pp-target-row.is-right, .pp-position.is-right {
        border-color: #bfe5cd;
    }

    .pp-slot-row.is-wrong, .pp-target-row.is-wrong, .pp-position.is-wrong {
        border-color: #f5c6c6;
    }

.pp-slot-label {
    font-size: 14px;
    font-weight: 600;
    color: #3b4050;
    overflow-wrap: anywhere;
}

.pp-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d6d9e0;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
}

.pp-letter-select {
    max-width: 90px;
}

.pp-key-note {
    font-size: 13px;
    color: #1b6b3a;
    font-weight: 600;
    display: inline-flex;
    gap: 5px;
    align-items: center;
    grid-column: 1 / -1;
}

.pp-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: #f8f9fb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 6px;
}

.pp-pool-title {
    width: 100%;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
}

.pp-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    border: 1px solid #c9cdd6;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    cursor: grab;
    text-align: left;
    color: #1f2330;
}

    .pp-item i {
        color: #9aa0ad;
        font-size: 12px;
    }

    .pp-item.is-selected {
        border-color: #6b5fe6;
        box-shadow: 0 0 0 2px rgba(107, 95, 230, 0.3);
    }

    .pp-item.is-used {
        opacity: 0.4;
        cursor: default;
    }

.pp-targets {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pp-target {
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid #c9cdd6;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    display: flex;
    align-items: center;
    cursor: pointer;
    overflow-wrap: anywhere;
}

    .pp-target.is-empty {
        border-style: dashed;
        background: #fafbfc;
    }

    .pp-target.is-ready {
        border-color: #6b5fe6;
        background: #f6f5fe;
    }

.is-locked .pp-target {
    cursor: default;
}

.pp-target-placeholder {
    color: #9aa0ad;
    font-size: 13px;
}

.pp-positions {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pp-position {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 12px;
    border: 1px solid #c9cdd6;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
}

    .pp-position.is-empty {
        border-style: dashed;
        background: #fafbfc;
    }

.pp-position-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f1effd;
    color: #5a4fd4;
    font-weight: 700;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pp-position-text {
    flex: 1;
    min-width: 120px;
    overflow-wrap: anywhere;
}

.pp-position-actions {
    display: inline-flex;
    gap: 2px;
}

.pp-statement-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

    .pp-statement-table th {
        text-align: left;
        font-size: 12px;
        color: #6b7280;
        padding: 8px 10px;
        border-bottom: 1px solid #e5e7eb;
    }

    .pp-statement-table td {
        padding: 10px;
        border-bottom: 1px solid #f0f1f4;
        overflow-wrap: anywhere;
    }

    .pp-statement-table .pp-yn {
        width: 56px;
        text-align: center;
    }

    .pp-statement-table .pp-key-note {
        display: flex;
        margin-top: 4px;
    }

.pp-picture-boxes {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .pp-picture-boxes .pp-slot-row {
        grid-template-columns: 80px 100px auto;
        justify-content: start;
    }

.pp-feedback {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 14px;
}

    .pp-feedback.is-right {
        background: #ebf8f0;
        border: 1px solid #bfe5cd;
    }

    .pp-feedback.is-wrong {
        background: #fdf0f0;
        border: 1px solid #f5c6c6;
    }

.pp-feedback-title {
    font-weight: 700;
    margin-bottom: 6px;
}

.pp-explanation {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    margin-top: 6px;
}

.pp-reference {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    margin-top: 8px;
    color: #5a4fd4;
    overflow-wrap: anywhere;
}

.pp-session-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #f0f1f4;
}

.pp-keys-hint {
    font-size: 12px;
    color: #9aa0ad;
    margin-top: 10px;
}

.pp-nav-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
    position: sticky;
    top: 12px;
}

.pp-nav-title {
    font-size: 13px;
    font-weight: 600;
    color: #3b4050;
    margin-bottom: 10px;
}

.pp-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
    gap: 6px;
    max-height: 50vh;
    overflow-y: auto;
    padding: 2px;
}

.pp-nav-cell {
    height: 34px;
    border: 1px solid #d6d9e0;
    border-radius: 7px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    position: relative;
    color: #3b4050;
}

    .pp-nav-cell.is-answered {
        background: #eceafd;
        border-color: #c8c2f6;
    }

    .pp-nav-cell.is-right {
        background: #e3f5ea;
        border-color: #9fd8b5;
    }

    .pp-nav-cell.is-wrong {
        background: #fdecec;
        border-color: #f1b4b4;
    }

    .pp-nav-cell.is-current {
        box-shadow: 0 0 0 2px #6b5fe6;
        font-weight: 700;
    }

    .pp-nav-cell.is-flagged::after {
        content: "";
        position: absolute;
        top: 3px;
        right: 3px;
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: #e8a317;
    }

.pp-nav-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-top: 10px;
    font-size: 12px;
    color: #6b7280;
}

    .pp-nav-legend span {
        display: inline-flex;
        align-items: center;
        gap: 5px;
    }

.pp-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    border: 1px solid #d6d9e0;
}

    .pp-legend-dot.is-answered {
        background: #eceafd;
        border-color: #c8c2f6;
    }

    .pp-legend-dot.is-flagged {
        background: #e8a317;
        border-color: #e8a317;
        border-radius: 50%;
    }

.pp-nav-counts {
    font-size: 13px;
    color: #4b5160;
    margin-top: 10px;
}

/* ============ Results ============ */
.pp-score-card {
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 18px;
}

.pp-score {
    font-size: 44px;
    font-weight: 800;
    line-height: 1;
}

    .pp-score.is-pass {
        color: #1b8a4a;
    }

    .pp-score.is-fail {
        color: #c62828;
    }

.pp-score-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    color: #4b5160;
    flex: 1;
    min-width: 200px;
}

.pp-review-item {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    margin-bottom: 12px;
}

    .pp-review-item > summary {
        cursor: pointer;
        padding: 12px 16px;
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
        font-size: 14px;
        list-style: none;
    }

        .pp-review-item > summary::-webkit-details-marker {
            display: none;
        }

.pp-review-preview {
    flex: 1;
    min-width: 160px;
    color: #3b4050;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pp-review-body {
    padding: 0 16px 16px;
}

.pp-review-mark {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

    .pp-review-mark.is-right {
        background: #e3f5ea;
        color: #1b8a4a;
    }

    .pp-review-mark.is-wrong {
        background: #fdecec;
        color: #c62828;
    }

    .pp-review-mark.is-partial {
        background: #fff3d6;
        color: #8a5a00;
    }

/* ============ Question editor ============ */
.pp-editor-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.pp-editor-line {
    display: flex;
    gap: 6px;
    align-items: center;
}

    .pp-editor-line input[type=text] {
        flex: 1;
        min-width: 0;
        padding: 7px 10px;
        border: 1px solid #d6d9e0;
        border-radius: 8px;
        font-size: 14px;
    }

    .pp-editor-line select {
        padding: 7px 8px;
        border: 1px solid #d6d9e0;
        border-radius: 8px;
        font-size: 14px;
        background: #fff;
    }

.pp-editor-letter {
    width: 22px;
    font-weight: 700;
    color: #6b5fe6;
    text-align: center;
    flex-shrink: 0;
}

.pp-editor-slot {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 8px;
    background: #fafbfc;
}

.pp-editor-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pp-editor-image {
    position: relative;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px;
    background: #fff;
    font-size: 12px;
    color: #6b7280;
    max-width: 220px;
}

    .pp-editor-image img {
        max-width: 200px;
        max-height: 140px;
        display: block;
        margin-bottom: 4px;
    }

.pp-preview-box {
    border: 1px dashed #c9cdd6;
    border-radius: 10px;
    padding: 14px;
    background: #fafbfc;
}

/* Read pictures with AI */
.pp-ai-pictures {
    margin: 14px 0 6px;
    padding: 10px 12px;
    border: 1px solid #e4e1fb;
    border-radius: 10px;
    background: #f8f7ff;
}

    .pp-ai-pictures .pp-hint {
        margin: 4px 0 0 24px;
    }

.pp-ai-pictures .fa-wand-magic-sparkles, .picture-read-card .fa-wand-magic-sparkles, .read-pictures-card .fa-wand-magic-sparkles {
    color: #6b5fe6;
}

.license-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.picture-read-card {
    margin-bottom: 14px;
    border-color: #e4e1fb;
}

.picture-read-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

    .picture-read-line + .picture-read-line, .picture-read-bar + .picture-read-line, .picture-read-card .pp-error {
        margin-top: 10px;
    }

.picture-read-hint {
    margin-top: 6px;
    font-size: 13px;
    color: #6b7280;
}

.picture-read-status {
    font-weight: 600;
    color: #2d3142;
}

.picture-read-bar {
    margin-top: 10px;
    height: 8px;
    border-radius: 999px;
    background: #eceef2;
    overflow: hidden;
}

    .picture-read-bar > div {
        height: 100%;
        background: #6b5fe6;
        transition: width 0.3s ease;
    }

.pp-pill-ai {
    background: #efedfd;
    color: #4b3fc4;
}

/* Tablets and phones */
@media (max-width: 1000px) {
    .pp-layout {
        grid-template-columns: 1fr;
    }

    .pp-session {
        grid-template-columns: 1fr;
    }

    .pp-nav-card {
        position: static;
        order: -1;
    }

    .pp-nav-grid {
        max-height: 140px;
    }
}

@media (max-width: 700px) {
    .pp-page {
        padding: 12px 16px 20px;
    }

    .pp-search {
        max-width: none;
    }

    .pp-collection-grid {
        grid-template-columns: 1fr;
    }

    .pp-mode-options {
        grid-template-columns: 1fr;
    }

    .pp-slot-row, .pp-target-row {
        grid-template-columns: 1fr auto;
    }

        .pp-slot-row .pp-slot-label, .pp-target-row .pp-slot-label {
            grid-column: 1 / -1;
        }

    .pp-question-card {
        padding: 14px;
    }

    .pp-question-table .pp-q-kind {
        width: auto;
    }

    .pp-question-table .pp-hide-phone, .pp-history-table .pp-hide-phone {
        display: none;
    }

    .pp-score {
        font-size: 36px;
    }
}
