/* The floating tools: the calculator (styled after a Casio fx-83/85GTX) and the Symbols panel.
   Kept as the user approved them in the old desk; only moved and lightly restyled. */

/* Calculator */
.dk-calc { position: fixed; right: 20px; bottom: 20px; width: 306px; background: #2a2c31; border: 1px solid #141518; border-radius: 16px 16px 24px 24px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .07); z-index: 70; padding: 9px 14px 16px; color: #ececec;
  user-select: none; -webkit-user-select: none; font-family: var(--ui, "Archivo", system-ui, sans-serif); box-sizing: border-box; touch-action: manipulation; }
.dk-calc *, .dk-calc *::before, .dk-calc *::after { box-sizing: border-box; }
.dk-calc[hidden], .dk-symp[hidden] { display: none !important; }
.dk-calc button { font-family: inherit; cursor: pointer; }
.dk-calc .calc-head { display: flex; align-items: center; gap: 7px; padding: 0 0 8px 2px; cursor: grab; touch-action: none; }
.dk-calc .calc-head.dragging { cursor: grabbing; }
.dk-calc .calc-brand { font: italic 800 17px/1 var(--ui, sans-serif); color: #f2f2f2; }
.dk-calc .calc-model { flex: 1; font: 700 7.5px/1.25 var(--ui, sans-serif); letter-spacing: .12em; color: #9b9ea6; }
.dk-calc .calc-solar { width: 70px; height: 17px; border: 1px solid #101012; border-radius: 3px; background: repeating-linear-gradient(90deg, #3a2b25 0 13px, #1d1513 13px 14px); }
.dk-calc .calc-x { width: 24px; height: 24px; border: 0; border-radius: 4px; background: transparent; color: #a9acb3; display: grid; place-items: center; padding: 0; }
.dk-calc .calc-x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.dk-calc .calc-x:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.dk-calc .calc-lcd { background: #c3cab6; border: 7px solid #141518; border-radius: 7px; padding: 3px 8px 6px; box-shadow: inset 0 2px 5px rgba(0, 0, 0, .28); color: #1a1f15; margin-bottom: 12px; }
.dk-calc .lcd-ind { display: flex; gap: 8px; height: 12px; font: 800 9px/12px var(--ui, sans-serif); }
.dk-calc .lcd-ind span { opacity: 0; }
.dk-calc .lcd-ind span.on { opacity: .8; }
.dk-calc .calc-lcd input { width: 100%; border: 0; background: transparent; font: 16px/22px Consolas, "Cascadia Mono", "SF Mono", Menlo, monospace; color: inherit;
  caret-color: currentColor; outline: none; padding: 0; user-select: text; -webkit-user-select: text; }
.dk-calc .calc-out { display: flex; align-items: center; justify-content: flex-end; gap: 1px; min-height: 44px; font: 27px/1 Consolas, "Cascadia Mono", "SF Mono", Menlo, monospace; white-space: nowrap; overflow: hidden; }
.dk-calc .calc-out.err { font: 800 16px/44px var(--ui, sans-serif); letter-spacing: .02em; }
.dk-calc .calc-out .fr { display: inline-flex; flex-direction: column; align-items: center; font-size: .66em; line-height: 1.08; margin: 0 2px; }
.dk-calc .calc-out .fr > span { padding: 0 3px; display: flex; align-items: flex-end; }
.dk-calc .calc-out .fr > span + span { border-top: 2px solid currentColor; padding-top: 2px; }
.dk-calc .calc-out .rt { border-top: 2px solid currentColor; padding: 1px 1px 0; margin-left: 1px; line-height: 1; }
.dk-calc .calc-out .x10 { font-size: .78em; margin-left: 4px; }
.dk-calc .calc-out .x10 sup { font-size: .62em; }
.dk-calc .kf { display: grid; grid-template-columns: repeat(6, 1fr); gap: 15px 6px; padding-top: 4px; margin-bottom: 15px; }
.dk-calc .kn { display: grid; grid-template-columns: repeat(5, 1fr); gap: 15px 7px; padding-top: 10px; }
.dk-calc .kc { position: relative; }
.dk-calc .kc i { position: absolute; top: -12px; font: 700 8.5px/10px var(--ui, sans-serif); font-style: normal; white-space: nowrap; pointer-events: none; }
.dk-calc .kc .ks { left: 0; color: #e2b43c; }
.dk-calc .kc .ka { right: 0; color: #f0645a; }
.dk-calc .kc.one .ks { left: 50%; transform: translateX(-50%); }
.dk-calc .kc button { display: flex; align-items: center; justify-content: center; width: 100%; height: 25px; border: 0; border-radius: 7px 7px 10px 10px; padding: 0; background: #4a4d54; color: #f3f3f3;
  font: 650 11px/1 var(--ui, sans-serif); box-shadow: 0 2px 0 #151619, inset 0 1px 0 rgba(255, 255, 255, .1); }
.dk-calc .kc button:hover { background: #55585f; }
.dk-calc .kc button:active, .dk-calc .kpad button:active { transform: translateY(1px); box-shadow: 0 1px 0 #151619; }
.dk-calc .kc button sup { font-size: 8px; line-height: 0; position: relative; top: -4px; }
.dk-calc .kc.shift button { color: #e2b43c; }
.dk-calc .kc.alpha button { color: #f0645a; }
.dk-calc.sh .kc.shift button, .dk-calc.al .kc.alpha button { background: #6b6e75; }
.dk-calc.sh .kc .ks, .dk-calc.al .kc .ka { text-decoration: underline; text-underline-offset: 2px; }
.dk-calc .kfr { display: inline-flex; flex-direction: column; align-items: center; font-size: 7px; line-height: 7px; }
.dk-calc .kfr i { position: static; font: inherit; }
.dk-calc .kfr i + i { border-top: 1px solid currentColor; }
.dk-calc .kpad { grid-column: span 2; position: relative; height: 38px; margin-top: -7px; border-radius: 20px; background: #1b1c20; box-shadow: inset 0 0 0 2px #3d4047; }
.dk-calc .kpad button { position: absolute; border: 0; background: transparent; color: #c9ccd2; font-size: 9px; padding: 0; border-radius: 6px; }
.dk-calc .kpad button:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.dk-calc .kpad .up, .dk-calc .kpad .down { left: 50%; width: 34px; height: 15px; transform: translateX(-50%); }
.dk-calc .kpad .up { top: 2px; }
.dk-calc .kpad .down { bottom: 2px; }
.dk-calc .kpad .left, .dk-calc .kpad .right { top: 50%; width: 28px; height: 26px; transform: translateY(-50%); }
.dk-calc .kpad .left { left: 5px; }
.dk-calc .kpad .right { right: 5px; }
.dk-calc .kn .kc button { height: 33px; border-radius: 7px; background: #e4e4e1; color: #1c1c1e; font: 650 16px/1 var(--ui, sans-serif); box-shadow: 0 2px 0 #84858a, inset 0 -1px 0 rgba(0, 0, 0, .08); }
.dk-calc .kn .kc button:hover { background: #f1f1ee; }
.dk-calc .kn .kc button sup { font-size: 9px; top: -6px; }
.dk-calc .kn .kc.del button { background: #ffd60a; color: #121212; font-size: 13px; font-weight: 800; box-shadow: 0 2px 0 rgba(0, 0, 0, .45); }

/* Symbols panel */
.dk-symp { position: fixed; top: 64px; right: 16px; width: 226px; z-index: 71; background: var(--chrome, #141416); color: var(--text, #f3f2ee);
  border: 1px solid var(--line-strong, #38383d); border-radius: 8px; box-shadow: 0 14px 34px rgba(0, 0, 0, .4); padding: 0 7px 7px; user-select: none; -webkit-user-select: none;
  font-family: var(--ui, "Archivo", system-ui, sans-serif); box-sizing: border-box; touch-action: manipulation; }
.dk-symp * { box-sizing: border-box; }
.dk-symp .symp-head { display: flex; align-items: center; gap: 4px; height: 30px; margin: 0 -7px 7px; padding: 0 8px 0 4px; border-bottom: 1px solid var(--line, #26262a);
  cursor: grab; touch-action: none; font: 700 12px var(--ui, sans-serif); color: var(--muted, #a4a4a9); }
.dk-symp .symp-head.dragging { cursor: grabbing; }
.dk-symp .symx { width: 22px; height: 22px; display: grid; place-items: center; border: 0; border-radius: 4px; background: transparent; color: var(--muted, #a4a4a9); padding: 0; cursor: pointer; }
.dk-symp .symx:hover { background: var(--hover, #202024); color: var(--text, #f3f2ee); }
.dk-symp .symx svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.dk-symp .sym-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; }
.dk-symp .sym-grid button { height: 25px; border: 1px solid transparent; border-radius: 4px; background: var(--subtle, #19191c); color: var(--text, #f3f2ee);
  font: 14.5px/1 "Cambria Math", "Segoe UI Symbol", "STIX Two Math", var(--ui, sans-serif); padding: 0; cursor: pointer; }
.dk-symp .sym-grid button:hover { border-color: var(--accent, #ffd60a); }
.dk-symp .sym-grid button i { font-style: italic; color: var(--muted, #a4a4a9); font-size: 13px; }
.dk-symp .sym-grid button:active { background: var(--accent, #ffd60a); color: var(--accent-ink, #121212); }
.dk-symp .symp-note { margin-top: 6px; font-size: 10.5px; color: var(--muted, #a4a4a9); text-align: center; }
.dk-symp .symp-note.warn { color: var(--warn, #ffb020); font-weight: 700; }

@media (max-width: 760px) {
  .dk-calc { right: 8px; bottom: calc(66px + env(safe-area-inset-bottom)); max-height: calc(100dvh - 120px); overflow: auto; }
  .dk-symp { top: 58px; right: 8px; width: 258px; }
  .dk-symp .sym-grid button { height: 30px; }
}
@media (max-height: 640px) and (min-width: 761px) {
  .dk-calc { bottom: 12px; }
}
