@font-face { font-family: "BVP"; src: url("vendor/fonts/BeVietnamPro-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "BVP"; src: url("vendor/fonts/BeVietnamPro-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
	/* Bản 3.x: nền không gian tối, kính mờ, màu nhấn theo công cụ (biến --ac, --ac2, --ac-on, --ac-rgb đặt ở cuối app.css theo data-mode). */
	--bg0: #05080f; --pnl: #0d1524; --pnl-h: #121c30;
	--glass: rgba(10, 16, 28, .74); --glass-2: rgba(16, 24, 40, .88);
	--line: rgba(150, 180, 230, .14); --line-2: rgba(150, 180, 230, .26);
	--tx: #eaf1fb; --mu: #9aa9c0; --mu2: #6b7b93;
	--ac: #4da3ff; --ac2: #8b7bff; --ac-on: #061426; --ac-rgb: 77, 163, 255;
	--ac-ink: color-mix(in srgb, var(--ac) 62%, #fff); --ac-soft: rgba(var(--ac-rgb), .13); --ac-line: rgba(var(--ac-rgb), .5);
	--bad: #ef6a70; --ok: #4fd1a0; --warn: #ffb84d;
	--r: 12px; --r-sm: 9px; --mbar: 58px;
	--ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg0); color: var(--tx); font: 14px/1.45 "BVP", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; overflow: hidden; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(var(--ac-rgb), .35); }
#app { display: flex; flex-direction: column; height: 100%; min-height: 0; position: relative; isolation: isolate;
	background:
		radial-gradient(1000px 520px at 50% -10%, rgba(var(--ac-rgb), .17), transparent 70%),
		radial-gradient(760px 460px at 100% 105%, rgba(var(--ac-rgb), .08), transparent 70%),
		radial-gradient(1.1px 1.1px at 14% 26%, rgba(255, 255, 255, .6), transparent) 0 0 / 290px 230px,
		radial-gradient(1px 1px at 63% 71%, rgba(255, 255, 255, .45), transparent) 0 0 / 370px 310px,
		radial-gradient(1.4px 1.4px at 86% 18%, rgba(255, 255, 255, .5), transparent) 0 0 / 510px 420px,
		var(--bg0); }

/* ---- thanh trên (kính mờ) ---- */
.menubar { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 0 max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left)); min-height: var(--mbar); background: var(--glass); backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%); z-index: 7; flex: none; }
.menubar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(var(--ac-rgb), .55) 30%, rgba(var(--ac-rgb), .55) 70%, transparent); opacity: .55; }
.mb-l, .mb-r, .mb-c { display: flex; align-items: center; min-width: 0; }
.mb-l { gap: 2px; }
.mb-r { gap: 8px; justify-content: flex-end; }
.mb-c { gap: 10px; justify-content: center; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 14px 0 0; margin-right: 6px; border-right: 1px solid var(--line); height: 34px; }
.brand .mark { display: flex; filter: drop-shadow(0 4px 12px rgba(var(--ac-rgb), .45)); }
.brand svg { display: block; }
.wm { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.wm b { font-size: 10.5px; letter-spacing: .22em; color: var(--mu); font-weight: 700; }
.wm em { font-style: normal; font-size: 14px; font-weight: 700; color: var(--tx); white-space: nowrap; margin-top: 2px; }
.mbi { height: 34px; padding: 0 13px; border: 0; background: none; color: var(--mu); border-radius: var(--r-sm); cursor: pointer; font-size: 14px; white-space: nowrap; transition: background .15s, color .15s; }
.mbi:hover, .mbi[aria-expanded="true"] { background: rgba(255, 255, 255, .07); color: var(--tx); }
.fname { position: relative; max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 6px 15px; border-radius: 999px; background: rgba(255, 255, 255, .045); border: 1px solid var(--line); color: var(--tx); font-size: 13px; }
.fname:empty { display: none; }
.fname.dirty::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 10px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 10px var(--warn); vertical-align: 1px; }
.autosave { color: var(--mu2); font-size: 12px; white-space: nowrap; }

/* ---- nút ---- */
.btn, .tool { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid transparent; background: transparent; color: var(--tx); border-radius: 10px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, transform .12s var(--ease), box-shadow .2s; }
.btn { border-color: var(--line); background: rgba(255, 255, 255, .05); }
.btn:hover:not(:disabled), .tool:hover { background: rgba(255, 255, 255, .1); border-color: var(--line-2); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.985); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.primary { background: linear-gradient(135deg, var(--ac), var(--ac2)); border-color: transparent; color: var(--ac-on); font-weight: 700; box-shadow: 0 8px 22px -8px rgba(var(--ac-rgb), .7), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08) saturate(1.05); box-shadow: 0 12px 28px -8px rgba(var(--ac-rgb), .85), inset 0 1px 0 rgba(255, 255, 255, .4); }
.btn.danger { color: #ffb4b6; border-color: rgba(239, 106, 112, .4); background: transparent; }
.btn.danger:hover:not(:disabled) { background: rgba(239, 106, 112, .14); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn.lg { height: 52px; padding: 0 28px; font-size: 15.5px; border-radius: 14px; }
.tool { color: var(--mu); }
.tool:hover { color: var(--tx); }
#bRead[aria-pressed="true"] { border-color: var(--ac-line); color: var(--ac-ink); background: var(--ac-soft); }
#app.empty #bRead, #app.empty #bSave, #app.empty #bMore { opacity: .4; pointer-events: none; }
#app.empty .menubar .btn.primary { background: rgba(255, 255, 255, .08); color: var(--mu); box-shadow: none; }
.split { position: relative; display: inline-flex; }
.split #bSave { border-top-right-radius: 0; border-bottom-right-radius: 0; padding-right: 15px; }
.split .save-more { padding: 0 9px; border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 1px solid rgba(0, 0, 0, .22); }

.ic { width: 18px; height: 18px; display: inline-block; background: currentColor; flex: none;
	-webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.ic-open { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7v12a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-7l-2-3H5a2 2 0 0 0-2 2z'/%3E%3C/svg%3E"); }
.ic-plus { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); }
.ic-save { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12m0 0 4-4m-4 4-4-4M5 21h14'/%3E%3C/svg%3E"); }
.ic-print { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M6 9V3h12v6M6 18H4a1 1 0 0 1-1-1v-6a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v6a1 1 0 0 1-1 1h-2'/%3E%3Crect x='6' y='14' width='12' height='7'/%3E%3C/svg%3E"); }
.ic-close { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E"); }
.ic-caret { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); }
.ic-key { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='6' width='19' height='12' rx='2'/%3E%3Cpath d='M6 10h.01M10 10h.01M14 10h.01M18 10h.01M7 14h10'/%3E%3C/svg%3E"); }
.ic-up { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 15 6-6 6 6'/%3E%3C/svg%3E"); }
.ic-down { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.ic-copy { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='8' y='8' width='12' height='12' rx='2'/%3E%3Cpath d='M4 16V6a2 2 0 0 1 2-2h10'/%3E%3C/svg%3E"); }
.ic-eye { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
.ic-eye-off { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3l18 18M10.6 5.1A10 10 0 0 1 12 5c6.4 0 10 7 10 7a17 17 0 0 1-3.2 4M6.6 6.6C3.9 8.3 2 12 2 12s3.6 7 10 7a9.6 9.6 0 0 0 5.4-1.6M9.9 9.9a3 3 0 0 0 4.2 4.2'/%3E%3C/svg%3E"); }
.ic-trash { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M9 7V4h6v3M6 7l1 13h10l1-13'/%3E%3C/svg%3E"); }
.ic-grip { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6h.01M15 6h.01M9 12h.01M15 12h.01M9 18h.01M15 18h.01' stroke-width='3'/%3E%3C/svg%3E"); }
.ic-play-from { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 4.5v15'/%3E%3Cpath d='M9 4.5v15l11-7.5z' fill='black'/%3E%3C/svg%3E"); }
.ic-play { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 4.5v15l12-7.5z' fill='black'/%3E%3C/svg%3E"); }
.ic-presenter { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='4' width='12' height='9' rx='1.5'/%3E%3Cpath d='M17.5 6h4M17.5 10h4M2.5 17h19M8 13v4'/%3E%3C/svg%3E"); }
.ic-full { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3H5a2 2 0 0 0-2 2v3'/%3E%3Cpath d='M21 8V5a2 2 0 0 0-2-2h-3'/%3E%3Cpath d='M3 16v3a2 2 0 0 0 2 2h3'/%3E%3Cpath d='M16 21h3a2 2 0 0 0 2-2v-3'/%3E%3C/svg%3E"); }
.ic-exitfull { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3v3a2 2 0 0 1-2 2H3'/%3E%3Cpath d='M21 8h-3a2 2 0 0 1-2-2V3'/%3E%3Cpath d='M3 16h3a2 2 0 0 1 2 2v3'/%3E%3Cpath d='M16 21v-3a2 2 0 0 1 2-2h3'/%3E%3C/svg%3E"); }
.ic-toc { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6h11M9 12h11M9 18h11'/%3E%3Ccircle cx='4.5' cy='6' r='1'/%3E%3Ccircle cx='4.5' cy='12' r='1'/%3E%3Ccircle cx='4.5' cy='18' r='1'/%3E%3C/svg%3E"); }
.ic-find { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6'/%3E%3Cpath d='m15 15 5 5'/%3E%3C/svg%3E"); }
.ic-note { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 4h14v11l-5 5H5z'/%3E%3Cpath d='M14 20v-5h5M8.5 9h7M8.5 12.5h5'/%3E%3C/svg%3E"); }
.ic-bookmark { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 3.5h10v17l-5-4-5 4z'/%3E%3C/svg%3E"); }
.ic-speak { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9.5h3.5L12 5.5v13l-4.5-4H4z'/%3E%3Cpath d='M15.5 9a4 4 0 0 1 0 6M18 6.5a7.5 7.5 0 0 1 0 11'/%3E%3C/svg%3E"); }
.ic-aa { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 18 8 6l5 12M4.8 14h6.4'/%3E%3Cpath d='M14 18l3.5-8.5L21 18M15.2 15.2h4.6'/%3E%3C/svg%3E"); }
.ic-left { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 5 8 12l7 7'/%3E%3C/svg%3E"); }
.ic-right { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 5 7 7-7 7'/%3E%3C/svg%3E"); }
.ic-pause { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 5v14M16 5v14'/%3E%3C/svg%3E"); }
.ic-play { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 5v14l12-7z'/%3E%3C/svg%3E"); }
.ic-zout { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5M7.5 10.5h6'/%3E%3C/svg%3E"); }
.ic-zin { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5M7.5 10.5h6M10.5 7.5v6'/%3E%3C/svg%3E"); }
.ic-fitpage { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6' y='3.5' width='12' height='17' rx='1.5'/%3E%3Cpath d='M3 8V3.5h3.5M21 8V3.5h-3.5M3 16v4.5h3.5M21 16v4.5h-3.5'/%3E%3C/svg%3E"); }
.ic-fitwidth { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6' y='5' width='12' height='14' rx='1.5'/%3E%3Cpath d='M2.5 12h3M18.5 12h3M4 10l-1.5 2L4 14M20 10l1.5 2-1.5 2'/%3E%3C/svg%3E"); }
.ic-shelf { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h16M6 20V6h3v14M10 20V4h3v16M14.5 20l-.5-13 3-.5 1.5 13.5'/%3E%3C/svg%3E"); }


/* ---- vùng làm việc: khung LibreOffice như một cửa sổ nổi ---- */
.stage { flex: 1; min-height: 0; position: relative; z-index: 0; isolation: isolate; color: var(--tx); }

/* ---- màn hình đầu ---- */
.drop { position: absolute; inset: var(--mbar) 0 0 0; display: flex; align-items: center; justify-content: center; overflow: auto; overscroll-behavior: contain; padding: 24px max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); z-index: 3; }
#app:not(.empty) .drop { display: none; }
.drop-in { max-width: 640px; width: 100%; margin: auto; padding: 8px 24px 28px; text-align: center; animation: rise .7s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero-art { position: relative; display: inline-block; width: 168px; height: 168px; margin-bottom: 10px; perspective: 700px; }
.hero-art svg { position: absolute; left: 50%; top: 50%; width: 118px; height: 118px; margin: -59px 0 0 -59px; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .5)); animation: float 6s ease-in-out infinite; }
.hero-art::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid rgba(var(--ac-rgb), .4); background: radial-gradient(circle at 50% 0, #fff 0 2.5px, rgba(var(--ac-rgb), .9) 3px, transparent 7px); box-shadow: 0 0 40px -6px rgba(var(--ac-rgb), .35), inset 0 0 40px -14px rgba(var(--ac-rgb), .3); animation: orbit 16s linear infinite; }
.hero-art::after { content: ""; position: absolute; inset: 22px -34px; border-radius: 50%; border: 1px solid var(--line); transform: rotate(-14deg); }
@keyframes orbit { from { transform: rotateX(72deg) rotateZ(0); } to { transform: rotateX(72deg) rotateZ(360deg); } }
@keyframes float { 0%, 100% { transform: translateY(-3px); } 50% { transform: translateY(4px); } }
.drop-in h1 { margin: 6px 0 26px; font-size: 42px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; background: linear-gradient(180deg, #fff 30%, color-mix(in srgb, var(--ac) 45%, #b7c4da)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.btnrow { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin: 4px 0 2px; }
.drop::after { content: ""; position: absolute; inset: 18px; border: 2px dashed var(--ac); border-radius: 28px; background: var(--ac-soft); opacity: 0; pointer-events: none; transition: opacity .18s; }
#app.dragging .drop::after { opacity: 1; }
.restore { margin: 30px auto 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; background: var(--ac-soft); border: 1px solid var(--ac-line); border-radius: 14px; padding: 12px 14px; backdrop-filter: blur(8px); }
.restore p { margin: 0; flex-basis: 100%; color: var(--ac-ink); font-size: 13.5px; }

/* ---- menu thả xuống, hộp thoại, thông báo (kính mờ) ---- */
.dd, .modal, .toast, .help, .ime, #app.reading .rbar { background: var(--glass-2); backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%); border: 1px solid var(--line-2); }
.dd { position: fixed; z-index: 80; color: var(--tx); border-radius: 14px; box-shadow: 0 22px 56px rgba(0, 0, 0, .6); padding: 6px; min-width: 260px; max-height: calc(100vh - 60px); overflow: auto; animation: ddin .14s var(--ease); overscroll-behavior: contain; }
.dd button { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; background: none; border: 0; border-radius: 9px; padding: 9px 12px; color: inherit; cursor: pointer; white-space: nowrap; }
.dd button:hover:not(:disabled), .dd button:focus-visible { background: rgba(var(--ac-rgb), .16); outline: none; }
.dd button:disabled { opacity: .38; cursor: default; }
.dd .kb { margin-left: auto; padding-left: 24px; color: var(--mu2); font-size: 12px; }
.dd .mdiv { height: 1px; background: var(--line); margin: 6px 4px; }
@keyframes ddin { from { opacity: 0; transform: translateY(-5px) scale(.985); } to { opacity: 1; transform: none; } }
.mov { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(3, 5, 10, .66); backdrop-filter: blur(4px); }
.modal { color: var(--tx); border-radius: 20px; max-width: 460px; width: 100%; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); overflow: hidden; animation: ddin .18s var(--ease); }
.modal h2 { margin: 0; padding: 18px 22px 4px; font-size: 17px; letter-spacing: -.01em; }
.modal .mb { padding: 8px 22px 18px; line-height: 1.55; color: var(--mu); }
.modal .mf { padding: 14px 22px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); background: rgba(255, 255, 255, .025); flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; align-items: flex-start; gap: 11px; color: var(--tx); padding: 13px 20px 13px 16px; border-radius: 14px; box-shadow: 0 18px 48px rgba(0, 0, 0, .6); z-index: 95; max-width: min(560px, 92vw); font-size: 13.5px; animation: ddin .22s var(--ease); }
.toast::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 1px; background: var(--ok); -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E"); }
.toast.bad::before { background: var(--bad); --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4 2.5 20h19z'/%3E%3Cpath d='M12 10v5M12 18v.01'/%3E%3C/svg%3E"); }

/* ---- màn chờ tải ---- */
.busy { position: fixed; inset: 0; z-index: 85; display: flex; flex-direction: column; gap: 16px; align-items: center; justify-content: center; color: var(--mu); font-weight: 400; font-size: 14px; background: radial-gradient(700px 420px at 50% 42%, rgba(var(--ac-rgb), .16), transparent 70%), #04070d; animation: fade .25s ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.busy::before { content: ""; width: 58px; height: 58px; border-radius: 50%; order: 0; background: conic-gradient(from 0deg, transparent 0 40%, var(--ac) 85%, var(--ac2)); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px)); animation: spin 1.05s linear infinite; filter: drop-shadow(0 0 14px rgba(var(--ac-rgb), .55)); }
#busyText { order: 2; letter-spacing: .02em; }
.busy-sub { order: 1; }
.busy .bar { order: 3; }
@keyframes spin { to { transform: rotate(360deg); } }
kbd { font: inherit; font-size: 11px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .05); color: var(--mu); white-space: nowrap; }

/* ---- hướng dẫn nhanh ---- */
.help { width: min(660px, 94vw); max-height: 86vh; padding: 0; border-radius: 20px; color: var(--tx); box-shadow: 0 34px 90px rgba(0, 0, 0, .65); }
.help::backdrop { background: rgba(3, 5, 10, .66); backdrop-filter: blur(4px); }
.help-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 10px 22px; border-bottom: 1px solid var(--line); font-size: 15px; }
.help-b2 { padding: 6px 22px 20px; overflow: auto; max-height: calc(86vh - 60px); }
.help h2 { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ac-ink); margin: 18px 0 6px; }
.help dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 13.5px; }
.help dt { color: var(--mu); }
.help dd { margin: 0; }
.help p { color: var(--mu); font-size: 12.5px; margin: 8px 0 0; }

/* ---- toàn màn hình ---- */
.rbar { display: none; }
#app.reading .rbar { display: flex; align-items: center; gap: 2px; position: fixed; right: 18px; top: 16px; z-index: 60; padding: 5px; border-radius: 14px; box-shadow: 0 14px 40px rgba(0, 0, 0, .55); transition: opacity .25s, transform .25s; }
#app.reading .rbar.idle { opacity: 0; pointer-events: none; transform: translateY(-8px); }
.rb { width: 38px; height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--tx); cursor: pointer; }
.rb:hover { background: rgba(255, 255, 255, .12); }
.rb .ic { width: 17px; height: 17px; }
#app.reading .menubar { display: none !important; }

/* ---- màn hình hẹp ---- */
@media (max-width: 1100px) { .btn .lbl-d, #bIme span, #bRead span { display: none; } #bIme, #bRead { padding: 0 11px; } .autosave { display: none; } }
@media (max-width: 860px) { .wm, .fname { display: none; } .menubar { grid-template-columns: auto 1fr auto; } }
@media (max-width: 640px) {
	.menubar { gap: 4px; padding-left: 8px; padding-right: 8px; }
	.mbi { padding: 0 9px; }
	.brand { padding-right: 8px; margin-right: 2px; }
	.btn span { display: none; }
	.btn.lg span { display: inline; }
	.btn.lg { padding: 0 22px; }
	.drop-in h1 { font-size: 32px; }
	.hero-art { width: 132px; height: 132px; } .hero-art svg { width: 92px; height: 92px; margin: -46px 0 0 -46px; }
}
@media (max-width: 420px) { .brand { display: none; } .drop-in h1 { font-size: 27px; margin-bottom: 18px; } .help dl { grid-template-columns: 1fr; gap: 2px 0; } .help dd { margin-bottom: 6px; } }
@media (max-height: 560px) { :root { --mbar: 48px; } .hero-art { display: none; } .drop-in h1 { font-size: 26px; margin-bottom: 14px; } }
@media (pointer: coarse) { .dd button { height: 46px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---- in ---- */
#printArea { display: none; }
@media print {
	html, body, #app { height: auto; background: #fff; overflow: visible; }
	.menubar, .tabrow, .toast, .busy, .drop, .rbar, .help, .dd, .mov { display: none !important; }
	.host.off { display: none !important; }
	body.print-area #app, body.print-area .toast { display: none !important; }
	body.print-area #printArea { display: block; color: #000; background: #fff; font: 10pt/1.3 "BVP", system-ui, sans-serif; }
	.pr-sheet h1 { font-size: 12pt; margin: 0 0 6pt; }
	.pr-sheet table { border-collapse: collapse; }
	.pr-sheet td { border: .5pt solid #999; padding: 2pt 4pt; vertical-align: top; white-space: pre-wrap; }
}

/* ---- Đọc sách điện tử ---- */
#app:not(.empty) .drop { display: none; }
#app.empty .stage .work { visibility: hidden; }
#app.empty #bRead, #app.empty #bSave, #app.empty #bMore { opacity: .4; pointer-events: none; }
.work { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr; gap: 8px; padding: 8px 10px 10px; }
.xbar { display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); overflow-x: auto; scrollbar-width: none; min-width: 0; }
.xbar::-webkit-scrollbar { display: none; }
.xb { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 11px; border: 0; border-radius: 10px; background: none; color: var(--mu); cursor: pointer; white-space: nowrap; font-size: 13px; transition: background .15s, color .15s; flex: none; }
.xb:hover { background: rgba(var(--ac-rgb), .14); color: var(--tx); }
.xb[aria-pressed="true"], .xb[aria-expanded="true"] { color: var(--ac-ink); background: var(--ac-soft); }
.xb .ic { width: 17px; height: 17px; }
.xsep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; flex: none; }
.grow { flex: 1; }
.bkinfo { display: flex; align-items: baseline; gap: 10px; min-width: 0; padding: 0 6px; overflow: hidden; white-space: nowrap; }
.bkinfo b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
.bkinfo span { color: var(--mu); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.body { display: grid; grid-template-columns: 1fr; gap: 10px; min-height: 0; }
#app.side .body { grid-template-columns: 320px 1fr; }
.sidep { display: none; flex-direction: column; min-height: 0; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); overflow: hidden; }
#app.side .sidep { display: flex; }
.sideh { display: flex; justify-content: flex-end; padding: 6px 6px 0; }
.spane { flex: 1; min-height: 0; overflow: auto; padding: 0 12px 14px; overscroll-behavior: contain; }
.spane h2 { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mu); }
.cnt:not(:empty) { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--ac-soft); color: var(--ac-ink); font-size: 11px; letter-spacing: 0; }
.muted { color: var(--mu); font-size: 12.5px; }
.ib { width: 30px; height: 28px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: none; color: var(--mu); cursor: pointer; }
.ib:hover { background: rgba(255, 255, 255, .09); color: var(--tx); }
.ib .ic { width: 16px; height: 16px; }
.toc, .toc ul, .hits, .anns { list-style: none; margin: 0; padding: 0; }
.tocit { display: block; width: 100%; text-align: left; padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--tx); cursor: pointer; font-size: 13.5px; line-height: 1.35; }
.tocit:hover { background: rgba(255, 255, 255, .06); }
.tocit.cur { background: var(--ac-soft); color: var(--ac-ink); box-shadow: inset 2px 0 0 var(--ac); }
.qrow { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.qrow input { flex: 1; min-width: 0; height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .28); color: var(--tx); outline: none; }
.qrow input:focus { border-color: var(--ac-line); box-shadow: 0 0 0 3px rgba(var(--ac-rgb), .18); }
.hit, .ann { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; border-radius: 10px; cursor: pointer; outline: none; font-size: 13px; }
.hit:hover, .ann:hover, .hit:focus-visible, .ann:focus-visible { background: rgba(255, 255, 255, .06); }
.ak { color: var(--mu); font-size: 11.5px; }
.hx { color: var(--tx); line-height: 1.45; }
.hx mark { background: rgba(var(--ac-rgb), .35); color: var(--tx); border-radius: 3px; padding: 0 1px; }
.aq { border-left: 3px solid #ffd84d; padding-left: 8px; color: var(--tx); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.an { color: var(--ac-ink); font-size: 12.5px; padding-left: 11px; white-space: pre-wrap; }
.ann.mk .at { color: var(--tx); }
.ann.mk .ak::before { content: "🔖 "; }
.readp { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; border-radius: 16px; border: 1px solid var(--line-2); overflow: hidden; background: #070c15; box-shadow: 0 22px 60px -30px rgba(0, 0, 0, .8); }
.viewer { flex: 1; min-height: 0; position: relative; background: #fff; transition: background .2s; }
.viewer foliate-view { display: block; width: 100%; height: 100%; }
.navz { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 72px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 12px; background: rgba(10, 16, 28, .32); color: #fff; cursor: pointer; opacity: 0; transition: opacity .2s, background .2s; z-index: 2; }
.navz.prev { left: 6px; } .navz.next { right: 6px; }
.readp:hover .navz, .navz:focus-visible { opacity: .75; }
.navz:hover { opacity: 1; background: rgba(10, 16, 28, .6); }
.navz .ic { width: 22px; height: 22px; }
.foot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 2fr) auto auto; align-items: center; gap: 14px; padding: 7px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--mu); background: var(--glass-2); }
.foot .chap { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foot .loc { white-space: nowrap; font-variant-numeric: tabular-nums; }
.foot input[type=range] { width: 100%; accent-color: var(--ac); }
.zoomg { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 10px; background: rgba(0, 0, 0, .22); border: 1px solid var(--line); }
.zoomg .ib { width: 30px; height: 28px; }
.zoomg .ib[aria-pressed="true"] { background: rgba(var(--ac-rgb), .18); color: var(--ac); }
.zoomg .zl { min-width: 50px; height: 28px; padding: 0 4px; border: 0; border-radius: 8px; background: none; color: var(--tx); cursor: pointer; font: 600 12px/1 "BVP", system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.zoomg .zl:hover, .zoomg .ib:hover { background: rgba(255, 255, 255, .08); color: var(--tx); }
.zoomg.text .zfit { display: none; }
.ttsbar { display: none; position: absolute; left: 50%; bottom: 52px; transform: translateX(-50%); align-items: center; gap: 4px; padding: 6px 8px; border-radius: 14px; background: var(--glass-2); border: 1px solid var(--ac-line); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); z-index: 3; backdrop-filter: blur(14px); }
#app.tts .ttsbar { display: flex; }
#app.tts #bTts { color: var(--ac-ink); background: var(--ac-soft); }
.ttsbar select { height: 30px; border-radius: 8px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .3); color: var(--tx); padding: 0 6px; max-width: 170px; }
/* chọn chữ, ghi chú */
.selpop { position: fixed; z-index: 70; display: flex; align-items: center; gap: 6px; padding: 7px; border-radius: 14px; background: var(--glass-2); border: 1px solid var(--line-2); box-shadow: 0 18px 46px rgba(0, 0, 0, .55); backdrop-filter: blur(14px); color: var(--tx); }
.selpop .sw { width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .7); cursor: pointer; padding: 0; }
.selpop .sw.on { box-shadow: 0 0 0 2px var(--ac); }
.annpop { flex-direction: column; align-items: stretch; width: min(340px, 92vw); }
.annpop .arow { display: flex; gap: 6px; align-items: center; }
.annpop .arow .danger { margin-left: auto; }
.annpop textarea { width: 100%; resize: vertical; min-height: 64px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .3); color: var(--tx); outline: none; font: 13.5px/1.45 "BVP", system-ui, sans-serif; }
.annpop textarea:focus { border-color: var(--ac-line); }
/* giao diện đọc */
.dd.aa { width: 330px; padding: 12px 14px; display: flex; flex-direction: column; gap: 12px; }
.agrp { display: flex; flex-direction: column; gap: 6px; }
.alab { font-size: 12px; color: var(--mu); }
.alab b { color: var(--tx); margin-left: 4px; }
.aseg { display: flex; flex-wrap: wrap; gap: 4px; }
.aseg .btn { flex: 1 1 auto; }
.aseg .btn[aria-pressed="true"] { background: var(--ac-soft); color: var(--ac-ink); border-color: var(--ac-line); }
.agrp input[type=range] { width: 100%; accent-color: var(--ac); }
/* thư viện trên màn hình đầu */
.drop-in { max-width: 980px; }
.shelf { margin: 30px auto 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 16px; text-align: left; }
.bk { position: relative; }
.bkopen { display: flex; flex-direction: column; gap: 5px; width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .03); color: var(--tx); cursor: pointer; text-align: left; transition: background .15s, border-color .15s, transform .15s; }
.bkopen:hover { background: rgba(var(--ac-rgb), .08); border-color: var(--ac-line); transform: translateY(-2px); }
.bkopen b { font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bkopen > span { font-size: 11.5px; color: var(--mu); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover { aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; background: linear-gradient(150deg, rgba(var(--ac-rgb), .35), rgba(var(--ac-rgb), .08)); display: flex; align-items: center; justify-content: center; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover.nocover span { font-weight: 700; font-size: 18px; letter-spacing: .08em; color: var(--ac-ink); }
.bar { height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ac); }
.bkrm { position: absolute; top: 12px; right: 12px; background: rgba(5, 8, 15, .7); opacity: 0; transition: opacity .15s; }
.bk:hover .bkrm, .bkrm:focus-visible { opacity: 1; }
/* toàn màn hình */
#app.reading .menubar, #app.reading .xbar { display: none; }
#app.reading .work { padding: 0; grid-template-rows: minmax(0, 1fr); }
#app.reading .readp { border-radius: 0; border: 0; }
#app.reading .rbar { display: flex; position: fixed; top: 10px; right: 10px; z-index: 20; padding: 4px; border-radius: 12px; background: var(--glass-2); border: 1px solid var(--line); opacity: .35; transition: opacity .2s; }
#app.reading .rbar:hover { opacity: 1; }
#app.reading .stage { position: fixed; inset: 0; }
#app.dragging .drop, #app.dragging .readp { outline: 2px dashed var(--ac); outline-offset: -8px; }
/* cỡ màn hình nhỏ */
@media (max-width: 760px) {
	.work { padding: 6px; gap: 6px; }
	.xb span { display: none; }
	.xb { padding: 0 9px; }
	.bkinfo { display: none; }
	#app.side .body { grid-template-columns: 1fr; }
	#app.side .readp { display: none; }
	.foot { grid-template-columns: minmax(60px, 1fr) auto auto; gap: 8px; padding: 6px 8px; }
	.zoomg .zl { min-width: 40px; }
	.foot .chap { display: none; }
	.navz { display: none; }
	.ttsbar { bottom: 46px; max-width: calc(100% - 16px); }
	.ttsbar #ttsVoice { display: none; }
	.shelf { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
	.mb-r #bRead span, .mb-r #bSave span { display: none; }
}

body[data-mode="ebook"] { --ac: #4fd1b0; --ac2: #3b8cff; --ac-on: #03221b; --ac-rgb: 79, 209, 176; }
