/* Fixlytools - Scientific Calculator (all classes start with sc-) */
.sc-wrap { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 800px) { .sc-wrap { grid-template-columns: minmax(0, 400px) minmax(0, 1fr); align-items: start; } }

.sc-calc { max-width: 420px; width: 100%; margin: 0 auto; padding: 12px; border-radius: 22px; background: #e2e8f0; border: 1px solid #cbd5e1; }
.dark .sc-calc { background: #0f172a; border-color: #334155; }

.sc-screen { background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 14px; padding: 8px 12px 10px; margin-bottom: 10px; }
.dark .sc-screen { background: #1e293b; border-color: #334155; }
.sc-badges { display: flex; flex-wrap: wrap; gap: 6px; min-height: 22px; align-items: center; }
.sc-badge { font-size: 11px; font-weight: 800; letter-spacing: 0.04em; padding: 2px 8px; border-radius: 8px; background: #e0e7ff; color: #3730a3; }
.sc-badge[hidden] { display: none; }
.sc-badge-mode { background: #2563eb; color: #fff; font-size: 12px; }
.dark .sc-badge { background: #312e81; color: #e0e7ff; }
.dark .sc-badge-mode { background: #3b82f6; color: #0b1120; }
.sc-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.sc-expr { width: 100%; box-sizing: border-box; margin-top: 4px; padding: 8px 4px; border: 0; border-bottom: 2px solid #94a3b8; border-radius: 0; background: transparent; color: #0f172a; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 20px; text-align: right; outline: none; }
.sc-expr:focus { border-bottom-color: #2563eb; }
.dark .sc-expr { color: #f1f5f9; border-bottom-color: #475569; }
.dark .sc-expr:focus { border-bottom-color: #60a5fa; }
.sc-expr::placeholder { color: #94a3b8; font-size: 14px; }
.sc-result { min-height: 40px; margin-top: 6px; text-align: right; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 26px; font-weight: 700; color: #0f172a; overflow-wrap: anywhere; line-height: 1.3; }
.dark .sc-result { color: #f1f5f9; }
.sc-result.sc-preview { font-size: 20px; font-weight: 500; color: #475569; }
.dark .sc-result.sc-preview { color: #94a3b8; }
.sc-result.sc-err { font-family: inherit; font-size: 15px; font-weight: 600; color: #b91c1c; }
.dark .sc-result.sc-err { color: #fca5a5; }

.sc-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
.sc-mode-btn { min-height: 44px; border: 2px solid #94a3b8; border-radius: 12px; background: transparent; color: #334155; font-weight: 700; font-size: 14px; cursor: pointer; font-family: inherit; }
.sc-mode-btn[aria-pressed="true"] { background: #2563eb; border-color: #2563eb; color: #fff; }
.dark .sc-mode-btn { border-color: #475569; color: #cbd5e1; }
.dark .sc-mode-btn[aria-pressed="true"] { background: #3b82f6; border-color: #3b82f6; color: #0b1120; }

.sc-keys { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.sc-key { min-height: 46px; padding: 0 2px; border: 0; border-radius: 10px; font-size: 16px; font-weight: 600; cursor: pointer; background: #fff; color: #0f172a; box-shadow: 0 1px 0 #94a3b8; font-family: inherit; touch-action: manipulation; overflow: hidden; }
.sc-key:hover { background: #f1f5f9; }
.sc-key:active { transform: translateY(1px); box-shadow: none; }
.sc-key:focus-visible, .sc-mode-btn:focus-visible, .sc-tool-btn:focus-visible, .sc-hist-item:focus-visible, .sc-expr:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }
.dark .sc-key { background: #334155; color: #f8fafc; box-shadow: 0 1px 0 #0f172a; }
.dark .sc-key:hover { background: #475569; }
.sc-key-fn { background: #e0e7ff; color: #3730a3; font-size: 14px; }
.sc-key-fn:hover { background: #c7d2fe; }
.dark .sc-key-fn { background: #312e81; color: #e0e7ff; }
.dark .sc-key-fn:hover { background: #3730a3; }
.sc-key-mem { background: #cbd5e1; color: #1e293b; font-size: 14px; }
.dark .sc-key-mem { background: #1e293b; color: #cbd5e1; }
.sc-key-toggle { background: #fef3c7; color: #92400e; font-size: 14px; }
.sc-key-toggle[aria-pressed="true"] { background: #f59e0b; color: #1c1917; }
.dark .sc-key-toggle { background: #78350f; color: #fef3c7; }
.dark .sc-key-toggle[aria-pressed="true"] { background: #f59e0b; color: #1c1917; }
.sc-key-op { background: #2563eb; color: #fff; box-shadow: 0 1px 0 #1e3a8a; font-size: 20px; }
.sc-key-op:hover { background: #1d4ed8; }
.dark .sc-key-op { background: #3b82f6; color: #0b1120; }
.dark .sc-key-op:hover { background: #60a5fa; }
.sc-key-clear { background: #fee2e2; color: #991b1b; }
.dark .sc-key-clear { background: #7f1d1d; color: #fee2e2; }
.sc-key-eq { background: #16a34a; color: #fff; box-shadow: 0 1px 0 #14532d; font-size: 24px; grid-column: span 5; }
.sc-key-eq:hover { background: #15803d; }
.dark .sc-key-eq { background: #22c55e; color: #052e16; }

.sc-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.sc-tool-btn { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid #94a3b8; background: #fff; color: #0f172a; font-weight: 600; font-size: 14px; cursor: pointer; font-family: inherit; }
.sc-tool-btn:hover:not(:disabled) { background: #eff6ff; }
.sc-tool-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.sc-tool-btn[aria-pressed="true"] { background: #dbeafe; border-color: #2563eb; }
.dark .sc-tool-btn { background: #1e293b; border-color: #475569; color: #f1f5f9; }
.dark .sc-tool-btn:hover:not(:disabled) { background: #334155; }
.dark .sc-tool-btn[aria-pressed="true"] { background: #1e3a8a; border-color: #60a5fa; }
.sc-note { font-size: 12px; color: #64748b; margin: 10px 0 0; text-align: center; }
.dark .sc-note { color: #94a3b8; }

.sc-hist-box { border: 1px solid #e2e8f0; border-radius: 16px; padding: 14px; background: #fff; min-width: 0; }
.dark .sc-hist-box { background: #1e293b; border-color: #334155; }
.sc-hist-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.sc-h2 { font-size: 16px; font-weight: 700; color: #0f172a; margin: 0; }
.dark .sc-h2 { color: #f1f5f9; }
.sc-hist-empty { font-size: 14px; color: #64748b; margin: 4px 0; }
.dark .sc-hist-empty { color: #94a3b8; }
.sc-hist-empty[hidden] { display: none; }
.sc-hist-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 480px; overflow-y: auto; }
.sc-hist-item { width: 100%; min-height: 44px; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 2px; padding: 6px 12px; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; color: #0f172a; cursor: pointer; font-family: inherit; text-align: right; }
.sc-hist-item:hover { background: #eff6ff; }
.dark .sc-hist-item { background: #0f172a; border-color: #334155; color: #f1f5f9; }
.dark .sc-hist-item:hover { background: #172554; }
.sc-hist-expr { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; color: #64748b; overflow-wrap: anywhere; max-width: 100%; }
.dark .sc-hist-expr { color: #94a3b8; }
.sc-hist-res { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; font-size: 15px; overflow-wrap: anywhere; max-width: 100%; }
