/* Equinox console */
.app-main { padding: 28px 0 60px; }
.app-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 20px; }
.app-head h1 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0; }
.app-head .sub { color: var(--text-2); margin: 4px 0 0; font-size: 0.95rem; }
.app-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.banner {
  display: none; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-radius: 12px; margin-bottom: 18px;
  border: 1px solid rgba(255, 180, 67, 0.4); background: rgba(255, 180, 67, 0.09); color: var(--text);
  font-size: 0.92rem;
}
.banner.show { display: flex; }
.banner strong { color: var(--warn); }
.banner code { background: rgba(0, 0, 0, 0.25); border-color: rgba(255, 180, 67, 0.3); }
.banner .spacer { flex: 1; }

.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-7 { grid-column: span 7; }
.col-12 { grid-column: span 12; }
@media (max-width: 1000px) { .col-4 { grid-column: span 6; } .col-5, .col-7 { grid-column: span 12; } }
@media (max-width: 640px) { .col-4 { grid-column: span 12; } }

.panel { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-head h2 { font-size: 1rem; margin: 0; letter-spacing: 0; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.panel-head h2 svg { width: 16px; height: 16px; color: var(--green-text); }

.kv dd > code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; font-size: 0.92rem; align-items: center; }
.kv dt { color: var(--text-3); margin: 0; }
.kv dd { margin: 0; color: var(--text); font-weight: 500; display: flex; align-items: center; gap: 8px; min-width: 0; }
.mono { font-family: var(--font-mono); font-size: 0.85em; }
.addr { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.addr code { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); flex: none;
}
.mini-btn:hover { color: var(--text); border-color: var(--border-strong); }
.mini-btn svg { width: 13px; height: 13px; }

.balances { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bal { padding: 12px 14px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); }
.bal .lbl { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); font-weight: 600; }
.bal .val { font-family: var(--font-display); font-size: 1.55rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin-top: 2px; }
.bal .val small { font-size: 0.75rem; color: var(--text-3); font-family: var(--font-sans); font-weight: 500; margin-left: 4px; }
.bal.usdg .val { color: var(--green-text); }

.budget { display: flex; gap: 18px; align-items: center; }
.ring { position: relative; width: 120px; height: 120px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { fill: none; stroke: var(--surface-2); stroke-width: 10; }
.ring .bar { fill: none; stroke: url(#ringGrad); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 314; stroke-dashoffset: 314; transition: stroke-dashoffset 0.9s var(--ease); }
.ring .bar.warn { stroke: var(--warn); }
.ring .bar.danger { stroke: var(--danger); }
.ring .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1.1; }
.ring .center strong { font-family: var(--font-display); font-size: 1.35rem; letter-spacing: -0.02em; }
.ring .center span { font-size: 0.7rem; color: var(--text-3); }
.budget-facts { flex: 1; min-width: 0; display: grid; gap: 8px; }
.fact { display: flex; justify-content: space-between; gap: 10px; font-size: 0.9rem; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.fact:last-child { border-bottom: 0; }
.fact span { color: var(--text-3); }
.fact strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-line { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar-line i { display: block; height: 100%; width: 0; background: var(--grad); border-radius: 999px; transition: width 0.9s var(--ease); }

.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { padding: 12px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); text-align: center; }
.stat .val { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; }
.stat .lbl { font-size: 0.72rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }

/* Try it */
.try-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 860px) { .try-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.8rem; font-weight: 600; color: var(--text-2); }
.input, .select {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  font-size: 0.92rem; min-height: 42px; transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(153, 69, 255, 0.25); }
.input.mono { font-size: 0.85rem; }
.select { appearance: none; -webkit-appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8ea6' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.row { display: grid; grid-template-columns: 120px 1fr; gap: 10px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hint { font-size: 0.8rem; color: var(--text-3); margin: 0; }
.hint a { cursor: pointer; }
.result { min-height: 240px; display: flex; flex-direction: column; }
.result .code { flex: 1; display: flex; flex-direction: column; }
.result .code pre { flex: 1; min-height: 200px; max-height: 420px; }
.result-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 28px; }
.result-empty { color: #6b7088; font-family: var(--font-sans); font-style: italic; }

/* History table */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; min-width: 760px; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
th { color: var(--text-3); font-weight: 600; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td .mono { color: var(--text-2); }
td a.mono { color: var(--violet-text); }
td.num { font-variant-numeric: tabular-nums; font-weight: 600; }
.empty-row td { text-align: center; color: var(--text-3); padding: 28px; white-space: normal; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 400; display: none; align-items: center; justify-content: center; padding: var(--gutter); }
.modal.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(4, 4, 10, 0.7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal-card { position: relative; width: 100%; max-width: 460px; padding: 24px; background: var(--surface-solid); border-radius: var(--radius-lg); animation: modal-in 0.3s var(--ease); }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-card h2 { font-size: 1.2rem; margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.modal-card .warn-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 180, 67, 0.15); color: var(--warn); }
.modal-card .warn-icon svg { width: 18px; height: 18px; }
.modal-card p { color: var(--text-2); font-size: 0.92rem; }
.modal-amount { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; letter-spacing: -0.03em; margin: 8px 0 2px; }
.modal-amount small { font-size: 0.9rem; color: var(--text-3); font-family: var(--font-sans); font-weight: 500; margin-left: 6px; }
.modal-card .kv { margin: 14px 0 20px; }
.modal-card .kv dd { word-break: break-all; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.status-dot.ok { background: var(--green); box-shadow: 0 0 0 3px rgba(20, 241, 149, 0.2); }
.status-dot.bad { background: var(--warn); box-shadow: 0 0 0 3px rgba(255, 180, 67, 0.2); }

.skeleton { position: relative; overflow: hidden; color: transparent !important; background: var(--surface-2); border-radius: 6px; }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent); animation: shimmer 1.2s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.hint-warn { color: var(--warn, #f5a524); }
.hint code { font-family: var(--font-mono); font-size: 0.85em; }
