:root{
  --bg:#000;
  --text:#f5f5f5;
  --green:#2eea5a;
  --gold:#f0c777;
  --shadow: 0 10px 25px rgba(0,0,0,.45);
  --r: 28px;
  --w: min(520px, 94vw);
  --fn:#a9a9a9;
  --op:#f3a118;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background: radial-gradient(1200px 900px at 20% -10%, #171717 0%, #070707 40%, #000 75%);
  color:var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}

.screen{ width: var(--w); margin: 0 auto; padding: 18px 14px 16px; }

.top{ display:flex; align-items:flex-start; justify-content:space-between; gap:14px; padding-top:6px; }

.title{ font-weight:800; font-size: clamp(26px, 6vw, 36px); line-height:1.1; }

.stamp{ margin-top:6px; font-weight:800; letter-spacing:.4px; }
.date,.time{ color:var(--green); font-size: clamp(20px, 5.5vw, 30px); line-height:1.06; }

.actions{ display:flex; gap:10px; margin-top:4px; }
.iconbtn{
  width:54px; height:54px; border-radius:18px;
  background:#2b2b2b; border:0; box-shadow:var(--shadow);
  display:grid; place-items:center;
}
.iconbtn svg{ width:26px; height:26px; fill:#f1d2a0; opacity:.95; }
.iconbtn:active{ transform: translateY(1px); }

.rates{ margin-top:18px; display:flex; flex-direction:column; gap:14px; }
.rateRow{ display:flex; gap:14px; align-items:center; }

.pill{
  border-radius: var(--r);
  box-shadow: var(--shadow);
  background: linear-gradient(#3b3b3b, #2f2f2f);
  height:76px; display:flex; align-items:center;
}

.leftPill{ width:148px; justify-content:flex-start; padding:0 16px; gap:12px; }
.flag{
  width:42px; height:42px; border-radius:50%;
  display:grid; place-items:center; font-size:26px;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.35));
}
.code{ font-weight:800; font-size:30px; letter-spacing:.6px; color:#d8d8d8; }

.rightPill{ flex:1; justify-content:flex-end; padding:0 22px; }
.value{ font-weight:900; font-size: clamp(44px, 9vw, 62px); letter-spacing:.5px; color:#efefef; }

.rateRow.sel .leftPill,
.rateRow.sel .rightPill{ background: linear-gradient(#4c4027, #3e341f); }
.rateRow.sel .code,
.rateRow.sel .value{ color: var(--gold); }

.calc{ margin-top:18px; }
.keys{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; }
.k{
  border:0; border-radius:999px; height:70px;
  font-size:30px; font-weight:800;
  color:#f1f1f1; background:#2e2e2e; box-shadow:var(--shadow);
  touch-action: manipulation;
}
.k.fn{ background: var(--fn); color:#1a1a1a; }
.k.op{ background: var(--op); color:#171717; }
.k.zero{ grid-column: 1 / span 2; }
.k.eq{ font-size:34px; }
.k:active{ transform: translateY(1px); }

@media (max-width: 380px){
  .iconbtn{ width:50px; height:50px; border-radius:16px; }
  .pill{ height:72px; }
  .leftPill{ width:140px; }
  .code{ font-size:28px; }
  .k{ height:66px; font-size:28px; }
}

/* rates sheet */
.sheet{
  position:fixed; inset:0; background: rgba(0,0,0,.55);
  display:none; align-items:flex-end; justify-content:center; padding:18px;
}
.sheet.show{ display:flex; }
.sheetCard{ width:min(520px,96vw); background:#111; border-radius:24px; box-shadow:var(--shadow); padding:16px 16px 14px; }
.sheetTitle{ font-weight:900; font-size:18px; margin-bottom:8px; }
.sheetBody{ color:#ddd; font-size:14px; line-height:1.35; max-height:44vh; overflow:auto; background:#0b0b0b; border-radius:16px; padding:12px; white-space:pre-line; }
.sheetClose{ margin-top:12px; width:100%; height:44px; border:0; border-radius:16px; font-weight:900; background:var(--op); color:#111; }

button{ -webkit-tap-highlight-color: transparent; user-select:none; }
