/* ===== Sehrgut — Schreiben Aufgabe ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* بلا هادشي، الـ navigateur كيعطي للأزرار لون النص ديالو
   (كحل) — وعلى خلفية كحلة كيختافيو بالكامل. هادشي هو اللي
   وقع لحروف ä ö ü ß. */
button, input, select, textarea { font: inherit; color: inherit; }

/* أبيض وأحمر، بحال باقي الموقع.

   قبل، هاد الصفحة كانت الوحيدة اللي بقات كحلة: الشريط ديال
   فوق أبيض والباقي أسود. دابا ولات فاتحة بحال Lesen و Hören —
   نفس الألوان ديال assets/theme.css.

   تنبيه على الأسماء:
     --ink   = لون *النص* (ماشي الخلفية بحال ف theme.css)
     --paper = خلفية الصفحة
     --card  = خلفية اللوحات والبطائق */
:root {
    --ink: #121d18;
    --paper: #f7f8fc;
    --card: #ffffff;
    --bar: #ffffff;
    --bar-text: #121d18;
    --red: var(--brand);
    --red-dark: var(--brand-dark);
    --yellow: var(--brand-soft);
    --border: rgba(18, 29, 24,.10);
    --muted: #5b6172;
}


body {
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    background: var(--paper);
    color: var(--ink);
    min-height: 100vh;
}

/* ===== TOP BAR ===== */
.task-header {
    background: var(--bar);
    color: var(--bar-text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 22px;
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 4px solid var(--red);
}

.task-header .left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.back-btn {
    background: transparent;
    border: none;
    color: var(--bar-text);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 6px;
    border-radius: 8px;
}
.back-btn:hover { background: rgba(255,255,255,.12); }

.task-title-block h1 {
    font-size: 17px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.task-title-block .sub {
    font-size: 12px;
    color: var(--accent-text);
    letter-spacing: .3px;
    margin-top: 2px;
}

.task-header .right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.timer-pill {
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.18);
    color: #fff;
    padding: 7px 14px;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.timer-pill.low { background: rgba(18, 209, 129,.25); border-color: var(--red); color: #ffb3b3; }

.icon-btn {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.14);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
}
.icon-btn:hover { background: rgba(255,255,255,.18); }

.correct-btn {
    background: var(--yellow);
    color: #111;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}
.correct-btn:hover { background: #fff; }
.correct-btn:disabled { opacity: .6; cursor: wait; }

/* ===== LAYOUT ===== */
.task-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: calc(100vh - 68px);
}
@media (max-width: 900px) {
    .task-body { grid-template-columns: 1fr; }
}

.panel-left {
    padding: 26px 28px;
    border-inline-end: 1px solid var(--border);
    overflow-y: auto;
    background: var(--paper);
}
.panel-right {
    display: flex;
    flex-direction: column;
    background: var(--card);
}

.block {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
}

.block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.block-head h2 {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.block-head h2::before {
    content: "";
    width: 4px;
    height: 16px;
    background: var(--red);
    border-radius: 3px;
    display: inline-block;
}

.translate-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}
.translate-btn:hover { border-color: var(--red); color: var(--accent-text); }

.ad-text {
    white-space: pre-wrap;
    font-size: 14.5px;
    line-height: 1.7;
    color: var(--ink);
}

.aufgabe-intro {
    font-size: 14.5px;
    margin-bottom: 14px;
    color: var(--ink);
}

.point-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.5;
}
.point-num {
    background: var(--yellow);
    color: #111;
    width: 22px;
    height: 22px;
    min-width: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

/* ===== WRITING AREA ===== */
.editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    border-bottom: 1px solid var(--border);
}
.umlaut-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.umlaut-btns button {
    border: 1px solid var(--border);
    background: var(--paper);
    color: var(--ink);
    border-radius: 8px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
}
.umlaut-btns button:hover { border-color: var(--red); color: var(--accent-text); }
.word-count { font-size: 13px; color: var(--muted); white-space: nowrap; }

.editor-wrap {
    flex: 1;
    position: relative;
    display: flex;
}
#answer-text {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    padding: 24px;
    font-size: 15.5px;
    line-height: 1.8;
    font-family: inherit;
    background: transparent;
    color: var(--ink);
}
.editor-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--muted);
    pointer-events: none;
    text-align: center;
}
.editor-placeholder svg { width: 40px; height: 40px; opacity: .4; }
.editor-placeholder.hidden { display: none; }

/* ===== RESULT PANEL ===== */
.result-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}
.result-overlay.hidden { display: none; }
.result-card {
    background: var(--card);
    border-radius: 18px;
    max-width: 640px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 26px;
}
.result-score {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 6px;
}
.result-score .num { font-size: 42px; font-weight: 800; color: var(--accent-text); }
.result-score .max { font-size: 18px; color: var(--muted); }
.result-bar {
    height: 8px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 18px;
}
.result-bar-fill { height: 100%; background: linear-gradient(90deg, var(--red), var(--brand-light)); }
.result-section { margin-bottom: 16px; }
.result-section h3 { font-size: 14px; margin-bottom: 8px; }
.result-section p, .result-section li { font-size: 14px; line-height: 1.7; color: var(--ink); }
.result-close {
    margin-top: 10px;
    /* كانت بيضا على بطاقة كحلة. البطاقة ولات بيضا، إذن خاصها
       حدّ وخلفية رمادية خفيفة باش تبان. */
    background: var(--surface-2);
    color: var(--bar-text);
    border: 1px solid var(--line);
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
}
.result-close:hover { border-color: var(--red); color: var(--accent-text); }

.loading-dots span {
    display: inline-block;
    width: 6px; height: 6px;
    background: #111;
    border-radius: 50%;
    margin: 0 2px;
    animation: blink 1.2s infinite ease-in-out;
}
.loading-dots span:nth-child(2) { animation-delay: .2s; }
.loading-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }

.error-banner {
    background: #fdecea;
    border: 1px solid #f5b5ae;
    color: #a11;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13.5px;
    margin-bottom: 16px;
}
/* ===== TRANSLATION ===== */
.translation {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--paper);
    border: 1px solid var(--border);
    border-inline-start: 4px solid var(--red);
    direction: rtl;
    text-align: right;
    font-size: 14.5px;
    line-height: 1.9;
    white-space: pre-wrap;
}
.translate-btn[aria-busy="true"] { opacity: .6; cursor: wait; }
.translation.error {
    border-inline-start-color: var(--red);
    color: #a11;
}

.words-badge {
    display: inline-block;
    margin-inline-start: 8px;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--yellow);
    color: #111;
    font-size: 12px;
    font-weight: 700;
}

/* ===== شاشة Premium (أبيض وأحمر) =====
   كانت كحلة على موقع أبيض — كانت كتبان بحال شي صفحة أخرى. */
.premium-screen {
    --gold: var(--brand);
    --gold-soft: var(--brand-dark);
    --ink-900: #f7f8fc;
    --card-900: #ffffff;

    position: fixed;
    inset: 0;
    overflow-y: auto;
    padding: 40px 18px;
    direction: rtl;
    font-family: "Cairo", "IBM Plex Sans Arabic", "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 15% 10%, rgba(214,178,94,.08), transparent 42%),
        radial-gradient(circle at 85% 30%, rgba(214,178,94,.05), transparent 46%),
        var(--ink-900);
}

.premium-card {
    max-width: 520px;
    margin: 6vh auto 0;
    background: var(--card-900);
    border: 1px solid var(--line-gold);
    border-radius: 22px;
    padding: 38px 30px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(18, 29, 24,.12);
}

.premium-lock {
    font-size: 40px;
    line-height: 1;
    margin-bottom: 16px;
}

.premium-card h1 {
    font-size: 27px;
    font-weight: 900;
    margin: 0 0 12px;
    background: var(--grad-text, linear-gradient(135deg, var(--gold), var(--brand-light)));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.premium-card p {
    color: var(--muted);
    font-size: 16px;
    line-height: 1.9;
    margin: 0 0 26px;
}

.premium-actions {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.premium-btn {
    display: block;
    padding: 14px 18px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: .25s;
}

.premium-btn.gold {
    background: linear-gradient(135deg, var(--gold), var(--brand-light));
    color: var(--on-brand);
}
.premium-btn.gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px -8px rgba(214,178,94,.5);
}

.premium-btn.whatsapp { background: var(--grad-brand); color: var(--on-brand); }
.premium-btn.whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px -8px rgba(37,211,102,.45);
}

.premium-btn.ghost {
    background: var(--surface-2);
    border-color: var(--line);
    color: var(--muted);
}
.premium-btn.ghost:hover { border-color: rgba(214,178,94,.35); color: var(--accent-text); }

/* ===== OFFERS ===== */
.offers-sheet {
    max-width: 1100px;
    margin: 26px auto 0;
}
.offers-sheet[hidden] { display: none; }

.offers-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    align-items: stretch;
}

.offer-box {
    display: flex;
    flex-direction: column;
    background: var(--card-900);
    border: 2px solid var(--line);
    border-radius: 20px;
    padding: 26px 22px;
    text-align: center;
    transition: .3s;
}
.offer-box:hover {
    transform: translateY(-6px);
    border-color: rgba(214,178,94,.35);
    box-shadow: 0 20px 45px -12px rgba(214,178,94,.3);
}

.offer-box.best { border-color: rgba(214,178,94,.5); }

.offer-tag {
    align-self: center;
    margin-bottom: 10px;
    padding: 4px 13px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--gold), var(--brand-light));
    color: var(--on-brand);
    font-size: 12px;
    font-weight: 800;
}

.offer-box h3 { margin: 0 0 6px; font-size: 22px; color: var(--accent-text); }
.offer-box .sub { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.offer-box .amount { font-size: 32px; font-weight: 800; color: var(--text); }
.offer-box .per { font-size: 15px; color: var(--muted); }

.offer-box ul {
    list-style: none;
    margin: 20px 0 0;
    padding: 0;
    flex: 1;
    text-align: start;
}
.offer-box li {
    display: flex;
    gap: 9px;
    margin-bottom: 13px;
    font-size: 14.5px;
    line-height: 1.6;
}
.offer-box li::before { content: "✓"; color: var(--ok); font-weight: 700; }

@media (max-width: 900px) {
    .offers-grid { grid-template-columns: 1fr; }
    .offer-box { max-width: 520px; width: 100%; margin: 0 auto; }
    .premium-card { padding: 30px 22px; }
    .premium-card h1 { font-size: 23px; }
}

/* ===== الهاتف =====
   فالعرض الضيق العمودين كيوليو فوق بعضياتهم. الـ textarea
   عندها flex:1 داخل عمود، ف بلا طول أدنى كتقدر تنكمش
   لشي سطرين — والطالب خاصو يكتب 150 كلمة فيها. */

@media (max-width: 900px) {
    .task-body { min-height: auto; }

    .panel-left { padding: 18px 16px; }

    .panel-right {
        min-height: 68vh;
        border-top: 1px solid var(--border);
    }

    #answer-text {
        min-height: 46vh;
        padding: 18px 16px;
        font-size: 16px;   /* تحت 16px، iOS كيزوّم ملي تكتب */
    }
}

@media (max-width: 600px) {
    .task-header {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 14px;
    }

    .task-header .left { flex: 1 1 100%; }

    .task-header .right {
        flex: 1 1 100%;
        justify-content: space-between;
    }

    .task-title-block h1 { font-size: 15px; }

    .correct-btn { padding: 10px 16px; }

    .block { padding: 16px 14px; }

    .point-row { padding: 10px 12px; }

    .result-card { padding: 20px 16px; }

    .umlaut-btns button { width: 34px; height: 34px; }
}

/* ===== منع التمدد الأفقي فالتيليفون =====
   الـ grid عندو min-width:auto فالأعمدة، إذن شي نص طويل بلا
   مسافات (بريد، لينك، كلمة مركّبة ألمانية) كيوسّع العمود أكثر
   من الشاشة والصفحة كاملة كتمشي فالعرض. هادشي كيحلّو. */

html, body { max-width: 100%; overflow-x: hidden; }

.task-body { min-width: 0; }
.panel-left,
.panel-right { min-width: 0; }

.block,
.point-row,
.ad-text,
.aufgabe-intro,
.translation,
.result-section p,
.result-section li {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.block-head { flex-wrap: wrap; gap: 10px; }
.block-head h2 { min-width: 0; }

.editor-toolbar { flex-wrap: wrap; gap: 8px; }

@media (max-width: 600px) {
    .task-header { padding: 9px 12px; }
    .task-header .right { flex-wrap: wrap; gap: 8px; }

    /* الهيدر ملي كيولي جوج سطورة كياكل بزاف من الشاشة */
    .timer-pill { padding: 6px 11px; font-size: 13px; }
    .icon-btn { width: 34px; height: 34px; }
    .correct-btn { flex: 1 1 auto; min-height: 42px; }

    .translate-btn { font-size: 11.5px; padding: 6px 9px; }

    .editor-toolbar { padding: 9px 12px; }
    .umlaut-btns { gap: 5px; }
    .word-count { font-size: 12px; }

    .result-card { max-height: 88dvh; overflow-y: auto; }
}


/* ===== الشريط ديال التمرين =====
   الأزرار والمؤقت كانو نص أبيض حيت الشريط كان كحل.

   ملاحظة: كانت هنا لائحة محددات ديال body[data-theme="light"]
   سالات بفاصلة على قبل تعليق، إذن .task-header كان داخل معاهم
   فنفس القاعدة. الوضع الفاتح/المظلم تحيد، إذن حيدناهم. */
.task-header { border-bottom: 3px solid var(--red); box-shadow: 0 2px 14px rgba(18, 29, 24,.06); }
.back-btn { color: var(--bar-text); }
.back-btn:hover { background: rgba(18, 29, 24,.06); }
.timer-pill {
    background: rgba(18, 29, 24,.05);
    border-color: rgba(18, 29, 24,.12);
    color: var(--bar-text);
}
.timer-pill.low { background: rgba(214,178,94,.12); border-color: var(--red); color: var(--accent-text); }
.icon-btn { background: rgba(18, 29, 24,.05); color: var(--bar-text); }
.icon-btn:hover { background: rgba(18, 29, 24,.10); }
.task-title-block .sub { color: var(--accent-text); }
.correct-btn { background: var(--red); color: var(--on-brand); }
.correct-btn:hover { background: var(--red-dark); }
.point-num { background: var(--red); color: var(--on-brand); }

/* ===== v3 — نفس الهوية ديال الموقع: بار أزرق ليلي + أزرار واضحين ===== */
:root {
    --ink: #0e3223;
    --paper: #f2f4f9;
    --border: rgba(14, 50, 35,.11);
    --muted: #56607a;
}
.task-header {
    background: var(--grad-navy, linear-gradient(135deg, var(--navy-2), var(--navy) 55%, #12563a));
    color: #fff;
    border-bottom: 3px solid var(--red);
    box-shadow: 0 10px 30px -14px rgba(9, 44, 29,.6);
}
.task-header .back-btn { color: #fff; }
.task-header .back-btn:hover { background: rgba(255,255,255,.12); }
.task-header .task-title-block h1 { color: #fff; }
.task-header .task-title-block .sub { color: #ff8aa0; }
.task-header .timer-pill { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #fff; }
.task-header .timer-pill.low { background: rgba(214,178,94,.3); border-color: var(--red); color: #fff; }
.task-header .icon-btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); color: #fff; }
.task-header .icon-btn:hover { background: rgba(255,255,255,.18); }
.correct-btn {
    min-height: 42px;
    padding: 0 20px;
    border-radius: 12px;
    font-weight: 800;
    background: var(--grad-brand, linear-gradient(135deg, #4eeba9, #1fd186 45%, #16a569));
    color: var(--on-brand);
    box-shadow: 0 10px 24px -10px rgba(214,178,94,.7);
}
.correct-btn:hover { background: var(--grad-brand); filter: brightness(1.06); }
.translate-btn {
    min-height: 34px;
    border: 1.5px solid var(--navy, var(--navy));
    color: var(--navy, var(--navy));
    background: #fff;
    font-weight: 800;
}
.translate-btn:hover { background: var(--navy, var(--navy)); color: #fff; border-color: var(--navy, var(--navy)); }
.umlaut-btns button {
    border: 1.5px solid var(--navy, var(--navy));
    color: var(--navy, var(--navy));
    background: #fff;
    font-weight: 800;
}
.umlaut-btns button:hover { background: var(--navy, var(--navy)); color: #fff; }

/* v5: الطبقة الداكنة v4 مسدودة (@media not all) — كتبقى هنا إلا بغينا نرجعوها */
@media not all {
/* ===== v4 — ذهبي وأسود ===== */
:root {
    --ink: #ece7dc;
    --paper: #0e0e11;
    --card: #16161b;
    --bar: #16161b;
    --bar-text: #ece7dc;
    --border: rgba(255,255,255,.08);
    --muted: #a39d90;
    --yellow: rgba(214,178,94,.14);
}
body { background: var(--paper); color: var(--ink); }
.task-header {
    background: linear-gradient(145deg, #202027 0%, #141418 55%, #0d0d10 100%);
    border-bottom: 1px solid rgba(214,178,94,.35);
    box-shadow: 0 12px 30px -16px rgba(0,0,0,.9);
}
.task-header .task-title-block .sub { color: var(--accent-text); }
.correct-btn { background: var(--grad-brand); color: var(--on-brand); box-shadow: var(--shadow-brand); }
.correct-btn:hover { background: var(--grad-brand); color: var(--on-brand); }
.translate-btn,
.umlaut-btns button {
    background: transparent;
    color: var(--ink);
    border: 1.5px solid rgba(214,178,94,.4);
}
.translate-btn:hover,
.umlaut-btns button:hover { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.point-num { background: var(--grad-brand); color: var(--on-brand); }
textarea, input { background: transparent; color: var(--ink); }

}
/* =====================================================
   v4.2 — ورقة بيضة: النص، المهام وخانة الكتابة فاتحين
   بكتابة كحلة باش يركز المستخدم. الباقي أسود وذهبي.
   ===================================================== */
.block,
.panel-right,
.result-card {
    --ink: #1c1a16;
    --paper: #f5efe1;
    --card: #fffdf8;
    --border: rgba(28,26,22,.13);
    --muted: #5e584c;
    color: #1c1a16;
}
.block {
    background: linear-gradient(180deg, #fffdf8, #faf6ec);
    border: 1px solid rgba(214,178,94,.55);
    box-shadow: 0 18px 40px -26px rgba(0,0,0,.9);
}
.block-head h2 { color: #1c1a16; }
.block-head h2::before { background: var(--grad-brand); }
.panel-right { background: #fffdf8; border-inline-start: 1px solid rgba(214,178,94,.45); }
.editor-toolbar { background: #f5efe1; border-bottom-color: rgba(168,134,58,.35); }
#answer-text { color: #1c1a16; caret-color: #a8863a; }
#answer-text::selection, .block ::selection { background: rgba(214,178,94,.45); color: #000; }
.point-row { background: #fff; border-color: rgba(28,26,22,.13); color: #1c1a16; }
.translation { background: #f5efe1; color: #1c1a16; border-inline-start-color: #d6b25e; }
:is(.block, .panel-right) :is(.translate-btn, .umlaut-btns button) {
    background: #fff;
    color: #1c1a16;
    border: 1.5px solid rgba(168,134,58,.55);
}
:is(.block, .panel-right) :is(.translate-btn, .umlaut-btns button):hover {
    background: var(--grad-brand);
    color: var(--on-brand);
    border-color: #d6b25e;
}
.result-card { background: #fffdf8; border: 1px solid rgba(214,178,94,.55); }

/* ---- شبكة telc فالنتيجة ---- */
.crit-list { display: flex; flex-direction: column; gap: 8px; }
.crit-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px;
            border-radius: 12px; border: 1px solid var(--line, rgba(0,0,0,.1)); }
.crit-grade { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
              font-weight: 900; font-size: 16px; color: #fff; background: #9aa0a6; }
.crit-A .crit-grade { background: #2e9e5b; }
.crit-B .crit-grade { background: #c9a227; }
.crit-C .crit-grade { background: #e07b24; }
.crit-D .crit-grade { background: #d14343; }
.crit-body { flex: 1 1 auto; min-width: 0; }
.crit-body b { font-size: 14px; }
.crit-body small { font-weight: 600; opacity: .65; margin-inline-start: 4px; }
.crit-body p { margin: 4px 0 0; font-size: 13.5px; }
.crit-pts { flex: 0 0 auto; font-weight: 800; font-size: 13px; opacity: .8; white-space: nowrap; }
.lp-list { list-style: none; padding: 0; margin: 0; }
.lp-list li { padding: 6px 0; border-bottom: 1px dashed var(--line, rgba(0,0,0,.1)); }
.lp-list li:last-child { border-bottom: 0; }
.lp-list small { opacity: .7; }
.wc-note { margin: 0 0 16px; font-size: 13.5px; font-weight: 700; }
.wc-note.ok { color: #2e9e5b; }
.wc-note.short { color: #d14343; }

/* ===== بلاصة الكتابة: خلفية بيضا =====
   كانت --card (كريمي 255,253,248). الكتابة الطويلة على
   خلفية بيضا صافية أريح للعين وأقرب للورقة الحقيقية. */
.panel-right { background: #ffffff; }
#answer-text { background: #ffffff; }

/* ===== الرأس: أيقونات بلاصة الإيموجي (نسخة 2) ===== */
.back-btn svg, .icon-btn svg, .correct-btn svg, .timer-pill svg { flex: none; display: block; }
.timer-pill { font-weight: 800; height: 40px; padding: 0 14px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; }
.correct-btn { height: 42px; padding: 0 22px; border-radius: 12px; font-weight: 900; font-size: 15px; background: linear-gradient(135deg, #ffe58a, #f2b705); box-shadow: 0 10px 22px -12px #f2b705; transition: transform .18s, filter .18s; }
.correct-btn:hover { background: linear-gradient(135deg, #ffe58a, #f2b705); filter: brightness(1.06); transform: translateY(-1px); }

/* =====================================================
   v6 — تصميم أنظف
   · الشريط: العنوان + شارات (B2 · Beschwerde)، الأزرار كاملين ف جهة وحدة
     (ملاحظة، الوضع المظلم، المؤقت، شاشة كاملة، تصحيح).
   · الإعلان كيبان بحال إعلان (عنوان، لائحة، اتصال)، والرسالة بحال ورقة.
   · خانة الكتابة: لاصقة ف PC، العداد «45 / 150» مع شريط، والنص
     التوضيحي ف البلاصة فين كتبدا الكتابة.
   ===================================================== */
body { font-family: "Cairo", "Segoe UI", Arial, sans-serif; }
.block, .panel-right, #answer-text, .point-row, .ad-flyer, .ad-letter { font-family: "Inter", "Segoe UI", Arial, Helvetica, sans-serif; }
.block-head h2, .translate-btn, .word-count, .editor-placeholder { font-family: "Cairo", "Segoe UI", Arial, sans-serif; }

/* ---- الشريط ---- */
.task-header { padding: 12px 22px; gap: 14px; }
.task-title-block { min-width: 0; }
.task-header .task-title-block h1 { font-size: 19px; font-weight: 800; letter-spacing: .1px; }
.task-header .task-title-block .sub {
    display: inline-flex; align-items: center; margin-top: 5px; padding: 2px 10px;
    border-radius: 999px; background: rgba(255,255,255,.14); color: #ffe3ea;
    font-size: 12px; font-weight: 700; letter-spacing: .3px;
}
.task-header .right { gap: 8px; }
.task-header .rp-head-btn {
    height: 40px; padding: 0 14px; border-radius: 12px; font-size: 13px;
    background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.22);
}
.task-header .rp-head-btn:hover { background: rgba(255,255,255,.18); }
.task-header .de-theme-btn.icon-btn svg { width: 18px; height: 18px; }

/* ---- الإعلان ---- */
.ad-flyer {
    position: relative; padding: 22px 20px 16px; border-radius: 14px;
    background: #fff; border: 1.5px solid rgba(168,134,58,.45);
    box-shadow: 0 1px 0 rgba(0,0,0,.02), 0 10px 24px -18px rgba(0,0,0,.5);
    color: #1c1a16; font-size: 15px; line-height: 1.65; direction: ltr; text-align: left;
}
.ad-tag {
    position: absolute; top: -10px; left: 16px; padding: 1px 10px; border-radius: 999px;
    background: #f2b705; color: #2a1d00; font: 800 11px/1.8 "Inter", Arial, sans-serif;
    letter-spacing: .08em; text-transform: uppercase;
}
.ad-title { margin: 0 0 8px; font-size: 18px; font-weight: 800; line-height: 1.35; color: #157f52; }
.ad-flyer p { margin: 0 0 8px; }
.ad-shout { font-weight: 800; letter-spacing: .04em; color: #157f52; }
.ad-list { list-style: none; margin: 4px 0 12px; padding: 0; display: grid; gap: 6px; }
.ad-list li { position: relative; padding-left: 26px; }
.ad-list li::before {
    content: ""; position: absolute; left: 4px; top: .5em; width: 12px; height: 7px;
    border-left: 2.5px solid #2e9e5b; border-bottom: 2.5px solid #2e9e5b; transform: rotate(-45deg);
}
.ad-contact {
    margin: 0 !important; font-size: 13px; color: #6b6458;
}
.ad-flyer p:not(.ad-contact) + .ad-contact { margin-top: 10px !important; padding-top: 10px; border-top: 1px dashed rgba(168,134,58,.45); }
.ad-letter {
    padding: 18px 20px; border-radius: 12px; background: #fff;
    border: 1px solid rgba(28,26,22,.12); border-inline-start: 4px solid #f2b705;
    color: #1c1a16; font-size: 15px; line-height: 1.75; direction: ltr; text-align: left;
}
.ad-letter p { margin: 0 0 10px; }
.ad-letter p:last-child, .ad-flyer > :last-child { margin-bottom: 0; }
#situation-text { font-size: 15px; line-height: 1.75; margin-top: 16px !important; padding: 14px 16px;
    background: rgba(242,183,5,.10); border-radius: 12px; }
.aufgabe-intro { font-size: 15px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.point-row { font-size: 15px; padding: 12px 14px; border-radius: 12px; align-items: center; }
.point-num { width: 26px; height: 26px; min-width: 26px; font-size: 13px; }

/* ---- خانة الكتابة ---- */
/* overflow-x:hidden ف html/body كيخلي body يولي «scroll container» →
   position:sticky ما كيخدمش (الشريط كان كيمشي مع السكرول). clip
   كيقطع التمدد الأفقي بلا هاد المشكل (المتصفحات القديمة كيبقاو ف hidden). */
html, body { overflow-x: clip; }
@media (min-width: 901px) {
    .panel-right {
        position: sticky; top: var(--hdr, 68px);
        height: calc(100vh - var(--hdr, 68px)); align-self: start;
    }
    .panel-left { min-height: calc(100vh - var(--hdr, 68px)); }
}
.editor-toolbar { padding: 10px 16px; gap: 10px; background: #faf6ec; }
.umlaut-btns { gap: 6px; }
.umlaut-btns button, :is(.block, .panel-right) .umlaut-btns button { width: 36px; height: 36px; border-radius: 10px; font-size: 16px; }
.word-count { display: inline-flex; align-items: baseline; gap: 4px; font-size: 13px; font-weight: 700; color: #5e584c; margin-inline-start: auto; }
.word-count b { font-size: 16px; color: #1c1a16; }
.word-count.is-done b { color: #2e9e5b; }
.wc-meter { flex: 0 0 90px; height: 6px; border-radius: 999px; background: rgba(28,26,22,.10); overflow: hidden; }
.wc-meter-fill { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #f2b705, #e0a800); transition: width .25s ease; }
.wc-meter.is-done .wc-meter-fill { background: #2e9e5b; }
#answer-text { padding: 26px 28px; font-size: 16.5px; line-height: 1.9; }
.editor-placeholder {
    inset: 0 auto auto 0; right: 0; padding: 26px 28px; flex-direction: row;
    justify-content: flex-start; align-items: center; gap: 10px; direction: rtl; text-align: right;
    font-size: 15px; color: #8d8577;
}
.editor-placeholder svg { width: 22px; height: 22px; opacity: .55; }

@media (max-width: 900px) {
    .panel-right { min-height: 70vh; }
    #answer-text { padding: 20px 16px; font-size: 16px; }
    .editor-placeholder { padding: 20px 16px; }
    .editor-toolbar { position: sticky; top: var(--hdr, 0px); z-index: 5; }
}
@media (max-width: 600px) {
    .task-header { padding: 10px 12px; row-gap: 10px; }
    .task-header .task-title-block h1 { font-size: 16px; }
    .task-header .right { flex-wrap: nowrap; justify-content: flex-start; }
    .task-header .rp-head-btn span { display: none; }
    .task-header .rp-head-btn { width: 38px; height: 38px; padding: 0; justify-content: center; }
    #fullscreen-toggle { display: none; }
    .task-header .icon-btn { width: 38px; height: 38px; }
    .timer-pill { height: 38px; }
    .correct-btn { height: 40px; min-height: 40px; flex: 1 1 auto; justify-content: center; }
    .ad-flyer { padding: 20px 14px 14px; font-size: 14.5px; }
    .ad-title { font-size: 16.5px; }
    .umlaut-btns button, :is(.block, .panel-right) .umlaut-btns button { width: 34px; height: 34px; }
    .wc-meter { flex-basis: 100%; order: 3; }
}

/* Sehrgut: بلا تصحيح بالذكاء الاصطناعي — الطالب كيكتب بحرية */
#correct-btn, #result-overlay { display: none !important; }
/* Sehrgut: بلا ترجمة ف Schreiben */
.translate-btn, .translation { display: none !important; }
