/* Language Tutor (Story 2463) -- three pages: the project list, one project
   and its lessons, and one lesson with its quiz. Phone-first; shares the
   Library "qm-" look so the shelf reads as one system. */

:root {
    --lt-ink:    #1d2330;
    --lt-muted:  #6b7280;
    --lt-line:   #e6e8ef;
    --lt-bg:     #f4f5f9;
    --lt-card:   #ffffff;
    --lt-accent: #1f7a5c;
    --lt-accent-soft: #e3f3ec;
    --lt-gold:   #f0a500;
    --lt-danger: #c2384a;
    --lt-wait:   #b45309;
}

* { box-sizing: border-box; }

body {
    background: var(--lt-bg);
    color: var(--lt-ink);
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Fixed-viewport shell: the Leonardo menu band + page header stay pinned;
   only .lt-body scrolls. 100dvh after 100vh so the phone's URL bar does not
   push the band off screen. */
.lt-shell { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }

/* ---- header (recognized .lw-nav marker so the icon band attaches) ------- */
.lt-top { background: #1e3d33; color: #fff; flex: 0 0 auto; }
.lw-nav { min-height: 6px; }
.lt-title { display: flex; align-items: center; gap: 10px; padding: 8px 12px 4px; }
.lt-title h1 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: .2px; word-break: break-word; }
.lt-title .sub { font-size: 12px; color: #bfe3d3; margin-top: 2px; }
/* The Print control lives inside .lw-nav so quick-launch.js finds it and
   relocates it into the Leonardo Main Menu Tool Bar Strip. It is only
   visible for the instant before the band is injected. */
.lt-top .lw-nav > button {
    font: inherit; font-size: 12px; margin: 4px 0 0 10px;
    background: transparent; color: #bfe3d3; cursor: pointer;
    border: 1px solid rgba(255,255,255,.28); border-radius: 999px; padding: 2px 10px;
}
.lt-stats { display: flex; gap: 0; padding: 4px 8px 8px; }
.lt-stat {
    flex: 1 1 0; min-width: 56px; text-align: center;
    padding: 3px 2px; border-right: 1px solid rgba(255,255,255,.16);
}
.lt-stat:last-child { border-right: none; }
.lt-stat .n { font-size: 16px; font-weight: 700; display: block; line-height: 1.1; }
.lt-stat .l { font-size: 9px; text-transform: uppercase; letter-spacing: .5px; color: #bfe3d3; }

/* ---- buttons ------------------------------------------------------------ */
.lt-actions {
    display: flex; gap: 7px; padding: 9px 10px; flex-wrap: wrap;
    background: #fff; border-bottom: 1px solid var(--lt-line); flex: 0 0 auto;
}
.lt-btn {
    font: inherit; font-size: 13px; font-weight: 600;
    border: 1px solid var(--lt-line); border-radius: 999px;
    background: #fff; color: var(--lt-ink);
    padding: 8px 13px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    transition: background .12s, border-color .12s, transform .05s;
    text-decoration: none;
}
.lt-btn:hover { background: #eef7f3; border-color: #bfe3d3; }
.lt-btn:active { transform: scale(.97); }
.lt-btn:disabled { opacity: .55; cursor: default; }
.lt-btn.primary { background: var(--lt-accent); border-color: var(--lt-accent); color: #fff; }
.lt-btn.primary:hover { background: #17604a; }
.lt-btn.danger { color: var(--lt-danger); }
.lt-btn .ic { font-size: 15px; line-height: 1; }

/* ---- body / cards ------------------------------------------------------- */
.lt-body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 10px 90px; }

.lt-card {
    background: var(--lt-card);
    border: 1px solid var(--lt-line);
    border-left: 4px solid var(--lt-accent);
    border-radius: 10px;
    padding: 12px 14px 10px;
    margin: 0 0 9px;
    box-shadow: 0 1px 2px rgba(20,20,50,.04);
}
.lt-card.tap { cursor: pointer; }
.lt-card.waiting { border-left-color: var(--lt-wait); }
.lt-card.archived { opacity: .6; }
.lt-card .t { font-size: 17px; font-weight: 700; color: var(--lt-accent); word-break: break-word; }
.lt-card.waiting .t { color: var(--lt-wait); }
.lt-card .s { font-size: 13px; color: #3a3f4b; margin-top: 2px; }
.lt-card .preview {
    font-family: Georgia, "Times New Roman", serif; font-size: 14.5px; line-height: 1.5; color: #20242e;
    margin-top: 8px; white-space: pre-wrap; word-break: break-word;
}
.lt-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.lt-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; background: var(--lt-accent-soft); color: var(--lt-accent); padding: 2px 8px; border-radius: 999px; }
.lt-tag.wait { background: #fef3c7; color: var(--lt-wait); }
.lt-tag.score { background: #fff4d6; color: #8a5b00; }
.lt-tag.plain { background: #f0f1f5; color: var(--lt-muted); }
.lt-cardactions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px; padding-top: 6px; border-top: 1px dashed #eef0f6; }
.lt-icobtn {
    border: none; background: transparent; cursor: pointer;
    font-size: 19px; line-height: 1; padding: 8px 11px; border-radius: 8px; color: var(--lt-muted);
    min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center;
}
.lt-icobtn:hover { background: #eef7f3; }
.lt-icobtn.del:hover { background: #fdecef; color: var(--lt-danger); }

.lt-empty { text-align: center; color: var(--lt-muted); padding: 40px 20px 20px; font-size: 14px; }
.lt-loadmore { display: flex; justify-content: center; padding: 6px 0 14px; }

/* ---- floating add ------------------------------------------------------- */
.lt-fab {
    position: fixed; right: 18px; bottom: 22px; z-index: 60;
    width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
    background: var(--lt-accent); color: #fff; font-size: 28px; line-height: 1;
    box-shadow: 0 6px 18px rgba(31,122,92,.45);
}
.lt-fab:active { transform: scale(.94); }

/* ---- modal -------------------------------------------------------------- */
.lt-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(20,18,40,.55); display: none; align-items: flex-end; justify-content: center; }
.lt-overlay.show { display: flex; }
.lt-modal { background: #fff; width: 100%; max-width: 620px; max-height: 92vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 16px 16px 22px; box-shadow: 0 -8px 30px rgba(0,0,0,.25); }
@media (min-width: 640px) { .lt-overlay { align-items: center; } .lt-modal { border-radius: 16px; } }
.lt-modal h2 { margin: 2px 0 12px; font-size: 17px; display: flex; align-items: center; gap: 8px; }

.lt-field { margin-top: 12px; }
.lt-field:first-of-type { margin-top: 4px; }
.lt-field label { display: block; font-size: 12px; font-weight: 600; color: var(--lt-muted); margin-bottom: 5px; }
.lt-field input[type=text], .lt-field textarea {
    width: 100%; box-sizing: border-box;
    padding: 11px 12px; font: inherit; font-size: 15px;
    border: 1px solid var(--lt-line); border-radius: 10px; outline: none; background: #fff;
}
.lt-field textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.lt-field input:focus, .lt-field textarea:focus { border-color: var(--lt-accent); box-shadow: 0 0 0 3px rgba(31,122,92,.15); }
.lt-field .hint { font-size: 11px; color: var(--lt-muted); margin-top: 4px; }
.lt-field .voice-mic-wrap { display: block; width: 100%; }
.lt-warn { display: none; margin-top: 10px; padding: 10px 12px; background: #fff5e0; border: 1px solid #f0d28a; border-radius: 10px; font-size: 13px; color: #8a5b00; }
.lt-warn.show { display: block; }
.lt-modal-btns { display: flex; gap: 8px; margin-top: 16px; }
.lt-modal-btns .lt-btn { flex: 1; justify-content: center; padding: 11px; }

/* level stepper: a number with minus / plus, never a native select */
.lt-level { display: flex; align-items: center; gap: 10px; }
.lt-level button { font: inherit; font-size: 20px; font-weight: 700; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--lt-line); background: #fff; cursor: pointer; }
.lt-level .val { font-size: 15px; font-weight: 700; min-width: 2em; text-align: center; }
.lt-level .lab { font-size: 13px; color: var(--lt-muted); }

/* ---- lesson page -------------------------------------------------------- */
.lt-section { background: #fff; border: 1px solid var(--lt-line); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.lt-section-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; user-select: none; background: #f6fbf8; }
.lt-section-h .chev { transition: transform .15s; color: var(--lt-accent); font-size: 12px; }
.lt-section.open .lt-section-h .chev { transform: rotate(90deg); }
.lt-section-h .t { font-size: 14px; font-weight: 800; color: var(--lt-accent); }
.lt-section-h .c { margin-left: auto; font-size: 11px; color: var(--lt-muted); background: var(--lt-accent-soft); padding: 1px 9px; border-radius: 999px; }
.lt-section-body { display: none; padding: 10px 14px 12px; }
.lt-section.open .lt-section-body { display: block; }

.lt-passage {
    font-family: Georgia, "Times New Roman", serif; font-size: 17px; line-height: 1.65; color: #20242e;
    white-space: pre-wrap; word-break: break-word;
}
.lt-passage .w { border-bottom: 2px dotted #7fc8ad; cursor: pointer; }
.lt-passage .w.on { background: var(--lt-accent-soft); }
.lt-translation { font-size: 15px; line-height: 1.55; color: #3a3f4b; white-space: pre-wrap; margin-top: 10px; padding-top: 10px; border-top: 1px dashed #dfe3ea; }
.lt-summary { font-size: 14px; color: #3a3f4b; line-height: 1.5; }
.lt-gloss { display: none; margin-top: 10px; padding: 10px 12px; background: var(--lt-accent-soft); border-radius: 10px; font-size: 14px; }
.lt-gloss.show { display: block; }
.lt-gloss .term { font-weight: 800; color: var(--lt-accent); }

.lt-word { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0f1f5; align-items: baseline; }
.lt-word:last-child { border-bottom: none; }
.lt-word .term { font-weight: 800; color: var(--lt-accent); min-width: 34%; word-break: break-word; }
.lt-word .tr { flex: 1; }
.lt-word .pos { font-size: 11px; color: var(--lt-muted); font-style: italic; }
.lt-word .note { display: block; font-size: 12px; color: var(--lt-muted); margin-top: 2px; }

.lt-point { padding: 8px 0; border-bottom: 1px solid #f0f1f5; }
.lt-point:last-child { border-bottom: none; }
.lt-point .pt { font-weight: 800; color: var(--lt-accent); }
.lt-point .ex { font-family: Georgia, serif; font-size: 14.5px; color: #20242e; margin-top: 4px; white-space: pre-wrap; }
.lt-point .exp { font-size: 14px; line-height: 1.5; color: #3a3f4b; margin-top: 4px; white-space: pre-wrap; }

/* quiz */
.lt-q { padding: 10px 0 12px; border-bottom: 1px solid #f0f1f5; }
.lt-q:last-child { border-bottom: none; }
.lt-q .qt { font-weight: 700; margin-bottom: 8px; line-height: 1.4; }
.lt-q .qn { font-size: 11px; color: var(--lt-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.lt-opt {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; margin-bottom: 6px; border: 1px solid var(--lt-line); border-radius: 10px;
    cursor: pointer; font-size: 15px; background: #fff;
}
.lt-opt input { width: 20px; height: 20px; margin: 0; }
.lt-opt.picked { border-color: var(--lt-accent); background: var(--lt-accent-soft); }
.lt-opt.right { border-color: var(--lt-accent); background: #dff5ea; }
.lt-opt.wrong { border-color: var(--lt-danger); background: #fdecef; }
.lt-q input[type=text] {
    width: 100%; box-sizing: border-box; padding: 11px 12px; font: inherit; font-size: 15px;
    border: 1px solid var(--lt-line); border-radius: 10px; outline: none;
}
.lt-q input[type=text]:focus { border-color: var(--lt-accent); box-shadow: 0 0 0 3px rgba(31,122,92,.15); }
.lt-q .voice-mic-wrap { display: block; width: 100%; }
.lt-mark { margin-top: 8px; font-size: 13px; padding: 8px 10px; border-radius: 8px; }
.lt-mark.right { background: #dff5ea; color: #145c43; }
.lt-mark.wrong { background: #fdecef; color: #8a1f2d; }
.lt-result { text-align: center; padding: 14px 8px 6px; }
.lt-result .big { font-size: 34px; font-weight: 800; color: var(--lt-accent); }
.lt-result .l { font-size: 13px; color: var(--lt-muted); }
.lt-attempt { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0f1f5; font-size: 14px; }
.lt-attempt:last-child { border-bottom: none; }
.lt-attempt .d { color: var(--lt-muted); }
.lt-attempt .sc { margin-left: auto; font-weight: 700; color: var(--lt-accent); }

/* ---- folds (Story 5757): the summary banner and every project card ------ */
.lt-fold-head { cursor: pointer; user-select: none; }
.lt-fold-head .chev { color: #bfe3d3; font-size: 12px; transition: transform .15s; display: inline-block; }
.lt-fold-head[aria-expanded="true"] .chev { transform: rotate(90deg); }
.lt-top.stats-folded .lt-stats { display: none; }
.lt-btn[hidden] { display: none; }
.lt-card-h { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.lt-card-h .chev { color: var(--lt-accent); font-size: 12px; transition: transform .15s; display: inline-block; }
.lt-card:not(.collapsed) .lt-card-h .chev { transform: rotate(90deg); }
.lt-card-h a.t { text-decoration: none; }
.lt-card-h a.t:hover { text-decoration: underline; }
.lt-card.collapsed { padding-bottom: 12px; }
.lt-card.collapsed .lt-card-b { display: none; }

.lt-statusbar { background: #1b2621; color: #aeb4c2; padding: 5px 12px; font-size: 11px; flex: 0 0 auto; }
