/* Scientific calculator — tool-specific styles (shared tokens from xct.css). */
.xsc { max-width: 560px; margin: 0 auto; }
.xsc-screen {
	background: var(--xct-ink); color: #fff; border-radius: 12px; padding: 12px 16px 14px;
	position: relative; overflow: hidden;
}
.xsc-screen::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--xct-grad);
}
.xsc-status { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 26px; }
.xsc-mode {
	font: inherit; font-size: .75rem; font-weight: 700; letter-spacing: .08em; color: #fff; cursor: pointer;
	background: rgba(255,255,255,.12); border: 0; border-radius: 999px; padding: 4px 12px; min-height: 26px;
}
.xsc-mode:hover { background: rgba(255,255,255,.22); }
.xsc-mode:focus-visible { outline: 2px solid #d155f8; outline-offset: 2px; }
.xsc-mem { font-size: .75rem; color: #c9c9d1; font-variant-numeric: tabular-nums; }
.xsc-input {
	display: block; width: 100%; background: transparent; border: 0; color: #fff; text-align: right;
	font: inherit; font-size: clamp(1.15rem, 4.5vw, 1.5rem); padding: 8px 0 2px; min-height: 44px;
	font-variant-numeric: tabular-nums; caret-color: #d155f8;
}
.xsc-input::placeholder { color: rgba(255,255,255,.35); }
.xsc-input:focus { outline: none; }
.xsc-result {
	display: block; text-align: right; font-size: clamp(1.8rem, 8vw, 2.6rem); font-weight: 600; line-height: 1.15;
	min-height: 1.2em; font-variant-numeric: tabular-nums; word-break: break-all; letter-spacing: -.01em;
}
.xsc-result.is-preview { color: rgba(255,255,255,.55); }
.xsc-result.is-error { color: #ff8a8a; font-size: 1rem; font-weight: 500; padding-top: .6em; }
.xsc-memrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0 6px; }
.xsc-mkey {
	min-height: 34px; border: 1px solid var(--xct-line); background: #fff; border-radius: 8px; cursor: pointer;
	font: inherit; font-size: .8125rem; font-weight: 600; color: var(--xct-muted);
}
.xsc-mkey:hover { color: var(--xct-ink); border-color: var(--xct-ink); }
.xsc-pad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.xsc-key {
	min-height: 48px; padding: 0 2px; border: 0; border-radius: 10px; cursor: pointer;
	font: inherit; font-size: 1.0625rem; font-weight: 500; color: var(--xct-ink); background: var(--xct-soft);
	transition: background .12s, transform .06s; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
	font-variant-numeric: tabular-nums;
}
.xsc-key:hover { background: #ececef; }
.xsc-key:active { transform: scale(.96); }
.xsc-key:focus-visible, .xsc-mkey:focus-visible { outline: 3px solid rgba(103,96,216,.45); outline-offset: 1px; }
.xsc-key--fn { font-size: .9375rem; background: #fff; box-shadow: inset 0 0 0 1px var(--xct-line); }
.xsc-key--fn:hover { background: var(--xct-soft); }
.xsc-key--fn[aria-pressed="true"] { background: var(--xct-accent); color: #fff; box-shadow: none; }
.xsc-key--num { background: #f0f0f2; font-weight: 600; }
.xsc-key--op { background: #ebeafb; color: #3f3a9e; font-size: 1.25rem; }
.xsc-key--op:hover { background: #dedcf7; }
.xsc-key--clr { background: #fdecef; color: #a11d3a; font-weight: 600; }
.xsc-key--clr:hover { background: #fadbe1; }
.xsc-key--eq { background: var(--xct-grad); color: #fff; font-size: 1.375rem; font-weight: 600; }
.xsc-key--eq:hover { opacity: .92; background: var(--xct-grad); }
.xsc-hist { margin-top: 16px; border-top: 1px solid var(--xct-line); padding-top: 12px; }
.xsc-hist-head { display: flex; justify-content: space-between; align-items: center; }
.xsc-link { background: none; border: 0; padding: 4px 0; color: var(--xct-accent); font: inherit; font-size: .8125rem; cursor: pointer; }
.xsc-link:hover { text-decoration: underline; }
.xsc-hist-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 260px; overflow-y: auto; }
.xsc-hist-list li { margin: 0; padding: 0; }
.xsc-hist-list li::before { display: none; }
.xsc-hist-item {
	display: flex; justify-content: space-between; align-items: baseline; gap: 12px; width: 100%; text-align: left;
	background: none; border: 0; border-bottom: 1px dashed var(--xct-line); padding: 8px 2px; cursor: pointer;
	font: inherit; font-size: .875rem; color: var(--xct-ink); font-variant-numeric: tabular-nums;
}
.xsc-hist-item:hover { background: var(--xct-soft); }
.xsc-hist-expr { color: var(--xct-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.xsc-hist-item strong { white-space: nowrap; }
.xsc-hist-empty { color: var(--xct-muted); font-size: .875rem; padding: 6px 0; }
@media (max-width: 400px) {
	.xsc-pad { gap: 5px; }
	.xsc-key { min-height: 46px; font-size: 1rem; }
	.xsc-key--fn { font-size: .875rem; }
}
