/* ORRERY app */
body.app { min-height: 100svh; }
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 22px; height: 60px; padding: 0 18px; background: rgba(9,9,10,.86); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .2em; font-size: 14px; }
.logo img { width: 32px; height: 32px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 7px 12px; border-radius: 99px; color: var(--mute); font-size: 14px; font-weight: 500; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); background: var(--panel2); }
.bar-r { display: flex; align-items: center; gap: 12px; }
.pubview { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mute); cursor: pointer; user-select: none; }
.pubview input { appearance: none; width: 30px; height: 18px; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line2); position: relative; cursor: pointer; transition: background .15s; }
.pubview input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--mute); transition: transform .15s, background .15s; }
.pubview input:checked { background: var(--acc-soft); border-color: var(--acc); }
.pubview input:checked::after { transform: translateX(12px); background: var(--acc); }
.wallet.on { font-family: var(--f-mono); font-size: 12.5px; }

#view { padding: 16px; max-width: 1640px; margin: 0 auto; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel-h h2, .panel-h h3 { font-size: 14px; font-weight: 600; }
.panel-b { padding: 16px; }
.empty { padding: 36px 16px; text-align: center; color: var(--mute); font-size: 14px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r2); background: rgba(255,194,92,.07); border: 1px solid rgba(255,194,92,.2); color: #f3dcb0; font-size: 13.5px; line-height: 1.5; }
.notice.info { background: var(--acc-soft); border-color: rgba(124,130,255,.28); color: #e6f7b5; }

/* trade layout */
.trade { display: grid; grid-template-columns: 290px minmax(0, 1fr) 370px; gap: 12px; align-items: start; }
.mlist { position: sticky; top: 76px; max-height: calc(100svh - 92px); display: flex; flex-direction: column; overflow: hidden; }
.mlist .search { padding: 10px; border-bottom: 1px solid var(--line); }
.input { width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg2); outline: none; transition: border-color .15s; }
.input:focus { border-color: rgba(124,130,255,.6); }
.mfilter { display: flex; gap: 4px; padding: 8px 10px 0; }
.mfilter button { border: 0; background: none; color: var(--mute); font-size: 12.5px; padding: 5px 9px; border-radius: 99px; cursor: pointer; }
.mfilter button.on { background: var(--panel2); color: var(--ink); }
.mrows { overflow-y: auto; padding: 6px; }
.mrow { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.mrow:hover { background: var(--panel2); }
.mrow.on { background: var(--panel2); box-shadow: inset 2px 0 0 var(--acc); }
.mrow b { font-weight: 600; font-size: 14px; }
.mrow .px { font-family: var(--f-mono); font-size: 12.5px; text-align: right; }
.mrow small { color: var(--dim); font-size: 12px; }
.mrow .chg { font-family: var(--f-mono); font-size: 11.5px; text-align: right; }

.center { display: grid; gap: 12px; min-width: 0; }
.mhead { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; padding: 16px 18px; }
.mhead h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.mhead .big { font-family: var(--f-mono); font-size: 22px; }
.stat { display: grid; gap: 2px; }
.stat span { font-size: 11.5px; color: var(--dim); }
.stat b { font-family: var(--f-mono); font-size: 13.5px; font-weight: 500; }
.chart-wrap { position: relative; height: 430px; }
.chart-tools { display: flex; gap: 4px; padding: 10px 12px 0; }
.chart-tools button { border: 0; background: none; color: var(--mute); font: 500 12px var(--f-mono); padding: 5px 9px; border-radius: 7px; cursor: pointer; }
.chart-tools button.on { background: var(--panel2); color: var(--ink); }
#chart { position: absolute; inset: 44px 0 0 0; }
.chart-msg { position: absolute; inset: 44px 0 0 0; display: grid; place-items: center; color: var(--dim); font-size: 13px; }

/* ticket */
.ticket { position: sticky; top: 76px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--bg2); border-radius: 12px; border: 1px solid var(--line); }
.seg button { height: 36px; border: 0; border-radius: 9px; background: none; color: var(--mute); font-weight: 600; font-size: 14px; cursor: pointer; }
.seg button.on { background: var(--panel2); color: var(--ink); }
.seg.side button.on[data-v="buy"] { background: rgba(95,227,157,.14); color: var(--up); }
.seg.side button.on[data-v="sell"] { background: rgba(255,107,107,.14); color: var(--down); }
.field { display: grid; gap: 6px; margin-top: 14px; }
.field > label, .field > .lbl { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--mute); }
.field .lbl button { background: none; border: 0; color: var(--acc); font-size: 12px; cursor: pointer; }
.amt { position: relative; }
.amt input { width: 100%; height: 56px; padding: 0 84px 0 14px; border-radius: 12px; border: 1px solid var(--line2); background: var(--bg2); font: 500 20px var(--f-mono); outline: none; }
.amt input:focus { border-color: rgba(124,130,255,.6); }
.amt .unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--mute); font: 500 13px var(--f-mono); }
.pcts { display: flex; gap: 6px; }
.pcts button { flex: 1; height: 28px; border: 1px solid var(--line); border-radius: 8px; background: none; color: var(--mute); font: 500 11.5px var(--f-mono); cursor: pointer; }
.pcts button:hover { color: var(--ink); border-color: var(--line2); }
.rows { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 7px; font-size: 13px; }
.rows div { display: flex; justify-content: space-between; gap: 12px; }
.rows span { color: var(--mute); }
.rows b { font-family: var(--f-mono); font-weight: 500; font-size: 12.5px; text-align: right; }
.go { margin-top: 16px; }
.small { font-size: 12px; color: var(--dim); line-height: 1.5; margin-top: 10px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font: 500 11px var(--f-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--dim); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; }
.tbl td.num, .tbl td .num { font-family: var(--f-mono); font-size: 12.5px; }
.scroll-x { overflow-x: auto; }

/* page grids */
.page { display: grid; gap: 12px; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 6px 2px 4px; }
.page-h h1 { font-size: 30px; letter-spacing: -.03em; font-weight: 700; }
.page-h p { color: var(--mute); max-width: 62ch; font-size: 14.5px; margin-top: 4px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.card { padding: 16px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); display: grid; gap: 8px; }
.card h3 { font-size: 15px; }
.card p { font-size: 13px; color: var(--mute); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { padding: 16px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); }
.kpi span { font-size: 12px; color: var(--dim); }
.kpi b { display: block; font: 500 22px var(--f-mono); margin-top: 4px; letter-spacing: -.03em; }
.legs { display: grid; gap: 8px; }
.leg { display: grid; grid-template-columns: 1fr 90px 34px; gap: 8px; align-items: center; }
.leg select, .leg input { height: 40px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg2); padding: 0 10px; outline: none; }
.leg input { font-family: var(--f-mono); text-align: right; }
.leg button { height: 40px; border-radius: 10px; border: 1px solid var(--line); background: none; color: var(--mute); cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line2); background: none; font-size: 13px; cursor: pointer; color: var(--mute); }
.chip:hover, .chip.on { color: var(--ink); border-color: rgba(124,130,255,.6); }
textarea.input { height: 96px; padding: 10px 12px; resize: vertical; font: 12px/1.5 var(--f-mono); }
.code { font: 12px/1.5 var(--f-mono); padding: 12px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); word-break: break-all; color: #d9d7d0; }
pre.code { white-space: pre-wrap; }
.addr { font-family: var(--f-mono); font-size: 12.5px; }
.blur { filter: blur(6px); user-select: none; }
.pub-hide { transition: filter .2s; }
body.public .pub-hide { filter: blur(7px); user-select: none; }

/* toasts and modal */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { padding: 12px 14px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line2); font-size: 13.5px; box-shadow: 0 10px 40px rgba(0,0,0,.5); animation: tin .2s ease-out; }
.toast.err { border-color: rgba(255,107,107,.45); }
.toast.ok { border-color: rgba(95,227,157,.45); }
.toast a { color: var(--acc); text-decoration: underline; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); padding: 16px; }
.modal-card { position: relative; width: min(520px, 100%); max-height: 86svh; overflow: auto; background: var(--panel); border: 1px solid var(--line2); border-radius: 18px; padding: 22px; }
.modal-card .x { position: absolute; top: 12px; right: 14px; border: 0; background: none; color: var(--mute); font-size: 24px; cursor: pointer; }
.modal-card h2 { font-size: 19px; margin-bottom: 6px; }
.wlist { display: grid; gap: 8px; margin-top: 14px; }
.wlist button { display: flex; align-items: center; gap: 12px; height: 54px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line2); background: var(--bg2); cursor: pointer; font-weight: 600; text-align: left; }
.wlist button:hover { border-color: rgba(124,130,255,.6); }
.wlist img { width: 26px; height: 26px; border-radius: 6px; }

@media (max-width: 1180px) {
  .trade { grid-template-columns: 250px minmax(0, 1fr); }
  .trade .ticket { grid-column: 1 / -1; position: static; }
}
@media (max-width: 860px) {
  .bar { gap: 12px; padding: 0 12px; height: auto; min-height: 56px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .tabs { order: 3; flex-basis: 100%; }
  .pubview span { display: none; }
  #view { padding: 12px; }
  .trade, .cols { grid-template-columns: minmax(0, 1fr); }
  .mlist { position: static; max-height: 300px; }
  .chart-wrap { height: 340px; }
  .two { grid-template-columns: 1fr; }
}
.modal[hidden], [hidden] { display: none !important; }
.x-link { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--mute); }
.x-link:hover { color: var(--ink); background: rgba(255,255,255,.06); }
.x-link svg { width: 17px; height: 17px; }
.x-link[hidden] { display: none; }
