:root{
  --bg: #0f1115;
  --panel: #151923;
  --border: #1f2633;
  --text: #e6eaf2;
  --muted: #8c96a8;
  --accent: #4f8cff;
  --op: #ffb547;
  --eq: #35c759;
}

body.light {
  --bg:#f5f7fb;
  --panel:#ffffff;
  --border:#e9eef5;
  --text:#161b22;
  --muted:#6b7280;
  --accent:#3b82f6;
  --op:#f59e0b;
  --eq:#10b981;
}

*{box-sizing:border-box;margin:0;padding:0;}

/* body{
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height:100vh;
  display:flex;
  justify-content:center;
  align-items:center;
  padding:20px;
}

.app{
  display:grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap:20px;
  width:100%;
  max-width:800px;
}

.calc{
  background: var(--panel);
  border:1px solid var(--border);
  border-radius:16px;
  padding:16px;
  display:grid;
  gap:14px;
}

.top-bar{
  display:flex;
  justify-content:flex-end;
}

.theme-btn{
  background:transparent;
  border:none;
  font-size:20px;
  cursor:pointer;
  color:var(--muted);
}

.display{
  background:rgba(0,0,0,0.2);
  border-radius:12px;
  padding:30px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.history{
  font-size:14px;
  color:var(--muted);
  min-height:18px;
}

.screen{
  font-size:32px;
  text-align:right;
}

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

.key{
  background:#1d2230;
  border:1px solid var(--border);
  border-radius:10px;
  padding:14px;
  font-size:18px;
  cursor:pointer;
  color:var(--text);
}

.key-fn{ color: var(--muted);}
.key-op{ color: var(--op);}
.key-eq{ background: var(--eq); color:white;}
.key-wide{ grid-column: span 2;}
.key-ghost{ background: transparent; border:none; color: var(--muted); }

.tape{
  background: var(--panel);
  border:1px solid var(--border);
  border-radius:16px;
  padding:12px;
  overflow-y:auto;
  max-height:500px;
}

.tape h2{
  font-size:16px;
  margin-bottom:10px;
}

.tape ul{
  list-style:none;
  display:flex;
  flex-direction:column;
  gap:6px;
}

.tape li{
  font-size:14px;
  color:var(--text);
  border-bottom:1px dashed var(--border);
  padding-bottom:4px;
}


---
/* Small phones: make buttons taller and text slightly bigger */
@media (max-width: 380px){
  .key{ padding: 16px 12px; font-size: 24px; }
  .screen{ font-size: 38px; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  .key{ transition: none; }
}


.tape-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:10px;
}

.clear-btn{
  background: var(--accent);
  border:none;
  color:white;
  font-size:13px;
  padding:4px 10px;
  border-radius:6px;
  cursor:pointer;
  transition: background 0.2s ease;
}

.clear-btn:hover{
  background: color-mix(in srgb, var(--accent) 80%, black);
}


/* Optional: special style for memory keys */
.key-fn[data-action^="m"] {
  background: #222a35;
  color: var(--accent);
}

.memory-indicator{
  font-size: 14px;
  color: var(--accent);
  text-align: right;
  margin-bottom: 8px;
  min-height: 18px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.memory-indicator:hover{
  opacity: 0.7;
}

.memory-indicator.hidden {
  display: none;
} */




body {
  margin: 0;
  height: 100vh;
  display: flex;
  justify-content: center;   /* horizontal */
  align-items: center;       /* vertical */
  background: #222;
}





body {
  font-family: Arial, sans-serif;
  margin-top: 60px;
  height: 120vh;               
  display: flex;               
  justify-content: center;     
  align-items: center;        

  font-family: Arial, sans-serif;
  color: white;
}

.app {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  
}





.calc {
  background: #333;
  padding: 20px;
  border-radius: 12px;
  /* box-shadow: 0 0 15px rgba(0,0,0,0.5); */
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  width: 320px;

}

/* .display {
  background: black;
  color: lime;
  font-size: 2em;
  padding: 20px;
  margin-bottom: 10px;
  text-align: right;
  border-radius: 8px;
} */

.display {
  background: #000;
  color: #0f0;
  text-align: right;
  padding: 5px;
  border-radius: 8px;
  /* margin-bottom: 15px; */
  font-family: monospace;
}

.history {
  /* font-size: 1rem; */
  /* opacity: 0.7; */
  /* min-height: 1em; */
}

.screen {
  font-size: 2rem;
  font-weight: bold;
  min-height: 1em;
}


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

.key {
  background: #555;
  border: none;
  padding: 15px;
  border-radius: 8px;
  color: white;
  font-size: .9em;
  cursor: pointer;
}

.key:hover {
  background: #777;
}

.key-eq {
  background: #28a745;
}

.key-eq:hover {
  background: #218838;
}

.key-wide {
  /* grid-column: span 2; */
}

.tape {
  background: #444;
  padding: 15px;
  border-radius: 12px;
  width: 200px;
  height: 400px;
  overflow-y: auto;
}
