/**
 * com_manidownload — lessons tab + files tab (2026)
 * Colours follow the store accent (--md-accent). RTL-first, logical properties, mobile-first touch sizes.
 * @copyright Copyright (C) 2026 Manisoft Media Inc. — https://www.manisoft.agency
 * @version 2026.10.23.1215
 */
.mdls, .mdlf {
	--l-acc: var(--md-accent, #5b21b6);
	--l-acc-soft: var(--md-accent-soft, rgba(91, 33, 182, .08));
	--l-ink: #1d2330;
	--l-mut: #5f6675;
	--l-line: #e6e8ee;
	--l-row: #eceef2;
	--l-bg: #fafbfc;
	--l-new: #1d4ed8;
	--l-new-bg: #eff6ff;
	--l-upd: #9a3412;
	--l-upd-bg: #fff7ed;
	--l-upd-line: #fed7aa;
	--l-ok: #067647;
	--l-ok-bg: #ecfdf3;
	--l-r: 16px;
	display: flex;
	flex-direction: column;
	gap: 18px;
	color: var(--l-ink);
	font-size: 15px;
	line-height: 1.8;
}
.mdls [hidden], .mdlf [hidden], .mdls-reader [hidden] { display: none !important; }
.mdls-muted { color: var(--l-mut); font-size: 13px; }
.mdls-empty { padding: 28px; text-align: center; color: var(--l-mut); border: 1px dashed #cfd4dc; border-radius: var(--l-r); }

/* buttons & chips */
.mdls-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	min-height: 40px; padding: 0 14px; border-radius: 10px;
	border: 1px solid #dfe2e8; background: #fff; color: var(--l-ink) !important;
	font: inherit; font-size: 13.5px; font-weight: 600; line-height: 1.4; text-decoration: none !important;
	cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s;
}
.mdls-btn:hover { background: #f5f6f8; border-color: #cfd4dc; }
.mdls-btn:focus-visible, .mdls-chip:focus-visible, .mdls-gh-btn:focus-visible, .mdls-link:focus-visible { outline: 2px solid var(--l-acc); outline-offset: 2px; }
.mdls-btn.is-dark { background: var(--l-ink); border-color: var(--l-ink); color: #fff !important; }
.mdls-btn.is-dark:hover { background: #2c3445; }
.mdls-btn.is-on { background: var(--l-acc-soft); border-color: var(--l-acc); }
.mdls-btn.is-icon { padding: 0 11px; }
.mdls-link { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--l-acc); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.mdls-chip-s { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; line-height: 1.6; padding: 1px 9px; border-radius: 99px; white-space: nowrap; }
.mdls-chip-s.is-new { background: var(--l-new-bg); color: var(--l-new); }
.mdls-chip-s.is-upd { background: var(--l-upd-bg); color: var(--l-upd); }
.mdls-chip-s.is-free { background: var(--l-ok-bg); color: var(--l-ok); }
.mdls-chip-s.is-lock { background: #f3f4f7; color: #4b5563; }

/* top cards */
.mdls-top { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }
.mdls-card { background: #fff; border: 1px solid var(--l-line); border-radius: var(--l-r); padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.mdls-progress-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.mdls-progress-h span { color: var(--l-mut); font-size: 13.5px; }
.mdls-bar { height: 8px; background: #eef0f4; border-radius: 99px; overflow: hidden; }
.mdls-bar span { display: block; height: 100%; background: var(--l-acc); border-radius: 99px; }
.mdls-progress-f { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mdls-progress-f .mdls-btn { white-space: normal; text-align: start; min-height: 44px; }
.mdls-done-all { color: var(--l-ok); font-weight: 700; }
.mdls-news { background: var(--l-upd-bg); border-color: var(--l-upd-line); color: #7c2d12; }
.mdls-news-h { font-weight: 800; display: flex; gap: 6px; align-items: center; }
.mdls-news-t { font-size: 14px; }
.mdls-news .mdls-link { color: var(--l-upd); align-self: flex-start; }
.mdls-inst { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.mdls-inst-b { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1 1 320px; }
.mdls-inst-steps { display: flex; gap: 6px; }
.mdls-inst-steps span { flex: 1; height: 8px; border-radius: 99px; background: #eef0f4; }
.mdls-inst-steps span.is-paid { background: var(--l-acc); }

/* visitor stats */
.mdls-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.mdls-stats > div { background: #fff; border: 1px solid var(--l-line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.mdls-stats b { font-size: 17px; font-weight: 800; }
.mdls-stats span { font-size: 12.5px; color: var(--l-mut); }
.mdls-stats .is-accent { background: var(--l-acc-soft); border-color: transparent; }

/* tools */
.mdls-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; scroll-margin-top: 90px; }
.mdls-search { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 14px; border: 1px solid #dfe2e8; border-radius: 12px; background: #fff; margin: 0; }
.mdls-search:focus-within { border-color: var(--l-acc); box-shadow: 0 0 0 3px var(--l-acc-soft); }
.mdls-search i { color: var(--l-mut); }
.mdls-search input { flex: 1; min-width: 0; border: 0 !important; outline: 0; background: transparent; font: inherit; font-size: 14px; height: 44px; padding: 0; box-shadow: none !important; }
.mdls-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.mdls-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border: 1px solid #dfe2e8; background: #fff; color: #3b4252; border-radius: 99px; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.mdls-chip span { font-weight: 700; }
.mdls-chip.is-on { border-color: var(--l-acc); background: var(--l-acc-soft); color: var(--l-acc); font-weight: 600; }
.mdls-chip.is-ghost { border-style: dashed; }
.mdls-noresult { padding: 18px; text-align: center; color: var(--l-mut); border: 1px dashed #cfd4dc; border-radius: var(--l-r); }

/* sections */
.mdls-groups { display: flex; flex-direction: column; gap: 14px; }
.mdls-group { background: #fff; border: 1px solid var(--l-line); border-radius: var(--l-r); overflow: hidden; }
.mdls-gh { margin: 0; font-size: inherit; }
.mdls-gh-btn { width: 100%; display: flex; align-items: center; gap: 14px; padding: 16px 20px; border: 0; background: var(--l-bg); text-align: start; font: inherit; color: inherit; cursor: pointer; }
.mdls-group.is-open .mdls-gh-btn { border-bottom: 1px solid var(--l-row); }
.mdls-gn { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px; background: var(--l-acc-soft); color: var(--l-acc); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.mdls-gt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mdls-gt-t { font-size: 16px; font-weight: 800; line-height: 1.6; }
.mdls-gm { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--l-mut); }
.mdls-chev { transition: transform .2s; color: var(--l-mut); }
.mdls-group.is-open .mdls-chev { transform: rotate(180deg); }

/* lesson rows */
.mdls-row { border-top: 1px solid var(--l-row); scroll-margin-top: 110px; }
.mdls-gb > .mdls-row:first-child { border-top: 0; }
.mdls-row.is-flash { animation: mdls-flash 2.2s ease-out; }
@keyframes mdls-flash { 0%, 30% { background: var(--l-acc-soft); } 100% { background: transparent; } }
.mdls-r { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px 20px; }
.mdls-ico { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: #f3f4f7; color: #4b5563; font-size: 18px; }
.mdls-ico.is-done { background: var(--l-ok-bg); color: var(--l-ok); }
.mdls-ico.is-upd { background: var(--l-upd-bg); color: #c2410c; }
.mdls-ico.is-text { background: var(--l-acc-soft); color: var(--l-acc); }
.mdls-ico.is-play { background: var(--l-new-bg); color: var(--l-new); }
.mdls-ico.is-lock { background: #f3f4f7; color: #9aa1ad; }
.mdls-rt { min-width: 0; }
.mdls-t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; font-weight: 600; line-height: 1.7; }
.mdls-num { color: var(--l-mut); font-weight: 700; font-variant-numeric: tabular-nums; }
.mdls-m { display: flex; gap: 4px 8px; flex-wrap: wrap; margin-top: 4px; font-size: 12.5px; color: var(--l-mut); }
.mdls-m i { font-style: normal; color: #c3c8d0; }
.mdls-warn { color: var(--l-upd); font-weight: 600; }
.mdls-a { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.mdls-lock { font-size: 13px; color: var(--l-mut); white-space: nowrap; }
.mdls-lock.is-btn { border: 1px dashed #cfd4dc; background: #fff; border-radius: 10px; min-height: 40px; padding: 0 12px; font: inherit; font-size: 13px; cursor: pointer; }

/* panels under a lesson */
.mdls-panel { margin: 0 20px 16px; margin-inline-start: 78px; }
.mdls-desc { padding: 12px 16px; background: var(--l-bg); border-radius: 12px; font-size: 14px; color: #3b4252; }
.mdls-upd { border: 1px solid #fde4c3; background: #fffbf5; border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.mdls-upd-i + .mdls-upd-i { border-top: 1px solid #f3dcc0; padding-top: 14px; }
.mdls-upd-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; color: #7c2d12; }
.mdls-upd-more { font-size: 13px; color: var(--l-mut); }
.mdls-files { border: 1px solid var(--l-line); border-radius: 14px; overflow: hidden; }
.mdls-file { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 12px 14px; }
.mdls-file + .mdls-file { border-top: 1px solid var(--l-row); }
.mdls-ext { height: 30px; border-radius: 8px; background: #f3f4f7; color: #4b5563; font-size: 10.5px; font-weight: 800; letter-spacing: .02em; display: inline-flex; align-items: center; justify-content: center; direction: ltr; overflow: hidden; }
.mdls-file-t { min-width: 0; display: flex; flex-direction: column; }
.mdls-file-t b { font-size: 14px; font-weight: 600; }
.mdls-file-t span { font-size: 12.5px; color: var(--l-mut); line-height: 1.8; }
.mdls-file-s { font-size: 12.5px; color: var(--l-mut); white-space: nowrap; }
.mdls-file-x { display: inline-flex; gap: 14px; align-items: center; justify-content: flex-end; }
.mdls-file-x:empty { display: none; }

/* rich text (lesson text, updates) */
.mdls-prose { font-size: 15px; line-height: 2.05; color: #2d3340; overflow-wrap: anywhere; }
.mdls-prose > :first-child { margin-top: 0; }
.mdls-prose > :last-child { margin-bottom: 0; }
.mdls-prose p { margin: 0 0 12px; }
.mdls-prose h3 { font-size: 17px; font-weight: 800; margin: 22px 0 8px; }
.mdls-prose h4 { font-size: 15.5px; font-weight: 800; margin: 18px 0 6px; }
.mdls-prose ul, .mdls-prose ol { margin: 0 0 12px; padding-inline-start: 22px; }
.mdls-prose img { display: block; max-width: 100%; max-height: 520px; width: auto; height: auto; object-fit: contain; border-radius: 12px; border: 1px solid var(--l-line, #e6e8ee); margin: 14px 0; }
.mdls-prose a { color: var(--l-acc, #5b21b6); }
.mdls-prose blockquote { margin: 12px 0; padding: 8px 14px; border-inline-start: 3px solid var(--l-acc, #5b21b6); background: #f7f7fb; border-radius: 8px; }
.mdls-prose table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; display: block; overflow-x: auto; }
.mdls-prose th, .mdls-prose td { border: 1px solid #e3e6eb; padding: 6px 10px; }
.mdls-prose pre, .mdls-prose code { direction: ltr; text-align: left; font-size: 13px; background: #f3f4f7; border-radius: 6px; }
.mdls-prose pre { padding: 10px 12px; overflow-x: auto; }

/* reader */
.mdls-reader { --l-acc: var(--md-accent, #5b21b6); --l-acc-soft: var(--md-accent-soft, rgba(91, 33, 182, .08)); --l-line: #e6e8ee; --l-mut: #5f6675; }
.mdls-reader .modal-content { border-radius: 18px; border: 0; }
.mdls-reader .modal-header { align-items: flex-start; gap: 12px; padding: 20px 24px 16px; }
.mdls-reader .modal-header .btn-close { margin: 0; margin-inline-start: auto; }
.mdls-reader-k { font-size: 12.5px; color: var(--l-acc); font-weight: 700; }
.mdls-reader .modal-title { font-size: 20px; font-weight: 800; line-height: 1.6; margin: 2px 0; }
.mdls-reader .modal-body { padding: 22px 24px; }
.mdls-reader .modal-body .mdls-upd-inline { margin-bottom: 18px; border: 1px solid #fde4c3; background: #fffbf5; border-radius: 14px; padding: 14px 16px; }
.mdls-reader-f { justify-content: space-between; gap: 10px; padding: 14px 24px; }
.mdls-reader-f .mdls-btn { max-width: 42%; overflow: hidden; text-overflow: ellipsis; display: inline-block; line-height: 40px; }
.mdls-read-ok { color: #067647; font-weight: 700; font-size: 13.5px; }

/* files tab */
.mdlf-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mdlf-head h3 { margin: 0; font-size: 17px; font-weight: 800; flex: 1 1 auto; }
.mdlf-head h3 small { font-size: 13px; font-weight: 500; color: var(--l-mut); margin-inline-start: 6px; }
.mdlf-head .mdls-search { flex: 0 1 300px; }
.mdlf-sec { background: #fff; border: 1px solid var(--l-line); border-radius: var(--l-r); overflow: hidden; }
.mdlf-sec-h { padding: 14px 20px; background: var(--l-bg); border-bottom: 1px solid var(--l-row); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.mdlf-sec-h b { font-size: 15.5px; font-weight: 800; }
.mdlf-sec-h span { font-size: 12.5px; color: var(--l-mut); }
.mdlf-sec .mdls-file { padding: 14px 20px; }
.mdlf-lesson { font-size: 12.5px; color: var(--l-mut); white-space: nowrap; }
.mdlf-lesson a { color: inherit; }
.mdlf-note { font-size: 12.5px; color: var(--l-mut); text-align: center; }

/* ---------- tablets & phones ---------- */
@media (max-width: 991.98px) {
	.mdls-top { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767.98px) {
	.mdls, .mdlf { gap: 14px; }
	.mdls-card { padding: 14px 16px; }
	.mdls-tools { flex-direction: column; align-items: stretch; }
	.mdls-tools .mdls-search { flex: 0 0 auto; }
	.mdls-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -2px; padding: 2px; }
	.mdls-chips::-webkit-scrollbar { display: none; }
	.mdls-gh-btn { padding: 14px 16px; gap: 12px; }
	.mdls-gt-t { font-size: 15px; }
	.mdls-r { grid-template-columns: 40px minmax(0, 1fr); gap: 10px 12px; padding: 14px 16px; align-items: start; }
	.mdls-ico { width: 40px; height: 40px; border-radius: 11px; font-size: 16px; }
	.mdls-t { font-size: 14.5px; }
	.mdls-a { grid-column: 1 / -1; justify-content: stretch; }
	.mdls-a > * { flex: 1 1 auto; }
	.mdls-a .mdls-btn { min-height: 44px; }
	.mdls-a .mdls-btn.is-icon { flex: 0 0 44px; }
	.mdls-a .mdls-lock { text-align: center; }
	.mdls-panel { margin: 0 16px 14px; }
	.mdls-file, .mdlf-sec .mdls-file { grid-template-columns: 46px minmax(0, 1fr) auto; padding: 12px 14px; }
	.mdls-file .mdls-file-x { grid-column: 2; grid-row: 2; justify-content: flex-start; margin-top: -6px; }
	.mdls-file .mdls-ext { grid-row: 1 / span 2; align-self: start; }
	.mdls-file .mdls-btn, .mdls-file .mdls-lock { grid-column: 3; grid-row: 1 / span 2; }
	.mdlf-head .mdls-search { flex: 1 1 100%; }
	.mdls-reader .modal-header, .mdls-reader .modal-body { padding-inline: 18px; }
	.mdls-reader-f { flex-wrap: nowrap; }
	.mdls-reader-f .mdls-btn { max-width: 48%; font-size: 12.5px; padding: 0 10px; }
}

/* daily download cap */
.mdls-btn.is-off { background: #f3f4f7; border-style: dashed; color: #5f6675 !important; cursor: default; }
.mdls-btn.is-off:hover { background: #f3f4f7; }
.mdls-limit { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: 14px; background: #fff7ed; border: 1px solid #fed7aa; color: #7c2d12; line-height: 1.9; }
.mdls-limit > i { font-size: 20px; margin-top: 2px; }
.mdls-limit b { display: block; font-size: 15px; }
.mdls-limit span { font-size: 13.5px; }

/* v2026.10.18 — calm colour: accent only for what can be clicked or is selected */
.mdls-gn { background: #f1f2f5; color: #4b5563; }
.mdls-ico.is-text, .mdls-ico.is-play { background: #f1f2f5; color: #4b5563; }
.mdls-bar span { background: #1d2330; }
.mdls-stats .is-accent { background: #fff; border-color: var(--l-line); }
.mdls-reader-k { color: var(--l-mut); }
.mdls-inst-steps span.is-paid { background: #1d2330; }
.mdls-prose blockquote { border-inline-start-color: #c3c8d0; }
