:root {
  --navy: #0c1c33;
  --ink: #1a2332;
  --muted: #5e6c7e;
  --ivory: #f6f1e7;
  --ivory-2: #fbf8f2;
  --gold: #c4a574;
  --gold-2: #e4d2b0;
  --gold-deep: #8c6a3e;
  --line: rgba(184, 149, 108, .35);
  --up: #1f7a4d;
  --down: #9a3b3b;
  --shadow: 0 18px 50px rgba(12, 28, 51, .12);
  --sans: "Segoe UI", "Helvetica Neue", sans-serif;
  --serif: Palatino, "Palatino Linotype", Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body.desk-app {
  height: 100dvh;
  overflow: hidden;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
h1, h2, h3, .num { font-family: var(--serif); font-weight: 500; letter-spacing: -.02em; margin: 0; }
h1 { font-size: 28px; color: #f6f1e7; }
h2 { font-size: 22px; color: var(--navy); }
p { margin: 0; }
a { color: var(--navy); }
:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }

.stage {
  height: 100dvh;
  min-height: 0;
  display: flex;
  background:
    radial-gradient(340px 200px at 100% 0%, rgba(198, 161, 90, .28), transparent 58%),
    linear-gradient(180deg, #fffdf8 0%, #f6efe4 46%, #e4ebf3 100%);
}
.phone {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
}
.phone-screen {
  flex: 1; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column; position: relative;
  background: transparent;
}
.appbar { display: grid; grid-template-columns: 52px 1fr 52px; align-items: center; padding: max(8px, env(safe-area-inset-top)) 8px 6px; min-height: 52px; }
.appbar strong {
  text-align: center;
  font-size: 17px;
  letter-spacing: .02em;
  font-weight: 750;
  background: linear-gradient(100deg, #7a4e10 0%, #e8c56a 40%, #fff1c2 50%, #c9922a 66%, #7a4e10 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brandmini { width: 52px; height: 52px; display: grid; place-items: center; }
.brandmini img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; display: block; }
.icon-btn { width: 44px; height: 44px; margin: 0 auto; border: 0; background: transparent; border-radius: 12px; display: grid; place-items: center; position: relative; padding: 0; color: inherit; }
.icon-btn .badge { position: absolute; top: 4px; right: 2px; }
.ico svg { width: 20px; height: 20px; display: block; }
.phone-scroll { flex: 1; min-height: 0; overflow: auto; padding: 2px 16px 24px; }
.appbar, .tabbar { flex: none; }
.tabbar {
  display: grid; grid-template-columns: repeat(5, 1fr);
  background:
    linear-gradient(180deg, rgba(255,255,255,.22), transparent 28%),
    linear-gradient(180deg, #243044, #141c2b);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(231, 211, 164, .35);
  padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
}
.tab { background: transparent; border: 0; color: rgba(246, 241, 231, .7); font-size: 10px; letter-spacing: .04em; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0 6px; }
.tab[aria-current="page"] { color: #f3e2c0; font-weight: 750; }
.tab-book { margin-top: 0; }
.tab-book .ico svg { width: 16px; height: 16px; }
.bubble {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.7), #e7d7b6 28%, #c4a574 58%, #8c6a3e);
  color: #1a140c; box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
.splash, .login { flex: 1; min-height: 0; }
.login { display: flex; flex-direction: column; background: var(--navy); overflow: hidden; padding-top: env(safe-area-inset-top); }
.login-hero { color: #f6f1e7; padding: 6px 22px 18px; text-align: center; }
.login-hero img { width: 112px; height: 112px; border-radius: 26px; object-fit: cover; box-shadow: 0 12px 28px rgba(0,0,0,.28); }
.login-hero h1 { margin: 8px 0 6px; }
.login-hero p { color: rgba(246, 241, 231, .78); }
.login-list { flex: 1; min-height: 0; overflow: auto; background: rgba(251, 248, 242, .96); border-radius: 22px 22px 0 0; padding: 16px 14px 8px; }
.login-foot { flex: none; background: var(--ivory-2); padding: 8px 14px 16px; }
.eyebrow { letter-spacing: .22em; text-transform: uppercase; font-size: 11px; color: var(--gold-2); }
.hello { color: var(--gold-deep); letter-spacing: .14em; text-transform: uppercase; font-size: 11px; font-weight: 750; margin-bottom: 2px; }
.cust-name { font-size: 30px; margin-bottom: 2px; text-transform: uppercase; letter-spacing: .06em; }
.fine, .muted { color: var(--muted); }
.fine { font-size: 12px; line-height: 1.45; }
.stack { display: flex; flex-direction: column; gap: 12px; }

.glass, .board, .rate-card, .market-card {
  position: relative;
  border-radius: 22px;
  color: #f6f1e7;
  background:
    linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,.04) 28%, transparent 42%),
    radial-gradient(280px 140px at 100% 0%, rgba(228, 210, 176, .28), transparent 55%),
    linear-gradient(165deg, rgba(22, 48, 79, .78), rgba(12, 28, 51, .72) 62%, rgba(8, 20, 38, .8));
  border: 1px solid rgba(255, 255, 255, .28);
  box-shadow: 0 16px 40px rgba(12, 28, 51, .16), inset 0 1px 0 rgba(255,255,255,.35);
  backdrop-filter: blur(18px);
}
.board {
  padding: 18px 16px 6px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,.05) 32%, transparent 48%),
    radial-gradient(240px 140px at 100% 0%, rgba(231, 211, 164, .34), transparent 58%),
    linear-gradient(165deg, #8a2744 0%, #6e1830 58%, #4a1020 100%);
  border-color: rgba(231, 211, 164, .5);
}
.board-row > span:nth-child(1) { grid-area: name; min-width: 0; }
.board-row > .board-px { grid-area: price; justify-self: end; align-self: center; }
.board-row > .move { grid-area: move; }
.board-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #8d8d8d; display: inline-block; }
.live-dot.on { background: #7dcea0; box-shadow: 0 0 0 4px rgba(125, 206, 160, .18); }
.board-row {
  width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name price" "move price";
  column-gap: 12px; row-gap: 4px; align-items: center; text-align: left; color: inherit; background: transparent; border: 0;
  border-top: 1px solid rgba(255,255,255,.16); padding: 14px 0;
}
.board-row:first-of-type { border-top: 0; }
.board-k { display: block; letter-spacing: .03em; text-transform: uppercase; font-size: 15px; font-weight: 750; color: #fff; line-height: 1.15; }
.board-p { display: block; margin-top: 3px; font-size: 12px; font-weight: 650; color: rgba(246,241,231,.78); }
.board-px { text-align: right; }
.board-px strong { display: block; font-family: var(--serif); font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.board-px small { display: block; margin-top: 4px; color: rgba(246,241,231,.75); font-size: 11px; font-weight: 700; }
.board .fine { color: rgba(246,241,231,.72); }
.panel-light, .panel-dark { border-radius: 22px; padding: 16px 16px 4px; backdrop-filter: blur(18px); }
.panel-light {
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255,255,255,.82), rgba(255,255,255,.48) 42%, rgba(244, 236, 220, .55)),
    linear-gradient(135deg, rgba(231, 211, 164, .55), rgba(255,255,255,.15));
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: 0 14px 32px rgba(74, 16, 32, .08), inset 0 1px 0 #fff;
}
.panel-dark {
  color: #f6f1e7;
  background:
    linear-gradient(180deg, rgba(255,255,255,.18), transparent 36%),
    radial-gradient(220px 120px at 100% 0%, rgba(231, 211, 164, .28), transparent 60%),
    linear-gradient(160deg, #2a3346 0%, #151c2b 52%, #4a1526 100%);
  border: 1px solid rgba(231, 211, 164, .38);
  box-shadow: 0 16px 36px rgba(20, 12, 18, .16), inset 0 1px 0 rgba(255,255,255,.28);
}
.eyebrow.dark { color: var(--gold-deep); }
.pair { display: grid; grid-template-columns: 1.15fr .85fr .85fr; gap: 8px; align-items: end; padding: 12px 0; border-top: 1px solid rgba(255,255,255,.16); }
.panel-light .pair { border-top-color: rgba(74, 16, 32, .12); }
.pair:first-of-type { border-top: 0; }
.pair-name { font-size: 13px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; line-height: 1.2; }
.panel-light .pair-name { color: #4a1020; }
.pair-q { text-align: right; }
.pair-q small, .coin-quotes small { display: block; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; font-weight: 750; opacity: .68; }
.pair-q b { display: block; font-family: var(--serif); font-size: 20px; font-weight: 700; line-height: 1.05; }
.coin {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center;
  padding: 14px 14px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.86), rgba(255,255,255,.52)),
    linear-gradient(135deg, rgba(231, 211, 164, .42), rgba(255,255,255,.1));
  border: 1px solid rgba(255,255,255,.92);
  box-shadow: 0 12px 28px rgba(74, 16, 32, .07), inset 0 1px 0 #fff;
  backdrop-filter: blur(14px);
}
.coin h3 { font-size: 16px; color: #4a1020; }
.coin-quotes { display: flex; gap: 14px; }
.coin-quotes b { display: block; font-family: var(--serif); font-size: 20px; font-weight: 700; color: var(--navy); line-height: 1; }
.panel-light .fine { color: var(--muted); }
.move { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 750; }
.move.up { color: #b7e0c8; }
.move.down { color: #f3b7b4; }
.move.flat { color: rgba(246,241,231,.7); }

.rate-card { padding: 16px; }
.rate-card h2 { color: #f6f1e7; }
.kicker { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-2); font-weight: 750; }
.rate-px { font-family: var(--serif); font-size: 40px; margin: 10px 0 0; line-height: 1; }
.rate-unit { color: var(--gold-2); margin: 4px 0 8px; }
.rate-card .fine, .market-card .fine { color: rgba(246,241,231,.75); }
.market-card { padding: 14px 16px; }
.market-card h3 { color: #f6f1e7; font-size: 16px; }
.glass-lite {
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(255,255,255,.8);
  box-shadow: 0 10px 30px rgba(12,28,51,.06), inset 0 1px 0 rgba(255,255,255,.9);
  backdrop-filter: blur(14px);
  border-radius: 18px;
}

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick button {
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(255,255,255,.8);
  backdrop-filter: blur(12px);
  border-radius: 16px; padding: 10px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 11px; color: var(--navy); position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.notice {
  background: rgba(248, 239, 227, .72);
  border-radius: 16px; padding: 12px 14px; color: #5c4a32;
  border: 1px solid rgba(255,255,255,.7);
  backdrop-filter: blur(12px);
}
.ticket {
  display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left;
  background: rgba(255,255,255,.7); border: 1px solid rgba(255,255,255,.85); border-radius: 16px;
  padding: 14px 14px 14px 16px; position: relative; color: inherit;
  box-shadow: 0 8px 24px rgba(12,28,51,.06), inset 0 1px 0 #fff;
  backdrop-filter: blur(12px);
}
.ticket:before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--accent, var(--gold)); }
.ticket.PENDING { --accent: #c4a574; }
.ticket.ACCEPTED { --accent: #1f7a4d; }
.ticket.DECLINED { --accent: #9a3b3b; }
.ticket-top, .row-between { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.ref { letter-spacing: .08em; font-weight: 750; font-size: 13px; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; font-size: 10px; letter-spacing: .08em; font-weight: 750; }
.pill.PENDING { background: #f3ead7; color: #7a5b2e; }
.pill.ACCEPTED { background: #e5f2ea; color: #1d6b45; }
.pill.DECLINED { background: #f8e8e6; color: #8d3530; }
.badge { background: var(--down); color: white; border-radius: 99px; font-style: normal; font-size: 10px; min-width: 16px; height: 16px; display: grid; place-items: center; padding: 0 4px; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 650; }
.control { width: 100%; border: 1px solid var(--line); background: rgba(255,255,255,.86); border-radius: 12px; padding: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.55); padding: 8px 12px; color: var(--navy); backdrop-filter: blur(8px); }
.chip[aria-pressed="true"] { background: var(--navy); color: #f6f1e7; border-color: var(--navy); }
.quote {
  background: rgba(255,255,255,.72);
  border-radius: 18px; padding: 14px;
  border: 1px solid rgba(255,255,255,.85);
  box-shadow: inset 0 1px 0 #fff;
  backdrop-filter: blur(12px);
  min-height: 96px;
}
.q-total { font-family: var(--serif); font-size: 32px; color: var(--navy); margin: 4px 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 12px 16px; border: 1px solid transparent; font-weight: 700; }
.btn:active { transform: translateY(1px); }
.btn-gold { background: linear-gradient(180deg, #f3e7cf, #e7d7b6 30%, #c4a574); color: #1a140c; box-shadow: inset 0 1px 0 rgba(255,255,255,.8); }
.btn-navy { background: var(--navy); color: #f6f1e7; }
.btn-ghost { background: rgba(255,255,255,.45); border-color: var(--line); color: var(--navy); }
.btn-block { width: 100%; }
.lock {
  background: rgba(255,255,255,.7); border-radius: 22px; padding: 22px 16px; text-align: center;
  border: 1px solid rgba(255,255,255,.85); display: flex; flex-direction: column; gap: 10px; align-items: center;
  backdrop-filter: blur(14px);
}
.lock h2 { font-size: 24px; }
.lock img { width: 72px; height: 72px; border-radius: 18px; object-fit: cover; }
.member {
  color: #f6f1e7; border-radius: 22px; padding: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.18), transparent 40%),
    linear-gradient(145deg, rgba(22,48,79,.84), rgba(12,28,51,.78));
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3);
  backdrop-filter: blur(16px);
}
.member h2, .member .fine { color: #f6f1e7; }
.member .fine { color: rgba(246,241,231,.75); }
.member-top { display: flex; justify-content: space-between; gap: 10px; }
.member img { width: 48px; height: 48px; border-radius: 14px; object-fit: cover; }
.list-btn {
  width: 100%; text-align: left; background: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.85); border-radius: 14px; padding: 12px 14px;
  display: flex; justify-content: space-between; align-items: center; color: var(--navy);
  backdrop-filter: blur(10px);
}
.note {
  width: 100%; text-align: left; background: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.8); border-radius: 16px; padding: 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.panel {
  background: rgba(255,255,255,.72); border-radius: 18px; padding: 14px;
  border: 1px solid rgba(255,255,255,.85); backdrop-filter: blur(12px);
}
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.modal-back { position: fixed; inset: 0; background: rgba(12,28,51,.48); display: flex; align-items: flex-end; justify-content: center; padding: 18px; z-index: 60; }
.modal-card {
  width: min(420px, 100%); background: rgba(255,253,249,.94); border-radius: 22px; padding: 22px;
  box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.8); backdrop-filter: blur(16px);
  display: flex; flex-direction: column; gap: 10px; max-height: min(86vh, 720px); overflow: auto;
}
.modal-card h3 { font-size: 26px; color: var(--navy); }
.modal-card dl { display: grid; grid-template-columns: 110px 1fr; gap: 8px 10px; margin: 0; }
.modal-card dt { color: var(--muted); }
.modal-card dd { margin: 0; font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
#toast:empty { display: none; }
#toast {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  background: var(--navy); color: #f6f1e7; border: 1px solid rgba(212,188,148,.45);
  border-radius: 14px; padding: 12px 14px; z-index: 80; width: min(420px, calc(100% - 24px));
}

@media (min-width: 800px) {
  .modal-back { align-items: center; }
}
