/* Scientific Calculator — tool-specific styles */
.sc-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; align-items: start; }
.sc-card { padding: 18px; }

.sc-display { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 16px; margin-bottom: 12px; }
#scExpr { width: 100%; background: none; border: none; color: var(--text); font-size: 1.7rem; font-weight: 700;
  font-family: inherit; font-variant-numeric: tabular-nums; text-align: right; outline: none; }
.sc-preview { text-align: right; color: var(--accent-2); font-size: 1rem; font-weight: 600; min-height: 1.3em;
  font-variant-numeric: tabular-nums; }
.sc-preview.err { color: var(--danger); }

.sc-toprow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px; }
.sc-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.sc-key { font-family: inherit; font-weight: 700; font-size: 1.05rem; min-height: 50px; cursor: pointer;
  background: var(--bg-soft); border: 1px solid var(--line); color: var(--text); border-radius: 10px;
  transition: background .12s, border-color .12s, transform .08s; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; }
.sc-key:hover { border-color: var(--muted-2); }
.sc-key:active { transform: scale(.94); }
.sc-fn { font-size: .9rem; color: var(--accent-2); }
.sc-op { color: var(--accent); font-size: 1.2rem; }
.sc-danger { color: var(--danger); }
.sc-eq { background: var(--accent-grad); color: #0b0e1c; border-color: transparent; font-size: 1.3rem; }
.sc-eq:hover { filter: brightness(1.06); }
.sc-toggle.rad { background: rgba(92,214,192,.15); border-color: var(--accent-2); }

.sc-history { padding: 18px; max-height: 480px; display: flex; flex-direction: column; }
.sc-hist-h { margin: 0 0 10px; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted-2); display: flex; justify-content: space-between; align-items: center; }
.sc-histclear { background: none; border: none; color: var(--muted-2); cursor: pointer; font-family: inherit;
  font-size: .78rem; text-transform: lowercase; }
.sc-histclear:hover { color: var(--danger); }
.sc-histlist { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.sc-histitem { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px;
  cursor: pointer; transition: border-color .12s; }
.sc-histitem:hover { border-color: var(--accent); }
.sc-histitem small { display: block; color: var(--muted-2); font-size: .8rem; font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-histitem b { font-size: 1rem; font-variant-numeric: tabular-nums; color: var(--accent-2); }
.sc-histempty { color: var(--muted-2); font-size: .85rem; text-align: center; padding: 18px 0; }

@media (max-width: 760px) { .sc-layout { grid-template-columns: 1fr; } .sc-history { max-height: 260px; } }
