.sci-card { padding: 28px; }
.sci-title-bar { background: linear-gradient(135deg, var(--site-dark) 0%, var(--site-dark-2) 100%); border-radius: 10px 10px 0 0; padding: 18px 24px; margin: -28px -28px 24px; }
.sci-title-bar h1 { color: #fff; margin: 0; font-size: 1.4em; text-align: center; display: flex; align-items: center; justify-content: center; gap: 10px; }

.sci-mode-toggle { display: flex; gap: 0; border: 1px solid #e5e7eb; border-radius: 30px; padding: 4px; margin: 0 auto 18px; max-width: 260px; background: #f7f8fa; }
.sci-mode-btn { flex: 1; border: none; background: none; padding: 9px 14px; border-radius: 26px; font-weight: 700; font-size: .88em; color: #6b7280; cursor: pointer; transition: background .2s ease, color .2s ease; }
.sci-mode-btn.active { background: var(--site-dark); color: #fff; }
.sci-mode-btn:hover:not(.active) { color: var(--site-dark); }

.sci-display { background: #1f2430; border-radius: 12px; padding: 18px 18px 16px; margin-bottom: 16px; position: relative; overflow: hidden; }
.sci-display-mem { position: absolute; top: 10px; left: 14px; font-size: .72em; font-weight: 800; color: var(--site-light); background: rgba(20,184,166,.15); padding: 2px 8px; border-radius: 6px; letter-spacing: .04em; opacity: 0; transition: opacity .15s ease; }
.sci-display-mem.show { opacity: 1; }
.sci-display-expr { min-height: 24px; text-align: right; color: #9aa3b5; font-size: 1.05em; word-break: break-all; margin-bottom: 6px; }
.sci-display-result { text-align: right; color: #fff; font-size: 2.1em; font-weight: 800; word-break: break-all; line-height: 1.2; }
.sci-display-result.is-error { color: #f87171; font-size: 1.4em; }

.sci-btn-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 18px; }
.sci-btn { border: none; border-radius: 10px; padding: 14px 6px; font-size: 1em; font-weight: 700; cursor: pointer; background: #f2f3f5; color: #23272f; transition: background .15s ease, transform .1s ease; }
.sci-btn:active { transform: scale(.94); }
.sci-btn:hover { background: #e6e8ec; }

.sci-btn-mem { background: #eef2ff; color: #4338ca; font-size: .82em; }
.sci-btn-mem:hover { background: #e0e7ff; }

.sci-btn-fn { background: #f7f8fa; color: var(--site-dark-2); font-size: .85em; }
.sci-btn-fn:hover { background: #eafbf3; }

.sci-btn-op { background: #f0fdfa; color: var(--site-dark); font-size: 1.1em; }
.sci-btn-op:hover { background: #ccfbf1; }

.sci-btn-num { background: #fff; border: 1px solid #eee; }
.sci-btn-num:hover { background: #f7f8fa; }

.sci-btn-clear { background: var(--site-danger-bg); color: var(--site-danger); }
.sci-btn-clear:hover { background: var(--site-danger-border); }

.sci-btn-back { background: #fef3c7; color: #92400e; }
.sci-btn-back:hover { background: #fde68a; }

.sci-btn-eq { background: var(--site-dark); color: #fff; font-size: 1.2em; }
.sci-btn-eq:hover { background: var(--site-dark); }

.sci-history { border-radius: 10px; border: 1px solid #eee; background: #fafbfc; padding: 4px 16px; }
.sci-history-empty { text-align: center; color: #9aa0aa; font-size: .88em; padding: 16px 0; }
.sci-history-item { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid #eee; cursor: pointer; }
.sci-history-item:last-child { border-bottom: none; }
.sci-history-item:hover .sci-history-result { color: var(--site-dark); }
.sci-history-expr { font-size: .84em; color: #6b7280; word-break: break-all; }
.sci-history-result { font-size: .96em; font-weight: 700; color: var(--site-dark); white-space: nowrap; }
.sci-history-title { font-size: .78em; text-transform: uppercase; letter-spacing: .06em; color: #6b7280; padding: 12px 0 4px; }

@media (max-width: 600px) {
    .sci-btn { padding: 12px 4px; font-size: .92em; }
    .sci-btn-mem, .sci-btn-fn { font-size: .76em; }
    .sci-display-result { font-size: 1.7em; }
}

@media (max-width: 380px) {
    .sci-btn-grid { gap: 6px; }
    .sci-btn { padding: 10px 3px; font-size: .84em; border-radius: 8px; }
    .sci-btn-mem, .sci-btn-fn { font-size: .7em; }
}
