/* Global horizontal overflow prevention */
html, body {
    overflow-x: clip;
}

/* Homepage Study Abroad GPT section styling - Exact match to approved original design */
.pe-study-chat {
    width: calc(100% - 48px);
    max-width: 1200px;
    margin: 0 auto;
    padding: 38px 0 52px;
    color: #101c40;
}
.pe-study-chat .pe-chat-heading {
    text-align: center;
    margin-bottom: 22px;
    scroll-margin-top: 120px;
}
.pe-study-chat .pe-chat-eyebrow {
    color: #f26522;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    text-align: center;
    margin: 0 0 8px;
}
.pe-study-chat h2 {
    color: #0b1a30;
    font-size: clamp(30px, 3.2vw, 46px);
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -0.8px;
    margin: 0;
}
.pe-study-chat h2 span {
    color: #f25822;
}
.pe-study-chat .pe-chat-subtitle {
    color: #64748b;
    font-size: 15.5px;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    margin: 10px 0 0;
}

/* Warm Peach Container Card */
.pe-chat-panel {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    align-items: center;
    column-gap: 20px;
    background: #fdf7f2;
    border-radius: 26px;
    padding: 32px 36px 32px 40px;
    min-height: 0;
    overflow: hidden;
}
.pe-chat-content {
    min-width: 0;
    position: relative;
    z-index: 1;
}
.pe-chat-label {
    display: block;
    color: #0b1a30;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.4px;
    margin-bottom: 14px;
}

/* Input & Ask Now Button */
.pe-chat-composer {
    display: flex;
    align-items: center;
    gap: 10px;
}
.pe-chat-field {
    position: relative;
    flex: 1;
    min-width: 0;
}
.pe-study-chat #prompt {
    height: 48px;
    width: 100%;
    padding: 10px 44px 10px 18px;
    border: 1px solid #d5dae5;
    border-radius: 8px;
    background: #ffffff;
    color: #1f293d;
    font-size: 14px;
    font-weight: 400;
    box-shadow: none;
    text-overflow: ellipsis;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.pe-study-chat #prompt:focus {
    border-color: #f25822;
    outline: none;
    box-shadow: 0 0 0 3px rgba(242, 88, 34, 0.12);
}
.pe-study-chat #prompt::placeholder {
    color: #8c93a3;
    opacity: 1;
}
.pe-chat-microphone {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #7b8192;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.pe-chat-microphone:hover {
    color: #f25822;
    background: #fff0e6;
}
.pe-chat-microphone:disabled {
    cursor: default;
    color: #b4b9c5;
}
.pe-chat-microphone.listening {
    color: #db3b21;
    background: #ffede5;
}

.pe-study-chat .pe-chat-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
    height: 48px;
    padding: 0 22px;
    background: #f25822;
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(242, 88, 34, 0.22);
    transition: all 0.2s ease;
}
.pe-study-chat .pe-chat-submit:hover {
    background: #e04a16;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(242, 88, 34, 0.3);
}
.pe-chat-submit .bx {
    font-size: 18px;
    font-weight: 700;
}
.pe-study-chat .pe-chat-submit:disabled {
    opacity: 0.75;
    cursor: wait;
}

/* Suggestion Pills */
.pe-chat-starters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}
.pe-chat-starters button {
    border: 1px solid #f99c58;
    border-radius: 50px;
    background: #ffffff;
    color: #e55c1b;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    box-shadow: none;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}
.pe-chat-starters button:hover {
    background: #fff5ee;
    border-color: #f25822;
    color: #cb4600;
}
.pe-chat-starters button:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* Robot Illustration */
.pe-chat-illustration {
    position: relative;
    width: 100%;
    max-width: 290px;
    justify-self: end;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pe-chat-illustration img {
    display: block;
    width: 100%;
    max-width: 275px;
    height: auto;
    object-fit: contain;
}

/* Feedback & Suggestions Dropdown */
.pe-study-chat .pe-chat-voice-status {
    color: #6b7181;
    font-size: 12px;
    line-height: 1.5;
    text-align: left;
    margin: 8px 0 0;
}
.pe-study-chat .pe-chat-autocomplete {
    list-style: none;
    border: 1px solid #e4d9d0;
    border-radius: 8px;
    background: #fff;
    padding: 5px;
    margin: 8px 0 0;
    max-height: 220px;
    overflow-y: auto;
    text-align: left;
}
.pe-chat-autocomplete a {
    display: block;
    padding: 9px 12px;
    color: #25304c;
    font-size: 14px;
    border-radius: 5px;
}
.pe-chat-autocomplete a:hover {
    background: #fff1e6;
}

/* Chat Response Container */
.pe-chat-response {
    margin-top: 20px;
    padding: 22px 26px;
    border: 1px solid #e4e6ec;
    border-radius: 12px;
    background: #fff;
    color: #30384e;
    overflow-wrap: anywhere;
    font-size: 16px;
    line-height: 1.7;
}
.pe-chat-response.is-error {
    border-color: #efc6b7;
    background: #fff8f3;
    color: #9f371e;
}
.pe-chat-response h3 {
    font-size: 18px;
    margin: 0 0 10px;
}
.pe-chat-response p {
    text-align: left;
    margin: 0 0 12px;
}
.pe-chat-response ul,
.pe-chat-response ol {
    text-align: left;
}
.pe-chat-response [data-chat-answer] {
    white-space: pre-wrap;
}

.pe-study-chat [hidden] {
    display: none !important;
}
.pe-study-chat :focus-visible {
    outline: 3px solid #24569a;
    outline-offset: 3px;
}

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

/* Landscape / Medium Tablets (992px - 1199.98px) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .pe-study-chat {
        width: calc(100% - 40px);
        padding: 34px 0 48px;
    }
    .pe-chat-panel {
        grid-template-columns: minmax(0, 1fr) 250px;
        padding: 28px 28px 28px 32px;
        border-radius: 24px;
    }
    .pe-chat-label {
        font-size: 21px;
        margin-bottom: 12px;
    }
    .pe-study-chat #prompt {
        height: 46px;
        font-size: 13.5px;
    }
    .pe-study-chat .pe-chat-submit {
        height: 46px;
        padding: 0 18px;
        font-size: 14.5px;
    }
    .pe-chat-starters {
        gap: 6px;
        margin-top: 14px;
    }
    .pe-chat-starters button {
        font-size: 12.5px;
        padding: 5px 12px;
    }
    .pe-chat-illustration {
        max-width: 240px;
    }
    .pe-chat-illustration img {
        max-width: 230px;
    }
}

/* Portrait Tablets (681px - 991.98px: iPad Mini 768px, iPad Air 820px, Surface 912px)
   Keeps the sleek side-by-side design without orphaning the robot at the bottom */
@media (min-width: 681px) and (max-width: 991.98px) {
    .pe-study-chat {
        width: 100%;
        max-width: 720px;
        margin: 0 auto;
        padding: 28px 16px 40px;
    }
    .pe-study-chat .pe-chat-heading {
        margin-bottom: 18px;
    }
    .pe-study-chat h2 {
        font-size: 30px;
        letter-spacing: -0.6px;
    }
    .pe-study-chat .pe-chat-subtitle {
        font-size: 14.5px;
        margin-top: 6px;
    }
    .pe-chat-panel {
        grid-template-columns: minmax(0, 1fr) 200px;
        column-gap: 16px;
        padding: 24px 20px 24px 24px;
        border-radius: 22px;
    }
    .pe-chat-label {
        font-size: 20px;
        margin-bottom: 12px;
    }
    .pe-chat-composer {
        gap: 8px;
    }
    .pe-study-chat #prompt {
        height: 44px;
        font-size: 13px;
        padding: 8px 36px 8px 14px;
    }
    .pe-chat-microphone {
        width: 28px;
        height: 28px;
        font-size: 18px;
        right: 6px;
    }
    .pe-study-chat .pe-chat-submit {
        height: 44px;
        padding: 0 16px;
        font-size: 14px;
        gap: 4px;
    }
    .pe-chat-submit .bx {
        font-size: 16px;
    }
    .pe-chat-starters {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        margin-top: 12px;
    }
    .pe-chat-starters button {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        font-size: 11px;
        padding: 5px 8px;
        white-space: nowrap;
        text-align: center;
    }
    .pe-chat-illustration {
        max-width: 195px;
    }
    .pe-chat-illustration img {
        max-width: 190px;
    }
}

/* Mobile & Phablet Screens (max-width: 680px: iPhone 14/15/16, Galaxy S22/S23, Pixel) */
@media (max-width: 680px) {
    .pe-study-chat {
        width: calc(100% - 24px);
        padding: 24px 0 34px;
    }
    .pe-study-chat .pe-chat-heading {
        margin-bottom: 16px;
    }
    .pe-study-chat .pe-chat-eyebrow {
        font-size: 12px;
        letter-spacing: 1.2px;
        margin-bottom: 6px;
    }
    .pe-study-chat h2 {
        font-size: 25px;
        letter-spacing: -0.5px;
        line-height: 1.2;
    }
    .pe-study-chat .pe-chat-subtitle {
        font-size: 13.5px;
        margin-top: 6px;
    }
    .pe-chat-panel {
        display: flex;
        flex-direction: column;
        padding: 22px 18px 20px;
        border-radius: 20px;
        column-gap: 0;
    }
    .pe-chat-content {
        width: 100%;
    }
    .pe-chat-label {
        font-size: 18px;
        margin-bottom: 12px;
        text-align: left;
    }
    .pe-chat-composer {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    .pe-chat-field {
        width: 100%;
    }
    .pe-study-chat #prompt {
        height: 44px;
        font-size: 13.5px;
        padding: 8px 38px 8px 14px;
        border-radius: 8px;
    }
    .pe-chat-microphone {
        width: 30px;
        height: 30px;
        font-size: 18px;
        right: 6px;
    }
    .pe-study-chat .pe-chat-submit {
        width: 100%;
        height: 44px;
        font-size: 14.5px;
        border-radius: 8px;
        justify-content: center;
    }
    .pe-chat-starters {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        margin-top: 12px;
        overflow: visible;
        padding: 0;
    }
    .pe-chat-starters button {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        font-size: 7px;
        padding: 4px 6px;
        border-radius: 50px;
        white-space: nowrap;
        text-align: center;
        line-height: 1.25;
    }
    .pe-chat-illustration {
        align-self: center;
        max-width: 180px;
        margin-top: 16px;
    }
    .pe-chat-illustration img {
        max-width: 170px;
        height: auto;
    }
}

/* Extra small mobile (max-width: 380px: iPhone SE, Galaxy Z Flip outer) */
@media (max-width: 380px) {
    .pe-study-chat {
        width: calc(100% - 16px);
        padding: 20px 0 28px;
    }
    .pe-study-chat h2 {
        font-size: 22px;
    }
    .pe-chat-panel {
        padding: 16px 14px 16px;
        border-radius: 16px;
    }
    .pe-chat-label {
        font-size: 16px;
        margin-bottom: 10px;
    }
    .pe-study-chat #prompt {
        font-size: 12.5px;
        height: 40px;
    }
    .pe-study-chat .pe-chat-submit {
        height: 40px;
        font-size: 13.5px;
    }
    .pe-chat-starters {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }
    .pe-chat-starters button {
        font-size: 7px;
        padding: 4px 4px;
        white-space: nowrap;
    }
    .pe-chat-illustration {
        max-width: 140px;
        margin-top: 12px;
    }
    .pe-chat-illustration img {
        max-width: 130px;
    }
}
