/* ==========================================
   USDT Converter — styles.css
   ========================================== */

/* ---------- CSS Variables ---------- */
:root {
  --bg: #0a0e17;
  --surface: #111827;
  --surface2: #1a2235;
  --border: #1e2d45;
  --accent: #00d4aa;
  --accent2: #0099ff;
  --accent3: #ff6b35;
  --text: #e8f0fe;
  --muted: #6b7a99;
  --green: #00c97d;
  --red: #ff4757;
  --yellow: #ffd700;

  --radius-card: 16px;
  --radius-input: 12px;
  --radius-sm: 8px;
  --gap-card: 20px;
  --pad-card: 28px 32px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

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

/* ---------- Base ---------- */
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Syne', sans-serif;
  min-height: 100vh;
  min-width: 375px;
  padding: 24px 16px 56px;
  background-image:
    radial-gradient(ellipse at 15% 0%, rgba(0, 212, 170, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 100%, rgba(0, 153, 255, 0.07) 0%, transparent 55%);
}

.container {
  max-width: 700px;
  margin: 0 auto;
}

/* ---------- Header ---------- */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 12px;
  flex-wrap: wrap;
}

.logo {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.logo span {
  color: var(--accent);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.source-label {
  font-size: 11px;
  color: var(--muted);
}

/* ---------- Language Switcher ---------- */
.lang-switcher {
  display: flex;
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px;
}

.lang-divider {
  font-size: 11px;
  color: var(--border);
  user-select: none;
}

.lang-btn {
  background: transparent;
  border: none;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 12px;
  transition: color 0.18s, background 0.18s;
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.active {
  color: var(--accent);
  background: rgba(0, 212, 170, 0.12);
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--pad-card);
  margin-bottom: var(--gap-card);
  position: relative;
  overflow: hidden;
}

.card-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  pointer-events: none;
}

/* ---------- Section title ---------- */
.price-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  width: 100%;
}

.section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

/* ---------- Currency Selector ---------- */
.currency-selector-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.currency-selector-row .section-title {
  margin-bottom: 0;
  flex-shrink: 0;
}

.currency-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ctab {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--muted);
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.18s;
  letter-spacing: 0.03em;
}

.ctab:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.ctab.active {
  background: rgba(0, 212, 170, 0.12);
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Price Display ---------- */
.price-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.dot.live {
  animation: pulse 2s infinite;
}

.dot.manual {
  background: var(--accent3);
  animation: none;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

.price-main {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.price-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.price-card-top-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.calc-open-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.calc-open-btn svg {
  width: 22px;
  height: 22px;
  transition: color 0.2s;
}

.calc-open-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 212, 170, 0.08);
}

.calc-open-btn:active {
  transform: scale(0.93);
}

.price-value {
  font-family: 'Space Mono', monospace;
  font-size: 44px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -1px;
  transition: color 0.3s;
}

.price-value.manual-mode {
  color: var(--accent3);
}

.price-unit {
  font-size: 18px;
  font-weight: 600;
  color: var(--muted);
}

.price-change {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(0, 201, 125, 0.12);
  color: var(--green);
  transition: all 0.3s;
}

.price-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.meta-item {
  font-size: 12px;
  color: var(--muted);
}

.meta-item span {
  font-family: 'Space Mono', monospace;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

/* ---------- Refresh Button ---------- */
.refresh-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  cursor: pointer;
  padding: 7px 12px;
  font-size: 12px;
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.refresh-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.refresh-btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.refresh-btn.outline {
  border-color: var(--accent3);
  color: var(--accent3);
}

/* ---------- Manual Rate ---------- */
.manual-toggle-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  user-select: none;
  flex-shrink: 0;
  height: 35px;
}

.toggle-label input[type=checkbox] {
  display: none;
}

.toggle-switch {
  width: 38px;
  height: 21px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 11px;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s, background 0.2s;
}

.toggle-label input:checked+.toggle-switch {
  background: rgba(255, 107, 53, 0.15);
  border-color: var(--accent3);
}

.toggle-label input:checked+.toggle-switch::after {
  transform: translateX(17px);
  background: var(--accent3);
}

.manual-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateX(4px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.manual-prefix,
.manual-suffix {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  font-family: 'Space Mono', monospace;
}

.manual-input {
  background: var(--bg);
  border: 1px solid var(--accent3);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-family: 'Space Mono', monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent3);
  width: 130px;
  outline: none;
  transition: box-shadow 0.2s;
}

.manual-input:focus {
  box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.25);
}

/* ---------- Converter ---------- */
.input-group {
  margin-bottom: 16px;
}

.input-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-badge {
  position: absolute;
  left: 16px;
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  z-index: 1;
  pointer-events: none;
  user-select: none;
}

.currency-badge.secondary {
  color: var(--accent2);
}

.conv-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 14px 90px 14px 50px;
  font-family: 'Space Mono', monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.conv-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.conv-input.secondary-input:focus {
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(0, 153, 255, 0.1);
}

.input-currency {
  position: absolute;
  right: 16px;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  pointer-events: none;
}

.swap-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  margin: 8px auto;
  font-size: 18px;
  transition: all 0.25s;
}

.swap-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(180deg);
}

/* ---------- Fee Grid ---------- */
.fee-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.fee-col {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 16px;
  transition: border-color 0.2s;
}

.fee-col.highlight {
  border-color: var(--accent3);
}

.fee-col-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
}

.fee-col-pct {
  font-family: 'Space Mono', monospace;
  font-size: 15px;
  font-weight: 700;
  color: var(--yellow);
  margin-bottom: 12px;
}

.fee-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.fee-row span {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--text);
  font-weight: 700;
}

.fee-net {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--green);
}

.fee-net span {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
}

/* ---------- Custom Fee ---------- */
.custom-fee-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  flex-wrap: wrap;
}

.custom-fee-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  flex-shrink: 0;
}

.custom-fee-wrap {
  position: relative;
  flex-shrink: 0;
}

.custom-fee-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 34px 5px 12px;
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent3);
  width: 110px;
  outline: none;
  transition: border-color 0.2s;
}

.custom-fee-input:focus {
  border-color: var(--accent3);
}

.custom-fee-unit {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--muted);
  pointer-events: none;
}

.custom-fee-result {
  flex: 1;
  min-width: 160px;
}

.custom-fee-result .fee-row {
  margin-bottom: 3px;
}

/* ---------- Error Bar ---------- */
.status-bar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 71, 87, 0.1);
  border: 1px solid rgba(255, 71, 87, 0.3);
  border-radius: 10px;
  font-size: 12px;
  color: var(--red);
  margin-bottom: 16px;
}

/* ---------- Footer ---------- */
footer {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
  letter-spacing: 0.04em;
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* ---------- Responsive ---------- */
@media (max-width: 540px) {
  :root {
    --pad-card: 20px 18px;
  }

  .price-value {
    font-size: 32px;
  }

  .fee-grid {
    grid-template-columns: 1fr;
  }

  .price-meta {
    gap: 14px;
  }

  .custom-fee-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .manual-input-wrap {
    gap: 6px;
  }

  .header-right {
    gap: 10px;
  }
}

/* alert */

/* ---------- Bell Button ---------- */
.bell-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.25s ease;
  vertical-align: middle;
  margin-left: 8px;
  outline: none;
}

.bell-btn:hover {
  border-color: var(--accent3);
  color: var(--accent3);
  transform: scale(1.1);
}

.bell-btn.active {
  background: rgba(255, 107, 53, 0.15);
  border-color: var(--accent3);
  color: var(--accent3);
  animation: swing 2.5s infinite ease-in-out;
}

@keyframes swing {

  0%,
  100% {
    transform: rotate(0);
  }

  10%,
  30% {
    transform: rotate(15deg);
  }

  20%,
  40% {
    transform: rotate(-15deg);
  }

  50% {
    transform: rotate(0);
  }
}

/* ---------- Alert Panel ---------- */
.alert-panel {
  position: absolute;
  top: 35px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px;
  margin-bottom: 20px;
  animation: alert 0.25s ease;
  z-index: 10;
}

@keyframes alert {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.alert-panel-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.alert-inputs {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.alert-select,
.alert-input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s;
}

.alert-select {
  padding: 6px 10px;
  cursor: pointer;
}

.alert-input {
  padding: 6px 12px;
  width: 120px;
}

.alert-select:focus,
.alert-input:focus {
  border-color: var(--accent3);
}

.alert-currency {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--muted);
}

.alert-save-btn,
.alert-cancel-btn {
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 12px;
  padding: 6px 14px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.alert-save-btn {
  background: var(--accent3);
  color: #fff;
}

.alert-cancel-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

.alert-save-btn:hover,
.alert-cancel-btn:hover {
  opacity: 0.9;
}

.alert-status-text {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}

/* ---------- Calculator Toggle Button ---------- */
.calc-toggle-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.25s ease;
  vertical-align: middle;
  margin-left: 6px;
  outline: none;
}

.calc-toggle-btn:hover {
  border-color: var(--accent2);
  color: var(--accent2);
  transform: scale(1.1);
}

/* ---------- Calculator Modal PopUp ---------- */
.calc-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 14, 23, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.price-calc.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  width: 220px;
  padding: 16px;
  border-radius: var(--radius-card);
  animation: scaleUp 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-sizing: border-box;
}

@keyframes scaleUp {
  from {
    transform: scale(0.9);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.calc-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.calc-modal-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.calc-close-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  transition: color 0.15s;
}

.calc-close-btn:hover {
  color: var(--red);
}

.calc-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(5, 8, 18, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.calc-modal-overlay.calc-visible {
  opacity: 1;
}

/* ==========================================
   Calculator Modal Box
   ========================================== */
.calc-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%;
  max-width: 340px;
  overflow: hidden;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(0, 212, 170, 0.08);
  transform: translateY(12px);
  transition: transform 0.2s ease;
}

.calc-modal-overlay.calc-visible .calc-modal {
  transform: translateY(0);
}

/* Header */
.calc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.calc-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.calc-close-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}

.calc-close-btn:hover {
  color: var(--text);
  background: var(--surface2);
}

/* Display */
.calc-display {
  background: var(--bg);
  padding: 16px 20px 12px;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 4px;
  border-bottom: 1px solid var(--border);
}

.calc-expr {
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  color: var(--muted);
  min-height: 20px;
  word-break: break-all;
  text-align: right;
}

.calc-input {
  font-family: 'Space Mono', monospace;
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -1px;
  line-height: 1;
  word-break: break-all;
  text-align: right;
  transition: color 0.15s;
}

.calc-input--error {
  color: var(--red) !important;
  font-size: 22px;
}

/* Paste row */
.calc-paste-row {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

.calc-paste-btn {
  flex: 1;
  background: rgba(0, 212, 170, 0.08);
  border: 1px solid rgba(0, 212, 170, 0.25);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 7px 10px;
  cursor: pointer;
  transition: all 0.18s;
}

.calc-paste-btn:hover {
  background: rgba(0, 212, 170, 0.16);
  border-color: var(--accent);
}

.calc-paste-btn.calc-paste-fiat {
  background: rgba(0, 153, 255, 0.08);
  border-color: rgba(0, 153, 255, 0.25);
  color: var(--accent2);
}

.calc-paste-btn.calc-paste-fiat:hover {
  background: rgba(0, 153, 255, 0.16);
  border-color: var(--accent2);
}

/* Button grid */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border-top: 1px solid var(--border);
}

.calc-btn {
  background: var(--surface);
  border: none;
  color: var(--text);
  font-family: 'Space Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  padding: 0;
  height: 64px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}

.calc-btn:hover {
  background: var(--surface2);
}

.calc-btn:active,
.calc-btn.pressed {
  background: #243050;
}

/* Operator column */
.calc-btn--op {
  background: rgba(0, 212, 170, 0.07);
  color: var(--accent);
}

.calc-btn--op:hover {
  background: rgba(0, 212, 170, 0.14);
}

.calc-btn--op.active {
  background: var(--accent);
  color: var(--bg);
}

/* Function row (C, ±, %) */
.calc-btn--fn {
  color: var(--accent2);
  font-size: 15px;
}

.calc-btn--fn:hover {
  background: rgba(0, 153, 255, 0.1);
}

/* Equals */
.calc-btn--eq {
  background: var(--accent);
  color: var(--bg);
  font-size: 22px;
}

.calc-btn--eq:hover {
  background: #00bfa0;
}

.calc-btn--eq:active {
  background: #009e84;
}

/* Zero spans 2 cols */
.calc-btn--zero {
  grid-column: span 2;
  text-align: left;
  padding-left: 24px;
}

/* Ripple on press */
.calc-btn.pressed::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

/* ── Responsive ── */
@media (max-width: 380px) {
  .calc-modal {
    border-radius: 16px;
  }

  .calc-btn {
    height: 56px;
    font-size: 16px;
  }

  .calc-input {
    font-size: 28px;
  }
}