#prof-ia-module,
#prof-ia-module * {
    box-sizing: border-box;
}

#prof-ia-module {
    --pia-text: #1f2937;
    --pia-text-soft: #64748b;
    --pia-title: #0f4c81;
    --pia-blue: #1565c0;
    --pia-blue-dark: #0f4c81;
    --pia-bg: #eef4fb;
    --pia-bg-soft: #f7fbff;
    --pia-card: #ffffff;
    --pia-border: #dbe7f3;
    --pia-border-strong: #c7d7ea;
    --pia-shadow: 0 14px 34px rgba(15, 76, 129, .10);
    --pia-shadow-soft: 0 8px 20px rgba(15, 76, 129, .06);
    font-family: Arial, Helvetica, sans-serif !important;
    color: var(--pia-text);
    width: 100%;
}

#prof-ia-module .pia-wrap {
    max-width: 1420px;
    margin: 18px auto 32px;
    padding: 0 16px;
}

#prof-ia-module .pia-hidden,
#prof-ia-module .pia-hidden-box,
.pia-hidden {
    display: none !important;
}

/* =========================
   HERO
========================= */

#prof-ia-module .pia-hero {
    background: linear-gradient(135deg, #0f4c81 0%, #1565c0 60%, #2b83d7 100%);
    color: #fff !important;
    border-radius: 26px;
    padding: 24px 26px;
    box-shadow: 0 20px 40px rgba(15, 76, 129, .16);
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
}

#prof-ia-module .pia-hero::before {
    content: "";
    position: absolute;
    right: -60px;
    top: -60px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
}

#prof-ia-module .pia-hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 20px;
    align-items: center;
}

#prof-ia-module .pia-title {
    margin: 0 0 8px;
    font-size: 2rem;
    line-height: 1.15;
    color: #fff !important;
    font-weight: 700;
}

#prof-ia-module .pia-subtitle {
    margin: 0;
    color: rgba(255, 255, 255, .94) !important;
    line-height: 1.55;
}

#prof-ia-module .pia-hero-notice {
    margin-top: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    color: #fff !important;
    font-size: .94rem;
    backdrop-filter: blur(4px);
}

#prof-ia-module .pia-hero-img img {
    width: 110px;
    max-width: 100%;
    display: block;
    margin: 0 auto;
    border-radius: 22px;
    box-shadow: 0 14px 28px rgba(0, 0, 0, .18);
    background: #fff;
}

/* =========================
   LAYOUT
========================= */

#prof-ia-module .pia-grid {
    display: grid;
    grid-template-columns: 310px 1fr;
    gap: 18px;
    align-items: start;
}

#prof-ia-module .pia-side {
    position: relative;
    min-width: 0;
    padding: 18px;
    border-radius: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid var(--pia-border);
    box-shadow: var(--pia-shadow-soft);
    overflow: hidden;
}

#prof-ia-module #chat-container {
    min-width: 0;
}

#prof-ia-module .pia-stage-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    border-radius: 24px;
    overflow: visible;
    background: linear-gradient(180deg, rgba(255, 255, 255, .96) 0%, rgba(247, 250, 254, .98) 100%);
    border: 1px solid var(--pia-border);
    box-shadow: var(--pia-shadow);
}

#prof-ia-module .pia-stage {
    flex: 1;
    padding: 0;
    position: relative;
    background:
        radial-gradient(circle at top right, rgba(45, 140, 255, .04), transparent 22%),
        linear-gradient(180deg, #f8fbff 0%, #f2f7fc 100%);
}

/* =========================
   ONGLETS
========================= */

#prof-ia-module .pia-tabs {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

#prof-ia-module .pia-tabs-top {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 16px 0;
    margin-bottom: 0;
}

#prof-ia-module .pia-tab-btn {
    appearance: none;
    width: 100%;
    border: 1px solid var(--pia-border);
    background: #ffffff;
    color: var(--pia-title);
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
    transition: .18s ease;
    box-shadow: none;
}

#prof-ia-module .pia-tabs-top .pia-tab-btn {
    width: auto;
    min-width: 140px;
    text-align: center;
    padding: 12px 18px;
}

#prof-ia-module .pia-tab-btn:hover {
    transform: translateY(-1px);
    border-color: #bfd5ea;
    background: #f8fbff;
}

#prof-ia-module .pia-tab-btn.active {
    background: linear-gradient(135deg, var(--pia-blue) 0%, var(--pia-blue-dark) 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 10px 20px rgba(15, 76, 129, .16);
}

#prof-ia-module .pia-tab-panel {
    display: none;
}

#prof-ia-module .pia-tab-panel.active {
    display: block;
}

/* =========================
   FORMULAIRES
========================= */

#prof-ia-module .pia-side h2 {
    margin: 0 0 14px;
    font-size: 1.08rem;
    color: var(--pia-title);
}

#prof-ia-module .pia-panel-note {
    margin: 0 0 16px;
    padding: 12px 13px;
    border-radius: 14px;
    background: #f4f8fd;
    border: 1px solid var(--pia-border);
    color: #33506d;
    line-height: 1.5;
    font-size: 13px;
}

#prof-ia-module .pia-panel-note strong {
    color: var(--pia-title);
}

#prof-ia-module .pia-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #e7eef7;
}

#prof-ia-module .pia-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 11px;
    border-radius: 999px;
    background: #eef6ff;
    border: 1px solid var(--pia-border);
    color: var(--pia-title);
    font-size: .82rem;
    font-weight: 700;
}

#prof-ia-module .pia-field {
    margin-bottom: 16px;
}

#prof-ia-module .pia-label {
    display: block;
    margin: 0 0 8px;
    color: var(--pia-title);
    font-weight: 700;
    font-size: .94rem;
}

#prof-ia-module .pia-select,
#prof-ia-module .pia-textarea {
    width: 100%;
    border: 1px solid #d5e2ef;
    color: var(--pia-text);
    border-radius: 16px;
    font-size: 15px;
    outline: none;
    font-family: Arial, Helvetica, sans-serif;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

#prof-ia-module .pia-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 13px 46px 13px 15px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
    background-image:
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%231565c0' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat, no-repeat;
    background-position: 0 0, right 14px center;
    background-size: auto, 18px;
}

#prof-ia-module .pia-textarea {
    padding: 13px 15px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
    resize: vertical;
    min-height: 96px;
    line-height: 1.5;
}

#prof-ia-module .pia-select:hover,
#prof-ia-module .pia-textarea:hover {
    border-color: #bfd5ea;
}

#prof-ia-module .pia-select:focus,
#prof-ia-module .pia-textarea:focus {
    border-color: var(--pia-blue);
    box-shadow: 0 0 0 4px rgba(21, 101, 192, .10);
    background: #fff;
}

#prof-ia-module .pia-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

#prof-ia-module .pia-btn {
    appearance: none;
    border: none;
    border-radius: 16px;
    padding: 13px 16px;
    cursor: pointer;
    font-weight: 800;
    font-size: 15px;
    line-height: 1;
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
}

#prof-ia-module .pia-btn:hover {
    transform: translateY(-1px);
}

#prof-ia-module .pia-btn-primary {
    background: linear-gradient(135deg, var(--pia-blue) 0%, var(--pia-blue-dark) 100%);
    color: #fff;
    box-shadow: 0 10px 20px rgba(15, 76, 129, .16);
}

#prof-ia-module .pia-btn-secondary {
    background: linear-gradient(180deg, #f8fbff 0%, #eef5fc 100%);
    color: var(--pia-title);
    border: 1px solid var(--pia-border);
    box-shadow: 0 6px 14px rgba(15, 76, 129, .04);
}

/* =========================
   TOPBAR / STATS
========================= */

#prof-ia-module .pia-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px 12px;
    border-bottom: 1px solid #e8eef6;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

#prof-ia-module .pia-topbar-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--pia-title);
    margin-bottom: 8px;
}

#prof-ia-module .pia-topbar-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
}

#prof-ia-module .pia-mode-badge,
#prof-ia-module .pia-difficulty {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    border: 1px solid var(--pia-border);
}

#prof-ia-module .pia-mode-badge {
    background: #edf4ff;
    color: var(--pia-title);
}

#prof-ia-module .pia-mode-badge.admin {
    background: linear-gradient(135deg, #e8f8f0, #ddf5e7);
    color: #1e7e34;
    border-color: #c9e9d4;
}

#prof-ia-module .pia-mode-badge.teacher {
    background: linear-gradient(135deg, #f4ebff, #ece0ff);
    color: #6f42c1;
    border-color: #d8c7f6;
}

#prof-ia-module .pia-mode-badge.student {
    background: linear-gradient(135deg, #e8f1ff, #deebff);
    color: #0b63ce;
    border-color: #c8daf6;
}

#prof-ia-module .pia-mode-badge.visitor {
    background: linear-gradient(135deg, #fff7d6, #fff2be);
    color: #8a6d00;
    border-color: #ecdca2;
}

#prof-ia-module .pia-difficulty {
    background: #f7faff;
    color: #334155;
}

#prof-ia-module .pia-level-easy {
    background: #e8f8f0;
    color: #1e7e34;
    border-color: #bfe4c9;
}

#prof-ia-module .pia-level-medium {
    background: #fff7e6;
    color: #b26a00;
    border-color: #f2d39b;
}

#prof-ia-module .pia-level-hard {
    background: #fdecea;
    color: #a93226;
    border-color: #f0c5c1;
}

#prof-ia-module .pia-stats {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

#prof-ia-module .pia-stat {
    min-width: 48px;
    text-align: center;
    padding: 7px 10px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 14px;
    border: 1px solid transparent;
}

#prof-ia-module .pia-stat-bad {
    background: linear-gradient(135deg, #fdecea, #fce0dc);
    color: #a93226;
    border-color: #f2c7c1;
}

#prof-ia-module .pia-stat-good {
    background: linear-gradient(135deg, #e8f8f0, #dcf4e5);
    color: #1e7e34;
    border-color: #c9e9d4;
}

#prof-ia-module .pia-progress-wrap {
    padding: 10px 16px 8px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    background: rgba(255, 255, 255, .88);
    border-top: 1px solid #eef3f9;
}

#prof-ia-module .pia-progress {
    height: 10px;
    background: #e6eef8;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(15, 76, 129, .06);
}

#prof-ia-module .pia-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--pia-blue), #2d8cff);
    border-radius: 999px;
    transition: width .25s ease;
}

#prof-ia-module .pia-progress-text {
    font-weight: 800;
    font-size: .9rem;
    color: var(--pia-title);
}

#prof-ia-module #pia-xp-wrap {
    padding: 0 16px 12px;
    background: rgba(255, 255, 255, .88);
}

/* =========================
   FEEDBACK / MESSAGE
========================= */

#prof-ia-module .pia-feedback {
    background: linear-gradient(180deg, rgba(255, 255, 255, .98) 0%, rgba(252, 254, 255, .98) 100%);
    border: 1px solid var(--pia-border);
    border-radius: 24px;
    padding: 24px;
    max-width: 980px;
    width: 100%;
    margin: 24px auto;
    box-shadow: 0 14px 28px rgba(0, 0, 0, .05);
}

#prof-ia-module .pia-feedback.good {
    border-color: #2c8b52;
    background: linear-gradient(180deg, #f4fff7 0%, #ffffff 100%);
}

#prof-ia-module .pia-feedback.bad {
    border-color: #d85a4a;
    background: linear-gradient(180deg, #fff7f6 0%, #ffffff 100%);
}

#prof-ia-module .pia-feedback-title {
    font-size: 1.34rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--pia-title);
}

#prof-ia-module .pia-feedback-text {
    font-size: 1.04rem;
    line-height: 1.72;
    color: var(--pia-text);
    word-break: break-word;
}

#prof-ia-module .pia-feedback-answer {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 16px;
    background: #f0f4fa;
    color: #1f3f62;
    border: 1px solid var(--pia-border);
}

#prof-ia-module .pia-question-card {
    max-width: 1020px;
    margin: 0 auto;
    width: 100%;
    padding: 24px 22px;
}

#prof-ia-module .pia-question-index {
    font-size: 1rem;
    color: var(--pia-text-soft);
    margin-bottom: 14px;
    font-weight: 700;
}

#prof-ia-module .pia-question-title {
    font-size: 1.05rem;
    color: var(--pia-text-soft);
    margin-bottom: 12px;
    font-weight: 700;
}

#prof-ia-module .pia-question-text {
    font-size: 1.22rem;
    line-height: 1.65;
    margin-bottom: 22px;
    color: var(--pia-text);
    font-weight: 500;
    max-width: 850px;
}

#prof-ia-module .pia-choices {
    display: grid;
    gap: 14px;
}

#prof-ia-module .pia-choice-btn {
    width: 100%;
    text-align: left;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    color: var(--pia-text);
    border: 1px solid var(--pia-border);
    border-radius: 20px;
    padding: 18px 20px;
    font-size: 1.12rem;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
    box-shadow: 0 6px 14px rgba(15, 76, 129, .04);
}

#prof-ia-module .pia-choice-btn:hover {
    border-color: var(--pia-blue);
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(15, 76, 129, .10);
}

#prof-ia-module .pia-choice-letter {
    display: inline-block;
    width: 44px;
    color: var(--pia-blue);
    font-weight: 700;
}

#prof-ia-module .pia-tools {
    margin-top: 24px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#prof-ia-module .pia-tool-btn {
    background: transparent;
    color: var(--pia-blue);
    border: none;
    font-size: .98rem;
    font-weight: 700;
    cursor: pointer;
    padding: 8px 0;
}

#prof-ia-module .pia-hint-box {
    margin: 0 22px 16px;
    padding: 16px 18px;
    border-radius: 16px;
    background: linear-gradient(180deg, #eef6ff 0%, #f6fbff 100%);
    color: #1f3f62;
    display: none;
    border: 1px solid var(--pia-border);
}

/* =========================
   EXPORT / BOUTONS
========================= */

#pia-btn-fullscreen.pia-btn-fullscreen,
#prof-ia-module .pia-export-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 15px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--pia-blue), var(--pia-blue-dark));
    color: #fff !important;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(15, 76, 129, .18);
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
    text-decoration: none !important;
    outline: none;
    white-space: nowrap;
}

#pia-btn-fullscreen.pia-btn-fullscreen:hover,
#prof-ia-module .pia-export-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(15, 76, 129, .22);
}

#pia-btn-fullscreen.pia-btn-fullscreen.is-active {
    background: linear-gradient(135deg, #d84b6a, #f39c12);
}

#prof-ia-module .pia-export-row {
    display: none !important;
}

#prof-ia-module.pia-doc-mode[data-active-tab="prof"] .pia-export-row {
    display: flex !important;
}

#prof-ia-module .pia-export-toolbar {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    align-items: center;
    border-top: 1px solid #edf2f8;
    background: rgba(255, 255, 255, .90);
}

#prof-ia-module .pia-export-icon {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--pia-border);
    background: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all .2s ease;
}

#prof-ia-module .pia-export-icon:hover {
    background: #f0f4fa;
    border-color: var(--pia-blue);
    transform: translateY(-1px);
}

#prof-ia-module .pia-export-row-middle #pia-export-pdf,
#prof-ia-module .pia-export-row-premium .pia-export-icon:not(.disabled) {
    background: var(--pia-blue);
    color: #fff;
    border-color: var(--pia-blue);
}

#prof-ia-module .pia-export-icon.disabled,
#prof-ia-module .pia-export-icon:disabled {
    background: #f1f5f9;
    color: #9aa5b1;
    border-color: #e2e8f0;
    cursor: pointer;
    opacity: .82;
}

#prof-ia-module .pia-export-icon .pia-icon {
    font-size: 16px;
}

#prof-ia-module .pia-export-icon .pia-lock {
    position: absolute;
    bottom: -1px;
    right: -1px;
    font-size: 11px;
    background: #fff;
    border-radius: 50%;
    padding: 1px;
}

#prof-ia-module .pia-export-btn-disabled,
#prof-ia-module .pia-export-btn:disabled {
    background: linear-gradient(135deg, #cfd6df, #aeb8c4) !important;
    color: #eef2f7 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    opacity: .75;
    transform: none !important;
    pointer-events: none;
}

/* =========================
   COMPOSER / STATUS / LOGIN
========================= */

#prof-ia-module .pia-composer {
    padding: 16px 18px 18px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: end;
    border-top: 1px solid #e7eef7;
    background: linear-gradient(180deg, rgba(255, 255, 255, .95) 0%, rgba(247, 250, 254, .98) 100%);
}

#prof-ia-module .pia-composer .pia-textarea {
    min-height: 64px;
    max-height: 180px;
    border-radius: 18px;
    padding: 16px 18px;
}

#prof-ia-module .pia-composer .pia-btn {
    min-width: 110px;
    min-height: 50px;
    border-radius: 16px;
}

#prof-ia-module .pia-status {
    padding: 0 16px 12px;
    color: var(--pia-text-soft);
    min-height: 20px;
    font-size: 12.5px;
    background: rgba(255, 255, 255, .94);
}

#prof-ia-module .pia-login-box {
    margin: 0 18px 18px;
    padding: 14px 16px;
    border: 1px solid var(--pia-border);
    border-radius: 16px;
    background: linear-gradient(180deg, #f8fbff 0%, #f5f9ff 100%);
    color: var(--pia-text);
    line-height: 1.55;
}

#prof-ia-module .pia-login-box strong {
    color: var(--pia-title);
}

/* =========================
   POPUP PREMIUM
========================= */

.pia-lock-popup {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 16px;
}

.pia-lock-popup.is-open {
    display: flex;
}

.pia-lock-popup-box {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .18);
    text-align: center;
}

.pia-lock-popup-icon {
    font-size: 34px;
    margin-bottom: 10px;
}

.pia-lock-popup-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--pia-title);
    margin-bottom: 8px;
}

.pia-lock-popup-text {
    color: #475569;
    line-height: 1.55;
    margin-bottom: 18px;
}

.pia-lock-popup-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.pia-lock-popup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--pia-blue), var(--pia-blue-dark));
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 700;
}

.pia-lock-popup-close {
    border: 1px solid var(--pia-border);
    background: #fff;
    color: #334155;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}

/* =========================
   DOCUMENT MODE
========================= */

#prof-ia-module.pia-doc-mode #pia-stats-box,
#prof-ia-module.pia-doc-mode #pia-progress-wrap,
#prof-ia-module.pia-doc-mode #pia-xp-wrap,
#prof-ia-module.pia-doc-mode #difficulty-level,
#prof-ia-module.pia-doc-mode #pia-level-badge,
#prof-ia-module.pia-doc-mode #pia-score-badge {
    display: none !important;
}

#prof-ia-module.pia-doc-mode .pia-stage-panel {
    overflow: visible !important;
}

#prof-ia-module.pia-doc-mode .pia-stage {
    flex: 1 1 auto;
    overflow-y: auto !important;
    overflow-x: hidden;
    padding-bottom: 24px;
}

#prof-ia-module.pia-doc-mode #pia-stage {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

#prof-ia-module.pia-doc-mode .pia-feedback,
#prof-ia-module.pia-doc-mode .pia-doc,
#prof-ia-module.pia-doc-mode #pia-document {
    max-width: 100%;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* =========================
   LOADER
========================= */

.pia-loader-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.pia-loader-box {
    text-align: center;
}

.pia-spinner {
    width: 48px;
    height: 48px;
    border: 5px solid #dbe7f5;
    border-top: 5px solid #1f6fd1;
    border-radius: 50%;
    animation: piaSpin 0.8s linear infinite;
    margin: 0 auto 12px;
}

.pia-loader-text {
    font-weight: 600;
    color: #1e2f45;
}

@keyframes piaSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes piaFadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes piaBlink {
    0%, 80%, 100% {
        opacity: .35;
        transform: scale(.9);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes piaFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1100px) {
    #prof-ia-module .pia-grid {
        grid-template-columns: 1fr;
    }

    #prof-ia-module .pia-side,
    #prof-ia-module .pia-stage-panel {
        min-height: auto;
    }
}

@media (max-width: 980px) {
    #prof-ia-module .pia-composer {
        grid-template-columns: 1fr;
    }

    #prof-ia-module .pia-hero-grid {
        grid-template-columns: 1fr;
    }

    #prof-ia-module .pia-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    #prof-ia-module .pia-stats {
        justify-content: flex-start;
    }
}

@media (max-width: 900px) {
    #prof-ia-module .pia-tabs-top {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    #prof-ia-module .pia-tabs-top .pia-tab-btn {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 768px) {
    #prof-ia-module .pia-actions {
        grid-template-columns: 1fr;
    }

    #prof-ia-module .pia-topbar,
    #prof-ia-module .pia-progress-wrap,
    #prof-ia-module #pia-xp-wrap,
    #prof-ia-module .pia-composer,
    #prof-ia-module .pia-status,
    #prof-ia-module .pia-export-toolbar {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    #prof-ia-module .pia-feedback {
        padding: 18px;
        border-radius: 20px;
    }

    #prof-ia-module .pia-choice-btn {
        font-size: 1.03rem;
        padding: 16px;
    }

    #prof-ia-module .pia-question-text {
        font-size: 1.08rem;
    }
}

@media (max-width: 640px) {
    #prof-ia-module .pia-wrap {
        padding: 0 10px;
    }

    #prof-ia-module .pia-hero {
        padding: 20px 18px;
        border-radius: 22px;
    }

    #prof-ia-module .pia-side,
    #prof-ia-module .pia-stage-panel {
        border-radius: 22px;
    }

    #prof-ia-module .pia-stage {
        padding: 0;
    }
}