/* Bitbase Farm Mini App palette, adapted from the KCEX farm terminal. */
:root {
  color-scheme: dark;
  --bg: #100b07;
  --surface: #18100a;
  --surface-2: #20150c;
  --raised: #2b1b0e;
  --border: #4a2b14;
  --text: #f9ede3;
  --muted: #aa907b;
  --accent: #ce6d22;
  --accent-bright: #f18a34;
  --accent-soft: rgba(206, 109, 34, .18);
  --long: #20ba80;
  --short: #ef6262;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body:not(.authorized) .app, body:not(.authorized) .tabbar { display: none; }
[hidden] { display: none !important; }
.gate { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.gate-card { width: min(100%, 380px); padding: 25px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); text-align: center; }
.gate-card strong { font-size: 18px; letter-spacing: .07em; }
.gate-card strong span { color: var(--accent-bright); }
.gate-card p { color: var(--muted); line-height: 1.5; margin: 14px 0 0; }
body.authorized .gate { display: none; }
body {
  color: var(--text);
  background: radial-gradient(800px 380px at 50% -180px, #543018, transparent 70%), var(--bg);
  font-size: 13px;
}
.app { max-width: 650px; margin: auto; padding: 16px 14px 95px; }
.topbar, .card-head, .market-row { display: flex; justify-content: space-between; align-items: center; }
.topbar { margin: 5px 0 18px; }
.brand { font-size: 17px; font-weight: 800; letter-spacing: .065em; }
.brand span { color: var(--accent-bright); }
.status { color: var(--muted); font-size: 11px; }
.status i { display: inline-block; width: 7px; height: 7px; background: var(--accent); border-radius: 50%; margin-right: 5px; }
.summary, .card { border: 1px solid var(--border); border-radius: 14px; background: linear-gradient(165deg, var(--surface-2), var(--surface)); }
.summary { padding: 14px; margin-bottom: 10px; box-shadow: 0 12px 34px #0004; }
.eyebrow { color: var(--accent-bright); font-size: 10px; font-weight: 750; letter-spacing: .16em; margin-bottom: 15px; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.summary-grid > div + div { border-left: 1px solid var(--border); padding-left: 11px; }
.summary small, .summary strong { display: block; }
.summary small { color: var(--muted); margin-bottom: 6px; font-size: 10px; }
.summary strong { font: 700 20px ui-monospace, SFMono-Regular, Menlo, monospace; }
.summary em { color: var(--muted); font-size: 10px; font-style: normal; font-weight: 500; }
.card { padding: 15px; margin-bottom: 10px; }
.card-head { margin-bottom: 14px; }
.card-head h1, .card-head h2 { margin: 0; font-size: 15px; font-weight: 700; }
.counter, .pill { color: var(--accent-bright); border: 1px solid var(--border); background: var(--accent-soft); padding: 3px 8px; border-radius: 7px; font-size: 11px; }
.muted, .hint { color: var(--muted); }
p.muted { margin: 0; line-height: 1.5; }
.empty { min-height: 170px; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; gap: 7px; }
.empty-icon { display: grid; place-items: center; height: 44px; width: 44px; border-radius: 13px; background: var(--accent-soft); color: var(--accent-bright); font-size: 25px; }
.empty strong { font-size: 13px; }
.empty span { max-width: 270px; color: var(--muted); line-height: 1.4; font-size: 11px; }
.market-row { padding: 11px 0; border-bottom: 1px solid #3a2415; }
.market-row strong { font: 700 20px ui-monospace, SFMono-Regular, Menlo, monospace; }
.market-row b { color: var(--accent-bright); margin-left: 6px; }
.trade-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 15px; }
button { border: 1px solid var(--border); border-radius: 9px; padding: 12px; font-weight: 750; color: var(--text); background: var(--raised); cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
button:active:not(:disabled) { transform: scale(.985); }
.primary { background: var(--accent); border-color: var(--accent-bright); }
.secondary { background: #2c1c10; color: var(--accent-bright); }
.buy { background: #156d51; border-color: #20ba80; }
.sell { background: #8f3535; border-color: #ef6262; }
.full { width: 100%; }
.hint { font-size: 10px; text-align: center; margin-top: 10px; }
.tabbar { position: fixed; inset: auto 0 0; display: flex; justify-content: space-around; border-top: 1px solid var(--border); background: #160e08ed; backdrop-filter: blur(14px); padding: 9px 4px calc(10px + env(safe-area-inset-bottom)); }
.tabbar button { width: 20%; border: 0; border-radius: 0; padding: 0; text-align: center; color: #8e7866; background: transparent; font-size: 21px; line-height: 1; font-weight: 400; }
.tabbar button.selected { color: var(--accent-bright); }
.tabbar small { display: block; margin-top: 4px; font-size: 10px; }
@media (min-width: 700px) { .app { padding-top: 25px; } .tabbar { left: 50%; right: auto; width: 650px; transform: translateX(-50%); border-inline: 1px solid var(--border); } }
.notice { margin-bottom: 12px; padding: 12px 14px; border: 1px solid var(--accent); border-radius: 10px; color: var(--text); background: #38210d; line-height: 1.4; }
.notice.error, .error-text { color: #ff9c9c; border-color: #7d3333; }
.error-text { margin-top: 10px; }
.pill.ok { color: #54d4a7; border-color: #24785e; background: #153729; }
.pill.bad { color: #ff9c9c; border-color: #7d3333; background: #3b1919; }
.account-row { padding: 14px 0; border-top: 1px solid var(--border); }
.account-row:first-of-type { border-top: 0; padding-top: 0; }
.account-row .card-head { margin-bottom: 7px; }
.account-title { display: flex; gap: 8px; align-items: center; }
.account-title input { accent-color: var(--accent-bright); }
.account-sub { color: var(--muted); font-size: 11px; margin: 4px 0 10px; }
.account-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.account-metrics span { color: var(--muted); font-size: 11px; }
.account-metrics b { display: block; margin-top: 3px; color: var(--text); font-size: 13px; }
.account-row button { margin-top: 12px; }
.price-line { display: flex; justify-content: space-between; align-items: baseline; margin: 8px 0 12px; }
.price-line strong { font: 700 27px ui-monospace, SFMono-Regular, Menlo, monospace; }
.long { color: var(--long); } .short { color: var(--short); }
.book { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 15px; }
.book > div > div { display: flex; justify-content: space-between; padding: 3px 0; font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
.book > div:first-child > div span:first-child { color: var(--long); }
.book > div:last-child > div span:first-child { color: var(--short); }
.book small { display: block; color: var(--muted); margin-bottom: 7px; }
form label { display: block; width: 100%; color: var(--muted); margin-bottom: 13px; font-size: 11px; }
form input, form select { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 9px; background: #100b07; color: var(--text); font-size: 14px; outline: none; }
form input:focus, form select:focus { border-color: var(--accent-bright); }
.form-row { display: flex; gap: 10px; align-items: flex-end; }
.form-row > button { margin-bottom: 13px; }
.empty { min-height: 120px; }
