/* Calculadora — sempre dark (igual ao nativo dos prints), ignora tema do telefone */ :root { --calc-bg: #000000; --calc-text: #ffffff; --calc-expression: #8e8e93; --calc-key-num: #333333; --calc-key-fn: #636366; --calc-key-fn-text: #ffffff; --calc-key-op: #ff9f0a; --calc-top-btn: #1c1c1e; --calc-top-icon: #ebebf5; --calc-sheet: rgba(44, 44, 46, 0.92); --calc-sheet-border: rgba(84, 84, 88, 0.65); --calc-sheet-handle: rgba(235, 235, 245, 0.3); --calc-sheet-muted: #8e8e93; --calc-sheet-divider: rgba(84, 84, 88, 0.55); --calc-sheet-highlight: rgba(255, 255, 255, 0.08); --calc-close-btn: rgba(120, 120, 128, 0.36); --calc-danger: #ff453a; --safe-top: 3.4rem; --safe-bottom: 2.75rem; --side-pad: 0.9rem; --pad-gap: 0.7rem; --result-max: 5.6rem; } *, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; } html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: var(--calc-bg); color: var(--calc-text); color-scheme: dark !important; font-family: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif; } .calc-app { position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; padding: var(--safe-top) var(--side-pad) var(--safe-bottom); background: var(--calc-bg); color: var(--calc-text); color-scheme: dark !important; } .calc-topbar { display: flex; align-items: center; justify-content: flex-start; flex-shrink: 0; padding: 0 0.1rem; min-height: 2.2rem; } .top-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.55rem; height: 2.55rem; padding: 0; border: 0; border-radius: 50%; background: var(--calc-top-btn); color: var(--calc-top-icon); cursor: pointer; opacity: 0.95; } .top-btn:disabled { cursor: default; opacity: 0.95; } .top-btn:active:not(:disabled) { filter: brightness(1.25); } .top-btn svg { width: 1.55rem; height: 1.55rem; fill: currentColor; } .calc-main { flex: 1; display: flex; flex-direction: column; min-height: 0; padding-top: 0.2rem; } .calc-display { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; padding: 0 0.15rem 1.05rem; min-height: 6.5rem; text-align: right; overflow: visible; } .calc-expression { width: 100%; min-height: 1.25rem; margin-bottom: 0.1rem; color: var(--calc-expression); font-size: 1.5rem; font-weight: 300; letter-spacing: 0.01em; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity 0.15s ease; } .calc-expression.is-visible { opacity: 1; } .calc-result-wrap { width: 100%; display: flex; justify-content: flex-end; align-items: flex-end; overflow: hidden; padding: 0.05rem 0 0.15rem; min-height: 3.8rem; } .calc-result { display: inline-block; max-width: 100%; color: var(--calc-text); font-size: var(--result-size, var(--result-max)); font-weight: 300; letter-spacing: 0.01em; line-height: 1; padding: 0.06em 0.04em 0.08em 0; white-space: nowrap; overflow: visible; text-align: right; font-variant-numeric: lining-nums; } .calc-pad { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--pad-gap); width: 100%; padding: 0; flex-shrink: 0; } .key { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1 / 1; height: auto; min-width: 0; margin: 0; padding: 0; border: 0; border-radius: 50%; font-family: inherit; font-size: clamp(2.1rem, 8.6vw, 2.55rem); font-weight: 400; line-height: 0; text-align: center; cursor: pointer; transition: filter 0.12s ease, background-color 0.12s ease, color 0.12s ease; } .key > span { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; line-height: 1; transform: translateY(0.02em); } .key:active { filter: brightness(1.35); } .key:focus, .key:focus-visible { outline: none; } .key svg { display: block; flex-shrink: 0; width: 1.85rem; height: 1.85rem; margin: 0; overflow: visible; } .key .icon-backspace { width: 2.15rem; height: 1.72rem; } .key .icon-negate { width: 1.85rem; height: 1.85rem; } .key-num { background: var(--calc-key-num); color: var(--calc-text); } .key-fn { background: var(--calc-key-fn); color: var(--calc-key-fn-text); font-size: clamp(1.7rem, 7vw, 2.05rem); font-weight: 500; } .key-fn svg { color: var(--calc-key-fn-text); stroke: currentColor; } .key-fn:active { filter: brightness(1.25); } .key-op { background: var(--calc-key-op); color: var(--calc-text); font-size: clamp(2.25rem, 9.2vw, 2.75rem); font-weight: 400; } .key-op > span { transform: translateY(-0.02em); } .key-op:active { filter: brightness(1.08); } /* ===== History sheet ===== */ .history-sheet { position: absolute; inset: 0; z-index: 40; pointer-events: none; } .history-sheet.is-open, .history-sheet.is-closing { pointer-events: auto; } .history-backdrop { position: absolute; inset: 0; margin: 0; padding: 0; border: 0; background: rgba(0, 0, 0, 0.45); opacity: 0; cursor: pointer; transition: opacity 0.28s ease; pointer-events: none; } .history-sheet.is-open .history-backdrop, .history-sheet.is-closing .history-backdrop { pointer-events: auto; } .history-sheet.is-open .history-backdrop { opacity: 1; } .history-slider { position: absolute; left: 0; right: 0; bottom: 0; height: min(70%, 30rem); transform: translateY(100%); transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1); will-change: transform; } .history-sheet.is-open .history-slider { transform: translateY(0); } .history-sheet.is-closing .history-slider { transform: translateY(100%); transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); } .history-panel { width: 100%; height: 100%; display: flex; flex-direction: column; border-radius: 1.15rem 1.15rem 0 0; background: #2c2c2e; box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.35); overflow: hidden; } .history-handle { width: 2.25rem; height: 0.28rem; margin: 0.55rem auto 0.15rem; border-radius: 999px; background: var(--calc-sheet-handle); flex-shrink: 0; } .history-header { display: flex; align-items: center; justify-content: space-between; padding: 0.35rem 1rem 0.55rem; flex-shrink: 0; } .history-edit { border: 0; background: transparent; color: var(--calc-text); font-size: 1.05rem; font-weight: 400; padding: 0.35rem 0.15rem; cursor: pointer; transition: color 0.15s ease; } .history-edit.is-editing { font-weight: 600; } .history-edit.is-delete { color: var(--calc-danger); } .history-close { display: inline-flex; align-items: center; justify-content: center; width: 1.7rem; height: 1.7rem; padding: 0; border: 0; border-radius: 50%; background: var(--calc-close-btn); color: var(--calc-text); cursor: pointer; } .history-close svg { width: 0.95rem; height: 0.95rem; fill: currentColor; } .history-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0.15rem 0 1.4rem; -webkit-overflow-scrolling: touch; } .history-empty { padding: 2.5rem 1.25rem; text-align: center; color: var(--calc-sheet-muted); font-size: 0.95rem; } .history-empty.is-hidden, .history-groups:empty + .history-empty { display: none; } .history-group-title { padding: 0.55rem 1.25rem 0.45rem; color: var(--calc-sheet-muted); font-size: 0.92rem; font-weight: 500; } .history-item { position: relative; display: flex; align-items: center; gap: 0.65rem; padding: 0.72rem 1.25rem 0.72rem 1.25rem; cursor: pointer; border-bottom: 1px solid var(--calc-sheet-divider); transition: padding-left 0.26s cubic-bezier(0.22, 1, 0.36, 1), background 0.15s ease; } .history-item:last-child { border-bottom: 0; } .history-item.is-latest { background: var(--calc-sheet-highlight); } .history-item-select { position: absolute; left: 1rem; top: 50%; display: inline-flex; align-items: center; justify-content: center; width: 1.4rem; height: 1.4rem; border-radius: 999px; border: 1.5px solid rgba(235, 235, 245, 0.35); box-sizing: border-box; background: transparent; color: transparent; opacity: 0; transform: translateY(-50%) scale(0.6); pointer-events: none; transition: opacity 0.2s ease, transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), background 0.15s ease, border-color 0.15s ease, color 0.15s ease; } .history-item-select svg { width: 0.82rem; height: 0.82rem; fill: currentColor; flex-shrink: 0; } .history-sheet.is-editing .history-item { padding-left: 3.15rem; cursor: pointer; } .history-sheet.is-editing .history-item-select { opacity: 1; transform: translateY(-50%) scale(1); } .history-item.is-selected { background: rgba(255, 255, 255, 0.08); } .history-item.is-selected .history-item-select { background: #8e8e93; border-color: #8e8e93; color: #ffffff; } .history-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 0.12rem; } .history-item-expr { color: var(--calc-sheet-muted); font-size: 0.92rem; font-weight: 400; line-height: 1.2; word-break: break-all; } .history-item-result { color: var(--calc-text); font-size: 1.55rem; font-weight: 400; line-height: 1.15; letter-spacing: -0.01em; }