.calc-shell {
  max-width: min(1080px, calc(100% - 32px));
  margin: 24px auto 60px;
  padding: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
.calc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 45%;
  gap: 24px;
  align-items: start;
}
.calc-layout.calc-layout-single {
  grid-template-columns: minmax(0, 1fr);
}
.calc-main {
  min-width: 0;
  display: grid;
  gap: 16px;
}
.calc-page-head {
  margin-bottom: 20px;
}
.calc-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #6b737c;
  margin-bottom: 8px;
}
.calc-breadcrumbs a {
  color: #6b737c;
  text-decoration: none;
}
.calc-breadcrumbs a:hover,
.calc-breadcrumbs a:focus-visible {
  color: #2f6fdf;
  text-decoration: underline;
}
.calc-page-title {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 18px;
  color: #151a1f;
}
.calc-page-intro {
  margin: 0;
  max-width: 720px;
  color: #4b535d;
  font-size: 15px;
  line-height: 1.6;
}
.calc-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(20, 24, 30, 0.08);
  box-shadow: 0 18px 34px -30px rgba(15, 23, 42, 0.7);
  max-width: 100%;
  overflow: hidden;
}
.calc-card-head {
  margin-bottom: 18px;
}
.calc-card-head .calc-page-title {
  margin: 0;
}
.calc-card-head--with-tools {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.calc-card-head--with-tools .calc-page-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}
.calc-card-head--with-tools .calc-top-tools {
  flex: 0 0 auto;
  margin: 0;
  padding-top: 3px;
}
.calc-card-head--with-tools .calc-tax-rate-control {
  white-space: nowrap;
}
.calc-top-tools {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}
.calc-tax-rate-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  border: none;
  background: transparent;
  border-radius: 999px;
  color: #5f6873;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.calc-tax-rate-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px;
  border: 1px solid rgba(20, 24, 30, 0.12);
  background: #ffffff;
  border-radius: 999px;
  box-shadow: 0 18px 34px -30px rgba(15, 23, 42, 0.7);
}
.calc-tax-rate-input {
  width: 26px;
  border: none;
  background: transparent;
  text-align: right;
  color: #5f6873;
  font-size: 13px;
  font-weight: 600;
  padding: 0;
  outline: none;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
.calc-tax-rate-input::-webkit-outer-spin-button,
.calc-tax-rate-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.calc-tax-rate-input[type="number"] {
  -moz-appearance: textfield;
}
.calc-tax-rate-suffix {
  color: #6b737c;
  font-size: 12px;
  font-weight: 600;
}
.calc-display {
  background: #ffffff;
  color: #1b1f24;
  border-radius: 8px;
  padding: 20px 16px 22px;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  font-size: 34px;
  font-weight: 600;
  text-align: right;
  overflow: visible;
  border: 1px solid rgba(20, 24, 30, 0.12);
  max-width: 100%;
  overflow: visible;
  /* Reserve fixed inline space for the overflow toggle so digits never render under it. */
  --calc-display-toggle-clearance: clamp(30px, 7vw, 40px);
}
.calc-display-preview {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: rgba(27, 31, 36, 0.45);
  min-height: 16px;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  white-space: normal;
  word-break: break-all;
  overflow-wrap: anywhere;
  line-height: 1.2;
  overflow: hidden;
  max-height: 1.2em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  position: relative;
  padding-left: 14px;
  text-align: right;
  direction: rtl;
  unicode-bidi: plaintext;
}
/* Intentionally no preview ellipsis marker:
   the toggle button is the single overflow indicator for this component. */
.calc-display-preview sup {
  font-size: 0.7em;
  vertical-align: super;
}
.calc-display-text {
  display: block;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  line-height: 1.2;
  text-transform: none;
  text-rendering: geometricPrecision;
  font-variant-ligatures: none;
  font-feature-settings: "tnum" 1, "lnum" 1;
  max-height: 1.2em;
  overflow: hidden;
  text-overflow: clip;
  padding-right: 0;
  max-width: 100%;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  cursor: pointer;
  position: relative;
  margin-right: 0;
  margin-left: 0;
}
.calc-display-text:focus,
.calc-display-text:focus-visible {
  outline: none;
  box-shadow: 0 18px 34px -30px rgba(15, 23, 42, 0.7);
}
.calc-display-text.has-toggle {
  display: block;
  max-width: 100%;
  /* Keep a clear text-safe zone on the toggle side across all breakpoints. */
  padding-right: var(--calc-display-toggle-clearance);
  box-sizing: border-box;
  margin-right: 0;
}
.calc-display.toggle-left .calc-display-text.has-toggle {
  max-width: 100%;
  padding-left: var(--calc-display-toggle-clearance);
  padding-right: 0;
  margin-right: 0;
  margin-left: 0;
}
.calc-display-text.is-truncated {
  direction: ltr;
  unicode-bidi: normal;
  text-align: right;
}
.calc-decimal-placeholder {
  opacity: 0.45;
}
.calc-display.is-final .calc-decimal-placeholder {
  opacity: 1;
}

.calc-preview-ghost {
  color: rgba(27, 31, 36, 0.28);
}
.calc-exp {
  font-size: 0.7em;
  vertical-align: super;
  margin-left: 2px;
  letter-spacing: 0.02em;
}
.calc-display::-webkit-scrollbar {
  height: 0;
}
.calc-display::-webkit-scrollbar-thumb {
  background: transparent;
}
.calc-display {
  scrollbar-width: none;
}
.calc-display {
  position: relative;
}
.calc-display-text {
  cursor: pointer;
}
.calc-display.is-expanded .calc-display-preview,
.calc-display.is-expanded .calc-display-text {
  max-height: 1.2em;
  overflow: hidden;
}
.calc-display.is-expanded .calc-display-toggle {
  display: inline-flex;
}
.calc-display-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0;
  margin-top: 13px;
  z-index: 6;
  pointer-events: auto;
  background-clip: padding-box;
  border: 1px solid rgba(20, 24, 30, 0.12);
  background: #f3f4f6;
  color: #3c4651;
  font-size: 12px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 999px;
  cursor: pointer;
}
.calc-display.toggle-left .calc-display-toggle {
  right: auto;
  left: 12px;
}

.calc-display-popover {
  position: absolute;
  right: 12px;
  left: 12px;
  top: calc(100% + 8px);
  background: #ffffff;
  border: 1px solid rgba(20, 24, 30, 0.12);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  color: #151a1f;
  box-shadow: 0 18px 34px -30px rgba(15, 23, 42, 0.7);
  display: none;
  max-height: 220px;
  overflow: auto;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
  z-index: 2;
  white-space: pre-wrap;
  cursor: pointer;
  text-align: left;
  scrollbar-width: thin;
  scrollbar-color: #9aa3ad rgba(0, 0, 0, 0.08);
}
.calc-display-popover::-webkit-scrollbar {
  width: 8px;
}
.calc-display-popover::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
}
.calc-display-popover::-webkit-scrollbar-thumb {
  background: #9aa3ad;
  border-radius: 999px;
}
.calc-display.is-expanded .calc-display-popover {
  display: block;
}
.calc-display-toggle:focus {
  outline: none;
  box-shadow: 0 18px 34px -30px rgba(15, 23, 42, 0.7);
}
.calc-copy-toast {
  position: absolute;
  right: 12px;
  bottom: 12px;
  background: rgba(32, 37, 44, 0.92);
  color: #f8fafc;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.calc-copy-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.calc-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(52px, 1fr));
  gap: 14px 10px;
  margin-top: 20px;
}
.calc-btn {
  background: #f3f4f6;
  border: 0px solid rgba(20, 24, 30, 0.14);
  border-radius: 35px;
  padding: 12px 8px;
  font-size: 16px;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #2a2f36;
  cursor: pointer;
  transition: none;
  min-height: 44px;
  box-sizing: border-box;
  line-height: 1.1;
}
.calc-btn sup {
  font-size: 0.7em;
}
.calc-btn:focus-visible {
  outline: none;
  box-shadow: 0 18px 34px -30px rgba(15, 23, 42, 0.7);
}
.calc-btn:active,
.calc-btn.is-active {
  background: #e9eef9;
  border-color: transparent;
}
.calc-btn-core {
  background: #ffffff;
  border: 0;
  color: #151a1f;
  font-size: 18px;
  font-weight: 600;
}
.calc-btn-core:not(.calc-btn-op):not(.calc-btn-eq) {
  border: 1px solid #f3f4f6;
}
.calc-btn-op {
  font-size: 18px;
  background: #f0f8ff;
}
.calc-btn-eq {
  background: #2f6fdf;
  border-color: #2f6fdf;
  color: #ffffff;
  font-size: 18px;
}
.calc-btn-fn {
  background: #f3f4f6;
  color: #3c4651;
  font-size: 15px;
}
.calc-btn-fn[data-action="sign"] {
  background: #ffffff;
  border: 1px solid #f3f4f6;
}
.calc-btn-state {
  background: #f0f1f3;
  color: #6b737c;
  font-size: 14px;
}
.calc-btn-state[data-action="back"],
.calc-btn-state[data-action="ac"],
.calc-btn-state[data-action="clear"],
.calc-btn-fn[data-action="sign"] {
  color: #3c4651;
  font-weight: 600;
}
.calc-btn-state[data-action="back"] {
  background: #fff6f0;
}
.calc-btn-state[data-action="ac"],
.calc-btn-state[data-action="clear"] {
  background: #fff0f0;
  color: #3c4651;
}
.calc-btn-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 10px;
  align-items: center;
  justify-items: center;
  font-size: 15px;
  letter-spacing: 0;
  padding: 6px 0;
  min-height: 44px;
  height: 44px;
  text-transform: none;
  grid-column: span 2;
  position: relative;
}
.calc-toggle-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 12px;
  width: auto;
  min-width: 60%;
  height: 28px;
  border-radius: 999px;
  color: #6b737c;
  line-height: 1;
}
.calc-btn-toggle::after {
  content: "|";
  color: #9aa3ad;
  font-size: 14px;
  line-height: 1;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.calc-toggle-indicator {
  display: none;
}
.calc-btn-toggle[data-active="DEG"] .calc-toggle-option[data-mode="DEG"],
.calc-btn-toggle[data-active="RAD"] .calc-toggle-option[data-mode="RAD"] {
  background: transparent;
  color: #0b57d0;
}
.calc-btn-state[data-action="ac"] {
  border-color: rgba(20, 24, 30, 0.14);
}
.calc-btn-state:disabled {
  opacity: 0;
  pointer-events: none;
}
.calc-sidebar {
  display: block;
}
.calc-sidebar-card {
  background: #ffffff;
  border: 1px solid rgba(20, 24, 30, 0.08);
  border-radius: 12px;
  box-shadow: 0 18px 34px -30px rgba(15, 23, 42, 0.7);
  padding: 16px;
  margin-bottom: 16px;
}

.calc-sidebar-card-match-bg {
  background: #ffffff;
}

.calc-sidebar-card-scroll {
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.calc-sidebar-card-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.scientific-sidebar-card {
  background: #fcfcfc;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #9fb2d8 rgba(0, 0, 0, 0.06);
}

.scientific-sidebar-card::-webkit-scrollbar {
  width: 8px;
}

.scientific-sidebar-card::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
}

.scientific-sidebar-card::-webkit-scrollbar-thumb {
  background: #9fb2d8;
  border-radius: 999px;
}

.scientific-sections {
  margin-top: 16px;
}

.calc-sections-full {
  margin-top: 16px;
}
.calc-settings {
  margin-bottom: 18px;
}
.calc-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(20, 24, 30, 0.06);
  font-size: 14px;
  color: #2a2f36;
}
.calc-setting:last-child {
  border-bottom: none;
}
.calc-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 42px;
  height: 24px;
}
.calc-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.calc-switch-slider {
  position: absolute;
  inset: 0;
  background: #e6e9ef;
  border-radius: 999px;
  transition: background 0.2s ease;
}
.calc-switch-slider::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 18px 34px -30px rgba(15, 23, 42, 0.7);
  transition: transform 0.2s ease;
}
.calc-switch input:checked + .calc-switch-slider {
  background: #7bd99b;
}
.calc-switch input:checked + .calc-switch-slider::after {
  transform: translateX(18px);
}
.calc-select {
  width: 100%;
  max-width: 170px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(20, 24, 30, 0.12);
  background: #ffffff;
  font-size: 13px;
  color: #2a2f36;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--rp-select-chevron-color, #334155) 50%),
    linear-gradient(135deg, var(--rp-select-chevron-color, #334155) 50%, transparent 50%);
  background-position:
    calc(100% - var(--rp-select-chevron-right, 18px)) 14px,
    calc(100% - var(--rp-select-chevron-right-inner, 13px)) 14px;
  background-size:
    var(--rp-select-chevron-size, 5px) var(--rp-select-chevron-size, 5px),
    var(--rp-select-chevron-size, 5px) var(--rp-select-chevron-size, 5px);
  background-repeat: no-repeat;
  padding-right: var(--rp-select-padding-right, 36px);
}
.calc-setting-reset {
  width: 100%;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(20, 24, 30, 0.12);
  background: #ffffff;
  color: #2a2f36;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.calc-setting-reset:active {
  background: #eef1f6;
}
.calc-sidebar-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #3b3f45;
  margin-bottom: 12px;
}
.calc-sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.calc-sidebar-list a {
  color: #2a2f36;
  text-decoration: none;
  font-size: 14px;
}
.calc-sidebar-list a:hover,
.calc-sidebar-list a:focus-visible {
  color: #2f6fdf;
  text-decoration: underline;
}
.calc-sidebar-more {
  margin-top: 12px;
}
.calc-sidebar-more-toggle {
  color: #2f6fdf;
  cursor: pointer;
  font-size: 13px;
  list-style: none;
}
.calc-sidebar-more-toggle::-webkit-details-marker {
  display: none;
}
.calc-sidebar-more-toggle::after {
  content: " ▾";
  font-size: 11px;
  color: #6b737c;
}
.calc-sidebar-more[open] .calc-sidebar-more-toggle::after {
  content: " ▴";
}
.calc-sidebar-more-panel {
  margin-top: 10px;
  border-top: 1px solid rgba(20, 24, 30, 0.08);
  padding-top: 10px;
}
.calc-sidebar-list-secondary {
  opacity: 0.9;
}

.currency-converter {
  margin-top: 0;
  overflow: visible;
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.currency-converter > * {
  margin: 0;
}
.currency-converter-title {
  font-size: 22px;
  color: #151a1f;
}
h1.currency-converter-title {
  padding-bottom: 8px;
}
.currency-converter-intro {
  color: #4b535d;
  font-size: 15px;
  line-height: 1.6;
}
.currency-converter-full {
  margin-bottom: 0;
}
.currency-calculator .currency-converter-title {
  margin: 0;
}
.currency-calculator .currency-converter-intro {
  margin: 0;
}
.currency-calculator {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.currency-calculator > * {
  margin: 0;
}
.currency-layout-row {
  align-items: start;
}
.currency-main-row,
.currency-sidebar-row {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.currency-sidebar-row {
  box-shadow: 0 18px 34px -30px rgba(15, 23, 42, 0.7);
}
.currency-main-row .currency-calculator {
  height: auto;
}
.currency-sidebar-card-scroll {
  height: auto;
  max-height: 100%;
  margin-bottom: 0;
  overflow: auto;
  background: #ffffff;
  border-radius: 12px;
  clip-path: inset(0 round 12px);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.currency-sidebar-card-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
  background: transparent;
}
.currency-main-fullwidth {
  margin-top: 0;
}
.currency-converter-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.currency-converter-field {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #2a2f36;
}
.currency-converter-field input,
.currency-converter-field select {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(20, 24, 30, 0.14);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 15px;
  color: #151a1f;
  background: #ffffff;
  box-sizing: border-box;
}

.currency-converter-field select {
  -webkit-appearance: none;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--rp-select-chevron-color, #334155) 50%),
    linear-gradient(135deg, var(--rp-select-chevron-color, #334155) 50%, transparent 50%);
  background-position:
    calc(100% - var(--rp-select-chevron-right, 18px)) 50%,
    calc(100% - var(--rp-select-chevron-right-inner, 13px)) 50%;
  background-size:
    var(--rp-select-chevron-size, 5px) var(--rp-select-chevron-size, 5px),
    var(--rp-select-chevron-size, 5px) var(--rp-select-chevron-size, 5px);
  background-repeat: no-repeat;
  padding-right: var(--rp-select-padding-right, 36px);
}
.currency-converter-field select:disabled {
  background: #f4f5f7;
  color: #5f6873;
}
.currency-converter-result {
  margin-top: 14px;
  border: 1px solid rgba(20, 24, 30, 0.12);
  border-radius: 10px;
  background: #ffffff;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.currency-converter-result-label {
  font-size: 12px;
  color: #6b737c;
}
.currency-converter-output {
  margin-top: 4px;
  font-size: 30px;
  font-weight: 600;
  color: #151a1f;
  line-height: 1.2;
  word-break: break-word;
}
.currency-converter-meta {
  font-size: 12px;
  color: #6b737c;
}
.currency-converter-copy {
  border: 1px solid rgba(20, 24, 30, 0.12);
  background: #f3f4f6;
  color: #2a2f36;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.currency-converter-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: #6b737c;
}

#converter-amount.is-flash,
#currency-converter-output.is-flash,
#go-from-value.is-flash,
#go-to-value.is-flash {
  animation: currency-result-flash 2s ease-out;
}

@keyframes currency-result-flash {
  0% {
    background-color: rgba(16, 185, 129, 0.12);
  }
  100% {
    background-color: #fff;
  }
}

.currency-select-wrap {
  position: relative;
}

.currency-native-select {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.currency-select-trigger {
  width: 100%;
  min-height: 48px;
  border: 1px solid #b9c7df;
  border-radius: 0;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  background: #fff;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 500;
  color: #0f172a;
  cursor: pointer;
  text-align: left;
}

.currency-select-trigger::after {
  content: "";
  margin-left: auto;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #6b7280;
}

.currency-select-trigger[aria-expanded="true"]::after {
  border-top: 0;
  border-bottom: 6px solid #6b7280;
}

.currency-select-trigger:focus-visible {
  border-color: #2563eb;
  box-shadow: 0 18px 34px -30px rgba(15, 23, 42, 0.7);
  outline: none;
  position: relative;
  z-index: 3;
}

.currency-select-flag {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  border: 1px solid #cbd5e1;
  box-shadow: 0 18px 34px -30px rgba(15, 23, 42, 0.7);
}

.currency-select-flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.currency-select-label {
  min-width: 0;
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.currency-select-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid #b9c7df;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 34px -30px rgba(15, 23, 42, 0.7);
  z-index: 40;
}

.currency-select-option {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(185, 199, 223, 0.75);
  background: #fff;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  color: #0f172a;
  cursor: pointer;
  text-align: left;
}

.currency-select-option:last-child {
  border-bottom: 0;
}

.currency-select-option:hover,
.currency-select-option:focus-visible,
.currency-select-option.is-active {
  background: #eff4ff;
}

.currency-select-option:focus-visible {
  outline: none;
}

.calc-reference,
.currency-reference {
  margin-top: 16px;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #1f2937;
}

.calc-card.calc-reference,
.calc-card.currency-reference {
  box-shadow: 0 18px 34px -30px rgba(15, 23, 42, 0.7);
}
.calc-reference h2,
.currency-reference h2 {
  margin: 16px 0 8px;
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.3;
  color: #151a1f;
}
.calc-reference h2:first-child,
.currency-reference h2:first-child {
  margin-top: 0;
}
.calc-reference-subsection + .calc-reference-subsection {
  margin-top: 12px;
}
.calc-reference-subsection h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #1f2937;
}
.calc-reference h2[id],
.currency-reference h2[id] {
  scroll-margin-top: 28px;
}
.calc-reference p,
.currency-reference p {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #374151;
  font-size: 15px;
  line-height: 1.65;
  font-weight: 400;
}
.calc-reference p + p,
.currency-reference p + p {
  margin-top: 12px;
}
.calc-reference ul,
.currency-reference-links {
  margin: 10px 0 0;
  padding-left: 18px;
  color: #1f2937;
}
.calc-reference li,
.currency-reference-links li {
  margin: 2px 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  padding-bottom: 4px;
  font-weight: 400;
  color: #374151;
}
.calc-reference a,
.currency-reference-links a {
  color: #0f172a;
  text-decoration: none;
  font-weight: 500;
}
.calc-reference a:hover,
.calc-reference a:focus-visible,
.currency-reference-links a:hover,
.currency-reference-links a:focus-visible {
  color: #1f5cc9;
  text-decoration: none;
}

main[data-full-li-links="true"] .currency-reference-links > li {
  cursor: pointer;
}

main[data-full-li-links="true"] .currency-reference-links > li:hover > a,
main[data-full-li-links="true"] .currency-reference-links > li:focus-within > a {
  color: #1f5cc9;
  text-decoration: none;
}

.converters-quick-links {
  list-style: none;
  padding-left: 0;
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.calc-page-head .currency-reference-links.converters-quick-links {
  padding-left: 0;
  margin-left: 0;
}

.converters-quick-links li {
  margin: 0;
}

.converters-quick-links a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #bfd1ef;
  background: #fff;
  text-decoration: none;
  font-weight: 600;
}

.converters-quick-links a:hover,
.converters-quick-links a:focus-visible {
  border-color: #2563eb;
  text-decoration: none;
}

.currency-related-pills {
  margin-top: 12px;
}

.currency-page-shell {
  --currency-card-gap: 16px;
  display: grid;
  gap: var(--currency-card-gap);
  padding: 0;
}

.currency-page-shell .calc-layout {
  gap: var(--currency-card-gap);
}

.currency-page-shell .calc-reference,
.currency-page-shell .currency-reference {
  margin-top: 0;
}

@media (max-width: 720px) {
  .calc-reference h2[id],
  .currency-reference h2[id] {
    scroll-margin-top: 24px;
  }

  .calc-layout:not(.calc-layout-single) {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .calc-layout {
    gap: 14px;
  }
  .calc-main {
    gap: 14px;
  }
  .calc-card { padding: 16px; }
  .calc-display { font-size: 28px; }
  .calc-grid { gap: 10px 8px; }
  .calc-btn { padding: 12px 6px; }
  .calc-page-title { font-size: 22px; }
  .currency-converter-form { grid-template-columns: 1fr; }
  .currency-converter-output { font-size: 24px; }
  .currency-converter-result { align-items: flex-start; flex-direction: column; }
  .currency-page-shell {
    --currency-card-gap: 14px;
    padding: 0;
  }
  .currency-sidebar-card-scroll {
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .calc-sidebar-card-scroll {
    height: auto;
    max-height: none !important;
    overflow: visible;
  }
}

@media (max-width: 640px) {
  .calc-card-head--with-tools {
    gap: 8px;
  }
  .calc-top-tools {
    margin-bottom: 8px;
  }
  .calc-tax-rate-control {
    padding: 0;
    gap: 6px;
  }
  .calc-tax-rate-input {
    width: 26px;
  }
  .calc-display {
    font-size: 26px;
    padding: 18px 14px 20px;
  }
  .calc-grid {
    grid-template-columns: repeat(5, minmax(44px, 1fr));
    gap: 10px 6px;
  }
  .calc-btn {
    font-size: 14px;
    padding: 10px 4px;
    min-height: 42px;
  }
  .calc-btn-core { font-size: 16px; }
  .calc-btn-fn { font-size: 13px; }
  .calc-btn-state { font-size: 12px; }
  .calc-btn-toggle {
    font-size: 11px;
    padding: 8px 4px;
  }
}

@media (max-width: 420px) {
  .calc-grid {
    grid-template-columns: repeat(5, minmax(38px, 1fr));
    gap: 8px 6px;
  }
  .calc-btn {
    font-size: 13px;
    min-height: 40px;
  }
  .calc-btn-core { font-size: 15px; }
  .calc-btn-fn { font-size: 12px; }
  .calc-btn-state { font-size: 11px; }
}

@media (max-height: 800px) {
  .calc-card { padding: 14px; }
  .calc-display { font-size: 24px; padding: 16px 12px 18px; }
  .calc-grid { gap: 8px 6px; }
  .calc-btn { min-height: 38px; padding: 9px 4px; }
  .calc-btn-core { font-size: 15px; }
  .calc-btn-fn { font-size: 12px; }
  .calc-btn-state { font-size: 11px; }
  .calc-btn-toggle { min-height: 36px; }
}
