:root {
  --bg-0: #f0f7f5;
  --bg-1: #e6f2ef;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --ink: #0f1f1c;
  --ink-soft: #3d524c;
  --muted: #6b8079;
  --line: rgba(15, 118, 110, 0.12);
  --line-strong: rgba(15, 118, 110, 0.22);
  --teal-700: #0f766e;
  --teal-600: #0d9488;
  --teal-500: #14b8a6;
  --teal-50: #ecfdf5;
  --amber: #d97706;
  --rose: #e11d48;
  --sky: #0284c7;
  --shadow: 0 10px 40px rgba(15, 61, 55, 0.08);
  --shadow-sm: 0 2px 10px rgba(15, 61, 55, 0.06);
  --radius: 16px;
  --radius-sm: 10px;
  --header-h: 64px;
  --font-display: "Outfit", "Noto Sans SC", sans-serif;
  --font-body: "Noto Sans", "Noto Sans SC", "Noto Sans JP", "Noto Sans KR", "Noto Sans Arabic", "Outfit", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.bg-atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(20, 184, 166, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 0%, rgba(2, 132, 199, 0.12), transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(217, 119, 6, 0.08), transparent 55%),
    linear-gradient(180deg, #f5fbf9 0%, #eaf4f1 100%);
}

.bg-atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(15, 118, 110, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 118, 110, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  backdrop-filter: blur(14px);
  background: rgba(245, 251, 249, 0.78);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  transition: transform 0.25s var(--ease);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.18);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-tag {
  font-size: 0.68rem;
  color: var(--teal-600);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-solid);
  cursor: pointer;
  padding: 10px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: 0.25s var(--ease);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-backdrop {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin-inline-start: 8px;
  position: relative;
}

.lang-switch {
  position: relative;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-solid);
  color: var(--ink-soft);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.lang-btn:hover,
.lang-switch.open .lang-btn {
  background: var(--teal-50);
  color: var(--teal-700);
  border-color: var(--line-strong);
}

.lang-code {
  font-family: var(--font-display);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 168px;
  max-height: min(70vh, 420px);
  overflow: auto;
  padding: 8px;
  background: var(--surface-solid);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: var(--shadow);
  z-index: 80;
}

.lang-menu button {
  display: block;
  width: 100%;
  text-align: start;
  padding: 9px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.lang-menu button:hover,
.lang-menu button.active {
  background: var(--teal-50);
  color: var(--teal-700);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-inline-start: auto;
  flex: 0 1 auto;
  min-width: 0;
}

.dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 220px;
  max-width: min(280px, calc(100vw - 24px));
  padding: 8px;
  background: var(--surface-solid);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: none;
  z-index: 50;
}

.nav-item.open .dropdown {
  display: block;
}

.nav-item {
  position: relative;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.92rem;
  transition: background 0.2s, color 0.2s;
}

.nav-btn:hover,
.nav-item.open .nav-btn,
.nav-item.active .nav-btn {
  background: rgba(15, 118, 110, 0.1);
  color: var(--teal-700);
}

.nav-ico {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
}

.nav-ico svg,
.chev {
  width: 18px;
  height: 18px;
}

.chev {
  width: 14px;
  height: 14px;
  opacity: 0.55;
  transition: transform 0.2s var(--ease);
}

.nav-item.open .chev {
  transform: rotate(180deg);
}

.dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  color: var(--ink-soft);
  transition: background 0.15s, color 0.15s;
}

.dropdown a:hover,
.dropdown a.active {
  background: var(--teal-50);
  color: var(--teal-700);
}

.dropdown a .di {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(15, 118, 110, 0.08);
  color: var(--teal-700);
  flex-shrink: 0;
}

.dropdown a .di svg {
  width: 15px;
  height: 15px;
}

/* Layout */
.site-main {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  min-height: calc(100vh - var(--header-h) - 72px);
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  background: var(--surface);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px;
  animation: rise 0.45s var(--ease) both;
}

.sidebar-head {
  padding: 4px 8px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.sidebar-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--font-display);
}

.sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 10px;
  font-size: 0.9rem;
  color: var(--ink-soft);
  transition: 0.15s;
}

.sidebar-list a:hover {
  background: rgba(15, 118, 110, 0.07);
}

.sidebar-list a.active {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.14), rgba(20, 184, 166, 0.08));
  color: var(--teal-700);
  font-weight: 600;
}

.sidebar-list .si {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(15, 118, 110, 0.08);
  color: var(--teal-700);
}

.sidebar-list .si svg {
  width: 15px;
  height: 15px;
}

.workspace {
  animation: rise 0.5s var(--ease) 0.05s both;
  min-width: 0;
  max-width: 100%;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tool-hero {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
  min-width: 0;
}

.tool-hero-text {
  min-width: 0;
  flex: 1 1 auto;
}

.tool-hero-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--teal-600), var(--teal-700));
  color: #ecfdf5;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.28);
  flex-shrink: 0;
}

.tool-hero-icon svg {
  width: 26px;
  height: 26px;
}

.tool-crumb {
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal-600);
  font-family: var(--font-display);
}

.tool-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.5vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tool-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.tool-panel {
  background: var(--surface);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: clamp(16px, 3vw, 28px);
  min-height: 320px;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

/* Form primitives */
.form-grid {
  display: grid;
  gap: 16px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

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

.form-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input[type="date"],
.field input[type="datetime-local"],
.field input[type="time"],
.field input[type="month"] {
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18);
}

.field input[readonly],
.field .result-input {
  background: var(--teal-50);
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--teal-700);
}

.hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
  max-width: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.15s, background 0.15s;
  max-width: 100%;
}

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

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--teal-600), var(--teal-700));
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.32);
}

.btn-ghost {
  background: var(--surface-solid);
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

.btn-ghost:hover {
  background: var(--teal-50);
  color: var(--teal-700);
}

.result-card {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(2, 132, 199, 0.06));
  border: 1px solid var(--line);
}

.result-card h3 {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--font-display);
}

.result-main {
  font-family: var(--font-mono);
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  font-weight: 600;
  color: var(--teal-700);
  word-break: break-all;
}

.result-sub {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  display: grid;
  gap: 4px;
}

.unit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: end;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.swap-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface-solid);
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--teal-700);
  margin-bottom: 1px;
  transition: 0.15s;
}

.swap-btn:hover {
  background: var(--teal-50);
  transform: rotate(180deg);
}

.swap-btn svg {
  width: 18px;
  height: 18px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-solid);
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--ink-soft);
  transition: 0.15s;
}

.chip:hover,
.chip.active {
  background: var(--teal-50);
  border-color: rgba(15, 118, 110, 0.35);
  color: var(--teal-700);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
}

.switch-row .switch-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.switch-row .switch-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.switch-row .switch-hint {
  font-size: 0.78rem;
  color: var(--muted);
}

.switch {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(15, 31, 28, 0.12);
  transition: background 0.2s var(--ease);
}

.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 61, 55, 0.25);
  transition: transform 0.2s var(--ease);
}

.switch input:checked + .switch-track {
  background: linear-gradient(135deg, var(--teal-600), var(--teal-700));
}

.switch input:checked + .switch-track .switch-thumb {
  transform: translateX(20px);
}

.switch input:focus-visible + .switch-track {
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18);
}

/* Calculator */
.calc-wrap {
  max-width: 360px;
  margin: 0 auto;
}

.calc-display {
  background: #0f2926;
  color: #ecfdf5;
  border-radius: 14px;
  padding: 18px 16px;
  text-align: right;
  margin-bottom: 12px;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.calc-expr {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  opacity: 0.55;
  min-height: 1.2em;
  word-break: break-all;
}

.calc-value {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 600;
  word-break: break-all;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.calc-grid.sci {
  grid-template-columns: repeat(5, 1fr);
}

.calc-key {
  border: none;
  border-radius: 12px;
  padding: 14px 8px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  color: var(--ink);
  transition: 0.12s;
}

.calc-key:hover {
  background: var(--teal-50);
  color: var(--teal-700);
}

.calc-key.op {
  background: rgba(15, 118, 110, 0.1);
  color: var(--teal-700);
  font-weight: 600;
}

.calc-key.eq {
  background: linear-gradient(135deg, var(--teal-600), var(--teal-700));
  color: #fff;
  border: none;
}

.calc-key.fn {
  font-size: 0.78rem;
  background: rgba(15, 31, 28, 0.04);
}

.calc-key.span-2 {
  grid-column: span 2;
}

.bmi-meter {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, #22c55e, #eab308, #f97316, #ef4444);
  margin-top: 12px;
  position: relative;
}

.bmi-needle {
  position: absolute;
  top: -6px;
  width: 3px;
  height: 22px;
  background: var(--ink);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: left 0.35s var(--ease);
}

.table-mini {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-top: 12px;
}

.table-mini th,
.table-mini td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.table-mini th {
  color: var(--muted);
  font-weight: 600;
}

.site-footer {
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0;
}

.site-footer .footer-contact {
  margin-top: 8px;
}

.site-footer a {
  color: var(--teal-700);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s, color 0.15s;
}

.site-footer a:hover {
  color: var(--teal-600);
  border-bottom-color: rgba(13, 148, 136, 0.45);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0f2926;
  color: #ecfdf5;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s var(--ease);
  z-index: 200;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 900px) {
  .site-header {
    overflow: visible;
  }

  .site-main {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px 12px 40px;
    width: 100%;
    max-width: 100%;
  }

  /* 手机 / H5：不显示顶部菜单与左侧工具列表，只留右上角菜单入口 */
  .nav-toggle {
    display: flex;
  }

  .header-actions {
    margin-inline-start: auto;
  }

  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: auto;
    width: 100%;
    max-width: 100%;
    margin: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px;
    background: rgba(245, 251, 249, 0.98);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: none !important;
    max-height: calc(100vh - var(--header-h));
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 120;
    box-sizing: border-box;
  }

  .main-nav.open {
    display: flex !important;
    animation: rise 0.25s var(--ease);
  }

  .nav-backdrop {
    display: none;
    position: fixed;
    inset: var(--header-h) 0 0 0;
    width: 100%;
    background: rgba(15, 31, 28, 0.28);
    z-index: 110;
    border: none;
    padding: 0;
    cursor: pointer;
  }

  .nav-backdrop.show {
    display: block;
  }

  .nav-btn {
    width: 100%;
    justify-content: flex-start;
    border-radius: 12px;
    padding: 12px 14px;
  }

  .dropdown {
    position: static;
    display: none;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0 0 8px 8px;
    min-width: 0;
    max-width: 100%;
  }

  .nav-item.open .dropdown {
    display: block;
  }

  .sidebar {
    display: none !important;
  }

  .tool-panel {
    padding: 14px;
  }

  .tool-title {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .tool-desc {
    overflow-wrap: anywhere;
  }

  .result-card,
  .result-main,
  .actions,
  .btn {
    max-width: 100%;
  }

  .result-main {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .form-grid.cols-2,
  .form-grid.cols-3,
  .unit-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .unit-row {
    gap: 10px;
  }

  .swap-btn {
    width: 100%;
    height: 40px;
  }

  .calc-wrap {
    max-width: 100%;
  }

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

  .site-footer {
    padding: 16px 12px;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 420px) {
  .brand-tag {
    display: none;
  }

  .lang-code {
    display: none;
  }

  .tool-hero {
    gap: 12px;
  }

  .tool-hero-icon {
    width: 48px;
    height: 48px;
  }
}

html[dir="rtl"] .dropdown {
  left: auto;
  right: 0;
}

html[dir="rtl"] .lang-menu {
  inset-inline-end: 0;
}
