/* Тарих кабинеті: жоғарыда кезеңдер (сынып бойынша), төменде сабақ жоспары (сол жақ) мен таңдалған бөлім (оң жақ). */
.th-page { background: #fbf6ec; display: grid; grid-template-rows: auto auto 1fr; height: 100vh; overflow: hidden; }

/* Кезеңдер жолағы */
.th-periods { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--line); }
.th-periods button { font: inherit; text-align: left; display: grid; gap: 1px; padding: 8px 12px; border-radius: 14px; border: 2px solid color-mix(in srgb, var(--pc) 30%, #fff); background: color-mix(in srgb, var(--pc) 6%, #fff); color: #3b2a14; cursor: pointer; min-height: 64px; }
.th-periods small { font-size: 12px; font-weight: 800; color: var(--pc); text-transform: uppercase; letter-spacing: .03em; }
.th-periods b { font-size: 15px; line-height: 1.2; }
.th-periods b .ic { color: var(--pc); margin-right: 2px; }
.th-periods button[aria-pressed="true"] b .ic { color: #fff; }
.th-periods span { font-size: 12px; color: var(--muted); }
.th-periods button[aria-pressed="true"] { background: var(--pc); border-color: var(--pc); color: #fff; }
.th-periods button[aria-pressed="true"] small, .th-periods button[aria-pressed="true"] span { color: rgba(255,255,255,.85); }

/* Сабақ: жоспар + көрініс */
.th-main { min-height: 0; padding: 12px 14px; }
.th-lesson { height: 100%; display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 14px; }
.th-plan { overflow-y: auto; background: #fff; border: 1px solid #ead9b8; border-radius: 18px; padding: 12px; display: grid; gap: 4px; align-content: start; }
.th-plan-head { padding: 4px 6px 8px; border-bottom: 3px solid var(--pc); margin-bottom: 6px; }
.th-plan-head small { font-weight: 800; color: var(--pc); font-size: 12px; text-transform: uppercase; }
.th-plan-head h2 { font-size: 19px; color: #3b2a14; margin-top: 2px; }
.th-plan h3 { display: flex; justify-content: space-between; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin: 10px 6px 2px; }
.th-plan h3 i { font-style: normal; color: var(--pc); }
.th-plan button { font: inherit; text-align: left; display: grid; gap: 1px; padding: 8px 10px; border-radius: 10px; border: 0; background: transparent; color: #3b2a14; cursor: pointer; font-size: 14.5px; font-weight: 600; }
.th-plan button .ic { color: var(--pc); margin-right: 4px; }
.th-plan button small { font-size: 12px; color: var(--muted); font-weight: 600; }
.th-plan button:hover { background: #fdf6ea; }
.th-plan button[aria-pressed="true"] { background: color-mix(in srgb, var(--pc) 14%, #fff); box-shadow: inset 4px 0 0 var(--pc); }

.th-view { min-height: 0; display: grid; grid-template-rows: 1fr auto; background: #fff; border: 1px solid #ead9b8; border-radius: 18px; overflow: hidden; }
.th-body { overflow-y: auto; padding: 26px 30px; font-size: clamp(15px, 1.05vw, 21px); position: relative; }
.th-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-top: 1px solid #f1e6cf; background: #fffcf6; }
.th-nav .btn { padding: 12px 22px; }
.th-nav .btn.primary { background: var(--pc); border-color: var(--pc); }
.th-nav b { color: var(--muted); font-size: 14px; }

/* Мазмұн */
.th-body h1 { font-size: 2em; color: #3b2a14; line-height: 1.15; margin: .15em 0 .3em; }
.th-body h3 { font-size: .85em; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 1.2em 0 .5em; }
.th-text { font-size: 1.3em; line-height: 1.5; color: #3b2a14; margin: 0 0 .9em; max-width: 46em; }
.th-grade, .th-date { display: inline-block; font-size: .85em; font-weight: 800; color: var(--pc); background: color-mix(in srgb, var(--pc) 12%, #fff); padding: .25em .8em; border-radius: 999px; }
.th-intro > p { font-size: 1.35em; line-height: 1.55; color: #3b2a14; max-width: 46em; }
.th-mini-line { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 4px solid color-mix(in srgb, var(--pc) 35%, #fff); display: grid; gap: 6px; }
.th-mini-line button { font: inherit; display: flex; gap: 14px; align-items: baseline; width: 100%; text-align: left; padding: 8px 12px; border-radius: 12px; border: 1px solid #f1e6cf; background: #fffcf6; cursor: pointer; color: #3b2a14; position: relative; }
.th-mini-line button::before { content: ""; position: absolute; left: -29px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: var(--pc); border: 3px solid #fff; }
.th-mini-line span { min-width: 10em; font-weight: 800; color: var(--pc); font-size: .9em; }
.th-mini-line b { font-size: 1.05em; }
.th-card-top { display: flex; gap: 20px; align-items: center; margin-bottom: .6em; }
/* Иконкалар (icons.js, Lucide): мәтінмен бірге — жол биіктігінде, үлкені — кезең түсіндегі шеңберде */
.ic { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }
.th-ico { flex: none; display: grid; place-items: center; width: 2.6em; height: 2.6em; border-radius: 50%; background: color-mix(in srgb, var(--pc) 14%, #fff); color: var(--pc); font-style: normal; }
.th-ico .ic { width: 1.35em; height: 1.35em; }
.th-card-top h1 { margin: 0; }
.th-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.th-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-top: 1em; }
.th-chip { font: inherit; font-weight: 700; font-size: .95em; display: inline-flex; gap: 6px; align-items: center; margin: 0 6px 6px 0; padding: .5em .9em; border-radius: 999px; border: 1.5px solid color-mix(in srgb, var(--pc) 35%, #fff); background: #fff; color: #3b2a14; cursor: pointer; }
.th-chip .ic { color: var(--pc); }
.th-mini-line b .ic { color: var(--pc); margin-right: 2px; }
.th-chip:hover { background: color-mix(in srgb, var(--pc) 10%, #fff); }
.th-minimap { width: 100%; height: 220px; display: block; border-radius: 14px; border: 1px solid #d6e4ee; margin-bottom: 8px; }
.th-place { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.th-map { width: 100%; height: min(62vh, 560px); display: block; border-radius: 16px; border: 1px solid #d6e4ee; cursor: pointer; touch-action: manipulation; }
.th-map.game { height: min(56vh, 520px); }
.th-place .th-map { height: auto; aspect-ratio: 1088 / 640; } /* облыстар картасының пішіні */

/* Ойын */
.th-qhead { display: flex; justify-content: space-between; font-weight: 800; color: var(--pc); margin-bottom: .8em; }
.th-q { display: flex; gap: 18px; align-items: center; padding: 16px 20px; border-radius: 16px; background: #fffcf6; border: 1px solid #f1e6cf; margin-bottom: 14px; }
.th-q > i { flex: none; display: grid; place-items: center; width: 2.6em; height: 2.6em; border-radius: 50%; background: color-mix(in srgb, var(--pc) 14%, #fff); color: var(--pc); font-style: normal; }
.th-q > i .ic { width: 1.3em; height: 1.3em; }
.th-q h2 { font-size: 1.5em; color: #3b2a14; }
.th-q p { margin: .2em 0 0; font-size: 1.15em; color: #3b2a14; }
.th-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.th-opts button { font: inherit; font-size: 1.2em; font-weight: 700; min-height: 64px; padding: 10px 14px; border-radius: 16px; border: 2px solid #ead9b8; background: #fff; color: #3b2a14; cursor: pointer; }
.th-opts button.ok { border-color: #2f9e44; background: #ebfbee; }
.th-opts button:disabled { opacity: .45; }
.th-order { margin: 0 0 12px; padding: 0; list-style: none; counter-reset: o; display: grid; gap: 6px; }
.th-order li { counter-increment: o; display: flex; gap: 12px; align-items: center; font-size: 1.1em; font-weight: 700; padding: 10px 14px; border-radius: 14px; background: color-mix(in srgb, var(--pc) 10%, #fff); color: #3b2a14; animation: rise .3s ease both; }
.th-order li::before { content: counter(o); width: 1.8em; height: 1.8em; border-radius: 50%; background: var(--pc); color: #fff; display: grid; place-items: center; flex: none; }
.th-order li span { font-size: .8em; color: var(--pc); min-width: 9em; }
.th-done { text-align: center; padding: 40px 0; }
.th-done .th-ico { margin: 0 auto 12px; font-size: 1.6em; }
.th-bad { animation: thshake .4s ease; }
@keyframes thshake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

body.touch .th-plan button { min-height: 48px; }
@media (max-width: 1100px) { .th-periods { grid-template-columns: repeat(3, 1fr); } .th-lesson { grid-template-columns: 280px minmax(0, 1fr); } .th-place { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .th-page { height: auto; overflow: visible; } .th-lesson { grid-template-columns: 1fr; } .th-plan { max-height: 40vh; } }

/* Тереңдетілген мазмұн (details.js): себебі–барысы–нәтижесі–маңызы, терминдер, дереккөз, тұлға мен орын деректері */
.th-deep { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 1.2em 0 .4em; max-width: 72em; }
.th-deep section { background: #fffcf6; border: 1px solid #f1e6cf; border-radius: 14px; padding: 14px 16px; }
.th-deep h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: .95em; color: var(--pc); text-transform: uppercase; letter-spacing: .03em; }
.th-deep p { margin: 0; font-size: 1.05em; line-height: 1.5; color: #3b2a14; }
.th-terms { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; max-width: 72em; }
.th-terms div { padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--pc) 8%, #fff); }
.th-terms dt { font-weight: 800; color: #3b2a14; }
.th-terms dd { margin: 2px 0 0; color: #5c4a30; font-size: .95em; line-height: 1.4; }
.th-terms.big { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; margin-top: .6em; }
.th-terms.big div { padding: 14px 18px; border: 1px solid color-mix(in srgb, var(--pc) 20%, #fff); }
.th-terms.big dt { font-size: 1.2em; display: flex; align-items: center; gap: 10px; }
.th-terms.big dt span { display: grid; place-items: center; width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--pc); color: #fff; font-size: .75em; flex: none; }
.th-terms.big dd { font-size: 1.05em; margin-top: 6px; }
.th-source { display: flex; gap: 14px; align-items: flex-start; margin: 1.2em 0 0; padding: 16px 18px; border-radius: 14px; background: #fff; border-left: 4px solid var(--pc); box-shadow: 0 4px 16px rgba(59, 42, 20, .06); max-width: 72em; }
.th-source > i { font-style: normal; color: var(--pc); flex: none; margin-top: 2px; }
.th-source > i .ic { width: 1.6em; height: 1.6em; }
.th-source small { font-size: .78em; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.th-source p { margin: 4px 0; font-size: 1.08em; line-height: 1.5; color: #3b2a14; }
.th-source.quote p { font-size: 1.25em; font-style: italic; font-weight: 600; }
.th-source figcaption { font-size: .9em; color: var(--muted); }
.th-facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 1em 0 .2em; }
.th-facts div { padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--pc) 10%, #fff); }
.th-facts small { display: block; font-size: .78em; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--pc); }
.th-facts b { color: #3b2a14; }
.th-list { margin: 0; padding-left: 1.3em; display: grid; gap: 4px; font-size: 1.08em; color: #3b2a14; }
.th-list li::marker { color: var(--pc); }
.th-why { margin: 0; font-size: 1.12em; line-height: 1.5; color: #3b2a14; max-width: 46em; }
.th-deep.two { margin-top: 1em; }
@media (max-width: 900px) { .th-deep { grid-template-columns: 1fr; } }
.th-more-say { margin-top: 1em; }
.th-facts .th-more-say { margin-top: 0; align-self: center; }

/* Жеңілдетілген көрініс (sheber.education): кезеңдер бір жолда, жоспар — 6 бөлім, мазмұн «Толығырақ» ішінде */
.th-periods { gap: 6px; padding: 8px 14px; }
.th-periods button { min-height: 48px; padding: 6px 12px; border-width: 1.5px; align-content: center; }
.th-periods b { font-size: 14px; }
.th-lesson { grid-template-columns: 290px minmax(0, 1fr); }
.th-plan { gap: 6px; }
.th-progress { height: 6px; margin-top: 10px; border-radius: 999px; background: #f1e6cf; overflow: hidden; }
.th-progress i { display: block; height: 100%; background: var(--pc); border-radius: inherit; transition: width .25s ease; }
.th-sec { border-radius: 14px; }
.th-sec.open { background: color-mix(in srgb, var(--pc) 8%, #fff); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--pc) 35%, #fff); }
.th-plan .th-sec-btn { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; font-size: 16px; font-weight: 700; border-radius: 14px; }
.th-sec-btn span { flex: 1; }
.th-sec-btn em { font-style: normal; font-size: 13px; font-weight: 800; color: var(--pc); background: color-mix(in srgb, var(--pc) 12%, #fff); padding: 2px 9px; border-radius: 999px; }
.th-num { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-style: normal; font-size: 13px; font-weight: 800; background: #f1e6cf; color: #7a5a2a; }
.th-sec.open .th-num { background: var(--pc); color: #fff; }
.th-sec.done .th-num { background: #d3f9d8; color: #2b8a3e; }
.th-sec.done .th-sec-btn span { color: #6b5a3e; }
.th-sub { display: grid; gap: 2px; padding: 0 8px 8px 46px; }
.th-plan .th-sub button { padding: 7px 10px; font-size: 14px; font-weight: 600; border-radius: 10px; min-height: 40px; }
.th-plan .th-sub button[aria-pressed="true"] { background: #fff; box-shadow: inset 3px 0 0 var(--pc); color: #3b2a14; }
.th-nav #pos { color: var(--muted); font-size: 14px; text-align: center; }
.th-nav #pos b { color: #3b2a14; }
.th-nav #nextBtn { max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-more { margin: 1.2em 0 .4em; border: 1.5px solid #ead9b8; border-radius: 16px; background: #fffcf6; }
.th-more summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 10px 16px; font-weight: 700; font-size: 16px; color: #3b2a14; }
.th-more summary::-webkit-details-marker { display: none; }
.th-more summary .ic { color: var(--pc); transition: transform .2s; }
.th-more[open] summary .ic { transform: rotate(90deg); }
.th-more-in { padding: 0 16px 16px; }
.th-more-in .th-deep { margin-top: .6em; }
@media (max-width: 1100px) { .th-periods { grid-template-columns: repeat(3, 1fr); } .th-lesson { grid-template-columns: 250px minmax(0, 1fr); } }
@media (max-width: 760px) { .th-periods { grid-template-columns: repeat(2, 1fr); } .th-lesson { grid-template-columns: 1fr; } .th-plan { max-height: none; } .th-sub { display: none; } }
@media (prefers-reduced-motion: reduce) { .th-progress i, .th-more summary .ic { transition: none; } }
