:root {
    --bg: #1c1115;
    --text: #f2e9eb;
    --muted: #b9aeb1;
    --brand: #7f3248;
    --brand-soft: rgba(127,50,72,0.24);
    --sup: #5f9d73;
    --sup-soft: rgba(95,157,115,0.12);
    --you: #b15564;
    --you-soft: rgba(177,85,100,0.12);
    --accent: #54a8ff;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, sans-serif;
    margin: 0;
    padding: 20px;
    line-height: 1.6;
}

.hdr { text-align: center; margin-bottom: 30px; }
.hdr h1 { font-weight: 600; font-size: 24px; margin: 0; color: #fff; }
.hdr p { color: var(--muted); font-size: 14px; margin-top: 8px; }

.mn { max-width: 600px; margin: 0 auto; }
.inp-inner { background: rgba(255,255,255,0.03); padding: 20px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.08); }
.inp-ta { width: 100%; height: 140px; background: #000; color: #fff; border: 1px solid #333; border-radius: 12px; padding: 15px; font-size: 16px; outline: none; resize: none; font-family: inherit; }

.btn-def { width: 100%; padding: 16px; background: var(--brand); color: #fff; border: none; border-radius: 12px; margin-top: 15px; font-weight: 600; font-size: 16px; cursor: pointer; }

.privacy-shield { text-align: center; font-size: 11px; color: #777; margin-top: 12px; }

.pdf-btn-wrap { display: flex; justify-content: center; margin-top: 25px; }
.btn-pdf { 
    display: inline-block;
    padding: 10px 20px;
    background: rgba(255,255,255,0.05);
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    border: 1px solid #444;
    border-radius: 8px;
    width: fit-content;
    text-align: center;
    transition: background 0.2s;
}
.btn-pdf:active { background: rgba(255,255,255,0.1); }

.res-block { margin-top: 20px; animation: fade 0.4s ease; }

/* --- NEW: Expandable Description & Edit Button Styles --- */
.res-query-wrap { margin-bottom: 25px; }
.res-query { 
    background: rgba(255,255,255,0.05); 
    padding: 15px; 
    border-radius: 12px; 
    color: #bbb; 
    font-size: 14px; 
    border-left: 3px solid var(--brand);
    position: relative;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.res-query.collapsed { 
    max-height: 80px; 
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%); 
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%); 
}

.expand-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    padding: 8px 0;
    cursor: pointer;
    text-transform: uppercase;
    display: inline-block;
}

.inline-edit-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid #444;
    color: #888;
    font-size: 11px;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 8px;
    display: inline-block;
    transition: all 0.2s;
}
.inline-edit-btn:active { background: var(--brand-soft); color: #fff; border-color: var(--brand); }
/* -------------------------------------------------------- */

.crd { background: rgba(255,255,255,0.02); border-radius: 16px; margin-bottom: 20px; border: 1px solid rgba(255,255,255,0.08); overflow: hidden; }
.crd-v { padding: 20px; border-left: 6px solid #444; }
.v-wrong { border-color: var(--sup); background: var(--sup-soft); }
.v-correct { border-color: var(--you); background: var(--you-soft); }

.v-badge { font-size: 10px; font-weight: 600; padding: 4px 8px; border-radius: 4px; display: inline-block; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.wrong { background: var(--sup); color: #fff; }
.correct { background: var(--you); color: #fff; }

.v-text { font-size: 18px; font-weight: 600; color: #fff; line-height: 1.3; }
.v-section { font-size: 13px; color: var(--muted); margin-top: 6px; }

.blk { padding: 18px; border-top: 1px solid rgba(255,255,255,0.05); }
.blk-label { font-size: 11px; text-transform: uppercase; font-weight: 600; color: #777; margin-bottom: 8px; letter-spacing: 0.5px; }
.blk p { color: #d1c7c9; margin: 0; font-size: 14px; }

.strategy-box { background: rgba(84,168,255,0.05); border: 1px solid rgba(84,168,255,0.15); border-radius: 12px; padding: 15px; margin-top: 5px; }
.strategy-box p { color: var(--accent) !important; font-weight: 400; }

.followup-wrap { text-align: center; padding: 25px; background: rgba(255,255,255,0.03); border-radius: 16px; border: 1px solid var(--brand); }
.followup-q { font-weight: 500; color: #fff; margin-bottom: 20px; font-size: 16px; }
.followup-opts { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.followup-opt { width: 100%; max-width: 320px; padding: 14px; background: var(--brand); color: #fff; border: none; border-radius: 10px; font-weight: 500; cursor: pointer; font-size: 14px; }

.footer-btns { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }
.btn-edit, .btn-clr { background: none; border: 1px solid #444; color: #aaa; padding: 12px 20px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.btn-edit { border-color: var(--brand); color: var(--text); }

.ios-banner { position: fixed; bottom: 30px; left: 20px; right: 20px; background: #2a1b21; border: 1px solid var(--brand); border-radius: 12px; padding: 15px; z-index: 9999; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.ios-banner-content { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }

.st { text-align: center; color: #444; font-size: 11px; margin-top: 40px; padding-bottom: 30px; }
.hide { display: none; }
.loading { display: none; text-align: center; padding: 40px; }
.loading.show { display: block; }
.spinner { width: 24px; height: 24px; border: 2px solid rgba(255,255,255,0.1); border-top: 2px solid #fff; border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; } }
