/* =========================================
   ASK — FINAL CLEAN CSS
   ========================================= */

/* ---------- Base ---------- */

body
{
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: #FFFFFF;
    color: #111;
}

.wrap
{
    width: 90%;
    max-width: 1000px;
    margin: auto;
}

/* ---------- Header ---------- */

.site-header
{
    width: 100%;
    background: #FFF;
    border-bottom: 1px solid #E5E5E5;
}

.site-header .wrap
{
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* keeps your mobile behavior */
    padding: 15px 0;
}

/* ---------- NAV ---------- */

.nav
{
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end; /* keeps right alignment */
}

.nav a
{
    text-decoration: none;
    color: #1F2937;
    font-size: 0.85em;
    letter-spacing: 1px;
    white-space: nowrap; /* keeps each item intact */
}

.nav a::before
{
    content: "[ ";
}

.nav a::after
{
    content: " ]";
}

.nav a:hover
{
    color: #2F80ED;
}

/* ---------- BRAND ---------- */
.brand
{
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo
{
    height: 42px; /* match Ask scale */
    width: auto;
}

.brand-name
{
    font-family: Georgia, serif;
    font-size: 1.4em;
    font-weight: bold;
}

.brand-sub
{
    font-size: 0.75em;
    letter-spacing: 2px;
    color: #6B7280;
}

.home-btn
{
    border: 1px solid #333;
    border-radius: 20px;
    padding: 6px 14px;
    text-decoration: none;
    color: #000;
}

/* ---------- Panel (DA) ---------- */

.panel
{
    max-width: 1000px;
    margin: 30px auto 8px;
    padding: 20px;
    border: 2px solid #2F6FDB;
    border-radius: 14px;
    background: #FFF;
    position: relative;
}

/* ---------- Ask Header Line ---------- */

.ask-line
{
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 10px;
}

#status
{
    justify-self: start;
    font-size: 0.95em;
    color: #9AA3AF;
}

.ask-title
{
    justify-self: center;
    font-size: 1.5em;
    font-weight: 600;
}

/* ---------- New Dialog ---------- */

#newConvBtn
{
    position: absolute;
    right: 15px;
    top: 15px;
    border: 1px solid #333;
    border-radius: 20px;
    padding: 6px 14px;
    background: #FFF;
    cursor: pointer;
}

/* ---------- Chat (CA) ---------- */

#chat
{
    max-width: 800px;
    margin: 12px auto 16px;

    display: flex;
    flex-direction: column;
    gap: 10px;

    max-height: 50vh;
    overflow-y: auto;
    overflow-x: hidden;

    border: 3px solid #E5E5E5;
    padding: 0 12px;
}

/* ---------- Chat Rows (DO NOT CHANGE) ---------- */


#chat .row
{
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;

    padding: 10px 12px;
    border-radius: 12px;
    line-height: 1.45;

    overflow-wrap: anywhere;
    word-break: break-word;
    border: 1px solid #000000;
}

#chat .user
{
    background: #743CF0;
    color: #FFF;
    border-radius: 12px;
    white-space: pre-wrap;
}

#chat .assistant
{
    background: #F2F3FF;
    border-radius: 12px;
    white-space: pre-wrap;
}

/* ---------- Form Container ---------- */

#f
{
    max-width: 800px;
    margin: 0 auto;
}

/* ---------- Row 1: Input + Send ---------- */

.ask-input-row
{
    display: flex;
    align-items: center;
    gap: 8px;
}

#q
{
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #CCC;
    box-sizing: border-box;
}

#sendBtn
{
    background: linear-gradient(135deg, #A855F7, #7C3AED);
    color: #FFF;
    border: none;
    border-radius: 20px;
    padding: 10px 16px;
    cursor: pointer;
}

/* ---------- Row 2: Print / Options / Help ---------- */

.ask-control-row
{
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    margin-top: 12px;
}

/* Left / Right buttons */

#printBtn,
#helpBtn
{
    background: #F8F8F8;
    border: 1px solid #BBB;
    border-radius: 20px;
    padding: 6px 12px;
    cursor: pointer;
}

/* ---------- Options ---------- */

#quickOptions
{
    display: flex;
    justify-content: center;
    flex-direction: row-reverse;
    flex-wrap: wrap;
    gap: 6px;
}

#quickOptions button
{
    background: #E9DDFF;
    border: 1px solid #C4B5FD;
    color: #5B21B6;
    border-radius: 999px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

/* Hover → Send */

#quickOptions button:hover
{
    background: linear-gradient(135deg, #A855F7, #7C3AED);
    color: #FFF;
}

/* Active */

#quickOptions button:active
{
    transform: translateY(0);
}

/* Highlight (AI suggested NEXT) */

#quickOptions button.preferred
{
    border: 2px solid #7B3FF2;
    box-shadow: 0 0 0 2px rgba(123, 63, 242, 0.15);
    transform: scale(1.05);
    font-weight: 600;
}

/* ---------- Footer ---------- */

footer
{
    text-align: center;
    font-size: 0.85em;
    color: #999;
    margin-top: 4px;
}

.panel
{
    position: relative;
}

.manual-overlay
{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background: #FFFFFF;
    border-radius: 10px;

    display: flex;
    flex-direction: column;

    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: all 0.25s ease;
}

/* ACTIVE STATE */
.manual-overlay.show
{
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* HEADER */
.manual-header
{
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 10px;
    border-bottom: 1px solid #DDD;
    font-weight: bold;
}

/* CONTENT */
.manual-content
{
    padding: 15px;
    overflow-y: auto;
}

.manual-overlay
{
    z-index: 9999; /* 👈 THIS FIXES IT */
}

.manual-overlay
{
    background: rgba(255, 255, 255, 0.92);
}

.manual-overlay
{
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px); /* Safari */
}


.nav
{
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav a
{
    text-decoration: none;
    color: var(--text);
    font-size: 0.85em;
    letter-spacing: 1px;
    white-space: nowrap;
}

.nav a::before
{
    content: "[ ";
}

.nav a::after
{
    content: " ]";
}

.nav a:hover
{
    color: var(--accent);
}

@media (max-width: 768px)
{
    .nav a::before,
    .nav a::after
    {
        content: "";
    }
}

@media (max-width: 768px)
{
    .header-inner
    {
        align-items: flex-start;
    }

    .nav
    {
        width: 100%;
        justify-content: flex-start;
        margin-top: 8px;
    }
}

.wrap
{
    width: 90%;
    max-width: 1000px;
    margin: auto;
}
