/* Calculator page: the machine (inputs + display) and the paper tape (results). */ .desk { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; max-width: 1200px; margin: 0 auto; padding: 4px max(16px, env(safe-area-inset-right)) 48px max(16px, env(safe-area-inset-left)); } @media (min-width: 900px) { .desk { grid-template-columns: minmax(360px, 440px) minmax(0, 1fr); gap: 28px; align-items: start; } .machine { position: sticky; top: 16px; } } @media (min-width: 1180px) { .desk { grid-template-columns: 460px minmax(0, 1fr); gap: 40px; } } /* ---- machine ---- */ .machine { background: linear-gradient(180deg, var(--machine-hi) 0%, var(--machine) 120px, var(--machine-lo) 100%); color: var(--machine-ink); border-radius: var(--radius-l); box-shadow: var(--shadow-machine); padding: 18px 18px 20px; } .machine :focus-visible { outline-color: var(--focus); } @media (min-width: 480px) { .machine { padding: 22px 24px 24px; } } @media (max-width: 299px) { .machine { padding: 14px 12px 16px; } .tape { padding-left: 12px; padding-right: 12px; } } .machine-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; margin-bottom: 14px; } .machine-head h1 { font-size: 1.15rem; font-weight: 750; font-stretch: 92%; letter-spacing: .005em; } .machine-head p { font-size: .85rem; color: var(--machine-muted); } /* display */ .display { background: var(--display); border-radius: 14px; padding: 14px 16px 14px; box-shadow: inset 0 3px 10px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.04), 0 1px 0 rgba(255,255,255,.1); color: var(--display-ink); outline: none; } .display-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 10px; min-height: 24px; } .display-label { font-size: .8rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--display-dim); } .display-flag { font-size: .75rem; font-weight: 650; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--display-line); color: var(--display-dim); white-space: nowrap; } .display-flag:empty { display: none; } .display-value { display: block; font-size: clamp(2.1rem, 9vw, 2.9rem); font-weight: 800; font-stretch: 78%; line-height: 1.05; letter-spacing: -.01em; text-align: right; margin: 6px 0 10px; white-space: nowrap; /* never split a number; app.js shrinks the size to fit */ overflow: hidden; transition: color .2s; } .display.is-off .display-value { color: var(--display-dim); opacity: .7; } .display-sub { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding-top: 10px; border-top: 1px dashed var(--display-line); } .display-sub div { flex: 1 0 auto; min-width: 0; } /* grow, never shrink below the number */ .display-sub dt { font-size: .72rem; color: var(--display-dim); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; } .display-sub dd { margin: 2px 0 0; font-weight: 700; font-size: .98rem; font-stretch: 88%; white-space: nowrap; } .display-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 9px 11px; border-radius: 9px; background: rgba(255, 230, 160, .1); color: var(--display-ink); font-size: .86rem; line-height: 1.45; } .display-note[hidden] { display: none; } .display-note .icon { margin-top: 2px; color: var(--gold); } /* inputs */ .keys { margin-top: 18px; display: grid; gap: 18px; } .field { margin: 0; padding: 0; border: 0; min-width: 0; } .field > label, .field > legend { display: block; padding: 0; margin-bottom: 8px; font-size: .82rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--machine-muted); } .entry { display: flex; align-items: center; gap: 8px; background: var(--display); border-radius: 12px; padding: 0 14px; box-shadow: inset 0 2px 6px rgba(0,0,0,.5), 0 1px 0 rgba(255,255,255,.08); border: 2px solid transparent; transition: border-color .15s; } .entry:focus-within { border-color: var(--gold); } .entry.is-invalid { border-color: #ff8a7a; } .entry-prefix { font-weight: 700; color: var(--display-dim); font-size: 1.1rem; } .entry input { flex: 1; min-width: 0; height: 56px; border: 0; background: transparent; outline: none; color: var(--display-ink); caret-color: var(--gold); font-size: 1.55rem; font-weight: 750; font-stretch: 85%; text-align: right; letter-spacing: .01em; } .help { margin-top: 7px; font-size: .84rem; color: var(--machine-muted); } .field-error { margin-top: 7px; font-size: .86rem; color: #ffb4a8; font-weight: 600; } .field-error[hidden] { display: none; } .quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; } @media (min-width: 360px) { .quick { grid-template-columns: repeat(6, 1fr); } } .chip { min-height: 36px; padding: 0 4px; border-radius: 8px; white-space: nowrap; border: 1px solid var(--machine-line); background: rgba(255,255,255,.04); color: var(--machine-ink); font-size: .86rem; font-weight: 600; transition: background-color .15s, border-color .15s; } .chip:hover { background: rgba(255,255,255,.1); border-color: var(--machine-muted); } .chip[aria-pressed="true"] { background: rgba(242,193,78,.16); border-color: var(--gold); color: var(--gold-hi); } @media (pointer: coarse) { .chip { min-height: 44px; } } /* segmented keys */ .segmented { display: grid; gap: 6px; } .seg-tenor { grid-template-columns: repeat(auto-fit, minmax(48px, 1fr)); } .seg-cust { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); } .seg { position: relative; display: grid; } .seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; } .seg-face { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 52px; padding: 6px 4px 5px; border-radius: 10px; background: var(--key); color: var(--key-ink); box-shadow: inset 0 -3px 0 var(--key-edge); font-weight: 650; text-align: center; line-height: 1.15; user-select: none; transition: background-color .15s, color .15s, transform .08s, box-shadow .08s; } .seg-cust .seg-face { flex-direction: row; min-height: 48px; font-size: .95rem; } .seg-num { font-size: 1.2rem; font-weight: 800; font-stretch: 85%; } .seg-unit { font-size: .7rem; font-weight: 600; opacity: .8; } .seg-tag { font-size: .62rem; font-weight: 600; opacity: .75; margin-top: 1px; } .seg:hover .seg-face { background: var(--key-hi); } .seg input:checked + .seg-face { background: var(--gold); color: var(--gold-ink); box-shadow: inset 0 -2px 0 var(--gold-edge); transform: translateY(1px); } .seg input:focus-visible + .seg-face { outline: 3px solid var(--focus); outline-offset: 2px; } .seg input:active + .seg-face { transform: translateY(2px); box-shadow: inset 0 -1px 0 var(--key-edge); } .machine-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-top: 4px; } .machine-actions .key { min-width: 0; padding: 0 10px; text-align: center; line-height: 1.2; } @media (max-width: 279px) { .machine-actions { grid-template-columns: minmax(0, 1fr); } } .machine-actions .key-gold { grid-column: 1 / -1; min-height: 52px; font-size: 1rem; } .toast { min-height: 1.2em; font-size: .86rem; color: var(--gold-hi); text-align: right; margin-top: -6px; } .model-note { font-size: .82rem; line-height: 1.4; padding: 8px 10px; border-radius: 8px; background: var(--warn-bg); color: #3b2600; border: 1px solid #e7c271; } .tape-verify { font-weight: 600; color: var(--paper-ink, inherit); } /* ---- tape ---- */ .tape-wrap { position: relative; min-width: 0; max-width: 720px; width: 100%; justify-self: center; } @media (min-width: 900px) { .tape-wrap { justify-self: start; } } .tape-slot { height: 14px; margin: 0 -6px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--machine-lo), var(--machine)); box-shadow: inset 0 -4px 6px rgba(0,0,0,.45); } .tape { --zig: 9px; position: relative; margin: -6px 6px 0; background: var(--paper); color: var(--paper-ink); padding: 22px clamp(16px, 4vw, 30px) calc(26px + var(--zig)); box-shadow: var(--shadow-paper); /* torn zig-zag bottom edge */ -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - var(--zig)) no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(var(--zig) * 2) var(--zig) repeat-x; mask: linear-gradient(#000 0 0) top / 100% calc(100% - var(--zig)) no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(var(--zig) * 2) var(--zig) repeat-x; font-family: var(--font-tape); font-size: .86rem; line-height: 1.55; } .tape ::selection { background: var(--paper-hilite); color: var(--paper-ink); } .tape :focus-visible { outline-color: var(--focus-on-light); } .tape.is-feeding { animation: feed .32s var(--ease-out); } @keyframes feed { from { transform: translateY(-10px); } to { transform: none; } } .tape h2, .tape h3 { font-family: var(--font-ui); } .tape-head { text-align: center; padding-bottom: 14px; border-bottom: 1px dashed var(--paper-rule); } .tape-logo { justify-content: center; margin-bottom: 12px; } .tape-logo .logo { height: 34px; } .tape-head h2 { font-size: 1.08rem; font-weight: 800; font-stretch: 90%; letter-spacing: .04em; text-transform: uppercase; color: var(--paper-accent); } .tape-meta { color: var(--paper-muted); font-size: .8rem; margin-top: 2px; } .lines-input { margin-top: 12px; text-align: left; } .tape-sec { padding: 16px 0; border-bottom: 1px dashed var(--paper-rule); } .tape-sec h3 { font-size: .95rem; font-weight: 750; color: var(--paper-ink); margin-bottom: 10px; } /* label .......... value lines */ .lines { margin: 0; display: grid; gap: 4px; } /* receipt row: the value always stays in the right column on the same row; when space runs out the label wraps and the value aligns with its last line */ .lines div { display: flex; flex-wrap: nowrap; align-items: flex-end; column-gap: 8px; min-width: 0; } .lines dt { color: var(--paper-muted); flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; line-height: 1.4; order: 0; } .lines dd { order: 2; flex: none; margin: 0 0 0 auto; text-align: right; white-space: nowrap; font-weight: 600; color: var(--paper-ink); line-height: 1.4; } /* dotted leader between label and value, like a printed receipt */ .lines div::after { content: ""; order: 1; flex: 1 1 10px; min-width: 10px; align-self: flex-end; border-bottom: 1px dotted var(--paper-rule); margin-bottom: .45em; } .lines .is-strong::after, .lines .is-group::after { border-bottom-color: transparent; } .lines .is-strong dt, .lines .is-strong dd { color: var(--paper-ink); font-weight: 800; } .lines .is-strong { padding: 6px 0; border-top: 1px solid var(--paper-ink); border-bottom: 1px solid var(--paper-ink); margin: 4px 0; font-size: 1.02rem; } .lines .is-sub dt { padding-left: 14px; } .lines .is-neg dd { color: var(--bad); } .lines .is-group { margin-top: 10px; } .lines .is-group dt { color: var(--paper-ink); font-weight: 700; font-family: var(--font-ui); } .lines-total { font-size: .92rem; } @media (max-width: 420px) { .tape { font-size: .8rem; } .lines-total { font-size: .86rem; } .lines .is-strong { font-size: .94rem; } } .lines dt .formula { display: block; font-size: .74rem; color: var(--paper-muted); opacity: .9; } /* comparison rows */ .cmp { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; } .cmp-row { padding: 11px 12px 12px; border-radius: 10px; border: 1px solid var(--paper-rule); background: color-mix(in srgb, var(--paper) 92%, var(--paper-rule)); } .cmp-row.is-best { border-color: var(--paper-accent); background: var(--paper); box-shadow: inset 0 0 0 1px var(--paper-accent); } .cmp-row.is-dep { border-style: dashed; background: transparent; } .cmp-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; } .cmp-name { font-family: var(--font-ui); font-weight: 750; font-size: .98rem; display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; } .cmp-tag { font-family: var(--font-ui); font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 7px; border-radius: 999px; background: var(--paper-accent); color: #fff; } .cmp-row.is-dep .cmp-tag { background: transparent; color: var(--paper-muted); border: 1px solid var(--paper-rule); } .cmp-total { font-weight: 800; font-size: clamp(.86rem, 4.2vw, 1.08rem); margin-left: auto; white-space: nowrap; } .cmp-bar { height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--paper-rule) 45%, transparent); margin: 8px 0 9px; overflow: hidden; display: flex; } .cmp-bar i { display: block; height: 100%; background: var(--bar); } .cmp-bar i + i { background: var(--gold); } .cmp-row.is-dep .cmp-bar i { background: var(--bar-dep); } .cmp-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; font-size: .82rem; } .cmp-meta div { display: flex; flex-direction: column; gap: 0; flex: 1 0 auto; min-width: 84px; } .cmp-meta dt { color: var(--paper-muted); font-size: .72rem; } .cmp-meta dd { margin: 0; font-weight: 600; white-space: nowrap; } .cmp-diff { margin-top: 6px; font-size: .8rem; font-weight: 700; } .cmp-diff.up { color: var(--good); } .cmp-diff.down { color: var(--bad); } .legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .76rem; color: var(--paper-muted); margin: -2px 0 10px; } .legend span { display: inline-flex; align-items: center; gap: 6px; } .legend i { width: 10px; height: 10px; border-radius: 2px; background: var(--bar); } .legend i.cb { background: var(--gold); } .tape-note { font-size: .76rem; color: var(--paper-muted); margin-top: 10px; line-height: 1.5; } .tape-details summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; min-height: 44px; margin: -8px 0; } .tape-details summary::-webkit-details-marker { display: none; } .tape-details summary h3 { margin: 0; display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; } .tape-details summary .chev { transition: transform .2s var(--ease-out); color: var(--paper-muted); } .tape-details[open] summary .chev { transform: rotate(180deg); } .tape-details[open] summary { margin-bottom: 8px; } .tape-details summary:hover h3 { text-decoration: underline; text-underline-offset: .25em; } .calc-block + .calc-block { margin-top: 14px; } .calc-block h4 { font-family: var(--font-ui); font-size: .85rem; font-weight: 750; margin: 0 0 4px; color: var(--paper-accent); } .tape-foot { padding-top: 14px; text-align: center; color: var(--paper-muted); font-size: .76rem; display: grid; gap: 2px; } /* mini display (phones, when the main display scrolled away) */ .mini-display { position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 20; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 14px; background: var(--display); color: var(--display-ink); box-shadow: 0 12px 30px -10px rgba(0,0,0,.55); transform: translateY(140%); transition: transform .25s var(--ease-out); } .mini-display.is-shown { transform: none; } .mini-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--display-dim); font-weight: 650; } .mini-value { font-weight: 800; font-size: 1.2rem; font-stretch: 82%; } .mini-equiv { margin-left: auto; font-size: .85rem; color: var(--display-dim); font-weight: 600; } @media (min-width: 900px) { .mini-display { display: none; } } @media (max-width: 899px) { .page-calc { padding-bottom: 76px; } } /* error page */ .desk-error { display: block; } .panel-error { display: flex; gap: 14px; max-width: 640px; margin: 40px auto; padding: 20px; border-radius: var(--radius-m); background: var(--warn-bg); color: #3b2600; border: 1px solid #e7c271; } .panel-error .icon { width: 24px; height: 24px; color: var(--warn); margin-top: 2px; } .panel-error h1 { font-size: 1.15rem; margin-bottom: 6px; } /* ---- print: only the tape ---- */ @media print { @page { margin: 12mm; } body { background: #fff; } .topbar, .machine, .tape-slot, .mini-display, .skip-link { display: none !important; } .desk { display: block; padding: 0; } .tape-wrap { max-width: none; } .tape { margin: 0; box-shadow: none; -webkit-mask: none; mask: none; background: #fff; color: #000; padding: 0; font-size: 10.5pt; } .tape-details summary .chev { display: none; } .tape-logo .logo { height: 12mm; } .cmp-row { break-inside: avoid; } }