* { box-sizing: border-box; }
:root {
  font: 16px/1.45 system-ui, "Segoe UI", sans-serif;
  color: #080d4b;
  background: #eef0fa;
  --ink: #080d4b;
  --muted: #495374;
  --violet: #6925ff;
  --cobalt: #183cce;
  --accent: #5322de;
  --cyan: #00cce8;
  --line: #dedcf3;
  --soft: #f0ebff;
  --paper: #fff;
  --green: #10693f;
  --amber: #914306;
  --red: #a91c48;
}
body { margin: 0; min-height: 100vh; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid #8061ff; outline-offset: 2px;
}
button, summary { cursor: pointer; }
button:disabled { cursor: default; }
.device {
  width: min(100%, 450px); min-height: min(850px, calc(100vh - 44px)); min-height: min(850px, calc(100dvh - 44px)); margin: 22px auto;
  border: 1px solid #d5cdf6; border-radius: 24px;
  background: linear-gradient(155deg, #f8f8ff 0, #f4f2fc 270px, #f9f8fe 100%);
  box-shadow: 0 8px 26px #3e238711; position: relative;
}
#screen { padding: 13px 13px 78px; outline: none; min-height: inherit; }
header { display: flex; justify-content: space-between; align-items: center; min-height: 52px; margin-bottom: 11px; }
.headline { display: flex; align-items: center; min-width: 0; }
header > * + *, .headline > * + * { margin-inline-start: 8px; }
header h1 { margin: 0; font-size: 1.25rem; line-height: 1.2; font-weight: 750; letter-spacing: -.018em; }
h2 { font-size: 1.12rem; margin: 0; line-height: 1.3; font-weight: 730; letter-spacing: -.015em; }
h3 { font-size: 1rem; margin: 0; line-height: 1.24; }
p { margin: 0; }
p + p { margin-top: 6px; }
small, .muted { color: var(--muted); font-size: .82rem; }
strong, .amount, .result { font-variant-numeric: tabular-nums; }
.brand { display: flex; align-items: center; font-weight: 800; color: #262574; letter-spacing: -.015em; white-space: nowrap; }
.brand .mark { margin-inline-end: 7px; }
.mark {
  position: relative; display: inline-block; flex: none; width: 30px; height: 30px;
  border-radius: 26%; background: linear-gradient(135deg, #6630db, #3342bd 72%, #2754b2);
}
.mark::before, .mark::after {
  content: ""; position: absolute; top: 23%; bottom: 23%; left: 17%; right: 17%;
}
.mark::before {
  background: white;
  clip-path: polygon(0 100%, 0 0, 20% 0, 50% 43%, 80% 0, 100% 0, 100% 100%, 77% 100%, 77% 39%, 50% 77%, 23% 39%, 23% 100%);
}
.mark::after {
  background: #9deafa;
  clip-path: polygon(77% 39%, 100% 7%, 100% 100%, 77% 100%);
}
.panel, .market, .menu-list, .grid-game, .summary-box { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.panel { padding: 14px; }
.panel.tint { background: #f2efff; }
.panel.info { background: #edf7ff; border-color: #d5e9f7; }
.panel.green { background: #eef9f2; border-color: #d6eee0; }
.panel.warn { background: #fff6e9; border-color: #f9e4c5; }
.panel.bad { background: #fff1f6; border-color: #f3d9e3; }
.stack { display: grid; gap: 10px; }
.stack.large { gap: 15px; }
.row { display: flex; align-items: center; }
.row > :first-child { min-width: 0; }
.row > :not([hidden]) + :not([hidden]) { margin-inline-start: 8px; }
.between { justify-content: space-between; }
.align-end { align-items: end; }
.centered { text-align: center; }
.market-title { margin: 0; font-size: 1.15rem; }
.credit { color: var(--green); }
.form-error { border-radius: 8px; background: #fff1f6; color: var(--red); padding: 8px; font-size: .85rem; }
[aria-invalid="true"] { border-color: var(--red) !important; }
.password-row { align-items: end; }
.password-row .field { flex: 1; }
.pending-market { border-left: 4px solid var(--violet); }
.pending-market.pending-1 { border-left-color: var(--cobalt); }
.pending-market.pending-2 { border-left-color: #007e9a; }
.timer { justify-content: center; padding: 8px; color: var(--accent); font-weight: 780; background: var(--soft); border-radius: 8px; }
.entry-fields { padding: 0; border: none; min-inline-size: 0; }
.basic-nav { grid-template-columns: repeat(3, 1fr); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.grow { flex: 1; }
.right { text-align: right; }
.section-title { margin: 13px 0 7px; }
.amount { display: block; font-size: 1.75rem; line-height: 1.15; font-weight: 800; color: var(--ink); }
.amount.small { font-size: 1rem; }
.result { color: var(--cobalt); font-weight: 800; overflow-wrap: anywhere; }
.market { padding: 9px 10px; display: grid; gap: 4px; }
.market + .market { margin-top: 6px; }
.market-content { display: grid; flex: 1; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 5px; row-gap: 3px; min-width: 0; }
.market-content .right { justify-self: end; }
.market > .row > .btn { max-width: 40%; min-width: 0; }
.market h3 { overflow-wrap: anywhere; }
.market .times { font-size: .77rem; line-height: 1.4; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tag { padding: 3px 6px; border-radius: 6px; font-size: .72rem; font-weight: 733; color: #3d4265; background: #efeff8; display: inline-block; }
.tag.green { background: #e0f5e7; color: var(--green); }
.tag.warn { background: #fff0d7; color: var(--amber); }
.tag.bad { background: #fce7ee; color: var(--red); }
.tag.accent { background: #ebe4ff; color: var(--accent); }
.btn, .icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 45px; padding: 8px 10px; border: 1px solid #d1c9f2; border-radius: 9px;
  background: #fff; color: var(--accent); text-align: center; font-weight: 700;
  cursor: pointer; line-height: 1.2; overflow-wrap: anywhere;
}
.btn.primary { background: linear-gradient(106deg,#6722e7,#1c51e1 62%,#007eb4); color: #fff; border-color: transparent; }
.btn > .icon { margin-inline-end: 6px; }
.btn.tint, .icon-btn { background: #f6f2ff; }
.btn.text { border-color: transparent; background: transparent; padding-inline: 7px; }
.btn.compact { padding: 7px 8px; font-size: .82rem; }
.btn.danger, .icon-btn.danger { color: var(--red); border-color: #f0d9e5; background: #fff8fa; }
.btn[disabled] { background: #eff0f6; border-color: #dddfee; color: #6a6d84; }
.icon-btn { width: 44px; height: 44px; flex: none; font-size: 1.12rem; padding: 0; }
.icon { display: inline-block; width: 1.24em; height: 1.24em; vertical-align: -.16em; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-tile { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; color: var(--accent); background: #ede6ff; border-radius: 9px; }
.symbol { font-size: 1rem; }
.full { width: 100%; }
.discard { margin-top: 3px; }
.tabbar {
  position: absolute; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(4, 1fr);
  background: #fff; border-top: 1px solid var(--line); border-radius: 0 0 24px 24px; min-height: 61px;
}
.app-only .tabbar {
  position: fixed; z-index: 2; max-width: 450px; margin: 0 auto;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  min-height: calc(61px + env(safe-area-inset-bottom, 0px));
}
.app-only #screen { padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
.tabbar a { display: grid; justify-items: center; align-content: center; color: var(--ink); font-size: .76rem; font-weight: 650; min-height: 56px; min-width: 0; padding: 3px; text-align: center; overflow-wrap: anywhere; }
.tabbar a[aria-current] { color: var(--accent); box-shadow: inset 0 3px var(--violet); }
.tabbar .icon { font-size: 1.12rem; margin-bottom: 3px; }
.menu-list { overflow: hidden; }
.menu-item {
  min-height: 46px; width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px; justify-content: space-between; text-align: left;
  background: transparent; color: var(--ink); font-weight: 680;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:hover { background: #f6f3ff; }
.menu-item span { min-width: 0; overflow-wrap: anywhere; }
.chevron { color: var(--accent); font-size: 1.2rem; }
.field { display: grid; gap: 5px; font-weight: 650; font-size: .86rem; margin: 0; min-width: 0; }
input:not([type=checkbox]):not([type=radio]), textarea, select {
  width: 100%; max-width: 100%; min-width: 0; min-height: 46px; display: block; border: 1px solid #cbc9e6;
  border-radius: 9px; background: #fff; padding: 9px; font-weight: 500;
}
input[readonly] { background: #f0f1f7 !important; color: var(--muted); }
input[type=file] { font-size: .8rem; }
textarea { resize: vertical; min-height: 144px; }
legend { font-weight: 750; padding: 0 4px; }
fieldset { margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 11px; }
.radio { display: flex; align-items: center; min-height: 44px; padding: 7px; border-radius: 8px; background: var(--soft); font-size: .88rem; }
.rc { accent-color: var(--accent); width: 17px; height: 17px; flex: none; }
.radio > .rc { margin-inline-end: 8px; }
.segments { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(max-content, 1fr); gap: 5px; }
.segments .btn { min-height: 39px; font-size: .85rem; }
.grid-game { min-height: 68px; display: flex; align-items: center; justify-content: center; padding: 8px; text-align: center; font-weight: 700; color: var(--ink); }
.grid-game .icon-tile { width: 27px; height: 27px; margin-inline-end: 8px; }
.grid-game:hover { background: #f5f1ff; }
.digits { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.digits .btn { font-size: 1.14rem; }
.draft-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 6px; align-items: center; padding: 5px 7px; }
.draft-value { font-weight: 760; font-size: .86rem; overflow-wrap: anywhere; }
.draft-value b { color: var(--accent); }
.summary-box { display: flex; align-items: center; justify-content: space-between; padding: 8px; position: sticky; bottom: 8px; }
.summary-box > * + * { margin-inline-start: 8px; }
.value-list { margin: 0; display: grid; gap: 0; }
.value-list div { display: flex; align-items: start; justify-content: space-between; gap: 10px; padding-block: 7px; border-bottom: 1px solid var(--line); }
.value-list div:last-child { border-bottom: none; }
.value-list dt { color: var(--muted); font-size: .85rem; }
.value-list dd { margin: 0; font-weight: 710; text-align: right; overflow-wrap: anywhere; max-width: 60%; }
.listline { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.listline:last-child { border-bottom: 0; }
.listline a { font-weight: 680; }
.login-art { padding: 18px; text-align: center; }
.login-art .mark { width: 46px; height: 46px; vertical-align: middle; margin-bottom: 7px; }
.login-art h1 { font-size: 1.5rem; margin-block: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: .86rem; }
caption { text-align: left; padding: 9px; color: var(--muted); }
td, th { padding: 8px; border-bottom: 1px solid var(--line); }
th { color: var(--ink); background: var(--soft); text-align: left; }
tr:last-child td { border-bottom: 0; }
.chart-table td, .chart-table th { padding: 6px; text-align: center; }
.chart-table tbody th { white-space: nowrap; }
.chart-table td span, .chart-table tbody th span { display: block; font-size: .69rem; }
.chart-table td strong { display: block; color: var(--accent); border-radius: 5px; background: #f1edff; padding: 2px; }
.chart-table { min-width: 340px; }
.deposit-balance { display: grid; text-align: right; }
.deposit-balance strong { color: var(--cobalt); line-height: 1.12; }
#screen[data-page="add-funds"] { padding-bottom: 16px; }
.add-funds-body { gap: 8px; }
.deposit-panel { padding: 10px; }
.deposit-panel form { gap: 8px; }
.receiving-list { margin: 3px 0 0; }
.receiving-row { display: grid; grid-template-columns: minmax(76px, auto) minmax(0, 1fr) auto; align-items: center; gap: 8px; border-top: 1px solid var(--line); }
.receiving-row dt { font-size: .86rem; font-weight: 700; }
.receiving-row dd { margin: 0; overflow-wrap: anywhere; font-size: .87rem; color: var(--cobalt); font-variant-numeric: tabular-nums; }
.receiving-row .btn, .receiving-qr .btn { min-height: 38px; padding-block: 4px; }
.receiving-qr { border-top: 1px solid var(--line); padding-top: 6px; }
.receiving-qr > :not([hidden]) + :not([hidden]) { margin-inline-start: 12px; }
.receiving-qr .stack { gap: 0; justify-items: start; }
.deposit-qr { flex: none; width: min(92px, 35%); margin: 0; }
#overlay dialog { border: 1px solid var(--line); background: #fcfbff; border-radius: 18px; color: var(--ink); width: min(422px,calc(100vw - 24px)); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow: auto; padding: 14px; box-shadow: 0 8px 30px #221c5526; }
#overlay dialog::backdrop { background: #19193371; }
#overlay dialog.sheet { margin: auto auto 12px; }
#toast:not(:empty) { position: fixed; z-index: 4; left: 50%; bottom: 68px; transform: translateX(-50%); color: white; background: #23254b; padding: 8px 13px; border-radius: 8px; max-width: min(92vw,420px); }
@media (max-width: 795px) {
  .device { left: 0; margin: 8px auto; }
}
@media (max-width: 455px) {
  .device { min-height: 100vh; min-height: 100dvh; margin: 0; border: none; border-radius: 0; }
  .tabbar { border-radius: 0; }
  [data-mode="active"]:not([data-language="en"]) #screen[data-page="home"],
  [data-mode="active"]:not([data-language="en"]) #screen[data-page="charts"],
  [data-mode="active"]:not([data-language="en"]) #screen[data-page="rates"],
  [data-mode="active"]:not([data-language="en"]) #screen[data-page="account"] {
    padding-bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px));
  }
}
@media (max-width: 360px) {
  #screen { padding-inline: 9px; }
  .market-content { grid-template-columns: minmax(0, 1fr); }
  .market-content .right { justify-self: start; }
  .brand { font-size: .84rem; }
  .brand .mark { margin-inline-end: 4px; }
  .market .times { white-space: normal; }
}
