/* Oryn app shell. Builds on style.css tokens and components. */

.app {
  --side: 236px;
  --p-bg: #16130f;
  --p-bg-2: #1b1713;
  background: #100e0b;
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 6px;
  padding: 20px 14px 16px;
  background: #0c0a08;
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.side__brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; }
.side__brand img { border-radius: 8px; }
.side__nav { display: grid; gap: 2px; }
.side__nav a {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 9px;
  color: var(--muted); font-size: 14.5px;
  transition: background 0.18s, color 0.18s;
}
.side__nav a:hover { background: rgba(239, 232, 220, 0.04); color: var(--text); }
.side__nav a.is-active { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.side__nav a.is-active::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.side__nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.side__nav a.is-active svg { stroke: var(--accent-2); }
.side__dot { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 3px rgba(143, 207, 143, 0.15); }

.side__foot { margin-top: auto; display: grid; gap: 10px; padding-top: 18px; }
.side__bot { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--p-bg); }
.side__bot small { color: var(--dim); font-size: 11.5px; }
.side .pill { margin: 0; justify-content: center; font-size: 11.5px; }
.wcard { border: 1px solid var(--line); border-radius: 10px; background: var(--p-bg); overflow: hidden; }
.wcard__top { display: flex; align-items: center; gap: 10px; padding: 12px; }
.wcard__top p { margin: 0; font-size: 13px; }
.wcard__top small { color: var(--dim); font: 11.5px var(--mono); }
.wcard__ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #1c0e03; font-weight: 600; flex: none; }
.wcard__acts { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.wcard__acts > * { padding: 9px 4px; font-size: 12px; text-align: center; background: none; border: 0; color: var(--muted); cursor: pointer; }
.wcard__acts > * + * { border-left: 1px solid var(--line); }
.wcard__acts > *:hover { color: var(--text); background: rgba(239, 232, 220, 0.03); }

/* ---------- Main ---------- */
.main { min-width: 0; padding: 0 24px 40px; }
.bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 16px 0; margin-bottom: 18px;
  background: rgba(16, 14, 11, 0.88); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.bar__title h1 { margin: 0; font-family: var(--serif); font-weight: 600; letter-spacing: -0.025em; font-size: 26px; line-height: 1.1; }
.bar__title p { margin: 2px 0 0; font-size: 13px; color: var(--dim); }
.bar__stats { display: flex; gap: 6px; }
.bar__stats div { display: grid; gap: 1px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--p-bg); min-width: 104px; }
.bar__stats small { font-size: 11px; color: var(--dim); }
.bar__stats b { font: 500 14px var(--mono); white-space: nowrap; }

.dash__note { margin: 0 0 16px; font-size: 13px; color: var(--muted); padding: 10px 14px; border: 1px solid rgba(247, 115, 26, 0.3); border-radius: var(--radius-sm); background: var(--accent-soft); }
.dash__note code { font-family: var(--mono); font-size: 12px; color: var(--accent-2); }
.dash__fine { margin: 24px 0 0; color: var(--dim); font-size: 12.5px; max-width: 90ch; }

.view { display: grid; gap: 16px; }
.panel { border: 1px solid var(--line); border-radius: 12px; background: var(--p-bg); min-width: 0; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.panel__head h3 { margin: 0; font-family: var(--serif); font-weight: 600; letter-spacing: -0.025em; font-size: 24px; line-height: 1.1; }
.panel__tools { display: flex; align-items: center; gap: 10px; }
.k { margin: 0 0 10px; font: 11.5px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.sub { margin: 2px 0 0; font-size: 13px; color: var(--dim); }
.big { margin: 0; font-family: var(--serif); font-weight: 600; letter-spacing: -0.025em; font-size: 34px; line-height: 1; }

.tabs--sm .tab { padding: 6px 12px; font-size: 13px; }
.tabs--full { display: flex; width: 100%; }
.tabs--full .tab { flex: 1; }
.tab .count { font: 11px var(--mono); color: var(--accent-2); }
.search--sm { height: 36px; max-width: none; }
.minscore { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.minscore input { flex: 1; accent-color: var(--accent); min-width: 0; }
.minscore output { width: 20px; text-align: right; color: var(--text); }
.iconbtn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); background: none; color: var(--muted); cursor: pointer; font-size: 16px; }
.iconbtn:hover { color: var(--text); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--muted); font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.linkbtn:hover { color: var(--text); }
.linkbtn.danger { color: var(--down); text-decoration-color: rgba(232, 115, 95, 0.4); }
.btn--xs { height: 28px; padding: 0 11px; font-size: 12.5px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Terminal ---------- */
.term { display: grid; grid-template-columns: 264px minmax(0, 1fr) 316px; gap: 16px; align-items: start; }
.center { display: grid; gap: 16px; min-width: 0; }

.watch { display: flex; flex-direction: column; position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow: hidden; }
.watch__top { display: grid; gap: 12px; padding: 12px; border-bottom: 1px solid var(--line); }
.watch__q { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--accent-soft); font-size: 12px; }
.watch__q span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--accent-2); }
.watch__list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.watch__list li > button {
  width: 100%; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 11px; align-items: center;
  padding: 10px 8px; border: 0; border-radius: 9px; background: none; cursor: pointer; text-align: left;
}
.watch__list li > button:hover { background: rgba(239, 232, 220, 0.035); }
.watch__list li > button.is-sel { background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.watch__list .tok__img { width: 32px; height: 32px; font-size: 12px; }
.wl__name { display: block; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl__meta { display: block; margin-top: 2px; font: 11.5px var(--mono); color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl__right { display: grid; justify-items: end; gap: 4px; }
.wl__right .mono { font-size: 11.5px; }
.spill { font: 500 11.5px var(--mono); padding: 2px 8px; border-radius: 999px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.spill.is-hi { color: #1c0e03; background: var(--accent); border-color: var(--accent); }
.spill.is-mid { color: var(--accent-2); border-color: rgba(247, 115, 26, 0.35); }
.watch__empty { padding: 30px 12px; text-align: center; color: var(--dim); font: 12.5px var(--mono); }
.watch__src { margin: 0; padding: 9px 12px; border-top: 1px solid var(--line); color: var(--dim); font-size: 11px; }

.tokcard { overflow: hidden; }
.tokhead { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px 16px; }
.tokhead__id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.tokhead__name { min-width: 0; display: grid; gap: 6px; justify-items: start; }
.tokhead__name h2 { margin: 0; font-family: var(--serif); font-weight: 600; letter-spacing: -0.025em; font-size: 26px; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tokhead__name h2 small { font: 13px var(--mono); color: var(--dim); }
.tok__img--lg { width: 46px; height: 46px; font-size: 16px; }
.ca { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--p-bg-2); color: var(--muted); font-size: 11.5px; cursor: pointer; }
.ca:hover { color: var(--text); border-color: var(--line-2); }
.ca svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
.tokhead__px { text-align: right; flex: none; }
.tokhead__px b { display: block; font: 500 26px var(--mono); line-height: 1.1; }
.tokhead__px span { font: 13px var(--mono); }
.strip { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); border-top: 1px solid var(--line); }
.strip div { padding: 12px 20px; min-width: 0; }
.strip div + div { border-left: 1px solid var(--line); }
.strip dt { font-size: 11.5px; color: var(--dim); }
.strip dd { margin: 3px 0 0; font: 500 14.5px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chartp { overflow: hidden; }
.chartbar { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tfs { display: flex; gap: 2px; }
.tfs button { border: 0; background: none; padding: 5px 9px; border-radius: 6px; font: 12px var(--mono); color: var(--dim); cursor: pointer; }
.tfs button:hover { color: var(--text); }
.tfs button.is-active { color: var(--accent-2); background: var(--accent-soft); }
.chartbar__links { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.chartbar__links a { font: 11.5px var(--mono); padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.chartbar__links a:hover { color: var(--text); border-color: var(--line-2); }
.chart { position: relative; height: 500px; background: #0e0c0a; }
.chart iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.chart > div { position: absolute; inset: 0; }
.chart__empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--dim); }
.chart__legend { position: absolute; left: 12px; top: 10px; z-index: 3; margin: 0; font: 11.5px var(--mono); color: var(--muted); pointer-events: none; }
.chart__legend b { color: var(--text); font-weight: 500; }

.details { overflow: hidden; }
.details__tabs { padding: 12px; border-bottom: 1px solid var(--line); }
.det { padding: 20px; }
.ov { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.ov__col { min-width: 0; }
.ov__col .k + * { margin-bottom: 22px; }
.kvs { margin: 0; display: grid; gap: 0; }
.kvs div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.kvs div:last-child { border-bottom: 0; }
.kvs dt { color: var(--dim); }
.kvs dd { margin: 0; font: 13px var(--mono); text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kvs dd a { color: var(--accent-2); }
.kvs dd .ok { color: var(--up); }
.kvs dd .bad { color: var(--down); }
.chg { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.chg div { padding: 9px 10px; text-align: center; }
.chg div + div { border-left: 1px solid var(--line); }
.chg small { display: block; font: 11px var(--mono); color: var(--dim); }
.chg span { font: 500 13px var(--mono); }
.mini-t { width: 100%; border-collapse: collapse; font: 12.5px var(--mono); }
.mini-t th { text-align: right; font-weight: 400; color: var(--dim); font-size: 11px; padding: 0 0 6px; }
.mini-t th:first-child, .mini-t td:first-child { text-align: left; }
.mini-t td { text-align: right; padding: 7px 0; border-top: 1px solid var(--line); }
.flowbar { display: block; height: 4px; border-radius: 4px; margin-top: 4px; background: var(--down); overflow: hidden; }
.flowbar i { display: block; height: 100%; background: var(--up); }
.ov__links { display: flex; flex-wrap: wrap; gap: 6px; }
.ov__links a { font: 12px var(--mono); padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); }
.ov__links a:hover { color: var(--text); border-color: var(--accent); }
.ov__desc { margin: 12px 0 0; font-size: 13px; color: var(--muted); line-height: 1.6; max-height: 7.5em; overflow: hidden; }

.hsum { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.hsum div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--p-bg-2); min-width: 0; }
.hsum small { display: block; font-size: 11.5px; color: var(--dim); }
.hsum b { display: block; margin-top: 3px; font: 500 18px var(--mono); white-space: nowrap; }
.hsum b.up { color: var(--up); }
.hsum b.warn { color: #e8b45f; }
.hsum b.down { color: var(--down); }
.hbar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--line); }
.hbar i { display: block; height: 100%; }
.hlegend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 18px; font-size: 11.5px; color: var(--muted); }
.hlegend span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; background: var(--c); }
.det .table-wrap { border: 1px solid var(--line); border-radius: 10px; max-height: 420px; overflow-y: auto; }
.share { display: block; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.share i { display: block; height: 100%; background: var(--accent); }
.share i.prog { background: #6b6a8f; }
.h-note { margin-top: 10px; }
.addr { color: var(--text); }
.addr:hover { color: var(--accent-2); }

.airead { display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.airead .dial { width: 110px; height: 110px; }
.airead .dial span { font-size: 30px; }
.airead .reasons { margin-bottom: 16px; }

.order { display: flex; flex-direction: column; gap: 14px; padding: 16px; position: sticky; top: 92px; }
.order .field__in { height: 46px; }
.order .field__in input { font-size: 18px; }
.safe { padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.safe header { display: flex; align-items: center; justify-content: space-between; }
.safe h3 { margin: 0; font-family: var(--serif); font-weight: 600; letter-spacing: -0.025em; font-size: 21px; }
.checks--sm li { padding: 8px 10px; font-size: 12.5px; }

.dial { --p: 0; width: 78px; height: 78px; border-radius: 50%; display: grid; place-content: center; text-align: center; position: relative; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--line) 0); }
.dial::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--p-bg); }
.dial span, .dial small { position: relative; }
.dial span { font: 500 22px var(--mono); line-height: 1; }
.dial small { font: 10.5px var(--mono); color: var(--muted); margin-top: 4px; }
.factors { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.factors li { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; font-size: 11.5px; color: var(--muted); }
.factors li b { font: 500 11px var(--mono); color: var(--text); }
.factors li i { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.factors li i::after { content: ""; display: block; height: 100%; width: var(--w); background: var(--accent); border-radius: 4px; }
.factors--big { gap: 12px; }
.factors--big li { font-size: 13.5px; gap: 6px 10px; }
.factors--big li b { font-size: 12.5px; }
.factors--big li i { height: 6px; }
.reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; color: var(--muted); }
.reasons li { display: grid; grid-template-columns: 12px 1fr; gap: 8px; }
.reasons li::before { content: "·"; color: var(--accent-2); }
.reasons li.pos::before { content: "+"; color: var(--up); }
.reasons li.neg::before { content: "−"; color: var(--down); }

.dock { overflow: hidden; margin-top: 16px; }
.dock > .tabs { margin: 12px; }
.table-wrap { overflow-x: auto; }
.dock .table-wrap { border-top: 1px solid var(--line); max-height: 360px; overflow-y: auto; }
.table--dash th { background: var(--p-bg); padding: 11px 14px; font-size: 11px; position: sticky; top: 0; z-index: 1; }
.table--dash td { padding: 11px 14px; font-size: 13.5px; }
.table--dash tbody tr { cursor: default; }
.table--dash td.act { text-align: right; width: 1%; }
.table--dash .is-note td, .table--dash .is-empty td { text-align: center; color: var(--dim); font: 12.5px var(--mono); padding: 28px 14px; }
.table--dash .plan { font-size: 11.5px; color: var(--muted); }
.tok__img--sol { background: linear-gradient(135deg, #9945ff, #14f195); color: #0d0b09; font-size: 15px; border: 0; }
.tag { font: 10.5px var(--mono); padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.tag--session { color: var(--accent-2); border-color: rgba(247, 115, 26, 0.4); }
.tag--prog { color: #a9a8d6; border-color: rgba(169, 168, 214, 0.35); }

/* ---------- Analytics ---------- */
.cards3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cards3 > .panel { padding: 18px; }
.cards2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.regime__v { margin: 0 0 14px; font-family: var(--serif); font-weight: 600; letter-spacing: -0.025em; font-size: 34px; line-height: 1; }
.regime__v.up { color: var(--up); }
.regime__v.down { color: var(--down); }
.meter { height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--down), #6b5f50 50%, var(--up)); position: relative; margin-bottom: 16px; }
.meter i { position: absolute; top: -4px; width: 4px; height: 14px; border-radius: 2px; background: var(--text); left: 50%; transform: translateX(-50%); transition: left 0.6s var(--ease); }
.regime__note { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.mini { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.mini dt { font-size: 11.5px; color: var(--dim); }
.mini dd { margin: 1px 0 0; font: 14px var(--mono); }
.mini--big dd { font-size: 18px; }
.dist { display: grid; gap: 10px; }
.dist__row { display: grid; grid-template-columns: 70px 1fr 40px; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.dist__row i { height: 10px; border-radius: 3px; background: var(--line); overflow: hidden; }
.dist__row i::after { content: ""; display: block; height: 100%; width: var(--w); background: var(--c, var(--accent)); }
.dist__row b { font: 500 13px var(--mono); color: var(--text); text-align: right; }
.pnlchart { height: 120px; margin-top: 16px; position: relative; display: grid; place-items: center; color: var(--dim); border-top: 1px solid var(--line); padding-top: 8px; }
.pnlchart > div { position: absolute; inset: 8px 0 0; }

.picks { list-style: none; margin: 0; padding: 6px; counter-reset: pick; }
.picks li > button { width: 100%; display: grid; grid-template-columns: 22px 32px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border: 0; border-radius: 8px; background: none; cursor: pointer; text-align: left; }
.picks li > button:hover { background: rgba(239, 232, 220, 0.035); }
.picks .n { font: 12px var(--mono); color: var(--dim); }
.picks .why { display: block; margin-top: 2px; font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars { list-style: none; margin: 0; padding: 12px 18px 16px; display: grid; gap: 9px; }
.bars li { display: grid; grid-template-columns: 90px 1fr 70px; gap: 10px; align-items: center; font-size: 13px; cursor: pointer; }
.bars li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars li i { height: 8px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bars li i::after { content: ""; display: block; height: 100%; width: var(--w); background: var(--accent); opacity: 0.85; }
.bars li b { font: 500 12px var(--mono); text-align: right; }

.deep__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding: 18px; }
.deep__grid .k { margin-top: 4px; }
.deep__grid .factors { margin-bottom: 22px; }
.summary { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.65; }
.checks { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.checks li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; background: var(--p-bg-2); font-size: 13px; color: var(--muted); }
.checks li b { font: 500 12.5px var(--mono); }
.checks li.ok b { color: var(--up); }
.checks li.bad b { color: var(--down); }
.checks li.warn b { color: #e8b45f; }

/* ---------- Bot ---------- */
.botstat { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 24px; align-items: center; padding: 18px 20px; }
.botstat__main { display: flex; align-items: center; gap: 16px; }
.botstat__main h2 { margin: 0; font-family: var(--serif); font-weight: 600; letter-spacing: -0.025em; font-size: 28px; }
.botstat .mini { grid-template-columns: repeat(4, auto); gap: 4px 26px; }
.botstat__acts { display: flex; align-items: center; gap: 14px; }
.status { display: inline-flex; align-items: center; gap: 8px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); font: 12px var(--mono); color: var(--muted); width: fit-content; }
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.status.is-on { color: var(--text); border-color: rgba(143, 207, 143, 0.35); }
.status.is-on i { background: var(--up); animation: blink 1.6s ease-in-out infinite; }
.status--lg { padding: 8px 14px; font-size: 13px; }
@keyframes blink { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .status.is-on i { animation: none; } }

.setup { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.setup__form { display: grid; gap: 16px; }
.step { padding: 18px 20px 20px; }
.step__head { display: flex; gap: 14px; align-items: flex-start; margin: 0 0 16px; }
.step__head:not(:first-child) { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.step__head h3 { margin: 0; font-family: var(--serif); font-weight: 600; letter-spacing: -0.025em; font-size: 24px; line-height: 1.1; }
.step__n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; font: 500 12px var(--mono); color: var(--accent-2); border: 1px solid rgba(247, 115, 26, 0.45); }
.choice { display: grid; gap: 10px; margin-bottom: 18px; }
.choice--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.choice label { cursor: pointer; display: block; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: grid; gap: 4px; height: 100%; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--p-bg-2); transition: border-color 0.2s, background 0.2s; }
.choice b { font-weight: 500; font-size: 14.5px; }
.choice small { font-size: 12.5px; color: var(--dim); line-height: 1.45; }
.choice--5 span { padding: 12px; }
.choice--5 b { font-size: 13.5px; }
.choice label:hover span { border-color: var(--line-2); }
.choice input:checked + span { border-color: rgba(247, 115, 26, 0.7); background: var(--accent-soft); }
.choice input:focus-visible + span { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.choice input:disabled + span { opacity: 0.55; cursor: not-allowed; }

.sliders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; margin-bottom: 16px; }
.sl { display: grid; grid-template-columns: 1fr auto; gap: 8px; font-size: 13.5px; color: var(--muted); }
.sl output { font: 500 13px var(--mono); color: var(--text); }
.sl input { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); }
.toggle { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--muted); cursor: pointer; margin-top: 6px; }
.toggle input { position: absolute; opacity: 0; }
.toggle span { width: 36px; height: 20px; border-radius: 999px; background: var(--line-2); position: relative; flex: none; transition: background 0.2s; }
.toggle span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text); transition: transform 0.2s var(--ease); }
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(16px); }
.toggle input:focus-visible + span { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.saved { margin: 16px 0 0; min-height: 16px; color: var(--up); }

.session { margin-top: 4px; padding: 14px; border: 1px dashed var(--line-2); border-radius: 10px; }
.session p { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.session .mono { word-break: break-all; }
.session__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.kv { margin: 0; display: grid; gap: 8px; }
.kv div { display: flex; justify-content: space-between; gap: 12px; }
.kv dt { color: var(--dim); font-size: 13px; }
.kv dd { margin: 0; }
.kv a { color: var(--accent-2); }

.preview { position: sticky; top: 92px; }
.preview__n { margin: 0; padding: 16px 18px 6px; color: var(--muted); font-size: 13px; }
.preview__n b { font-family: var(--serif); font-weight: 600; letter-spacing: -0.025em; font-size: 44px; color: var(--text); margin-right: 6px; }
.pv { list-style: none; margin: 0; padding: 6px 10px 10px; max-height: 520px; overflow-y: auto; }
.pv li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px; border-radius: 8px; }
.pv li:hover { background: rgba(239, 232, 220, 0.03); }
.pv .tok__img { width: 28px; height: 28px; font-size: 11px; }
.pv-empty { padding: 20px 8px; color: var(--dim); font: 12.5px var(--mono); text-align: center; display: block !important; }
.preview > .sub { padding: 10px 18px 16px; border-top: 1px solid var(--line); margin: 0; font-size: 11px; }

/* ---------- Activity ---------- */
.log { list-style: none; margin: 0; padding: 0 18px 12px; max-height: 70vh; overflow-y: auto; font-size: 12.5px; }
.log li { display: grid; grid-template-columns: 76px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--muted); line-height: 1.55; }
.log li:last-child { border-bottom: 0; }
.log time { color: var(--dim); }
.log a { color: var(--accent-2); }
.log .log__buy span { color: var(--up); }
.log .log__sell span { color: var(--accent-2); }
.log .log__error span { color: var(--down); }
.log .log__skip span { color: var(--dim); }
.log .log__empty { display: block; text-align: center; color: var(--dim); padding: 40px 0; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field__k { font-size: 12.5px; color: var(--muted); }
.field__in { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--bg); }
.field__in:focus-within { border-color: var(--accent); }
.field__in input { flex: 1; min-width: 0; width: 100%; background: none; border: 0; outline: 0; color: var(--text); font: 500 20px var(--mono); }
.field__in span { color: var(--dim); }
.field__hint { color: var(--dim); font-size: 11.5px; }
.field > input, .field select, .field textarea { height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font: 13.5px var(--sans); outline: 0; width: 100%; }
.field textarea { height: auto; padding: 10px 12px; resize: none; font: 12px var(--mono); word-break: break-all; }
.field > input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.field select option { background: var(--panel); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line); background: none; font: 12px var(--mono); color: var(--muted); cursor: pointer; }
.chip:hover { color: var(--text); border-color: var(--line-2); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--muted); cursor: pointer; }
.check input { accent-color: var(--accent); margin-top: 3px; }
.keybox { color: var(--accent-2) !important; }
.quote { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.quote div { padding: 9px 11px; background: var(--p-bg-2); min-width: 0; }
.quote div.wide { grid-column: 1 / -1; }
.quote dt { font-size: 11px; color: var(--dim); }
.quote dd { margin: 2px 0 0; font: 13px var(--mono); overflow-wrap: anywhere; }
.quote .warn { color: #e8b45f; }

/* ---------- Modals, toasts ---------- */
.modal { padding: 0; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg-2); color: var(--text); width: min(500px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; }
.modal::backdrop { background: rgba(8, 7, 5, 0.65); backdrop-filter: blur(3px); }
.modal[open] { animation: pop 0.28s var(--ease); }
@keyframes pop { from { transform: translateY(10px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__inner { padding: 22px; display: grid; gap: 16px; }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal__head h3 { margin: 0; font-family: var(--serif); font-weight: 600; letter-spacing: -0.025em; font-size: 28px; line-height: 1.1; }
.modal__x { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 1px solid var(--line-2); background: none; color: var(--muted); cursor: pointer; font-size: 20px; line-height: 1; }
.modal__x:hover { color: var(--text); }
.modal__fine, .modal__p { margin: 0; font-size: 13px; color: var(--muted); }
.modal__p.mono { word-break: break-all; color: var(--text); }
.modal__msg { margin: 0; min-height: 16px; color: var(--muted); font-size: 12px; }
.modal__msg.is-ok { color: var(--up); }
.modal__msg.is-err { color: var(--down); }
.modal__msg a { color: var(--accent-2); }
.modal__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wallets { display: grid; gap: 8px; }
.wallets__item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); cursor: pointer; font-size: 15px; text-align: left; transition: border-color 0.2s; }
.wallets__item:hover { border-color: rgba(247, 115, 26, 0.6); }
.wallets__item small { margin-left: auto; color: var(--up); }
.wallets__item.is-off small { color: var(--dim); }
.wallets__item.is-off { opacity: 0.75; }
.wallets__ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line-2); font-weight: 600; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 40px)); }
.toast { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--line-2); font-size: 14px; box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.7); animation: pop 0.25s var(--ease); transition: opacity 0.5s, transform 0.5s; }
.toast--ok { border-color: rgba(143, 207, 143, 0.4); }
.toast--err { border-color: rgba(232, 115, 95, 0.5); }
.toast a { color: var(--accent-2); }
.toast.is-out { opacity: 0; transform: translateY(6px); }

.mbar { display: none; }
.mwallet { display: none; }

/* ---------- Global search ---------- */
.gsearch { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--p-bg); transition: border-color 0.2s; }
.gsearch:focus-within { border-color: rgba(247, 115, 26, 0.6); }
.gsearch svg { width: 16px; height: 16px; fill: none; stroke: var(--dim); stroke-width: 2; flex: none; }
.gsearch input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: 14px var(--sans); }
.gsearch input::placeholder { color: var(--dim); }
.gsearch kbd { font-size: 11px; color: var(--dim); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 1680px) {
  /* Collapse the sidebar to icons so the chart gets the room. */
  .app { --side: 72px; }
  .side { padding: 18px 10px 14px; align-items: center; }
  .side__brand { padding: 4px 0 20px; }
  .side__brand .brand__word, .side__nav span, .side__bot small, .side .pill, .side__wallet { display: none; }
  .side__nav a { justify-content: center; padding: 12px; }
  .side__nav a.is-active::before { left: -10px; }
  .side__dot { position: absolute; top: 7px; right: 7px; margin: 0; }
  .side__bot { padding: 8px; border: 0; background: none; }
  .side__bot .status span { display: none; }
  .side__bot .status { padding: 7px; }
  .mwallet { display: inline-flex; }
  .term { grid-template-columns: 244px minmax(0, 1fr) 296px; }
  .strip div { padding: 11px 14px; }
  .bar__stats .hide-lg { display: none; }
}
@media (max-width: 1280px) {
  .term { grid-template-columns: 232px minmax(0, 1fr); }
  .order { grid-column: 1; grid-row: 2; position: static; }
  .watch { grid-row: 1; }
  .center { grid-column: 2; grid-row: 1 / span 2; }
  .strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .strip div:nth-child(4) { border-left: 0; }
  .strip div:nth-child(n + 4) { border-top: 1px solid var(--line); }
  .ov { grid-template-columns: 1fr 1fr; }
  .hsum { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .airead { grid-template-columns: 110px minmax(0, 1fr); }
  .airead > div:last-child { grid-column: 1 / -1; }
  .choice--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .setup { grid-template-columns: 1fr; }
  .preview { position: static; }
  .gsearch { max-width: 380px; }
}
@media (max-width: 1080px) {
  .cards3 { grid-template-columns: 1fr 1fr; }
  .cards2, .deep__grid { grid-template-columns: 1fr; }
  .botstat { grid-template-columns: 1fr; }
  .bar__stats { display: none; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; padding-bottom: 64px; }
  .side { display: none; }
  .main { padding: 0 14px 24px; }
  .bar { flex-wrap: wrap; gap: 10px; }
  .bar__title { flex: 1; }
  .gsearch { order: 3; max-width: none; flex-basis: 100%; }
  .term { grid-template-columns: 1fr; }
  .watch, .order, .center { grid-column: 1; grid-row: auto; position: static; }
  .watch { max-height: 360px; }
  .chart { height: 420px; }
  .ov { grid-template-columns: 1fr; }
  .tokhead { flex-wrap: wrap; }
  .mbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: 60px;
    background: rgba(12, 10, 8, 0.96); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  }
  .mbar a { display: grid; place-items: center; font-size: 12.5px; color: var(--dim); }
  .mbar a.is-active { color: var(--accent-2); }
}
@media (max-width: 640px) {
  .cards3, .choice--2, .choice--3, .choice--5, .sliders { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
  .botstat .mini { grid-template-columns: 1fr 1fr; }
  .strip { grid-template-columns: 1fr 1fr; }
  .strip div:nth-child(odd) { border-left: 0; }
  .strip div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .hsum { grid-template-columns: 1fr 1fr; }
  .airead { grid-template-columns: 1fr; }
  .chg { grid-template-columns: repeat(2, 1fr); }
  .tokhead__name h2 { font-size: 24px; }
}
