@font-face { font-family: "BVP"; src: url("vendor/fonts/be-vietnam-pro-latin-300-normal.woff2") format("woff2"); font-weight: 300; font-display: swap; unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "BVP"; src: url("vendor/fonts/be-vietnam-pro-latin-ext-300-normal.woff2") format("woff2"); font-weight: 300; font-display: swap; unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "BVP"; src: url("vendor/fonts/be-vietnam-pro-vietnamese-300-normal.woff2") format("woff2"); font-weight: 300; font-display: swap; unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "BVP"; src: url("vendor/fonts/be-vietnam-pro-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "BVP"; src: url("vendor/fonts/be-vietnam-pro-latin-ext-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "BVP"; src: url("vendor/fonts/be-vietnam-pro-vietnamese-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@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 {
	/* Nền than chì trung tính; độ sâu bằng ba lớp: lõm (màn đọc số, ô nhập), mặt nền, nổi (bảng, nút). Một màu nhấn phẳng, không chuyển màu, không quầng sáng.
	   Biến --ac, --ac-on, --ac-rgb đặt ở cuối app.css theo data-mode. */
	--bg0: #0e1115; --pnl: #161a20; --pnl-h: #1c2128;
	--sunk: #0a0c0f; --raise: #1b2027; --raise-h: #222831;
	--glass: #12161b; --glass-2: #181c22;
	--line: rgba(255, 255, 255, .08); --line-2: rgba(255, 255, 255, .14);
	--tx: #e3e7ed; --mu: #98a1ad; --mu2: #6a727d;
	--ac: #5aa2e6; --ac2: #5aa2e6; --ac-on: #061322; --ac-rgb: 90, 162, 230;
	--ac-ink: #a3cbf1; --ac-soft: rgba(var(--ac-rgb), .12); --ac-line: rgba(var(--ac-rgb), .5);
	--bad: #e2646b; --ok: #4dbf93; --warn: #e0ad4c;
	--sh-raise: inset 0 1px 0 rgba(255, 255, 255, .05), 0 1px 2px rgba(0, 0, 0, .45);
	--sh-float: inset 0 1px 0 rgba(255, 255, 255, .05), 0 2px 4px rgba(0, 0, 0, .35), 0 18px 44px -18px rgba(0, 0, 0, .85);
	--sh-sunk: inset 0 1px 3px rgba(0, 0, 0, .6), 0 1px 0 rgba(255, 255, 255, .04);
	--r: 10px; --r-sm: 8px; --mbar: 56px;
	--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: var(--bg0); }

/* ---- thanh trên ---- */
.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); border-bottom: 1px solid rgba(0, 0, 0, .55); box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .04), 0 1px 0 rgba(255, 255, 255, .03); z-index: 7; flex: none; }
.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; }
.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); 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: var(--raise); box-shadow: var(--sh-raise); }
.btn:hover:not(:disabled) { background: var(--raise-h); border-color: var(--line-2); }
.tool:hover { background: rgba(255, 255, 255, .06); border-color: var(--line-2); }
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .5); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.primary { background: var(--ac); border-color: rgba(0, 0, 0, .35); color: var(--ac-on); font-weight: 700; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 1px 2px rgba(0, 0, 0, .5); }
.btn.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--ac) 88%, #fff); border-color: rgba(0, 0, 0, .35); }
.btn.danger { color: #f0a3a7; border-color: rgba(226, 100, 107, .4); background: var(--raise); }
.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-link { --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='M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.7 1.7'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.7-1.7'/%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-search { --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-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='m14.5 6-6 6 6 6'/%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 6 6 6-6 6'/%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 5.5v13M16 5.5v13'/%3E%3C/svg%3E"); }
.ic-atom { --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='12' cy='12' r='1.6'/%3E%3Cellipse cx='12' cy='12' rx='9' ry='3.6'/%3E%3Cellipse cx='12' cy='12' rx='9' ry='3.6' transform='rotate(60 12 12)'/%3E%3Cellipse cx='12' cy='12' rx='9' ry='3.6' transform='rotate(-60 12 12)'/%3E%3C/svg%3E"); }
.ic-enter { --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='M19 6v5.5a2.5 2.5 0 0 1-2.5 2.5H6'/%3E%3Cpath d='m9.5 10.5-3.5 3.5 3.5 3.5'/%3E%3C/svg%3E"); }
.ic-fit { --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 9V5h4M20 9V5h-4M4 15v4h4M20 15v4h-4'/%3E%3C/svg%3E"); }
.ic-zoom { --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 5M10.5 8v5M8 10.5h5'/%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; }
.drop-in h1 { margin: 6px 0 26px; font-size: 42px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; color: var(--tx); }
.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: 12px; padding: 12px 14px; }
.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: lớp nổi ---- */
.dd, .modal, .toast, .help, .ime, #app.reading .rbar { background: var(--glass-2); border: 1px solid var(--line-2); }
.dd { position: fixed; z-index: 80; color: var(--tx); border-radius: 12px; box-shadow: var(--sh-float); 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(4, 5, 7, .7); }
.modal { color: var(--tx); border-radius: 14px; max-width: 460px; width: 100%; box-shadow: var(--sh-float); 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: 12px; box-shadow: var(--sh-float); 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: var(--bg0); animation: fade .25s ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.busy::before { content: ""; width: 44px; height: 44px; border-radius: 50%; order: 0; border: 3px solid var(--line-2); border-top-color: var(--ac); animation: spin .9s linear infinite; }
#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: 14px; color: var(--tx); box-shadow: var(--sh-float); }
.help::backdrop { background: rgba(4, 5, 7, .7); }
.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: 12px; box-shadow: var(--sh-float); 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; }
}

/* ===== Bảng tuần hoàn: cùng hệ giao diện tối của VNISES. Màu của ô là màu dữ liệu (loại, khối, trạng thái, thang tính chất);
   màu nhấn xanh chỉ dùng cho điều khiển. Thứ bậc bo góc: khung 14 px, ô nguyên tố 7 px, chip 7 px. ===== */
:root {
	--ro: "BVP", system-ui, sans-serif; --mono: "BVP", system-ui, sans-serif;
	--ink: #f1f4f8; --edge: rgba(255, 255, 255, .07); --edge-2: rgba(255, 255, 255, .13); --surf-2: #1a1f26;
	--r-shell: 14px; --r-cell: 7px; --cardw: clamp(340px, 24vw, 420px);
	color-scheme: dark;
}
body[data-mode="pt"] #app { background: var(--bg0); }
/* ô lớn mang màu nguyên tố: biến tính tại chính phần tử để nhận --cc của nó */
.tile, .ft { --tint: linear-gradient(165deg, color-mix(in oklch, var(--cc) 24%, #181c23), color-mix(in oklch, var(--cc) 8%, #12161b) 78%);
	--tint-sh: inset 0 0 0 1px color-mix(in oklch, var(--cc) 32%, rgba(255, 255, 255, .05)), inset 0 1px 0 rgba(255, 255, 255, .06), 0 14px 34px -18px color-mix(in oklch, var(--cc) 55%, transparent); }
/* chữ số thẳng cột ở mọi chỗ hiện số liệu */
.el, .tk, .rd, .ft, .tile, .fi .ec, .cb, .orb-n, .cfg-t, .boxes, .inrow input, .conv, table, .qi, .kv, .big, .cfgb { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stage { display: grid; grid-template-columns: minmax(0, 1fr) var(--cardw); grid-template-rows: minmax(0, 1fr); gap: 12px; padding: 12px max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
body[data-view="atom"] .stage, body[data-view="tools"] .stage { grid-template-columns: minmax(0, 1fr); }
.view { min-width: 0; min-height: 0; }
.view[hidden], .card[hidden] { display: none !important; }

/* ---- thanh trên: tìm ---- */
.find { position: relative; width: clamp(180px, 20vw, 280px); }
.find .ic { position: absolute; left: 11px; top: 50%; margin-top: -8px; width: 16px; height: 16px; color: var(--mu2); pointer-events: none; }
.find input { width: 100%; height: 36px; padding: 0 12px 0 34px; border-radius: 10px; border: 1px solid rgba(0, 0, 0, .55); background: var(--sunk); color: var(--tx); outline: none; box-shadow: var(--sh-sunk); font: 400 14px var(--ro); transition: border-color .15s, box-shadow .15s; }
.find input::placeholder { color: var(--mu2); }
.find input:focus { border-color: var(--ac-line); box-shadow: var(--sh-sunk), 0 0 0 3px rgba(var(--ac-rgb), .14); }
.find input::-webkit-search-cancel-button { display: none; }
.qres { position: absolute; right: 0; top: calc(100% + 6px); width: max(100%, 300px); z-index: 60; padding: 6px; border-radius: 12px; background: var(--surf-2); border: 1px solid var(--line-2); box-shadow: var(--sh-float); animation: ddin .12s var(--ease); }
.qi { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; width: 100%; padding: 6px 10px 6px 6px; border: 0; border-radius: 8px; background: none; color: var(--tx); text-align: left; cursor: pointer; }
.qi.on, .qi:hover { background: rgba(var(--ac-rgb), .13); }
.qi .sy { display: grid; place-items: center; height: 36px; border-radius: 7px; font: 400 16px var(--ro); color: #fff; background: linear-gradient(180deg, color-mix(in oklch, var(--cc) 22%, #181c23), color-mix(in oklch, var(--cc) 9%, #12161b)); box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--cc) 32%, rgba(255,255,255,.05)); }
.qi .nm { display: flex; flex-direction: column; font-size: 14px; line-height: 1.25; }
.qi .nm i { font-style: normal; color: var(--mu); font-size: 12.5px; }
.qi .z { color: var(--mu2); font: 12px var(--mono); }
.qx { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 100%; padding: 9px 12px; margin-bottom: 4px; border: 0; border-radius: 8px; background: rgba(var(--ac-rgb), .1); color: var(--tx); text-align: left; cursor: pointer; }
.qx:hover { background: rgba(var(--ac-rgb), .18); }
.qx .qk { font: 500 13px var(--ro); color: var(--ac-ink); }
.qx .qv { font: 400 15px var(--ro); color: var(--ink); }
.qx sub { font-size: .7em; } .qx sup { font-size: .66em; }
.seg { position: relative; display: inline-flex; padding: 3px; border-radius: 10px; background: var(--sunk); border: 1px solid rgba(0, 0, 0, .5); box-shadow: var(--sh-sunk); }
.seg button { position: relative; height: 30px; min-width: 0; padding: 0 14px; border: 0; border-radius: 7px; background: none; color: var(--mu); cursor: pointer; font: 500 13px/1 var(--ro); white-space: nowrap; transition: color .15s, background .15s; }
.seg button:hover { color: var(--tx); }
.seg button[aria-checked="true"] { background: var(--raise-h); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 1px 2px rgba(0, 0, 0, .6); }
.seg.sm button { height: 30px; padding: 0 9px; }
.seg.sm .ic { width: 16px; height: 16px; }
.seg.mode button { padding: 0 16px; }

/* ================= BẢNG ================= */
.vt { display: flex; flex-direction: column; gap: 10px; }
.tbar { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tb1 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-width: 0; }
.tb2 { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; min-width: 0; min-height: 32px; }
.pick select { height: 36px; padding: 0 34px 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--raise) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a1ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") right 9px center / 16px no-repeat; color: var(--tx); font: 500 14px var(--ro); box-shadow: var(--sh-raise); appearance: none; -webkit-appearance: none; cursor: pointer; max-width: 100%; }
.pick.one { display: none; }
.pick.prop select { color: var(--mu); }
.pick.prop.on select { color: var(--ink); border-color: var(--ac-line); background-color: var(--raise-h); }
.mseg button { padding: 0 13px; }
.ctl { flex: none; display: flex; align-items: center; gap: 8px 10px; }
.presets { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.presets:empty { display: none; }
.presets .chip[aria-pressed="true"] { border-color: var(--ac-line); color: var(--ac-ink); background: rgba(var(--ac-rgb), .12); }
.ctl:empty { display: none; }
.rng { min-width: 0; } .rng input { width: clamp(160px, 22vw, 320px); max-width: 100%; margin: 0; accent-color: var(--ac); }
.rd { min-width: 150px; font: 400 13px var(--mono); color: var(--tx); white-space: nowrap; }
.chip { height: 30px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--raise); color: var(--tx); font: 500 12.5px var(--ro); cursor: pointer; }
.chip:hover { border-color: var(--edge-2); background: var(--raise-h); }
.ib { width: 34px; height: 34px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 9px; background: none; color: var(--mu); cursor: pointer; }
.ib:hover:not(:disabled) { background: rgba(255, 255, 255, .07); color: var(--tx); }
.ib:disabled { opacity: .3; cursor: default; }
.ib.play { border-color: var(--line-2); background: var(--raise); color: var(--ac-ink); }
.legend { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 1px; }
.tb2.tight .lg { padding: 0 5px 0 4px; gap: 5px; font-size: 11.5px; } .tb2.tight .legend { gap: 2px 0; }
.lg { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 7px 0 6px; border: 1px solid transparent; border-radius: 7px; background: none; color: var(--mu); font: 500 12px var(--ro); cursor: pointer; white-space: nowrap; }
.lg i { width: 9px; height: 9px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
.lg:hover { color: var(--tx); background: rgba(255, 255, 255, .05); }
.lg[aria-pressed="true"] { color: var(--tx); border-color: var(--line-2); background: var(--raise); }
.lgn { font: 500 12.5px var(--ro); color: var(--mu); margin-right: 12px; white-space: nowrap; }
.scale { position: relative; display: inline-flex; flex-direction: column; width: clamp(220px, 34vw, 560px); padding-bottom: 14px; margin: 2px 18px 0 14px; }
.bar { display: block; width: 100%; height: 8px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .3); }
.tks { position: absolute; left: 0; right: 0; top: 11px; height: 14px; }
.tk { position: absolute; transform: translateX(-50%); font: 400 11px/1 var(--mono); color: var(--mu); white-space: nowrap; }
.tk::before { content: ""; position: absolute; left: 50%; top: -6px; width: 1px; height: 4px; background: rgba(255, 255, 255, .35); }
.zoom { display: none; }

.tw { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .16) transparent; display: flex; }
.grid { --lab: 18px; --g: clamp(2px, .26vw, 5px); position: relative; margin: 0 auto auto; width: 100%; display: grid; grid-template-columns: var(--lab) repeat(18, minmax(0, 1fr)); grid-template-rows: auto repeat(7, auto) calc(var(--g) * 3) repeat(2, auto); gap: var(--g); container-type: inline-size; }
.lab { display: flex; align-items: flex-end; justify-content: center; padding-bottom: 2px; color: var(--mu2); font: 500 clamp(9px, 0.95cqw, 12px) var(--ro); }
.lab.pl { align-items: center; padding: 0; }
.lab { transition: color .15s; }
.lab.on { color: var(--ac-ink); font-weight: 500; }
.grid[data-peek]:not([data-peek=""]) .el[data-z]:not(.pk) { opacity: .2; }
.el.touch { box-shadow: inset 0 0 0 2px #fff; transform: scale(1.18); z-index: 4; }
.el { --cc: transparent; position: relative; aspect-ratio: 1 / var(--ar, 1.12); min-width: 0; display: grid; grid-template-rows: auto 1fr auto auto; padding: 4% 6% 5%; border: 0; border-radius: var(--r-cell); color: var(--tx); text-align: left; cursor: pointer;
	background: linear-gradient(180deg, color-mix(in oklch, var(--cc) 15%, #171b21), color-mix(in oklch, var(--cc) 6%, #12161b));
	box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--cc) 21%, rgba(255, 255, 255, .04)), inset 0 1px 0 rgba(255, 255, 255, .035);
	transition: background .18s, box-shadow .18s, opacity .25s, transform .12s var(--ease); font-family: var(--ro); }
.el .z { font: 500 clamp(8px, 0.78cqw, 11.5px)/1 var(--ro); color: color-mix(in oklch, var(--cc) 72%, #9aa3ae); }
.el .sy { align-self: center; justify-self: center; font: 400 clamp(11px, 1.9cqw, 27px)/1 var(--ro); letter-spacing: -.02em; color: #f3f5f8; }
.el .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; font: 400 clamp(8px, 0.64cqw, 11px)/1.2 var(--ro); color: #d3dae3; }
.el .vl { overflow: hidden; text-overflow: clip; white-space: nowrap; text-align: center; font: 400 clamp(8px, 0.64cqw, 10.5px)/1.25 var(--ro); color: #7f8995; }
@container (max-width: 1250px) { .el .nm { display: none; } .el { grid-template-rows: auto 1fr auto; } .el .vl { font-size: clamp(8px, .86cqw, 11px); } .el .sy { font-size: clamp(11px, 2.05cqw, 26px); } }
.grid[data-mode]:not([data-mode="cat"]):not([data-mode="blk"]):not([data-mode="st"]):not([data-mode="yr"]) .el .vl { font-weight: 500; color: var(--ink, #fff); opacity: .92; }
.el:hover { background: linear-gradient(180deg, color-mix(in oklch, var(--cc) 27%, #181c22), color-mix(in oklch, var(--cc) 12%, #13171c)); box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--cc) 58%, transparent); z-index: 2; }
.el:hover .vl { color: #aeb6c0; }
.el:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; z-index: 3; }
.el.sel { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .92), 0 0 0 1px rgba(0, 0, 0, .6), 0 8px 22px -8px color-mix(in oklch, var(--cc) 80%, transparent); z-index: 2; }
.el.num { background: linear-gradient(180deg, color-mix(in oklch, var(--cc) 86%, #fff), color-mix(in oklch, var(--cc) 90%, #0e1115) 70%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .14); }
.el.num .z, .el.num .sy, .el.num .nm, .el.num .vl { color: var(--ink, #fff); }
.el.num .z, .el.num .nm, .el.num .vl { opacity: .78; }
.el.num:hover { filter: brightness(1.12); }
.el.num.sel { box-shadow: inset 0 0 0 2px #fff, 0 0 0 1px rgba(0, 0, 0, .6); }
.el.num .sy { font-weight: 500; }
.el.na { background: repeating-linear-gradient(135deg, #15191e 0 4px, #191d23 4px 8px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05); }
.el.na .sy { color: var(--mu); }
.el.dim { opacity: .14; }
.el.dim:hover, .el.dim:focus-visible { opacity: .55; }
.el.ph { display: grid; place-items: center; grid-template-rows: 1fr; padding: 0; }
.el.ph .sy { font-size: clamp(7px, 0.85cqw, 12px); color: color-mix(in oklch, var(--cc) 70%, #c8cfd8); font-weight: 500; }
/* ô nhỏ: chỉ ký hiệu */
@container (max-width: 760px) { .el .nm, .el .vl { display: none; } .el { grid-template-rows: auto 1fr; } .el .sy { font-size: clamp(9px, 2.6cqw, 18px); } .el .z { font-size: clamp(6px, 1.25cqw, 9px); } }
@container (max-width: 470px) { .el .z { display: none; } .el { grid-template-rows: 1fr; padding: 0; border-radius: 4px; } .el .sy { font-size: clamp(8px, 2.75cqw, 13px); } .lab { font-size: 9px; } .el.ph .sy { font-size: 5.5px; } }

/* ô lớn giữa bảng */
.feat { --cc: #888; display: flex; align-items: center; gap: clamp(10px, 1.6cqw, 22px); min-width: 0; padding: 0 clamp(4px, .8cqw, 12px); pointer-events: none; }
.feat .ft { flex: none; display: grid; grid-template-rows: auto 1fr auto; width: clamp(54px, 9.6cqw, 132px); aspect-ratio: 1 / 1.06; padding: clamp(4px, .6cqw, 9px) clamp(5px, .7cqw, 10px); border-radius: clamp(7px, .9cqw, 12px); background: var(--tint); box-shadow: var(--tint-sh); }
.feat .ft .z { font: 500 clamp(9px, 1.05cqw, 14px)/1 var(--ro); color: color-mix(in oklch, var(--cc) 70%, #c9d1db); }
.feat .ft .sy { align-self: center; justify-self: center; font: 300 clamp(24px, 4.8cqw, 66px)/1 var(--ro); color: #fff; letter-spacing: -.035em; }
.feat .ft .w { text-align: center; font: 400 clamp(9px, .95cqw, 13px)/1 var(--ro); color: #b9c1cb; }
.feat .fi { display: flex; flex-direction: column; gap: clamp(2px, .35cqw, 5px); min-width: 0; }
.feat .fi b { font: 300 clamp(16px, 2.7cqw, 38px)/1.05 var(--ro); color: var(--ink); letter-spacing: -.025em; white-space: nowrap; }
.feat .fi .vi { font-size: clamp(10px, 1.15cqw, 15px); color: var(--mu); margin-top: -1px; }
.feat .fi .ct { display: inline-flex; align-items: center; gap: .5em; margin-top: clamp(2px, .4cqw, 6px); font: 500 clamp(9px, 1cqw, 13px)/1.2 var(--ro); color: color-mix(in oklch, var(--cc) 78%, #fff); }
.feat .fi .ct::before { content: ""; width: .62em; height: .62em; border-radius: 2px; background: var(--cc); }
.feat .fi .ec { font: 400 clamp(9px, 1.05cqw, 14px)/1.3 var(--ro); color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feat .fv { display: flex; gap: 8px; align-items: baseline; margin-top: clamp(2px, .4cqw, 6px); font-size: clamp(9px, 1.05cqw, 14px); color: var(--mu); }
.feat .fv b { font: 400 clamp(11px, 1.35cqw, 18px) var(--ro); color: var(--ink); }
@container (max-width: 760px) { .feat .fi .vi, .feat .fv span { display: none; } .feat .ft { padding: 3px 4px; border-radius: 6px; } }
@container (max-width: 470px) { .feat { gap: 6px; padding: 0 2px; } .feat .fi .ct, .feat .fi .ec { display: none; } .feat .ft .z, .feat .ft .w { display: none; } .feat .ft { grid-template-rows: 1fr; } }

.featm { display: none; }
/* ================= THẺ NGUYÊN TỐ ================= */
.card { --cc: #888; min-height: 0; display: flex; flex-direction: column; border-radius: var(--r-shell); border: 1px solid var(--edge-2); background: var(--pnl); box-shadow: var(--sh-raise); overflow: hidden; }
.ch { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 18px 14px 16px 18px;
	background: radial-gradient(120% 140% at 0% 0%, color-mix(in oklch, var(--cc) 13%, transparent), transparent 62%); }
.ch .cx { display: none; position: absolute; top: 8px; right: 8px; }
.tile { display: grid; grid-template-rows: auto 1fr auto; width: 92px; height: 100px; padding: 8px 9px 9px; border-radius: 12px; background: var(--tint); box-shadow: var(--tint-sh); }
.tile .z { font: 500 13px/1 var(--ro); color: color-mix(in oklch, var(--cc) 70%, #d6dde6); }
.tile .sy { align-self: center; justify-self: center; font: 300 46px/1 var(--ro); color: #fff; letter-spacing: -.035em; }
.tile .w { text-align: center; font: 400 12px/1 var(--ro); color: #c3cbd5; }
.cn { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cn h2 { margin: 0; font: 300 28px/1.08 var(--ro); color: var(--ink); letter-spacing: -.025em; white-space: nowrap; }
.cn .vi { color: var(--mu); font-size: 14px; }
.cn .ct { display: inline-flex; align-items: center; gap: 7px; margin-top: 6px; font: 500 12.5px var(--ro); color: color-mix(in oklch, var(--cc) 78%, #fff); }
.cn .ct i { width: 9px; height: 9px; border-radius: 3px; background: var(--cc); }
.cn .ps { font-size: 12.5px; color: var(--mu); }
.nav { display: flex; flex-direction: column; gap: 2px; align-self: start; }
.cb { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 0 18px 20px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .16) transparent; }
.cb section { padding: 18px 0 6px; }
.cb section + section { border-top: 1px solid var(--edge); }
.cb h3 { margin: 0 0 8px; font: 500 12.5px/1.3 var(--ro); color: var(--mu); letter-spacing: .01em; }
/* dải cấu hình electron dưới tiêu đề thẻ */
.cfgb { display: flex; flex-direction: column; gap: 10px; margin: 0 18px; padding: 14px 0 16px; border-top: 1px solid var(--edge); border-bottom: 1px solid var(--edge); }
.cfgb .cf { font: 300 19px/1.3 var(--ro); color: var(--ink); letter-spacing: -.005em; overflow-wrap: anywhere; }
.cfgb .shs { display: flex; flex-wrap: wrap; gap: 6px; }
.cfgb .shs span { display: inline-flex; align-items: baseline; gap: 5px; height: 24px; padding: 0 9px; border-radius: 6px; background: var(--sunk); box-shadow: var(--sh-sunk); font: 500 13px/24px var(--ro); color: var(--ink); }
.cfgb .shs i { font-style: normal; font-size: 11px; color: var(--mu2); }
.cfgb .shs span:last-child i { color: color-mix(in oklch, var(--cc) 80%, #fff); }
.cb dl { margin: 0; display: flex; flex-direction: column; }
.cb .r { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 6px 0; font-size: 13.5px; }
.cb .r + .r { box-shadow: 0 -1px 0 rgba(255, 255, 255, .03); }
.cb dt { color: var(--mu); flex: none; }
.cb .r.hl { margin: 2px -10px; padding: 7px 10px; border-radius: 8px; background: rgba(var(--ac-rgb), .1); box-shadow: inset 0 0 0 1px rgba(var(--ac-rgb), .28); }
.cb .r.hl dt { color: var(--ac-ink); }
.rk { display: block; margin-top: 2px; font: 500 11.5px var(--ro); color: var(--ac-ink); text-align: right; }
.ies.hl { padding: 8px 10px 10px; margin: 8px -10px 6px; border-radius: 8px; background: rgba(var(--ac-rgb), .1); box-shadow: inset 0 0 0 1px rgba(var(--ac-rgb), .28); }
.iel .rk { display: inline; margin-left: 8px; }
.cb dd { margin: 0; text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cb .sub { color: var(--mu); font-size: 12.5px; margin-left: 4px; }
.tag { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 5px; background: rgba(255, 255, 255, .06); color: var(--mu); font: 500 11px/1.5 var(--ro); vertical-align: 1px; }
.ies { margin: 14px 0 6px; }
.iel { display: block; margin-bottom: 10px; font-size: 13.5px; color: var(--mu); }
/* năng lượng ion hóa liên tiếp: cột theo thang log, thấy rõ bước nhảy khi chạm lớp electron bên trong */
.ieb { display: flex; align-items: flex-end; gap: 4px; height: 104px; }
.ieb .b { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.ieb .b em { font: 400 10.5px/1 var(--ro); font-style: normal; color: var(--tx); white-space: nowrap; }
.ieb .b i { display: block; width: 100%; max-width: 30px; height: calc(var(--h) * 64px + 4px); border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, color-mix(in oklch, var(--cc) 75%, #fff), color-mix(in oklch, var(--cc) 40%, #1a1f26)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); }
.ieb .b u { text-decoration: none; font: 500 10.5px/1 var(--ro); color: var(--mu2); }
table.iso { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
table.iso th { text-align: right; font: 500 11.5px var(--ro); color: var(--mu2); padding: 4px 0 6px 8px; }
table.iso th:first-child, table.iso td:first-child { text-align: left; padding-left: 0; }
table.iso td { text-align: right; padding: 5px 0 5px 8px; border-top: 1px solid var(--edge); color: var(--ink); white-space: nowrap; }
table.iso td sup { color: var(--mu); font-size: .72em; margin-right: 1px; }
.orig { margin: 8px 0 0; color: var(--tx); font-size: 14px; line-height: 1.6; text-align: justify; hyphens: auto; }
.cact { padding: 16px 0 2px; }
.cact .btn { width: 100%; height: 42px; }

/* ================= NGUYÊN TỬ ================= */
.va { display: grid; grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); grid-template-areas: "head orb" "bohr orb" "cfg orb"; gap: 12px; }
.ahead { grid-area: head; --cc: #888; display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 0 2px; }
.ahead .tile { width: 74px; height: 80px; padding: 6px 7px 7px; border-radius: 10px; }
.ahead .tile .sy { font-size: 34px; }
.ahead .cn h2 { font-size: 24px; }
.apane { min-width: 0; min-height: 0; display: flex; flex-direction: column; border-radius: var(--r-shell); border: 1px solid var(--edge-2); background: var(--pnl); box-shadow: var(--sh-raise); overflow: hidden; }
.apane h2 { margin: 0; padding: 14px 16px 12px; font: 500 13px/1.2 var(--ro); color: var(--mu); border-bottom: 1px solid rgba(0, 0, 0, .45); box-shadow: 0 1px 0 rgba(255, 255, 255, .03); }
.bohr { grid-area: bohr; }
.bohr canvas { flex: none; height: clamp(220px, 34vh, 380px); width: 100%; display: block; background: radial-gradient(circle at 50% 50%, #12161c, var(--sunk) 70%); }
.bohr-k { display: flex; flex-wrap: wrap; gap: 2px 14px; padding: 9px 16px 11px; font-size: 13px; color: var(--mu); border-top: 1px solid var(--edge); }
.bohr-k b { color: var(--ink); font-weight: 500; }
.bohr-k sup { font-size: .72em; }
.orb3 { grid-area: orb; }
.orb-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 0 16px 0 0; border-bottom: 1px solid rgba(0, 0, 0, .45); box-shadow: 0 1px 0 rgba(255, 255, 255, .03); }
.orb-h h2 { border: 0; box-shadow: none; }
.orb-h sub { font-size: .72em; }
.orb-n { font: 400 12.5px var(--mono); color: var(--mu); padding: 0 0 0 16px; }
.orb-c { position: relative; flex: 1; min-height: 260px; background: radial-gradient(circle at 50% 45%, #121820, var(--sunk) 72%); cursor: grab; touch-action: none; }
.orb-c:active { cursor: grabbing; }
.orb-c canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
.orb-l { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--edge); }
.osub, .oml { display: flex; flex-wrap: wrap; gap: 4px; }
.osb { min-width: 40px; height: 30px; padding: 0 9px; border: 1px solid var(--edge); border-radius: 8px; background: none; color: var(--mu); font: 500 13px var(--ro); cursor: pointer; }
.osb:hover { color: var(--tx); border-color: var(--edge-2); }
.osb[aria-pressed="true"] { color: var(--ink); border-color: color-mix(in oklch, var(--cc) 60%, transparent); background: color-mix(in oklch, var(--cc) 14%, var(--raise)); }
.oml { padding: 3px; border-radius: 9px; background: var(--sunk); box-shadow: var(--sh-sunk); align-self: flex-start; max-width: 100%; }
.ob { height: 28px; padding: 0 9px; border: 0; border-radius: 7px; background: none; color: var(--mu); font: 500 12.5px var(--ro); cursor: pointer; white-space: nowrap; }
.ob sub { font-size: .75em; }
.ob:hover { color: var(--tx); }
.ob[aria-pressed="true"] { background: var(--raise-h); color: var(--ac-ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 1px 2px rgba(0, 0, 0, .6); }
.cfg { grid-area: cfg; }
.cfg-t { padding: 14px 16px 6px; }
.cfg-t .full { font: 300 18px/1.5 var(--ro); color: var(--ink); overflow-wrap: anywhere; }
.cfg-t .short { margin-top: 4px; font: 400 13px var(--ro); color: var(--mu); }
.boxes { flex: 1; min-height: 0; overflow: auto; padding: 6px 12px 14px; display: flex; flex-direction: column; gap: 2px; scrollbar-width: thin; }
.shl { display: flex; align-items: flex-start; gap: 6px; padding: 3px 0; }
.shl + .shl { border-top: 1px solid var(--edge); }
.shl .sk { flex: none; width: 18px; padding-top: 9px; font: 500 12px var(--ro); color: var(--mu2); }
.shl.out .sk { color: color-mix(in oklch, var(--cc) 85%, #fff); }
.shl .subs { display: flex; flex-wrap: wrap; gap: 2px 4px; min-width: 0; }
.boxes .sub { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 8px; cursor: pointer; }
.boxes .sub:hover { background: rgba(255, 255, 255, .04); }
.boxes .sub.on { background: rgba(var(--ac-rgb), .1); }
.boxes .sub.val .sl { color: color-mix(in oklch, var(--cc) 85%, #fff); }
.boxes .sub.val .bxs i { border-color: color-mix(in oklch, var(--cc) 70%, transparent); background: color-mix(in oklch, var(--cc) 10%, var(--sunk)); }
.phase { position: absolute; left: 12px; bottom: 10px; z-index: 2; display: flex; gap: 12px; font: 400 12px var(--mono); color: var(--mu); pointer-events: none; }
.phase span { display: inline-flex; align-items: center; gap: 6px; }
.phase i { width: 9px; height: 9px; border-radius: 50%; }
.phase .pp { background: #5fb4e8; } .phase .pn { background: #f2a25c; }
.boxes .sl { min-width: 30px; flex: none; font: 400 13px var(--ro); color: var(--tx); }
.bxs { display: flex; gap: 0; }
.bxs i { position: relative; width: 22px; height: 26px; border: 1px solid rgba(255, 255, 255, .28); margin-left: -1px; background: var(--sunk); }
.bxs i:first-child { margin-left: 0; border-radius: 4px 0 0 4px; }
.bxs i:last-child { border-radius: 0 4px 4px 0; }
.bxs i:only-child { border-radius: 4px; }
.bxs b { position: absolute; top: 5px; width: 2px; height: 16px; background: #e8eef6; }
.bxs b::before { content: ""; position: absolute; left: -3px; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; }
.bxs b.u { left: 6px; } .bxs b.u::before { top: -2px; border-bottom: 6px solid #e8eef6; }
.bxs b.d { right: 6px; } .bxs b.d::before { bottom: -2px; border-top: 6px solid #e8eef6; }
.err { margin: 10px 0 0; color: #f0a3a7; font-size: 14px; }
.orb-c .err { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; }

/* ================= CÔNG CỤ ================= */
.vx { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; overflow: auto; }
.tl { display: flex; flex-direction: column; gap: 14px; padding: 18px 18px 20px; border-radius: var(--r-shell); border: 1px solid var(--edge-2); background: var(--pnl); box-shadow: var(--sh-raise); min-width: 0; }
.tl h2 { margin: 0; font: 400 18px/1.2 var(--ro); color: var(--ink); letter-spacing: -.01em; }
.inrow { display: flex; gap: 8px; padding: 5px; border-radius: 12px; border: 1px solid rgba(0, 0, 0, .6); background: var(--sunk); box-shadow: var(--sh-sunk); transition: border-color .2s, box-shadow .2s; }
.inrow:focus-within { border-color: var(--ac-line); box-shadow: var(--sh-sunk), 0 0 0 3px rgba(var(--ac-rgb), .12); }
.inrow input { flex: 1; min-width: 0; height: 44px; padding: 0 10px; border: 0; background: transparent; color: #fff; outline: none; font: 400 18px var(--ro); letter-spacing: .01em; caret-color: var(--ac); }
.inrow input::placeholder { color: var(--mu2); }
.go { flex: none; width: 48px; border: 1px solid rgba(0, 0, 0, .4); border-radius: 9px; background: var(--ac); color: var(--ac-on); cursor: pointer; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 1px 2px rgba(0, 0, 0, .5); display: grid; place-items: center; }
.go:hover { background: color-mix(in srgb, var(--ac) 88%, #fff); }
.out:empty { display: none; }
.big { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; padding: 4px 2px 10px; }
.big .f { font: 400 18px var(--ro); color: var(--mu); }
.big b { font: 300 46px/1 var(--ro); color: var(--ink); letter-spacing: -.03em; }
.big .u { font: 500 15px var(--ro); color: var(--mu); }
table.comp, table.chk { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
table.comp th, table.chk th { text-align: right; padding: 4px 0 8px 10px; font: 500 12px var(--ro); color: var(--mu2); }
table.comp th:first-child, table.comp td:first-child, table.chk th:first-child, table.chk td:first-child { text-align: left; padding-left: 0; }
table.comp td, table.chk td { text-align: right; padding: 7px 0 7px 10px; border-top: 1px solid var(--edge); color: var(--ink); white-space: nowrap; }
.es { display: inline-grid; place-items: center; width: 34px; height: 30px; margin-right: 10px; border: 0; border-radius: 6px; font: 500 14px var(--ro); color: #fff; cursor: pointer; background: linear-gradient(180deg, color-mix(in oklch, var(--cc) 22%, #181c23), color-mix(in oklch, var(--cc) 9%, #12161b)); box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--cc) 32%, rgba(255,255,255,.05)); }
.pb { display: inline-block; width: clamp(50px, 8vw, 120px); height: 6px; margin-right: 10px; border-radius: 3px; background: rgba(255, 255, 255, .06); vertical-align: 2px; overflow: hidden; }
.pb i { display: block; height: 100%; background: var(--cc); border-radius: 3px; }
.conv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.conv label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--mu); min-width: 0; }
.conv input { height: 38px; padding: 0 10px; border-radius: 8px; border: 1px solid rgba(0, 0, 0, .55); background: var(--sunk); box-shadow: var(--sh-sunk); color: var(--tx); font: 400 14px var(--mono); outline: none; min-width: 0; }
.conv input:focus { border-color: var(--ac-line); }
.conv input[readonly] { color: var(--ink); background: transparent; box-shadow: none; border-color: var(--edge); }
.eq { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 4px; padding: 6px 2px 14px; font: 300 26px/1.5 var(--ro); color: var(--ink); letter-spacing: -.01em; }
.eq .t b { margin-right: 2px; color: var(--ac-ink); font-weight: 500; }
.eq .pl { margin: 0 6px; color: var(--mu); }
.eq .ar { margin: 0 10px; color: var(--mu); }
.eq sub, .big sub, .comp sub { font-size: .66em; }
.eq sup, .big sup { font-size: .62em; }

/* ================= KÍCH THƯỚC MÀN HÌNH ================= */
/* màn vừa: thẻ nguyên tố là ngăn trượt từ phải, đè lên bảng */
@media (max-width: 1179px) {
	.stage { grid-template-columns: minmax(0, 1fr); }
	.card { position: fixed; z-index: 70; top: calc(var(--mbar) + 10px); right: max(10px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); width: min(420px, calc(100vw - 20px)); box-shadow: var(--sh-float); animation: slin .22s var(--ease); }
	@keyframes slin { from { opacity: 0; transform: translateX(16px); } }
	.ch .cx { display: inline-flex; }
	.ch { padding-right: 46px; }
	.va { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "head head" "orb orb" "bohr cfg"; grid-template-rows: none; grid-auto-rows: auto; align-content: start; overflow: auto; overscroll-behavior: contain; }
	.va .apane { min-height: auto; overflow: visible; } .va .apane > h2, .va .orb-h { border-radius: var(--r-shell) var(--r-shell) 0 0; }
	.orb-c { flex: none; height: clamp(320px, 52vh, 520px); min-height: 0; overflow: hidden; }
	.bohr canvas { height: 300px; }
	.boxes { overflow: visible; }
}
/* máy tính bảng và điện thoại dọc: tóm tắt nguyên tố dưới bảng */
@media (max-width: 1179px) and (orientation: portrait) {
	.featm { --cc: #888; display: flex; flex-direction: column; gap: 10px; margin-top: 4px; padding: 12px; border-radius: var(--r-shell); border: 1px solid var(--edge-2); background: var(--pnl); box-shadow: var(--sh-raise); }
	.featm .fh { display: flex; align-items: center; gap: 12px; min-width: 0; }
	.featm .ft { flex: none; display: grid; grid-template-rows: auto 1fr auto; width: 64px; height: 70px; padding: 5px 6px 6px; border-radius: 10px; background: var(--tint); box-shadow: var(--tint-sh); }
	.featm .ft .z { font: 500 10.5px/1 var(--ro); color: #d6dde6; } .featm .ft .sy { align-self: center; justify-self: center; font: 300 30px/1 var(--ro); color: #fff; letter-spacing: -.03em; } .featm .ft .w { text-align: center; font: 400 9.5px/1 var(--mono); color: #d6dde6; }
	.featm .fi { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
	.featm .fi b { font: 300 22px/1.1 var(--ro); color: var(--ink); letter-spacing: -.02em; white-space: nowrap; } .featm .fi .vi { font-size: 13px; color: var(--mu); }
	.featm .fi .ct { display: inline-flex; align-items: center; gap: 6px; font: 500 12px var(--ro); color: color-mix(in oklch, var(--cc) 70%, #fff); } .featm .fi .ct i { width: 8px; height: 8px; border-radius: 2px; background: var(--cc); }
	.featm .fi .ec { font: 400 12px var(--mono); color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.featm .fo { flex: none; align-self: flex-start; height: 34px; padding: 0 8px 0 12px; gap: 2px; font-size: 13px; }
	.featm .fo span { display: inline !important; } .featm .fo .ic { width: 16px; height: 16px; }
	.featm .kvs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; border-radius: 10px; overflow: hidden; background: var(--edge); }
	.featm .kv { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 8px 10px; background: var(--sunk); }
	.featm .kv span { font-size: 11.5px; color: var(--mu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.featm .kv b { font: 400 15px var(--ro); color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.featm .kv.hl { background: color-mix(in srgb, var(--ac) 12%, var(--sunk)); } .featm .kv.hl span { color: var(--ac-ink); }
	.vt .tw { flex: none; }
	body[data-zoom="big"] .vt .tw { flex: none; }
	.vt { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
}
@media (min-width: 761px) and (max-width: 1179px) and (orientation: portrait) { .featm .kvs { grid-template-columns: repeat(3, minmax(0, 1fr)); } .featm { padding: 14px; } }
/* điện thoại, máy tính bảng dọc */
@media (max-width: 760px) {
	.stage { padding: 8px max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); gap: 8px; }
	.mb-c { justify-content: flex-start; }
	.menubar { grid-template-columns: auto 1fr auto; }
	.find { width: 40px; }
	.find input { padding: 0; color: transparent; cursor: pointer; }
	.find input::placeholder { color: transparent; }
	.find .ic { left: 12px; }
	.find:focus-within { position: fixed; left: 8px; right: 8px; top: 8px; width: auto; z-index: 75; }
	.find:focus-within input { padding-left: 34px; color: var(--tx); height: 40px; }
	.seg.mode button { padding: 0 11px; font-size: 12.5px; }
	.tbar { gap: 8px; }
	.pick { flex: 1 1 0; min-width: 0; } .pick select { width: 100%; }
	/* điện thoại dọc: bảng lên trước, chú giải và điều khiển ngay dưới bảng */
	.tbar { display: contents; } .tb1 { order: 1; } .vt > .tw { order: 2; } .tb2 { order: 3; } .featm { order: 4; }
	.vt > *, .vt .tb1, .vt .tb2 { flex-shrink: 0; }
	.mseg, .pick.prop { display: none !important; } .pick.one { display: block; }
	.feat { visibility: hidden; }
	.scale { width: min(260px, 64vw); } .lgn { margin-right: 8px; font-size: 11.5px; }
	.presets { width: 100%; flex-wrap: wrap; } .presets .chip { flex: 1 1 auto; padding: 0 9px; font-size: 12px; }
	.vt { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
	.zoom { display: inline-flex; order: 2; } .presets { order: 3; }
	body:not([data-zoom="big"]) .grid { touch-action: none; }
	.grid { margin: 4px auto auto; }
	.lg { height: 26px; padding: 0 7px 0 6px; font-size: 11.5px; gap: 5px; }
	.tb2 { min-height: 30px; row-gap: 6px; }
	.ctl { width: 100%; } .ctl:empty { display: none; } .rng { flex: 1; } .rng input { width: 100%; } .rd { min-width: 0; font-size: 12px; }
	.legend { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(152px, 46%), 1fr)); gap: 0 4px; }
	.legend:has(.scale) { display: flex; flex-wrap: nowrap; }
	.lg { width: 100%; min-width: 0; height: auto; min-height: 26px; padding-block: 3px; white-space: normal; text-align: left; line-height: 1.25; }
	.card { inset: auto 0 0 0; top: auto; width: 100%; height: min(86dvh, 720px); border-radius: 18px 18px 0 0; animation: shin .24s var(--ease); }
	@keyframes shin { from { transform: translateY(24px); opacity: 0; } }
	.va { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "orb" "bohr" "cfg"; }
	.orb-c { height: clamp(300px, 100vw, 440px); } .bohr canvas { height: min(320px, 82vw); }
	.orb-n { font-size: 11.5px; }
	.vx { grid-template-columns: minmax(0, 1fr); }
	.conv { grid-template-columns: 1fr 1fr; } .conv label:last-child { grid-column: 1 / -1; }
	.big b { font-size: 32px; }
	.eq { font-size: 18px; }
	table.comp th:nth-child(3), table.comp td:nth-child(3) { display: none; }
}
/* ô lớn trên điện thoại: cuộn ngang */
body[data-zoom="big"] .tw { display: block; }
@media (max-width: 760px) { body[data-zoom="big"] .grid { width: 1060px; max-width: none; } }
@media (min-width: 761px) { .zoom { display: none !important; } }
/* màn rất rộng */
@media (min-width: 1800px) { .cb .r { font-size: 14.5px; } }
/* màn thấp, xoay ngang */
@media (max-height: 560px) and (orientation: landscape) {
	/* xoay ngang: cột trái chọn cách tô và chú giải; bảng bên phải, thanh trượt ngay dưới bảng */
	.vt { display: grid; grid-template-columns: minmax(170px, 210px) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "t1 tw" "lg tw" "lg ct"; gap: 8px 10px; }
	.tbar, .tb2 { display: contents; }
	.tb1 { grid-area: t1; flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 6px; }
	.pick, .pick select { width: 100%; }
	.mseg, .pick.prop { display: none !important; } .pick.one { display: block; }
	.presets { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; } .presets:empty { display: none; } .presets .chip { width: 100%; padding: 0 4px; font-size: 11.5px; white-space: normal; line-height: 1.15; }
	.legend { grid-area: lg; display: flex; flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 0; min-height: 0; }
	.lg { flex: 1 1 auto; width: 100%; min-height: 21px; max-height: 34px; height: auto; padding-block: 1px; font-size: 11.5px; white-space: nowrap; }
	.lgn { margin: 0 0 4px; white-space: normal; } .scale { width: auto; margin: 2px 10px 0 8px; }
	.ctl { grid-area: ct; flex-wrap: nowrap; width: auto; } .rng { flex: 1 1 auto; } .rng input { width: 100%; } .rd { min-width: 0; }
	.featm { display: none !important; } .feat { visibility: visible; }
	.zoom { display: none !important; }
	.vt > .tw { grid-area: tw; flex: 1; }
	.card { top: calc(var(--mbar) + 6px); bottom: 6px; height: auto; width: min(420px, 56vw); left: auto; right: 6px; border-radius: 14px; }
	.va { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "head head" "orb bohr" "cfg cfg"; }
	.orb-c { height: 280px; } .bohr canvas { height: 280px; }
}
/* màn cảm ứng: vùng chạm tối thiểu 32 px */
@media (max-width: 400px) { .seg.mode button { padding: 0 9px; } .ch .tile { width: 78px; height: 86px; } .ch .tile .sy { font-size: 38px; } .ch { gap: 12px; padding-left: 14px; } .cfgb, .cb { margin-inline: 0; } .cfgb { margin: 0 14px; } .cb { padding: 0 14px 18px; } }
@media (max-width: 350px) { .seg.mode button { padding: 0 6px; font-size: 11.5px; } .menubar { gap: 8px; } }
@media (max-width: 420px) {
	.tl { padding: 16px 12px 18px; }
	table.comp, table.chk { font-size: 13px; }
	table.comp th, table.comp td, table.chk th, table.chk td { padding-left: 6px; }
	.pb { width: clamp(24px, 9vw, 60px); margin-right: 6px; }
	.es { width: 30px; margin-right: 6px; }
}
@media (pointer: coarse) {
	.lg { min-height: 32px; } .chip { height: 32px; } .rng input { height: 28px; } .osb, .ob { height: 32px; }
}
@media (pointer: coarse) and (max-height: 560px) and (orientation: landscape) { .lg { min-height: 21px; } }
@media (prefers-reduced-motion: reduce) { .el, .card { transition: none; animation: none; } }

body[data-mode="pt"] { --ac: #5aa2e6; --ac2: #5aa2e6; --ac-on: #061322; --ac-rgb: 90, 162, 230; }
