@import url('https://fonts.googleapis.com/css2?family=Kantumruy+Pro:wght@400;500;600;700&display=swap');

:root {
  color-scheme: dark;
  --bg: #0c1213;
  --panel: #141c1d;
  --line: #293635;
  --text: #edf5f1;
  --muted: #a6b8b2;
  --accent: #7be7bb;
  --dark-accent: #0b311f;
  font-family: "Kantumruy Pro", Tahoma, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--bg); line-height: 1.65; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { appearance: none; cursor: pointer; border: 1px solid transparent; border-radius: .7rem; padding: .6rem .9rem; background: var(--accent); color: #092317; font-weight: 700; }
button:disabled { cursor: wait; opacity: .55; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: var(--accent); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.45rem, 4vw, 2.15rem); }
h2 { font-size: 1.22rem; }
h3 { font-size: 1rem; }
[dir=ltr] { text-align: start; }
.shell { max-width: 73rem; margin: auto; padding: 0 clamp(.85rem, 4vw, 2.3rem) 4rem; }
.mast { min-height: 4.55rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: 1.5rem; }
.brand, .mast-tools, .profile, .section-head, .row, .actions { display: flex; align-items: center; gap: .7rem; }
.brand { font-size: 1.2rem; }
.brand-mark { display: grid; place-items: center; background: #1a332b; color: var(--accent); border-radius: .8rem; width: 2.25rem; height: 2.25rem; font-size: 1.4rem; }
.mast-tools, .actions, .row { flex-wrap: wrap; }
.quiet, .tabs button { background: #1b2827; color: var(--text); border-color: var(--line); }
.tabs { display: flex; overflow: auto; gap: .5rem; padding: .25rem .15rem .65rem; }
.tabs button { white-space: nowrap; padding: .5rem .8rem; }
.tabs button[aria-pressed=true] { background: #193b2e; color: var(--accent); border-color: #478267; }
.stack { display: grid; gap: 1rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: .9rem; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.card, .empty, .stat, .balance { border: 1px solid var(--line); border-radius: 1rem; padding: clamp(.85rem, 3vw, 1.3rem); background: var(--panel); min-width: 0; overflow-wrap: anywhere; }
.balance { background: linear-gradient(118deg, #182e29, #163e30 60%, #1b5140); border-color: #396553; }
.balance strong { display: block; font-size: clamp(1.5rem, 7.5vw, 2.65rem); }
.tag { color: var(--accent); background: #1c362c; border-radius: .55rem; padding: .18rem .48rem; font-size: .82rem; width: fit-content; }
.stat strong { display: block; font-size: clamp(1.1rem, 3.8vw, 1.55rem); }
.stat span, .muted, label span { color: var(--muted); }
.profile { align-items: flex-start; }
.avatar { border-radius: 50%; display: grid; place-items: center; flex: 0 0 3rem; width: 3rem; height: 3rem; object-fit: cover; background: #213e35; color: var(--accent); font-weight: 700; }
.section-head { justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: .6rem; }
.details { white-space: pre-wrap; }
.card .actions { margin-top: .25rem; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: .8rem; }
label { display: grid; gap: .24rem; }
input, select, textarea { min-width: 0; width: 100%; color: var(--text); background: #0f1718; border: 1px solid #354441; border-radius: .65rem; padding: .62rem .7rem; }
textarea { resize: vertical; }
.entries { list-style: none; padding: 0; margin: 0; }
.entries li { border-top: 1px solid var(--line); padding: .8rem 0; }
.entries li:first-child { border-top: 0; }
#toast { position: fixed; z-index: 2; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: calc(100% - 2rem); border: 1px solid #4a8770; background: #17362c; border-radius: .85rem; padding: .75rem 1rem; box-shadow: 0 .45rem 1.8rem #0008; white-space: pre-line; }
.error { color: #ffb5ab; }
@media (max-width: 42rem) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
