/* =============================================
   SCIENTIFIC CALCULATOR — scientific.css
   Tool page overrides only.
   Core calc styles (calc-card, btn-*, etc.)
   are already in calcleaf.css (global).
   ============================================= */

/* Wrapper centers the card on tool page */
.sci-tool-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* Card — fixed width matching homepage sci width */
.sci-tool-card {
    width: 100%;
    max-width: 420px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* Header row: title + theme toggle */
.sci-tool-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--navy);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sci-tool-title {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    letter-spacing: 0.02em;
}

/* Result panel width matches card */
#stResultPanel {
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
}

/* Default theme: light (matches homepage default) */
.sci-tool-card.theme-light .calc-display   { background: #fff; border-bottom: 1px solid #f1f5f9; }
.sci-tool-card.theme-light .calc-expression{ color: #94a3b8; }
.sci-tool-card.theme-light .calc-result    { color: var(--navy); }
.sci-tool-card.theme-light .calc-body      { background: #f8fafc; }
.sci-tool-card.theme-light .btn-num        { background: #fff; color: #1e293b; border: 1px solid #e2e8f0; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.sci-tool-card.theme-light .btn-num:hover  { background: #f1f5f9; }
.sci-tool-card.theme-light .btn-op         { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.sci-tool-card.theme-light .btn-op:hover   { background: #bae6fd; }
.sci-tool-card.theme-light .btn-fn         { background: #f3f0ff; color: #7c3aed; border: 1px solid #ddd6fe; }
.sci-tool-card.theme-light .btn-fn:hover   { background: #ede9fe; }
.sci-tool-card.theme-light .btn-clear      { background: #fff1f2; color: #e11d48; border: 1px solid #fecdd3; }
.sci-tool-card.theme-light .btn-clear:hover{ background: #ffe4e6; }
.sci-tool-card.theme-light .btn-eq         { background: var(--teal); color: #fff; font-weight: 700; border: none; box-shadow: 0 4px 12px rgba(0,201,167,0.30); }
.sci-tool-card.theme-light .btn-eq:hover   { background: #00b396; }

/* Dark theme */
.sci-tool-card.theme-dark .calc-display    { background: #0a0a0a; border-bottom: none; }
.sci-tool-card.theme-dark .calc-expression { color: #4a5568; }
.sci-tool-card.theme-dark .calc-result     { color: #fff; }
.sci-tool-card.theme-dark .calc-body       { background: #1a1a1a; }
.sci-tool-card.theme-dark .btn-num         { background: #2c2c2c; color: #fff; border: none; }
.sci-tool-card.theme-dark .btn-num:hover   { background: #3a3a3a; }
.sci-tool-card.theme-dark .btn-op          { background: #162d4a; color: var(--teal); border: none; }
.sci-tool-card.theme-dark .btn-op:hover    { background: #1e3d5e; }
.sci-tool-card.theme-dark .btn-fn          { background: #1e1a2e; color: #a78bfa; border: none; }
.sci-tool-card.theme-dark .btn-fn:hover    { background: #2d2145; }
.sci-tool-card.theme-dark .btn-clear       { background: #2d1515; color: #f87171; border: none; }
.sci-tool-card.theme-dark .btn-clear:hover { background: #3d1a1a; }
.sci-tool-card.theme-dark .btn-eq          { background: var(--teal); color: #0d2137; font-weight: 700; border: none; }
.sci-tool-card.theme-dark .btn-eq:hover    { background: #00b396; }

@media (max-width: 480px) {
    .sci-tool-card { max-width: 100%; border-radius: 0; }
    #stResultPanel { max-width: 100%; }
}
