:root {
  --bg: #F5F5F7; --card: #FFFFFF; --line: #E5E5E7;
  --ink: #1D1D1F; --ink2: #6E6E73; --ink3: #AEAEB2;
  --gold: #B8942E; --gold-br: #D4AF37; --gold-bg: #FBF6E7;
  --up: #1F9D57; --down: #FF3B30; --warn: #FF9500; --dark: #1F1F25;
  --card-in: var(--bg);
  --tab-h: 68px; --shell: 440px;
}
:root[data-theme="dark"] {
  --bg: #0E0E11; --card: #17171B; --line: #262630;
  --ink: #F3F3F6; --ink2: #9A9AA2; --ink3: #6E6E78;
  --gold: #D4AF37; --gold-br: #E6C558; --gold-bg: #221E12;
  --dark: #17171B; --card-in: #0E0E11;
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1;
  overscroll-behavior-y: none;
}
a { color: var(--gold); text-decoration: none; } a:hover { color: var(--gold-br); }
button { font-family: inherit; cursor: pointer; border: none; }
.tnum { font-variant-numeric: tabular-nums; }
::-webkit-scrollbar { width: 0; height: 0; }

@keyframes sk { 0% { background-position: 100% 0 } 100% { background-position: -100% 0 } }
@keyframes livedot { 0%,100% { opacity: 1; transform: scale(1) } 50% { opacity: .35; transform: scale(.65) } }
.sk { background: linear-gradient(90deg, #E6E6E9 25%, #F1F1F3 50%, #E6E6E9 75%); background-size: 200% 100%; animation: sk 1.4s linear infinite; border-radius: 6px; }
:root[data-theme="dark"] .sk { background: linear-gradient(90deg, #1E1E24 25%, #2A2A32 50%, #1E1E24 75%); background-size: 200% 100%; }
.sk-d { background: linear-gradient(90deg, rgba(255,255,255,.06) 25%, rgba(255,255,255,.13) 50%, rgba(255,255,255,.06) 75%); background-size: 200% 100%; animation: sk 1.4s linear infinite; border-radius: 6px; }

.shell { max-width: var(--shell); margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
.scroll { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 16px); }

.appbar { display: flex; align-items: flex-start; justify-content: space-between; padding: calc(env(safe-area-inset-top) + 14px) 20px 12px; }
.appbar .greet { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.appbar .sub { font-size: 13px; color: var(--ink2); margin-top: 3px; }
.appbar .sub b { color: var(--gold); font-weight: 600; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--dark); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; flex: none; }
:root[data-theme="dark"] .avatar { background: #2A2A32; }

.px { padding-left: 20px; padding-right: 20px; }

.till {
  background: var(--dark); border-radius: 16px; padding: 16px 16px 15px; color: #fff;
  position: relative; overflow: hidden;
}
:root[data-theme="dark"] .till { border: 1px solid var(--line); }
.till::after { content: ''; position: absolute; top: -46px; right: -34px; width: 170px; height: 170px; background: radial-gradient(circle, rgba(212,175,55,.18), transparent 70%); pointer-events: none; }
.till-top { position: relative; display: flex; align-items: center; justify-content: space-between; }
.till-brand { display: flex; align-items: center; gap: 8px; }
.till-brand svg { width: 17px; height: 17px; stroke: var(--gold-br); }
.till-brand span { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #B9B9C0; }
.till-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 600; letter-spacing: .06em; padding: 4px 10px; border-radius: 20px; }
.till-pill.open { background: rgba(31,157,87,.16); border: 1px solid rgba(31,157,87,.4); color: #54D08A; }
.till-pill.wait { background: rgba(255,149,0,.16); border: 1px solid rgba(255,149,0,.4); color: #FFB84D; }
.till-val { font-size: 40px; line-height: 1; font-weight: 600; letter-spacing: -.02em; color: var(--gold-br); margin-top: 15px; }
.till-tl { font-size: 13px; color: #9A9AA2; margin-top: 8px; }
.till-meta { font-size: 12px; color: #7C7C85; margin-top: 12px; }
.till-hr { height: 1px; background: rgba(255,255,255,.09); margin: 14px 0 2px; }
.till-lbl { font-size: 9.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #6E6E78; margin: 9px 0 2px; }
.mov { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.mov .k { font-size: 8.5px; font-weight: 700; letter-spacing: .04em; border-radius: 5px; padding: 3px 0; width: 66px; text-align: center; flex: none; }
.mov .k.scrap { color: var(--gold-br); background: rgba(212,175,55,.16); }
.mov .k.sarr { color: #6FB0FF; background: rgba(47,123,214,.18); }
.mov .k.doviz { color: #54D08A; background: rgba(31,157,87,.18); }
.mov .nm { font-size: 13.5px; font-weight: 500; color: #EDEDEF; flex: 1; min-width: 0; }
.mov .amt { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; }
.mov .tm { font-size: 11px; color: #6E6E78; width: 36px; text-align: right; }
.till-act { display: flex; gap: 10px; margin-top: 15px; }
.till-act .primary { flex: 1; height: 46px; border-radius: 12px; background: var(--gold); color: #1F1F25; font-size: 14px; font-weight: 600; }
.till-act .ghost { height: 46px; padding: 0 16px; border-radius: 12px; background: transparent; border: 1px solid rgba(255,255,255,.2); color: #EDEDEF; font-size: 13px; font-weight: 500; }
.till-open { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 9px 13px; background: rgba(255,59,48,.06); border: 1px solid rgba(255,59,48,.22); border-radius: 11px; }
.till-open svg { width: 15px; height: 15px; stroke: var(--down); flex: none; }
.till-open .t { font-size: 12.5px; font-weight: 500; color: var(--down); }
.till-open .t b { font-weight: 700; }
.till-open .more { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--down); }

.rowlbl { display: flex; align-items: center; gap: 7px; margin: 18px 0 11px; }
.rowlbl .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--up); animation: livedot 1.6s ease-in-out infinite; }
.rowlbl .t { font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink2); }
.rowlbl .r { margin-left: auto; font-size: 11px; font-weight: 500; color: var(--ink3); }

.strip { display: flex; gap: 10px; overflow-x: auto; }
.strip .cell { flex: 0 0 auto; min-width: 132px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; }
.strip .cell .top { display: flex; justify-content: space-between; align-items: center; }
.strip .cell .n { font-size: 12px; font-weight: 500; color: var(--ink2); }
.strip .cell .v { font-size: 17px; font-weight: 600; margin-top: 7px; }
.strip .cell .bot { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.strip .cell .u { font-size: 10px; color: var(--ink3); }
.tri { font-size: 9px; }

.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; }
.stat .l { font-size: 9.5px; font-weight: 500; letter-spacing: .03em; text-transform: uppercase; color: var(--ink3); }
.stat .v { font-size: 13.5px; font-weight: 600; margin-top: 6px; }
.stat.gold .l, .stat.gold .v { color: var(--gold); }

.seclbl { font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink2); margin: 20px 0 11px; }
.mods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mod { background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 14px 15px; display: flex; align-items: center; gap: 13px; color: var(--ink); }
.mod .ic { width: 40px; height: 40px; border-radius: 11px; background: var(--card-in); display: flex; align-items: center; justify-content: center; flex: none; }
.mod .ic svg { width: 22px; height: 22px; stroke: var(--ink); }
.mod .l { font-size: 14.5px; font-weight: 500; }

.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--shell); height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); padding-top: 9px;
  background: var(--card); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: start; z-index: 30;
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 5px; color: var(--ink3); }
.tab svg { width: 23px; height: 23px; stroke: currentColor; }
.tab .l { font-size: 9.5px; font-weight: 500; white-space: nowrap; }
.tab.on { color: var(--gold); }
.tab.on .l { font-weight: 600; }

.ic { fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.login { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.login-logo { height: 34px; margin-bottom: 10px; }
.login-tag { font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--ink3); margin-bottom: 26px; }
.login-fields { width: 100%; max-width: 360px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.lf { padding: 12px 16px; border-bottom: 1px solid var(--line); position: relative; }
.lf:last-child { border-bottom: none; }
.lf label { display: block; font-size: 10px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink3); margin-bottom: 5px; }
.lf input, .lf select { width: 100%; border: none; background: transparent; font-family: inherit; font-size: 16px; font-weight: 500; color: var(--ink); padding: 0; outline: none; appearance: none; }
.lf .eye { position: absolute; right: 16px; top: 50%; transform: translateY(-25%); width: 18px; height: 18px; stroke: var(--ink3); fill: none; stroke-width: 1.7; }
.lf .chev { position: absolute; right: 16px; top: 50%; transform: translateY(-10%); width: 16px; height: 16px; stroke: var(--ink3); fill: none; stroke-width: 1.8; pointer-events: none; }
.login-btn { width: 100%; max-width: 360px; height: 52px; border-radius: 13px; background: var(--gold); color: #fff; font-size: 16px; font-weight: 600; margin-top: 20px; }
.login-forgot { font-size: 13px; font-weight: 500; color: var(--gold); margin-top: 18px; }
.login-ver { font-size: 12px; color: var(--ink3); margin-top: auto; padding-top: 30px; }

.seg { display: flex; gap: 24px; border-bottom: 1px solid var(--line); padding: 0 20px; }
.seg a { padding: 12px 0; font-size: 14px; font-weight: 500; color: var(--ink2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.seg a.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--gold); }

.search { display: flex; align-items: center; gap: 10px; height: 46px; margin: 14px 20px 0; padding: 0 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.search svg { width: 17px; height: 17px; stroke: var(--ink3); fill: none; stroke-width: 1.8; flex: none; }
.search input { flex: 1; border: none; background: transparent; font-family: inherit; font-size: 14px; color: var(--ink); outline: none; }
.search .bar { width: 20px; height: 20px; stroke: var(--gold); }

.prow { display: flex; align-items: center; justify-content: space-between; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.prow .nm { font-size: 15px; font-weight: 500; }
.prow .sp { font-size: 11.5px; color: var(--ink3); margin-top: 3px; }
.prow .pr { font-size: 15px; font-weight: 600; text-align: right; }
.prow .has { font-size: 11px; color: var(--ink3); text-align: right; margin-top: 3px; }
.ayar { display: inline-block; font-size: 9.5px; font-weight: 600; color: var(--gold); background: var(--gold-bg); border-radius: 5px; padding: 2px 6px; margin-left: 7px; vertical-align: middle; }

.appbar-row { display: flex; align-items: baseline; justify-content: space-between; padding: calc(env(safe-area-inset-top) + 16px) 20px 6px; }
.appbar-row h1 { font-size: 22px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.appbar-row .cnt { font-size: 12.5px; color: var(--ink3); }

.cart { position: sticky; bottom: 0; background: var(--card); border-top: 1px solid var(--line); padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); }
.cart .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cart .meta { font-size: 12px; color: var(--ink3); }
.cart .tot { font-size: 18px; font-weight: 600; }
.cart .btn { width: 100%; height: 50px; border-radius: 13px; background: var(--gold); color: #fff; font-size: 15.5px; font-weight: 600; }

.themebtn { width: 38px; height: 38px; border-radius: 11px; background: var(--card); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.themebtn svg { width: 18px; height: 18px; stroke: var(--ink2); fill: none; stroke-width: 1.7; }

@media (min-width: 760px) {
  :root { --shell: 100%; }
  .shell { max-width: 100%; flex-direction: row; }
  .sidenav { display: flex; flex-direction: column; width: 250px; flex: 0 0 250px; background: var(--card); border-right: 1px solid var(--line); padding: 20px 14px; gap: 2px; min-height: 100vh; position: sticky; top: 0; }
  .maincol { flex: 1; min-width: 0; max-width: 860px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; min-height: 100vh; }
  .scroll { padding-bottom: 30px; }
  .tabbar { display: none; }
  .mods { grid-template-columns: 1fr 1fr 1fr; }
  .cart { border: 1px solid var(--line); border-radius: 14px; margin: 14px 20px; position: static; }
}
@media (max-width: 759px) { .sidenav { display: none; } }

.sidenav .sb { display: flex; align-items: center; gap: 10px; padding: 6px 12px 18px; }
.sidenav .sb img { height: 24px; }
.snav { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: 11px; color: var(--ink2); font-size: 14px; font-weight: 500; }
.snav svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.snav.on { background: var(--gold-bg); color: var(--gold); font-weight: 600; }
.snav:hover { background: var(--card-in); }

.pagehead { display: flex; align-items: baseline; justify-content: space-between; padding: 6px 20px 0; }
.pagehead h1 { font-size: 22px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.pagehead .cnt { font-size: 12.5px; font-weight: 500; color: var(--ink3); }

.segbar { display: flex; gap: 24px; margin: 16px 20px 0; border-bottom: 1px solid var(--line); }
.segbar a { position: relative; padding-bottom: 12px; font-size: 14px; font-weight: 500; color: var(--ink2); }
.segbar a.on { color: var(--ink); font-weight: 600; }
.segbar a.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--gold); border-radius: 2px; }

.searchbox { display: flex; align-items: center; gap: 10px; margin: 14px 20px 12px; padding: 0 12px; height: 44px; background: var(--card); border: 1px solid var(--line); border-radius: 11px; }
.searchbox svg.s { width: 19px; height: 19px; stroke: var(--ink3); fill: none; stroke-width: 1.8; flex: none; }
.searchbox input { flex: 1; border: none; background: transparent; font-family: inherit; font-size: 14px; color: var(--ink); outline: none; }
.searchbox input::placeholder { color: var(--ink3); }
.searchbox .sep { width: 1px; height: 20px; background: var(--line); flex: none; }
.searchbox svg.bc { width: 22px; height: 22px; stroke: var(--gold); fill: none; stroke-width: 1.7; flex: none; }

.plist { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin: 0 20px 12px; }
.plist .r { display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.plist .r:last-child { border-bottom: none; }
.plist .nm { font-size: 15px; font-weight: 500; }
.plist .sp { font-size: 12px; color: var(--ink3); margin-top: 3px; }
.plist .pr { font-size: 15px; font-weight: 600; text-align: right; }
.plist .has { font-size: 11.5px; color: var(--ink3); text-align: right; margin-top: 3px; }
.plist .r.stock { padding: 12px 15px; }
.plist .ayar { display: inline-block; font-size: 10px; font-weight: 600; color: var(--gold); background: var(--gold-bg); border: 1px solid rgba(184,148,46,.25); border-radius: 5px; padding: 2px 6px; margin-left: 8px; vertical-align: middle; }
.plist .hlbl { font-size: 10px; font-weight: 500; color: var(--ink3); letter-spacing: .06em; text-align: right; margin-top: 2px; }

.botbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); width: 100%; max-width: var(--shell); background: var(--card); border-top: 1px solid var(--line); z-index: 25; }
.tradebar { padding: 12px 20px 14px; }
.tradebar .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.tradebar .meta { font-size: 12.5px; color: var(--ink2); }
.tradebar .tot { font-size: 18px; font-weight: 600; }
.tradebar .btn { width: 100%; height: 50px; border-radius: 13px; background: var(--gold); color: #fff; font-size: 15.5px; font-weight: 600; }
.stokbar { display: flex; align-items: center; justify-content: space-between; padding: 13px 20px; }
.stokbar .info { display: flex; align-items: center; gap: 11px; }
.stokbar .bic { width: 38px; height: 38px; border-radius: 10px; background: var(--gold-bg); display: flex; align-items: center; justify-content: center; flex: none; }
.stokbar .bic svg { width: 22px; height: 22px; stroke: var(--gold); fill: none; stroke-width: 1.7; }
.stokbar .l { font-size: 10.5px; font-weight: 600; color: var(--ink2); text-transform: uppercase; letter-spacing: .05em; }
.stokbar .s { font-size: 12px; color: var(--ink3); margin-top: 2px; }
.stokbar .tot { font-size: 20px; font-weight: 600; color: var(--gold); }

.ratelist { margin: 0 20px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px 2px; }
.rhead, .rrow { display: grid; grid-template-columns: 1fr 90px 90px; align-items: center; }
.rhead { padding: 0 0 9px; border-bottom: 1px solid var(--line); }
.rhead span { text-align: right; font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); }
.rrow { padding: 13px 0; border-bottom: 1px solid var(--line); }
.rrow:last-child { border-bottom: none; }
.rrow .nm { font-size: 15px; font-weight: 500; }
.rrow .sub { font-size: 11px; color: var(--ink3); margin-top: 3px; }
.rrow .buy { text-align: right; font-size: 14.5px; font-weight: 500; }
.rrow .sell { text-align: right; }
.rrow .sell .v { font-size: 14.5px; font-weight: 600; }
.rrow .sell .v .t { font-size: 9px; margin-right: 3px; }
.rrow .sell .c { font-size: 10px; font-weight: 500; margin-top: 2px; }

.scroll.haspin { padding-bottom: calc(var(--tab-h) + 120px + env(safe-area-inset-bottom)); }

@media (min-width: 760px) {
  .botbar { position: static; transform: none; max-width: none; border: 1px solid var(--line); border-radius: 14px; margin: 14px 20px; }
  .scroll.haspin { padding-bottom: 30px; }
}

.login-err { width: 100%; max-width: 360px; background: rgba(255,59,48,.08); border: 1px solid rgba(255,59,48,.28); color: var(--down); font-size: 12.5px; font-weight: 500; padding: 11px 14px; border-radius: 11px; margin-bottom: 14px; text-align: center; }
