:root{--public-hero-height:500px}
/* One paginator, independent of Bootstrap's responsive utilities. */
.site-pagination{width:100%;margin-top:24px}
.site-pagination .pagination{display:flex;flex-wrap:wrap;gap:6px;align-items:center;justify-content:center;list-style:none!important;padding:0!important;margin:0!important}
.site-pagination .page-item{list-style:none!important;padding:0!important;margin:0!important}
.site-pagination .page-item::marker{content:""}
.site-pagination .page-link{display:grid;place-items:center;min-width:40px;height:40px;padding:0 10px;border:1px solid var(--border);border-radius:10px;text-decoration:none;font-size:.85rem;background:var(--paper);color:var(--green);transition:background .18s,border-color .18s,transform .18s}
.site-pagination a.page-link:hover{background:var(--surface-soft,#edf7ef);border-color:var(--green);transform:translateY(-2px)}
.site-pagination .active .page-link{background:var(--green);border-color:var(--green);color:#fff;font-weight:800}
.site-pagination .disabled .page-link{opacity:.4}
.site-pagination a:focus-visible{outline:3px solid var(--lime);outline-offset:3px}
/* Match the homepage banner's shared height without cropping the course copy. */
.public-marketing:not(.subscription-page) .course-hero{box-sizing:border-box;min-height:var(--public-hero-height);height:var(--public-hero-height);padding:24px 0 32px;display:flex;align-items:center}
.public-marketing .course-hero .breadcrumbs{margin-bottom:20px}
.public-marketing .hero-course-image img{height:315px;aspect-ratio:auto;object-fit:cover}
.public-marketing .course-hero .lead{margin:0 0 18px}
.instructor-media-row{display:grid;grid-template-columns:86px minmax(0,1fr);gap:18px;padding:20px 0;border-bottom:1px solid var(--border)}
.instructor-media-preview{height:76px;display:grid;place-items:center;border-radius:13px;background:var(--surface-soft,#edf6ef);color:var(--green);font-size:1.6rem;overflow:hidden}
.instructor-media-preview img{width:100%;height:100%;object-fit:cover}
.instructor-media-row small{display:block;color:var(--muted);margin:5px 0 12px}
.instructor-media-row .inline-form label{flex:1 1 140px;min-width:0}
.admin-video-record{display:grid!important;gap:14px;padding:18px 0;border-bottom:1px solid var(--border)}
.admin-video-record small{display:block;color:var(--muted);margin-top:6px}
.admin-video-record details summary{cursor:pointer;color:var(--green);font-weight:750}
.admin-video-record details[open]{padding:14px;border:1px solid var(--border);border-radius:12px;background:var(--surface-soft,#f3f8f3)}
.resource-admin-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,.42fr);gap:24px;align-items:start}
.resource-admin-layout>*{min-width:0}
.admin-content [data-resource-editor]>.panel-head{margin:0}
.admin-content .resource-format-switch{min-width:0;border:0;margin:0;padding:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;align-items:stretch}
.admin-content .resource-format-switch legend{float:none;width:auto;padding:0;font-weight:800;margin:0 0 10px}
.admin-content .resource-format-switch label{position:relative;display:block;min-width:0;width:100%;padding:0;border:0;cursor:pointer;margin:0!important}
.resource-format-switch input{position:absolute;opacity:0;width:1px;height:1px}
.admin-content .resource-format-switch label>span{display:grid;grid-template-columns:28px minmax(0,1fr);gap:5px 10px;width:100%;height:100%;box-sizing:border-box;border:1px solid var(--border);padding:13px 14px;border-radius:12px;transition:.2s;background:var(--paper)}
.resource-format-switch span>i{grid-row:span 2;align-self:center;font-size:1.4rem;color:var(--green)}
.resource-format-switch small{font-size:.72rem;color:var(--muted)}
.resource-format-switch input:checked+span{border-color:#12814b;background:#e9f8ed;box-shadow:0 0 0 1px #12814b}
.resource-format-switch input:focus-visible+span{outline:3px solid var(--lime);outline-offset:3px}
.resource-format-hint{margin:0;padding:12px 14px;border-radius:10px;background:var(--surface-soft,#f2f7f3);color:var(--muted);font-size:.8rem;line-height:1.6}
.resource-body-field{margin:22px 0}
.resource-body-field>label{margin-bottom:10px}
.resource-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:5px;padding:10px;border:1px solid var(--border);border-radius:12px 12px 0 0;background:var(--surface-soft,#f0f6f1)}
.resource-toolbar select{width:auto!important;min-width:150px;padding:8px!important;font-size:.76rem}
.resource-toolbar button{display:inline-flex;gap:6px;align-items:center;justify-content:center;min-width:34px;min-height:34px;padding:6px 8px;border:0;border-radius:7px;background:transparent;color:var(--green);cursor:pointer}
.resource-toolbar button:hover,.resource-toolbar button[aria-pressed=true]{background:#d6eedc}
.resource-toolbar button:focus-visible{outline:2px solid var(--green);outline-offset:2px}
.resource-visual-editor,.resource-editor-preview{min-height:440px;padding:28px;border:1px solid var(--border);border-top:0;background:var(--paper);overflow-wrap:anywhere;line-height:1.85;outline:none}
.resource-visual-editor:focus{box-shadow:inset 0 0 0 2px #15804b}
.resource-visual-editor:empty::before{content:"Viết câu chuyện, chia sẻ hướng dẫn của bạn…";color:var(--muted);pointer-events:none}
.resource-visual-editor :is(h2,h3,h4){margin:1.2em 0 .6em;line-height:1.35}
.resource-visual-editor figure,.resource-blog-article figure{margin:24px 0}
.resource-visual-editor img,.resource-editor-preview img,.resource-blog-article img{max-width:100%;height:auto;border-radius:12px}
.resource-visual-editor figcaption,.resource-blog-article figcaption{color:var(--muted);font-size:.8rem;text-align:center;margin-top:10px}
.resource-editor-status{display:flex;justify-content:space-between;gap:10px;border:1px solid var(--border);border-top:0;padding:10px 14px;border-radius:0 0 12px 12px;color:var(--muted);font-size:.7rem}
.resource-file-fields{border:1px solid var(--border);border-radius:14px;padding:18px;margin:20px 0}
.resource-file-fields legend{padding:0 8px;font-weight:800}
.resource-publish-options{margin:24px 0;padding:18px;border:1px solid var(--border);border-radius:14px}
.resource-publish-options summary{cursor:pointer;font-weight:800;display:flex;gap:10px;align-items:center}
.resource-publish-options[open] summary{margin-bottom:18px}
.resource-insert-dialog{width:min(560px,calc(100vw - 32px));max-height:85dvh;overflow:auto;padding:24px;border:1px solid var(--border);border-radius:18px;color:var(--ink);background:var(--paper);box-shadow:0 30px 90px #001b2550}
.resource-insert-dialog::backdrop{background:#032e24a6;backdrop-filter:blur(5px)}
.resource-insert-dialog label{display:grid;gap:8px;margin:14px 0}
.resource-insert-dialog [role=alert]{font-size:.8rem;color:var(--green)}
.resource-image-results{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;max-height:240px;overflow:auto}
.resource-image-results button{padding:6px;border:1px solid var(--border);border-radius:10px;background:var(--paper);cursor:pointer;text-align:left}
.resource-image-results img{width:100%;height:76px;object-fit:cover;border-radius:6px}
.resource-image-results span{display:block;font-size:.65rem;overflow-wrap:anywhere}
.resource-format-tag{display:flex;gap:8px;align-items:center;color:var(--green);font-weight:800;font-size:.73rem;margin:16px 0 8px}
.resource-back-link{display:flex;align-items:center;gap:10px;width:fit-content;margin-bottom:24px;font-size:.8rem;opacity:.85}
.resource-reading-lock{text-align:center;margin:28px 0;padding:40px 24px;background:var(--surface-soft,#edf7ef);border:1px solid var(--border);border-radius:20px}
.resource-reading-lock>i{font-size:1.8rem;color:var(--green);margin-bottom:16px}
.resource-reading-lock h2{font-size:1.5rem}
.resource-reading-lock p{color:var(--muted);line-height:1.75}
.resource-reading-lock .btn{margin:8px 4px}
[data-resource-editor] [hidden]{display:none!important}
html[data-theme=dark] .resource-format-switch input:checked+span{background:#153d2c;border-color:#68d589}
html[data-theme=dark] .resource-toolbar button:hover{background:#1d4932}
html[data-theme=dark] .resource-toolbar :is(button,select),html[data-theme=dark] .resource-format-tag{color:#b2ecbe}
@media(max-width:1100px){.resource-admin-layout{grid-template-columns:minmax(0,1fr)}.resource-records-panel{order:2}.public-marketing .hero-course-image img{height:285px}}
@media(max-width:760px){
 :root{--public-hero-height:650px}
 .site-pagination .page-link{min-width:34px;height:36px;padding:0 7px}.site-pagination .pagination{gap:4px}
 .public-marketing:not(.subscription-page) .course-hero{height:auto;min-height:var(--public-hero-height);padding:24px 0 20px}
 .public-marketing .hero-course-image img{height:180px}
 .instructor-media-row{grid-template-columns:52px minmax(0,1fr);gap:12px}.instructor-media-preview{height:52px}
 .admin-content .resource-format-switch{grid-template-columns:1fr}.admin-content .resource-format-switch label>span{padding:12px 14px}
 .resource-visual-editor,.resource-editor-preview{min-height:360px;padding:18px}.resource-editor-status{flex-wrap:wrap}
 .resource-toolbar{gap:2px;padding:7px}.resource-toolbar select{width:100%!important;margin-bottom:5px}
 .resource-insert-dialog{padding:18px}
}
@media(prefers-reduced-motion:reduce){.site-pagination a.page-link,.admin-content .resource-format-switch label>span{transition:none}.public-marketing .motion-title span{animation:none!important;opacity:1!important;filter:none!important;transform:none!important}}

/* Gift redemption follows the account form surfaces and rounded controls. */
.gift-redeem-card form{align-items:stretch;min-width:0;max-width:100%}
.gift-redeem-card .gift-code-input{width:100%;min-width:0;min-height:48px;padding:14px 20px;border:1px solid var(--border);border-radius:16px;background:var(--surface-input,var(--white));color:var(--ink);font:inherit;font-weight:750;letter-spacing:.08em;box-shadow:inset 0 1px 2px #07391f05;transition:border-color .2s,box-shadow .2s,background-color .2s;box-sizing:border-box}
.gift-redeem-card .gift-code-input::placeholder{color:var(--muted);font-weight:650;opacity:.8}
.gift-redeem-card .gift-code-input:hover{border-color:#83b48a}
.gift-redeem-card .gift-code-input:focus{border-color:#399950;outline:0;box-shadow:0 0 0 4px #58d63826}
html[data-theme="dark"] .gift-redeem-card .gift-code-input:focus{border-color:#a6ee91;box-shadow:0 0 0 4px #a6ee9126}
.gift-redeem-card form>.btn{flex:none;white-space:nowrap}
@media(max-width:480px){.gift-redeem-card form{flex-wrap:wrap}.gift-redeem-card .gift-code-input{flex:1 1 100%}.gift-redeem-card form>.btn{width:100%}}
