/* 線上計算機頁專用樣式；共用元件沿用 site.css */
.cx { max-width: 440px; margin-left: auto; margin-right: auto; padding: 12px; background: #fff; }
.cx.cx-wide { max-width: 520px; }
.cx-top { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 8px; }
.cx-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; flex: 1 1 200px; }
.cx-modes button { min-height: 44px; border: 2px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-size: 1rem; font-weight: 600; cursor: pointer; color: var(--fg); }
.cx-modes button[aria-selected="true"] { border-color: var(--brand); background: #eff4ff; color: var(--brand); }
.cx-screen { background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; text-align: right; }
.cx-expr { min-height: 1.9em; line-height: 1.9; font-size: 1.05rem; color: var(--muted); overflow-x: auto; white-space: nowrap; font-variant-numeric: tabular-nums; scrollbar-width: none; }
.cx-expr::-webkit-scrollbar { display: none; }
.cx-res { font-size: 2.3rem; line-height: 1.3; font-weight: 700; color: var(--fg); overflow-x: auto; white-space: nowrap; font-variant-numeric: tabular-nums; scrollbar-width: none; }
.cx-res-m { font-size: 1.8rem; }
.cx-res-s { font-size: 1.35rem; }
.cx-res.cx-err { color: var(--bad); font-size: 1.25rem; white-space: normal; }
.cx-mem { min-height: 1.4em; font-size: .9rem; color: var(--brand-dark); text-align: left; }
.cx-pad, .cx-sci { display: grid; gap: 8px; margin-bottom: 8px; }
.cx-pad { grid-template-columns: repeat(4, 1fr); }
.cx-sci { grid-template-columns: repeat(5, 1fr); }
.k, .cx-pad button, .cx-sci button {
  display: flex; align-items: center; justify-content: center; min-height: 58px; padding: 0;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--fg);
  font: inherit; font-size: 1.35rem; font-weight: 600; cursor: pointer; user-select: none; -webkit-user-select: none;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; box-shadow: 0 1px 0 rgba(0,0,0,.08);
}
.k:active, .cx-pad button:active, .cx-sci button:active { background: #dbe4ff; transform: translateY(1px); }
.k:focus-visible, .cx-pad button:focus-visible { outline: 3px solid #93b4ff; }
.k-fn { background: var(--soft); font-size: 1.05rem; min-height: 50px; }
.k-mem { background: var(--soft); font-size: 1rem; min-height: 44px; color: var(--brand-dark); }
.k-op { background: #eff4ff; color: var(--brand); font-size: 1.5rem; }
.k-eq { background: var(--brand); color: #fff; border-color: var(--brand); grid-column: span 3; }
.k-eq:active { background: var(--brand-dark); }
.cx-pad button.k-clr { background: #fef2f2; color: var(--bad); border: 1px solid #fecaca; }
.cx-sci button { min-height: 50px; background: var(--soft); font-size: 1.05rem; }
.cx-sci button.cx-angle { grid-column: span 1; font-size: .9rem; }
.cx-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.cx-tools .btn { flex: 1 1 120px; }
.cx-msg { min-height: 1.4em; font-size: .95rem; color: var(--muted); margin: 6px 0 0; }
.cx-histbox { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.cx-histbox h2 { font-size: 1.05rem; margin: 0 0 6px; display: flex; justify-content: space-between; align-items: center; }
#calc-hist { list-style: none; padding: 0; margin: 0; max-height: 220px; overflow-y: auto; }
.cx-h { display: flex; justify-content: space-between; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); cursor: pointer; font-variant-numeric: tabular-nums; font-size: 1rem; }
.cx-h:hover { background: var(--soft); }
.cx-h-e { color: var(--muted); overflow-x: auto; white-space: nowrap; min-width: 0; scrollbar-width: none; }
.cx-h-r { font-weight: 700; white-space: nowrap; }
@media (max-width: 480px) {
  .cx { padding: 8px; }
  .k, .cx-pad button { min-height: 62px; }
  .cx-sci { gap: 6px; }
  .cx-sci button { font-size: .95rem; padding: 0; }
}
