:root {
  color-scheme: light;
  --bg: #f8fafc;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #2563eb;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --ok: #16a34a;
  --warning: #d97706;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.app-shell {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 18px 14px 40px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0 14px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.1;
}

h2 {
  margin: 22px 0 10px;
  font-size: 17px;
}

.refresh-btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 8px 20px rgb(37 99 235 / 20%);
}

.refresh-btn:disabled {
  opacity: 0.65;
}

.summary-card,
.balance-card,
.history-item {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgb(15 23 42 / 4%);
}

.summary-card {
  padding: 14px;
}

.summary-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.summary-line:last-child {
  border-bottom: 0;
}

.summary-line span,
.hint,
.meta,
.empty {
  color: var(--muted);
}

.summary-line strong {
  text-align: right;
}

.alert {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 16px;
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 700;
  line-height: 1.45;
}

.hidden {
  display: none;
}

.balance-grid {
  display: grid;
  gap: 12px;
}

.balance-card {
  padding: 16px;
}

.balance-card.low {
  border-color: #fecaca;
  background: #fff7f7;
}

.balance-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.currency {
  font-size: 16px;
  color: var(--muted);
  font-weight: 800;
}

.total {
  font-size: 34px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.low-tag,
.ok-tag {
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
}

.low-tag {
  background: #fee2e2;
  color: var(--danger);
}

.ok-tag {
  background: #dcfce7;
  color: var(--ok);
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.metric {
  border-radius: 14px;
  padding: 10px;
  background: #f8fafc;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.metric strong {
  font-size: 18px;
}

.section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  padding: 12px;
}

.history-main {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-weight: 800;
}

.history-main .amount {
  white-space: nowrap;
}

.meta {
  font-size: 12px;
  line-height: 1.45;
}

.error-text {
  color: var(--danger);
}

.ok-text {
  color: var(--ok);
}

.warning-text {
  color: var(--warning);
}

.empty {
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  text-align: center;
  background: rgb(255 255 255 / 55%);
}
