:root {
  color-scheme: light;
  --ink: #2a1810;
  --paper: #f4efe6;
  --panel: #fffdf8;
  --line: #d8cfc2;
  --key: #efe6d8;
  --op: #7a3b2e;
  --op-ink: #fffaf4;
  --eq: #2f5d3a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

.wrap {
  width: min(22rem, calc(100vw - 2rem));
}

.kicker {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b5748;
}

h1 {
  margin: 0 0 1rem;
  font-size: 1.35rem;
  font-weight: 650;
}

.calc {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 14px 30px rgba(42, 24, 16, 0.08);
}

.display {
  min-height: 4.1rem;
  margin-bottom: 0.85rem;
  padding: 0.85rem 0.95rem;
  border-radius: 10px;
  background: #2a1810;
  color: #fff6ea;
  font-size: 2rem;
  line-height: 1.2;
  text-align: right;
  overflow: hidden;
}

.keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
}

button {
  appearance: none;
  border: 0;
  border-radius: 10px;
  min-height: 3.1rem;
  font: inherit;
  font-size: 1.15rem;
  cursor: pointer;
  background: var(--key);
  color: var(--ink);
}

button:hover { filter: brightness(0.97); }
button:focus-visible { outline: 2px solid var(--op); outline-offset: 2px; }

.op {
  background: var(--op);
  color: var(--op-ink);
}

.eq {
  background: var(--eq);
  color: #f4fff6;
}

.wide { grid-column: span 2; }

.note {
  margin: 0.85rem 0 0;
  font-size: 0.82rem;
  color: #6b5748;
}

.note a { color: inherit; }
