@font-face {
  font-family: "Calculator UI";
  src: url("../assets/fonts/Selawik/selawk.woff2") format("woff2"),
       url("../assets/fonts/Selawik/selawk.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Calculator UI";
  src: url("../assets/fonts/Selawik/selawksb.woff2") format("woff2"),
       url("../assets/fonts/Selawik/selawksb.woff") format("woff");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Calculator UI";
  src: url("../assets/fonts/Selawik/selawkb.woff2") format("woff2"),
       url("../assets/fonts/Selawik/selawkb.woff") format("woff");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Klingon pIqaD";
  src: url("../assets/fonts/pIqaD/pIqaD-qolqoS.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ui-font-family: "Calculator UI", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --theme-shell-background: none;
  --theme-shell-background-size: cover;
  --theme-shell-background-position: center;
  --theme-shell-overlay: none;
  --theme-shell-overlay-size: auto;
  --theme-shell-overlay-position: center;
  --theme-shell-overlay-opacity: 1;
  --theme-display-background: transparent;
  --theme-display-border: 0 solid transparent;
  --theme-display-radius: 0px;
  --theme-display-shadow: none;
  --theme-display-overlay: none;
  --theme-display-overlay-size: auto;
  --theme-display-overlay-position: center;
  --theme-display-overlay-opacity: 1;
  --theme-button-radius: 3px;
  --theme-button-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 5%, transparent);
  --theme-mascot-image: none;
  --theme-mascot-width: 0px;
  --theme-mascot-height: 0px;
  --theme-mascot-top: 0px;
  --theme-mascot-right: 0px;
  --theme-mascot-opacity: 0;
  --theme-mascot-filter: none;
  --bg: #1c1d22;
  --shell-bg: #1f2025;
  --window-bg: #202126;
  --window-bg-alt: #202126;
  --panel: #23242b;
  --panel-alt: #262831;
  --panel-soft: #30333b;
  --panel-strong: #3c4048;
  --text: #f4f4f5;
  --text-soft: #b0b3bb;
  --text-faint: #777b84;
  --accent: #53b5eb;
  --accent-strong: #4aacdf;
  --operator: #31343c;
  --danger: #ff6d7a;
  --shadow: 0 40px 100px rgba(0, 0, 0, 0.55);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --surface-active: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-faint: rgba(255, 255, 255, 0.025);
  --focus-ring: rgba(88, 183, 237, 0.75);
  --focus-border: rgba(88, 183, 237, 0.7);
  --focus-glow: rgba(88, 183, 237, 0.18);
  --scrim: rgba(0, 0, 0, 0.42);
  --shadow-menu: 0 18px 36px rgba(0, 0, 0, 0.35);
  --tooltip-bg: rgba(47, 48, 52, 0.98);
  --tooltip-text: #ffffff;
  --tooltip-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  --noscript-bg: rgba(35, 36, 45, 0.98);
  --accent-surface: rgba(88, 183, 237, 0.09);
  --accent-border: rgba(88, 183, 237, 0.14);
  --scrollbar-thumb: rgba(255, 255, 255, 0.24);
  --scrollbar-color: rgba(255, 255, 255, 0.32) transparent;
  --toggle-group-bg: rgba(22, 24, 32, 0.92);
  --toggle-group-ring: rgba(128, 216, 255, 0.18);
  --toggle-group-text: rgba(232, 239, 247, 0.92);
  --toggle-active-bg: #56c7ff;
  --toggle-active-hover-bg: #69d0ff;
  --toggle-active-text: #07213a;
  --graph-canvas-bg: #f8f7f6;
  --graph-panel-bg: #2f3034;
  --graph-panel-text: #f5f5f5;
  --graph-panel-hover-bg: #3a3c40;
  --graph-panel-active-bg: #4a4d54;
  --graph-editor-bg: #202126;
  --graph-input-bg: #2d2e33;
  --graph-input-focus-bg: #1f2024;
  --graph-input-add-bg: rgba(0, 0, 0, 0.16);
  --graph-input-add-border: rgba(255, 255, 255, 0.24);
  --graph-input-focus-border: rgba(255, 255, 255, 0.44);
  --graph-hidden-input-bg: #23252a;
  --graph-hidden-input-border: rgba(255, 255, 255, 0.18);
  --graph-hidden-badge-bg: rgba(255, 255, 255, 0.2);
  --graph-hidden-badge-hover-bg: rgba(255, 255, 255, 0.24);
  --graph-hidden-badge-text: rgba(244, 244, 245, 0.7);
  --graph-add-badge-bg: rgba(255, 255, 255, 0.28);
  --graph-add-badge-text: rgba(244, 244, 245, 0.78);
  --graph-style-panel-bg: #2a2c31;
  --graph-style-select-bg: #3b3d43;
  --graph-swatch-ring: rgba(255, 255, 255, 0.04);
  --graph-swatch-selected-ring: 0 0 0 2px #ffffff, 0 0 0 4px rgba(255, 255, 255, 0.22);
  --graph-active-ring: inset 0 0 0 1px rgba(255, 255, 255, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.16);
  --graph-success: #16c35b;
  --converter-menu-bg: linear-gradient(180deg, #2f3440 0%, #292d38 100%);
  --button-default-bg: #353841;
  --button-default-hover-bg: #3b3e47;
  --button-function-bg: #353841;
  --button-function-hover-bg: #3b3e47;
  --button-digit-bg: #393c45;
  --button-digit-hover-bg: #42464f;
  --button-operator-bg: #31343c;
  --button-operator-hover-bg: #3a3d45;
  --button-equals-bg-start: #57b9ed;
  --button-equals-bg-end: #4fb2e7;
  --button-equals-hover-bg-start: #68c4f2;
  --button-equals-hover-bg-end: #5dbdf0;
  --button-equals-text: #0b1a2c;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 8px;
}

html[lang='tlh-Piqd'] {
  --ui-font-family: "Klingon pIqaD", "Calculator UI", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f3f3f3;
  --shell-bg: #ececec;
  --window-bg: #f7f7f7;
  --window-bg-alt: #efefef;
  --panel: #ffffff;
  --panel-alt: #f3f3f3;
  --panel-soft: #ececec;
  --panel-strong: #dedede;
  --text: #1e1e1e;
  --text-soft: #5f5f5f;
  --text-faint: #777777;
  --accent: #0f6cbd;
  --accent-strong: #115ea3;
  --operator: #e8e8e8;
  --danger: #c42b1c;
  --surface-hover: rgba(0, 0, 0, 0.06);
  --surface-active: rgba(0, 0, 0, 0.08);
  --border-subtle: rgba(0, 0, 0, 0.1);
  --border-faint: rgba(0, 0, 0, 0.07);
  --focus-ring: rgba(15, 108, 189, 0.65);
  --focus-border: rgba(15, 108, 189, 0.6);
  --focus-glow: rgba(15, 108, 189, 0.14);
  --scrim: rgba(0, 0, 0, 0.32);
  --shadow-menu: 0 18px 36px rgba(0, 0, 0, 0.14);
  --tooltip-bg: rgba(44, 44, 44, 0.96);
  --tooltip-text: #ffffff;
  --tooltip-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
  --noscript-bg: rgba(255, 255, 255, 0.96);
  --accent-surface: rgba(15, 108, 189, 0.06);
  --accent-border: rgba(15, 108, 189, 0.1);
  --scrollbar-thumb: rgba(0, 0, 0, 0.2);
  --scrollbar-color: rgba(0, 0, 0, 0.24) transparent;
  --toggle-group-bg: rgba(255, 255, 255, 0.94);
  --toggle-group-ring: rgba(0, 0, 0, 0.1);
  --toggle-group-text: #444444;
  --toggle-active-bg: var(--accent);
  --toggle-active-hover-bg: var(--accent-strong);
  --toggle-active-text: #ffffff;
  --graph-canvas-bg: #f8f7f6;
  --graph-panel-bg: var(--panel);
  --graph-panel-text: var(--text);
  --graph-panel-hover-bg: var(--panel-soft);
  --graph-panel-active-bg: var(--panel-strong);
  --graph-editor-bg: var(--window-bg-alt);
  --graph-input-bg: var(--panel);
  --graph-input-focus-bg: var(--panel);
  --graph-input-add-bg: var(--panel);
  --graph-input-add-border: var(--border-faint);
  --graph-input-focus-border: var(--accent);
  --graph-hidden-input-bg: var(--panel-alt);
  --graph-hidden-input-border: var(--border-faint);
  --graph-hidden-badge-bg: var(--surface-active);
  --graph-hidden-badge-hover-bg: var(--surface-hover);
  --graph-hidden-badge-text: var(--text-soft);
  --graph-add-badge-bg: var(--surface-active);
  --graph-add-badge-text: var(--text-soft);
  --graph-style-panel-bg: var(--panel);
  --graph-style-select-bg: var(--panel-alt);
  --graph-swatch-ring: rgba(0, 0, 0, 0.06);
  --graph-swatch-selected-ring: 0 0 0 2px var(--accent), 0 0 0 4px rgba(15, 108, 189, 0.18);
  --graph-active-ring: inset 0 0 0 1px var(--border-subtle), 0 0 0 1px rgba(0, 0, 0, 0.06);
  --graph-success: #107c41;
  --converter-menu-bg: var(--panel);
  --button-default-bg: #f3f3f3;
  --button-default-hover-bg: #e6e6e6;
  --button-function-bg: #ececec;
  --button-function-hover-bg: #e2e2e2;
  --button-digit-bg: #ffffff;
  --button-digit-hover-bg: #f5f5f5;
  --button-operator-bg: #efefef;
  --button-operator-hover-bg: #e3e3e3;
  --button-equals-bg-start: #9cd6ff;
  --button-equals-bg-end: #84c9fb;
  --button-equals-hover-bg-start: #89cef9;
  --button-equals-hover-bg-end: #75c2f4;
  --button-equals-text: #0f1d2d;
}

:root[data-theme='blue'] {
  color-scheme: dark;
  --bg: #111923;
  --shell-bg: #15212d;
  --window-bg: #182534;
  --window-bg-alt: #182534;
  --panel: #1b2b3b;
  --panel-alt: #1f3144;
  --panel-soft: #294059;
  --panel-strong: #355271;
  --text: #eef6ff;
  --text-soft: #abc1d7;
  --text-faint: #6f859c;
  --accent: #69b8ff;
  --accent-strong: #4ea6f1;
  --operator: #203447;
  --danger: #ff7d88;
  --surface-hover: rgba(255, 255, 255, 0.06);
  --surface-active: rgba(255, 255, 255, 0.09);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-faint: rgba(255, 255, 255, 0.03);
  --focus-ring: rgba(105, 184, 255, 0.75);
  --focus-border: rgba(105, 184, 255, 0.68);
  --focus-glow: rgba(105, 184, 255, 0.18);
  --scrim: rgba(0, 0, 0, 0.42);
  --shadow-menu: 0 18px 36px rgba(3, 12, 24, 0.4);
  --tooltip-bg: rgba(28, 42, 59, 0.98);
  --tooltip-text: #ffffff;
  --tooltip-shadow: 0 4px 14px rgba(0, 0, 0, 0.32);
  --noscript-bg: rgba(21, 33, 45, 0.98);
  --accent-surface: rgba(105, 184, 255, 0.12);
  --accent-border: rgba(105, 184, 255, 0.18);
  --scrollbar-thumb: rgba(255, 255, 255, 0.24);
  --scrollbar-color: rgba(255, 255, 255, 0.32) transparent;
  --toggle-group-bg: rgba(15, 26, 38, 0.94);
  --toggle-group-ring: rgba(105, 184, 255, 0.2);
  --toggle-group-text: rgba(237, 244, 255, 0.92);
  --toggle-active-bg: #6fc0ff;
  --toggle-active-hover-bg: #82caff;
  --toggle-active-text: #082039;
  --graph-canvas-bg: #f8f7f6;
  --graph-panel-bg: #2c3642;
  --graph-panel-text: #f4f8fc;
  --graph-panel-hover-bg: #394352;
  --graph-panel-active-bg: #4c5870;
  --graph-editor-bg: #182534;
  --graph-input-bg: #2a3440;
  --graph-input-focus-bg: #202c39;
  --graph-input-add-bg: rgba(0, 0, 0, 0.16);
  --graph-input-add-border: rgba(255, 255, 255, 0.24);
  --graph-input-focus-border: rgba(255, 255, 255, 0.44);
  --graph-hidden-input-bg: #232d39;
  --graph-hidden-input-border: rgba(255, 255, 255, 0.18);
  --graph-hidden-badge-bg: rgba(255, 255, 255, 0.2);
  --graph-hidden-badge-hover-bg: rgba(255, 255, 255, 0.24);
  --graph-hidden-badge-text: rgba(244, 244, 245, 0.7);
  --graph-add-badge-bg: rgba(255, 255, 255, 0.28);
  --graph-add-badge-text: rgba(244, 244, 245, 0.78);
  --graph-style-panel-bg: #26303b;
  --graph-style-select-bg: #384452;
  --graph-swatch-ring: rgba(255, 255, 255, 0.04);
  --graph-swatch-selected-ring: 0 0 0 2px #ffffff, 0 0 0 4px rgba(105, 184, 255, 0.22);
  --graph-active-ring: inset 0 0 0 1px rgba(255, 255, 255, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.16);
  --graph-success: #33c181;
  --converter-menu-bg: linear-gradient(180deg, #304256 0%, #25374b 100%);
  --button-default-bg: #314255;
  --button-default-hover-bg: #385067;
  --button-function-bg: #2d3f52;
  --button-function-hover-bg: #35506a;
  --button-digit-bg: #36495e;
  --button-digit-hover-bg: #3f5770;
  --button-operator-bg: #26394b;
  --button-operator-hover-bg: #30465b;
  --button-equals-bg-start: #6ab9ff;
  --button-equals-bg-end: #4ea7f2;
  --button-equals-hover-bg-start: #7ac2ff;
  --button-equals-hover-bg-end: #61b2f5;
  --button-equals-text: #081a2c;
}

:root[data-theme='green'] {
  color-scheme: dark;
  --bg: #101812;
  --shell-bg: #15231c;
  --window-bg: #182920;
  --window-bg-alt: #182920;
  --panel: #1c2d24;
  --panel-alt: #20352b;
  --panel-soft: #2a4539;
  --panel-strong: #38604f;
  --text: #edf8f1;
  --text-soft: #aecab9;
  --text-faint: #6f8e7c;
  --accent: #68d8a2;
  --accent-strong: #4fc78f;
  --operator: #233a2f;
  --danger: #ff8076;
  --surface-hover: rgba(255, 255, 255, 0.06);
  --surface-active: rgba(255, 255, 255, 0.09);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-faint: rgba(255, 255, 255, 0.03);
  --focus-ring: rgba(104, 216, 162, 0.72);
  --focus-border: rgba(104, 216, 162, 0.66);
  --focus-glow: rgba(104, 216, 162, 0.18);
  --scrim: rgba(0, 0, 0, 0.42);
  --shadow-menu: 0 18px 36px rgba(6, 16, 11, 0.4);
  --tooltip-bg: rgba(31, 50, 40, 0.98);
  --tooltip-text: #ffffff;
  --tooltip-shadow: 0 4px 14px rgba(0, 0, 0, 0.32);
  --noscript-bg: rgba(21, 35, 28, 0.98);
  --accent-surface: rgba(104, 216, 162, 0.12);
  --accent-border: rgba(104, 216, 162, 0.18);
  --scrollbar-thumb: rgba(255, 255, 255, 0.24);
  --scrollbar-color: rgba(255, 255, 255, 0.32) transparent;
  --toggle-group-bg: rgba(16, 28, 22, 0.94);
  --toggle-group-ring: rgba(104, 216, 162, 0.2);
  --toggle-group-text: rgba(235, 246, 239, 0.92);
  --toggle-active-bg: #69daa6;
  --toggle-active-hover-bg: #7be0b2;
  --toggle-active-text: #09271a;
  --graph-canvas-bg: #f8f7f6;
  --graph-panel-bg: #2d3730;
  --graph-panel-text: #f4f8f5;
  --graph-panel-hover-bg: #39463d;
  --graph-panel-active-bg: #4f5d52;
  --graph-editor-bg: #182920;
  --graph-input-bg: #2a352e;
  --graph-input-focus-bg: #202b25;
  --graph-input-add-bg: rgba(0, 0, 0, 0.16);
  --graph-input-add-border: rgba(255, 255, 255, 0.24);
  --graph-input-focus-border: rgba(255, 255, 255, 0.44);
  --graph-hidden-input-bg: #243029;
  --graph-hidden-input-border: rgba(255, 255, 255, 0.18);
  --graph-hidden-badge-bg: rgba(255, 255, 255, 0.2);
  --graph-hidden-badge-hover-bg: rgba(255, 255, 255, 0.24);
  --graph-hidden-badge-text: rgba(244, 244, 245, 0.7);
  --graph-add-badge-bg: rgba(255, 255, 255, 0.28);
  --graph-add-badge-text: rgba(244, 244, 245, 0.78);
  --graph-style-panel-bg: #26312a;
  --graph-style-select-bg: #37443b;
  --graph-swatch-ring: rgba(255, 255, 255, 0.04);
  --graph-swatch-selected-ring: 0 0 0 2px #ffffff, 0 0 0 4px rgba(104, 216, 162, 0.22);
  --graph-active-ring: inset 0 0 0 1px rgba(255, 255, 255, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.16);
  --graph-success: #2fd487;
  --converter-menu-bg: linear-gradient(180deg, #30443a 0%, #27392f 100%);
  --button-default-bg: #31443a;
  --button-default-hover-bg: #395146;
  --button-function-bg: #2f4137;
  --button-function-hover-bg: #375147;
  --button-digit-bg: #374a40;
  --button-digit-hover-bg: #42564b;
  --button-operator-bg: #263a2f;
  --button-operator-hover-bg: #30473a;
  --button-equals-bg-start: #6fdca9;
  --button-equals-bg-end: #4ec58d;
  --button-equals-hover-bg-start: #81e1b6;
  --button-equals-hover-bg-end: #60cc9b;
  --button-equals-text: #092015;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  height: 100%;
  font-family: var(--ui-font-family);
  background: var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
  background: var(--shell-bg);
  overflow: hidden;
}

#app {
  width: 100%;
  height: 100%;
  min-width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
}

button,
input,
select {
  font: inherit;
}

.ui-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.7em;
  height: 0.45em;
  vertical-align: middle;
  pointer-events: none;
}

.ui-caret::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 0.28em solid transparent;
  border-right: 0.28em solid transparent;
  border-top: 0.36em solid currentColor;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

select,
input[type="date"],
input[type="number"],
input[type="text"] {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-hover);
  color: var(--text);
  outline: none;
}

select option,
select optgroup {
  background: var(--panel);
  color: var(--text);
}

select:focus,
input:focus {
  border-color: var(--focus-border);
  box-shadow: 0 0 0 3px var(--focus-glow);
}

#app {
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  width: 100%;
}

.noscript-card {
  max-width: 460px;
  margin: 10vh auto;
  padding: 2rem;
  background: var(--noscript-bg);
  border-radius: 24px;
  color: var(--text);
}

.app-tooltip {
  position: fixed;
  z-index: 1000;
  max-width: 240px;
  padding: 0.35rem 0.55rem;
  border-radius: 4px;
  background: var(--tooltip-bg);
  color: var(--tooltip-text);
  font-size: 0.8rem;
  line-height: 1.2;
  box-shadow: var(--tooltip-shadow);
  pointer-events: none;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 90ms ease, transform 90ms ease;
}

.app-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}
