*,
:before,
::before,
:after,
::after {
  box-sizing: border-box;
}

* {
  border: 0;
  border-radius: 0;
  margin: 0;
  outline: 0;
  padding: 0;
}

a,
blockquote,
button,
code,
div,
figcaption,
h1,
h2,
h3,
input[type=email],
input[type=text],
input[type=password],
li,
ol,
option,
p,
pre,
select,
span,
strong,
sub,
sup,
td,
textarea,
th,
ul {
  color: #1f1f1f;
}

a,
blockquote,
body,
br,
button,
code,
div,
figure,
figcaption,
h1,
h2,
h3,
html,
iframe,
img,
input,
li,
ol,
option,
p,
pre,
select,
span,
strong,
sub,
sup,
table,
tbody,
td,
th,
thead,
tr,
ul {
  -webkit-appearance: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  font-size: 100%;
  vertical-align: baseline;
}

html,
body {
  overflow: hidden;
}

body {
  font-family: "JetBrains Mono", "SF Mono", "Fira Code", monospace;
  font-size: 0;
  line-height: 1;
  -webkit-text-size-adjust: 100%;
}

a {
  background: transparent;
  font-size: 0;
  margin: 0;
  padding: 0;
  text-decoration: none;
  vertical-align: baseline;
}

p a {
  font-size: 100%;
  font-weight: bold;
}

strong {
  font-size: 100%;
  vertical-align: baseline;
}

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

img {
  font-size: 0;
  max-width: 100%;
}

svg {
  border: 0;
  stroke-width: 0;
}

ol,
ul {
  list-style: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

td,
th {
  text-align: left;
  white-space: nowrap;
  word-break: break-all;
}

th {
  font-weight: bold;
}

blockquote {
  quotes: none;
}

blockquote::after,
blockquote::before {
  content: "";
}

pre code {
  font-family: ui-monospace, "SFMono-Regular", "SF Mono", Consolas, Menlo, "Liberation Mono", monospace;
}

input[type=text] {
  background-color: transparent;
}

input[type=file],
input[type=checkbox] {
  display: none;
}

textarea {
  background-color: transparent;
  resize: vertical;
  text-rendering: optimizeLegibility;
  width: 100%;
  overflow-y: scroll;
  overflow-anchor: none;
}

button {
  cursor: pointer;
  background-color: transparent;
  font-family: inherit;
}

::-webkit-scrollbar {
  display: none;
}

::-webkit-calendar-picker-indicator {
  display: none;
}

::-webkit-resizer {
  display: none;
}

iframe {
  display: block;
  max-width: 100%;
}

.calculator {
  width: 100%;
  max-width: 420px;
  border-radius: 12px;
  overflow: hidden;
  background: #1a1a1e;
  color: #e8e8ec;
  font-family: "JetBrains Mono", "SF Mono", "Fira Code", monospace;
}

.calculator__mode-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
}

.calculator__mode-button {
  flex: none;
  padding: 4px 12px;
  border: none;
  border-radius: 4px;
  background: #22222a;
  color: #888890;
  font-family: "JetBrains Mono", "SF Mono", "Fira Code", monospace;
  font-size: 0.8rem;
  cursor: pointer;
}

.calculator__mode-button--active {
  background: #c46a10;
  color: #ffffff;
}

.calculator__angle-button {
  flex: none;
  padding: 4px 10px;
  border: none;
  border-radius: 4px;
  background: #22222a;
  color: #888890;
  font-family: "JetBrains Mono", "SF Mono", "Fira Code", monospace;
  font-size: 0.75rem;
  cursor: pointer;
}

.calculator__angle-button--active {
  background: #2a4a6b;
  color: #a0d0ff;
}

.calculator__memory-indicator {
  margin-left: auto;
  color: #c46a10;
  font-size: 0.7rem;
  font-weight: bold;
}

.calculator__display {
  padding: 16px 20px 12px;
  background: #0f0f12;
  text-align: right;
}

.calculator__history {
  min-height: 1.2em;
  margin-bottom: 4px;
  color: #666670;
  font-size: 0.85rem;
}

.calculator__value {
  overflow-x: auto;
  color: #e8e8ec;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.calculator__value--small {
  font-size: 2rem;
}

.calculator__value--medium {
  font-size: 2.4rem;
}

.calculator__value--large {
  font-size: 3rem;
}

.calculator__scientific {
  padding: 6px 8px 2px;
}

.calculator__row {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
}

.calculator__main {
  padding: 6px 8px 8px;
}

.calculator__button {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 0;
  border: none;
  border-radius: 8px;
  font-family: "JetBrains Mono", "SF Mono", "Fira Code", monospace;
  font-size: 1.15rem;
  line-height: 1.5;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s, transform 0.08s;
}

.calculator__button--digit {
  background: #2a2a30;
  color: #e8e8ec;
  font-size: 1.5rem;
  font-weight: 500;
}

.calculator__button--operator {
  background: #c46a10;
  color: #ffffff;
  font-size: 1.3rem;
  font-weight: bold;
}

.calculator__button--clear {
  background: #6b2028;
  color: #ffbdc4;
  font-weight: 600;
}

.calculator__button--equals {
  background: #2a6b3a;
  color: #c0ffd0;
  font-size: 1.3rem;
  font-weight: bold;
}

.calculator__button--memory {
  padding: 10px 0;
  background: #22222a;
  color: #888890;
  font-size: 0.9rem;
}

.calculator__button--modifier {
  background: #22222a;
  color: #888890;
}

.calculator__button--function {
  padding: 10px 0;
  background: #22222a;
  color: #888890;
  font-size: 0.9rem;
}

.calculator__button--function-active {
  padding: 10px 0;
  background: #3a3a50;
  color: #a0a0ff;
  font-size: 0.9rem;
}

.calculator__button--constant {
  padding: 8px 0;
  background: #22222a;
  color: #888890;
  font-size: 0.95rem;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #0f0f12;
}