/* Casio fx-991CW */
.cw-body {
  position: absolute; border-radius: 34px;
  background: linear-gradient(90deg, #121314 0, #1f2022 3%, #1d1e20 50%, #1f2022 97%, #121314 100%);
  box-shadow: inset 0 0 0 2px #2b2c2f, inset 0 3px 2px rgba(255,255,255,.06), 0 10px 40px rgba(0,0,0,.5);
  font-family: "Helvetica Neue", Arial, sans-serif;
}
.cw-bezel {
  position: absolute; left: 22px; top: 106px; width: 356px; height: 168px; border-radius: 14px;
  background: #161718; box-shadow: inset 0 0 0 2px #2c2d30, inset 0 2px 6px rgba(0,0,0,.8);
}
.cw-lcd {
  position: absolute; left: 12px; top: 11px; width: 332px; height: 128px; border-radius: 4px;
  background: linear-gradient(#c3c9b6, #bcc3ae);
  box-shadow: inset 0 2px 5px rgba(0,0,0,.45);
  overflow: hidden;
  --ink: rgba(22, 26, 18, var(--contrast, .95));
  color: var(--ink);
}
.cw-lcd.off { background: linear-gradient(#a9ae9e, #a3a897); }
.cw-screen { position: absolute; inset: 3px 6px 4px 6px; font-family: "Helvetica Neue", Arial, sans-serif; font-size: 21px; line-height: 1; }

/* status bar */
.status { position: absolute; left: 0; right: 0; top: 0; height: 15px; display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; }
.ind { opacity: .08; }
.ind.on { opacity: 1; }
.ind-s, .ind-ang { background: var(--ink); color: #c1c7b3; padding: 0 2px; border-radius: 1px; line-height: 12px; }
.ind-math { display: inline-flex; align-items: center; height: 13px; }
.ind-math svg { display: block; }
.ind-spacer { flex: 1; }
.ind-arrow { font-size: 9px; }

/* calculation screen */
.input { position: absolute; left: 0; right: 0; top: 18px; height: 62px; overflow: hidden; }
.expr { display: inline-flex; align-items: center; white-space: nowrap; min-height: 44px; padding-left: 1px; }
.result { position: absolute; right: 0; bottom: 0; left: 0; text-align: right; font-size: 25px; height: 54px; display: flex; justify-content: flex-end; align-items: flex-end; overflow: hidden; }
.result .rv { display: inline-flex; align-items: center; white-space: nowrap; }
.result.pair { font-size: 19px; }
.result.pair .rv { flex-direction: column; align-items: flex-end; }
.pairline { display: inline-flex; align-items: center; }
.cw-screen .t { white-space: pre; }
.cw-screen i { font-family: "Times New Roman", Times, serif; font-style: italic; font-size: 1.1em; }
.cw-screen .fn { letter-spacing: -.01em; }
.cw-screen .neg { display: inline-block; transform: scaleX(.8); }
.cw-screen b { font-weight: 700; }
.cur { display: inline-block; width: 2px; height: 1.05em; background: var(--ink); margin: 0 -1px; vertical-align: middle; animation: cwblink 1s steps(1) infinite; position: relative; z-index: 1; }
.input.ins .cur { width: 9px; height: .16em; vertical-align: bottom; margin: 0; }
@keyframes cwblink { 50% { opacity: 0; } }
.box { display: inline-block; min-width: .62em; height: .85em; border: 1.5px dotted var(--ink); margin: 0 1px; vertical-align: middle; position: relative; }
.box .cur { position: absolute; left: 2px; top: 1px; height: calc(100% - 2px); }
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; margin: 0 2px; font-size: .9em; }
.frac > .num, .frac > .den { display: inline-flex; align-items: center; padding: 0 2px; min-height: 1em; }
.frac > .num { padding-bottom: 2px; }
.frac > .den { border-top: 2px solid var(--ink); padding-top: 2px; }
.mixed { display: inline-flex; align-items: center; }
.sqrt { display: inline-flex; align-items: flex-start; }
.sqrt > .rad { font-size: 1.05em; line-height: 1.1; padding-right: 1px; transform: scaleY(1.1); transform-origin: bottom; }
.sqrt > .under { display: inline-flex; align-items: center; border-top: 2px solid var(--ink); padding: 2px 1px 0; margin-top: 1px; }
.sqrt > .idx { font-size: .55em; margin-right: -4px; align-self: flex-start; }
sup.pow, .cw-screen sup { font-size: .62em; align-self: flex-start; display: inline-flex; align-items: center; margin-top: -6px; }
sub.base { font-size: .62em; align-self: flex-end; display: inline-flex; margin-bottom: -4px; }
.x10 { font-size: .8em; display: inline-flex; align-items: baseline; }
.x10 small { font-size: .7em; }
.abs { display: inline-flex; align-items: center; border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); padding: 0 2px; margin: 0 2px; }
.bigop { display: inline-flex; flex-direction: column; align-items: center; font-size: .6em; margin-right: 1px; }
.bigop .sym { font-size: 2em; line-height: 1; }
.evalbar { display: inline-flex; align-self: stretch; border-left: 1.5px solid var(--ink); margin-left: 2px; padding-left: 1px; align-items: flex-end; }
.xeq { font-size: .6em; display: inline-flex; align-items: center; }
.dms { font-size: .8em; align-self: flex-start; }
.unit { font-size: .6em; }
.eng { font-size: .85em; }

/* menus */
.menu { position: absolute; left: 0; right: 7px; top: 0; bottom: 0; display: flex; flex-direction: column; font-size: 20px; letter-spacing: .02em; }
.mprompt { height: 25%; display: flex; align-items: center; padding-left: 2px; font-size: 17px; }
.mrow { display: flex; height: 25%; }
.mitem { flex: 1; display: flex; align-items: center; padding: 0 3px; gap: 5px; min-width: 0; white-space: nowrap; overflow: hidden; }
.mitem.sel { background: var(--ink); color: #c1c7b3; }
.mlabel { flex: 1; overflow: hidden; text-overflow: clip; }
.marrow { font-size: 11px; opacity: .8; }
.radio { width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; flex: none; }
.radio.on { background: radial-gradient(currentColor 0 2.5px, transparent 3px); }
.menu.vars { font-size: 17px; }
.menu.vars .mitem { font-family: "Helvetica Neue", Arial, sans-serif; }
.vn { font-style: normal; }
.x10s { font-size: .6em; }
.scrollbar { position: absolute; right: 0; top: 2px; bottom: 2px; width: 3px; border-left: 1px solid var(--ink); }
.scrollbar div { position: absolute; left: 0; right: 0; background: var(--ink); }

/* home screen */
.home { position: absolute; left: 8px; right: 12px; top: 16px; bottom: 2px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr 1fr; gap: 2px 4px; }
.app { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border-radius: 2px; }
.app.sel { background: var(--ink); color: #c1c7b3; }
.aicon { height: 22px; display: flex; align-items: center; font-size: 12px; font-weight: 700; line-height: .95; text-align: center; }
.aname { font-size: 15px; letter-spacing: -.01em; }
.ai-bars { display: flex; align-items: flex-end; gap: 2px; height: 18px; }
.ai-bars i { width: 4px; background: currentColor; }
.ai-bars i:nth-child(1) { height: 40%; } .ai-bars i:nth-child(2) { height: 90%; } .ai-bars i:nth-child(3) { height: 65%; } .ai-bars i:nth-child(4) { height: 30%; }
.ai-bell { font-size: 26px; line-height: 1; }
.ai-grid, .ai-table { width: 26px; height: 16px; border: 2px solid currentColor; background: repeating-linear-gradient(90deg, transparent 0 6px, currentColor 6px 7px), repeating-linear-gradient(transparent 0 5px, currentColor 5px 6px); }
.ai-table { background: linear-gradient(90deg, transparent 47%, currentColor 47% 53%, transparent 53%), repeating-linear-gradient(transparent 0 5px, currentColor 5px 6px); }
.ai-eq i { font-size: 1em; }

/* messages and errors */
.msg { position: absolute; left: 0; right: 0; top: 16px; bottom: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; font-size: 18px; text-align: center; }
.contrast { font-size: 14px; letter-spacing: 1px; }
.errbox { position: absolute; left: 22px; right: 22px; top: 22px; bottom: 6px; border: 2px solid var(--ink); display: flex; flex-direction: column; justify-content: center; padding: 0 10px; gap: 6px; font-size: 16px; }
.errtitle { font-size: 20px; font-weight: 700; }

/* keys */
.kwrap { position: absolute; }
.key {
  position: absolute; inset: 0; border-radius: 50%; border: 0; padding: 0; margin: 0;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  color: #fff; font-family: "Helvetica Neue", Arial, sans-serif; font-weight: 700;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.key svg { width: 52%; height: 52%; }
.key:focus { outline: none; }
.key:focus-visible { box-shadow: 0 0 0 2px #ffd34d; }
.key.pressed { transform: translateY(1.5px) scale(.97); filter: brightness(.82); }
.k-black { background: radial-gradient(circle at 50% 35%, #2e2f31, #18191a 70%); box-shadow: 0 0 0 1.5px #0b0b0c, 0 2px 0 #050505, inset 0 1px 1px rgba(255,255,255,.12); color: #d8d8d8; }
.k-dark { background: radial-gradient(circle at 50% 32%, #5c5d61, #45464a 72%); box-shadow: 0 0 0 1.5px #151516, 0 3px 0 #0a0a0b, inset 0 1px 1px rgba(255,255,255,.18); }
.k-num { background: radial-gradient(circle at 50% 30%, #7b7c80, #636468 74%); box-shadow: 0 0 0 1.5px #151516, 0 3px 0 #0b0b0c, inset 0 1px 1px rgba(255,255,255,.22); font-size: 31px; font-weight: 600; }
.k-shift { background: radial-gradient(circle at 50% 32%, #d9bf6e, #b79a45 74%); box-shadow: 0 0 0 1.5px #151516, 0 3px 0 #0a0a0b, inset 0 1px 1px rgba(255,255,255,.35); color: #fff; }
.k-shift svg { width: 46%; height: 46%; }
.k-on .on-mark { width: 3px; height: 13px; background: #8b8b8b; border-radius: 1px; margin-top: -14px; }
.k-on { align-items: flex-start; padding-top: 6px; }
.k-arrow svg { width: 58%; height: 58%; }
.k-ok span { font-size: 15px; letter-spacing: -.02em; }
.k-top { position: absolute; left: 50%; top: -17px; transform: translateX(-50%); font-size: 10.5px; color: #e8e8e8; white-space: nowrap; font-weight: 700; letter-spacing: .01em; }
.kwrap:has(.k-shift) .k-top { color: #e0bd52; }
.k-shift-lbl { position: absolute; left: -4px; top: -18px; font-size: 12.5px; color: #d8b14d; white-space: nowrap; font-weight: 700; line-height: 1; }
.k-shift-lbl::after { content: ""; position: absolute; left: 3px; top: 13px; width: 5px; height: 6px; border-left: 1.2px solid #d8b14d; border-bottom: 1.2px solid #d8b14d; }
.k-shift-lbl i { font-family: "Times New Roman", serif; font-size: 1.15em; }
.sl-icon { font-size: 10px; letter-spacing: -1px; }
.sl-icon b { font-weight: 400; }
.k-dark .lbl-txt { font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.lbl-x { font-family: "Times New Roman", serif; font-size: 27px; font-weight: 700; }
.lbl-fx { font-size: 18px; } .lbl-fx i { font-family: "Times New Roman", serif; font-size: 1.05em; }
.lbl-logab { font-size: 15px; display: inline-flex; align-items: flex-end; letter-spacing: -.02em; }
.lbl-logab i { width: 5px; height: 6px; background: #fff; margin: 0 1px -1px 1px; }
.lbl-logab b { width: 7px; height: 11px; border: 1.4px solid #fff; margin-left: 1px; }
.lbl-ac { font-size: 25px; }
.lbl-dot { font-size: 40px; line-height: .5; margin-top: -14px; }
.lbl-exe { font-size: 22px; letter-spacing: -.01em; }
.lbl-exp10 { font-size: 20px; letter-spacing: -.03em; display: inline-flex; align-items: flex-start; }
.lbl-exp10 i { width: 6px; height: 7px; background: #fff; margin-left: 1px; margin-top: 1px; }
.lbl-format { font-size: 12px; letter-spacing: -.03em; position: relative; }
.k-num[data-k="format"]::before, .k-num[data-k="format"]::after { content: ""; position: absolute; left: 7px; right: 7px; height: 13px; border: 1.6px solid #fff; border-radius: 50%; }
.k-num[data-k="format"]::before { top: 7px; border-bottom-color: transparent; border-left-color: transparent; }
.k-num[data-k="format"]::after { bottom: 7px; border-top-color: transparent; border-right-color: transparent; }
.k-num[data-k="del"] svg { width: 50%; height: 50%; }

.cw-dpad .dpad-plate { position: absolute; left: 160px; top: 312px; width: 150px; height: 140px; background:
  linear-gradient(#0e0e0f, #0e0e0f) 52px 0 / 46px 140px no-repeat,
  linear-gradient(#0e0e0f, #0e0e0f) 0 47px / 150px 46px no-repeat; border-radius: 24px; filter: drop-shadow(0 1px 0 #2a2b2e); }
.cw-rocker { position: absolute; left: 338px; top: 300px; width: 52px; height: 104px; border-radius: 26px; background: #0f0f10; box-shadow: 0 0 0 1.5px #0a0a0a, inset 0 1px 1px rgba(255,255,255,.1); }
.k-rock { position: absolute; left: 3px; right: 3px; height: 48px; border-radius: 23px; inset: auto 3px auto 3px; }
.k-rock.up { top: 3px; border-radius: 23px 23px 8px 8px; }
.k-rock.dn { bottom: 3px; border-radius: 8px 8px 23px 23px; }
.k-rock svg { width: 46%; height: 46%; }

/* constants, unit conversions, engineering symbols, Line mode */
.cw-screen .sc { font-weight: 700; font-style: italic; font-family: "Times New Roman", serif; font-size: 1.05em; }
.cw-screen .sc sub, .mlabel sub { font-size: .6em; vertical-align: -.25em; font-style: normal; }
.cw-screen .conv { font-size: .92em; }
.cw-screen .tri { font-size: .7em; vertical-align: .1em; }
.cw-screen .lf { display: inline-block; transform: scale(.9); }
.cw-screen .sym { font-weight: 700; margin-left: 1px; }
.engarrows { display: inline-block; font-size: 12px; line-height: 10px; margin-left: 4px; }
.cw-lcd.line .input { height: 72px; }
.cw-lcd.line .expr { display: block; white-space: normal; word-break: break-all; font-size: 18px; line-height: 23px; min-height: 0; padding-top: 2px; }
.cw-lcd.line .expr sup { margin-top: 0; vertical-align: .4em; }
.cw-lcd.line .result { font-size: 21px; height: 30px; }

/* newer firmware: Option Numbers and the CATALOG list */
.optn { display: inline-grid; place-items: center; flex: none; width: 15px; height: 15px; border-radius: 50%; background: var(--ink); color: #c1c7b3; font-size: 11px; font-weight: 700; line-height: 1; margin-right: 2px; }
.mitem.sel .optn { background: #c1c7b3; color: var(--ink); }
.catlist { position: absolute; left: 0; right: 7px; top: 1px; bottom: 1px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(5, 1fr); font-size: 14px; }
.citem { display: flex; align-items: center; gap: 2px; white-space: nowrap; overflow: hidden; }
.citem .optn { width: 13px; height: 13px; font-size: 10px; }
.k-top-shift { color: #d8b14d; font-weight: 700; }
