:root {
    --primary-teal: #0c4d4d;
    --button-gold: #d49a3b;
    --button-gold-hover: #e5ab4f;
    --button-gold-active: #b5802e;
    --exit-btn-color: rgba(255, 255, 255, 0.12);
    --exit-btn-hover: rgba(255, 255, 255, 0.2);
    --counter-teal: #a2cbcb;
    --white: #ffffff;
    --gold-glow: 0 0 15px rgba(212, 154, 59, 0.6);
    --disabled-gray: rgba(255, 255, 255, 0.15);
    --disabled-text: rgba(255, 255, 255, 0.3);
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #073636 0%, #0d5454 50%, #083c3c 100%);
    color: var(--white);
    margin: 0;
    padding: 40px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
}

.app-wrapper {
    width: 100%;
    max-width: 600px;
    text-align: center;
    box-sizing: border-box;
}

h1 {
    color: var(--button-gold);
    margin-top: 0;
    margin-bottom: 30px;
    font-size: 36px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.status-banner {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 15px;
    border-radius: 12px;
    font-size: 15px;
    color: #b3dfdf;
    margin-bottom: 30px;
    display: inline-block;
    width: 100%;
    box-sizing: border-box;
    font-weight: 500;
}

.menu-action-layout, .quiz-options, .navigation-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 25px;
}

.segmented-slider-container {
    display: flex;
    position: relative;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 4px;
    border-radius: 12px;
    margin: 25px auto 15px auto;
    max-width: 480px;
    user-select: none;
}

.segment-option {
    flex: 1;
    text-align: center;
    padding: 14px 0;
    font-size: 14px;
    font-weight: bold;
    color: var(--counter-teal);
    cursor: pointer;
    z-index: 2;
    transition: color 0.25s ease;
}

.segment-option.active {
    color: #1a1002;
}

.slider-pill {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(33.333% - 4px);
    height: calc(100% - 8px);
    background: var(--button-gold);
    border-radius: 9px;
    z-index: 1;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.range-drawer-panel {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid transparent;
    padding: 0 15px;
    max-width: 480px;
    margin: 0 auto;
    box-sizing: border-box;
}

.range-drawer-panel.open {
    max-height: 120px;
    opacity: 1;
    margin-top: 15px;
    border-color: rgba(255, 255, 255, 0.1);
    padding: 15px;
}

.range-flex-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-weight: bold;
    color: var(--counter-teal);
}

.range-flex-row input {
    width: 85px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 8px;
    color: #ffffff;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    outline: none;
}

.range-flex-row input:focus {
    border-color: var(--button-gold);
}

.custom-input-field-group {
    display: flex;
    gap: 10px;
    max-width: 480px;
    margin: 15px auto 0 auto;
    width: 100%;
}

.custom-text-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 14px 16px;
    color: var(--white);
    font-size: 15px;
    outline: none;
    box-sizing: border-box;
}

.custom-text-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.custom-text-input:disabled {
    background: var(--disabled-gray);
    color: var(--disabled-text);
    cursor: not-allowed;
    border-color: transparent;
}

.custom-select-menu {
    width: 100%;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 14px;
    color: var(--white);
    font-size: 15px;
    font-weight: 600;
    outline: none;
    margin: 25px auto 5px auto;
    cursor: pointer;
    box-sizing: border-box;
}

.custom-select-menu option {
    background: #073636;
    color: var(--white);
}

.custom-select-menu option:disabled {
    color: rgba(255, 255, 255, 0.25);
    background: #052626;
}

button {
    background-color: var(--button-gold);
    color: #1a1002;
    border: none;
    padding: 16px 24px;
    font-size: 16px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

button:hover:not(:disabled) {
    background-color: var(--button-gold-hover);
    transform: translateY(-3px);
    box-shadow: var(--gold-glow), 0 6px 15px rgba(0,0,0,0.3);
}

button:active:not(:disabled) {
    background-color: var(--button-gold-active);
    transform: translateY(-1px);
}

button:disabled {
    background-color: var(--disabled-gray);
    color: var(--disabled-text);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

button.exit-btn {
    background-color: var(--exit-btn-color);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 500;
}

button.exit-btn:hover {
    background-color: var(--exit-btn-hover);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}
.display-card-frame {
    background: #ffffff;
    border-radius: 12px;
    padding: 35px 25px;
    margin: 25px 0;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #1e2d2d;
    border: 3px solid var(--button-gold);
    box-shadow: var(--gold-glow), 0 10px 30px rgba(0,0,0,0.3);
    cursor: pointer;
    position: relative;
}

.card-eye-toggle-overlay {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7f8c8d;
    transition: color 0.2s, transform 0.1s;
    z-index: 10;
}

.card-eye-toggle-overlay:hover {
    color: #0c4d4d;
    transform: scale(1.1);
}

.card-eye-toggle-overlay.visible-state {
    color: var(--button-gold);
}

.card-eye-toggle-overlay .eye-slash-path {
    display: block;
}
.card-eye-toggle-overlay.visible-state .eye-slash-path {
    display: none;
}

.counter-label-text {
    font-size: 13px;
    color: var(--counter-teal);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
}

.arabic-text-render {
    font-size: clamp(32px, 8vw, 52px);
    font-family: var(--arabic-font);
    font-weight: 600;
    line-height: 1.8;
    max-width: 100%;
    overflow-wrap: anywhere;
    direction: rtl;
    margin: 15px 0;
    color: #0c4d4d;
}

.meaning-text-render {
    font-size: 28px;
    font-weight: 600;
    color: #2c3e50;
    margin-top: 10px;
    border-top: 2px dashed #e2e8f0;
    padding-top: 20px;
    width: 100%;
}

.quiz-options button {
    background-color: #ffffff;
    color: #1e2d2d;
    text-align: center;
    border: 2px solid #cbd5e1;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.quiz-options button:hover {
    background-color: #ffffff;
    border-color: var(--button-gold);
    transform: translateY(-3px);
    box-shadow: var(--gold-glow), 0 6px 15px rgba(0,0,0,0.15);
}

.quiz-options button.correct-choice {
    background-color: #10b981 !important;
    color: white !important;
    border-color: #10b981 !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4) !important;
}

.quiz-options button.wrong-choice {
    background-color: #ef4444 !important;
    color: white !important;
    border-color: #ef4444 !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4) !important;
}

#screenshot-target-scorecard {
    background: #ffffff;
    color: #073636;
    padding: 35px 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 3px solid var(--button-gold);
    box-shadow: var(--gold-glow), 0 10px 25px rgba(0,0,0,0.2);
}

.summary-metric-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: #0d5454;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    border: 4px solid var(--button-gold);
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

.summary-score-big {
    font-size: 34px;
    font-weight: bold;
}

.summary-percent-small {
    font-size: 16px;
    opacity: 0.9;
    margin-top: 1px;
    font-weight: 600;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: #ffffff;
    color: #1e2d2d;
    border-radius: 10px;
    overflow: hidden;
    font-size: 14px;
    border: 1px solid #e2e8f0;
}

.summary-table th, .summary-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #e2e8f0;
    text-align: center;
    vertical-align: middle;
}

.summary-table th {
    background-color: #f1f5f9;
    color: #0f172a;
    font-weight: bold;
}

.large-bold-cell {
    font-size: 22px;
    font-weight: bold;
    font-style: normal !important;
}

.large-arabic-cell {
    font-family: var(--arabic-font);
    line-height: 1.8;
    color: #0d5454;
}

.small-choice-cell {
    font-size: 13px;
    color: #475569;
}

.classic-indicator-pass {
    font-size: 24px; 
    font-weight: bold;
    color: #10b981;
    font-style: normal !important;
    display: table-cell;
}

.classic-indicator-fail {
    font-size: 24px;
    font-weight: bold;
    color: #ef4444;
    font-style: normal !important;
    display: table-cell;
}

.summary-table th:nth-child(-n+2),
.summary-table td:nth-child(-n+2) { white-space:nowrap; direction:ltr; }

.hidden { display: none !important; }

.toast-popup {
    position: fixed;
    bottom: 30px;
    background: var(--button-gold);
    color: #1a1002;
    padding: 14px 30px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 2500;
    box-shadow: var(--gold-glow), 0 4px 15px rgba(0,0,0,0.3);
}
.toast-popup.show { opacity: 1; }

/* Dictionary Mode: isolated styles so existing quiz/review screens remain unchanged */
#dictionary-view { text-align:left; }
.dictionary-sort { display:flex; position:relative; gap:0; padding:4px; margin:18px 0 12px; border-radius:12px; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.15); user-select:none; }
.dictionary-sort-pill { position:absolute; top:4px; bottom:4px; left:4px; width:calc(25% - 2px); border-radius:9px; background:var(--button-gold); box-shadow:0 2px 8px rgba(0,0,0,.2); transition:transform .25s cubic-bezier(.4,0,.2,1); z-index:1; pointer-events:none; }
.dictionary-sort > button { position:relative; z-index:2; flex:1; min-width:0; padding:11px 4px; font-size:15px; color:var(--counter-teal); background:transparent; box-shadow:none; transform:none; }
.dictionary-sort > button:hover:not(:disabled) { background:transparent; box-shadow:none; transform:none; }
.dictionary-sort > button.active { color:#1a1002; }
.dictionary-layout { position:relative; }
.dictionary-list { background:#fff; color:#1e2d2d; border-radius:18px; height:min(66vh,720px); min-height:330px; overflow-y:auto; overflow-x:hidden; scrollbar-width:none; -ms-overflow-style:none; overscroll-behavior:contain; padding:10px 47px 10px 12px; box-sizing:border-box; scroll-behavior:auto; }
.dictionary-list::-webkit-scrollbar { display:none; }
.dictionary-entry { display:grid; grid-template-columns:minmax(0,max-content) 12px minmax(0,max-content); justify-content:center; gap:10px; align-items:center; padding:12px 5px; border-bottom:1px solid #e2e8f0; min-height:64px; box-sizing:border-box; }
.dictionary-entry:last-child, .dictionary-entry.before-ten-divider { border-bottom:0; }
.dictionary-word { grid-column:3; grid-row:1; color:#0c4d4d; font-family:var(--arabic-font); font-size:24px; font-weight:600; line-height:1.8; text-align:left; overflow-wrap:anywhere; direction:rtl; }
.dictionary-meaning { grid-column:1; grid-row:1; color:#263746; font-size:17px; font-weight:600; text-align:right; overflow-wrap:anywhere; }
.dictionary-ten-divider { display:flex; align-items:center; gap:8px; color:#9aa5a5; font-size:10px; font-weight:400; padding:5px 5px; background:transparent; margin:1px 0; }
.dictionary-ten-divider:before,.dictionary-ten-divider:after { content:''; height:1px; flex:1; background:#e2e8e8; }
.dictionary-diamond { grid-column:2; grid-row:1; justify-self:center; width:6px; height:6px; background:var(--button-gold); transform:rotate(45deg); opacity:.9; }
.dictionary-jump { position:absolute; right:1px; top:8px; bottom:8px; width:43px; display:grid; grid-template-rows:repeat(var(--dictionary-jump-count, 1),minmax(0,1fr)); justify-items:center; min-height:0; overflow:hidden; z-index:5; touch-action:none; user-select:none; cursor:ns-resize; }
.dictionary-jump-track { position:absolute; inset:0; width:5px; left:17px; border-radius:5px; background:rgba(255,255,255,.45); }
.dictionary-jump button { position:relative; z-index:1; padding:0; width:41px; height:100%; min-height:0; box-sizing:border-box; border-radius:18px; background:transparent; color:#d7eeee; box-shadow:none; font-size:clamp(8px,calc(48vh / var(--dictionary-jump-count, 1)),11px); line-height:1; touch-action:none; }
.dictionary-jump button:hover:not(:disabled) { transform:none; box-shadow:none; background:rgba(255,255,255,.12); }
.dictionary-jump button.active { background:var(--button-gold); color:#fff; font-size:clamp(9px,calc(54vh / var(--dictionary-jump-count, 1)),14px); min-height:0; box-shadow:0 2px 7px rgba(0,0,0,.22); }
.dictionary-empty { padding:30px 10px; text-align:center; color:#64748b; }
.dictionary-footer { display:flex; justify-content:space-between; gap:10px; align-items:center; color:#c6e3e3; font-size:12px; margin:8px 4px 0; }
#app-title.dictionary-title { font-size:28px; margin-bottom:20px; letter-spacing:0; }
@media(max-width:420px) { .dictionary-list { padding-left:8px; padding-right:43px; } .dictionary-entry { gap:6px; padding:10px 2px; grid-template-columns:minmax(0,max-content) 9px minmax(0,max-content); } .dictionary-word { font-size:22px; } .dictionary-meaning { font-size:15px; } .dictionary-jump { width:39px; } .dictionary-jump-track { left:17px; } .dictionary-jump button { width:37px; font-size:10px; } #app-title.dictionary-title { font-size:26px; } }

/* Peaches: Urdu book content and verification status. */
[data-book="book_b"] .dictionary-meaning,
[data-book="book_b"] .meaning-text-render,
[data-book="book_b"] .quiz-options button,
[data-book="book_b"] .summary-table td:nth-child(n+4) {
    direction: rtl; text-align: right; font-family: 'Noto Nastaliq Urdu', 'Noto Naskh Arabic', 'Segoe UI', serif;
    line-height: 2; overflow-wrap: anywhere;
}
[data-book="book_b"] .meaning-text-render { white-space: normal; }
.dictionary-entry.unverified { opacity: .62; background: #f1f3f5; }
[data-book="book_b"] .dictionary-word { overflow-wrap: anywhere; min-width: 0; }

/* Larger Urdu meanings across Book B student screens. */
[data-book="book_b"] .quiz-options button { font-size: 22px; text-align: center; }
[data-book="book_b"] .meaning-text-render { font-size: 32px; text-align: center; }
[data-book="book_b"] .dictionary-meaning { font-size: 23px; }
[data-book="book_b"] .summary-table .large-bold-cell:nth-child(n+4) { font-size: 26px; }
[data-book="book_b"] .summary-table .small-choice-cell { font-size: 22px; }
@media (max-width: 420px) {
    [data-book="book_b"] .dictionary-meaning { font-size: 21px; }
}

/* The keyboard button expands into a native-input search field. */
.dictionary-sort { --dictionary-control-size:50px; gap:6px; align-items:center; }
.dictionary-sort-pill { display:none; }
.dictionary-sort > button { height:var(--dictionary-control-size); border-radius:10px; transition:flex .25s ease,background-color .2s,color .25s,box-shadow .2s; }
.dictionary-sort > button.active { background:var(--button-gold); box-shadow:0 2px 8px rgba(0,0,0,.2); }
.dictionary-search-control { position:relative; flex:0 0 var(--dictionary-control-size); min-width:0; height:var(--dictionary-control-size); box-sizing:border-box; border-radius:10px; transition:flex .28s ease,background .2s ease; }
.dictionary-search-control .dictionary-search-toggle { position:absolute; left:0; top:0; width:var(--dictionary-control-size); height:var(--dictionary-control-size); padding:0; font-size:25px; border-radius:10px; background:transparent; color:var(--counter-teal); box-shadow:none; line-height:1; box-sizing:border-box; }
.dictionary-search { visibility:hidden; display:block; width:100%; height:var(--dictionary-control-size); min-width:0; margin:0; padding:6px 12px 6px 38px; box-sizing:border-box; font-size:16px; opacity:0; transition:opacity .2s ease; }
.dictionary-search[dir="rtl"] { font-family:var(--arabic-font); }
.search-open > button { flex:0 0 var(--dictionary-control-size); font-size:11px; padding:0 1px; }
.search-open .dictionary-search-control { flex:1 1 0%; }
.search-open .dictionary-search { visibility:visible; opacity:1; }
.search-open .dictionary-search-toggle { background:var(--button-gold); color:#1a1002; box-shadow:0 2px 8px rgba(0,0,0,.2); width:36px; font-size:22px; border-radius:8px 0 0 8px; }
.dictionary-search:focus { border-color:var(--button-gold); outline:none; }
.dictionary-sort > button:hover:not(:disabled) { background:var(--button-gold-hover); color:#1a1002; transform:none; box-shadow:none; }
.dictionary-sort > button:active:not(:disabled) { background:var(--button-gold-active); transform:none; }
.dictionary-search-control .dictionary-search-toggle:hover:not(:disabled) { background:var(--button-gold-hover); color:#1a1002; transform:none; box-shadow:none; }
.dictionary-search-control .dictionary-search-toggle:active:not(:disabled) { background:var(--button-gold-active); transform:none; }
.dictionary-list.search-results { padding-right:12px; }
@media(max-width:420px) { .dictionary-sort { gap:4px; } .search-open > button { flex-basis:var(--dictionary-control-size); font-size:10px; } .dictionary-search-control { flex-basis:var(--dictionary-control-size); } .dictionary-search-control .dictionary-search-toggle { width:var(--dictionary-control-size); } .search-open .dictionary-search-toggle { width:32px; } .dictionary-search { padding-left:33px; } }
@media(prefers-reduced-motion:reduce) { .dictionary-sort > button,.dictionary-search-control,.dictionary-search { transition:none; } }

/* Toolbar highlighting changes color only; never lifts or scales controls. */
#dictionary-toolbar button,#dictionary-toolbar button:hover,#dictionary-toolbar button:active { transform:none !important; box-sizing:border-box; }
