:root {
  color-scheme: light;
  --bg: #f3f5f7;
  --surface: #fff;
  --ink: #17212a;
  --muted: #52616c;
  --border: #c4ced5;
  --green: #185f48;
  --green-hover: #104c3a;
  --green-soft: #e0f0e9;
  --yellow: #ffedab;
  --yellow-ink: #594200;
  --used: #eef1f3;
  --error: #942121;
  --focus: #096db0;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 18px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Arial, Helvetica, sans-serif; line-height: 1.4; }
button, input { font: inherit; }
button { cursor: pointer; min-height: 48px; font-weight: 700; border-radius: 10px; padding: 10px 16px; transition: background-color 160ms ease-out; }
button:disabled { cursor: not-allowed; opacity: .58; }
button:active:not(:disabled) { transform: translateY(1px); }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
input { width: 100%; min-height: 56px; padding: 12px; border: 2px solid var(--border); border-radius: 10px; color: var(--ink); background: var(--surface); }
input::placeholder { color: var(--muted); }
label { display: block; font-weight: 700; margin-bottom: 8px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: 1.85rem; letter-spacing: -.025em; margin-bottom: 0; }
h2 { text-wrap: balance; }
.app { max-width: 980px; margin: auto; padding: 24px 18px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.subtitle { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.account { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.quiet { background: var(--surface); color: var(--ink); border: 2px solid var(--border); }
.quiet:hover:not(:disabled) { background: #e8edf0; }
.primary { color: white; background: var(--green); border: 2px solid var(--green); }
.primary:hover:not(:disabled) { background: var(--green-hover); }
.revert { background: var(--yellow); color: var(--yellow-ink); border: 2px solid #ba9b38; }
.revert:hover:not(:disabled) { background: #ffe38a; }
.wide { width: 100%; min-height: 60px; }
.login-panel { max-width: 440px; margin: 56px auto; padding: 26px; background: var(--surface); border: 2px solid var(--border); border-radius: 14px; }
.login-panel h2 { font-size: 1.4rem; }
.login-panel input { margin-bottom: 20px; }
.controls { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.search-box { display: flex; gap: 8px; }
.search-box input { min-width: 0; min-height: 62px; }
.filters { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 18px; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { color: var(--muted); font-size: .82rem; font-weight: 700; margin-bottom: 7px; }
.segments { display: flex; gap: 8px; flex-wrap: wrap; }
.segments button { background: var(--surface); color: var(--ink); border: 2px solid var(--border); }
.segments button[aria-pressed="true"] { background: var(--green); color: white; border-color: var(--green); }
.summary { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin: 22px 2px 12px; }
.connection { color: var(--muted); font-size: .85rem; }
.connection.online { color: var(--green); }
.list { display: grid; gap: 14px; }
.card { padding: 20px; background: var(--surface); border: 2px solid var(--border); border-radius: 14px; }
.card.used { background: var(--used); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.amount { font-size: 2.25rem; font-weight: 800; line-height: 1.1; letter-spacing: -.03em; overflow-wrap: anywhere; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.badge { padding: 6px 10px; font-size: .73rem; font-weight: 800; border-radius: 20px; background: var(--green-soft); color: var(--green); }
.used .badge { background: #dbe2e7; color: #344650; }
.badge.reverted { background: var(--yellow); color: var(--yellow-ink); }
.from { margin: 20px 0 2px; color: var(--muted); font-size: .85rem; }
.sender-name { margin: 0; font-size: 1.3rem; line-height: 1.2; overflow-wrap: anywhere; }
.phone { margin: 6px 0 0; font-size: 1.45rem; font-weight: 800; }
.destination { margin: 12px 0 0; color: var(--muted); }
.destination strong { color: var(--ink); }
.approximate { background: #fff5cc; color: #594700; border-radius: 8px; padding: 8px 10px; margin: 12px 0 0; font-size: .82rem; }
.datetime { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; border-top: 1px solid var(--border); margin-top: 18px; padding-top: 16px; font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.day { overflow-wrap: anywhere; }
.hour { margin-left: auto; white-space: nowrap; }
.used-info, .reverted-info { margin: 14px 0 0; color: #344650; font-size: .9rem; }
.card button { margin-top: 16px; }
.history-title { color: var(--muted); font-size: 1rem; margin: 26px 0 10px; }
.error { color: var(--error); margin: 12px 0; }
.error:empty, .notice:empty { display: none; }
.warning { padding: 12px; color: var(--yellow-ink); background: #fff1ba; border-radius: 8px; margin-bottom: 12px; }
.empty { padding: 28px 18px; text-align: center; color: var(--muted); border: 2px dashed var(--border); border-radius: 12px; background: var(--surface); }
.muted { color: var(--muted); font-size: .9rem; }
.more { margin-top: 18px; }
.notice { padding: 12px 16px; margin-top: 18px; color: var(--green-hover); background: var(--green-soft); border-radius: 10px; }
footer { display: flex; justify-content: center; flex-wrap: wrap; gap: 20px; margin-top: 32px; font-size: .85rem; }
a { color: var(--green); padding: 8px 0; }
dialog { max-width: min(500px, calc(100% - 24px)); border: 2px solid var(--border); border-radius: 14px; padding: 24px; color: var(--ink); }
dialog::backdrop { background: rgb(15 25 30 / .6); }
dialog p { max-width: 65ch; overflow-wrap: anywhere; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.dialog-actions button { flex: 1 1 160px; min-height: 58px; }
.skeleton { height: 210px; border-radius: 14px; background: #e3e9ed; }
@media (max-width: 700px) {
  .app { padding: 16px 10px; }
  .controls { padding: 14px; }
  .filters { flex-direction: column; gap: 14px; }
  .segments button { flex: 1 1 auto; }
  .top { align-items: flex-start; }
  .account { flex-direction: column; gap: 6px; align-items: flex-end; }
  .card { padding: 16px; }
  .amount { font-size: 2rem; }
  .datetime { font-size: 1.65rem; }
  .login-panel { margin: 30px auto; padding: 20px; }
}
@media (max-width: 390px) {
  .card-head { flex-wrap: wrap; }
  .badges { justify-content: flex-start; }
  .datetime { font-size: 1.45rem; }
  .search-box { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
