:root {
  --blue-950: #073763;
  --blue-900: #0b477e;
  --blue-800: #0d5baa;
  --blue-700: #1673c2;
  --blue-600: #2b8bd0;
  --blue-300: #9dd5f3;
  --blue-200: #ccecff;
  --blue-100: #eaf7ff;
  --blue-50: #f6fbff;
  --red-700: #c6112f;
  --red-600: #e21936;
  --red-100: #ffe8ec;
  --green-600: #17945a;
  --orange-600: #e9891a;
  --purple-600: #7b45d6;
  --ink: #172033;
  --muted: #667085;
  --line: #dce7f0;
  --surface: #ffffff;
  --shadow: 0 18px 44px rgba(28, 82, 126, .12);
  --shadow-soft: 0 8px 24px rgba(28, 82, 126, .09);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 13px;
  --container: 1380px;
  --header-start: #eaf7ff;
  --header-end: #bde5fb;
  --footer-start: #dff3ff;
  --footer-end: #aee0f7;
  --page-bg: #f6fbff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #fff 0%, var(--page-bg) 100%);
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 9999; left: 16px; top: -60px; background: #fff; color: var(--blue-900); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); }
.skip-link:focus { top: 16px; }
.container { width: min(calc(100% - 36px), var(--container)); margin-inline: auto; }

.site-header { background: #fff; position: relative; z-index: 10; box-shadow: 0 1px 0 rgba(10, 76, 128, .08); }
.header-surface {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% -15%, rgba(255,255,255,.95), transparent 33%),
    linear-gradient(105deg, var(--header-start) 0%, color-mix(in srgb, var(--header-start) 54%, var(--header-end)) 44%, var(--header-end) 100%);
}
.header-surface::before,
.header-surface::after {
  content: "";
  position: absolute;
  left: -8%;
  right: -8%;
  height: 90px;
  border-radius: 50%;
  border-top: 1px solid rgba(255,255,255,.85);
  pointer-events: none;
}
.header-surface::before { bottom: -58px; transform: rotate(-1.8deg); box-shadow: 0 -12px 38px rgba(255,255,255,.65); }
.header-surface::after { bottom: -74px; transform: rotate(1.3deg); border-color: rgba(42, 139, 208, .14); }
.header-inner { min-height: 150px; display: flex; align-items: center; justify-content: space-between; gap: 28px; padding-block: 20px; position: relative; z-index: 1; }
.brand { display: flex; align-items: center; gap: 20px; border: 0; background: transparent; color: var(--blue-950); text-align: left; padding: 0; min-width: 0; }
.brand-logo { width: 116px; height: 116px; flex: 0 0 auto; display: grid; place-items: center; }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 18px rgba(0, 66, 120, .14)); }
.brand-copy { display: grid; gap: 5px; }
.brand-copy small { font-size: clamp(20px, 2vw, 30px); font-weight: 800; letter-spacing: .04em; color: var(--blue-900); }
.brand-copy strong { font-size: clamp(28px, 3vw, 48px); line-height: 1.02; letter-spacing: -.035em; color: var(--blue-950); white-space: nowrap; }
.header-tools { display: flex; align-items: center; gap: 12px; }
.global-search { display: flex; align-items: stretch; height: 50px; width: min(370px, 35vw); background: rgba(255,255,255,.92); border: 1px solid rgba(9, 87, 150, .14); border-radius: 16px; overflow: hidden; box-shadow: 0 10px 28px rgba(14, 91, 150, .08); }
.global-search input { min-width: 0; flex: 1; border: 0; background: transparent; padding: 0 16px; outline: none; color: var(--ink); }
.global-search button { width: 56px; border: 0; background: var(--red-600); color: #fff; font-size: 27px; }
.header-icon { width: 48px; height: 48px; border-radius: 15px; border: 1px solid rgba(10, 85, 145, .13); background: rgba(255,255,255,.78); color: var(--blue-900); font-size: 20px; }
.account-button { display: flex; align-items: center; gap: 9px; border: 0; background: transparent; color: var(--blue-950); padding: 4px; text-align: left; }
.account-icon { width: 42px; height: 42px; display: grid; place-items: center; border: 1.5px solid var(--blue-900); border-radius: 50%; font-size: 24px; }
.account-button span:last-child { display: grid; }
.account-button small { font-size: 12px; }
.account-button strong { font-size: 14px; }

.main-nav { background: rgba(255,255,255,.97); border-top: 1px solid rgba(26, 94, 145, .08); border-bottom: 1px solid rgba(26, 94, 145, .12); }
.nav-inner { min-height: 58px; display: flex; align-items: stretch; gap: 4px; }
.nav-item { border: 0; background: transparent; color: var(--blue-950); padding: 0 20px; min-height: 58px; display: flex; align-items: center; gap: 9px; font-weight: 750; border-radius: 12px; margin-block: 6px; }
.nav-item span { color: var(--blue-700); font-size: 18px; }
.nav-item:hover { background: var(--blue-50); }
.nav-item.active { background: var(--red-600); color: #fff; box-shadow: 0 8px 20px rgba(226,25,54,.2); }
.nav-item.active span { color: #fff; }

.filter-section { padding: 18px 0 8px; }
.filter-row { display: flex; align-items: center; gap: 16px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.type-switch, .category-chips { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.type-pill, .category-chip { border: 1px solid var(--line); background: #fff; color: #26364b; border-radius: 999px; padding: 10px 17px; font-weight: 700; box-shadow: 0 5px 14px rgba(21, 80, 126, .05); white-space: nowrap; }
.type-pill:hover, .category-chip:hover { border-color: var(--blue-300); color: var(--blue-800); }
.type-pill.active, .category-chip.active { background: var(--blue-800); border-color: var(--blue-800); color: #fff; box-shadow: 0 8px 18px rgba(13,91,170,.2); }
.category-chip span { opacity: .75; margin-left: 4px; }

.featured-section { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(340px, .9fr); gap: 20px; padding-top: 10px; }
.player-card, .featured-info, .content-panel, .tag-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow-soft); }
.player-card { position: relative; min-height: 480px; overflow: hidden; background: #07121f; }
.player-card iframe { width: 100%; height: 100%; min-height: 480px; border: 0; display: block; }
.player-placeholder, .player-warning { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; text-align: center; color: #fff; padding: 30px; background: radial-gradient(circle at top, #173b5e, #07121f 70%); }
.player-placeholder h2, .player-warning h2 { margin: 12px 0 6px; }
.player-placeholder p, .player-warning p { max-width: 620px; color: rgba(255,255,255,.78); line-height: 1.6; }
.placeholder-icon, .warning-symbol { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.13); font-size: 34px; }
.featured-info { padding: 30px; display: flex; flex-direction: column; min-width: 0; position: relative; }
.featured-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.content-badge, .tag-badge, .mini-tag { display: inline-flex; align-items: center; width: fit-content; border-radius: 999px; font-weight: 750; }
.content-badge { background: var(--red-100); color: var(--red-700); padding: 7px 11px; font-size: 13px; }
.tag-badge { background: var(--blue-100); color: var(--blue-800); padding: 7px 11px; font-size: 13px; }
.featured-info h1 { font-size: clamp(28px, 2.5vw, 42px); line-height: 1.12; letter-spacing: -.025em; margin: 18px 0 12px; color: #111827; }
.featured-info > p { margin: 0; color: var(--muted); line-height: 1.65; font-size: 16px; }
.featured-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.mini-tag { background: #f4f7fa; color: #40536a; padding: 6px 9px; font-size: 12px; border: 1px solid #e7edf3; }
.featured-meta { margin: 22px 0 18px; padding: 15px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.featured-meta div { display: flex; justify-content: space-between; gap: 20px; }
.featured-meta dt { color: var(--muted); }
.featured-meta dd { margin: 0; font-weight: 750; color: var(--blue-900); }
.featured-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; }
.featured-nav { display: flex; gap: 8px; position: absolute; right: 28px; top: 26px; }

.button { min-height: 44px; border-radius: 12px; border: 1px solid transparent; padding: 10px 16px; font-weight: 750; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: .18s ease; text-decoration: none; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.button-primary { background: var(--blue-800); color: #fff; box-shadow: 0 8px 18px rgba(13,91,170,.18); }
.button-primary:hover { background: var(--blue-900); }
.button-youtube { background: var(--red-600); color: #fff; }
.button-outline { background: #fff; color: var(--blue-900); border-color: #cbd9e5; }
.button-outline:hover { border-color: var(--blue-500, #2b8bd0); background: var(--blue-50); }
.button-danger { background: #b42318; color: #fff; }
.circle-button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--blue-900); display: grid; place-items: center; font-weight: 800; }
.circle-button:hover { border-color: var(--blue-300); background: var(--blue-50); }
.circle-button:disabled { opacity: .35; cursor: not-allowed; }
.text-button { border: 0; background: transparent; color: var(--blue-800); font-weight: 750; padding: 4px; }
.text-button.danger { color: #b42318; }

.library-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding-top: 22px; }
.content-panel { padding: 18px; min-width: 0; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.section-kicker { margin: 0 0 3px; color: var(--red-600); font-size: 12px; font-weight: 850; letter-spacing: .09em; }
.section-heading h2 { margin: 0; font-size: 25px; color: var(--blue-950); letter-spacing: -.02em; }
.heading-tools { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.compact-select { border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #344054; padding: 9px 30px 9px 10px; outline: none; }
.card-grid { display: grid; gap: 14px; }
.video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.infographic-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.content-card { border: 1px solid #e5edf4; border-radius: var(--radius-lg); background: #fff; overflow: hidden; min-width: 0; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; display: flex; flex-direction: column; }
.content-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-soft); border-color: var(--blue-300); }
.content-card.active { border-color: var(--red-600); box-shadow: 0 0 0 2px rgba(226,25,54,.08), var(--shadow-soft); }
.card-media { position: relative; border: 0; background: #eaf3fa; padding: 0; width: 100%; overflow: hidden; }
.video-card .card-media { aspect-ratio: 16 / 9; }
.infographic-card .card-media { aspect-ratio: 4 / 5; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.content-card:hover .card-media img { transform: scale(1.025); }
.card-play { position: absolute; inset: 50% auto auto 50%; translate: -50% -50%; width: 50px; height: 50px; border-radius: 50%; background: rgba(11, 24, 39, .78); color: #fff; display: grid; place-items: center; font-size: 22px; box-shadow: 0 10px 24px rgba(0,0,0,.18); }
.card-body { padding: 14px; display: flex; flex-direction: column; flex: 1; }
.card-meta-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.card-body h3 { margin: 0 0 8px; font-size: 16px; line-height: 1.35; color: #182230; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-body p { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-actions { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid #edf2f6; }
.card-actions button { border: 0; background: transparent; color: var(--blue-800); font-weight: 700; padding: 3px; font-size: 13px; }
.card-actions button:hover { color: var(--red-600); }
.empty-state { min-height: 180px; display: grid; place-items: center; align-content: center; text-align: center; color: var(--muted); border: 1px dashed #c8d7e4; border-radius: 16px; gap: 6px; }
.empty-state strong { color: var(--blue-950); }

.tag-section { margin-top: 22px; margin-bottom: 30px; padding: 18px; }
.tag-heading { align-items: center; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-filter { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 9px 13px; color: #42526a; font-weight: 700; }
.tag-filter:hover, .tag-filter.active { background: var(--blue-100); color: var(--blue-900); border-color: var(--blue-300); }
.tag-filter span { opacity: .65; margin-left: 4px; }

.site-footer { background: linear-gradient(105deg, var(--footer-start) 0%, color-mix(in srgb, var(--footer-start) 48%, var(--footer-end)) 55%, var(--footer-end) 100%); color: var(--blue-950); border-top: 1px solid rgba(13,91,170,.12); }
.footer-inner { min-height: 160px; display: grid; grid-template-columns: 1.1fr 1fr .8fr; align-items: center; gap: 34px; padding-block: 24px; }
.footer-brand { display: flex; align-items: center; gap: 15px; padding-right: 24px; border-right: 1px solid rgba(13,91,170,.25); }
.footer-brand img { width: 82px; height: 82px; object-fit: contain; }
.footer-brand div { display: grid; gap: 2px; }
.footer-brand small { font-weight: 800; letter-spacing: .04em; }
.footer-brand strong { font-size: 22px; }
.footer-contact { display: grid; gap: 7px; font-size: 14px; }
.footer-contact strong { margin-bottom: 4px; font-size: 15px; }
.footer-contact a { text-decoration: none; }
.footer-meta { display: grid; gap: 7px; font-size: 13px; padding-left: 28px; border-left: 1px solid rgba(13,91,170,.25); }
.footer-meta .text-button { width: fit-content; padding-left: 0; }

.dialog { border: 0; padding: 0; border-radius: 22px; box-shadow: 0 32px 90px rgba(13, 49, 81, .28); color: var(--ink); max-height: 92vh; }
.dialog::backdrop, .viewer-dialog::backdrop, .presentation-dialog::backdrop { background: rgba(7, 24, 42, .68); backdrop-filter: blur(5px); }
.dialog-small { width: min(460px, calc(100% - 28px)); }
.dialog-medium { width: min(760px, calc(100% - 28px)); }
.dialog-admin { width: min(1280px, calc(100% - 24px)); height: min(820px, calc(100vh - 24px)); }
.dialog-card { padding: 28px; background: #fff; position: relative; }
.dialog-card h2 { margin: 4px 0 8px; color: var(--blue-950); }
.dialog-card > p:not(.section-kicker):not(.form-error) { color: var(--muted); line-height: 1.55; }
.dialog-close { border: 0; background: #eef4f8; color: #526478; width: 38px; height: 38px; border-radius: 50%; font-size: 24px; display: grid; place-items: center; position: absolute; right: 18px; top: 18px; }
.dialog-close:hover { background: var(--red-100); color: var(--red-700); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 7px; color: #344054; font-weight: 700; font-size: 14px; }
.field-full { grid-column: 1 / -1; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #ccd9e4; border-radius: 11px; padding: 11px 12px; background: #fff; color: var(--ink); outline: none; font-weight: 500; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(43,139,208,.13); }
.field small { color: var(--muted); font-weight: 500; line-height: 1.4; }
.form-error { color: #b42318; min-height: 20px; margin: 10px 0 0; font-weight: 650; }
.file-button input { display: none; }
.confirm-symbol { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; background: #fff1e8; color: #c44316; font-size: 28px; font-weight: 900; }

.admin-shell { height: 100%; display: grid; grid-template-columns: 245px 1fr; background: #f7fbfe; }
.admin-sidebar { background: linear-gradient(180deg, var(--blue-950), var(--blue-900)); color: #fff; display: flex; flex-direction: column; padding: 18px 12px; }
.admin-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; }
.admin-brand img { width: 54px; height: 54px; object-fit: contain; }
.admin-brand div { display: grid; }
.admin-brand small { color: rgba(255,255,255,.65); }
.admin-nav { display: grid; gap: 7px; }
.admin-nav-item { border: 0; background: transparent; color: rgba(255,255,255,.82); text-align: left; padding: 12px 13px; border-radius: 11px; font-weight: 700; }
.admin-nav-item:hover, .admin-nav-item.active { background: rgba(255,255,255,.13); color: #fff; }
.admin-nav-item.logout { margin-top: auto; }
.admin-content { min-width: 0; overflow: auto; padding: 24px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; position: sticky; top: -24px; background: rgba(247,251,254,.95); backdrop-filter: blur(8px); z-index: 2; padding: 6px 0 16px; }
.admin-header h2 { margin: 0; color: var(--blue-950); }
.admin-header .dialog-close { position: static; }
.admin-tab { display: none; }
.admin-tab.active { display: block; }
.admin-toolbar { display: flex; gap: 12px; align-items: stretch; margin-bottom: 16px; }
.stat-card { min-width: 150px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 15px; display: grid; gap: 2px; }
.stat-card strong { color: var(--blue-900); font-size: 27px; }
.stat-card span { color: var(--muted); font-size: 13px; }
.push-right { margin-left: auto; align-self: center; }
.table-shell { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 850px; }
.admin-table th, .admin-table td { text-align: left; padding: 13px 14px; border-bottom: 1px solid #edf2f6; vertical-align: middle; }
.admin-table th { background: #f8fbfd; color: #536377; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-item-cell { display: flex; align-items: center; gap: 10px; min-width: 280px; }
.admin-thumb { width: 78px; height: 48px; object-fit: cover; border-radius: 8px; background: #e8f2f8; }
.admin-thumb.portrait { width: 48px; height: 62px; }
.admin-item-copy { display: grid; gap: 3px; min-width: 0; }
.admin-item-copy strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.admin-item-copy small { color: var(--muted); }
.order-buttons, .row-actions { display: flex; gap: 6px; }
.table-icon-button { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--blue-900); }
.table-icon-button:hover { background: var(--blue-50); border-color: var(--blue-300); }
.table-icon-button.danger { color: #b42318; }
.status-badge { border: 0; border-radius: 999px; padding: 7px 10px; font-weight: 750; font-size: 12px; }
.status-published { background: #e7f8ef; color: #087443; }
.status-hidden { background: #f2f4f7; color: #667085; }
.admin-empty { padding: 40px; text-align: center; color: var(--muted); }
.settings-form { display: grid; gap: 16px; }
.settings-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.settings-card h3 { margin: 0 0 12px; color: var(--blue-950); }
.settings-card p { color: var(--muted); line-height: 1.55; }
.logo-editor { display: flex; align-items: center; gap: 18px; }
.logo-preview { width: 116px; height: 116px; border: 1px dashed #b7cad8; border-radius: 18px; background: var(--blue-50); display: grid; place-items: center; overflow: hidden; }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.logo-editor > div:last-child { display: grid; gap: 8px; align-items: start; }
.sticky-actions { position: sticky; bottom: -24px; background: linear-gradient(180deg, rgba(247,251,254,0), #f7fbfe 26%); padding: 24px 0 5px; display: flex; justify-content: flex-end; }
.backup-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.backup-icon { width: 48px; height: 48px; border-radius: 13px; background: var(--blue-100); color: var(--blue-900); display: grid; place-items: center; font-size: 25px; font-weight: 900; }
.danger-card { border-color: #f2c6c2; }
.storage-note { margin-top: 16px; border-radius: 13px; background: #fff8e8; color: #705514; padding: 14px 16px; line-height: 1.55; }
.image-form-preview { min-height: 220px; border: 1px dashed #b9cad8; border-radius: 14px; background: #f6fbff; display: grid; place-items: center; overflow: hidden; color: var(--muted); font-weight: 500; }
.image-form-preview img { width: 100%; max-height: 360px; object-fit: contain; }

.viewer-dialog { border: 0; padding: 0; width: min(1160px, calc(100% - 24px)); max-height: calc(100vh - 24px); border-radius: 22px; overflow: hidden; box-shadow: 0 36px 100px rgba(0,0,0,.32); }
.viewer-shell { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .7fr); background: #fff; min-height: 650px; position: relative; }
.viewer-close { position: absolute; right: 18px; top: 18px; z-index: 2; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: #35445a; font-size: 26px; box-shadow: var(--shadow-soft); }
.viewer-image-wrap { background: #07121f; display: grid; place-items: center; padding: 18px; min-width: 0; }
.viewer-image-wrap img { max-width: 100%; max-height: calc(100vh - 60px); object-fit: contain; }
.viewer-copy { padding: 42px 32px 30px; display: flex; flex-direction: column; }
.viewer-copy h2 { font-size: 30px; line-height: 1.2; margin: 16px 0 10px; color: var(--blue-950); }
.viewer-copy p { color: var(--muted); line-height: 1.6; }
.viewer-actions { display: grid; gap: 10px; margin-top: auto; }

.presentation-dialog { width: 100vw; height: 100vh; max-width: none; max-height: none; border: 0; padding: 0; background: #07121f; color: #fff; }
.presentation-shell { height: 100%; display: grid; grid-template-rows: auto 1fr; }
.presentation-header { min-height: 62px; padding: 10px 18px; display: flex; align-items: center; justify-content: space-between; background: #0b2239; }
.presentation-header > div { display: flex; align-items: center; gap: 14px; }
.presentation-header span { color: rgba(255,255,255,.65); }
.presentation-icon-button { width: 42px; height: 42px; border-radius: 11px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.08); color: #fff; font-size: 22px; }
.presentation-main { display: grid; grid-template-columns: 1fr 290px; min-height: 0; }
.presentation-stage { position: relative; background: #000; min-width: 0; }
.presentation-stage iframe { width: 100%; height: 100%; border: 0; }
.presentation-caption { position: absolute; left: 22px; right: 22px; bottom: 18px; padding: 18px; background: linear-gradient(180deg, transparent, rgba(0,0,0,.86)); pointer-events: none; }
.presentation-caption span { color: #9fd7ff; font-weight: 750; }
.presentation-caption h2 { margin: 7px 0; }
.presentation-caption p { margin: 0; color: rgba(255,255,255,.72); }
.presentation-arrow { position: absolute; top: 50%; translate: 0 -50%; width: 52px; height: 72px; border: 0; background: rgba(0,0,0,.45); color: #fff; font-size: 40px; }
.presentation-arrow.left { left: 0; border-radius: 0 14px 14px 0; }
.presentation-arrow.right { right: 0; border-radius: 14px 0 0 14px; }
.presentation-playlist { background: #0b2239; padding: 16px; overflow: auto; }
.presentation-playlist h3 { margin-top: 0; }
.presentation-playlist-item { width: 100%; display: grid; grid-template-columns: 78px 1fr; gap: 10px; align-items: center; text-align: left; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #fff; padding: 8px; margin-bottom: 7px; }
.presentation-playlist-item img { width: 78px; aspect-ratio: 16/9; object-fit: cover; border-radius: 7px; }
.presentation-playlist-item span { font-size: 13px; line-height: 1.35; }
.presentation-playlist-item.active { background: rgba(255,255,255,.1); border-color: rgba(159,215,255,.35); }

.toast-region { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 10px; z-index: 9999; }
.toast { background: #0f3f68; color: #fff; border-radius: 12px; padding: 12px 15px; box-shadow: var(--shadow); animation: toastIn .2s ease; max-width: 360px; }
.toast.error { background: #9f1c1c; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 1180px) {
  .brand-copy strong { white-space: normal; }
  .header-inner { min-height: 132px; }
  .brand-logo { width: 96px; height: 96px; }
  .featured-section { grid-template-columns: 1fr; }
  .featured-info { min-height: 390px; }
  .library-grid { grid-template-columns: 1fr; }
  .infographic-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-meta { grid-column: 1 / -1; border-left: 0; padding-left: 0; border-top: 1px solid rgba(13,91,170,.2); padding-top: 16px; display: flex; flex-wrap: wrap; }
}

@media (max-width: 860px) {
  .header-inner { align-items: flex-start; flex-direction: column; padding-block: 16px; }
  .brand-logo { width: 82px; height: 82px; }
  .brand-copy small { font-size: 17px; }
  .brand-copy strong { font-size: 30px; }
  .header-tools { width: 100%; }
  .global-search { width: auto; flex: 1; }
  .account-button span:last-child { display: none; }
  .nav-inner { overflow-x: auto; }
  .nav-item { white-space: nowrap; padding-inline: 15px; }
  .player-card, .player-card iframe { min-height: 390px; }
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .infographic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-brand, .footer-meta { border: 0; padding: 0; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { flex-direction: row; overflow-x: auto; align-items: center; }
  .admin-brand { padding: 0 12px 0 0; min-width: 190px; }
  .admin-brand img { width: 40px; height: 40px; }
  .admin-nav { display: flex; }
  .admin-nav-item { white-space: nowrap; }
  .admin-nav-item.logout { margin-top: 0; margin-left: auto; }
  .admin-content { padding: 16px; }
  .admin-header { top: -16px; }
  .backup-grid { grid-template-columns: 1fr; }
  .viewer-shell { grid-template-columns: 1fr; max-height: calc(100vh - 24px); overflow: auto; }
  .viewer-image-wrap { min-height: 55vh; }
  .viewer-copy { min-height: 360px; }
  .presentation-main { grid-template-columns: 1fr; }
  .presentation-playlist { display: none; }
}

@media (max-width: 620px) {
  .container { width: min(calc(100% - 20px), var(--container)); }
  .brand { gap: 12px; }
  .brand-logo { width: 66px; height: 66px; }
  .brand-copy strong { font-size: 23px; }
  .brand-copy small { font-size: 14px; }
  .header-tools { gap: 8px; }
  .global-search { height: 44px; }
  .header-icon, .account-icon { width: 44px; height: 44px; }
  .account-button { display: none; }
  .filter-row { gap: 10px; }
  .type-pill, .category-chip { padding: 9px 13px; font-size: 13px; }
  .player-card, .player-card iframe { min-height: 255px; }
  .featured-info { padding: 20px; min-height: 430px; }
  .featured-info h1 { font-size: 28px; padding-right: 70px; }
  .featured-actions { grid-template-columns: 1fr; }
  .featured-nav { right: 18px; top: 18px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .heading-tools { width: 100%; justify-content: space-between; }
  .video-grid { grid-template-columns: 1fr; }
  .infographic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-panel, .tag-section { padding: 14px; }
  .footer-brand strong { font-size: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .field-full { grid-column: auto; }
  .dialog-card { padding: 22px 18px; }
  .admin-sidebar { padding: 10px; }
  .admin-brand { display: none; }
  .admin-nav-item { padding: 10px; font-size: 13px; }
  .admin-toolbar { flex-wrap: wrap; }
  .stat-card { min-width: calc(50% - 6px); }
  .push-right { width: 100%; margin-left: 0; }
  .viewer-copy { padding: 28px 20px 22px; }
}

/* ===== BỔ SUNG V4: menu Sổ tay, thẻ nội dung gọn và trình xem ảnh zoom/kéo ===== */
.featured-section { padding-top: 22px; }

.nav-inner { position: relative; overflow: visible; }
.nav-dropdown-host { position: relative; display: flex; align-items: stretch; }
.nav-item-menu { min-width: 190px; justify-content: flex-start; }
.nav-item-copy { display: grid; gap: 1px; text-align: left; line-height: 1.1; }
.nav-item-copy strong { font-size: 15px; }
.nav-item-copy small { max-width: 118px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 600; color: var(--muted); }
.nav-item-menu.filter-active { background: var(--blue-100); color: var(--blue-950); box-shadow: inset 0 0 0 1px var(--blue-200); }
.nav-item-menu.filter-active .nav-item-copy small { color: var(--blue-700); }
.nav-item-menu.menu-open { background: var(--blue-800); color: #fff; box-shadow: 0 8px 20px rgba(13,91,170,.18); }
.nav-item-menu.menu-open span,
.nav-item-menu.menu-open .nav-item-copy small { color: #fff; }
.nav-chevron { margin-left: auto; transition: transform .18s ease; }
.nav-item-menu.menu-open .nav-chevron { transform: rotate(180deg); }

.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 120;
  width: min(390px, calc(100vw - 28px));
  max-height: min(650px, calc(100vh - 190px));
  overflow: auto;
  padding: 14px;
  border: 1px solid #cfe1ee;
  border-radius: 18px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 24px 65px rgba(10, 62, 103, .22);
  backdrop-filter: blur(12px);
}
.nav-dropdown-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 4px 12px; border-bottom: 1px solid var(--line); }
.nav-dropdown-heading div { display: grid; gap: 2px; }
.nav-dropdown-heading small { color: var(--red-600); font-size: 10px; font-weight: 850; letter-spacing: .08em; }
.nav-dropdown-heading strong { color: var(--blue-950); font-size: 19px; }
.nav-dropdown-heading button { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--blue-50); color: var(--blue-900); font-size: 22px; }
.nav-dropdown-group { display: grid; gap: 8px; padding-top: 13px; }
.nav-dropdown-label { color: #667085 !important; font-size: 11px !important; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.nav-dropdown-option { display: grid; grid-template-columns: 38px 1fr; grid-template-rows: auto auto; column-gap: 10px; width: 100%; padding: 10px 11px; text-align: left; border: 1px solid #e4edf4; border-radius: 12px; background: #fff; color: var(--blue-950); }
.nav-dropdown-option > span { grid-row: 1 / 3; align-self: center; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--blue-50); color: var(--blue-700); font-size: 17px; }
.nav-dropdown-option strong { font-size: 14px; }
.nav-dropdown-option small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.nav-dropdown-option:hover { border-color: var(--blue-300); background: var(--blue-50); }
.nav-dropdown-option.active { border-color: var(--blue-700); background: var(--blue-100); box-shadow: inset 3px 0 0 var(--blue-700); }
.nav-category-group { border-top: 1px solid var(--line); margin-top: 13px; }
.nav-category-list { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.nav-category-option { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; border: 1px solid #e2ebf2; border-radius: 10px; background: #fff; color: #344054; text-align: left; font-weight: 700; }
.nav-category-option span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.nav-category-option small { flex: 0 0 auto; min-width: 24px; height: 22px; display: grid; place-items: center; border-radius: 999px; background: #eef5fa; color: var(--blue-800); font-size: 10px; }
.nav-category-option:hover,
.nav-category-option.active { border-color: var(--blue-600); background: var(--blue-100); color: var(--blue-950); }
.nav-reset-button { width: 100%; margin-top: 13px; padding: 10px 12px; border: 0; border-radius: 11px; background: #f4f7fa; color: var(--blue-800); font-weight: 750; }
.nav-reset-button:hover { background: var(--red-100); color: var(--red-700); }

.compact-content-card { position: relative; }
.compact-card-body { padding: 12px 13px 14px; min-height: 70px; justify-content: center; }
.compact-card-body h3 { margin: 0; font-size: 15px; line-height: 1.42; -webkit-line-clamp: 2; }
.card-title-button { width: 100%; padding: 0; border: 0; background: transparent; color: #182230; text-align: left; font-weight: 750; line-height: inherit; }
.card-title-button:hover { color: var(--blue-800); }
.card-share-overlay { position: absolute; z-index: 4; right: 9px; top: 9px; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.72); border-radius: 50%; background: rgba(7, 35, 61, .78); color: #fff; font-size: 18px; box-shadow: 0 6px 16px rgba(0,0,0,.18); backdrop-filter: blur(5px); }
.card-share-overlay:hover { background: var(--red-600); transform: translateY(-1px); }
.card-view-icon { position: absolute; inset: 50% auto auto 50%; translate: -50% -50%; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: rgba(7, 35, 61, .78); color: #fff; font-size: 24px; opacity: 0; transform: scale(.88); transition: .18s ease; }
.infographic-card:hover .card-view-icon { opacity: 1; transform: scale(1); }

.viewer-stage-column { position: relative; min-width: 0; min-height: 650px; overflow: hidden; background: #07121f; }
.viewer-image-wrap { position: absolute; inset: 0; min-height: 0; padding: 70px 24px 44px; overflow: hidden; display: grid; place-items: center; touch-action: none; cursor: grab; outline: none; }
.viewer-image-wrap:focus-visible { box-shadow: inset 0 0 0 3px rgba(159,215,255,.65); }
.viewer-image-wrap.is-dragging { cursor: grabbing; }
.viewer-image-wrap img { max-width: 100%; max-height: calc(100vh - 120px); width: auto; height: auto; object-fit: contain; transform-origin: center center; will-change: transform; user-select: none; pointer-events: none; transition: transform .12s ease; }
.viewer-image-wrap.is-dragging img { transition: none; }
.viewer-toolbar { position: absolute; z-index: 4; left: 16px; top: 16px; display: flex; align-items: center; gap: 7px; padding: 7px; border: 1px solid rgba(255,255,255,.18); border-radius: 13px; background: rgba(7, 24, 42, .78); box-shadow: 0 10px 28px rgba(0,0,0,.24); backdrop-filter: blur(8px); }
.viewer-toolbar button { min-width: 38px; height: 38px; padding: 0 10px; border: 1px solid rgba(255,255,255,.14); border-radius: 9px; background: rgba(255,255,255,.1); color: #fff; font-weight: 800; }
.viewer-toolbar button:hover { background: rgba(255,255,255,.2); }
.viewer-toolbar .viewer-zoom-value { min-width: 62px; font-size: 12px; }
.viewer-toolbar .viewer-fit-button { min-width: 82px; font-size: 12px; }
.viewer-pan-hint { position: absolute; z-index: 2; left: 50%; bottom: 12px; translate: -50% 0; max-width: calc(100% - 28px); padding: 7px 11px; border-radius: 999px; background: rgba(7, 24, 42, .72); color: rgba(255,255,255,.78); font-size: 11px; white-space: nowrap; pointer-events: none; }

@media (max-width: 860px) {
  .nav-inner { overflow: visible; flex-wrap: wrap; }
  .nav-item { flex: 1 1 auto; justify-content: center; }
  .nav-dropdown-host { flex: 1 1 auto; }
  .nav-item-menu { width: 100%; min-width: 170px; }
  .nav-dropdown { top: calc(100% + 5px); }
  .viewer-stage-column { min-height: 56vh; }
  .viewer-image-wrap { min-height: 0; }
}

@media (max-width: 620px) {
  .nav-inner { gap: 2px; padding-block: 4px; }
  .nav-item { min-height: 48px; margin-block: 2px; padding-inline: 10px; font-size: 13px; }
  .nav-item-menu { min-width: 155px; }
  .nav-item-copy small { max-width: 96px; }
  .nav-dropdown { position: fixed; left: 10px; right: 10px; top: auto; width: auto; max-height: 70vh; }
  .nav-category-list { grid-template-columns: 1fr; }
  .compact-card-body { min-height: 64px; padding: 10px 11px 12px; }
  .compact-card-body h3 { font-size: 14px; }
  .viewer-stage-column { min-height: 58vh; }
  .viewer-toolbar { left: 10px; top: 10px; gap: 4px; padding: 5px; }
  .viewer-toolbar button { min-width: 34px; height: 34px; padding-inline: 7px; }
  .viewer-toolbar .viewer-fit-button { min-width: 70px; }
  .viewer-pan-hint { white-space: normal; text-align: center; border-radius: 10px; }
}
.library-grid.single-panel { grid-template-columns: 1fr; }
@media (max-width: 620px) {
  .nav-dropdown { max-height: calc(100vh - 110px); }
}


/* ===== BỔ SUNG V5: phối màu giao diện và trình xem toàn màn hình trên điện thoại ===== */
.settings-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.settings-heading-row h3 { margin-bottom: 4px; }
.settings-heading-row p { margin: 0; max-width: 820px; }
.theme-presets { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 10px; margin: 18px 0; }
.theme-preset { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 13px; padding: 10px; display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 10px; text-align: left; }
.theme-preset:hover, .theme-preset.active { border-color: var(--blue-600); box-shadow: 0 0 0 3px var(--blue-100); }
.theme-preset > span { height: 34px; border-radius: 9px; background: linear-gradient(120deg, var(--p1) 0 40%, var(--p2) 40% 73%, var(--p3) 73%); border: 1px solid rgba(0,0,0,.06); }
.theme-preset strong { font-size: 13px; }
.theme-color-grid { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 12px; }
.color-field { border: 1px solid var(--line); border-radius: 13px; padding: 10px; background: #fbfdff; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 7px 10px; }
.color-field > span { grid-column: 1 / -1; color: #344054; font-size: 13px; font-weight: 750; }
.color-field input[type="color"] { width: 52px; height: 38px; padding: 2px; border: 1px solid #cbd9e5; border-radius: 9px; background: #fff; }
.color-field output { color: var(--muted); font: 700 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
.theme-layout-grid { margin-top: 14px; }

.presentation-dialog.single-video-mode .presentation-shell { display: block; position: relative; height: 100%; }
.presentation-dialog.single-video-mode .presentation-header { position: absolute; z-index: 5; inset: 0 0 auto 0; min-height: 58px; justify-content: flex-end; background: linear-gradient(180deg, rgba(0,0,0,.62), transparent); pointer-events: none; }
.presentation-dialog.single-video-mode .presentation-header > div:first-child,
.presentation-dialog.single-video-mode #fullscreenButton { display: none; }
.presentation-dialog.single-video-mode .presentation-header > div:last-child { pointer-events: auto; }
.presentation-dialog.single-video-mode #closePresentationButton { background: rgba(0,0,0,.58); border-color: rgba(255,255,255,.32); border-radius: 50%; }
.presentation-dialog.single-video-mode .presentation-main { display: block; height: 100%; }
.presentation-dialog.single-video-mode .presentation-stage { height: 100%; }
.presentation-dialog.single-video-mode .presentation-caption,
.presentation-dialog.single-video-mode .presentation-playlist,
.presentation-dialog.single-video-mode .presentation-arrow { display: none; }

@media (max-width: 860px) {
  .theme-presets, .theme-color-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .featured-info { min-height: 0; padding-bottom: 18px; }
  .featured-info > p,
  .featured-tags,
  .featured-meta { display: none; }
  .featured-info h1 { margin-bottom: 18px; }

  .viewer-dialog { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; border-radius: 0; }
  .viewer-shell { display: block; width: 100%; height: 100dvh; min-height: 0; overflow: hidden; background: #07121f; }
  .viewer-stage-column { width: 100%; height: 100dvh; min-height: 0; }
  .viewer-copy { display: none; }
  .viewer-close { position: fixed; z-index: 12; right: max(12px, env(safe-area-inset-right)); top: max(12px, env(safe-area-inset-top)); width: 46px; height: 46px; background: rgba(255,255,255,.94); }
  .viewer-image-wrap { inset: 0; width: 100%; height: 100%; padding: 72px 6px 22px; }
  .viewer-image-wrap img { max-height: calc(100dvh - 94px); }
  .viewer-toolbar { position: fixed; z-index: 11; left: max(8px, env(safe-area-inset-left)); top: max(10px, env(safe-area-inset-top)); right: 70px; justify-content: flex-start; width: fit-content; max-width: calc(100vw - 86px); }
  .viewer-toolbar .viewer-fit-button { min-width: 66px; }
  .viewer-pan-hint { bottom: max(10px, env(safe-area-inset-bottom)); }

  .presentation-dialog,
  .presentation-dialog.single-video-mode { width: 100vw; height: 100dvh; }
  .presentation-dialog.single-video-mode .presentation-header { padding-top: max(8px, env(safe-area-inset-top)); padding-right: max(10px, env(safe-area-inset-right)); }
  .presentation-dialog.single-video-mode .presentation-stage iframe { width: 100%; height: 100dvh; }

  .settings-heading-row { display: grid; }
  .settings-heading-row .button { width: 100%; }
  .theme-presets, .theme-color-grid { grid-template-columns: 1fr; }
}

/* V6 - trạng thái dữ liệu dùng chung */
.shared-storage-card { grid-column: 1 / -1; }
.sync-actions { display:flex; gap:12px; flex-wrap:wrap; margin-top:18px; }
.sync-help { margin:14px 0 0; padding:12px 14px; border-radius:14px; background:color-mix(in srgb, var(--primary-color) 8%, white); color:var(--text-muted); line-height:1.55; }
.sync-status-badge { display:inline-flex; align-items:center; justify-content:center; min-height:34px; padding:6px 12px; border-radius:999px; background:#eef4fb; color:var(--primary-dark); font-size:.82rem; font-weight:800; white-space:nowrap; }
.sync-status-badge.online { background:#e8f8ef; color:#167446; }
.sync-status-badge.empty { background:#fff6df; color:#8a5c00; }
.sync-status-badge.error { background:#fff0f2; color:#b21f3d; }
.sync-status-badge.syncing { background:#e9f3ff; color:#0d5baa; }
@media (max-width: 640px) {
  .sync-actions .button { width:100%; }
  .shared-storage-card .settings-heading-row { align-items:flex-start; }
}

/* V6.1: màn hình chờ ngắn trong lúc lấy dữ liệu dùng chung, tránh hiển thị video mẫu/cũ. */
.app-boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--header-start, #eaf7ff), var(--header-end, #bde5fb));
}
.app-boot-overlay[hidden] { display: none !important; }
.app-boot-card {
  min-width: min(360px, 88vw);
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 28px 24px;
  border: 1px solid rgba(13, 91, 170, .16);
  border-radius: 22px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 18px 55px rgba(7, 55, 99, .16);
  color: var(--primary-dark, #073763);
  text-align: center;
}
.app-boot-card strong { font-size: 1.05rem; }
.app-boot-card small { color: #64748b; }
.app-boot-spinner {
  width: 38px;
  height: 38px;
  border: 4px solid rgba(13, 91, 170, .18);
  border-top-color: var(--primary-color, #0d5baa);
  border-radius: 50%;
  animation: app-boot-spin .75s linear infinite;
}
@keyframes app-boot-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .app-boot-spinner { animation-duration: 1.6s; } }

/* V6.3 - trạng thái sao lưu/phục hồi */
.backup-progress {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary-color) 5%, white);
  color: var(--text-muted);
  line-height: 1.5;
}
.backup-progress[data-state="working"] {
  color: var(--primary-dark);
  border-color: color-mix(in srgb, var(--primary-color) 30%, white);
  background: color-mix(in srgb, var(--primary-color) 10%, white);
}
.backup-progress[data-state="success"] {
  color: #176b3a;
  border-color: #b7dfc5;
  background: #effaf3;
}
.backup-progress[data-state="error"] {
  color: #9d1d2d;
  border-color: #f1b8c0;
  background: #fff3f5;
}

/* ======================================================================
   V9 — GIAO DIỆN ĐỒNG BỘ + MYSQL DÙNG CHUNG + INFOGRAPHIC TOÀN MÀN HÌNH
   ====================================================================== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-x: hidden; }
button, input, select, textarea, a { -webkit-tap-highlight-color: transparent; }

/* Header gọn, trang nhã, đồng bộ với giao diện mẫu */
.header-surface {
  background:
    radial-gradient(circle at 87% 15%, rgba(255,255,255,.92), transparent 32%),
    linear-gradient(112deg, color-mix(in srgb, var(--header-start) 92%, white) 0%, var(--header-start) 46%, var(--header-end) 100%);
}
.header-surface::before {
  height: 74px;
  bottom: -52px;
  border-top-color: rgba(255,255,255,.88);
  box-shadow: 0 -12px 32px rgba(255,255,255,.52);
}
.header-surface::after {
  height: 68px;
  bottom: -58px;
  border-top-color: color-mix(in srgb, var(--blue-600) 17%, transparent);
}
.header-inner { min-height: 116px; padding-block: 14px; gap: 22px; }
.brand { gap: 15px; }
.brand-logo { width: 84px; height: 84px; }
.brand-copy { gap: 2px; min-width: 0; }
.brand-copy small { font-size: clamp(16px, 1.45vw, 22px); letter-spacing: .055em; }
.brand-copy strong {
  font-size: clamp(25px, 2.35vw, 38px);
  line-height: 1.06;
  letter-spacing: -.028em;
  white-space: normal;
  text-wrap: balance;
  overflow-wrap: break-word;
}
.header-tools { flex: 0 1 auto; }
.global-search { height: 46px; width: clamp(240px, 29vw, 390px); border-radius: 14px; }
.global-search button { width: 52px; font-size: 24px; }
.account-button { min-width: 92px; }

/* Điều hướng: Cổng ứng dụng nằm ngay cạnh Trang chủ */
.main-nav { box-shadow: 0 8px 26px rgba(28,82,126,.035); }
.nav-inner { min-height: 62px; gap: 7px; align-items: center; }
.nav-item {
  min-height: 46px;
  margin-block: 7px;
  padding: 0 17px;
  border-radius: 12px;
  text-decoration: none;
  flex: 0 0 auto;
}
.nav-item.active { box-shadow: 0 8px 20px rgba(226,25,54,.16); }
.nav-portal {
  background: linear-gradient(135deg, var(--blue-800), var(--blue-950));
  color: #fff;
  box-shadow: 0 8px 20px rgba(7,55,99,.16);
}
.nav-portal span { color: #fff; }
.nav-portal:hover { background: linear-gradient(135deg, var(--blue-700), var(--blue-900)); color: #fff; }
.nav-portal:focus-visible { outline: 3px solid rgba(43,139,208,.25); outline-offset: 2px; }

/* Hero */
.featured-section { grid-template-columns: minmax(0, 1.34fr) minmax(340px, .82fr); gap: 22px; padding-top: 24px; }
.player-card, .featured-info, .content-panel { border-color: color-mix(in srgb, var(--line) 84%, white); box-shadow: 0 14px 36px rgba(28,82,126,.09); }
.player-card { min-height: 440px; border-radius: 22px; }
.player-card iframe { min-height: 440px; }
.featured-info { min-height: 440px; padding: 30px 28px 26px; }
.featured-info h1 { font-size: clamp(29px, 2.15vw, 38px); line-height: 1.13; text-wrap: balance; overflow-wrap: break-word; }
.featured-info > p { font-size: 15px; }
.featured-meta { margin-block: 18px 16px; }
.featured-actions .button { min-height: 48px; }

/* Thư viện */
.library-grid { gap: 22px; padding-top: 22px; padding-bottom: 26px; }
.content-panel { padding: 20px; border-radius: 22px; }
.section-heading { margin-bottom: 15px; }
.section-heading h2 { font-size: 24px; }
.content-card { border-radius: 16px; box-shadow: 0 4px 15px rgba(28,82,126,.04); }
.content-card:hover { transform: translateY(-2px); }
.video-card .card-media { aspect-ratio: 16 / 9; background: #081827; }
.video-card .card-media img { object-fit: cover; }
.infographic-card .card-media { aspect-ratio: 3 / 4; background: #f3f9fd; }
.infographic-card .card-media img { object-fit: contain; padding: 5px; background: #f8fcff; }
.compact-card-body { min-height: 76px; padding: 12px 13px 14px; }
.compact-card-body h3,
.card-title-button { overflow-wrap: break-word; word-break: normal; hyphens: none; }

/* INFOGRAPHIC: chỉ hiển thị ảnh, toàn màn hình. Không còn cột nội dung/toolbar zoom. */
.viewer-dialog,
.viewer-image-only-dialog {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: #040b13;
  box-shadow: none;
}
.viewer-dialog::backdrop { background: rgba(3,10,18,.96); backdrop-filter: none; }
.viewer-shell,
.viewer-image-only-shell {
  display: block;
  width: 100vw;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: #040b13;
}
.viewer-stage-column {
  position: relative;
  width: 100vw;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: #040b13;
}
.viewer-copy,
.viewer-toolbar,
.viewer-pan-hint { display: none !important; }
.viewer-image-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #040b13;
  cursor: default;
  outline: none;
  touch-action: pinch-zoom;
  overscroll-behavior: contain;
}
.viewer-image-wrap img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100vw;
  max-height: 100dvh;
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  pointer-events: auto;
  transform-origin: center center;
}
.viewer-close {
  position: fixed;
  z-index: 30;
  right: max(14px, env(safe-area-inset-right));
  top: max(14px, env(safe-area-inset-top));
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(7,24,42,.78);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  box-shadow: 0 10px 30px rgba(0,0,0,.28);
  backdrop-filter: blur(10px);
}
.viewer-close:hover { background: var(--red-600); }

/* Tablet */
@media (max-width: 1180px) {
  .header-inner { min-height: 108px; }
  .brand-logo { width: 76px; height: 76px; }
  .global-search { width: clamp(230px, 35vw, 330px); }
  .featured-section { grid-template-columns: 1.18fr .82fr; }
  .featured-info { min-height: 400px; }
  .player-card, .player-card iframe { min-height: 400px; }
}

@media (max-width: 900px) {
  .container { width: min(calc(100% - 24px), var(--container)); }
  .header-inner { min-height: 0; flex-direction: column; align-items: stretch; gap: 12px; padding-block: 12px 14px; }
  .brand { align-self: flex-start; }
  .brand-logo { width: 68px; height: 68px; }
  .brand-copy small { font-size: 15px; }
  .brand-copy strong { font-size: clamp(23px, 5.4vw, 30px); }
  .header-tools { width: 100%; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; }
  .global-search { width: 100%; }
  .account-button { justify-self: end; min-width: 46px; }
  .account-button span:last-child { display: none; }

  .nav-inner {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1px;
  }
  .nav-inner::-webkit-scrollbar { display: none; }
  .nav-item { flex: 0 0 auto; min-height: 44px; padding-inline: 14px; white-space: nowrap; }
  .nav-dropdown-host { flex: 0 0 auto; }
  .nav-item-menu { width: auto; min-width: 166px; }
  .nav-dropdown { position: fixed; left: 12px; right: 12px; top: auto; width: auto; max-height: 72vh; }

  .featured-section { grid-template-columns: 1fr; gap: 14px; padding-top: 16px; }
  .player-card, .player-card iframe { min-height: auto; aspect-ratio: 16 / 9; }
  .featured-info { min-height: 0; padding: 22px; }
  .featured-info h1 { padding-right: 70px; font-size: clamp(26px, 5vw, 34px); }
  .library-grid { grid-template-columns: 1fr; gap: 16px; }
}

/* Điện thoại: không bể chữ, không kéo méo ảnh, điều hướng ngang có thể vuốt */
@media (max-width: 620px) {
  :root { --radius-xl: 18px; --radius-lg: 15px; }
  .container { width: min(calc(100% - 18px), var(--container)); }
  .header-inner { padding-block: 10px 12px; }
  .brand { gap: 10px; }
  .brand-logo { width: 58px; height: 58px; }
  .brand-copy small { font-size: 12px; }
  .brand-copy strong { font-size: clamp(19px, 5.8vw, 25px); line-height: 1.08; }
  .header-tools { grid-template-columns: minmax(0,1fr) 44px; }
  .global-search { height: 44px; border-radius: 12px; }
  .global-search input { padding-inline: 13px; font-size: 14px; }
  .global-search button { width: 48px; }
  .account-button { padding: 0; }
  .account-icon { width: 42px; height: 42px; }

  .nav-inner { gap: 5px; padding-block: 3px; }
  .nav-item { min-height: 42px; margin-block: 4px; padding-inline: 12px; font-size: 13px; border-radius: 11px; }
  .nav-portal { order: 1; }
  .nav-dropdown-host { order: 2; }
  #navPresentationButton { order: 3; }
  [data-open-admin="true"].nav-item { order: 4; }
  .nav-item-copy small { max-width: 92px; }

  .featured-section { padding-top: 12px; }
  .player-card { border-radius: 17px; }
  .featured-info { padding: 18px 16px 16px; border-radius: 17px; }
  .featured-info h1 { font-size: clamp(24px, 7vw, 30px); line-height: 1.16; margin-top: 14px; }
  .featured-actions { gap: 8px; }
  .featured-actions .button { min-height: 46px; }

  .content-panel { padding: 14px 12px; border-radius: 17px; }
  .section-heading { align-items: flex-start; gap: 10px; }
  .section-heading h2 { font-size: 21px; }
  .heading-tools { gap: 6px; font-size: 11px; }
  .compact-select { max-width: 125px; padding: 8px 26px 8px 8px; font-size: 11px; }
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .infographic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .compact-card-body { min-height: 70px; padding: 10px; }
  .compact-card-body h3 { font-size: 13px; line-height: 1.35; -webkit-line-clamp: 3; }
  .card-share-overlay { width: 32px; height: 32px; right: 7px; top: 7px; }
  .card-play { width: 42px; height: 42px; }

  .viewer-close { width: 44px; height: 44px; right: max(10px, env(safe-area-inset-right)); top: max(10px, env(safe-area-inset-top)); }
  .viewer-image-wrap { touch-action: pinch-zoom; }
  .viewer-image-wrap img { max-width: 100vw; max-height: 100dvh; }
}

@media (max-width: 390px) {
  .brand-copy strong { font-size: 19px; }
  .nav-item { padding-inline: 10px; }
  .nav-portal { max-width: none; }
  .heading-tools > span { display: none; }
  .compact-select { max-width: 118px; }
}
