/* Brand */
.logo { font-family: var(--font-display); font-weight: 700; letter-spacing: .02em; font-size: 20px; display: inline-flex; align-items: center; gap: 10px; color: var(--fg); }
.logo:hover { text-decoration: none; }
.logo b { color: var(--mint); font-weight: 700; }
.logo-mark { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: linear-gradient(140deg, var(--mint), #0FA57A); box-shadow: 0 0 18px var(--mint-glow), inset 0 1px 0 rgba(255, 255, 255, .4); }
.logo-mark svg { width: 14px; height: 14px; color: var(--mint-ink); }

/* Panels */
.panel {
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 var(--hi), 0 20px 40px -24px rgba(0, 0, 0, .6);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); min-width: 0;
}
.pad { padding: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-title { font-size: 15px; font-weight: 600; margin: 0; letter-spacing: -.005em; }
.well { padding: 14px; border-radius: 12px; background: var(--well); border: 1px solid var(--line); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px;
  border-radius: 12px; border: 1px solid var(--line-2); background: var(--raise); font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: transform .16s var(--ease), background .16s, border-color .16s, box-shadow .2s;
}
.btn:hover { border-color: rgba(142, 172, 214, .35); background: #172234; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary {
  background: linear-gradient(180deg, #4DF3C0, var(--mint-2)); color: var(--mint-ink); border-color: transparent;
  box-shadow: 0 0 0 1px rgba(56, 235, 180, .4), 0 8px 24px -8px var(--mint-glow), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.btn-primary:hover { background: linear-gradient(180deg, #6BF7CC, #2BD8A3); }
.btn-ghost { background: transparent; }
.btn-danger { background: linear-gradient(180deg, #FF6F89, #E23E5E); color: #fff; border-color: transparent; box-shadow: 0 8px 24px -10px rgba(255, 94, 123, .6), inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn-danger:hover { background: linear-gradient(180deg, #FF8299, #EC4A69); }
.btn-outline-danger { color: var(--red-text); border-color: rgba(255, 94, 123, .35); }
.btn[disabled] { opacity: .42; cursor: not-allowed; box-shadow: none; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-lg { height: 50px; padding: 0 24px; font-size: 15px; }
.btn-block { width: 100%; }

/* Pills */
.pill {
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  background: var(--mint-soft); color: var(--mint); border: 1px solid rgba(56, 235, 180, .22);
}
.pill.sm { height: 22px; font-size: 10px; padding: 0 9px; }
.pill.amber { background: var(--amber-soft); color: var(--amber); border-color: rgba(255, 186, 82, .25); }
.pill.red { background: var(--red-soft); color: var(--red); border-color: rgba(255, 94, 123, .25); }
.pill.ice { background: var(--ice-soft); color: var(--ice); border-color: rgba(124, 200, 255, .25); }
.pill.grey { background: rgba(142, 172, 214, .08); color: var(--muted); border-color: var(--line-2); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; flex: none; display: inline-block; }
.pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* Forms */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, .label { font-size: 12px; color: var(--muted); font-weight: 500; }
.input {
  height: 46px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--field); padding: 0 14px; width: 100%;
  outline: none; transition: border-color .16s, box-shadow .16s;
}
.input:focus { border-color: rgba(56, 235, 180, .55); box-shadow: 0 0 0 4px rgba(56, 235, 180, .10); }
.input[aria-invalid="true"] { border-color: rgba(255, 94, 123, .6); }
select.input {
  appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px; background-size: 5px 5px; background-repeat: no-repeat;
}
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .affix { position: absolute; left: 14px; color: var(--muted); font-family: var(--font-mono); pointer-events: none; }
.input-wrap .suffix { position: absolute; right: 14px; color: var(--dim); font-size: 12px; pointer-events: none; }
.input-wrap .input { padding-left: 32px; font-family: var(--font-mono); font-size: 17px; font-weight: 500; }
.form-error { color: var(--red-text); font-size: 13px; display: flex; gap: 8px; align-items: flex-start; }
.form-error svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--red); }

.switch { position: relative; width: 46px; height: 26px; border-radius: 999px; border: 1px solid var(--line-2); background: #1A2433; cursor: pointer; flex: none; transition: background .2s, border-color .2s; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #93A1B5; transition: transform .2s var(--ease), background .2s; }
.switch[aria-checked="true"] { background: rgba(56, 235, 180, .22); border-color: rgba(56, 235, 180, .5); }
.switch[aria-checked="true"]::after { transform: translateX(20px); background: var(--mint); box-shadow: 0 0 12px var(--mint-glow); }
.switch[disabled] { opacity: .5; cursor: not-allowed; }

.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--field); border: 1px solid var(--line); gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 9px; color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--raise); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-2); }

/* Meters, rings */
.meter { height: 6px; border-radius: 99px; background: rgba(142, 172, 214, .12); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--mint-2), var(--mint)); box-shadow: 0 0 12px var(--mint-glow); transition: width .5s var(--ease); }
.meter.amber i { background: linear-gradient(90deg, #E59A2F, var(--amber)); box-shadow: 0 0 12px rgba(255, 186, 82, .4); }
.meter.red i { background: linear-gradient(90deg, #D93E5C, var(--red)); box-shadow: 0 0 12px rgba(255, 94, 123, .4); }
.ring { position: relative; width: 96px; height: 96px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1.1; }
.ring-label b { font-family: var(--font-mono); font-size: 20px; }
.ring-label small { display: block; font-size: 10px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }

/* Banners */
.banner { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 14px; font-size: 13px; line-height: 1.5; }
.banner svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.banner b { color: var(--fg); }
.banner.amber { background: var(--amber-soft); border: 1px solid rgba(255, 186, 82, .28); color: var(--amber-text); }
.banner.amber svg { color: var(--amber); }
.banner.red { background: var(--red-soft); border: 1px solid rgba(255, 94, 123, .3); color: var(--red-text); }
.banner.red svg { color: var(--red); }
.banner.info { background: rgba(124, 200, 255, .06); border: 1px solid rgba(124, 200, 255, .2); color: #BFE2FF; }
.banner.info svg { color: var(--ice); }

/* Tables */
.tbl-wrap { overflow-x: auto; margin: 0 -22px -22px; padding: 0 22px 8px; }
table.tbl { width: 100%; border-collapse: collapse; min-width: 620px; }
.tbl th { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); font-weight: 600; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 14px 12px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: rgba(142, 172, 214, .04); }
.tbl .r { text-align: right; }
.tbl.compact { min-width: 400px; }
.inst b { display: block; font-weight: 600; }
.inst span { font-size: 12px; color: var(--dim); }
.side-tag { font-family: var(--font-mono); font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px; }
.side-tag.buy { background: var(--ice-soft); color: var(--ice); }
.side-tag.sell { background: var(--amber-soft); color: var(--amber); }
.side-tag.evt { background: var(--red-soft); color: var(--red); }

/* Lists */
.kv { display: flex; flex-direction: column; }
.kv > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv > div:last-child { border-bottom: 0; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.checks li { display: flex; gap: 10px; font-size: 14px; color: var(--muted); }
.checks li svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.checks li.warnline { color: var(--amber-text); }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty .ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--mint-soft); border: 1px solid rgba(56, 235, 180, .22); }
.empty .ico svg { width: 22px; height: 22px; color: var(--mint); }
.empty h3 { margin: 0; color: var(--fg); font-size: 17px; }
.empty p { margin: 0; max-width: 44ch; }

/* Toasts */
.toasts { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
.toast {
  background: #0F1A27; border: 1px solid rgba(56, 235, 180, .35); color: var(--fg); padding: 12px 16px; border-radius: 12px; display: flex; gap: 10px; align-items: center;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .7), 0 0 30px -10px var(--mint-glow); animation: toast-in .2s var(--ease);
}
.toast svg { width: 16px; height: 16px; color: var(--mint); flex: none; }
.toast.warn { border-color: rgba(255, 186, 82, .4); } .toast.warn svg { color: var(--amber); }
.toast.error { border-color: rgba(255, 94, 123, .45); } .toast.error svg { color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Charts */
.chart { width: 100%; height: 260px; display: block; }
.chart text { fill: var(--dim); font-family: var(--font-mono); font-size: 10.5px; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 2px; border-radius: 2px; display: inline-block; }
.legend .l-mint { background: var(--mint); } .legend .l-amber { background: var(--amber); } .legend .l-red { background: var(--red); }
