:root {
  --bg: #07080A;
  --text: #F4F6F9;
  --muted: #A3ACB9;
  --faint: #8F99A8;
  --warn: #FFB27A;
  --dim: rgba(244, 246, 249, 0.42);
  --line: rgba(255, 255, 255, 0.12);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, system-ui, sans-serif; }
body { overflow-x: hidden; }
button, input { font-family: inherit; }
[hidden] { display: none !important; }

.glow { position: fixed; border-radius: 50%; pointer-events: none; filter: blur(12px); z-index: 0; }
.g1 { width: 380px; height: 380px; left: -160px; top: 120px; background: radial-gradient(circle, rgba(110,127,153,.55) 0%, rgba(0,0,0,0) 70%); }
.g2 { width: 340px; height: 340px; right: -150px; top: 420px; background: radial-gradient(circle, rgba(200,210,225,.3) 0%, rgba(0,0,0,0) 70%); }

.app { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; padding: 20px 16px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; min-height: 100vh; }

/* ---------- загрузка ---------- */
.splash { position: fixed; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; background: var(--bg); }
.splash-logo { width: 220px; height: auto; animation: pulse 3s ease-in-out infinite; }
.loader { width: 180px; height: 6px; border-radius: 3px; overflow: hidden; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); margin-top: 20px; }
.loader div { width: 40%; height: 100%; background: linear-gradient(90deg, rgba(255,255,255,0), #fff, rgba(255,255,255,0)); animation: load 1.4s ease-in-out infinite; }
@keyframes load { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
@keyframes pulse { 0%,100% { opacity: .85; } 50% { opacity: 1; } }

/* ---------- стекло ---------- */
.glass {
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,.18);
  background: linear-gradient(155deg, rgba(255,255,255,.15) 0%, rgba(255,255,255,.04) 58%, rgba(255,255,255,.08) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 12px 30px rgba(0,0,0,.5);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  color: var(--text);
}
.card { padding: 18px; display: flex; flex-direction: column; gap: 12px; }

.tile { height: 130px; border-radius: 26px; padding: 16px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; text-align: left; cursor: pointer; font-size: 18px; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.row-btn { min-height: 64px; border-radius: 22px; padding: 0 18px; display: flex; align-items: center; gap: 14px; cursor: pointer; font-size: 18px; font-weight: 600; width: 100%; text-align: left; }
.row-btn .grow { flex: 1; }
button.glass:active, .list-item:active { transform: scale(.98); }

.btn-chrome {
  height: 52px; padding: 0 18px; border-radius: 16px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.55);
  background: linear-gradient(180deg, rgba(255,255,255,.92) 0%, rgba(205,212,222,.85) 100%);
  box-shadow: inset 0 1px 0 #fff, inset 0 -2px 6px rgba(0,0,0,.12), 0 8px 20px rgba(0,0,0,.45);
  color: #0B0C0F; font-size: 16px; font-weight: 700; white-space: nowrap;
}
.btn-chrome:disabled { opacity: .5; }
.btn-round { width: 56px; height: 56px; border-radius: 28px; padding: 0; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.btn-ghost { min-height: 44px; padding: 0 12px; border-radius: 14px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.06); color: #DDE3EC; font-size: 13px; font-weight: 500; cursor: pointer; }
.btn-dashed { min-height: 56px; border-radius: 20px; border: 1px dashed rgba(255,255,255,.35); background: rgba(255,255,255,.04); color: #E4E9F0; font-size: 16px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; width: 100%; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; padding: 0; display: flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer; }

.input {
  width: 100%; min-width: 0; height: 52px; border-radius: 16px; padding: 0 14px; outline: none;
  border: 1px solid rgba(255,255,255,.2); background: rgba(0,0,0,.35); color: var(--text);
  font-size: 18px; font-weight: 600;
}
.input:focus { border-color: rgba(255,255,255,.5); }
.input::placeholder { color: #7C8696; font-weight: 500; }
.input.small { height: 48px; font-size: 17px; text-align: right; }
.form-row { display: flex; gap: 10px; }
.form-row .input { flex: 1; }
label { font-size: 13px; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; }

/* ---------- текст ---------- */
.brand { display: flex; align-items: center; justify-content: center; gap: 10px; padding-top: 4px; }
.brand img { width: 44px; height: 44px; object-fit: contain; }
.brand span { font-size: 20px; font-weight: 800; letter-spacing: .14em; background: linear-gradient(180deg, #fff 0%, #AEB6C2 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.top { display: flex; align-items: center; gap: 12px; }
.top .titles { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
h1 { margin: 0; font-size: 22px; font-weight: 700; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.big { font-size: 32px; font-weight: 800; letter-spacing: -.01em; }
.mid { font-size: 22px; font-weight: 700; }
.dim { color: var(--dim); }
.warn { color: var(--warn); }
.stack { display: flex; flex-direction: column; gap: 4px; }
.right { align-items: flex-end; text-align: right; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.baseline { align-items: baseline; }
.sep { height: 1px; background: var(--line); }
.note { font-size: 13px; color: var(--warn); border-radius: 12px; background: rgba(255,140,60,.12); padding: 8px 12px; }

/* ---------- списки ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.list-item { min-height: 76px; border-radius: 22px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; cursor: pointer; width: 100%; text-align: left; }
.entry { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 16px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.05); }
.entry b { font-size: 16px; font-weight: 600; }
.empty { font-size: 14px; color: var(--faint); padding: 12px 4px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.05); color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.chip.on { background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(205,212,222,.85)); color: #0B0C0F; border-color: rgba(255,255,255,.55); }

.rates-head, .rates-row { display: grid; grid-template-columns: minmax(0, 1fr) 76px 100px; gap: 10px; align-items: center; }
.rates-head { padding: 0 16px; font-size: 12px; color: var(--faint); }
.rates-row { min-height: 72px; border-radius: 22px; padding: 12px 12px 12px 16px; }
.rates-row .input { padding: 0 10px; }

/* ---------- панель шефа ---------- */
.segs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 18px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.05); }
.seg { min-height: 40px; border-radius: 14px; border: 1px solid transparent; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; }
.seg.on { background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(205,212,222,.85)); color: #0B0C0F; border-color: rgba(255,255,255,.55); }
.nav-btn { width: 44px; height: 44px; border-radius: 22px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.06); color: #DDE3EC; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; flex-shrink: 0; }
.nav-btn:disabled { opacity: .3; cursor: default; }
.chart { display: flex; align-items: flex-end; height: 104px; padding-top: 6px; }
.bar-col { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; }
.bar-col span { font-size: 10px; color: var(--faint); height: 12px; white-space: nowrap; }
.bar { width: 100%; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,.18)); box-shadow: inset 0 1px 0 rgba(255,255,255,.6); }
.bar.last { background: linear-gradient(180deg, #fff, #C9CFD8); }
.bar.neg { background: linear-gradient(180deg, #FFB27A, rgba(255,140,60,.4)); }
.dot { width: 10px; height: 10px; border-radius: 5px; flex-shrink: 0; }
.dot.ok { background: #3DD68C; } .dot.bad { background: var(--warn); } .dot.off { background: #5B6370; }
.table-card { border-radius: 22px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.05); padding: 4px 16px; }
.table-row { min-height: 48px; border-bottom: 1px solid rgba(255,255,255,.08); }
.table-row:last-child { border-bottom: none; }
.tile-sm { min-height: 64px; border-radius: 20px; padding: 0 16px; display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 15px; font-weight: 600; text-align: left; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 10; max-width: 90vw; padding: 12px 18px; border-radius: 16px; background: rgba(30,34,42,.95); border: 1px solid rgba(255,255,255,.18); font-size: 14px; }
