.tool-widget:has(.basic-calc-app) { padding: 0; overflow: hidden; border: 0; background: transparent; box-shadow: none; }
.basic-calc-app { --bc-accent: #38bdf8; --bc-border: rgba(148, 163, 184, .18); --bc-muted: #94a3b8; width: 100%; }
.bc-shell {
    padding: 1.15rem; border: 1px solid var(--bc-border); border-radius: 20px;
    background: radial-gradient(circle at 0 0, rgba(14, 165, 233, .15), transparent 35%), linear-gradient(180deg, #111827, #0b1220);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
}
.bc-head, .bc-history-head, .bc-shortcuts > div { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.bc-head { margin-bottom: 1rem; }
.bc-head p { margin: 0 0 .2rem; color: var(--bc-accent); font-size: .68rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.bc-head h2 { margin: 0; color: #f8fafc; font-size: 1.2rem; }
.bc-keyboard-hint { padding: .3rem .65rem; border: 1px solid var(--bc-border); border-radius: 999px; color: var(--bc-muted); font-size: .66rem; font-weight: 750; }
.bc-layout { display: grid; grid-template-columns: minmax(300px, 430px) minmax(260px, 1fr); gap: 1rem; align-items: stretch; max-width: 920px; margin: 0 auto; }
.bc-calculator { padding: 1rem; border: 1px solid var(--bc-border); border-radius: 20px; background: rgba(5, 12, 25, .88); box-shadow: 0 18px 40px rgba(0, 0, 0, .25); }
.bc-display { min-height: 118px; margin-bottom: .75rem; padding: .8rem 1rem; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid rgba(56, 189, 248, .18); border-radius: 15px; background: linear-gradient(145deg, rgba(14, 165, 233, .11), rgba(2, 8, 20, .75)); text-align: right; overflow: hidden; }
.bc-display-top { min-height: 1.25rem; display: flex; justify-content: space-between; gap: .5rem; color: var(--bc-muted); font-size: .72rem; }
.bc-display-top > span:first-child { padding: .1rem .35rem; border-radius: 4px; background: rgba(52, 211, 153, .12); color: #86efac; font-weight: 850; }
.bc-display output { display: block; width: 100%; max-width: 100%; padding-bottom: .15rem; color: #f8fafc; font-size: clamp(1.65rem, 6vw, 3rem); font-weight: 750; line-height: 1.15; letter-spacing: -.04em; overflow: hidden; white-space: nowrap; text-align: right; }
.bc-display output.is-long { font-size: clamp(1.15rem, 4.2vw, 1.9rem); letter-spacing: -.05em; }
.bc-display output.is-very-long { font-size: clamp(.88rem, 3vw, 1.25rem); line-height: 1.3; letter-spacing: -.035em; white-space: normal; overflow-wrap: anywhere; }
.bc-display output.is-ultra-long { font-size: clamp(.76rem, 2.3vw, 1rem); line-height: 1.35; letter-spacing: -.025em; white-space: normal; overflow-wrap: anywhere; }
.bc-memory-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; margin-bottom: .55rem; }
.bc-memory-row button { min-height: 34px; border: 0; border-radius: 8px; background: transparent; color: #7dd3fc; font: inherit; font-size: .68rem; font-weight: 850; cursor: pointer; }
.bc-memory-row button:hover { background: rgba(56, 189, 248, .1); }
.bc-pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: .55rem; }
.bc-key { min-height: 58px; border: 1px solid var(--bc-border); border-radius: 14px; background: linear-gradient(145deg, rgba(30, 41, 59, .92), rgba(15, 23, 42, .92)); color: #f8fafc; font: inherit; font-size: 1.05rem; font-weight: 750; cursor: pointer; box-shadow: 0 5px 12px rgba(0, 0, 0, .16); transition: transform .1s ease, filter .12s ease, border-color .12s ease; }
.bc-key:hover { filter: brightness(1.12); border-color: rgba(148, 163, 184, .32); }
.bc-key:active { transform: translateY(1px) scale(.98); }
.bc-key--utility, .bc-key--back { background: rgba(51, 65, 85, .7); color: #cbd5e1; }
.bc-key--operator { background: linear-gradient(145deg, rgba(2, 132, 199, .42), rgba(30, 64, 175, .35)); color: #7dd3fc; font-size: 1.3rem; }
.bc-key--operator.is-active { border-color: #7dd3fc; background: #e0f2fe; color: #075985; }
.bc-key--equals { background: linear-gradient(145deg, #0ea5e9, #6366f1); border-color: transparent; color: #fff; font-size: 1.3rem; }
.bc-history-card { min-width: 0; padding: 1rem; display: flex; flex-direction: column; border: 1px solid var(--bc-border); border-radius: 18px; background: rgba(15, 23, 42, .72); }
.bc-history-head { margin-bottom: .65rem; }
.bc-history-head h3 { margin: 0; color: #f1f5f9; font-size: .9rem; }
.bc-history-head button, .bc-history-actions button { border: 0; background: transparent; color: #7dd3fc; font: inherit; font-size: .7rem; font-weight: 800; cursor: pointer; }
.bc-history { flex: 1; min-height: 220px; max-height: 360px; display: flex; flex-direction: column; gap: .4rem; overflow-y: auto; }
.bc-history-empty { margin: auto; max-width: 220px; color: var(--bc-muted); font-size: .76rem; line-height: 1.5; text-align: center; }
.bc-history-item { width: 100%; padding: .6rem .7rem; display: flex; align-items: center; justify-content: space-between; gap: .7rem; border: 1px solid rgba(148, 163, 184, .1); border-radius: 10px; background: rgba(2, 8, 20, .3); color: #cbd5e1; font: inherit; text-align: left; cursor: pointer; }
.bc-history-item:hover { border-color: rgba(56, 189, 248, .35); }
.bc-history-item span { min-width: 0; overflow: hidden; color: var(--bc-muted); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.bc-history-item strong { flex-shrink: 0; color: #e2e8f0; font-size: .78rem; }
.bc-history-actions { padding: .65rem 0; border-top: 1px solid var(--bc-border); text-align: right; }
.bc-shortcuts { margin-top: .25rem; padding-top: .75rem; border-top: 1px solid var(--bc-border); }
.bc-shortcuts h4 { margin: 0 0 .55rem; color: #cbd5e1; font-size: .75rem; }
.bc-shortcuts > div { padding: .25rem 0; color: var(--bc-muted); font-size: .66rem; }
.bc-shortcuts kbd { padding: .15rem .35rem; border: 1px solid var(--bc-border); border-bottom-width: 2px; border-radius: 5px; background: rgba(2, 8, 20, .45); color: #cbd5e1; font: inherit; font-size: .6rem; }
.bc-status { max-width: 920px; margin: .8rem auto 0; padding: .65rem .75rem; border: 1px solid var(--bc-border); border-radius: 10px; color: #cbd5e1; font-size: .74rem; }
.bc-status.is-error { border-color: rgba(248, 113, 113, .3); background: rgba(248, 113, 113, .08); color: #fca5a5; }
.bc-status.is-success { border-color: rgba(52, 211, 153, .28); background: rgba(52, 211, 153, .08); color: #86efac; }
.bc-status.is-info { border-color: rgba(56, 189, 248, .28); background: rgba(56, 189, 248, .08); color: #7dd3fc; }
.basic-calc-app button:focus-visible { outline: 3px solid rgba(56, 189, 248, .45); outline-offset: 3px; }
@media (max-width: 760px) { .bc-layout { grid-template-columns: 1fr; max-width: 470px; } .bc-history { min-height: 160px; max-height: 260px; } }
@media (max-width: 430px) { .bc-shell { padding: .75rem; border-radius: 16px; } .bc-calculator { padding: .75rem; } .bc-key { min-height: 54px; border-radius: 12px; } }
@media (prefers-reduced-motion: reduce) { .basic-calc-app *, .basic-calc-app *::before, .basic-calc-app *::after { transition-duration: .01ms !important; } }
