:root {
  color: #272635;
  background: #f5f4fb;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  --ink: #272635;
  --muted: #5f5d73;
  --accent: #5035b5;
  --border: #e8e4f3;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.shell { width: min(100% - 40px, 940px); margin: 0 auto 48px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 26px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 750; }
.brand-icon {
  display: grid; place-items: center; flex: 0 0 36px; height: 36px;
  border-radius: 12px; background: #eae2ff; color: var(--accent);
}
.role { font-size: 13px; font-weight: 650; color: var(--muted); text-align: right; }
.top-nav { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px 14px; }
.back-link { color: var(--accent); font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.back-link:hover { text-decoration: underline; }
.notice { margin: 0 0 14px; border-radius: 12px; background: #eae3ff; padding: 12px 16px; overflow-wrap: anywhere; }
.notice.error { background: #fbe6e7; color: #842928; }
.balance {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: clamp(24px, 5vw, 42px); border-radius: 26px; margin-bottom: 16px;
  background: linear-gradient(110deg, #3d288f, #6245c5); color: #fff;
}
.balance h1 { margin: 0 0 4px; font-size: 16px; font-weight: 650; color: #f0eaff; }
.balance output { display: block; font-size: clamp(39px, 9vw, 66px); font-weight: 750; line-height: 1.1; letter-spacing: -.04em; }
.star {
  display: grid; place-items: center; width: clamp(46px, 11vw, 94px); aspect-ratio: 1;
  border-radius: 28%; background: #ffffff21; color: #ffeea8; font-size: clamp(28px, 6vw, 57px);
}
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 16px; }
#parent-operations { display: grid; gap: 16px; }
.card { background: #fff; border: 1px solid var(--border); border-radius: 22px; padding: clamp(18px, 4vw, 26px); min-width: 0; }
.gate { max-width: 440px; margin-inline: auto; }
.gate h1 { margin: 0 0 8px; font-size: 26px; letter-spacing: -.02em; }
.gate p { margin: 0 0 18px; color: var(--muted); }
h2 { margin: 0 0 14px; font-size: 20px; letter-spacing: -.02em; }
.subtle { color: var(--muted); font-size: 14px; line-height: 1.55; margin: -5px 0 12px; }
form { display: grid; gap: 13px; }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 650; }
input, select, button, .button { font: inherit; border-radius: 10px; min-height: 44px; }
input, select { width: 100%; padding: 9px 10px; border: 1px solid #d9d4e7; background: #fff; color: var(--ink); font-size: 16px; }
.form-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(80px, 1fr); gap: 10px; }
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.check input { width: 19px; min-height: auto; height: 19px; accent-color: var(--accent); }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  border: 1px solid transparent; background: var(--accent); color: #fff;
  padding: 9px 13px; font-weight: 650; text-decoration: none; cursor: pointer;
}
button:disabled { opacity: .55; cursor: wait; }
.secondary { color: #452e9a; background: #f1ecff; border-color: #e6dcff; }
:focus-visible { outline: 3px solid #916eef; outline-offset: 2px; }
.rates { display: grid; grid-template-columns: 1fr auto; margin: 0; font-size: 14px; }
.rates dt, .rates dd { padding: 7px 0; border-bottom: 1px solid var(--border); }
.rates dt { padding-right: 10px; }
.rates dd { margin: 0; font-weight: 750; text-align: right; white-space: nowrap; }
.rates > :nth-last-child(-n+2) { border-bottom: 0; }
.history ul { list-style: none; padding: 0; margin: 0; }
.history li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--border); }
.history strong { font-size: 14px; overflow-wrap: anywhere; }
.history small { display: block; color: var(--muted); margin-top: 2px; }
.credit { color: #1f714f; font-weight: 750; white-space: nowrap; }
.debit { color: #9a392f; font-weight: 750; white-space: nowrap; }
#qr { display: block; border: 1px solid var(--border); border-radius: 10px; margin: 0 auto 12px; }
.share-links { display: grid; gap: 8px; margin-bottom: 14px; }
#pin-form { margin-top: 10px; }
.logout { margin-top: 16px; }
@media (max-width: 640px) {
  .shell { width: calc(100% - 28px); }
  .top { padding: 18px 0; }
  .brand { font-size: 16px; }
  .columns, #parent-operations { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .balance { margin-bottom: 12px; border-radius: 22px; }
}
