#htt-app, .htt-app {
    --htt-bg: #fff5f8;
    --htt-card: #ffffff;
    --htt-text: #3d2430;
    --htt-muted: #846b75;
    --htt-border: #f2d7e1;
    --htt-accent: #e84a7a;
    max-width: 920px;
    margin: 30px auto;
    color: var(--htt-text);
    background: linear-gradient(180deg, #fff5f8 0%, #ffffff 100%);
    padding: 12px;
    border-radius: 24px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.htt-app * { box-sizing: border-box; }
.htt-header {
    position:relative;
    overflow:hidden;
    box-shadow: 0 12px 35px rgba(232, 74, 122, .08);
    display:flex; justify-content:space-between; gap:24px; align-items:flex-start;
    padding:24px; border:1px solid var(--htt-border); border-radius:18px;
    background:var(--htt-card); margin-bottom:16px;
}
.htt-kicker { color:var(--htt-accent); font-size:13px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; }
.htt-header h2 { margin:6px 0 4px; font-size:28px; }
.htt-header p { margin:0; color:var(--htt-muted); }
.htt-progress-wrap { min-width:180px; text-align:right; color:var(--htt-muted); font-size:13px; }
.htt-progress { height:8px; background:#e9e9ef; border-radius:999px; margin-top:8px; overflow:hidden; }
.htt-progress span { display:block; height:100%; background:var(--htt-accent); width:25%; transition:width .25s ease; }
.htt-mode-tabs { display:flex; gap:8px; margin-bottom:16px; }
.htt-direct-lesson { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin:0 0 14px; padding:12px 14px; border:1px solid var(--htt-border); border-radius:12px; background:#fff; }
.htt-direct-lesson label { color:var(--htt-text); font-weight:700; }
.htt-direct-lesson select { min-width:220px; max-width:100%; padding:9px 12px; border:1px solid var(--htt-border); border-radius:9px; background:#fff; color:var(--htt-text); font:inherit; }
.htt-mode, .htt-button {
    border:1px solid var(--htt-border); background:#fff; color:var(--htt-text);
    border-radius:10px; padding:10px 15px; cursor:pointer; font-weight:600;
}
.htt-mode.is-active { background:var(--htt-accent); color:#fff; border-color:var(--htt-accent); }
.htt-card { position:relative; overflow:hidden; background:var(--htt-card); border:1px solid var(--htt-border); border-radius:20px; padding:34px; text-align:center; }
.htt-teacher { min-height:28px; color:var(--htt-muted); font-size:17px; }
.htt-character { font-size:110px; line-height:1.1; margin:18px 0; }
.htt-key-area { display:flex; flex-direction:column; align-items:center; gap:7px; color:var(--htt-muted); }
.htt-key-area.is-hidden { visibility:hidden; }
kbd { min-width:70px; padding:12px 22px; border:1px solid #cfd2da; border-bottom-width:3px; border-radius:12px; background:#fff7fa; font:700 30px/1 system-ui; color:#111827; }
.htt-instruction { margin:20px 0 10px; font-weight:600; }
.htt-input { position:absolute; opacity:0; pointer-events:none; }
.htt-result { min-height:28px; margin:8px 0 18px; font-weight:700; }
.htt-result.success { color:#15803d; }
.htt-result.error { color:#b91c1c; }
.htt-actions { display:flex; justify-content:center; gap:10px; }
.htt-button.primary { background:var(--htt-accent); border-color:var(--htt-accent); color:#fff; }
.htt-stats { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-top:16px; }
.htt-stats div { background:#fff; border:1px solid var(--htt-border); border-radius:14px; padding:15px; text-align:center; }
.htt-stats strong { display:block; font-size:22px; }
.htt-stats span { color:var(--htt-muted); font-size:13px; }
.htt-note { text-align:center; color:var(--htt-muted); font-size:12px; margin-top:14px; }
@media (max-width:700px) {
    .htt-header {
    position:relative;
    overflow:hidden;
    box-shadow: 0 12px 35px rgba(232, 74, 122, .08); flex-direction:column; }
    .htt-progress-wrap { width:100%; text-align:left; }
    .htt-card { padding:24px 14px; }
    .htt-character { font-size:84px; }
    .htt-stats { grid-template-columns:repeat(2,1fr); }
    .htt-mode-tabs { flex-wrap:wrap; }
}

.htt-app:before {
    content:"♥  ♡  ♥";
    display:block;
    text-align:center;
    color:#e84a7a;
    font-size:18px;
    letter-spacing:14px;
    margin-bottom:2px;
    opacity:.75;
}
.htt-heart {
    position:absolute;
    bottom:22%;
    color:#e84a7a;
    font-size:22px;
    pointer-events:none;
    animation: htt-heart-float 1s ease-out forwards;
    z-index:5;
}
@keyframes htt-heart-float {
    from { transform:translateY(0) scale(.7); opacity:0; }
    20% { opacity:1; }
    to { transform:translateY(-150px) scale(1.25) rotate(12deg); opacity:0; }
}

.htt-chapter5 {
    margin-top:18px;
    padding:24px;
    background:#fff;
    border:1px solid var(--htt-border);
    border-radius:20px;
    box-shadow:0 10px 30px rgba(232,74,122,.06);
}
.htt-ch5-heading h3 { margin:5px 0; font-size:24px; }
.htt-ch5-heading p { margin:0 0 18px; color:var(--htt-muted); }
.htt-mnemonic-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.htt-mnemonic-room { border:1px solid var(--htt-border); border-radius:16px; padding:17px; background:#fff9fb; }
.htt-room-title { font-weight:800; margin-bottom:10px; }
.htt-key-line code { font-weight:800; letter-spacing:.08em; color:#7a2744; }
.htt-hi-line { margin:8px 0; font-size:20px; font-weight:700; }
.htt-chant { padding:10px; border-radius:10px; background:#ffe8f0; font-weight:800; margin:10px 0; }
.htt-chunks { display:flex; flex-wrap:wrap; gap:7px; }
.htt-chunks span { background:#fff; border:1px solid var(--htt-border); padding:6px 8px; border-radius:8px; font-size:13px; }
.htt-mnemonic-drill { display:flex; align-items:center; justify-content:space-between; gap:15px; margin-top:16px; padding:16px; border-radius:14px; background:#fff0f5; }
.htt-mnemonic-drill p { margin:3px 0 0; color:var(--htt-muted); }
.htt-mnemonic-drill-card { margin-top:12px; padding:20px; text-align:center; border:1px dashed #e9a9bd; border-radius:14px; }
.htt-drill-label { font-weight:800; color:#a52e55; }
.htt-drill-phrase { font-size:34px; font-weight:900; margin:10px; }
.htt-drill-hint { color:var(--htt-muted); margin-bottom:10px; }
.htt-mnemonic-input { width:min(260px,100%); padding:11px 13px; border:1px solid #e7bccb; border-radius:10px; font-size:20px; text-align:center; margin-bottom:10px; }
.htt-footnote { margin:15px 0 0; color:var(--htt-muted); font-size:13px; line-height:1.6; }
@media (max-width:800px) { .htt-mnemonic-grid { grid-template-columns:1fr; } .htt-mnemonic-drill { flex-direction:column; align-items:stretch; } }

.htt-chapter6 {
    margin-top:18px; padding:24px; background:#fff;
    border:1px solid var(--htt-border); border-radius:20px;
    box-shadow:0 10px 30px rgba(232,74,122,.06);
}
.htt-ch6-heading h3 { margin:5px 0; font-size:24px; }
.htt-ch6-heading p { margin:0 0 18px; color:var(--htt-muted); }
.htt-learning-cycle {
    display:flex; justify-content:center; flex-wrap:wrap; gap:9px;
    padding:13px; background:#fff0f5; border-radius:13px; font-weight:800;
    color:#8e3151; margin-bottom:16px;
}
.htt-story-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.htt-story-card {
    padding:18px; border:1px solid var(--htt-border); border-radius:16px;
    background:#fff9fb;
}
.htt-story-tag { font-size:11px; font-weight:900; letter-spacing:.08em; color:#c43c68; }
.htt-story-card h4 { margin:7px 0; font-size:19px; }
.htt-description { color:var(--htt-muted); line-height:1.65; }
.htt-story-code { padding:9px; background:#fff0f5; border-radius:9px; margin:10px 0 12px; }
.htt-statement-box, .htt-explain-box, .htt-voice-practice {
    margin-top:14px; padding:18px; border:1px solid var(--htt-border);
    border-radius:15px; background:#fff;
}
.htt-statement-box h4, .htt-explain-box h4, .htt-voice-practice h4 { margin:0 0 10px; }
.htt-statement-row { display:flex; flex-wrap:wrap; gap:7px; margin:7px 0; }
.htt-statement-row span {
    padding:7px 9px; border:1px solid var(--htt-border); border-radius:8px;
    background:#fff9fb; font-size:13px; font-weight:700;
}
.htt-explain-box p { color:var(--htt-muted); line-height:1.7; }
.htt-voice-practice > p { color:var(--htt-muted); }
.htt-ch6-target { font-size:34px; font-weight:900; margin:15px 0 5px; color:#8e3151; }
.htt-ch6-hint { color:var(--htt-muted); margin-bottom:10px; }
@media (max-width:800px) { .htt-story-grid { grid-template-columns:1fr; } }

.htt-mnemonic-section { margin-top:16px; padding:17px; border:1px solid var(--htt-border); border-radius:15px; background:#fff; }
.htt-mnemonic-section h4 { margin:0 0 10px; }
.htt-section-note { color:var(--htt-muted); margin-top:-4px; }
.htt-mnemonic-table { display:grid; gap:6px; }
.htt-mnemonic-table > div { display:grid; grid-template-columns:55px 1fr 160px 42px; gap:9px; align-items:center; padding:8px; border-radius:9px; background:#fff9fb; }
.htt-mnemonic-table code { text-align:right; font-weight:800; }
.htt-button.tiny { padding:5px 8px; font-size:12px; min-height:30px; }
.htt-group-cards { display:grid; grid-template-columns:repeat(3,1fr); gap:9px; }
.htt-group-cards article { padding:12px; border:1px solid var(--htt-border); border-radius:11px; background:#fff9fb; }
.htt-group-cards article b { display:block; margin-bottom:5px; }
.htt-group-cards article p { margin:5px 0 8px; color:var(--htt-muted); line-height:1.5; }
.htt-group-cards article code { display:block; font-size:11px; margin-bottom:8px; overflow-wrap:anywhere; }
.htt-row-story p { margin:7px 0; line-height:1.6; }
.htt-ch6-summary { margin-top:14px; padding:13px; background:#fff0f5; border-radius:12px; color:#7e2f4c; }
@media (max-width:800px) {
    .htt-mnemonic-table > div { grid-template-columns:45px 1fr 105px 36px; }
    .htt-group-cards { grid-template-columns:1fr; }
}

/* Independent lesson/chapter pages */
.htt-chapter-page .htt-chapter-nav {
    display:flex; flex-wrap:wrap; gap:6px; margin:0 0 12px; padding:7px;
    border:1px solid var(--htt-border); border-radius:12px; background:#fff;
}
.htt-chapter-page .htt-chapter-nav a {
    text-decoration:none; padding:6px 10px; border-radius:9px; font-size:12px;
    color:#7d4058; background:#fff4f8; border:1px solid #f4dbe6;
}
.htt-chapter-page .htt-chapter-nav a.is-current { background:#f34c7d; color:#fff; border-color:#f34c7d; }
.htt-page-title { margin:0 0 12px; }
.htt-page-title h2 { margin:2px 0 0; }
.htt-chapter-page[data-chapter="1"] .htt-chapter5,
.htt-chapter-page[data-chapter="1"] .htt-chapter6,
.htt-chapter-page[data-chapter="2"] .htt-chapter5,
.htt-chapter-page[data-chapter="2"] .htt-chapter6,
.htt-chapter-page[data-chapter="3"] .htt-chapter5,
.htt-chapter-page[data-chapter="3"] .htt-chapter6,
.htt-chapter-page[data-chapter="4"] .htt-chapter5,
.htt-chapter-page[data-chapter="4"] .htt-chapter6,
.htt-chapter-page[data-chapter="5"] .htt-card,
.htt-chapter-page[data-chapter="5"] .htt-stats,
.htt-chapter-page[data-chapter="5"] .htt-note,
.htt-chapter-page[data-chapter="5"] .htt-mode-tabs,
.htt-chapter-page[data-chapter="5"] .htt-header,
.htt-chapter-page[data-chapter="6"] .htt-card,
.htt-chapter-page[data-chapter="6"] .htt-stats,
.htt-chapter-page[data-chapter="6"] .htt-note,
.htt-chapter-page[data-chapter="6"] .htt-mode-tabs,
.htt-chapter-page[data-chapter="6"] .htt-header,
.htt-chapter-page[data-chapter="5"] .htt-chapter6,
.htt-chapter-page[data-chapter="6"] .htt-chapter5 {
    display:none !important;
}
.htt-chapter-page[data-chapter="1"] .htt-header,
.htt-chapter-page[data-chapter="2"] .htt-header,
.htt-chapter-page[data-chapter="3"] .htt-header,
.htt-chapter-page[data-chapter="4"] .htt-header { display:block; }

.htt-index-page { max-width:900px; margin:24px auto; }
.htt-index-hero { text-align:center; padding:28px 18px 20px; }
.htt-index-hero h2 { margin:7px 0; }
.htt-index-hero p { color:var(--htt-muted); margin:0 auto; max-width:620px; line-height:1.6; }
.htt-index-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.htt-index-card { display:block; text-decoration:none; color:inherit; padding:18px; border:1px solid var(--htt-border); border-radius:16px; background:#fff; transition:transform .15s ease, box-shadow .15s ease; }
.htt-index-card:hover { transform:translateY(-2px); box-shadow:0 8px 24px rgba(0,0,0,.06); }
.htt-index-number { font-size:12px; font-weight:800; color:#e83f78; text-transform:uppercase; letter-spacing:.04em; }
.htt-index-card h3 { margin:7px 0; }
.htt-index-card p { margin:0 0 12px; color:var(--htt-muted); line-height:1.55; }
.htt-index-open { font-weight:800; color:#e83f78; }
.htt-index-note { margin-top:16px; padding:14px 16px; border-radius:13px; background:#fff0f5; color:#7e2f4c; }
@media (max-width:650px) { .htt-index-grid { grid-template-columns:1fr; } }

.htt-ai-assistant { margin-top:18px; padding:17px; border:1px solid var(--htt-border); border-radius:16px; background:#fff; }
.htt-ai-head { display:flex; justify-content:space-between; gap:14px; align-items:flex-start; }
.htt-ai-head h3 { margin:4px 0; }
.htt-ai-head p { margin:0; color:var(--htt-muted); line-height:1.5; }
.htt-ai-status { font-size:11px; padding:5px 8px; border-radius:99px; background:#fff0f5; color:#8c3555; white-space:nowrap; }
.htt-ai-messages { margin-top:12px; max-height:300px; overflow:auto; display:grid; gap:8px; padding:5px; }
.htt-ai-message { max-width:88%; padding:9px 11px; border-radius:12px; line-height:1.55; white-space:pre-wrap; }
.htt-ai-message.assistant { background:#fff4f8; justify-self:start; }
.htt-ai-message.user { background:#f4f4f4; justify-self:end; }
.htt-ai-message.error { color:#9d254d; }
.htt-ai-message.loading { opacity:.7; }
.htt-ai-compose { margin-top:10px; }
.htt-ai-input { width:100%; min-height:58px; resize:vertical; box-sizing:border-box; border:1px solid var(--htt-border); border-radius:10px; padding:9px; font:inherit; }
.htt-ai-actions { display:flex; gap:8px; margin-top:8px; }
@media (max-width:600px) { .htt-ai-head { display:block; } .htt-ai-status { display:inline-block; margin-top:8px; } }

/* Course Index: only six compact chapter cards; individual chapter pages stay out of the site header. */
.htt-index-page { max-width:920px; }
.htt-index-hero { padding:24px 14px 18px; }
.htt-index-hero h2 { font-size:30px; letter-spacing:-.02em; }
.htt-index-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.htt-index-card { position:relative; min-height:165px; padding:20px 20px 18px; border-radius:18px; background:linear-gradient(180deg,#fff 0%,#fff8fb 100%); }
.htt-index-card:after { content:""; position:absolute; top:0; left:0; right:0; height:4px; border-radius:18px 18px 0 0; background:#e84a7a; opacity:.85; }
.htt-index-number { margin-top:2px; font-size:11px; }
.htt-index-card h3 { font-size:20px; color:#3d2430; }
.htt-index-card p { line-height:1.6; min-height:48px; }
.htt-index-open { display:inline-flex; margin-top:3px; color:#d83368; font-weight:800; font-size:13px; }
.htt-index-note { margin-top:16px; padding:12px 15px; border-radius:12px; background:#fff0f5; color:#7e2f4c; text-align:center; }
@media (max-width:650px) { .htt-index-grid { grid-template-columns:1fr; } .htt-index-card { min-height:0; } }

.htt-notes-banner{margin:12px 0 16px;padding:12px 14px;border:1px solid var(--htt-border);border-radius:12px;background:#fff0f5;color:#7e2f4c;line-height:1.55}

.htt-admin-lesson-content h3{margin-top:0}
.htt-admin-lesson-content p{line-height:1.7}
.htt-custom-index-heading{margin:22px 0 8px}
.htt-custom-index-heading h3{margin-bottom:4px}

.htt-voice-assistant h3{margin-top:0}
.htt-voice-status{display:block;margin-top:10px;min-height:1.4em}

.htt-test-panel{max-width:760px;margin:20px auto}
.htt-test-meta{display:flex;gap:18px;flex-wrap:wrap;margin-bottom:20px}
.htt-test-target{font-size:2rem;text-align:center;padding:25px;margin:15px 0;border-radius:12px;background:rgba(0,0,0,.04)}
.htt-test-input{width:100%;font-size:1.3rem;padding:14px;border-radius:10px}
.htt-test-actions{display:flex;gap:10px;margin-top:14px;align-items:center}
.htt-test-feedback{min-height:2em;margin-top:15px}

.htt-key-finder-row{display:flex;gap:10px;max-width:620px;margin-top:10px}
.htt-key-query{flex:1;font-size:1.4rem;padding:13px;border-radius:10px}
.htt-key-result{text-align:center;margin-top:25px;min-height:140px;padding:22px;border-radius:14px;background:rgba(0,0,0,.035)}
.htt-key-big{font-size:4rem;font-weight:700;line-height:1.2}

.htt-key-label{display:block;margin-top:6px;font-size:.85rem;opacity:.8}


/* Chapter 7 language input */
.htt-key-mode{width:100%;max-width:620px;margin:8px 0 10px;padding:11px;border:1px solid var(--htt-border);border-radius:10px;font:inherit;background:#fff}
.htt-key-mode-help{font-size:.9rem;opacity:.8;margin-top:8px}

/* Chapter 8: responsive QWERTY-style Mangal/InScript keyboard */
.htt-virtual-keyboard{display:flex;flex-direction:column;gap:7px;margin-top:16px;overflow-x:auto;padding:8px 2px 12px}
.htt-kb-row{display:flex;gap:6px;min-width:720px}
.htt-kb-key{flex:1;min-width:48px;min-height:70px;border:1px solid var(--htt-border);border-radius:8px;background:linear-gradient(180deg,#fff,#fff6fa);cursor:pointer;padding:6px 4px;font:inherit}
.htt-kb-key:hover,.htt-kb-key:focus{transform:translateY(-1px);box-shadow:0 3px 10px rgba(0,0,0,.08)}
.htt-kb-en{display:block;font-weight:800;font-size:12px;opacity:.7}
.htt-kb-hi{display:block;font-size:24px;font-weight:700;margin-top:6px;color:#3d2430}
.htt-inscript-toggle{display:flex;gap:8px;flex-wrap:wrap}
.htt-inscript-layer.active{box-shadow:0 0 0 2px rgba(216,51,104,.22)}
.htt-inscript-help{margin:12px 0 0}
.htt-inscript-speak{margin-top:14px;padding:10px 12px;border-radius:10px;background:#fff0f5;text-align:center}


.htt-inscript-note{margin:12px 0;padding:12px 14px;border:1px solid #f0bfd2;border-radius:12px;background:#fff7fa;line-height:1.55}
.htt-kb-layers{display:flex;gap:6px;align-items:center;justify-content:center;font-size:18px;font-weight:700}
.htt-kb-normal,.htt-kb-shift{min-width:1.5em;text-align:center}
.htt-kb-shift{opacity:.55}
.htt-kb-key.htt-layer-normal .htt-kb-normal{font-weight:800}
.htt-kb-key.htt-layer-shift .htt-kb-shift{font-weight:800;opacity:1}


/* Chapter 7 only: explicit direction controls and Hindi character picker. */
.htt-key-finder .htt-key-direction-buttons{display:flex;gap:10px;flex-wrap:wrap;margin:0 0 16px}
.htt-key-finder .htt-key-direction.active{font-weight:700}
.htt-key-finder .htt-hindi-palette{margin-top:16px;padding:14px;border:1px solid #f0d7e2;border-radius:12px;background:#fff9fc}
.htt-key-finder .htt-hindi-palette-grid{display:flex;flex-wrap:wrap;gap:7px;margin-top:10px}
.htt-key-finder .htt-hindi-char{min-width:42px;min-height:42px;padding:7px 10px;border:1px solid #e7bfd1;border-radius:9px;background:#fff;color:inherit;font-size:20px;cursor:pointer}
.htt-key-finder .htt-hindi-char:hover,.htt-key-finder .htt-hindi-char:focus{transform:translateY(-1px);box-shadow:0 2px 8px rgba(0,0,0,.08)}

/* v0.9.5: Kruti Dev Chapter 7/8 focused fixes only. */
.htt-kruti-note{margin:12px 0;padding:12px 14px;border:1px solid #f0bfd2;border-radius:12px;background:#fff7fa;line-height:1.55}
.htt-keyboard-focus-help{margin:10px 0 0;text-align:center;color:var(--htt-muted)}
.htt-kb-space{min-height:44px;border:1px solid var(--htt-border);border-radius:8px;background:#fff;cursor:pointer;font:inherit;font-weight:700}
.htt-special-key-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:9px;margin-top:12px}
.htt-special-key{position:relative;text-align:left;min-height:90px;padding:10px;border:1px solid var(--htt-border);border-radius:10px;background:#fff8fb;cursor:pointer;font:inherit}
.htt-special-key:hover,.htt-special-key:focus{transform:translateY(-1px);box-shadow:0 3px 10px rgba(0,0,0,.08)}
.htt-special-key strong{display:block;font-size:23px}
.htt-special-key span,.htt-special-key small{display:block;margin-top:3px}
.htt-special-key small{color:var(--htt-muted)}
.htt-special-key em{position:absolute;right:9px;bottom:8px;font-style:normal}
.htt-special-help{margin-top:12px;color:var(--htt-muted);font-size:13px}
.htt-key-notice{padding:14px;border-radius:12px;background:#fff7fa;border:1px solid #f0bfd2;line-height:1.6}
