/* Máy tính khoa học Athena – thân xanh than, điểm nhấn vàng Athena */
:root{--body:#1f2d44;--body2:#2b3c58;--fnk:#2b3c58;--fnt:#e6f1fb;--numk:#e6ebf2;--numt:#042c53;--red:#e24b4a;--gold:#fcb714;--goldt:#412402;
 --blue:#85b7eb;--bluet:#042c53;--modek:#3a4b66;--lcd:#dfe6e0;--lcdt:#14262b;--page:#f6f2e8;--ink:#2c2c2a;--muted:#6b6355}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--page:#16181c;--ink:#ecebe6;--muted:#a8a294}}
:root[data-theme="dark"]{--page:#16181c;--ink:#ecebe6;--muted:#a8a294}
*{box-sizing:border-box}
body{margin:0;background:var(--page);color:var(--ink);font-family:"Be Vietnam Pro",system-ui,sans-serif;-webkit-tap-highlight-color:transparent}
.hd{max-width:980px;margin:0 auto;padding:14px 16px 4px}
.brand{display:inline-flex;align-items:center;gap:10px;text-decoration:none;color:inherit}
.brand img{width:38px;height:44px;border-radius:8px;background:#fcb714}
.brand b{font-family:"Cormorant Garamond",serif;font-size:22px;letter-spacing:.06em;text-transform:uppercase;display:block;line-height:1}
.brand small{font-size:12px;color:var(--muted)}
.wrap{max-width:980px;margin:0 auto;padding:8px 16px 32px;display:flex;flex-wrap:wrap;gap:24px;justify-content:center;align-items:flex-start}

.calc{width:min(100%,380px);background:var(--body);border-radius:26px;padding:14px 14px 18px;box-shadow:0 10px 30px rgba(20,30,50,.25),inset 0 1px 0 rgba(255,255,255,.08);user-select:none}
.cbrand{display:flex;align-items:center;gap:6px;color:#fac775;font-size:12px;margin:0 4px 8px}
.cbrand b{letter-spacing:.12em}.cbrand span{margin-left:auto;color:#8fa3c4}

/* màn hình */
.lcd{background:var(--lcd);color:var(--lcdt);border-radius:10px;height:196px;padding:6px 10px 8px;position:relative;overflow:hidden;box-shadow:inset 0 2px 6px rgba(0,0,0,.18);
 font-family:"Cambria Math","STIX Two Math","Times New Roman",serif}
.st{display:flex;gap:7px;font:600 10.5px/14px "Be Vietnam Pro",sans-serif;height:15px;color:#2f3d32}
.st b{font-weight:700}.st .i-s{background:var(--lcdt);color:var(--lcd);padding:0 3px;border-radius:2px}.st .i-a{background:#355f8a;color:#fff;padding:0 3px;border-radius:2px}
.st .md{margin-left:auto;font-weight:600;opacity:.75}
.body{height:168px;overflow:hidden;display:flex;flex-direction:column}
.ln{white-space:nowrap;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;line-height:1.25}
.ln::-webkit-scrollbar{display:none}
.expr{font-size:21px;min-height:44px;padding:6px 0 2px;flex:1;display:flex;align-items:center}
.expr.sm{font-size:17px;min-height:30px;flex:none;border-top:1px solid #b9c4b8;margin-top:4px}
.res{font-size:25px;text-align:right;min-height:40px;display:flex;align-items:center;justify-content:flex-end}
.res.sm{font-size:17px;min-height:28px;flex:none;border-top:1px solid #b9c4b8;margin-top:4px}
.lbl{font-size:16px;font-family:"Be Vietnam Pro",sans-serif;font-weight:600;padding-top:4px}
.hint{font:500 11px/1.3 "Be Vietnam Pro",sans-serif;color:#4f5d52;white-space:normal}
.old{color:#5d6a5f;margin-right:4px}
.ttl{font:700 12.5px/1.3 "Be Vietnam Pro",sans-serif;border-bottom:1px solid #b9c4b8;padding:2px 0 3px;margin-bottom:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ttl i{font-family:"Cambria Math","Times New Roman",serif}
.err{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;gap:6px;font-family:"Be Vietnam Pro",sans-serif}
.err b{font-size:20px}.err span{font-size:12.5px}
.flash{position:absolute;left:8px;right:8px;bottom:8px;background:var(--lcdt);color:var(--lcd);font:600 12px/1.3 "Be Vietnam Pro",sans-serif;padding:5px 8px;border-radius:6px}
/* ký hiệu toán */
.cur{display:inline-block;width:2px;height:1.05em;background:var(--lcdt);vertical-align:-.15em;margin:0 -1px;animation:bl 1s steps(1) infinite}
@keyframes bl{50%{opacity:0}}
.ph{display:inline-block;width:.55em;height:.8em;border:1.5px dotted #5d6a5f;vertical-align:-.05em;margin:0 1px}
.fr{display:inline-flex;flex-direction:column;align-items:center;vertical-align:middle;margin:0 2px;font-size:.86em}
.fr>span{padding:0 3px;line-height:1.15}.fr>span:first-child{border-bottom:1.5px solid currentColor}
.sq{white-space:nowrap}.sq .rad{border-top:1.5px solid currentColor;padding:0 2px 0 1px;display:inline-block;line-height:1.1}
sup{font-size:.62em;vertical-align:.7em;line-height:0}sub{font-size:.62em;line-height:0}
sup.ri{margin-right:-.3em;vertical-align:.95em}
.ab{white-space:nowrap}
.bigop{display:inline-flex;align-items:center;vertical-align:middle}
.bigop .op{font-size:1.5em;line-height:1}
.bigop .lims{display:inline-flex;flex-direction:column;justify-content:space-between;font-size:.6em;height:2.2em;margin-left:-2px}
.bigop .sig{display:inline-flex;flex-direction:column;align-items:center;font-size:.62em;line-height:1.05}.bigop .sig .op{font-size:1.9em}
.at{font-size:.9em}.at sub{font-size:.75em}
.ii{font-style:italic;font-weight:600}
.pc{font-weight:400;font-style:italic}
.mn{font-family:"Be Vietnam Pro",sans-serif;font-size:.8em;font-weight:600}
.ov{text-decoration:overline}
.mtab{border-collapse:collapse;font-size:17px;margin-left:auto;border-left:2px solid currentColor;border-right:2px solid currentColor}
.mtab td{padding:1px 8px;text-align:center}
.vbr{font-size:1.3em;margin:0 3px}
/* menu, danh sách, bảng */
.menu{font:500 14px/1.25 "Be Vietnam Pro",sans-serif}
.mi{padding:3px 6px;border-radius:4px;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mi b{display:inline-block;width:18px;font-weight:700}
.mi.on{background:var(--lcdt);color:var(--lcd)}
.mi i{font-family:"Cambria Math","Times New Roman",serif}
.chk{font-weight:700}
.more{text-align:right;font-size:11px;line-height:1;margin-top:auto}
.kv{display:flex;justify-content:space-between;align-items:center;gap:10px;font-size:17px;padding:2px 2px;border-bottom:1px dotted #b9c4b8;min-height:30px}
.kv>span:first-child{font-family:"Be Vietnam Pro",sans-serif;font-size:13.5px;font-weight:600}
.kv>span:first-child i{font-family:"Cambria Math","Times New Roman",serif;font-size:16px}
.txt{font-size:18px;line-height:1.6;padding-top:6px;overflow:auto}
.grid{border-collapse:collapse;font:500 13.5px/1.2 "Be Vietnam Pro",sans-serif;width:100%;table-layout:fixed}
.grid th{font-weight:700;font-size:12px;padding:2px;color:#3d4a40;width:auto}
.grid tr th:first-child{width:22px}
.grid td{border:1px solid #b9c4b8;padding:3px 4px;text-align:right;height:24px;overflow:hidden;white-space:nowrap;cursor:pointer}
.grid td.on{background:var(--lcdt);color:var(--lcd)}

/* phím */
.ctrl{display:grid;grid-template-columns:1fr 112px 1fr;gap:8px;align-items:center;margin:12px 2px 6px}
.kside{display:grid;grid-template-columns:1fr 1fr;gap:4px 6px}
.dpad{position:relative;width:112px;height:96px;border-radius:50%;background:#16223a;box-shadow:inset 0 1px 0 rgba(255,255,255,.08)}
.dpad button{position:absolute;border:none;background:transparent;color:#cfe0f5;font-size:13px;width:36px;height:30px;cursor:pointer;border-radius:8px}
.dpad button:active{background:rgba(255,255,255,.12)}
.dpad [data-dir=U]{top:2px;left:38px}.dpad [data-dir=D]{bottom:2px;left:38px}.dpad [data-dir=L]{left:2px;top:33px}.dpad [data-dir=R]{right:2px;top:33px}
.kgrid.fn{display:grid;grid-template-columns:repeat(6,1fr);gap:2px 6px;margin-top:4px}
.kgrid.num{display:grid;grid-template-columns:repeat(5,1fr);gap:4px 8px;margin-top:10px}
.kw{display:flex;flex-direction:column;align-items:stretch;min-width:0}
.kl{display:flex;justify-content:space-between;height:15px;font-size:10px;line-height:15px;padding:0 1px;white-space:nowrap}
.kl span{overflow:visible}
.kl .ls{color:var(--gold)}.kl .la{color:var(--blue);margin-left:auto}
.kl sup{vertical-align:.5em}
.key{border:none;border-radius:8px;cursor:pointer;font-family:"Be Vietnam Pro",sans-serif;font-weight:600;padding:0;transition:transform .05s,filter .1s;
 box-shadow:0 2px 0 rgba(0,0,0,.35)}
.key:active{transform:translateY(2px);box-shadow:none}
.fn .key,.kside .key{background:var(--fnk);color:var(--fnt);height:30px;font-size:13px}
.kside .key.shift{background:var(--gold);color:var(--goldt)}
.kside .key.alpha{background:var(--blue);color:var(--bluet)}
.kside .key.mode{background:var(--modek);color:var(--fnt);font-size:11px}
.kside .key.f{background:var(--fnk)}
.key.lit{outline:2px solid #fff;outline-offset:1px}
.num .key{background:var(--numk);color:var(--numt);height:42px;font-size:19px}
.num .key.red{background:var(--red);color:#fff;font-size:14px}
.num .key.eq{background:var(--gold);color:var(--goldt);font-size:22px}
.num .key sup,.fn .key sup{font-size:.6em}
.fn .key i,.kside .key i{font-family:"Cambria Math","Times New Roman",serif;font-size:15px}
.kside .key{font-size:12px}

/* cột bên */
.side{flex:1;min-width:260px;max-width:380px}
.luot{margin:4px 0 12px;font-size:15px;color:var(--muted)}.luot b{color:var(--ink)}
.help{background:rgba(127,127,127,.08);border-radius:12px;padding:10px 14px;font-size:14px;line-height:1.55}
.help summary{cursor:pointer;font-weight:600}
.help ul{padding-left:18px;margin:8px 0 2px}
kbd{font:600 12px/1 ui-monospace,monospace;background:rgba(127,127,127,.18);padding:2px 5px;border-radius:4px}
@media (max-width:420px){.wrap{padding:6px 8px 24px}.calc{border-radius:20px;padding:10px 10px 14px}.lcd{height:184px}.body{height:156px}
 .fn .key,.kside .key{height:28px;font-size:12px}.num .key{height:40px}.kl{font-size:9px}.ctrl{grid-template-columns:1fr 96px 1fr}.dpad{width:96px;height:88px}
 .dpad [data-dir=U],.dpad [data-dir=D]{left:30px}.dpad [data-dir=L],.dpad [data-dir=R]{top:29px}}
