/* =============================================
   Advanced Scientific Calculator — CalcToolkits
   Self-contained styles (sci-calc-* prefix)
   ============================================= */

/* ===== THEME VARIABLES ===== */
.sci-calc-wrapper {
  --sc-bg: #f8fafc;
  --sc-surface: #ffffff;
  --sc-surface-2: #f1f5f9;
  --sc-display-bg: linear-gradient(180deg, #0b0f19 0%, #111827 100%);
  --sc-display-text: #ffffff;
  --sc-display-expr: #38bdf8;
  --sc-text: #0f172a;
  --sc-text-2: #475569;
  --sc-border: #cbd5e1;
  --sc-btn-num: #ffffff;
  --sc-btn-num-text: #0f172a;
  --sc-btn-num-border: #cbd5e1;
  --sc-btn-num-hover: #f8fafc;
  --sc-btn-num-shadow: 0 2px 4px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --sc-btn-op: #fff1f2;
  --sc-btn-op-text: #e5322d;
  --sc-btn-op-border: #fecdd3;
  --sc-btn-op-hover: #ffe4e6;
  --sc-btn-op-shadow: 0 2px 4px rgba(229, 50, 45, 0.08);
  --sc-btn-sci: #edf2fe;
  --sc-btn-sci-text: #1d4ed8;
  --sc-btn-sci-border: #c7d2fe;
  --sc-btn-sci-hover: #e0e7ff;
  --sc-btn-sci-shadow: 0 2px 4px rgba(37, 99, 235, 0.06);
  --sc-btn-ctrl: #fff7ed;
  --sc-btn-ctrl-text: #c2410c;
  --sc-btn-ctrl-border: #fed7aa;
  --sc-btn-ctrl-hover: #ffedd5;
  --sc-btn-ctrl-shadow: 0 2px 4px rgba(194, 65, 12, 0.06);
  --sc-btn-eq: linear-gradient(135deg, #e5322d 0%, #dc2626 100%);
  --sc-btn-eq-text: #ffffff;
  --sc-btn-eq-hover: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  --sc-btn-eq-shadow: 0 4px 14px rgba(229, 50, 45, 0.4);
  --sc-btn-mem: #f0fdf4;
  --sc-btn-mem-text: #15803d;
  --sc-btn-mem-border: #bbf7d0;
  --sc-btn-mem-hover: #dcfce7;
  --sc-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.12), 0 4px 12px rgba(0, 0, 0, 0.04);
  --sc-radius: 20px;
  --sc-btn-radius: 12px;
  --sc-transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --sc-history-bg: #ffffff;
  --sc-history-item: #f8fafc;
  --sc-history-hover: #f1f5f9;
  --sc-toast-bg: #0f172a;
  --sc-toast-text: #ffffff;
  --sc-accent: #e5322d;
  --sc-mode-active: #e5322d;
  --sc-mode-active-text: #ffffff;
  --sc-mode-bg: #cbd5e1;
  --sc-mode-text: #334155;
  --sc-indicator: #e5322d;
}

.sci-calc-wrapper[data-theme="dark"] {
  --sc-bg: #0b0f19;
  --sc-surface: #1e293b;
  --sc-surface-2: #0f172a;
  --sc-display-bg: linear-gradient(180deg, #030712 0%, #0b0f19 100%);
  --sc-display-text: #ffffff;
  --sc-display-expr: #38bdf8;
  --sc-text: #f8fafc;
  --sc-text-2: #94a3b8;
  --sc-border: #334155;
  --sc-btn-num: #1e293b;
  --sc-btn-num-text: #f8fafc;
  --sc-btn-num-border: #334155;
  --sc-btn-num-hover: #334155;
  --sc-btn-num-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  --sc-btn-op: #450a0a;
  --sc-btn-op-text: #fca5a5;
  --sc-btn-op-border: #991b1b;
  --sc-btn-op-hover: #7f1d1d;
  --sc-btn-op-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  --sc-btn-sci: #172554;
  --sc-btn-sci-text: #93c5fd;
  --sc-btn-sci-border: #1e40af;
  --sc-btn-sci-hover: #1e3a8a;
  --sc-btn-sci-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  --sc-btn-ctrl: #451a03;
  --sc-btn-ctrl-text: #fde68a;
  --sc-btn-ctrl-border: #92400e;
  --sc-btn-ctrl-hover: #78350f;
  --sc-btn-ctrl-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  --sc-btn-eq: linear-gradient(135deg, #e5322d 0%, #ef4444 100%);
  --sc-btn-eq-text: #ffffff;
  --sc-btn-eq-hover: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  --sc-btn-eq-shadow: 0 4px 16px rgba(229, 50, 45, 0.5);
  --sc-btn-mem: #022c22;
  --sc-btn-mem-text: #86efac;
  --sc-btn-mem-border: #065f46;
  --sc-btn-mem-hover: #047857;
  --sc-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  --sc-history-bg: #1e293b;
  --sc-history-item: #0f172a;
  --sc-history-hover: #334155;
  --sc-toast-bg: #f8fafc;
  --sc-toast-text: #0f172a;
  --sc-mode-active: #e5322d;
  --sc-mode-active-text: #ffffff;
  --sc-mode-bg: #334155;
  --sc-mode-text: #94a3b8;
}

/* ===== WRAPPER ===== */
.sci-calc-wrapper {
  width: 100%;
  max-width: 840px;
  margin: 0 auto 2rem;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ===== DESKTOP LAYOUT ===== */
.sci-calc-layout {
  display: flex;
  gap: 1.25rem;
  align-items: stretch;
}

.sci-calc-main {
  flex: 0 0 500px;
  max-width: 500px;
  width: 100%;
}

/* ===== CALCULATOR CONTAINER ===== */
.sci-calc-container {
  background: var(--sc-surface);
  border: 1px solid var(--sc-border);
  border-radius: var(--sc-radius);
  box-shadow: var(--sc-shadow);
  overflow: hidden;
  transition: var(--sc-transition);
}

/* ===== DISPLAY ===== */
.sci-calc-display {
  background: var(--sc-display-bg);
  padding: 1rem 1.25rem 0.85rem;
  min-height: 105px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sci-calc-indicators {
  display: flex;
  gap: 6px;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.sci-calc-indicator {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
  transition: var(--sc-transition);
}

.sci-calc-indicator.active {
  background: var(--sc-indicator);
  color: #ffffff;
}

.sci-calc-expression {
  font-size: 0.95rem;
  color: var(--sc-display-expr);
  text-align: right;
  min-height: 1.4em;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  padding-bottom: 4px;
  scrollbar-width: none;
  font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
  word-break: keep-all;
}

.sci-calc-expression::-webkit-scrollbar {
  display: none;
}

.sci-calc-result {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 800;
  color: var(--sc-display-text);
  text-align: right;
  line-height: 1.2;
  min-height: 1.3em;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none;
  font-family: 'Inter', -apple-system, sans-serif;
  letter-spacing: -0.5px;
}

.sci-calc-result::-webkit-scrollbar {
  display: none;
}

.sci-calc-result.error {
  color: #f87171;
  font-size: 1.1rem;
  font-weight: 600;
}

/* ===== MODE BAR ===== */
.sci-calc-mode-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: var(--sc-surface-2);
  border-bottom: 1px solid var(--sc-border);
  flex-wrap: wrap;
}

.sci-calc-mode-toggle {
  display: flex;
  background: var(--sc-mode-bg);
  border-radius: 8px;
  padding: 2px;
  font-size: 0.72rem;
  font-weight: 700;
  overflow: hidden;
}

.sci-calc-mode-option {
  padding: 4px 10px;
  border: none;
  background: transparent;
  color: var(--sc-mode-text);
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  cursor: pointer;
  border-radius: 6px;
  transition: var(--sc-transition);
  white-space: nowrap;
}

.sci-calc-mode-option.active {
  background: var(--sc-mode-active);
  color: var(--sc-mode-active-text);
}

.sci-calc-mode-spacer {
  flex: 1;
}

.sci-calc-theme-btn,
.sci-calc-copy-btn,
.sci-calc-fullscreen-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--sc-border);
  background: var(--sc-surface);
  color: var(--sc-text-2);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--sc-transition);
}

.sci-calc-theme-btn:hover,
.sci-calc-copy-btn:hover,
.sci-calc-fullscreen-btn:hover {
  background: var(--sc-btn-num-hover);
  color: var(--sc-text);
  border-color: var(--sc-accent);
}

.sci-calc-fullscreen-btn.active {
  background: var(--sc-accent);
  color: #ffffff;
  border-color: var(--sc-accent);
}

/* ===== FULL SCREEN APP MODE (YouTube Style) ===== */
body.sci-calc-fullscreen-active {
  overflow: hidden !important;
}

.sci-calc-wrapper.fullscreen-mode,
.sci-calc-wrapper:fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  margin: 0 !important;
  padding: 12px !important;
  z-index: 99999 !important;
  background: var(--sc-bg) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.sci-calc-wrapper.fullscreen-mode .sci-calc-layout,
.sci-calc-wrapper:fullscreen .sci-calc-layout {
  width: 100%;
  max-width: 860px;
  height: 100%;
  max-height: 100%;
  gap: 12px;
  align-items: stretch;
}

.sci-calc-wrapper.fullscreen-mode .sci-calc-main,
.sci-calc-wrapper:fullscreen .sci-calc-main {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.sci-calc-wrapper.fullscreen-mode .sci-calc-container,
.sci-calc-wrapper:fullscreen .sci-calc-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.sci-calc-wrapper.fullscreen-mode .sci-calc-keypad,
.sci-calc-wrapper:fullscreen .sci-calc-keypad {
  flex: 1;
  grid-template-rows: repeat(5, 1fr);
}

.sci-calc-wrapper.fullscreen-mode .sci-calc-btn,
.sci-calc-wrapper:fullscreen .sci-calc-btn {
  height: 100%;
  min-height: unset;
}

/* ===== SCIENTIFIC PANEL ===== */
.sci-calc-sci-toggle {
  display: none;
  width: 100%;
  padding: 8px;
  background: var(--sc-btn-sci);
  color: var(--sc-btn-sci-text);
  border: none;
  border-bottom: 1px solid var(--sc-border);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: var(--sc-transition);
}

.sci-calc-sci-toggle .chevron {
  display: inline-block;
  transition: transform 0.2s ease;
  margin-left: 4px;
}

.sci-calc-sci-toggle.expanded .chevron {
  transform: rotate(180deg);
}

.sci-calc-sci-panel {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  padding: 8px;
  background: var(--sc-surface-2);
  border-bottom: 1px solid var(--sc-border);
}

/* ===== MEMORY BAR ===== */
.sci-calc-memory-bar {
  display: flex;
  gap: 4px;
  padding: 6px 8px;
  background: var(--sc-surface-2);
  border-bottom: 1px solid var(--sc-border);
}

.sci-calc-mem-btn {
  flex: 1;
  padding: 5px 2px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: inherit;
  background: var(--sc-btn-mem);
  color: var(--sc-btn-mem-text);
  border: 1px solid var(--sc-btn-mem-border);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--sc-transition);
  text-align: center;
  white-space: nowrap;
}

.sci-calc-mem-btn:hover {
  background: var(--sc-btn-mem-hover);
}

.sci-calc-mem-btn:active {
  transform: scale(0.94);
}

/* ===== MAIN KEYPAD ===== */
.sci-calc-keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  padding: 8px;
  background: var(--sc-surface);
}

/* ===== BUTTONS (shared) ===== */
.sci-calc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 6px 4px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  border-radius: var(--sc-btn-radius);
  cursor: pointer;
  transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.15s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.15s ease,
              border-color 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.sci-calc-btn:hover {
  transform: translateY(-1.5px);
}

.sci-calc-btn:active {
  transform: translateY(1px) scale(0.96);
  box-shadow: none !important;
}

/* Ripple effect */
.sci-calc-btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  transform: scale(0);
  animation: sc-ripple 0.4s ease-out;
  pointer-events: none;
}

@keyframes sc-ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Number buttons */
.sci-calc-btn.num {
  background: var(--sc-btn-num);
  color: var(--sc-btn-num-text);
  border: 1px solid var(--sc-btn-num-border);
  box-shadow: var(--sc-btn-num-shadow);
  font-size: 1.15rem;
  font-weight: 700;
}

.sci-calc-btn.num:hover {
  background: var(--sc-btn-num-hover);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}

/* Zero button spans 1 col only */
.sci-calc-btn.zero {
  font-size: 1.15rem;
}

/* Operator buttons */
.sci-calc-btn.op {
  background: var(--sc-btn-op);
  color: var(--sc-btn-op-text);
  border: 1px solid var(--sc-btn-op-border);
  box-shadow: var(--sc-btn-op-shadow);
  font-size: 1.25rem;
  font-weight: 700;
}

.sci-calc-btn.op:hover {
  background: var(--sc-btn-op-hover);
  box-shadow: 0 4px 10px rgba(229, 50, 45, 0.15);
}

/* Scientific buttons */
.sci-calc-btn.sci {
  background: var(--sc-btn-sci);
  color: var(--sc-btn-sci-text);
  border: 1px solid var(--sc-btn-sci-border);
  box-shadow: var(--sc-btn-sci-shadow);
  min-height: 38px;
  font-size: 0.82rem;
  font-weight: 700;
}

.sci-calc-btn.sci:hover {
  background: var(--sc-btn-sci-hover);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.12);
}

/* Control buttons */
.sci-calc-btn.ctrl {
  background: var(--sc-btn-ctrl);
  color: var(--sc-btn-ctrl-text);
  border: 1px solid var(--sc-btn-ctrl-border);
  box-shadow: var(--sc-btn-ctrl-shadow);
  font-weight: 700;
}

.sci-calc-btn.ctrl:hover {
  background: var(--sc-btn-ctrl-hover);
  box-shadow: 0 4px 10px rgba(194, 65, 12, 0.12);
}

/* Equals button */
.sci-calc-btn.eq {
  background: var(--sc-btn-eq);
  color: var(--sc-btn-eq-text);
  border: none;
  box-shadow: var(--sc-btn-eq-shadow);
  font-size: 1.4rem;
  font-weight: 800;
}

.sci-calc-btn.eq:hover {
  background: var(--sc-btn-eq-hover);
  box-shadow: 0 6px 18px rgba(229, 50, 45, 0.5);
}

/* 2nd mode active */
.sci-calc-btn.sci.second-active {
  background: var(--sc-accent);
  color: #ffffff;
  border-color: var(--sc-accent);
  box-shadow: 0 4px 12px rgba(229, 50, 45, 0.3);
}

/* ===== HISTORY PANEL ===== */
.sci-calc-history-panel {
  flex: 1;
  min-width: 260px;
  max-width: 320px;
  background: var(--sc-history-bg);
  border: 1px solid var(--sc-border);
  border-radius: var(--sc-radius);
  box-shadow: var(--sc-shadow);
  overflow: hidden;
  transition: var(--sc-transition);
  display: flex;
  flex-direction: column;
}

.sci-calc-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--sc-border);
  background: var(--sc-surface-2);
}

.sci-calc-history-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--sc-text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sci-calc-history-clear {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sc-accent);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 8px;
  border-radius: 6px;
  transition: var(--sc-transition);
}

.sci-calc-history-clear:hover {
  background: rgba(229, 50, 45, 0.08);
}

.sci-calc-history-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  scrollbar-width: thin;
}

.sci-calc-history-list::-webkit-scrollbar {
  width: 4px;
}

.sci-calc-history-list::-webkit-scrollbar-thumb {
  background: var(--sc-border);
  border-radius: 100px;
}

.sci-calc-history-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--sc-text-2);
  font-size: 0.85rem;
}

.sci-calc-history-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--sc-history-item);
  margin-bottom: 6px;
  cursor: pointer;
  transition: var(--sc-transition);
}

.sci-calc-history-item:hover {
  background: var(--sc-history-hover);
}

.sci-calc-history-item:last-child {
  margin-bottom: 0;
}

.sci-calc-history-expr {
  font-size: 0.78rem;
  color: var(--sc-text-2);
  font-family: 'SF Mono', 'Consolas', monospace;
  word-break: break-all;
}

.sci-calc-history-result {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--sc-text);
  margin-top: 2px;
}

.sci-calc-history-del {
  background: none;
  border: none;
  color: var(--sc-text-2);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  opacity: 0;
  transition: var(--sc-transition);
}

.sci-calc-history-item:hover .sci-calc-history-del {
  opacity: 1;
}

.sci-calc-history-del:hover {
  background: rgba(229, 50, 45, 0.1);
  color: var(--sc-accent);
}

/* Mobile history toggle button */
.sci-calc-history-toggle {
  display: none;
  width: 100%;
  padding: 10px;
  margin-top: 10px;
  background: var(--sc-surface);
  border: 1px solid var(--sc-border);
  border-radius: var(--sc-btn-radius);
  color: var(--sc-text);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--sc-transition);
  text-align: center;
}

.sci-calc-history-toggle:hover {
  background: var(--sc-btn-num-hover);
}

/* Mobile history overlay */
.sci-calc-history-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.sci-calc-history-overlay.visible {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: sc-fade-in 0.2s ease;
}

.sci-calc-history-overlay .sci-calc-history-drawer {
  width: 100%;
  max-width: 500px;
  max-height: 70vh;
  background: var(--sc-history-bg);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  animation: sc-slide-up 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sci-calc-history-drawer .sci-calc-history-handle {
  width: 36px;
  height: 4px;
  background: var(--sc-border);
  border-radius: 100px;
  margin: 10px auto 6px;
}

/* ===== TOAST ===== */
.sci-calc-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--sc-toast-bg);
  color: var(--sc-toast-text);
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 3000;
  font-family: 'Inter', sans-serif;
}

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

/* ===== ANIMATIONS ===== */
@keyframes sc-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sc-slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* ===== RESPONSIVE: MOBILE ===== */
@media (max-width: 768px) {
  .sci-calc-layout {
    flex-direction: column;
  }

  .sci-calc-history-panel {
    display: none;
  }

  .sci-calc-history-toggle {
    display: block;
  }

  .sci-calc-sci-toggle {
    display: block;
  }

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

  .sci-calc-sci-panel.expanded {
    display: grid;
  }

  .sci-calc-btn {
    min-height: 50px;
  }

  .sci-calc-btn.sci {
    min-height: 42px;
    font-size: 0.75rem;
  }

  .sci-calc-mem-btn {
    padding: 7px 2px;
    font-size: 0.68rem;
  }
}

@media (max-width: 400px) {
  .sci-calc-display {
    padding: 1rem 0.85rem 0.75rem;
    min-height: 100px;
  }

  .sci-calc-result {
    font-size: 1.6rem;
  }

  .sci-calc-expression {
    font-size: 0.82rem;
  }

  .sci-calc-keypad,
  .sci-calc-sci-panel {
    gap: 4px;
    padding: 6px 6px 8px;
  }

  .sci-calc-mode-bar {
    padding: 6px;
    gap: 4px;
  }

  .sci-calc-btn {
    min-height: 46px;
    font-size: 0.88rem;
    border-radius: 10px;
  }

  .sci-calc-btn.num {
    font-size: 1.05rem;
  }

  .sci-calc-btn.sci {
    min-height: 38px;
    font-size: 0.7rem;
  }

  .sci-calc-memory-bar {
    padding: 4px 6px;
  }
}

/* ===== SEO CONTENT SECTIONS ===== */
.sci-calc-content {
  max-width: 960px;
  margin: 2.5rem auto 0;
  color: var(--sc-text);
}

.sci-calc-content h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--sc-text);
  margin-bottom: 1rem;
  margin-top: 2rem;
}

.sci-calc-content h2:first-child {
  margin-top: 0;
}

.sci-calc-content p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--sc-text-2);
  margin-bottom: 1rem;
}

.sci-calc-content ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.sci-calc-content li {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--sc-text-2);
  margin-bottom: 0.35rem;
}

.sci-calc-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.sci-calc-content ol li {
  margin-bottom: 0.5rem;
}

/* FAQ within content */
.sci-calc-content .faq-item {
  background: var(--sc-surface);
  border: 1px solid var(--sc-border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.sci-calc-content .faq-question {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--sc-text);
  margin-bottom: 0.5rem;
}

.sci-calc-content .faq-answer {
  font-size: 0.92rem;
  color: var(--sc-text-2);
  line-height: 1.6;
}
