.memory-calculator { margin: 0 0 2.5rem; }
.memory-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.memory-calculator fieldset, .memory-results { min-width: 0; border: 1px solid var(--border, #28344b); border-radius: 12px; padding: 1.15rem; margin: 0 0 1rem; background: var(--bg-card, #101a2b); }
.memory-calculator legend { font-weight: 700; padding: 0 .4rem; }
.memory-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.memory-field { display: flex; flex-direction: column; min-width: 0; gap: .35rem; }
.memory-field label { font-size: .85rem; overflow-wrap: anywhere; }
.memory-field input, .memory-field select { box-sizing: border-box; width: 100%; min-width: 0; background: var(--bg, #0b1220); color: var(--text, #e2e8f0); border: 1px solid var(--border, #334155); padding: .6rem; border-radius: 6px; font: inherit; }
.memory-field input:focus, .memory-field select:focus { outline: 2px solid #38bdf8; outline-offset: 2px; }
.memory-calculator p { font-size: .9rem; line-height: 1.6; }
.memory-calculator .memory-help { color: var(--text-muted, #a6b3c8); font-size: .8rem; }
.memory-calculator button { border: 1px solid #334155; border-radius: 6px; background: #17253d; color: #e2e8f0; padding: .55rem .85rem; cursor: pointer; }
.memory-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.memory-summary div { padding: .9rem; background: rgba(56,189,248,.07); border-radius: 8px; }
.memory-summary dt { font-size: .8rem; color: var(--text-muted, #a6b3c8); }
.memory-summary dd { margin: .35rem 0 0; font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.memory-breakdown { margin: 1rem 0; }
.memory-breakdown div { display: flex; justify-content: space-between; gap: .8rem; padding: .45rem 0; border-bottom: 1px solid var(--border, #28344b); }
.memory-breakdown dt { font-size: .86rem; }
.memory-breakdown dd { margin: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.memory-bar { display: flex; height: 12px; overflow: hidden; border-radius: 6px; background: #1e293b; }
.memory-bar span:nth-child(1) { background: #38bdf8; }.memory-bar span:nth-child(2) { background: #a78bfa; }.memory-bar span:nth-child(3) { background: #fbbf24; }.memory-bar span:nth-child(4) { background: #34d399; }
.memory-status, .memory-error { padding: .75rem; border-radius: 6px; background: rgba(56,189,248,.1); }
.memory-status[data-state="danger"], .memory-error { background: rgba(248,113,113,.12); color: #fca5a5; }
.memory-status[data-state="warning"] { background: rgba(251,191,36,.12); color: #fde68a; }
.memory-formula code { display: block; white-space: normal; overflow-wrap: anywhere; font-size: .8rem; margin: .5rem 0; }
.memory-calculator details { margin: 1rem 0; }.memory-calculator summary { cursor: pointer; font-weight: 600; }
.memory-calculator [hidden] { display: none !important; }
@media (max-width: 900px) { .memory-layout { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 450px) { .memory-fields { grid-template-columns: minmax(0,1fr); }.memory-summary dd { font-size: 1.1rem; } }
