:root {
  /* Bee Protocol palette (from beeprotocol.io) */
  --forest: #06241a;
  --gold: #f6c958;          /* honey gold: fills (buttons, active tab) */
  --gold-deep: #cd9d1f;     /* deeper gold: borders, focus */
  --on-gold: #17351f;       /* text on gold */
  --brand: var(--gold-deep);
  --accent-text: #8a6a10;   /* gold that stays readable on cream */
  --brand-soft: #fbf3dc;
  --card: #fffefa;
  --card-2: #faf6e9;
  --panel: #f7f2e4;
  --line: #eadfc2;
  --card-border: rgba(205, 157, 31, .48);
  --text: #17351f;
  --muted: #6e7a6c;
  --err: #c0392b;
  --ok: #2f7a4b;
  --shadow: 0 30px 70px -25px rgba(0, 0, 0, .55);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: var(--gold); --accent-text: #f6c958; --brand-soft: rgba(246, 201, 88, .12);
    --card: #0c2c20; --card-2: #08261b; --panel: #0f3426; --line: rgba(246, 201, 88, .16);
    --card-border: rgba(246, 201, 88, .34); --text: #fff8e7; --muted: #a9b8a8; --err: #ff7b6b; --ok: #4fbf7a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: var(--gold); --accent-text: #f6c958; --brand-soft: rgba(246, 201, 88, .12);
  --card: #0c2c20; --card-2: #08261b; --panel: #0f3426; --line: rgba(246, 201, 88, .16);
  --card-border: rgba(246, 201, 88, .34); --text: #fff8e7; --muted: #a9b8a8; --err: #ff7b6b; --ok: #4fbf7a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Avenir Next", "Noto Sans", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(ellipse at 82% 8%, rgba(246, 201, 88, .22), transparent 45%),
    radial-gradient(ellipse at 12% 92%, rgba(93, 132, 104, .28), transparent 50%),
    var(--forest);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.stage { min-height: 100%; display: grid; place-items: start center; padding: 28px 16px; }
.card {
  position: relative; width: 100%; max-width: 420px;
  background: linear-gradient(145deg, var(--card), var(--card-2));
  border: 1px solid var(--card-border); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden;
}

/* header */
.card-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 6px; font-weight: 400; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; min-width: 0; white-space: nowrap; }
.brand b { color: var(--accent-text); font-weight: 700; }
.brand-logo { width: 26px; height: 22px; object-fit: contain; flex: none; }
.seg { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 3px; margin-left: auto; }
.seg-btn { border: 0; background: transparent; padding: 7px 13px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg-btn.is-on { background: var(--gold); color: var(--on-gold); }
.head-actions { display: flex; gap: 6px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 36px; min-width: 36px;
  padding: 0 8px; border: 1px solid var(--line); background: var(--card); border-radius: 10px;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { border-color: var(--brand); }
.flag { width: 22px; height: 16px; border-radius: 3px; overflow: hidden; display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--muted); }
.flag img { width: 100%; height: 100%; object-fit: cover; }
.chev { width: 14px !important; height: 14px !important; color: var(--muted); flex: none; }

/* body */
.card-body { padding: 14px 16px 6px; }
.field { display: flex; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.field:focus-within { border-color: var(--brand); }
.field-main { flex: 1; min-width: 0; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.field-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.amount { border: 0; background: transparent; outline: none; font-size: 24px; font-weight: 600; color: var(--text); padding: 2px 0; width: 100%; font-variant-numeric: tabular-nums; }
.amount-out { font-size: 20px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-btn {
  display: flex; align-items: center; gap: 8px; border: 0; border-left: 1px solid var(--line);
  background: transparent; padding: 0 14px; min-width: 140px; font-weight: 600;
}
.asset-btn:hover { background: var(--brand-soft); }
.asset-code { flex: 1; text-align: left; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-icon, .prov-logo, .li-icon {
  width: 26px; height: 26px; border-radius: 50%; flex: none; display: inline-grid; place-items: center;
  background: var(--brand-soft); color: var(--accent-text); font-size: 11px; font-weight: 700; overflow: hidden;
}
.asset-icon img, .prov-logo img, .li-icon img { width: 100%; height: 100%; object-fit: cover; }
.hint { margin: 6px 4px 10px; font-size: 12px; color: var(--muted); min-height: 15px; }
.hint.is-err { color: var(--err); }
.hint-right { text-align: right; }

.provider { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; font-size: 14px; }
.prov-logo { width: 22px; height: 22px; }
.prov-name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted { color: var(--muted); }
.provider.is-err .prov-name { white-space: normal; color: var(--err); font-weight: 500; font-size: 13px; }
[hidden] { display: none !important; }
.pill { border: 1px solid var(--brand); background: var(--brand-soft); color: var(--accent-text); border-radius: 999px; padding: 5px 10px; font-size: 13px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.pill:disabled { opacity: .5; }
.pill-dot { background: var(--gold); color: var(--on-gold); border-radius: 999px; font-size: 11px; min-width: 18px; height: 18px; display: inline-grid; place-items: center; padding: 0 5px; }
.rate { margin: 6px 4px 12px; font-size: 12px; color: var(--muted); min-height: 15px; }

.label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin: 4px 0 6px; }
.input { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); padding: 12px 14px; font-size: 15px; outline: none; }
.input:focus { border-color: var(--brand); }
.input.is-bad { border-color: var(--err); }
.select { display: flex; align-items: center; gap: 10px; text-align: left; }
.select span:nth-child(2) { flex: 1; }
.method-icon svg { width: 20px; height: 20px; display: block; }
.err { color: var(--err); font-size: 12px; margin: 5px 4px 10px; min-height: 14px; }
.err-center { text-align: center; }

.cta {
  width: 100%; border: 0; border-radius: 14px; padding: 15px; font-size: 16px; font-weight: 700; color: var(--on-gold);
  background: linear-gradient(180deg, #f8d271, var(--gold)); box-shadow: 0 8px 20px -10px rgba(205, 157, 31, .8);
  margin-top: 6px; transition: opacity .15s;
}
.cta:disabled { opacity: .45; box-shadow: none; }
.cta:not(:disabled):hover { filter: brightness(1.05); }
.fine { text-align: center; font-size: 11px; color: var(--muted); margin: 10px 0 8px; }

.card-foot { display: flex; justify-content: center; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding: 12px; font-size: 12px; color: var(--muted); }
.card-foot b { color: var(--text); }
.badge { background: var(--gold); color: var(--on-gold); border-radius: 6px; padding: 2px 6px; font-weight: 600; font-size: 11px; }

/* sheet */
.sheet { position: absolute; inset: 0; z-index: 10; display: flex; align-items: flex-end; }
.sheet[hidden] { display: none; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(3, 20, 13, .55); }
.sheet-panel {
  position: relative; width: 100%; max-height: 85%; background: linear-gradient(145deg, var(--card), var(--card-2)); border-top: 1px solid var(--card-border); border-radius: 20px 20px 0 0;
  padding: 14px 16px 16px; display: flex; flex-direction: column; animation: up .18s ease-out;
}
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sheet-head h2 { font-size: 17px; margin: 0; }
.sheet-search { margin-bottom: 8px; }
.sheet-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.sheet-list li button {
  width: 100%; display: flex; align-items: center; gap: 12px; border: 1px solid transparent; background: transparent;
  padding: 10px; border-radius: 12px; text-align: left;
}
.sheet-list li button:hover, .sheet-list li button.is-on { background: var(--panel); border-color: var(--line); }
.li-main { flex: 1; min-width: 0; }
.li-title { font-weight: 600; font-size: 14px; }
.li-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.li-right { text-align: right; font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; background: var(--gold); color: var(--on-gold); font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 5px; margin-left: 6px; vertical-align: 1px; }
.empty { color: var(--muted); text-align: center; padding: 24px; font-size: 14px; }

.toast { position: absolute; left: 50%; bottom: 70px; transform: translateX(-50%); background: var(--text); color: var(--card); padding: 9px 14px; border-radius: 10px; font-size: 13px; z-index: 20; white-space: nowrap; }

.shimmer { color: transparent !important; background: linear-gradient(90deg, var(--line), var(--panel), var(--line)); background-size: 200% 100%; animation: sh 1.2s infinite linear; border-radius: 6px; }
@keyframes sh { to { background-position: -200% 0; } }

/* order page */
.status-list { list-style: none; padding: 0; margin: 10px 0 16px; }
.status-list li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; color: var(--muted); }
.status-list li .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; }
.status-list li.done { color: var(--text); }
.status-list li.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.status-list li.now .dot { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.status-list li.fail .dot { background: var(--err); border-color: var(--err); color: #fff; }
.status-list .dot svg { width: 12px; height: 12px; stroke-width: 3; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; word-break: break-all; }
.center { text-align: center; }
a.cta { display: block; text-align: center; text-decoration: none; }

@media (max-width: 420px) {
  .stage { padding: 0; }
  .card { border-radius: 0; min-height: 100vh; box-shadow: none; }
  .asset-btn { min-width: 118px; padding: 0 10px; }
  .seg-btn { padding: 7px 12px; }
  .pill .see { display: none; }
  .pill { text-transform: capitalize; }
}

/* language menu */
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; list-style: none; margin: 0; padding: 6px;
  min-width: 180px; background: linear-gradient(145deg, var(--card), var(--card-2)); border: 1px solid var(--card-border);
  border-radius: 14px; box-shadow: var(--shadow);
}
.menu button {
  width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: transparent;
  padding: 8px 10px; border-radius: 10px; font-size: 14px; text-align: left;
}
.menu button:hover, .menu button[aria-checked="true"] { background: var(--panel); }
.menu-flag { width: 20px; height: 20px; border-radius: 50%; overflow: hidden; display: inline-grid; place-items: center; font-size: 9px; font-weight: 700; background: var(--brand-soft); flex: none; }
.menu-flag img { width: 100%; height: 100%; object-fit: cover; }
.menu-check { width: 16px; height: 16px; margin-left: auto; color: var(--accent-text); }

/* sheet extras */
.sheet-sub { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.sheet-tools { display: flex; gap: 8px; margin-bottom: 8px; }
.sheet-tools .sheet-search { margin-bottom: 0; flex: 1; min-width: 0; }
.sheet-filter { flex: 0 0 42%; min-width: 0; padding-right: 8px; cursor: pointer; }
.net-tag { display: inline-block; font-size: 9.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent-text); background: var(--brand-soft); border: 1px solid var(--card-border); border-radius: 5px;
  padding: 1px 5px; margin-left: 6px; vertical-align: 2px; }
.na-tag { font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--accent-text);
  border: 1px solid var(--card-border); border-radius: 6px; padding: 2px 6px; white-space: nowrap; }
.sheet-list li button:disabled { opacity: .5; cursor: not-allowed; }
.sheet-list li button:disabled:hover { background: transparent; border-color: transparent; }
.memo-hint { margin-top: 6px; line-height: 1.4; }
#methodIcon img { width: 22px; height: 22px; object-fit: contain; display: block; }

/* stacked wordmark: BEE over PROTOCOL */
#brandName { display: flex; flex-direction: column; line-height: 1.05; font-size: 11px; letter-spacing: .16em; }
#brandName b { font-size: 13px; letter-spacing: .2em; }
.brand { flex: none; }
.seg { flex: none; }
.head-actions { margin-inline-start: auto; }
.seg { margin-left: 0; margin-inline-start: auto; }
.menu { max-height: 340px; overflow-y: auto; }

/* right-to-left (Arabic) */
[dir="rtl"] .hint-right { text-align: left; }
[dir="rtl"] .menu { right: auto; left: 0; }
[dir="rtl"] .menu button, [dir="rtl"] .sheet-list li button { text-align: right; }
[dir="rtl"] .li-right { text-align: left; }
[dir="rtl"] .asset-btn { border-left: 0; border-right: 1px solid var(--line); }
[dir="rtl"] .asset-code { text-align: right; }
[dir="rtl"] .kv dd { text-align: left; }
[dir="rtl"] .select { text-align: right; }
[dir="rtl"] #receiveOut { direction: ltr; text-align: right; }

/* compact header so long languages (RU, FR, HI…) fit */
.card-head { gap: 6px; }
.seg-btn { padding: 6px 11px; font-size: 13px; white-space: nowrap; }
.head-actions { gap: 5px; }
.head-actions .icon-btn { height: 34px; min-width: 34px; padding: 0 7px; }
.country-btn .chev { display: none; }

/* order page */
.o-title { font-size: 20px; margin: 6px 0 2px; }
.o-sub { margin: 0 0 6px; font-size: 14px; }
.deposit { border: 1px solid var(--card-border); background: var(--brand-soft); border-radius: var(--radius); padding: 14px; margin: 0 0 14px; }
.deposit-title { margin: 0; font-size: 16px; font-weight: 700; }
.deposit-to { margin: 2px 0 10px; font-size: 13px; color: var(--muted); }
.deposit-body { display: flex; gap: 12px; align-items: center; }
.qr { flex: none; width: 144px; height: 144px; padding: 6px; background: #fff; border-radius: 10px; display: grid; place-items: center; }
.qr img, .qr canvas { display: block; }
.deposit-addr { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-width: 0; flex: 1; }
.deposit-addr code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.45; word-break: break-all; }
.deposit-memo { margin-top: 12px; }
.deposit-memo .deposit-addr { flex-direction: row; align-items: center; }
.deposit-wait { margin: 4px 0; font-size: 14px; color: var(--muted); }
.deposit-warn { margin: 12px 0 0; font-size: 12px; line-height: 1.45; color: var(--err); font-weight: 600; }
@media (max-width: 420px) { .deposit-body { flex-direction: column; align-items: stretch; } .qr { align-self: center; } }

/* ---------- dApp: wallet ---------- */
.hint-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hint-row .net { margin-inline-start: auto; text-align: end; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent-text); font-weight: 700; font-size: 12px; text-decoration: underline; text-underline-offset: 2px; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 6px; }
.label-row .label { margin: 0; }
.wallet-btn { font-size: 12px; padding: 4px 10px; }
.wallet-btn .wdot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.wallet-btn.is-on .wdot { background: var(--ok); box-shadow: 0 0 0 3px rgba(79, 191, 122, .2); }
.wallet-btn.is-wrong .wdot { background: var(--err); }
.wallet-hint { margin: 6px 4px 0; }
.wallet-hint.is-warn { color: var(--err); font-weight: 600; }
.input[readonly] { background: var(--panel); }
.send-wallet { margin-top: 12px; width: 100%; }
.tx-line { margin: 8px 0 0; font-size: 13px; }
.tx-line a { color: var(--accent-text); font-weight: 700; }
