:root {
  color-scheme: dark;
  --text: #f6f8ff;
  --text-soft: rgba(246, 248, 255, 0.76);
  --text-faint: rgba(246, 248, 255, 0.58);
  --panel: rgba(7, 11, 19, 0.76);
  --panel-strong: rgba(6, 10, 18, 0.92);
  --panel-soft: rgba(255, 255, 255, 0.08);
  --panel-soft-2: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.2);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
  --shell-width: min(1680px, calc(100% - 28px));
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --accent-a: #9d7bff;
  --accent-b: #59d8ff;
  --accent-c: #ffd96a;
  --accent-d: #ff8fd0;
  --hero-glow: rgba(122, 158, 255, 0.14);
  --button-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  --button-hover: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
}

html[data-theme="light"] {
  color-scheme: light;
  --text: #10213a;
  --text-soft: rgba(16, 33, 58, 0.78);
  --text-faint: rgba(16, 33, 58, 0.56);
  --panel: rgba(255, 255, 255, 0.56);
  --panel-strong: rgba(255, 255, 255, 0.72);
  --panel-soft: rgba(255, 255, 255, 0.34);
  --panel-soft-2: rgba(255, 255, 255, 0.22);
  --line: rgba(16, 33, 58, 0.1);
  --line-strong: rgba(16, 33, 58, 0.18);
  --shadow: 0 26px 80px rgba(98, 123, 171, 0.18);
  --accent-a: #6469ff;
  --accent-b: #1f9cf6;
  --accent-c: #ffbe2f;
  --accent-d: #fb74b4;
  --hero-glow: rgba(124, 177, 255, 0.18);
  --button-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.34));
  --button-hover: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.42));
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: #040815;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  position: relative;
  overflow-x: hidden;
}

body,
body * {
  transition:
    background-color 0.45s ease,
    border-color 0.45s ease,
    color 0.35s ease,
    box-shadow 0.45s ease,
    opacity 0.45s ease,
    transform 0.25s ease;
}

button,
input {
  font: inherit;
}

.page-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: -3;
  background: #040815;
}

.bg-layer,
.bg-orb,
.bg-grid {
  position: absolute;
  inset: 0;
}

.bg-light {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04)),
    url("./assets/background-light.png") center center / cover no-repeat;
  opacity: 0;
}

.bg-dark {
  background:
    radial-gradient(circle at 15% 20%, rgba(122, 99, 255, 0.3), transparent 22%),
    radial-gradient(circle at 78% 16%, rgba(49, 200, 255, 0.24), transparent 18%),
    radial-gradient(circle at 70% 82%, rgba(255, 145, 219, 0.16), transparent 20%),
    linear-gradient(180deg, #050914 0%, #081120 52%, #04070f 100%);
  opacity: 1;
}

html[data-theme="light"] .bg-light {
  opacity: 1;
}

html[data-theme="light"] .bg-dark {
  opacity: 0.16;
}

html[data-theme="dark"] .bg-light {
  opacity: 0;
}

html[data-theme="dark"] .bg-dark {
  opacity: 1;
}

.bg-orb {
  filter: blur(36px);
  opacity: 0.5;
}

.orb-a {
  inset: auto auto -10vh -8vw;
  width: 38vw;
  height: 38vw;
  background: radial-gradient(circle, rgba(89, 216, 255, 0.28), transparent 62%);
}

.orb-b {
  inset: -12vh -6vw auto auto;
  width: 34vw;
  height: 34vw;
  background: radial-gradient(circle, rgba(255, 172, 94, 0.24), transparent 64%);
}

.bg-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 90%);
  opacity: 0.22;
}

.site-shell {
  width: var(--shell-width);
  margin: 0 auto;
  padding: 14px 0 36px;
}

.glass-panel,
.glass-inner,
.theme-fab,
.dir-btn,
.mini-toggle,
.calc-keypad button,
.amount-input,
.calc-display {
  backdrop-filter: blur(18px) saturate(1.08);
  -webkit-backdrop-filter: blur(18px) saturate(1.08);
}

.glass-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, var(--panel), var(--panel-strong));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.glass-inner {
  background:
    linear-gradient(180deg, var(--panel-soft), var(--panel-soft-2));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.site-header {
  position: sticky;
  top: 10px;
  z-index: 24;
  border-radius: var(--radius-xl);
  padding: 16px 20px;
  overflow: hidden;
}

.brand-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 2;
}

.brand-logo {
  width: clamp(72px, 8vw, 92px);
  height: clamp(72px, 8vw, 92px);
  object-fit: contain;
  border-radius: 24px;
  padding: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--line);
}

.brand-copy-block {
  display: grid;
  gap: 10px;
}

.kicker {
  margin: 0;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: clamp(0.68rem, 1vw, 0.8rem);
  line-height: 1.15;
}

h1,
h2,
p,
ul {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.85rem, 4vw, 3rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(1.45rem, 2.8vw, 2.3rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.section-copy,
.calc-side-copy,
.result-note,
.result-meta,
.detail-label,
.card-kicker,
.field-label,
.history-empty,
.rule-list,
.table-row,
.calc-expression {
  color: var(--text-soft);
}

.header-overlay {
  position: absolute;
  border-radius: 999px;
  filter: blur(14px);
  opacity: 0.55;
}

.header-overlay-a {
  width: 280px;
  height: 280px;
  right: -100px;
  top: -120px;
  background: radial-gradient(circle, rgba(105, 160, 255, 0.3), transparent 64%);
}

.header-overlay-b {
  width: 240px;
  height: 240px;
  left: 18%;
  bottom: -160px;
  background: radial-gradient(circle, rgba(255, 163, 112, 0.22), transparent 62%);
}

.hero-grid,
.calculator-section {
  margin-top: 16px;
}

.hero-panel,
.calculator-section {
  border-radius: var(--radius-xl);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.hero-panel::before,
.calculator-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, var(--hero-glow), transparent 30%);
  pointer-events: none;
}

.section-topline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-head,
.calc-header {
  display: flex;
  gap: 18px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 22px;
}

.direction-switch,
.calc-header-actions,
.angle-mode-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.dir-btn,
.mini-toggle,
.theme-fab,
.calc-keypad button {
  border: 1px solid var(--line);
  background: var(--button-bg);
  color: var(--text);
}

.dir-btn,
.mini-toggle {
  border-radius: 999px;
  min-height: 42px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 600;
}

.dir-btn:hover,
.mini-toggle:hover,
.theme-fab:hover,
.calc-keypad button:hover {
  background: var(--button-hover);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.14);
}

.is-active {
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.converter-grid,
.calculator-grid {
  display: grid;
  gap: 18px;
}

.converter-grid {
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
}

.calculator-grid-landscape {
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  align-items: stretch;
}

.converter-card,
.info-card,
.table-card,
.calculator-panel,
.calc-side-panel {
  border-radius: var(--radius-lg);
  padding: 18px;
}

.hero-side-stack {
  display: grid;
  gap: 18px;
}

.field-label,
.card-kicker {
  display: block;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.76rem;
}

.input-shell,
.calc-display-shell {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--line-strong);
}

.input-prefix {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-soft);
}

.amount-input,
.calc-display {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.amount-input {
  min-height: 78px;
  padding: 0 18px 0 48px;
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.05em;
}

.quick-chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.quick-chip {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  color: var(--text-soft);
  cursor: pointer;
}

.result-wrap {
  margin-top: 22px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(104, 148, 255, 0.16), rgba(255, 223, 129, 0.1));
  border: 1px solid var(--line);
}

.result-main {
  font-size: clamp(2rem, 4vw, 3.3rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.06em;
  margin: 6px 0 10px;
}

.detail-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-grid-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-card {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
}

.detail-card strong {
  display: block;
  font-size: 1rem;
  margin-top: 6px;
  line-height: 1.4;
}

.rule-list {
  padding-left: 18px;
  margin-bottom: 0;
  display: grid;
  gap: 10px;
  line-height: 1.5;
}

.table-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.table-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  font-size: 0.95rem;
}

.table-row strong {
  color: var(--text);
}

.calc-display-shell {
  padding: 16px 18px 12px;
}

.calc-expression {
  min-height: 22px;
  text-align: right;
  font-size: 0.95rem;
}

.calc-display {
  min-height: 72px;
  padding: 0;
  text-align: right;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.05em;
}

.calc-mode-panel {
  display: none;
}

.calc-mode-panel.is-active {
  display: block;
}

.calc-keypad {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.calc-keypad-basic {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.calc-keypad-math {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.calc-keypad button {
  min-height: 54px;
  border-radius: 18px;
  cursor: pointer;
  font-weight: 700;
}

.calc-keypad-math button {
  min-height: 50px;
  font-size: 0.95rem;
}

.calc-keypad .equals {
  background: linear-gradient(135deg, rgba(89, 216, 255, 0.28), rgba(157, 123, 255, 0.22));
}

.wide-3 {
  grid-column: span 3;
}

.wide-4 {
  grid-column: span 4;
}

.angle-mode-group.is-hidden {
  display: none;
}

.history-list {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.history-item {
  border-radius: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  cursor: pointer;
}

.history-item:hover {
  transform: translateY(-1px);
}

.history-expression {
  font-size: 0.9rem;
  color: var(--text-soft);
  word-break: break-word;
}

.history-result {
  font-size: 1.08rem;
  font-weight: 700;
  margin-top: 6px;
}

.theme-fab {
  position: fixed;
  z-index: 30;
  top: 50%;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.theme-fab span {
  font-size: 1rem;
  transform: translateY(-1px);
}

.theme-fab-sun {
  left: 10px;
}

.theme-fab-moon {
  right: 10px;
}

html[data-theme="light"] .theme-fab-sun,
html[data-theme="dark"] .theme-fab-moon {
  border-color: rgba(255, 255, 255, 0.36);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

@media (max-width: 1260px) {
  .calc-keypad-math {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .wide-4 {
    grid-column: span 4;
  }
}

@media (max-width: 1080px) {
  .converter-grid,
  .calculator-grid-landscape {
    grid-template-columns: 1fr;
  }

  .hero-head,
  .calc-header {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 820px) {
  .site-shell {
    width: min(100% - 16px, 100%);
    padding-top: 12px;
  }

  .site-header,
  .hero-panel,
  .calculator-section {
    padding: 18px;
  }

  .brand-wrap {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .brand-logo {
    width: 72px;
    height: 72px;
  }

  .table-grid,
  .detail-grid,
  .calc-keypad-basic,
  .calc-keypad-math {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calc-keypad button,
  .amount-input {
    min-height: 54px;
  }

  .wide-3,
  .wide-4 {
    grid-column: span 2;
  }
}

@media (max-width: 560px) {
  .theme-fab {
    top: auto;
    bottom: 14px;
  }

  .theme-fab-sun {
    left: 12px;
  }

  .theme-fab-moon {
    right: 12px;
  }

  .table-grid,
  .detail-grid,
  .calc-keypad-basic,
  .calc-keypad-math {
    grid-template-columns: 1fr 1fr;
  }

  .dir-btn,
  .mini-toggle {
    flex: 1 1 auto;
  }

  .result-main {
    font-size: 2.2rem;
  }

  .table-row {
    padding: 10px 12px;
    font-size: 0.88rem;
  }
}


/* --- v3 handheld console refinements --- */
.brand-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-copy-block {
  min-width: 0;
  flex: 1;
  gap: 8px;
}

.brand-copy-block h1,
.brand-copy-block .kicker {
  white-space: normal;
}

.calc-header {
  margin-bottom: 14px;
}

.calculator-section {
  padding: 18px;
}

.calculator-console {
  width: 100%;
  padding: 10px;
  border-radius: 26px;
}

.calc-console-screen {
  padding: 10px 12px 12px;
  border-radius: 24px;
  min-height: 140px;
  background:
    linear-gradient(180deg, rgba(200, 255, 230, 0.08), rgba(255, 255, 255, 0.03)),
    linear-gradient(180deg, rgba(6, 18, 16, 0.78), rgba(8, 12, 18, 0.9));
}

html[data-theme="light"] .calc-console-screen {
  background:
    linear-gradient(180deg, rgba(232, 255, 242, 0.78), rgba(232, 240, 248, 0.58)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(244, 249, 255, 0.72));
}

.calc-screen-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 24px;
  margin-bottom: 12px;
}

.screen-brand {
  justify-self: center;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: rgba(225, 248, 235, 0.9);
}

html[data-theme="light"] .screen-brand {
  color: rgba(24, 62, 46, 0.82);
}

.screen-battery {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.screen-battery-body {
  width: 22px;
  height: 11px;
  border: 1.5px solid rgba(225, 248, 235, 0.82);
  border-radius: 3px;
  position: relative;
}

.screen-battery-body::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 1px;
  background: rgba(225, 248, 235, 0.82);
}

.screen-battery-tip {
  width: 3px;
  height: 7px;
  border-radius: 0 2px 2px 0;
  background: rgba(225, 248, 235, 0.82);
}

html[data-theme="light"] .screen-battery-body {
  border-color: rgba(24, 62, 46, 0.72);
}

html[data-theme="light"] .screen-battery-tip,
html[data-theme="light"] .screen-battery-body::before {
  background: rgba(24, 62, 46, 0.72);
}

.screen-signal {
  justify-self: end;
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 14px;
}

.screen-signal span {
  display: block;
  width: 3px;
  border-radius: 999px;
  background: rgba(225, 248, 235, 0.82);
}

.screen-signal span:nth-child(1) { height: 5px; }
.screen-signal span:nth-child(2) { height: 8px; }
.screen-signal span:nth-child(3) { height: 11px; }
.screen-signal span:nth-child(4) { height: 14px; }

html[data-theme="light"] .screen-signal span {
  background: rgba(24, 62, 46, 0.72);
}

.calc-screen-bottom {
  min-height: 82px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 8px;
}

.calc-expression {
  width: 100%;
  min-height: 18px;
  text-align: left;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: rgba(225, 248, 235, 0.72);
}

html[data-theme="light"] .calc-expression {
  color: rgba(24, 62, 46, 0.68);
}

.calc-display {
  min-height: 44px;
  padding: 0;
  text-align: left;
  font-size: clamp(1.35rem, 3.8vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: rgba(242, 255, 249, 0.96);
}

html[data-theme="light"] .calc-display {
  color: rgba(18, 43, 34, 0.9);
}

.calculator-section .calc-mode-panel {
  margin-top: 10px;
}

.calc-keypad {
  gap: 5px;
  margin-top: 0;
}

.calc-keypad button {
  min-height: 46px;
  border-radius: 14px;
  font-size: 0.98rem;
  padding: 0;
}

.calc-keypad-basic {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.calc-keypad-math {
  grid-template-columns: repeat(9, minmax(0, 1fr));
}

.calc-keypad-math button {
  min-height: 38px;
  font-size: clamp(0.62rem, 1.65vw, 0.84rem);
  border-radius: 11px;
}

.op-key {
  background: linear-gradient(135deg, rgba(104, 148, 255, 0.2), rgba(157, 123, 255, 0.18));
}

.equals {
  background: linear-gradient(135deg, rgba(89, 216, 255, 0.3), rgba(157, 123, 255, 0.24));
}

.calculator-grid,
.calculator-grid-landscape,
.calc-side-panel,
.history-list,
#clearHistoryBtn {
  display: none !important;
}

@media (max-width: 1080px) {
  .brand-wrap {
    display: flex;
    align-items: center;
  }
}

@media (max-width: 820px) {
  .site-shell {
    width: min(100% - 10px, 100%);
  }

  .site-header,
  .hero-panel,
  .calculator-section {
    padding: 14px;
  }

  .brand-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .brand-logo {
    width: 66px;
    height: 66px;
    border-radius: 20px;
  }

  .kicker {
    font-size: 0.62rem;
    letter-spacing: 0.12em;
  }

  .brand-copy-block h1 {
    font-size: clamp(1.8rem, 7vw, 2.65rem);
    line-height: 0.94;
  }

  .calculator-console {
    padding: 8px;
    border-radius: 22px;
  }

  .calc-console-screen {
    min-height: 122px;
    padding: 9px 10px 10px;
  }

  .calc-screen-bottom {
    min-height: 70px;
    gap: 6px;
  }

  .calc-keypad button {
    min-height: 42px;
    border-radius: 12px;
  }

  .calc-keypad-math {
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 4px;
  }

  .calc-keypad-math button {
    min-height: 34px;
    font-size: clamp(0.54rem, 2vw, 0.72rem);
    border-radius: 10px;
  }
}

@media (max-width: 560px) {
  .calculator-section {
    padding: 12px;
  }

  .brand-wrap {
    gap: 10px;
  }

  .brand-logo {
    width: 58px;
    height: 58px;
    padding: 6px;
  }

  .kicker {
    font-size: 0.56rem;
    letter-spacing: 0.1em;
  }

  .brand-copy-block h1 {
    font-size: clamp(1.45rem, 8.2vw, 2.1rem);
  }

  .calc-header-actions {
    gap: 8px;
  }

  .mini-toggle {
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.82rem;
  }

  .calculator-console {
    padding: 6px;
  }

  .calc-console-screen {
    min-height: 112px;
    padding: 8px 9px 9px;
    border-radius: 18px;
  }

  .calc-display {
    font-size: clamp(1.15rem, 5vw, 1.8rem);
  }

  .calc-keypad {
    gap: 4px;
  }

  .calc-keypad button {
    min-height: 38px;
    font-size: 0.88rem;
  }

  .calc-keypad-basic {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .calc-keypad-math {
    grid-template-columns: repeat(9, minmax(0, 1fr));
  }

  .calc-keypad-math button {
    min-height: 30px;
    font-size: clamp(0.48rem, 2.25vw, 0.65rem);
    border-radius: 9px;
  }
}
