/*
 * Front UI "C" theme (Bootstrap 5). Colours come from :root vars printed by frontUiThemeStyle()
 * (--p, --p-dark, --p-soft, --on-p, --p-rgb from THEME_COLOR). Loaded only by layouts/c/template.php.
 * Sections: 1 base · 2 shell (sidebar, rail, topbar, notice) · 3 mobile (tabbar, offcanvas) · 4 footer
 *           5 banner · 6 page content (classic page classes) · 7 per-page fixes (.act-*) · 8 auth pages · 9 home popup
 *           10 package page (c/package/index.php) · 11 notifications (bell list, c/notification/index.php)
 *           12 phone categories sheet · 13 login popup (#loginModal)
 */

/* ===== 1 base ===== */
:root {
    --bg: #F5F6F8; --card: #fff; --line: #E7E9EE; --line-soft: #F0F1F4;
    --text: #1F2430; --muted: #6B7280; --faint: #9AA1AE;
    --radius: 14px; --radius-sm: 10px;
    --side-w: 256px; --rail-w: 72px; --top-h: 64px;
    --bs-body-font-family: "IBM Plex Sans Thai", -apple-system, "Segoe UI", sans-serif;
    --bs-body-color: var(--text); --bs-body-bg: var(--bg); --bs-border-color: var(--line);
}
body.front-c { background: var(--bg); color: var(--text); font-family: var(--bs-body-font-family); font-size: 15px; -webkit-font-smoothing: antialiased; }
.front-c h1, .front-c h2, .front-c h3, .front-c h4, .front-c h5, .front-c h6 { font-family: inherit; color: var(--text); }
.front-c a:not(.btn) { color: var(--p-text); text-decoration: none; }
.front-c a:not(.btn):hover { color: var(--p-text); text-decoration: underline; }
.front-c .btn-primary { --bs-btn-bg: var(--p); --bs-btn-border-color: var(--p); --bs-btn-color: var(--on-p);
    --bs-btn-hover-bg: var(--p-dark); --bs-btn-hover-border-color: var(--p-dark); --bs-btn-hover-color: var(--on-p); --bs-btn-active-color: var(--on-p);
    --bs-btn-active-bg: var(--p-dark); --bs-btn-active-border-color: var(--p-dark); --bs-btn-disabled-bg: var(--p); --bs-btn-disabled-border-color: var(--p); }
.front-c .btn { border-radius: var(--radius-sm); font-weight: 500; }
/* Bootstrap 3 buttons/inputs were 14px (BS5: 16px); keep that size so buttons and their icons do not look swollen */
.front-c .btn { --bs-btn-font-size: 14px; --bs-btn-padding-y: 6px; --bs-btn-padding-x: 14px; --bs-btn-line-height: 1.45; }
.front-c .btn-sm, .front-c .btn-group-sm > .btn { --bs-btn-font-size: 12.5px; --bs-btn-padding-y: 4px; --bs-btn-padding-x: 10px; }
.front-c .btn-lg, .front-c .btn-group-lg > .btn { --bs-btn-font-size: 16px; --bs-btn-padding-y: 9px; --bs-btn-padding-x: 18px; }
.front-c .btn > .fa, .front-c .btn > .glyphicon { font-size: 1em; line-height: inherit; }
.front-c .form-control, .front-c .form-select { font-size: 14px; }
/* sweetalert2 is sized in rem: the BS5 root is 16px (BS3: 10px), which made every alert 1.6x bigger */
body.front-c .swal2-popup { font-size: .75rem; }
.front-c .form-control, .front-c .form-select { border-radius: var(--radius-sm); border-color: var(--line); }
.front-c .form-control:focus, .front-c .form-select:focus { border-color: var(--p); box-shadow: 0 0 0 3px rgba(var(--p-rgb), .15); }
.front-c .btn:focus-visible { box-shadow: 0 0 0 3px rgba(var(--p-rgb), .25); }
.front-c .dropdown-menu { border-color: var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(17, 24, 39, .12); padding: 6px; }
.front-c .dropdown-item { border-radius: 8px; padding: 7px 10px; font-size: 14px; }
.front-c .dropdown-item:active { background: var(--p); color: var(--on-p); }
.front-c .modal-content { border: 0; border-radius: 16px; box-shadow: 0 20px 50px rgba(17, 24, 39, .2); }
.c-legacy-stub { position: absolute; width: 0; height: 0; overflow: hidden; }
.c-sp { flex: 1; }

/* ===== 2 shell ===== */
.c-shell { display: flex; min-height: 100vh; }
.c-side { position: sticky; top: 0; height: 100vh; width: var(--side-w); flex: 0 0 var(--side-w); flex-direction: column;
    background: #fff; border-right: 1px solid var(--line); transition: width .18s, flex-basis .18s; z-index: 20; }
.c-brand { display: flex; align-items: center; gap: 10px; padding: 14px 16px; min-height: var(--top-h); border-bottom: 1px solid var(--line); color: var(--text) !important; }
.c-brand-logo { width: 38px; height: 38px; object-fit: contain; flex-shrink: 0; }
.c-brand-name { font-weight: 600; font-size: 14px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.c-side-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 10px 28px; scrollbar-width: thin; scrollbar-color: #D5D9E0 transparent; }
.c-menu .c-group { font-size: 11px; font-weight: 500; color: var(--faint); text-transform: uppercase; letter-spacing: .07em; margin: 16px 10px 6px; }
.c-menu .c-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 14px; color: #3B4252; cursor: pointer; list-style: none; position: relative; }
.c-menu .c-link > .fa, .c-menu .c-link > img { width: 20px; text-align: center; color: #6B7280; flex-shrink: 0; font-size: 15px; }
.c-menu .c-link > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-menu .c-link:hover { background: #F3F4F6; color: var(--text); }
.c-menu .c-link.active { background: var(--p-soft); color: var(--p-text); font-weight: 500; }
.c-menu .c-link.active > .fa { color: var(--p-text); }
.c-menu .c-sub { padding-left: 18px; font-size: 13.5px; }
.c-menu .c-sub > .fa { font-size: 12px; }
.c-menu .c-count { font-size: 11.5px; color: var(--faint); }
.c-menu .c-badge, .c-dot { font-size: 10.5px; font-weight: 600; background: #DC2626; color: #fff; border-radius: 999px; padding: 0 6px; line-height: 17px; }
.c-menu details > summary::-webkit-details-marker { display: none; }
.c-menu details > summary .c-caret { width: auto; font-size: 13px; transition: transform .15s; }
.c-menu details[open] > summary .c-caret { transform: rotate(180deg); }
.c-menu .c-cats { max-height: 320px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; -ms-overflow-style: none; } /* scrolls, scrollbar hidden */
.c-menu .c-cats::-webkit-scrollbar { display: none; }
.c-menu .c-cats > .c-cat-search { position: sticky; top: 0; z-index: 1; box-shadow: 0 0 0 4px #fff; } /* stays visible while the list scrolls */
.c-menu .c-cat-search { margin: 4px 6px 6px 18px; width: calc(100% - 24px); height: 32px; font-size: 13px; }
/* guest: "sign in to borrow" in the My library group, tinted like an action */
.c-menu .c-link.c-login-cta { background: var(--p-soft); color: var(--p-text); font-weight: 500; }
.c-menu .c-link.c-login-cta > .fa { color: var(--p-text); }
.c-menu .c-link.c-login-cta:hover { background: rgba(var(--p-rgb), .16); color: var(--p-text); }
/* bottom row: language / old look as small pills, apart from the main menu */
.c-menu .c-menu-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 16px 4px 4px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.c-menu .c-menu-foot:empty { display: none; }
.c-menu .c-link.c-mini { flex: 0 0 auto; gap: 6px; height: 30px; padding: 0 11px; font-size: 12.5px; line-height: 1; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; }
.c-menu .c-link.c-mini > .fa { width: auto; font-size: 12px; color: inherit; }
.c-menu .c-link.c-mini > img { width: 18px !important; height: 12px; object-fit: cover; border-radius: 2px; box-shadow: 0 0 0 1px rgba(17, 24, 39, .08); }
.c-menu .c-link.c-mini > span { flex: 0 1 auto; }
.c-menu .c-link.c-mini:hover { border-color: var(--p); color: var(--p-text); background: #fff; }
.c-menu button.c-link.c-mini { background: #fff; font: inherit; font-size: 12.5px; }
.c-menu .c-lang .c-mini .c-caret { width: auto; font-size: 12px; color: var(--faint); margin-left: 2px; }
.c-menu .c-lang .c-mini[aria-expanded="true"] { border-color: var(--p); color: var(--p-text); }
.c-menu .c-lang .dropdown-menu { min-width: 140px; }
.c-menu .c-lang .dropdown-item { display: flex; align-items: center; gap: 8px; color: var(--text); }
.c-menu .c-lang .dropdown-item.active { background: var(--p-soft); color: var(--p-text); font-weight: 500; }

/* rail: icons only */
.c-shell.rail .c-side { width: var(--rail-w); flex-basis: var(--rail-w); }
.c-shell.rail .c-brand { justify-content: center; padding: 14px 8px; }
.c-shell.rail .c-brand-name, .c-shell.rail .c-side .c-group, .c-shell.rail .c-side .c-count,
.c-shell.rail .c-side .c-sub, .c-shell.rail .c-side .c-cat-search, .c-shell.rail .c-side .c-caret { display: none; }
.c-shell.rail .c-side .c-link { justify-content: center; padding: 10px; font-size: 0; }
.c-shell.rail .c-side .c-link > span { display: none; }
.c-shell.rail .c-side .c-badge { position: absolute; top: 3px; right: 6px; }
.c-shell.rail .c-side .c-menu .c-group + .c-link { margin-top: 8px; border-top: 1px solid var(--line-soft); }
.c-shell.rail .c-side .c-menu-foot { flex-direction: column; align-items: stretch; margin: 12px 0 4px; gap: 2px; }
.c-shell.rail .c-side .c-link.c-mini { border: 0; border-radius: var(--radius-sm); height: auto; padding: 10px; justify-content: center; }
.c-shell.rail .c-side .c-link.c-mini > .fa { width: 20px; font-size: 15px; }

.c-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.c-notice { display: flex; align-items: center; gap: 10px; background: var(--p-soft); color: var(--p-text); font-size: 14px; padding: 8px 24px; border-bottom: 1px solid var(--line); }
.c-notice a { text-decoration: underline; font-weight: 500; }
.c-notice-x { background: none; border: 0; font-size: 20px; line-height: 1; color: var(--muted); padding: 0 4px; }
.c-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; min-height: var(--top-h); padding: 10px 24px; background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.c-icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 38px; height: 38px; padding: 0 8px; border-radius: var(--radius-sm); border: 0; background: transparent; color: #4B5563; }
.c-icon-btn:hover { background: #F3F4F6; }
.c-top-brand img { height: 34px; }
.c-search { flex: 1; max-width: 680px; display: flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid transparent; border-radius: 12px; padding: 4px; }
.c-search:focus-within { background: #fff; border-color: var(--p); }
.c-search .form-select { width: auto; max-width: 190px; border: 0; background-color: var(--p-soft); color: var(--p-text); font-weight: 500; font-size: 13px; height: 34px; padding-top: 0; padding-bottom: 0; }
.c-search .form-control { flex: 1; min-width: 0; border: 0; background: transparent; height: 34px; box-shadow: none !important; }
.c-search .btn { flex-shrink: 0; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; }
.c-top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.c-quota { font-size: 13px; color: var(--muted); white-space: nowrap; }
.c-quota b { color: var(--p-text); }
.c-avatar { position: relative; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--p-soft); color: var(--p-text); font-weight: 600; }
.c-avatar .c-dot { position: absolute; top: -3px; right: -4px; }
.c-profile .dropdown-header { white-space: normal; max-width: 260px; }
/* bell: reading package expired / expiring (the classic look's floating red box) */
.c-bell { position: relative; }
.c-bell > .fa { font-size: 18px; }
.c-bell[aria-expanded="true"] { background: #F3F4F6; color: var(--p-text); }
.c-bell:focus { outline: 0; }
.c-bell:focus-visible { outline: 2px solid var(--p); outline-offset: 1px; }
.c-bell .c-dot { position: absolute; top: 2px; right: 2px; min-width: 17px; text-align: center; padding: 0 4px; box-shadow: 0 0 0 2px #fff; }
.c-bell-menu { width: 320px; max-width: calc(100vw - 24px); padding: 0; overflow: hidden; border-radius: 12px; border-color: var(--line); box-shadow: 0 12px 32px rgba(17, 24, 39, .14); }
.c-bell-head { padding: 10px 14px; font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--line); }
.c-bell-item { display: flex; gap: 12px; padding: 12px 14px; color: inherit; text-decoration: none; }
.c-bell-item:hover, .c-bell-item:focus { background: #F9FAFB; color: inherit; }
.c-bell-ico { flex: 0 0 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.c-bell-item.is-expired .c-bell-ico { background: #FEE2E2; color: #B91C1C; }
.c-bell-item.is-soon .c-bell-ico { background: #FEF3C7; color: #B45309; }
.c-bell-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; line-height: 1.45; }
.c-bell-text strong { font-weight: 600; color: #111827; }
.c-bell-text small { font-size: 12px; color: var(--muted); }
.c-bell-cta { margin-top: 4px; font-size: 12.5px; font-weight: 600; color: var(--p-text); }
.c-bell-empty { padding: 22px 14px; text-align: center; font-size: 13px; color: var(--muted); }
/* at least one screen under the top bar: on short pages the footer starts below the fold (seen only after scrolling) */
.c-content { flex: 1; padding: 22px 28px 32px; min-width: 0; min-height: calc(100vh - var(--top-h)); }
.c-page { min-width: 0; }

/* ===== 3 mobile ===== */
.c-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: flex; justify-content: space-around; background: #fff; border-top: 1px solid var(--line); padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 18px rgba(17, 24, 39, .05); }
.c-tabbar a { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); padding: 4px 0; }
.c-tabbar a .fa { font-size: 18px; line-height: 22px; height: 22px; }
.c-tabbar a.active { color: var(--p-text); font-weight: 500; }
.c-tabbar .c-dot { position: absolute; top: 0; left: calc(50% + 6px); }
.c-offcanvas { --bs-offcanvas-width: 300px; }
.c-offcanvas .offcanvas-header { border-bottom: 1px solid var(--line); padding: 10px 14px; }
.c-offcanvas .c-brand { border: 0; padding: 0; min-height: 0; }
.c-offcanvas .offcanvas-body { padding: 8px 10px 30px; }
.c-off-user { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 12px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; font-size: 14px; }
@media (max-width: 991.98px) {
    .c-content { padding: 16px 14px 90px; }
    .c-top { padding: 8px 12px; gap: 8px; }
    .c-notice { padding: 8px 14px; flex-wrap: wrap; }
    .c-search .form-select { max-width: 120px; }
    .c-foot { padding-bottom: 90px !important; }
}
@media (max-width: 575.98px) {
    .c-search .form-select { max-width: 92px; font-size: 12px; padding-left: 8px; padding-right: 22px; background-position: right 6px center; }
    .c-search .btn { padding: 0 10px; }
}

/* ===== 4 footer ===== */
/* layered background in the theme HUE, taken almost to black (--p-deep / --p-deeper from frontUiThemeVars): white text
   and any library logo stay readable for every THEME_COLOR; one soft glow of the theme colour + a faint dot grid */
.c-foot { position: relative; overflow: hidden; isolation: isolate; color: rgba(255, 255, 255, .82); font-size: 14px;
    background:
        radial-gradient(560px 300px at 100% 0%, rgba(var(--p-rgb), .30), transparent 70%),
        radial-gradient(420px 260px at 0% 100%, rgba(255, 255, 255, .05), transparent 70%),
        linear-gradient(135deg, var(--p-deep, #161B26) 0%, var(--p-deeper, #0C0E14) 100%); }
.c-foot::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1.2px); background-size: 18px 18px;
    -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%); mask-image: linear-gradient(180deg, #000, transparent 85%); }
.c-foot::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; z-index: -1; background: linear-gradient(90deg, var(--p), rgba(255, 255, 255, .5), var(--p)); opacity: .8; }
/* slim: one row on wide screens (library | contact | app), ~130px with the bar */
.c-foot-main { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 20px 44px; padding: 20px 32px 18px; }
.c-foot b { color: #fff; display: block; }
.c-foot-lib { display: flex; align-items: center; gap: 16px; min-width: 0; }
.c-foot-logo { display: block; flex: 0 0 auto; height: 40px; width: auto; max-width: 220px; margin: 0; object-fit: contain; }
.c-foot-lib-text { min-width: 0; padding-left: 16px; border-left: 1px solid rgba(255, 255, 255, .16); }
.c-foot-name { font-size: 15px; font-weight: 700; line-height: 1.4; }
.c-foot-h { font-size: 12px; font-weight: 600; margin-bottom: 8px; letter-spacing: .02em; color: rgba(255, 255, 255, .65) !important; }
.c-foot-addr { display: flex; gap: 6px; margin-top: 2px; font-size: 12.5px; line-height: 1.5; color: rgba(255, 255, 255, .68); }
.c-foot-addr .fa { margin-top: 3px; opacity: .7; }
.c-foot a { color: rgba(255, 255, 255, .82) !important; text-decoration: none !important; }
.c-foot a:hover { color: #fff !important; }
/* contact HTML comes from the library settings (links with logo images): one row of round icons */
.c-foot-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; }
.c-foot-contact, .c-foot-contact * { color: rgba(255, 255, 255, .85) !important; }
.c-foot-contact a { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; transition: transform .15s ease; }
.c-foot-contact a:hover { transform: translateY(-2px); }
.c-foot-contact img { width: 34px !important; height: 34px; object-fit: contain; border-radius: 50%; box-shadow: 0 3px 8px rgba(0, 0, 0, .25); }
.c-foot-app .c-foot-h .fa { font-size: 14px; margin-right: 3px; }
.c-foot-store { display: inline-block; transition: transform .15s ease; }
.c-foot-store:hover { transform: translateY(-2px); }
.c-foot-store img { display: block; width: 100%; max-width: 230px; height: auto; }
.c-foot-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; padding: 9px 32px; border-top: 1px solid rgba(255, 255, 255, .12); background: rgba(0, 0, 0, .18); font-size: 12px; }
/* bar: copyright left, links right on wide screens (links come first in the markup for phones) */
.c-foot-copy { order: -1; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; color: rgba(255, 255, 255, .7); }
.c-foot-links { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px; }
.c-foot-by { font-size: 12px; opacity: .6; }
/* tablets: library on its own row, contact + app share the second */
@media (max-width: 1199.98px) {
    .c-foot-main { grid-template-columns: auto auto; justify-content: space-between; }
    .c-foot-lib { grid-column: 1 / -1; }
}
/* phones: everything centred and stacked tight, bar = links row with dots, then one small copyright line */
@media (max-width: 767.98px) {
    .c-foot-main { grid-template-columns: 1fr; justify-content: stretch; gap: 16px; padding: 20px 18px 16px; text-align: center; }
    .c-foot-lib { flex-direction: column; gap: 8px; }
    .c-foot-logo { height: 36px; margin: 0 auto; }
    .c-foot-lib-text { padding-left: 0; border-left: 0; }
    /* address centred like the rest: the pin sits inline before the first line instead of in its own column */
    .c-foot-addr { display: block; text-align: center; text-wrap: balance; }
    .c-foot-addr .fa { margin: 0 4px 0 0; }
    .c-foot-contact { justify-content: center; }
    .c-foot-h { margin-bottom: 6px; }
    .c-foot-store img { max-width: 210px; margin: 0 auto; }
    .c-foot-bar { flex-direction: column; justify-content: center; gap: 6px; padding: 12px 18px; text-align: center; }
    .c-foot-copy { order: 0; justify-content: center; font-size: 12px; }
    .c-foot-links { justify-content: center; gap: 4px 0; }
    .c-foot-links a + a::before { content: "·"; margin: 0 10px; opacity: .5; }
}
@media (prefers-reduced-motion: reduce) { .c-foot-contact a, .c-foot-store { transition: none; } }

/* ===== 5 banner ===== */
.c-banner { border-radius: var(--radius); overflow: hidden; margin-bottom: 22px; background: var(--p-soft); }
.c-banner .carousel-item img { display: block; width: 100%; max-height: 420px; object-fit: contain; margin: 0 auto; }
.c-banner .c-banner-yt { background: #111827; }
.c-banner .c-banner-yt a { position: relative; display: block; }
.c-banner .c-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 64px; height: 64px; border-radius: 50%; background: var(--p); color: var(--on-p); display: grid; place-items: center; font-size: 24px; box-shadow: 0 8px 20px rgba(0, 0, 0, .3); }

/* slide dots (banner, popup, product detail): one round dot per slide. Overrides Bootstrap 5 bars (30x3) and the
   BS3 <li> rule mixing into lumps; the active dot is solid and a little larger. */
.front-c .carousel-indicators { gap: 8px; margin-bottom: 12px; padding: 0; list-style: none; }
.front-c .carousel-indicators > li, .front-c .carousel-indicators > button, .front-c .carousel-indicators [data-bs-target] {
    box-sizing: border-box; flex: 0 0 auto; width: 10px; height: 10px; margin: 0; padding: 0; border: 0; border-radius: 50%;
    background: #fff; background-clip: border-box; opacity: .5; text-indent: -9999px; overflow: hidden; cursor: pointer;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .18); transition: opacity .2s ease, transform .2s ease; }
.front-c .carousel-indicators > .active, .front-c .carousel-indicators [data-bs-target].active { opacity: 1; transform: scale(1.2); }
@media (prefers-reduced-motion: reduce) { .front-c .carousel-indicators > li, .front-c .carousel-indicators > button { transition: none; } }

/* ===== 6 page content: classes of the classic page views ===== */
.c-page .container { width: 100%; max-width: none; padding-left: 0; padding-right: 0; }
.c-page .box-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 26px 0 14px !important; padding: 0 0 8px; border-bottom: 1px solid var(--line); }
.c-page .box-heading .text-box-heading, .c-page .text-box-heading { font-size: 19px; font-weight: 600; color: var(--text); background: none !important; padding: 0 !important; }
.c-page .box-heading > h1, .c-page .box-heading > h2 { margin: 0; font-size: 19px; font-weight: 600; line-height: 1.35 !important; }   /* category / publisher titles */
.c-page .box-heading h3 { margin: 0; font-size: 14px; font-weight: 500; }
.c-page .box-heading h3 a { color: var(--p-text); display: inline-flex; align-items: center; gap: 4px; }
.c-page .box-heading h3 .fa-chevron-right { font-size: 11px !important; top: 0 !important; left: 0 !important; margin: 0 !important; }   /* inline 18px in products/index.php */
/* YouTube play mark over the thumbnails: placed by inline left:38%/top:32% for the classic card size */
.c-page .fa-youtube-play[style*="absolute"] { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); font-size: 40px !important; line-height: 1; }
.c-page .box-heading .pull-right { float: none !important; margin-left: auto; }
.c-page #show-list-ebook, .c-page .row:has(> .books-list) { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px 18px; margin: 0; }
.c-page .row:has(> .article-list), .c-page .row:has(> .youtube-list) { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px 18px; margin: 0; }
.c-page .row > .books-list, .c-page .row > .article-list, .c-page .row > .youtube-list { width: auto !important; max-width: none; padding: 0; min-width: 0; }
.c-page .product-thumb { margin: 0; text-align: center; }
.c-page .book-size, .c-page .article-size, .c-page .book-media-size { width: 100% !important; height: auto !important; position: relative; }
/* cover card — category / publisher lists spell the class "book-cove" (classic views), so both are styled */
.c-page .book-cover, .c-page .book-cove { position: relative; aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden; background: #E9EBEF;
    border: 1px solid rgba(17, 24, 39, .06); box-shadow: 0 6px 16px rgba(17, 24, 39, .14); transition: transform .18s ease, box-shadow .18s ease; }
.c-page .product-thumb:hover .book-cover, .c-page .product-thumb:hover .book-cove,
.c-page .product-thumb:focus-within .book-cover, .c-page .product-thumb:focus-within .book-cove { transform: translateY(-4px); box-shadow: 0 14px 28px rgba(17, 24, 39, .24); }
.c-page .article-size .book-cover, .c-page .book-media-size .book-cover, .c-page .article-size .book-cove, .c-page .book-media-size .book-cove { aspect-ratio: 16 / 10; }
.c-page .book-cover a, .c-page .book-cove a { display: block; height: 100%; }
.c-page .cover-books, .c-page .cover-media_video { width: 100% !important; height: 100% !important; max-height: none !important; object-fit: cover; border-radius: 0; box-shadow: none !important; display: block; }
.c-page .caption { padding: 8px 2px 0; }
.c-page .text-book-name { max-width: none !important; text-align: center !important; white-space: normal; font-size: 13.5px; line-height: 1.35; margin: 0 0 2px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.c-page .text-book-name b { font-weight: 500; }
.c-page .text-book-name a { color: var(--text); }
.c-page .product-thumb:hover .text-book-name, .c-page .product-thumb:hover .text-book-name a { color: var(--p-text); }
@media (prefers-reduced-motion: reduce) { .c-page .book-cover, .c-page .book-cove { transition: none; } }
.c-page .corner-ribbon { background: var(--p) !important; color: var(--on-p); }
.c-page .table { --bs-table-bg: #fff; border-color: var(--line); }
.c-page .table > thead > tr > th, .c-page .table thead th { background: #FAFAFB; color: var(--muted); font-weight: 500; font-size: 13px; }
.c-page .pagination { flex-wrap: wrap; gap: 4px; }
.c-page .pagination > li > a, .c-page .pagination > li > span { display: inline-block; min-width: 36px; padding: 6px 10px; text-align: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #4B5563; }
.c-page .pagination > li.active > span, .c-page .pagination > li.active > a { background: var(--p); border-color: var(--p); color: var(--on-p); }
.c-page img { max-width: 100%; }
@media (max-width: 575.98px) {
    .c-page #show-list-ebook, .c-page .row:has(> .books-list) { grid-template-columns: repeat(3, 1fr); gap: 14px 10px; }
    .c-page .row:has(> .article-list), .c-page .row:has(> .youtube-list) { grid-template-columns: repeat(2, 1fr); gap: 14px 10px; }
    .c-page .text-book-name { font-size: 12.5px; }
}

/* ===== 7 per-page fixes (body.act-<action>) ===== */

/* book detail (products/product_detail.php): inline padding-top 50px + carousel margin-top 20px left a big empty band under the top bar */
.c-page #product_detail #content > .row:first-child { padding-top: 6px !important; }
/* book detail on phones: borrow / read / return / queue / preview buttons centred; notes under them on their own line (PC unchanged) */
@media (max-width: 767.98px) {
    .c-page #product_detail #product .button-group { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; text-align: center; }
    .c-page #product_detail #product .button-group > br { display: none; }
    .c-page #product_detail #product .button-group > .btn, .c-page #product_detail #product .button-group > a { margin: 0 !important; }
    .c-page #product_detail #product .button-group > small, .c-page #product_detail #product .button-group > p { flex-basis: 100%; margin: 4px 0 0; }
}
.c-page #product_detail #carousel-example-generic { margin-top: 0 !important; border-radius: 12px; overflow: hidden; border-color: var(--line) !important; }

/* tabs were styled by the classic site.css (.htabs), not loaded here */
.c-page .htabs { margin: 24px 0 0; border-bottom: 1px solid var(--line); }
.c-page .htabs .nav { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; }
.c-page .htabs .nav > li { list-style: none; }
.c-page .htabs .nav > li > a { display: block; padding: 10px 16px; margin-bottom: -1px; font-size: 14px !important; font-weight: 500;
    color: var(--muted); border-bottom: 2px solid transparent; text-decoration: none !important; }
.c-page .htabs .nav > li > a:hover { color: var(--text); }
.c-page .htabs .nav > li > a.active, .c-page .htabs .nav > li.active > a { color: var(--p-text); border-bottom-color: var(--p); }
.c-page .htabs + .tab-content { padding: 16px 2px 4px; font-size: 14px; line-height: 1.7; }
/* availability (left / queue / days): the view sets font-size 2rem (20px under BS3's 10px root, 32px here) — three compact columns */
.c-page .table-quantity { width: 100%; margin: 14px 0 16px; font-size: 14px !important; background: #fff; border: 1px solid var(--line) !important;
    border-radius: 12px; overflow: hidden; border-collapse: separate; }
.c-page .table-quantity > tbody { display: grid; grid-template-columns: repeat(3, 1fr); }
.c-page .table-quantity tr { display: contents; }
.c-page .table-quantity th, .c-page .table-quantity td { display: block; text-align: center; padding: 0 8px !important; border: 0 !important;
    box-shadow: none !important; background: transparent !important; }
.c-page .table-quantity th { padding-top: 10px !important; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.c-page .table-quantity td.list-amount { padding-bottom: 10px !important; font-size: 20px; font-weight: 700; line-height: 1.3; color: var(--p-text); }
.c-page .table-quantity th:nth-child(n+2), .c-page .table-quantity td:nth-child(n+2) { border-left: 1px solid var(--line-soft) !important; }

/* home (c/products/index.php) */
.c-welcome { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; margin-bottom: 22px; }
.c-hello { position: relative; overflow: hidden; background: var(--p); color: var(--on-p); border-radius: var(--radius); padding: 22px 24px; }
.c-hello::after { content: ""; position: absolute; right: -50px; top: -50px; width: 190px; height: 190px; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.c-hello h2 { color: inherit; font-size: 21px; margin: 0 0 4px; }
.c-hello p { margin: 0 0 14px; opacity: .9; font-size: 14px; }
.c-hello .btn { position: relative; z-index: 1; color: var(--text); }
.c-reading { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.c-reading-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; font-size: 14px; }
.c-reading-h a { font-size: 13px; }
.c-reading-item { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-soft); color: var(--text) !important; }
.c-reading-h + .c-reading-item { border-top: 0; }
.c-reading-item img { width: 38px; height: 54px; object-fit: cover; border-radius: 5px; flex-shrink: 0; background: #E9EBEF; }
.c-reading-item b { display: block; font-size: 13.5px; font-weight: 500; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.c-reading-item small { color: var(--muted); font-size: 12px; }
.c-reading { display: flex; flex-direction: column; }
.c-reading-none { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 96px; padding: 10px 0 6px; color: var(--muted); font-size: 13.5px; text-align: center; }
.c-reading-none .fa { font-size: 22px; color: var(--faint); }
@media (max-width: 767.98px) { .c-welcome { grid-template-columns: 1fr; } }

/* ===== 8 auth pages (layouts/c/auth.php): login / register / confirm on a page of their own ===== */
body.c-auth-page { min-height: 100vh; background: linear-gradient(180deg, var(--p-soft) 0, var(--bg) 420px); }
.c-auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 12px 16px 40px; }
.c-auth-top { width: 100%; max-width: 960px; display: flex; align-items: center; gap: 16px; min-height: 36px; font-size: 14px; }
.c-auth-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted) !important; }
.c-auth-link:hover { color: var(--text) !important; text-decoration: none !important; }
.c-auth-link .fa { font-size: 18px; line-height: 1; }
.c-auth-main { width: 100%; flex: 1; display: flex; align-items: center; justify-content: center; padding: 12px 0 0; }
.c-auth-main > .container { width: 100%; padding: 0; }
.c-auth-main #content, .c-auth-main #content-register { float: none !important; width: 100% !important; max-width: 560px; margin: 0 auto !important; padding: 0 !important; }
.c-auth-main .login-center { float: none; width: 100%; padding: 0; }
/* the card: login (.login-center > div) and register (#content-register) */
.c-auth-main .login-center > div, .c-auth-main #content-register { float: none !important; width: 100% !important; margin: 0 auto !important; background: #fff;
    border: 1px solid var(--line) !important; border-radius: 18px !important; box-shadow: 0 18px 40px rgba(17, 24, 39, .08) !important; }
.c-auth-main .login-center > div { max-width: 400px; padding: 30px 28px 22px !important; }
.c-auth-main #content-register { padding: 26px 28px !important; }
.c-auth-main .login-center > div > p:first-child img { width: 96px !important; height: 96px; object-fit: contain; }
.c-auth-main .hr-sect { margin: 14px 0; }
.c-auth-main .hr-sect h1 { font-size: 13px !important; font-weight: 500; color: var(--muted); margin: 0; }
.c-auth-main .control-label, .c-auth-main label { font-size: 13.5px; font-weight: 500; margin-bottom: 4px; }
.c-auth-main .form-group { margin-bottom: 14px; }
.c-auth-main input[type=text], .c-auth-main input[type=password], .c-auth-main input[type=email], .c-auth-main input[type=tel] {
    height: 44px; padding: 8px 14px !important; border-radius: 10px !important; font-size: 14px; }
.c-auth-main .checkbox { margin: 8px 2px !important; font-size: 13.5px; }
.c-auth-main input[type=checkbox] { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }
.c-auth-main input[type=submit], .c-auth-main button[type=submit] { width: 100%; height: 44px; padding: 0 16px !important; border-radius: 10px !important; border: 0 !important; margin-bottom: 10px; font-size: 15px; }
.c-auth-main .social-button { border-radius: 10px !important; }
.c-auth-main .alert { border-radius: 12px; font-size: 14px; max-width: 560px; margin: 0 auto 14px; }
@media (max-width: 575.98px) {
    .c-auth { padding: 8px 12px 28px; }
    .c-auth-main .login-center > div, .c-auth-main #content-register { padding: 24px 18px 18px !important; border-radius: 16px !important; }
}

/* ===== 9 home popup (#myPopup, markup + base CSS in layouts/c/legacy_body.php) ===== */
/* centred on screen and sized to fit it: the classic box sits at margin 10% from the top and grows past the bottom */
.front-c #myPopup[style*="block"] { display: flex !important; align-items: center; justify-content: center; padding: 24px 16px; }
.front-c #myPopup .custom-popup-content { display: inline-block; width: auto; max-width: min(800px, 100%); margin: 0 !important; border-radius: 14px; background: #fff; }
/* the "ไม่แสดงอีกวันนี้ / ปิด" strip (~46px, layouts/_home_popup.php) sits under the image: square bottom corners, and
   the image leaves room for it on screen */
.front-c #myPopup .custom-popup-content img { display: block; width: auto !important; max-width: 100%; height: auto; max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px); margin: 0 auto; border-radius: 14px 14px 0 0; }
.front-c #myPopup .carousel-inner { border-radius: 14px 14px 0 0; }
.front-c #myPopup iframe { display: block; max-width: 100%; border: 0; border-radius: 14px 14px 0 0; }
/* reCAPTCHA (login page + login popup, only when RECAPTCHA_SITE_KEY is set): the legacy global
   `iframe { width: 100%; height: 556px }` (layouts/c/legacy_body.php, for the video popup) stretched
   its box to 556px and made the login page scroll. Give it back Google's own size. */
.front-c .g-recaptcha iframe { width: 304px; height: 78px; aspect-ratio: auto; max-width: none; }
@media (max-width: 359.98px) { .front-c .g-recaptcha { transform: scale(.84); transform-origin: 50% 0; } }
.front-c #myPopup .custom-popup-close { top: -14px; right: -14px; width: 36px; height: 36px; font-size: 18px; line-height: 1; box-shadow: 0 4px 12px rgba(0, 0, 0, .25); z-index: 5; }
@media (max-width: 575.98px) { .front-c #myPopup .custom-popup-close { top: -10px; right: -6px; } }

/* ===== 10 package page (c/package/index.php) ===== */
.c-pk { --pk-pink: #E8577A; --pk-blue: #1F8FD1; --pk-orange: #F07A1F; --pk-green: #4E9A06; max-width: 1180px; margin: 0 auto; }
.c-pk-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: stretch; margin-bottom: 30px; }
.c-pk-hero-text { position: relative; overflow: hidden; background: linear-gradient(135deg, var(--p) 0%, var(--p-dark) 100%); color: var(--on-p); border-radius: var(--radius); padding: 28px 30px; }
.c-pk-hero-text::after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 240px; height: 240px; border-radius: 50%; background: rgba(255, 255, 255, .10); }
.c-pk-hero-text::before { content: ""; position: absolute; right: 70px; top: -40px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255, 255, 255, .07); }
.c-pk-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; background: rgba(255, 255, 255, .16); border-radius: 999px; padding: 4px 12px; margin-bottom: 14px; }
.front-c .c-pk-hero-text h1 { color: inherit; font-size: 25px; font-weight: 700; line-height: 1.35; margin: 0 0 10px; max-width: 520px; position: relative; z-index: 1; }
.c-pk-hero-text p { margin: 0; opacity: .88; font-size: 14px; max-width: 480px; position: relative; z-index: 1; }

.c-pk-mine { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: 0 1px 2px rgba(17, 24, 39, .04); display: flex; flex-direction: column; justify-content: center; gap: 8px; border-top: 4px solid #16A34A; }
.c-pk-mine.is-soon { border-top-color: #F59E0B; }
.c-pk-mine.is-expired { border-top-color: #DC2626; }
.c-pk-mine.is-none { flex-direction: row; align-items: center; gap: 16px; border-top-color: var(--line); }
.c-pk-mine-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.c-pk-mine-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.c-pk-pill { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px; background: #DCFCE7; color: #15803D; white-space: nowrap; }
.is-soon .c-pk-pill { background: #FEF3C7; color: #B45309; }
.is-expired .c-pk-pill { background: #FEE2E2; color: #B91C1C; }
.c-pk-mine-name { font-size: 19px; font-weight: 700; color: var(--text); line-height: 1.35; }
.c-pk-mine-until { font-size: 13.5px; color: var(--muted); }
.c-pk-mine-until b { color: var(--text); font-weight: 600; }
.c-pk-days { color: var(--text); }
.c-pk-bar { height: 6px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.c-pk-bar > span { display: block; height: 100%; border-radius: inherit; background: #16A34A; }
.is-soon .c-pk-bar > span { background: #F59E0B; }
.is-expired .c-pk-bar > span { background: #DC2626; }
.c-pk-pending { font-size: 13px; color: #B45309; }
.front-c .c-pk-renew { align-self: flex-start; margin-top: 4px; background: var(--p); color: var(--on-p); }
.front-c .c-pk-renew:hover { background: var(--p-dark); color: var(--on-p); }
.c-pk-none-ico { flex: 0 0 52px; height: 52px; border-radius: 50%; background: var(--p-soft); color: var(--p-text); display: inline-flex; align-items: center; justify-content: center; font-size: 22px; }

.c-pk-head { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; scroll-margin-top: calc(var(--top-h) + 16px); }
.front-c .c-pk-head h2 { font-size: 20px; font-weight: 700; margin: 0; white-space: nowrap; }
.c-pk-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.c-pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; padding-top: 6px; }
.c-pk-card { --pk: var(--pk-blue); position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 24px 22px 22px; box-shadow: 0 1px 2px rgba(17, 24, 39, .05); transition: transform .18s ease, box-shadow .18s ease; }
.c-pk-card::before { content: ""; position: absolute; left: 22px; right: 22px; top: -1px; height: 4px; border-radius: 0 0 6px 6px; background: var(--pk); }
.c-pk-card.is-pink { --pk: var(--pk-pink); }
.c-pk-card.is-blue { --pk: var(--pk-blue); }
.c-pk-card.is-orange { --pk: var(--pk-orange); }
.c-pk-card.is-green { --pk: var(--pk-green); }
.c-pk-card:hover, .c-pk-card:focus-within { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(17, 24, 39, .10); }
.front-c .c-pk-name { font-size: 16px; font-weight: 700; color: var(--pk); margin: 0 0 12px; line-height: 1.4; }
.front-c .c-pk-card.is-hot .c-pk-name { padding-right: 56px; }
.c-pk-price { display: flex; align-items: flex-start; gap: 2px; color: var(--text); line-height: 1; }
.c-pk-cur { font-size: 20px; font-weight: 600; margin-top: 5px; }
.c-pk-amount { font-size: 40px; font-weight: 700; letter-spacing: -.02em; }
.c-pk-term { margin: 10px 0 18px; font-size: 13.5px; color: var(--muted); }
.c-pk-feat { list-style: none; margin: 0 0 22px; padding: 16px 0 0; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 12px; flex: 1; }
.c-pk-feat li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.c-pk-feat li > .fa { flex: 0 0 22px; height: 22px; border-radius: 50%; background: var(--line-soft); background: color-mix(in srgb, var(--pk) 14%, #fff); color: var(--pk); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.c-pk-feat li > span { flex: 1; min-width: 0; }
.c-pk-feat li > b { font-size: 15px; white-space: nowrap; }
.c-pk-feat li > b small { font-size: 12px; font-weight: 400; color: var(--muted); }
.front-c .c-pk-buy { display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; border-radius: 12px; border: 1px solid var(--pk); color: var(--pk); background: #fff; font-weight: 600; }
.front-c .c-pk-buy:hover, .front-c .c-pk-buy:focus-visible { background: var(--pk); color: #fff; }

.c-pk-card.is-hot { border-color: transparent; background: linear-gradient(160deg, #3F8A00 0%, #6DB30C 100%); color: #fff; box-shadow: 0 16px 34px rgba(78, 154, 6, .32); }
.c-pk-card.is-hot::before { display: none; }
.front-c .c-pk-card.is-hot .c-pk-name, .c-pk-card.is-hot .c-pk-price { color: #fff; }
.c-pk-card.is-hot .c-pk-term, .c-pk-card.is-hot .c-pk-feat li > b small { color: rgba(255, 255, 255, .82); }
.c-pk-card.is-hot .c-pk-feat { border-top-color: rgba(255, 255, 255, .35); }
.c-pk-card.is-hot .c-pk-feat li > .fa { background: rgba(255, 255, 255, .22); color: #fff; }
.front-c .c-pk-card.is-hot .c-pk-buy { background: #fff; border-color: #fff; color: #3F8A00; }
.front-c .c-pk-card.is-hot .c-pk-buy:hover { background: #F0FBE4; color: #2F6A00; }
.c-pk-hot { position: absolute; top: -18px; right: -12px; width: 78px; height: auto; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .18)); transform: rotate(8deg); }
.c-pk-empty { grid-column: 1 / -1; text-align: center; padding: 40px 16px; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); }

@media (max-width: 991.98px) { .c-pk-hero { grid-template-columns: 1fr; } }
@media (max-width: 575.98px) {
    .c-pk-hero-text { padding: 22px 20px; }
    .front-c .c-pk-hero-text h1 { font-size: 21px; }
    .c-pk-amount { font-size: 36px; }
    .c-pk-hot { right: -4px; width: 70px; }
}
@media (prefers-reduced-motion: reduce) { .c-pk-card { transition: none; } .c-pk-card:hover, .c-pk-card:focus-within { transform: none; } }

/* ===== 11 notifications (bell list, c/notification/index.php) ===== */
.c-bell-scroll { max-height: min(62vh, 440px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.c-bell-item + .c-bell-item { border-top: 1px solid var(--line-soft); }
.c-bell-nt { position: relative; }
.c-bell-nt.is-unread { background: rgba(var(--p-rgb), .05); }
.c-bell-nt.is-unread::after { content: ""; position: absolute; top: 18px; right: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--p); }
.c-bell-nt .c-bell-text { padding-right: 14px; }
.c-bell-nt .c-bell-ico { background: var(--p-soft); color: var(--p-text); overflow: hidden; }
.c-bell-nt .c-bell-ico.is-news { background: #DBEAFE; color: #1D4ED8; }
.c-bell-nt .c-bell-ico.is-promotion { background: #FCE7F3; color: #BE185D; }
.c-bell-ico > img { width: 100%; height: 100%; object-fit: cover; }
.c-bell-msg { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.c-bell-all { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 14px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.front-c a.c-bell-all:hover { background: #F9FAFB; text-decoration: none; }

.c-nt { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 20px; align-items: start; max-width: 1200px; margin: 0 auto; }
.c-nt-list { position: sticky; top: calc(var(--top-h) + 16px); display: flex; flex-direction: column; max-height: calc(100vh - var(--top-h) - 40px); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.c-nt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.front-c .c-nt-head h1 { font-size: 18px; font-weight: 700; margin: 0; }
.c-nt-unread { font-size: 12px; color: var(--p-text); background: var(--p-soft); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.c-nt-items { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.front-c a.c-nt-item { position: relative; display: flex; gap: 12px; padding: 14px 30px 14px 16px; border-bottom: 1px solid var(--line-soft); color: inherit; text-decoration: none; }
.front-c a.c-nt-item:hover { background: #F9FAFB; text-decoration: none; color: inherit; }
.front-c a.c-nt-item.is-active { background: var(--p-soft); }
.c-nt-item.is-active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--p); }
.c-nt-thumb { flex: 0 0 46px; height: 46px; border-radius: 12px; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; background: var(--p-soft); color: var(--p-text); }
.c-nt-thumb.is-news { background: #DBEAFE; color: #1D4ED8; }
.c-nt-thumb.is-promotion { background: #FCE7F3; color: #BE185D; }
.c-nt-thumb > img { width: 100%; height: 100%; object-fit: cover; }
.c-nt-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.c-nt-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--faint); }
.c-nt-tag { font-size: 11px; font-weight: 600; border-radius: 999px; padding: 1px 8px; background: var(--line-soft); color: var(--muted); }
.c-nt-tag.is-news { background: #DBEAFE; color: #1D4ED8; }
.c-nt-tag.is-promotion { background: #FCE7F3; color: #BE185D; }
.c-nt-title { font-size: 14px; font-weight: 500; color: var(--text); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.c-nt-item.is-unread .c-nt-title { font-weight: 700; }
.c-nt-msg { font-size: 13px; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.c-nt-dot { position: absolute; top: 20px; right: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--p); display: none; }
.c-nt-item.is-unread .c-nt-dot { display: block; }
.front-c a.c-nt-pkg { display: flex; align-items: center; gap: 12px; margin: 12px 12px 4px; padding: 12px 14px; border-radius: 12px; text-decoration: none; color: inherit; }
.c-nt-pkg.is-expired { background: #FEF2F2; border: 1px solid #FECACA; }
.c-nt-pkg.is-soon { background: #FFFBEB; border: 1px solid #FDE68A; }
.c-nt-pkg > .fa { font-size: 20px; flex-shrink: 0; }
.c-nt-pkg.is-expired > .fa { color: #B91C1C; }
.c-nt-pkg.is-soon > .fa { color: #B45309; }
.c-nt-pkg > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.c-nt-pkg strong { font-size: 13.5px; font-weight: 600; color: var(--text); }
.c-nt-pkg small { font-size: 12.5px; font-weight: 600; color: var(--p-text); }
.front-c a.c-nt-pkg:hover { filter: brightness(.98); text-decoration: none; color: inherit; }
.c-nt-none { padding: 48px 16px; text-align: center; color: var(--muted); font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.c-nt-none .fa { font-size: 28px; color: var(--faint); }

.c-nt-detail { min-height: 440px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 30px 30px; }
.front-c .c-nt-back { display: none; align-items: center; gap: 6px; border: 0; background: none; padding: 0; margin: 0 0 14px; font-size: 14px; font-weight: 600; color: var(--p-text); }
.c-nt-empty { min-height: 380px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; color: var(--muted); font-size: 14px; }
.c-nt-empty p { margin: 0; max-width: 320px; }
.c-nt-empty-ico { width: 64px; height: 64px; border-radius: 50%; background: var(--p-soft); color: var(--p-text); display: inline-flex; align-items: center; justify-content: center; font-size: 26px; }
.c-nt-article .c-nt-meta { margin-bottom: 10px; }
.front-c .c-nt-h { font-size: 22px; font-weight: 700; line-height: 1.4; margin: 0 0 14px; }
.c-nt-img { display: block; max-width: 100%; height: auto; border-radius: 12px; margin: 0 0 16px; }
.c-nt-text { font-size: 15px; line-height: 1.7; color: #374151; white-space: pre-line; margin: 0 0 16px; }
.c-nt-frame { display: block; width: 100%; height: 120px; border: 0; margin-top: 4px; }

@media (max-width: 991.98px) {
    .c-nt { grid-template-columns: 1fr; }
    .c-nt-list { position: static; max-height: none; }
    .c-nt.show-detail .c-nt-list, .c-nt:not(.show-detail) .c-nt-detail { display: none; }
    .front-c .c-nt-back { display: inline-flex; }
    .c-nt-detail { min-height: 0; padding: 18px 18px 22px; }
    .front-c .c-nt-h { font-size: 19px; }
}

/* ===== 12 phone categories sheet (mobile_nav.php, the tab bar's "Books" tab) ===== */
.c-sheet.offcanvas-bottom { --bs-offcanvas-height: auto; max-height: 82vh; border-radius: 18px 18px 0 0; border-top: 0; box-shadow: 0 -10px 30px rgba(17, 24, 39, .16); }
.c-sheet-grip { width: 40px; height: 4px; border-radius: 999px; background: #D5D9E0; margin: 8px auto 0; }
.c-sheet .offcanvas-header { padding: 10px 18px 6px; }
.front-c .c-sheet .offcanvas-title { font-size: 17px; font-weight: 700; margin: 0; }
.c-sheet .offcanvas-body { padding: 4px 12px calc(16px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; }
.c-menu .c-sheet-search { margin: 4px 4px 8px; width: calc(100% - 8px); height: 38px; }
.c-sheet-list .c-link { padding: 11px 10px; font-size: 15px; }
.c-sheet-list .c-sub { padding-left: 14px; font-size: 14.5px; }
.c-sheet-list .c-link + .c-link { border-top: 1px solid var(--line-soft); border-radius: 0; }
.c-sheet-list .c-link.active { border-radius: var(--radius-sm); }

/* ===== 13 login popup (#loginModal, markup + inline styles in layouts/c/legacy_body.php) =====
   Same markup and behaviour (Google / Facebook / Mula / email login, reCAPTCHA, register, forgot password);
   only spacing and type, matching the login page (section 8). !important where the markup has style="". */
.front-c #loginModal .modal-dialog { max-width: 420px !important; width: calc(100% - 24px); margin: 4vh auto; }
.front-c #loginModal .modal-content { border: 0; border-radius: 20px; box-shadow: 0 24px 60px rgba(17, 24, 39, .22); overflow: hidden; }
.front-c #loginModal .modal-body { padding: 0; }
.front-c #loginModal .modal-body > .container { position: relative; width: 100%; max-width: none; padding: 26px 28px 18px !important; }
.front-c #loginModal .container > .close { position: absolute !important; top: 14px !important; right: 14px !important; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: #F3F4F6; color: var(--muted) !important; font-size: 14px; opacity: 1; float: none; text-shadow: none; cursor: pointer; }
.front-c #loginModal .container > .close:hover { background: #E5E7EB; color: var(--text) !important; }
.front-c #loginModal .container > center { margin-top: 0 !important; }
.front-c #loginModal .container > center + br { display: none; }
.front-c #loginModal .container > center h2 { font-size: 21px; font-weight: 700; margin: 0 0 14px; color: var(--text); }
.front-c #loginModal .container > p > img { display: block; width: 72px !important; height: 72px; object-fit: contain; margin: 0 auto; }
.front-c #loginModal .container > p.text-center { margin: 0 0 16px; font-size: 13.5px; color: var(--muted); }
.front-c #loginModal .social-button { display: flex !important; align-items: center; justify-content: center; height: 46px; line-height: 1.2; margin: 0 0 10px; padding: 0 16px 0 46px !important;
    border-radius: 12px !important; font-size: 14px; text-transform: none; text-align: center; }
.front-c #loginModal .social-button > span { padding-left: 0 !important; }
.front-c #loginModal .social-button b { font-weight: 600; }
.front-c #loginModal #google-connect, .front-c #loginModal #google-connect:hover { background-size: 22px 22px !important; background-position: 16px center !important; }
.front-c #loginModal #facebook-connect, .front-c #loginModal #facebook-connect:hover { background-size: auto 26px !important; background-position: 8px center !important; }
.front-c #loginModal #mula-connect, .front-c #loginModal #mula-connect:hover { background-size: 26px 26px !important; background-position: 14px center !important; }
.front-c #loginModal .hr-sect { margin: 12px 0 14px; }
.front-c #loginModal .hr-sect::before, .front-c #loginModal .hr-sect::after { background: var(--line); margin: 0 10px; }
.front-c #loginModal .hr-sect h1 { font-size: 12.5px !important; font-weight: 500; color: var(--faint); margin: 0; }
.front-c #loginModal .hr-sect h1 b { font-weight: 500; }
.front-c #loginModal .form-group { margin-bottom: 12px; }
.front-c #loginModal .control-label { display: block; font-size: 13.5px; font-weight: 500; color: var(--text); margin-bottom: 5px; }
.front-c #loginModal input[type=text], .front-c #loginModal input[type=password] { height: 44px; padding: 8px 14px !important; border-radius: 10px !important; font-size: 14px;
    background: #F9FAFB; border: 1px solid var(--line); box-shadow: none; }
.front-c #loginModal input[type=text]:focus, .front-c #loginModal input[type=password]:focus { background: #fff; border-color: var(--p); box-shadow: 0 0 0 3px rgba(var(--p-rgb), .15); }
.front-c #loginModal .checkbox { margin: 8px 2px 0 !important; font-size: 13px; color: var(--muted); }
.front-c #loginModal .checkbox label { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; cursor: pointer; }
.front-c #loginModal input[type=checkbox] { width: 16px; height: 16px; margin: 0; }
.front-c #loginModal .checkbox + p, .front-c #loginModal .form-group p.text-left { padding-top: 6px !important; margin: 0; font-size: 13px; color: var(--muted); }
.front-c #loginModal .g-recaptcha { margin: 2px auto 0; }
.front-c #loginModal input[type=submit] { width: 100%; height: 46px; padding: 0 16px !important; margin: 4px 0 10px; border: 0 !important; border-radius: 12px !important; font-size: 15px; font-weight: 600;
    background: var(--p); color: var(--on-p); }
.front-c #loginModal input[type=submit].btn-primary:hover, .front-c #loginModal input[type=submit].btn-primary:focus { background-color: var(--p-dark) !important; color: var(--on-p) !important; border: 0 !important; }
.front-c #loginModal form .text-center > a { display: inline-block; font-size: 13px; }
.front-c #loginModal .container > p.text-center:last-child, .front-c #loginModal .container > p:last-of-type small { font-size: 12px; line-height: 1.5; margin: 6px 0 0; }
@media (max-width: 379.98px) {
    .front-c #loginModal .modal-body > .container { padding: 22px 16px 14px !important; }
    .front-c #loginModal .g-recaptcha { transform: scale(.9); transform-origin: center top; }
}

/* ===== 14 YouTube pages (c/library/media_video.php list + popup, c/library/media_video_detail.php) ===== */
.c-vd, .c-vl { max-width: 1280px; margin: 0 auto; }
.c-vd-crumb { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13.5px; color: var(--muted); margin: 6px 0 16px; }
.c-vd-crumb > span { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60ch; }
.c-vd-crumb .fa-angle-right { color: var(--faint); }
.c-vd-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.c-vd-grid.is-single { grid-template-columns: minmax(0, 1fr); max-width: 980px; margin: 0 auto; }
/* player: 16:9, dark, poster image + round play button until clicked */
.c-vd-player { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #0B0D12; box-shadow: 0 18px 40px rgba(17, 24, 39, .22); }
.c-vd-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.c-vd-poster { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: #0B0D12; cursor: pointer; display: block; }
.c-vd-poster img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease, filter .35s ease; }
.c-vd-poster::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 13, 18, 0) 45%, rgba(11, 13, 18, .55) 100%); pointer-events: none; }
.c-vd-poster:hover img, .c-vd-poster:focus-visible img { transform: scale(1.03); filter: brightness(.9); }
.c-vd-poster:focus-visible { outline: 3px solid rgba(var(--p-rgb), .6); outline-offset: -3px; }
/* YouTube's own play button (SVG from frontUiYoutubePlayIcon(), brand red #FF0000 in every theme), 68:48 */
.c-vd-play { position: absolute; left: 50%; top: 50%; z-index: 1; width: 84px; transform: translate(-50%, -50%); line-height: 0; pointer-events: none;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .35)); transition: transform .2s ease; }
.c-vd-play svg { display: block; width: 100%; height: auto; }
.c-vd-poster:hover .c-vd-play, .c-vd-poster:focus-visible .c-vd-play, .c-vl-thumb:hover .c-vd-play, .c-vl-thumb:focus-visible .c-vd-play,
.c-vd-more a:hover .c-vd-play { transform: translate(-50%, -50%) scale(1.1); }
.c-vd-play.is-sm { width: 60px; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .35)); }
.c-vd-play.is-xs { width: 34px; filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .3)); }
.c-vd-noplayer { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #C9CDD6; text-align: center; padding: 20px; }
.c-vd-noplayer p { margin: 0; }
/* title, meta, buttons, description */
.c-vd-info { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px 22px; margin-top: 18px; box-shadow: 0 1px 2px rgba(17, 24, 39, .04); }
.front-c .c-vd-title { font-size: 22px; font-weight: 700; line-height: 1.4; margin: 0 0 8px; overflow-wrap: anywhere; }
.c-vd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 13px; color: var(--muted); }
.c-vd-meta .fa { margin-right: 4px; }
.c-vd-badge { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-size: 12px; color: #B91C1C; background: #FEE2E2; border-radius: 999px; padding: 3px 10px; }
.c-vd-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.c-vd-actions .btn { display: inline-flex; align-items: center; gap: 7px; }
.front-c .c-vd-copy { background: var(--line-soft); border-color: var(--line); color: var(--text); }
.front-c .c-vd-copy:hover { background: var(--line); }
.front-c .c-vd-copy.is-done { background: #DCFCE7; border-color: #BBF7D0; color: #15803D; }
.front-c .c-vd-h { font-size: 15px; font-weight: 600; margin: 20px 0 8px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.c-vd-desc { font-size: 15px; line-height: 1.75; color: #374151; overflow-wrap: anywhere; }
.c-vd-desc p:last-child { margin-bottom: 0; }
.c-vd-desc img, .c-vd-desc iframe { max-width: 100%; height: auto; }
/* "more videos" */
.c-vd-side { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 14px 10px; box-shadow: 0 1px 2px rgba(17, 24, 39, .04); position: sticky; top: calc(var(--top-h) + 16px); }
.c-vd-side-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 6px 10px; }
.front-c .c-vd-side-head h2 { font-size: 16px; font-weight: 600; margin: 0; }
.c-vd-side-head a { font-size: 13px; }
.c-vd-more { list-style: none; margin: 0; padding: 0; }
.front-c .c-vd-more a { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 12px; align-items: start; padding: 7px 6px; border-radius: 10px; color: var(--text); text-decoration: none; }
.front-c .c-vd-more a:hover, .front-c .c-vd-more a:focus-visible { background: var(--line-soft); color: var(--text); text-decoration: none; }
.c-vd-more-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #E9EBEF; display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 20px; }
.c-vd-more-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.c-vd-more-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.c-vd-more-title { font-size: 13.5px; font-weight: 500; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.front-c .c-vd-more a:hover .c-vd-more-title { color: var(--p-text); }
.c-vd-more-date { font-size: 12px; color: var(--faint); }
/* empty states */
.c-vd-empty { text-align: center; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 48px 20px; margin: 10px auto; max-width: 560px; }
.front-c .c-vd-empty h1, .front-c .c-vd-empty h2 { font-size: 19px; font-weight: 600; margin: 14px 0 6px; }
.c-vd-empty p { color: var(--muted); margin: 0 0 16px; }
.c-vd-empty-ico { width: 60px; height: 60px; border-radius: 50%; background: var(--p-soft); color: var(--p-text); display: inline-flex; align-items: center; justify-content: center; font-size: 24px; }
.c-vd-noplayer .c-vd-empty-ico { background: rgba(255, 255, 255, .08); color: #E5E7EB; }
/* list page */
.c-vl-head { display: flex; align-items: center; gap: 14px; margin: 6px 0 20px; }
.c-vl-head-ico { flex: 0 0 48px; height: 48px; border-radius: 14px; background: var(--p-soft); color: var(--p-text); display: inline-flex; align-items: center; justify-content: center; font-size: 22px; }
.front-c .c-vl-head h1 { font-size: 22px; font-weight: 700; margin: 0; }
.c-vl-head p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.c-vl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px 20px; }
.c-vl-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
    box-shadow: 0 1px 2px rgba(17, 24, 39, .04); transition: transform .18s ease, box-shadow .18s ease; }
.c-vl-card:hover, .c-vl-card:focus-within { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(17, 24, 39, .14); }
.c-vl-thumb { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; background: #0B0D12; cursor: pointer; overflow: hidden; }
.c-vl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease, filter .35s ease; }
.c-vl-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 13, 18, 0) 50%, rgba(11, 13, 18, .45) 100%); pointer-events: none; }
.c-vl-thumb:hover img, .c-vl-thumb:focus-visible img { transform: scale(1.05); filter: brightness(.92); }
.c-vl-thumb:focus-visible { outline: 3px solid rgba(var(--p-rgb), .6); outline-offset: -3px; }
.front-c a.c-vl-thumb.is-none { display: flex; align-items: center; justify-content: center; background: #E9EBEF; color: var(--faint); font-size: 30px; text-decoration: none; }
.front-c a.c-vl-thumb.is-none::after { display: none; }
.c-vl-body { padding: 12px 14px 14px; }
.front-c .c-vl-title { font-size: 15px; font-weight: 600; line-height: 1.45; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.front-c .c-vl-title a { color: var(--text); }
.front-c .c-vl-title a:hover { color: var(--p-text); }
.c-vl-desc { margin: 5px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.c-vl-pages { display: flex; justify-content: center; margin-top: 26px; }
/* popup: dark, wide, 16:9 player on top, scrolling description */
.c-vm .modal-dialog { max-width: min(1040px, calc(100vw - 32px)); }
.front-c .c-vm .modal-content { background: #11131A; color: #E5E7EB; overflow: hidden; border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.c-vm-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 34px; height: 34px; padding: 0; border-radius: 50%; background-color: rgba(0, 0, 0, .55); background-size: 12px; opacity: .9; }
.c-vm-close:hover { opacity: 1; background-color: rgba(0, 0, 0, .75); }
.c-vm-player { position: relative; aspect-ratio: 16 / 9; background: #000; }
.c-vm-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.c-vm-body { padding: 18px 22px 6px; }
.front-c .c-vm-title { color: #fff; font-size: 19px; font-weight: 600; line-height: 1.4; margin: 0 0 8px; overflow-wrap: anywhere; }
.c-vm-desc { font-size: 14px; line-height: 1.7; color: #BFC4CE; max-height: 22vh; overflow-y: auto; overflow-wrap: anywhere; padding-right: 4px; }
.c-vm-desc a { color: #93C5FD; }
.c-vm-desc img { max-width: 100%; height: auto; }
.c-vm-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 22px 18px; }
.c-vm-foot .btn { display: inline-flex; align-items: center; gap: 7px; }
.front-c .c-vm-btn-ghost { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); color: #E5E7EB; }
.front-c .c-vm-btn-ghost:hover, .front-c .c-vm-btn-ghost:focus { background: rgba(255, 255, 255, .16); color: #fff; }
@media (max-width: 991.98px) {
    .c-vd-grid { grid-template-columns: minmax(0, 1fr); }
    .c-vd-side { position: static; }
}
@media (max-width: 575.98px) {
    .c-vd-player { border-radius: 12px; }
    .c-vd-info { padding: 16px; }
    .front-c .c-vd-title, .front-c .c-vl-head h1 { font-size: 19px; }
    .c-vd-poster .c-vd-play { width: 66px; }
    .c-vd-actions .btn { flex: 1 1 auto; justify-content: center; }
    .c-vl-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .c-vm .modal-dialog { max-width: none; margin: 8px; }
    .c-vm-body { padding: 14px 16px 4px; }
    .c-vm-foot { padding: 10px 16px 16px; }
    .c-vm-foot .btn { flex: 1 1 auto; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
    .c-vd-poster img, .c-vl-thumb img, .c-vl-card, .c-vd-play { transition: none; }
}

/* ===== 15 (free) — the orange book-spine background moved to the admin login: css/admin/login-bg.css ===== */
/* ===== 16 document files (c/products/document_file.php list + popup #cDocModal, js/c/document_file.js) ===== */
.c-dl { max-width: 1280px; margin: 0 auto; }
.c-dl-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; margin: 6px 0 20px; }
.c-dl-top .c-vl-head { margin: 0; min-width: 0; }
.c-dl-top .c-vl-head p { overflow-wrap: anywhere; }
/* after a popup tag (?search=): "all files" pill next to the result line */
.front-c .c-dl-all { display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
    background: var(--p-soft); color: var(--p-text); text-decoration: none; white-space: nowrap; }
.front-c .c-dl-all:hover, .front-c .c-dl-all:focus-visible { background: var(--p); color: var(--on-p); text-decoration: none; }
/* cards */
.c-dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 22px 20px; }
.c-dl-card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
    box-shadow: 0 1px 2px rgba(17, 24, 39, .04); transition: transform .18s ease, box-shadow .18s ease; }
.c-dl-card:hover, .c-dl-card:focus-within { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(17, 24, 39, .14); }
/* the cover sits on a soft "desk" panel like a sheet of paper; any cover ratio fits (contain) */
.c-dl-cover { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 4 / 5; padding: 18px 18px 14px; border: 0; cursor: pointer; overflow: hidden;
    background: radial-gradient(120% 90% at 50% 0%, rgba(var(--p-rgb), .10), transparent 60%), linear-gradient(180deg, #F4F5F8, #E9EBF0); }
.c-dl-cover img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; border-radius: 4px; background: #fff;
    box-shadow: 0 1px 2px rgba(17, 24, 39, .08), 0 10px 22px rgba(17, 24, 39, .18); transition: transform .3s ease, box-shadow .3s ease; }
.c-dl-cover:hover img, .c-dl-cover:focus-visible img { transform: translateY(-4px) rotate(-.6deg); box-shadow: 0 2px 4px rgba(17, 24, 39, .08), 0 18px 32px rgba(17, 24, 39, .24); }
.c-dl-cover:focus-visible { outline: 3px solid rgba(var(--p-rgb), .6); outline-offset: -3px; }
.c-dl-noimg { display: none; font-size: 54px; color: var(--faint); }
.c-dl-cover.is-none .c-dl-noimg, .c-dm-cover.is-none .c-dl-noimg { display: block; }
.c-dm-cover.is-none img { display: none; }
/* file-type chip: colour by kind (the familiar app colours), the theme colour for anything else */
.c-dl-type { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .04em; line-height: 1; color: #fff; background: var(--p); }
.c-dl-type.is-other { color: var(--on-p); }
.c-dl-type:empty { display: none; }
.c-dl-cover .c-dl-type { position: absolute; top: 10px; left: 10px; box-shadow: 0 2px 6px rgba(17, 24, 39, .2); }
.c-dl-type.is-pdf { background: #D93025; } .c-dl-type.is-word { background: #2B579A; } .c-dl-type.is-sheet { background: #1D7044; }
.c-dl-type.is-slide { background: #C43E1C; } .c-dl-type.is-zip { background: #5B6170; } .c-dl-type.is-image { background: #7C3AED; }
.c-dl-type.is-audio { background: #DB2777; } .c-dl-type.is-video { background: #0E7490; } .c-dl-type.is-text { background: #475569; }
.c-dl-noimg { opacity: .85; }
.is-pdf > .c-dl-noimg { color: #D93025; } .is-word > .c-dl-noimg { color: #2B579A; } .is-sheet > .c-dl-noimg { color: #1D7044; }
.is-slide > .c-dl-noimg { color: #C43E1C; } .is-image > .c-dl-noimg { color: #7C3AED; } .is-audio > .c-dl-noimg { color: #DB2777; } .is-video > .c-dl-noimg { color: #0E7490; }
.c-dl-body { padding: 12px 14px 4px; flex: 1 1 auto; }
.front-c .c-dl-title { font-size: 15px; font-weight: 600; line-height: 1.45; margin: 0; }
.c-dl-title button { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding: 0; border: 0; background: none; color: var(--text); font: inherit; text-align: left; overflow-wrap: anywhere; cursor: pointer; }
.c-dl-title button:hover, .c-dl-title button:focus-visible { color: var(--p-text); }
.c-dl-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.c-dl-meta .fa { margin-right: 3px; color: var(--faint); }
.c-dl-foot { display: flex; gap: 8px; padding: 10px 14px 14px; }
.c-dl-foot .btn { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.front-c .c-dl-btn-ghost { background: var(--line-soft); border: 1px solid var(--line); color: var(--text); }
.front-c .c-dl-btn-ghost:hover, .front-c .c-dl-btn-ghost:focus { background: var(--line); color: var(--text); }
/* popup: cover panel left, details right; one column on phones */
.c-dm .modal-dialog { max-width: min(880px, calc(100vw - 32px)); }
.front-c .c-dm .modal-content { border: 0; border-radius: 18px; overflow: hidden; box-shadow: 0 30px 80px rgba(17, 24, 39, .35); }
.c-dm-close { position: absolute; top: 14px; right: 14px; z-index: 3; width: 34px; height: 34px; padding: 0; border-radius: 50%; background-color: rgba(255, 255, 255, .9); background-size: 11px; opacity: .8; box-shadow: 0 2px 8px rgba(17, 24, 39, .12); }
.c-dm-close:hover { opacity: 1; }
/* desktop: the cover stays put and only the details column scrolls (long descriptions) */
.c-dm .c-dm-body { display: grid; grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); padding: 0; overflow: hidden; min-height: 0; }
.c-dm-info { overflow-y: auto; overscroll-behavior: contain; }
.c-dm-cover { position: relative; display: flex; align-items: center; justify-content: center; padding: 28px 24px; min-height: 340px;
    background: radial-gradient(120% 80% at 50% 0%, rgba(var(--p-rgb), .14), transparent 65%), linear-gradient(180deg, #F4F5F8, #E6E8EE); }
.c-dm-cover img { max-width: 100%; max-height: 62vh; width: auto; height: auto; display: block; border-radius: 4px; background: #fff; box-shadow: 0 2px 4px rgba(17, 24, 39, .08), 0 18px 36px rgba(17, 24, 39, .22); }
.c-dm-cover .c-dl-noimg { font-size: 84px; }
.c-dm-info { padding: 26px 28px 22px; min-width: 0; }
.front-c .c-dm-title { font-size: 22px; font-weight: 700; line-height: 1.35; margin: 10px 44px 6px 0; overflow-wrap: anywhere; }
.c-dm-author { margin: 0; color: var(--muted); font-size: 14px; }
.c-dm-author .fa { color: var(--faint); margin-right: 2px; }
.c-dm-author b { color: var(--text); font-weight: 600; }
.c-dm-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0 4px; }
.c-dm-stats > div { background: var(--line-soft); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.c-dm-stats dt { font-size: 12px; font-weight: 500; color: var(--muted); margin: 0 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-dm-stats dt .fa { color: var(--faint); }
.c-dm-stats dd { margin: 0; font-size: 15px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.front-c .c-dm-h { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin: 18px 0 6px; }
.c-dm-desc { font-size: 15px; line-height: 1.7; color: #374151; overflow-wrap: anywhere; }
.c-dm-desc p:last-child { margin-bottom: 0; }
.c-dm-desc img { max-width: 100%; height: auto; }
.c-dm-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.front-c .c-dm-tag { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 999px; font-size: 13px; background: var(--p-soft); color: var(--p-text); text-decoration: none; }
.front-c .c-dm-tag:hover, .front-c .c-dm-tag:focus-visible { background: var(--p); color: var(--on-p); text-decoration: none; }
.c-dm-foot { gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line-soft); background: var(--card); }
.c-dm-foot > * { margin: 0; }
.c-dm-foot .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.c-dm-dl small { font-size: 12px; opacity: .8; font-weight: 500; }
.c-dm-dl small:empty { display: none; }
.c-dm-dl small::before { content: "("; } .c-dm-dl small::after { content: ")"; }
@media (max-width: 767.98px) {
    .c-dm .c-dm-body { display: block; overflow-y: auto; }
    .c-dm-info { overflow: visible; }
    .c-dm-cover { min-height: 0; padding: 22px 20px 18px; }
    .c-dm-cover img { max-height: 36vh; }
    .c-dm-cover .c-dl-noimg { font-size: 64px; }
    .c-dm-info { padding: 18px 18px 16px; }
    .front-c .c-dm-title { font-size: 19px; margin-right: 0; }
}
@media (max-width: 575.98px) {
    .c-dl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .c-dl-cover { padding: 12px 12px 10px; }
    .c-dl-body { padding: 10px 10px 2px; }
    .front-c .c-dl-title { font-size: 14px; }
    .c-dl-foot { flex-direction: column; gap: 6px; padding: 8px 10px 10px; }
    .c-dm .modal-dialog { max-width: none; margin: 8px; }
    .c-dm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .c-dm-foot { padding: 10px 14px; }
    .c-dm-foot .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { .c-dl-card, .c-dl-cover img { transition: none; } }

/* ===== 17 articles (c/library/article.php list, c/library/view_article.php reading page) ===== */
.c-ar { max-width: 1280px; margin: 0 auto; }
.c-ar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px 20px; }
.c-ar-card { position: relative; display: flex; flex-direction: column; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
    box-shadow: 0 1px 2px rgba(17, 24, 39, .04); transition: transform .18s ease, box-shadow .18s ease; }
.c-ar-card:hover, .c-ar-card:focus-within { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(17, 24, 39, .14); }
.front-c a.c-ar-cover { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: linear-gradient(135deg, var(--p-soft), #ECEEF2); text-decoration: none; }
.c-ar-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.c-ar-card:hover .c-ar-cover img { transform: scale(1.04); }
.c-ar-noimg { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; font-size: 40px; color: var(--p-text); opacity: .45; }
.c-ar-cover.is-none .c-ar-noimg { display: flex; }
.c-ar-body { display: flex; flex-direction: column; flex: 1 1 auto; padding: 14px 16px 16px; min-width: 0; }
.c-ar-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.c-ar-tags span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; font-weight: 600; color: var(--p-text); background: var(--p-soft); border-radius: 999px; padding: 2px 10px; }
.front-c .c-ar-title { font-size: 16px; font-weight: 600; line-height: 1.45; margin: 0; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.front-c .c-ar-title a { color: var(--text); text-decoration: none; }
.front-c .c-ar-title a:hover, .front-c .c-ar-title a:focus-visible { color: var(--p-text); }
/* the whole card is clickable through the title link */
.c-ar-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.c-ar-excerpt { margin: 6px 0 0; font-size: 13.5px; line-height: 1.6; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.c-ar-excerpt:empty { display: none; }
.c-ar-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: auto 0 0; padding-top: 12px; font-size: 12.5px; color: var(--faint); }
.c-ar-meta .fa { margin-right: 2px; }
.c-ar-author { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* featured: newest article on page 1, cover left, text right */
.c-ar-card.is-featured { grid-column: 1 / -1; flex-direction: row; }
.c-ar-card.is-featured .c-ar-cover { flex: 0 0 56%; aspect-ratio: auto; min-height: 300px; }
.c-ar-card.is-featured .c-ar-body { padding: 26px 30px 28px; justify-content: center; }
.front-c .c-ar-card.is-featured .c-ar-title { font-size: 24px; line-height: 1.35; -webkit-line-clamp: 3; }
.c-ar-card.is-featured .c-ar-excerpt { font-size: 15px; line-height: 1.7; -webkit-line-clamp: 4; margin-top: 10px; }
.c-ar-card.is-featured .c-ar-meta { margin-top: 14px; padding-top: 0; }
.front-c .c-ar-read { position: relative; z-index: 2; align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; border-radius: 999px; padding: 8px 20px; }
.c-ar-card.is-featured .c-ar-tags { position: relative; z-index: 2; }
/* reading page */
.c-ar-page { max-width: 900px; }
.c-ar-read-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 12px 32px rgba(17, 24, 39, .06); }
.c-ar-hero { margin: 0; background: #E9EBEF; }
.c-ar-hero img { display: block; width: 100%; max-height: 460px; object-fit: cover; }
.c-ar-read-inner { padding: 30px 48px 36px; }
.front-c .c-ar-h1 { font-size: 30px; font-weight: 700; line-height: 1.35; margin: 0 0 18px; overflow-wrap: anywhere; }
.c-ar-byline { display: flex; align-items: center; gap: 12px; padding-bottom: 20px; margin-bottom: 26px; border-bottom: 1px solid var(--line-soft); }
.c-ar-avatar { flex: 0 0 42px; height: 42px; border-radius: 50%; background: var(--p-soft); color: var(--p-text); display: inline-flex; align-items: center; justify-content: center; font-size: 18px; }
.c-ar-byline-text { flex: 1 1 auto; min-width: 0; }
.c-ar-by { margin: 0; font-size: 14px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.c-ar-when { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.c-ar-when .fa { margin-right: 3px; color: var(--faint); }
.c-ar-copy { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 14px; }
/* article body from the admin editor: one readable size, inline font sizes/families evened out, media fitted */
.c-ar-prose { font-size: 16.5px; line-height: 1.9; color: #2B303B; overflow-wrap: anywhere; }
.c-ar-prose p, .c-ar-prose span, .c-ar-prose div, .c-ar-prose li, .c-ar-prose font, .c-ar-prose td, .c-ar-prose a, .c-ar-prose strong, .c-ar-prose b, .c-ar-prose em {
    font-size: inherit !important; font-family: inherit !important; line-height: inherit !important; }
.c-ar-prose p { margin: 0 0 1.05em; }
.c-ar-prose > :first-child { margin-top: 0; }
.c-ar-prose > :last-child { margin-bottom: 0; }
.c-ar-prose p:empty { display: none; }
.c-ar-prose h1, .c-ar-prose h2, .c-ar-prose h3, .c-ar-prose h4 { font-weight: 700; line-height: 1.45; margin: 1.5em 0 .6em; }
.c-ar-prose h1 { font-size: 1.6em; } .c-ar-prose h2 { font-size: 1.4em; } .c-ar-prose h3 { font-size: 1.22em; } .c-ar-prose h4 { font-size: 1.08em; }
.c-ar-prose a { color: var(--p-text); text-decoration: underline; text-underline-offset: 2px; }
.c-ar-prose img { max-width: 100% !important; height: auto !important; border-radius: 10px; }
.c-ar-prose iframe, .c-ar-prose video { display: block; width: 100% !important; max-width: 100%; height: auto !important; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; margin: 1em 0; }
.c-ar-prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1em 0; }
.c-ar-prose td, .c-ar-prose th { border: 1px solid var(--line); padding: 6px 10px; }
.c-ar-prose blockquote { margin: 1.2em 0; padding: 4px 0 4px 18px; border-left: 4px solid rgba(var(--p-rgb), .5); color: #4B5563; font-style: italic; }
.c-ar-prose ul, .c-ar-prose ol { padding-left: 1.4em; margin: 0 0 1.05em; }
.c-ar-prose hr { margin: 2em 0; border: 0; border-top: 1px solid var(--line); }
.c-ar-foot-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.c-ar-foot-tags > .fa { color: var(--faint); margin-right: 2px; }
.c-ar-tag { font-size: 13px; color: var(--p-text); background: var(--p-soft); border-radius: 999px; padding: 4px 12px; }
.c-ar-more { margin-top: 34px; }
.c-ar-more-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.front-c .c-ar-more-head h2 { font-size: 19px; font-weight: 700; margin: 0; }
.c-ar-more-head a { font-size: 14px; }
.c-ar-grid.is-more { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.c-ar-grid.is-more .c-ar-body { padding: 12px 14px 14px; }
.front-c .c-ar-grid.is-more .c-ar-title { font-size: 14.5px; }
.c-ar-grid.is-more .c-ar-meta { padding-top: 8px; }
@media (max-width: 991.98px) {
    .c-ar-card.is-featured { flex-direction: column; }
    .c-ar-card.is-featured .c-ar-cover { flex: none; aspect-ratio: 16 / 9; min-height: 0; }
    .c-ar-card.is-featured .c-ar-body { padding: 18px 20px 22px; }
    .front-c .c-ar-card.is-featured .c-ar-title { font-size: 21px; }
    .c-ar-read-inner { padding: 26px 28px 30px; }
}
@media (max-width: 575.98px) {
    .c-ar-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .c-ar-grid.is-more { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .c-ar-grid.is-more .c-ar-body { padding: 10px; }
    .front-c .c-ar-grid.is-more .c-ar-title { font-size: 13.5px; }
    .front-c .c-ar-card.is-featured .c-ar-title { font-size: 19px; }
    .c-ar-read-card { border-radius: 14px; }
    .c-ar-read-inner { padding: 20px 18px 24px; }
    .front-c .c-ar-h1 { font-size: 23px; }
    .c-ar-byline { flex-wrap: wrap; }
    .c-ar-copy { margin-left: 54px; }
    .c-ar-prose { font-size: 16px; line-height: 1.85; }
}
@media (prefers-reduced-motion: reduce) { .c-ar-card, .c-ar-cover img { transition: none; } }

/* ===== 18 book detail (c/products/product_detail.php + js/c/product_detail.js) ===== */
.c-pd { max-width: 1280px; margin: 0 auto; }
.c-pd-hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 32px; align-items: start; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 26px; box-shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 12px 32px rgba(17, 24, 39, .05); }
/* gallery: the cover standing on a soft panel tinted with the theme */
.c-pd-gallery { position: sticky; top: calc(var(--top-h) + 16px); min-width: 0; }
.c-pd-stage { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 5; max-height: min(600px, calc(100vh - var(--top-h) - 140px)); margin: 0 auto; padding: 28px; border-radius: 16px; overflow: hidden;
    background: radial-gradient(110% 80% at 50% 0%, rgba(var(--p-rgb), .16), transparent 65%), linear-gradient(180deg, #F4F5F8, #E7E9EE); }
.c-pd-stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 6px; box-shadow: 0 2px 4px rgba(17, 24, 39, .08), 0 22px 44px rgba(17, 24, 39, .26); }
.c-pd-noimg { font-size: 80px; color: var(--p-text); opacity: .35; }
.c-pd-thumbs { display: flex; justify-content: center; gap: 8px; margin-top: 12px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.c-pd-thumb { flex: 0 0 58px; height: 74px; padding: 4px; border: 2px solid transparent; border-radius: 10px; background: #F1F2F5; cursor: pointer; }
.c-pd-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 4px; }
.c-pd-thumb:hover { border-color: var(--line); }
.c-pd-thumb.is-active { border-color: var(--p); background: var(--p-soft); }
/* info column */
.c-pd-info { min-width: 0; }
.c-pd-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.c-pd-type, .c-pd-avail { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; border-radius: 999px; padding: 4px 12px; }
.c-pd-type { background: var(--p-soft); color: var(--p-text); }
.c-pd-avail.is-ok { background: #DCFCE7; color: #15803D; }
.c-pd-avail.is-out { background: #FEF3C7; color: #B45309; }
.front-c .c-pd-title { font-size: 28px; font-weight: 700; line-height: 1.35; margin: 0 0 8px; overflow-wrap: anywhere; }
.c-pd-by { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 18px; font-size: 14.5px; color: var(--muted); }
.c-pd-by b { color: var(--text); font-weight: 600; }
.c-pd-by .fa { color: var(--faint); margin-right: 2px; }
.c-pd-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 20px; }
.c-pd-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; font-size: 16px; padding: 10px 22px; }
.c-pd-actions .btn-borrow, .c-pd-actions .btn-add-queue, .c-pd-actions #btn-read-ebook { min-width: 200px; box-shadow: 0 8px 20px rgba(var(--p-rgb), .28); }
.c-pd-actions #btn-read-ebook { box-shadow: 0 8px 20px rgba(22, 163, 74, .28); }
.front-c .c-pd-btn-ghost { background: var(--card); border: 1px solid var(--line); color: var(--text); }
.front-c .c-pd-btn-ghost:hover, .front-c .c-pd-btn-ghost:focus { background: var(--line-soft); border-color: #D5D9E0; color: var(--text); }
.front-c .c-pd-pending { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; background: #FEF3C7; color: #92400E; font-weight: 600; text-decoration: none; }
.front-c .c-pd-pending:hover { background: #FDE68A; color: #78350F; }
.c-pd-note { flex-basis: 100%; margin: 0; font-size: 13.5px; color: #B45309; }
.c-pd-note .fa { margin-right: 4px; }
/* availability / queue / wait days */
.c-pd-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.c-pd-stats > div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px; border-radius: 14px; background: var(--line-soft); border: 1px solid var(--line); text-align: center; }
.c-pd-stats b { font-size: 22px; font-weight: 700; line-height: 1.2; color: var(--p-text); }
.c-pd-stats b small { font-size: 14px; font-weight: 600; color: var(--muted); }
.c-pd-stats span { font-size: 12.5px; color: var(--muted); }
/* "request to library" page (c/products/product_detail_ads.php): why / what happens next */
.c-pd-req { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-bottom: 18px; border-radius: 14px; background: #FFFBEB; border: 1px solid #FDE68A; }
.c-pd-req.is-done { background: #F0FDF4; border-color: #BBF7D0; }
.c-pd-req-ico { flex: none; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #FEF3C7; color: #B45309; font-size: 16px; }
.c-pd-req.is-done .c-pd-req-ico { background: #DCFCE7; color: #15803D; }
.c-pd-req b { display: block; font-size: 14.5px; margin-bottom: 2px; color: var(--text); }
.c-pd-req span { font-size: 13.5px; color: var(--muted); }
.c-pd-stats > .is-ok b { color: #15803D; }
.c-pd-stats > .is-out b { color: #B45309; }
/* specs: two columns of label/value */
.c-pd-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin: 0 0 18px; border-top: 1px solid var(--line-soft); }
.c-pd-specs > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); min-width: 0; }
.c-pd-specs dt { flex: 0 0 auto; font-weight: 500; font-size: 13.5px; color: var(--muted); }
.c-pd-specs dd { margin: 0; min-width: 0; font-size: 14px; font-weight: 500; color: var(--text); text-align: right; overflow-wrap: anywhere; }
.c-pd-qr { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; border: 1px dashed #D5D9E0; background: #FAFBFC; }
.c-pd-qr img { flex: 0 0 auto; border-radius: 8px; background: #fff; padding: 4px; border: 1px solid var(--line); }
.c-pd-qr b { display: block; font-size: 14.5px; }
.c-pd-qr span { font-size: 13px; color: var(--muted); }
/* description / contents tabs */
.c-pd-tabs { margin-top: 24px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.c-pd-tablist { display: flex; gap: 4px; padding: 10px 14px 0; border-bottom: 1px solid var(--line); background: #FAFBFC; }
.front-c .c-pd-tablist .nav-link { position: relative; border: 0; background: none; padding: 10px 16px 12px; font-weight: 600; font-size: 15px; color: var(--muted); }
.front-c .c-pd-tablist .nav-link:hover { color: var(--text); }
.front-c .c-pd-tablist .nav-link.active { color: var(--p-text); }
.c-pd-tablist .nav-link.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--p); }
.c-pd-tabbody { padding: 22px 26px 26px; }
.c-pd-desc { font-size: 15.5px; line-height: 1.85; color: #2B303B; overflow-wrap: anywhere; }
.c-pd-desc img { max-width: 100% !important; height: auto !important; }
.c-pd-desc iframe { width: 100% !important; height: auto !important; aspect-ratio: 16 / 9; border: 0; }
.c-pd-desc table { display: block; max-width: 100%; overflow-x: auto; }
/* shelves: horizontal, snap, arrows on wide screens */
.c-pd-shelf { margin-top: 30px; }
.c-pd-shelf-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.front-c .c-pd-shelf-head h2 { font-size: 19px; font-weight: 700; margin: 0; }
.c-pd-shelf-head h2 .fa { color: var(--p-text); margin-right: 4px; }
.c-pd-shelf-tools { display: flex; align-items: center; gap: 6px; }
.c-pd-shelf-tools a { font-size: 14px; margin-right: 6px; white-space: nowrap; }
.c-pd-arrow { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--text); display: inline-flex; align-items: center; justify-content: center; font-size: 18px; }
.c-pd-arrow:hover:not(:disabled) { background: var(--p-soft); border-color: rgba(var(--p-rgb), .35); color: var(--p-text); }
.c-pd-arrow:disabled { opacity: .35; cursor: default; }
.c-pd-shelf.is-fit .c-pd-arrow { display: none; }
.c-pd-shelf-track { display: grid; grid-auto-flow: column; grid-auto-columns: 150px; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 14px; scrollbar-width: thin; overscroll-behavior-x: contain; }
.front-c a.c-pd-book { scroll-snap-align: start; display: flex; flex-direction: column; gap: 8px; color: var(--text); text-decoration: none; }
.c-pd-book-cover { display: block; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: #E9EBEF; box-shadow: 0 1px 2px rgba(17, 24, 39, .08), 0 8px 18px rgba(17, 24, 39, .12); transition: transform .2s ease, box-shadow .2s ease; }
.c-pd-book-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.c-pd-book:hover .c-pd-book-cover, .c-pd-book:focus-visible .c-pd-book-cover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(17, 24, 39, .08), 0 16px 28px rgba(17, 24, 39, .2); }
.c-pd-book-name { font-size: 13.5px; font-weight: 500; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.front-c a.c-pd-book:hover .c-pd-book-name { color: var(--p-text); }
/* "how to read" popup (c/products/product_detail.php, product_detail_ads.php): icon + title head, numbered steps,
   get-the-app box; looks like the dialogs in section 21 */
.c-pd-readmodal .modal-dialog { max-width: 420px; margin-left: auto; margin-right: auto; padding: 0 16px; }
.front-c .c-pd-readmodal .modal-content { border: 0; border-radius: 22px; overflow: hidden; background: #fff; /* BS5 default = --bs-body-bg (the grey page) */ box-shadow: 0 24px 60px rgba(17, 24, 39, .24), 0 2px 6px rgba(17, 24, 39, .06); }
.c-rm-head { position: relative; padding: 28px 24px 18px; text-align: center; background: linear-gradient(180deg, var(--p-soft), #fff); }
.c-rm-badge { display: inline-flex; align-items: center; justify-content: center; width: 60px; height: 60px; margin-bottom: 12px; border-radius: 18px;
    background: var(--p); color: var(--on-p); font-size: 26px; box-shadow: 0 10px 22px rgba(var(--p-rgb), .3); transform: rotate(-6deg); }
.c-rm-badge .fa { transform: rotate(6deg); }
.front-c .c-pd-readmodal .modal-title { margin: 0; font-size: 19px; font-weight: 600; line-height: 1.4; }
.c-rm-sub { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.c-rm-x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
    border: 0; border-radius: 50%; background: rgba(255, 255, 255, .7); color: var(--muted); font-size: 15px; cursor: pointer; transition: background .15s, color .15s; }
.c-rm-x:hover { background: #fff; color: var(--text); }
.c-rm-x:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(var(--p-rgb), .35); }
.c-pd-readmodal .modal-body { padding: 6px 24px 4px; }
/* steps: a numbered line of text each, with a thin line joining the numbers */
.c-rm-steps { list-style: none; margin: 0; padding: 0; }
.c-rm-steps li { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 0 0 14px; font-size: 14.5px; line-height: 1.55; color: var(--text); text-align: left; }
.c-rm-steps li:last-child { padding-bottom: 0; }
.c-rm-steps li:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; border-radius: 2px; background: rgba(var(--p-rgb), .18); }
.c-rm-num { flex: 0 0 28px; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
    background: var(--p-soft); color: var(--p-text); font-size: 13px; font-weight: 600; line-height: 1; margin-top: -2px; }
/* phone: "open in the app" link from the server (LibraryController::getQrCode, inline-styled logo picture) */
.c-rm-deeplink { font-size: 14.5px; line-height: 1.6; color: var(--text); text-align: center; overflow-wrap: anywhere; }
.c-rm-deeplink br { display: none; }
.c-rm-deeplink a { display: table; margin: 14px auto 0; cursor: pointer; }
.c-rm-deeplink img { width: 150px !important; height: auto; padding: 10px 18px !important; border: 1px solid var(--line) !important; border-radius: 14px !important;
    background: #fff; box-shadow: 0 6px 16px rgba(17, 24, 39, .1) !important; transition: transform .15s, box-shadow .15s; }
.c-rm-deeplink a:hover img { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(17, 24, 39, .14) !important; }
/* get-the-app box */
.c-rm-app { margin-top: 18px; padding: 14px 16px 16px; border-radius: 16px; background: #F6F7F9; text-align: center; }
.c-rm-app p { margin: 0 0 10px; font-size: 13.5px; color: var(--muted); }
.c-rm-app a { display: block; max-width: 280px; margin: 0 auto; border-radius: 10px; transition: transform .15s; }
.c-rm-app a:hover { transform: translateY(-1px); }
.c-rm-app img { display: block; width: 100%; height: auto; }
.c-rm-foot { padding: 16px 24px 22px; }
.front-c .c-rm-close { width: 100%; height: 46px; border: 0; border-radius: 12px; background: #F1F3F6; color: #374151; font-size: 15px; font-weight: 500; }
.front-c .c-rm-close:hover { background: #E5E8ED; color: var(--text); }
@media (max-width: 575.98px) {
    .c-rm-head { padding: 24px 18px 16px; }
    .c-pd-readmodal .modal-body { padding: 6px 18px 4px; }
    .c-rm-foot { padding: 14px 18px 18px; }
}
@media (max-width: 991.98px) {
    .c-pd-hero { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 18px; }
    .c-pd-gallery { position: static; }
    .c-pd-stage { aspect-ratio: auto; height: min(62vh, 460px); }
    .c-pd-thumbs { justify-content: center; }
}
@media (max-width: 575.98px) {
    .c-pd-hero { border-radius: 16px; padding: 14px; margin: 0 -2px; }
    /* smaller cover so the title + borrow button are on the first screen */
    .c-pd-stage { height: min(34vh, 260px); padding: 12px; }
    .c-pd-thumbs { margin-top: 8px; }
    .c-pd-thumb { flex-basis: 44px; height: 56px; padding: 3px; border-radius: 8px; }
    .front-c .c-pd-title { font-size: 21px; }
    .c-pd-actions .btn { flex: 1 1 100%; }
    .c-pd-specs { grid-template-columns: minmax(0, 1fr); }
    .c-pd-stats b { font-size: 19px; }
    .c-pd-tabbody { padding: 16px; }
    .c-pd-tablist { padding: 8px 8px 0; overflow-x: auto; }
    .c-pd-shelf-track { grid-auto-columns: 120px; gap: 12px; }
    .c-pd-arrow { display: none; }
}
@media (prefers-reduced-motion: reduce) { .c-pd-book-cover { transition: none; } .c-pd-shelf-track { scroll-behavior: auto; } }

/* ===== 19 history (c/account/history_borrow.php: borrows / queue / packages) ===== */
.c-hs { max-width: 1080px; margin: 0 auto; }
/* tabs as a segmented bar with counts */
.front-c .c-hs-tabs { display: flex; flex-wrap: nowrap; gap: 6px; padding: 5px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); overflow-x: auto; scrollbar-width: none; }
.c-hs-tabs::-webkit-scrollbar { display: none; }
.front-c .c-hs-tabs .nav-item { flex: 1 0 auto; }
.front-c .c-hs-tabs .nav-link { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 0; padding: 10px 16px; border: 0; border-radius: 10px; font-weight: 600; font-size: 14.5px; color: var(--muted); white-space: nowrap; background: none; }
.front-c .c-hs-tabs .nav-link:hover { color: var(--text); background: var(--line-soft); }
.front-c .c-hs-tabs .nav-link.active { color: var(--on-p); background: var(--p); box-shadow: 0 6px 16px rgba(var(--p-rgb), .3); }
.c-hs-count { min-width: 22px; padding: 1px 7px; border-radius: 999px; font-size: 12px; line-height: 18px; text-align: center; background: var(--line-soft); color: var(--muted); }
.c-hs-tabs .nav-link.active .c-hs-count { background: rgba(255, 255, 255, .25); color: inherit; }
/* list rows: cover | text | actions */
.c-hs-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.c-hs-item { position: relative; display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 18px 14px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 1px 2px rgba(17, 24, 39, .04); }
.c-hs-item::before { content: ""; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: transparent; }
.c-hs-item.is-ok::before { background: #16A34A; }
.c-hs-item.is-wait::before { background: #F59E0B; }
.c-hs-item.is-info::before { background: #2563EB; }
.front-c a.c-hs-cover, .c-hs-cover { display: block; width: 72px; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; background: #E9EBEF; box-shadow: 0 4px 10px rgba(17, 24, 39, .14); }
.c-hs-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.c-hs-cover.is-icon { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; box-shadow: none; background: var(--p-soft); color: var(--p-text); font-size: 26px; border-radius: 14px; }
.c-hs-main { min-width: 0; }
.c-hs-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 4px; }
.c-hs-pill, .c-hs-left { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 20px; }
.c-hs-pill.is-ok { background: #DCFCE7; color: #15803D; }
.c-hs-pill.is-wait { background: #FEF3C7; color: #B45309; }
.c-hs-pill.is-info { background: #DBEAFE; color: #1D4ED8; }
.c-hs-pill.is-done { background: var(--line-soft); color: var(--muted); }
.c-hs-pill.is-off { background: var(--line-soft); color: var(--faint); }
.c-hs-pill.is-bad { background: #FEE2E2; color: #B91C1C; }
.c-hs-left { background: var(--p-soft); color: var(--p-text); }
.c-hs-left.is-soon { background: #FEE2E2; color: #B91C1C; }
.front-c .c-hs-name { font-size: 16px; font-weight: 600; line-height: 1.45; margin: 0 0 6px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.front-c .c-hs-name a { color: var(--text); text-decoration: none; }
.front-c .c-hs-name a:hover { color: var(--p-text); }
.c-hs-dates { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; font-size: 13px; }
.c-hs-dates > div { display: flex; gap: 6px; min-width: 0; }
.c-hs-dates dt { font-weight: 500; color: var(--faint); }
.c-hs-dates dd { margin: 0; color: #4B5563; }
.c-hs-email { margin: 4px 0 0; font-size: 12.5px; color: var(--faint); overflow-wrap: anywhere; }
.c-hs-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 120px; }
.c-hs-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 10px; white-space: nowrap; }
.c-hs-actions:empty { display: none; }
.front-c .c-hs-btn-ghost { background: var(--card); border: 1px solid var(--line); color: var(--text); }
.front-c .c-hs-btn-ghost:hover, .front-c .c-hs-btn-ghost:focus { background: var(--line-soft); color: var(--text); }
/* finished / cancelled rows step back a little */
.c-hs-item.is-done, .c-hs-item.is-off, .c-hs-item.is-bad { background: #FCFCFD; }
.c-hs-item.is-done .c-hs-cover img, .c-hs-item.is-off .c-hs-cover img, .c-hs-item.is-bad .c-hs-cover img { filter: saturate(.75); }
@media (max-width: 767.98px) {
    .c-hs-item { grid-template-columns: 60px minmax(0, 1fr); gap: 12px; padding: 12px; align-items: start; }
    .front-c a.c-hs-cover, .c-hs-cover { width: 60px; }
    .c-hs-actions { grid-column: 1 / -1; flex-direction: row; min-width: 0; }
    .c-hs-actions .btn { flex: 1 1 0; }
    .front-c .c-hs-name { font-size: 15px; }
    .c-hs-dates { flex-direction: column; gap: 2px; }
    .front-c .c-hs-tabs .nav-link { padding: 9px 12px; font-size: 13.5px; }
}
@media (max-width: 575.98px) { .front-c .c-hs-tabs .nav-link > .fa { display: none; } .front-c .c-hs-tabs .nav-link { padding: 9px 10px; gap: 6px; } }

/* ===== 20 book not found (c/products/product_not_found.php; shelf = section 18) ===== */
.c-nf { max-width: 1080px; margin: 0 auto; }
.c-nf-card { text-align: center; padding: 44px 24px 40px; margin-top: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 20px;
    background-image: radial-gradient(90% 70% at 50% 0%, rgba(var(--p-rgb), .10), transparent 70%); box-shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 12px 32px rgba(17, 24, 39, .05); }
.c-nf-ico { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 96px; height: 96px; border-radius: 28px; background: var(--p-soft); color: var(--p-text); font-size: 44px; transform: rotate(-6deg); }
.c-nf-ico-badge { position: absolute; right: -8px; bottom: -8px; width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    font-size: 17px; background: #F59E0B; color: #fff; border: 3px solid var(--card); transform: rotate(6deg); }
.front-c .c-nf-card h1 { font-size: 24px; font-weight: 700; margin: 22px 0 8px; line-height: 1.4; }
.c-nf-card > p { max-width: 520px; margin: 0 auto 18px; color: var(--muted); font-size: 15px; line-height: 1.7; }
.front-c .c-nf-mail { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; padding: 9px 18px; border-radius: 999px; border: 1px dashed #D5D9E0; background: #FAFBFC; color: var(--text); text-decoration: none; font-size: 14px; overflow-wrap: anywhere; }
.front-c .c-nf-mail:hover { border-color: rgba(var(--p-rgb), .45); background: var(--p-soft); color: var(--text); }
.c-nf-mail .fa { color: var(--p-text); font-size: 16px; }
.c-nf-mail b { color: var(--p-text); font-weight: 600; }
.c-nf-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.c-nf-actions .btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 12px; padding: 10px 22px; }
@media (max-width: 575.98px) {
    .c-nf-card { padding: 32px 16px 28px; border-radius: 16px; }
    .front-c .c-nf-card h1 { font-size: 20px; }
    .c-nf-actions .btn { flex: 1 1 100%; justify-content: center; }
}

/* ===== 21 dialogs (SweetAlert2: classes and icon glyphs set by js/c/swal-theme.js for every Swal.fire) ===== */
/* sizes in px: swal2 is sized in em of .swal2-popup (section 1 sets it to .75rem) */
body.front-c .c-swal-wrap.swal2-backdrop-show { background: rgba(17, 24, 39, .48); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
body.front-c .c-swal-wrap { padding: 16px; }
body.front-c .c-swal { width: 400px; max-width: 100%; padding: 32px 26px 24px; border-radius: 22px; font-family: var(--bs-body-font-family);
    box-shadow: inset 0 5px 0 var(--c-swal-tone), 0 24px 60px rgba(17, 24, 39, .24), 0 2px 6px rgba(17, 24, 39, .06); }
body.front-c .c-swal.swal2-show { animation: c-swal-in .26s cubic-bezier(.2, .8, .3, 1.15); }
body.front-c .c-swal.swal2-hide { animation: c-swal-out .16s ease-in forwards; }
@keyframes c-swal-in { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes c-swal-out { to { opacity: 0; transform: translateY(6px) scale(.97); } }
/* top accent in the icon's colour = the inset shadow above: it follows the rounded corners (a 5px-high ::before
   bar could not take a 22px radius, so its square ends stuck out past the corners) */
body.front-c .c-swal-wrap .swal2-header { padding: 0; }

/* icon: glyph in a soft round badge with a halo (replaces the outlined swal2 icon) */
body.front-c .c-swal .c-swal-icon { box-sizing: border-box; display: flex; align-items: center; justify-content: center; width: 68px; height: 68px;
    margin: 2px auto 18px; border: 0; border-radius: 50%; line-height: 1; color: var(--c-swal-tone); background: var(--c-swal-soft);
    box-shadow: 0 0 0 8px var(--c-swal-halo); }
body.front-c .c-swal .c-swal-icon .swal2-icon-content { display: flex; align-items: center; justify-content: center; font-size: 30px; line-height: 1; }
body.front-c .c-swal .c-swal-icon.swal2-icon-show { animation: c-swal-icon-pop .42s cubic-bezier(.2, .9, .3, 1.35) both; }
body.front-c .c-swal .c-swal-icon.swal2-icon-show .swal2-icon-content { animation: c-swal-glyph .42s .08s ease-out both; }
@keyframes c-swal-icon-pop { from { transform: scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes c-swal-glyph { from { transform: scale(.4) rotate(-14deg); opacity: 0; } to { transform: none; opacity: 1; } }
body.front-c .c-swal { --c-swal-tone: var(--p); --c-swal-soft: var(--p-soft); --c-swal-halo: rgba(var(--p-rgb), .07); }
/* tone per icon type: js/c/swal-theme.js adds c-swal-<icon> to the popup */
body.front-c .c-swal.c-swal-warning { --c-swal-tone: #D97706; --c-swal-soft: #FEF3C7; --c-swal-halo: rgba(245, 158, 11, .1); }
body.front-c .c-swal.c-swal-success { --c-swal-tone: #16A34A; --c-swal-soft: #DCFCE7; --c-swal-halo: rgba(22, 163, 74, .09); }
body.front-c .c-swal.c-swal-error { --c-swal-tone: #DC2626; --c-swal-soft: #FEE2E2; --c-swal-halo: rgba(220, 38, 38, .08); }
body.front-c .c-swal .swal2-image { margin: 0 auto 16px; max-width: 100%; border-radius: 14px; }

/* text */
body.front-c .c-swal .c-swal-title { margin: 0 0 6px; font-size: 20px; font-weight: 600; line-height: 1.4; color: var(--text); letter-spacing: 0; word-break: break-word; }
body.front-c .c-swal .c-swal-text { font-size: 15px; line-height: 1.65; color: var(--muted); word-break: break-word; }
body.front-c .c-swal .c-swal-text b, body.front-c .c-swal .c-swal-text strong { color: var(--text); font-weight: 600; }
/* call sites that put the question in the title with their own small inline size / red book name (js/library/order_history.js) */
body.front-c .c-swal .c-swal-title label[style] { display: block; margin: 0; font-size: 17px !important; font-weight: 500; line-height: 1.6 !important; color: var(--text); }
body.front-c .c-swal .c-swal-title span[style*="red"] { color: var(--p-text) !important; font-weight: 600; }
body.front-c .c-swal .c-swal-text label[style] { font-size: 15px !important; font-weight: 400; margin: 0; }

/* buttons: cancel (left) light grey, confirm (right) in the theme colour, same width */
body.front-c .c-swal .c-swal-actions { flex-wrap: nowrap; gap: 10px; margin: 24px 0 0; padding: 0; }
body.front-c .c-swal .c-swal-btn { flex: 1 1 0; min-width: 0; max-width: 200px; height: 46px; margin: 0; padding: 0 18px; border: 0; border-radius: 12px;
    font-family: inherit; font-size: 15px; font-weight: 500; line-height: 1; cursor: pointer; box-shadow: none;
    transition: background-color .15s, box-shadow .15s, transform .1s; }
body.front-c .c-swal .c-swal-btn:active { transform: translateY(1px); }
body.front-c .c-swal .c-swal-ok { background: var(--p); color: var(--on-p); box-shadow: 0 6px 16px rgba(var(--p-rgb), .28); }
body.front-c .c-swal .c-swal-ok:hover { background: var(--p-dark); }
body.front-c .c-swal .c-swal-cancel { background: #F1F3F6; color: #374151; }
body.front-c .c-swal .c-swal-cancel:hover { background: #E5E8ED; }
body.front-c .c-swal .c-swal-btn:focus { outline: none; }
body.front-c .c-swal .c-swal-ok:focus-visible { box-shadow: 0 0 0 3px #fff, 0 0 0 5px rgba(var(--p-rgb), .55); }
body.front-c .c-swal .c-swal-cancel:focus-visible { box-shadow: 0 0 0 3px #fff, 0 0 0 5px #C5CBD5; }
body.front-c .c-swal .swal2-actions.swal2-loading .c-swal-ok { opacity: .7; }
body.front-c .c-swal .c-swal-x { top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; font-size: 26px; color: var(--faint); }
body.front-c .c-swal .c-swal-x:hover { background: #F3F4F6; color: var(--text); }
body.front-c .c-swal .c-swal-input { height: 44px; margin: 16px 0 0; border: 1px solid var(--line); border-radius: 10px; box-shadow: none; font-size: 15px; }
body.front-c .c-swal .c-swal-input:focus { border-color: var(--p); box-shadow: 0 0 0 3px rgba(var(--p-rgb), .15); }
body.front-c .c-swal .c-swal-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 13px; color: var(--muted); }
body.front-c .c-swal .swal2-validation-message { margin: 14px 0 0; border-radius: 10px; font-size: 13.5px; }
@media (max-width: 575.98px) {
    body.front-c .c-swal { padding: 28px 18px 18px; border-radius: 20px; }
    body.front-c .c-swal .c-swal-title { font-size: 18px; }
    body.front-c .c-swal .c-swal-btn { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
    body.front-c .c-swal.swal2-show, body.front-c .c-swal.swal2-hide, body.front-c .c-swal .c-swal-icon.swal2-icon-show,
    body.front-c .c-swal .c-swal-icon.swal2-icon-show .swal2-icon-content { animation: none; }
}

/* ===== 22 how-to pages: tabs on top (c/account/_howto_nav.php) =====
   the pages themselves are posters: section 23 */
.c-ht { max-width: 980px; margin: 0 auto; }
.c-ht-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.c-ht-tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--muted) !important; font-size: 14px; text-decoration: none !important; transition: background .15s, border-color .15s, color .15s; }
.c-ht-tab:hover { border-color: rgba(var(--p-rgb), .45); color: var(--p-text) !important; }
.c-ht-tab.is-active { background: var(--p); border-color: var(--p); color: var(--on-p) !important; font-weight: 600; }

/* ===== 23 how-to posters (c/account/howto.php + _howto_poster_foot.php): laid out like the library posters =====
   dark theme background (--p-deep / --p-deeper), accent text --p-glow (4.5:1 on both, tests/front_ui/helper_test.php),
   headings in Kanit (loaded by the page), website pictures = HTML look-alikes (.c-mk-*), app pictures = poster cuts */
.c-htp { max-width: 980px; margin: 0 auto; display: grid; gap: 22px; }
.c-htp h1, .c-htp h2, .c-htp h3, .c-htp-num, .c-htp-big, .c-htp-strong, .c-htp-for, .c-htp-bcz, .c-htp-pill, .c-htp-line { font-family: "Kanit", var(--bs-body-font-family); }
.c-htp-poster { position: relative; overflow: hidden; isolation: isolate; border-radius: 22px; color: #fff; padding: 36px 44px 30px;
    background:
        radial-gradient(700px 420px at 85% 8%, rgba(var(--p-rgb), .30), transparent 65%),
        radial-gradient(620px 420px at 8% 92%, rgba(var(--p-rgb), .20), transparent 70%),
        linear-gradient(165deg, var(--p-deep) 0%, var(--p-deeper) 100%); }
.c-htp-poster p { color: inherit; }
.c-htp-blob { position: absolute; z-index: -1; border-radius: 50%; background: linear-gradient(135deg, var(--p-glow), var(--p)); pointer-events: none; }
.c-htp-blob.is-a { width: 280px; height: 280px; left: -110px; top: -120px; opacity: .30; }
.c-htp-blob.is-b { width: 340px; height: 340px; right: -130px; bottom: -170px; opacity: .22; }
.c-htp-blob.is-c { width: 340px; height: 300px; left: -190px; top: -170px; border-radius: 0 0 70% 30%; transform: rotate(-12deg); }
.c-htp-blob.is-d { width: 420px; height: 360px; left: -250px; bottom: -220px; border-radius: 60% 40% 0 0; transform: rotate(18deg); }
.c-htp-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; min-height: 30px; }
.c-htp-top.is-end { justify-content: flex-end; }
.c-htp-liblogo { display: block; height: 46px; width: auto; max-width: 260px; object-fit: contain; }
.c-htp-bcz { display: inline-flex; align-items: center; gap: 7px; font-size: 19px; font-weight: 500; color: #fff; }
.c-htp-bcz.is-sm { font-size: 20px; padding: 1px 12px; border-radius: 9px; background: rgba(255, 255, 255, .12); }
/* poster 1 */
.c-htp-intro-body { position: relative; text-align: center; max-width: 760px; margin: 14px auto 30px; }
.c-htp-h1 { margin: 0 0 10px; font-size: 46px; font-weight: 700; line-height: 1.15; color: var(--p-glow) !important; }
.c-htp-h1 small { display: block; margin-top: 8px; font-size: 34px; font-weight: 500; letter-spacing: .01em; word-break: break-all; }
.c-htp-strong { margin: 14px 0 4px; font-size: 25px; font-weight: 700; }
.c-htp-lead { margin: 0; font-size: 20px; line-height: 1.5; color: rgba(255, 255, 255, .9) !important; }
.c-htp-lead.is-lg { margin-top: 4px; font-size: 22px; color: #fff !important; }
.c-htp-for { margin: 26px 0 20px; font-size: 29px; font-weight: 700; line-height: 1.35; }
.c-htp-glow { margin: 0; font-size: 24px; color: var(--p-glow) !important; }
.c-htp-big { margin: 2px 0 6px; font-size: 54px; font-weight: 800; line-height: 1.12; color: var(--p-glow) !important; }
.c-htp-nw { white-space: nowrap; }
/* poster 2 */
.c-htp-h2 { position: relative; margin: 4px 0 34px; text-align: center; font-size: 60px; font-weight: 800; line-height: 1.05; color: var(--p-glow) !important; }
.c-htp-h2 small { display: block; margin-top: 10px; font-size: 34px; font-weight: 500; color: #fff; }
.c-htp-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 40px; }
.c-htp-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 30px; align-items: center; padding: 10px 0; }
/* the slanted theme bands behind every other step, as on the poster */
.c-htp-row:nth-child(even)::before { content: ""; position: absolute; z-index: -1; left: -80px; right: -80px; top: -26px; bottom: -26px; background: rgba(var(--p-rgb), .22); transform: skewY(-5deg); }
.c-htp-pic { position: relative; display: flex; justify-content: center; }
.c-htp-shot { display: block; width: 400px; max-width: 100%; height: auto; border-radius: 4px; box-shadow: 0 12px 30px rgba(0, 0, 0, .40); }
.c-htp-txt { display: flex; align-items: flex-start; gap: 16px; }
.c-htp-num { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 58px; height: 58px; border-radius: 50%; background: var(--p-glow); color: var(--p-deeper); font-size: 30px; font-weight: 700; box-shadow: 0 6px 18px rgba(0, 0, 0, .30); }
.c-htp-row:nth-child(even) .c-htp-num { background: #fff; }
.c-htp-txt h3 { margin: 6px 0 6px; font-size: 28px; font-weight: 700; line-height: 1.3; color: var(--p-glow) !important; }
.c-htp-txt p { margin: 0 0 6px; font-size: 20px; line-height: 1.45; }
.c-htp-app { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 26px !important; margin-top: 6px !important; }
.c-htp-stores img { display: block; width: 230px; max-width: 100%; height: auto; margin: 2px 0 10px; }
/* poster bottom */
.c-htp-foot { position: relative; display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 18px 24px; margin-top: 36px; }
.c-htp-foot-site, .c-htp-foot-ask { display: flex; flex-direction: column; gap: 8px; font-size: 15px; color: rgba(255, 255, 255, .92); }
.c-htp-foot-ask { align-items: center; text-align: center; }
.c-htp-pill { display: inline-flex; align-items: center; gap: 14px; padding: 9px 22px; border-radius: 999px; background: #fff; color: #1F2430 !important; font-size: 22px; text-decoration: none !important; }
.c-htp-pill .fa { color: #9AA1AE; }
.c-htp-line { display: inline-flex; align-items: center; gap: 10px; padding: 8px 22px 8px 10px; border-radius: 999px; background: #06C755; color: #fff !important; font-size: 22px; font-weight: 500; text-decoration: none !important; }
.c-htp-line:hover { background: #05B04B; }
.c-htp-line-ic { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: #fff; color: #06C755; font-family: Arial, sans-serif; font-size: 9px; font-weight: 800; }
/* website look-alikes (light UI on the dark poster, red marks like the poster's screenshots) */
.c-mk { position: relative; width: 100%; max-width: 420px; height: 270px; color: #1F2430; font-size: 12px; }
.c-mk i { font-style: normal; }
.c-mk-card { position: absolute; background: #fff; border-radius: 6px; box-shadow: 0 12px 30px rgba(0, 0, 0, .38); }
.c-mk-lines i { display: block; height: 7px; margin-bottom: 7px; border-radius: 4px; background: #E5E7EB; }
.c-mk-lines i:nth-child(1) { width: 92%; } .c-mk-lines i:nth-child(2) { width: 70%; } .c-mk-lines i:nth-child(3) { width: 80%; }
.c-mk-cover { display: block; aspect-ratio: 3 / 4; border-radius: 3px; background: linear-gradient(160deg, var(--p-glow), var(--p)); }
.c-mk-login > .c-mk-card:first-child { left: 0; top: 0; bottom: 0; width: 44%; padding: 16px 14px; display: flex; flex-direction: column; align-items: center; gap: 9px; }
.c-mk-login > .c-mk-card:first-child img { max-width: 86%; max-height: 46px; object-fit: contain; margin: 6px 0 2px; }
.c-mk-login > .c-mk-card:first-child b { font-size: 13px; }
.c-mk-field { display: block; width: 100%; height: 17px; border: 1px solid #D1D5DB; border-radius: 4px; }
.c-mk-btn { display: block; align-self: flex-end; width: 46px; height: 17px; border-radius: 4px; background: var(--p); }
.c-mk-zoom { right: 0; top: 0; width: 60%; padding: 14px 16px; display: flex; flex-direction: column; gap: 5px; outline: 3px solid #E53935; }
.c-mk-zoom label { margin: 0; font-size: 12px; color: #374151; }
.c-mk-input { display: block; padding: 6px 9px; border: 1px solid #D1D5DB; border-radius: 5px; font-size: 12px; color: #6B7280; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.c-mk-go { align-self: flex-end; margin-top: 6px; padding: 5px 12px; border-radius: 5px; background: var(--p); color: var(--on-p); font-size: 12px; font-weight: 600; }
.c-mk-login::after { content: ""; position: absolute; left: 34%; top: 52%; width: 74px; height: 3px; background: #E53935; transform: rotate(-38deg); transform-origin: left center; }
.c-mk-shelf { position: absolute; left: 0; top: 0; width: 78%; height: 62%; padding: 24px 10px 10px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; align-content: start; overflow: hidden; background: #fff; border-radius: 4px; box-shadow: 0 12px 30px rgba(0, 0, 0, .38); }
.c-mk-shelf::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 14px; background: var(--p); }
.c-mk-shelf i { display: block; aspect-ratio: 3 / 4; border-radius: 3px; background: linear-gradient(160deg, #FDE68A, #F59E0B); }
.c-mk-shelf i:nth-child(2) { background: linear-gradient(160deg, #A7F3D0, #10B981); }
.c-mk-shelf i:nth-child(3) { background: linear-gradient(160deg, #FECACA, #EF4444); }
.c-mk-shelf i:nth-child(4) { background: linear-gradient(160deg, #BFDBFE, #3B82F6); }
.c-mk-shelf i:nth-child(5) { background: linear-gradient(160deg, #DDD6FE, #8B5CF6); }
.c-mk-shelf i:nth-child(6) { background: linear-gradient(160deg, #FBCFE8, #EC4899); }
.c-mk-shelf i:nth-child(7) { background: linear-gradient(160deg, #E5E7EB, #6B7280); }
.c-mk-shelf .is-hit { outline: 3px solid #E53935; outline-offset: 1px; }
.c-mk-book { position: absolute; left: 24%; top: 30%; width: 76%; height: 70%; padding: 14px; display: grid; grid-template-columns: 32% 1fr; gap: 12px; align-content: start; background: #fff; border-radius: 4px; box-shadow: 0 14px 34px rgba(0, 0, 0, .42); }
.c-mk-borrowbtn { position: absolute; right: -8px; top: 10px; padding: 6px 12px; border-radius: 8px; background: #1F2430; color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; outline: 3px solid #E53935; outline-offset: 1px; }
.c-mk-dialog { position: absolute; left: 46%; bottom: 5%; width: 44%; padding: 12px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; background: #fff; border-radius: 10px; box-shadow: 0 16px 36px rgba(0, 0, 0, .45); }
.c-mk-dialog b { font-size: 12px; }
.c-mk-warn { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: #FEF3C7; color: #D97706; font-weight: 800; font-size: 15px; }
.c-mk-dbtns { display: flex; gap: 6px; }
.c-mk-dbtns i { padding: 3px 12px; border-radius: 6px; background: #F1F3F6; font-size: 11px; }
.c-mk-dbtns .is-ok { background: var(--p); color: var(--on-p); outline: 2px solid #E53935; outline-offset: 1px; }
.c-mk-history { height: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 40px; }
.c-mk-tag { position: absolute; left: 0; top: 0; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 8px; background: #1F2430; color: #fff; font-size: 13px; font-weight: 600; }
.c-mk-hrow { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px; background: #fff; border-radius: 8px; box-shadow: 0 10px 26px rgba(0, 0, 0, .35); }
.c-mk-hrow .c-mk-lines i:last-child { margin-bottom: 0; }
.c-mk-hrow.is-dim { opacity: .55; }
.c-mk-ret { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 8px; background: #FEE2E2; color: #B91C1C; font-size: 12px; font-weight: 600; outline: 3px solid #E53935; outline-offset: 2px; }
.c-mk-mail { height: auto; }
.c-mk-mail .c-mk-card { position: relative; padding: 18px; }
.c-mk-mail img { display: block; max-height: 36px; max-width: 70%; margin-bottom: 12px; }
.c-mk-code { display: inline-block; margin-top: 6px; padding: 6px 12px; border: 3px solid #E53935; font-weight: 700; letter-spacing: .05em; }
@media (max-width: 991.98px) {
    .c-htp-poster { padding: 28px 26px 24px; }
    .c-htp-h1 { font-size: 38px; } .c-htp-h1 small { font-size: 28px; }
    .c-htp-big { font-size: 44px; }
    .c-htp-h2 { font-size: 48px; } .c-htp-h2 small { font-size: 28px; }
    .c-htp-row { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .c-htp-txt h3 { font-size: 24px; } .c-htp-txt p { font-size: 18px; }
}
@media (max-width: 575.98px) {
    .c-htp { gap: 16px; }
    .c-htp-poster { padding: 22px 16px 20px; border-radius: 16px; }
    .c-htp-liblogo { height: 34px; max-width: 180px; }
    .c-htp-bcz { font-size: 16px; }
    .c-htp-h1 { font-size: 28px; } .c-htp-h1 small { font-size: 20px; }
    .c-htp-strong { font-size: 18px; } .c-htp-lead { font-size: 16px; } .c-htp-lead.is-lg { font-size: 17px; }
    .c-htp-for { font-size: 21px; margin: 20px 0 14px; } .c-htp-glow { font-size: 18px; } .c-htp-big { font-size: 30px; }
    .c-htp-h2 { font-size: 36px; margin-bottom: 26px; } .c-htp-h2 small { font-size: 22px; }
    .c-htp-rows { gap: 34px; }
    .c-htp-num { width: 46px; height: 46px; font-size: 24px; }
    .c-htp-txt { gap: 12px; } .c-htp-txt h3 { font-size: 20px; } .c-htp-txt p { font-size: 16px; } .c-htp-app { font-size: 20px !important; }
    .c-htp-stores img { width: 190px; }
    .c-mk { height: 220px; font-size: 11px; }
    .c-mk-borrowbtn { right: 4px; font-size: 12px; padding: 5px 10px; }
    .c-mk-history, .c-mk-mail { height: auto; }
    .c-htp-foot { flex-direction: column; align-items: center; text-align: center; }
    .c-htp-foot-site { align-items: center; }
    .c-htp-pill, .c-htp-line { font-size: 18px; }
}
/* white posters (c/account/howtonote.php, howtotranslate.php): theme band on top and at the end, Kanit headings */
.c-htw { position: relative; overflow: hidden; background: #fff; color: #1F2430; border-radius: 22px; border: 1px solid var(--line); }
.c-htw h1, .c-htw h2, .c-htw h3, .c-htw-sub, .c-htw-kicker, .c-htw-app, .c-htw-can, .c-htw-mid, .c-htw-arrow { font-family: "Kanit", var(--bs-body-font-family); }
.c-htw-band { margin: 0; padding: 22px 40px 20px; background: var(--p); color: var(--on-p) !important; font-size: 50px; font-weight: 500; line-height: 1.15; text-align: center; }
.c-htw-band.has-logo { position: relative; padding-left: 60px; padding-right: 210px; text-align: left; }
.c-htw-logo { position: absolute; z-index: 1; right: 40px; top: 18px; width: 140px; height: auto; padding: 8px 10px 4px; background: #fff; }
.c-htw-sub { margin: 10px 0 8px; text-align: center; font-size: 56px; font-weight: 500; line-height: 1.1; color: #111 !important; }
.c-htw-sub.is-app { padding-left: 60px; padding-right: 210px; text-align: left; font-weight: 600; }
.c-htw-body { padding: 14px 40px 36px; }
.c-htw-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 18px; }
.c-htw-shot { display: block; width: 100%; height: auto; }
.c-htw-step h3 { margin: 12px 0 4px; font-size: 32px; font-weight: 400; line-height: 1.2; color: var(--p-text) !important; }
.c-htw-step p { margin: 0 0 6px; font-size: 18px; line-height: 1.55; color: #1F2430; }
.c-htw-ic { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: #1F2430; color: #fff; font-size: 13px; vertical-align: -6px; }
.c-htw-ic.is-lg { width: 38px; height: 38px; font-size: 17px; vertical-align: -8px; }
.c-htw-mid { margin: 28px 0 18px; text-align: center; font-size: 30px; line-height: 1.3; color: var(--p-text) !important; }
.c-htw-endband { height: 26px; background: var(--p); }
/* tools intro: one size step between each line (kicker 20 / title 34 / label 18 / list 17), each on one line */
.c-htw-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: center; margin-top: 8px; }
.c-htw-kicker { margin: 0 0 2px; font-size: 20px; line-height: 1.3; color: var(--p-text) !important; }
.c-htw-app { margin: 0; font-size: 34px; font-weight: 500; line-height: 1.15; white-space: nowrap; color: #111 !important; }
.c-htw-can { display: block; margin-top: 12px; font-size: 18px; font-weight: 500; }
.c-htw-tools { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.c-htw-tools li { display: flex; align-items: center; gap: 12px; font-size: 17px; line-height: 1.35; }
.c-htw-tools .c-htw-ic { flex: 0 0 auto; width: 32px; height: 32px; font-size: 14px; vertical-align: 0; }
.c-htw-hr { margin: 28px 0; border: 0; border-top: 2px solid #E5E7EB; opacity: 1; }
.c-htw-web { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; align-items: start; }
.c-htw-arrow { display: flex; align-items: center; min-height: 300px; padding: 30px 80px 30px 34px; background: var(--p); color: var(--on-p); font-size: 38px; line-height: 1.2; clip-path: polygon(0 0, 78% 0, 100% 50%, 78% 100%, 0 100%); }
.c-htw-withqr { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 14px; align-items: start; }
.c-htw-qr { display: block; width: 110px; height: auto; }
.c-htw-step p.c-htw-note { color: #DC2626; font-size: 15px; }
@media (max-width: 991.98px) {
    .c-htw-band { font-size: 36px; } .c-htw-band.has-logo, .c-htw-sub.is-app { padding-left: 32px; padding-right: 160px; }
    .c-htw-logo { width: 104px; right: 28px; }
    .c-htw-sub { font-size: 40px; }
    .c-htw-body { padding: 12px 28px 30px; }
    .c-htw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .c-htw-split, .c-htw-web { grid-template-columns: minmax(0, 1fr); }
    .c-htw-arrow { min-height: 0; padding: 22px 80px 22px 26px; font-size: 30px; }
}
@media (max-width: 575.98px) {
    .c-htw { border-radius: 16px; }
    .c-htw-band { padding: 16px 18px 14px; font-size: 25px; }
    .c-htw-band.has-logo, .c-htw-sub.is-app { padding-left: 18px; padding-right: 96px; }
    .c-htw-logo { width: 70px; right: 14px; top: 10px; padding: 5px 6px 2px; }
    .c-htw-sub { font-size: 28px; }
    .c-htw-body { padding: 10px 16px 24px; }
    .c-htw-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .c-htw-grid .c-htw-step { display: grid; grid-template-columns: 42% minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 0 14px; align-items: start; }
    .c-htw-grid .c-htw-step .c-htw-shot { grid-row: span 2; }
    .c-htw-step h3 { margin-top: 0; font-size: 24px; } .c-htw-web .c-htw-step h3 { margin-top: 10px; }
    .c-htw-step p { font-size: 15px; }
    .c-htw-mid { font-size: 21px; margin: 20px 0 14px; }
    .c-htw-kicker { font-size: 17px; } .c-htw-app { font-size: 27px; } .c-htw-can { font-size: 16px; margin-top: 10px; } .c-htw-tools li { font-size: 15px; }
    .c-htw-tools .c-htw-ic { width: 28px; height: 28px; font-size: 13px; }
    .c-htw-arrow { padding: 18px 60px 18px 18px; font-size: 22px; }
    .c-htw-withqr { grid-template-columns: minmax(0, 1fr) 80px; } .c-htw-qr { width: 80px; }
}
