/* ============================================================================
   WRAITHGRID dashboard
   Shares the site's tokens; adds the pieces a dashboard needs and the landing
   page does not - telemetry, filters, dense cards, dialogs, tables.
   ========================================================================= */

body {
  padding-top: 68px;
}

/* The ambient field sits behind everything, fixed, and never intercepts a click. */
#ambient {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 78%);
}
body > *:not(#ambient) {
  position: relative;
  z-index: 1;
}

.app-head {
  padding: 34px 0 0;
}
.app-head h1 {
  font-size: clamp(30px, 4vw, 46px);
  margin: 4px 0 10px;
  letter-spacing: -0.02em;
}

/* ------------------------------------------------------------------ telemetry */

.telemetry {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  margin: 28px 0 6px;
}
.tm {
  background: var(--panel);
  padding: 15px 17px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.tm-wide {
  grid-column: span 2;
  justify-content: center;
}
@media (max-width: 620px) {
  .tm-wide {
    grid-column: span 1;
  }
}
.tm-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dimmer);
}
.tm-value {
  font-family: var(--mono);
  font-size: 25px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.tm-sub {
  font-size: 11.5px;
  color: var(--dim);
  line-height: 1.4;
}
#tmClassBar {
  width: 100%;
  height: 10px;
  border-radius: 3px;
  margin: 7px 0 5px;
}

/* ----------------------------------------------------------------------- tabs */

nav.tabs {
  display: flex;
  gap: 2px;
  margin: 26px 0 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
nav.tabs button {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--dim);
  font-family: var(--display);
  font-size: 14.5px;
  padding: 13px 17px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
nav.tabs button:hover {
  color: var(--ink);
}
nav.tabs button[aria-selected="true"] {
  color: var(--teal);
  border-bottom-color: var(--teal);
}

main.app {
  padding: 0 0 100px;
}
section.pane {
  display: none;
  padding-top: 26px;
}
section.pane[data-active] {
  display: block;
}
.pane-intro {
  max-width: 68ch;
  margin-bottom: 22px;
}
.pane-intro h2 {
  font-size: 22px;
  margin: 0 0 8px;
}
.pane-intro .lede {
  font-size: 15px;
  margin: 0;
}

/* -------------------------------------------------------------------- filters */

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 18px 26px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: color-mix(in srgb, var(--panel) 80%, transparent);
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.filter-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dimmer);
}
.filter-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
  padding-bottom: 4px;
}

select.mini,
input.mini {
  background: var(--ground);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 8px 11px;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 12.5px;
  min-width: 150px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.chip {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--ground);
  color: var(--dim);
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.chip:hover {
  color: var(--ink);
}
.chip[aria-pressed="true"] {
  color: var(--teal);
  border-color: color-mix(in srgb, var(--teal) 45%, transparent);
  background: color-mix(in srgb, var(--teal) 10%, transparent);
}
.chip.static {
  cursor: default;
}
.chip.static:hover {
  color: var(--dim);
}

/* ------------------------------------------------------------------ card grid */

.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  margin-top: 20px;
}

.dev-card {
  display: flex;
  flex-direction: column;
  gap: 13px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.dev-card:hover {
  border-color: color-mix(in srgb, var(--wraith) 45%, var(--line));
  transform: translateY(-2px);
}
.dev-top {
  display: flex;
  gap: 13px;
  align-items: flex-start;
}
.dev-thumb {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--ground);
  flex: none;
}
.dev-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dev-title {
  min-width: 0;
}
.dev-title h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.sub {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11.5px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.pill {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--dim);
  text-transform: uppercase;
  white-space: nowrap;
}
.pill.on {
  color: var(--green);
  border-color: rgba(110, 231, 168, 0.35);
}
.pill.off {
  color: var(--dimmer);
}
.pill.warn {
  color: var(--amber);
  border-color: rgba(245, 181, 68, 0.35);
}
.pill.bad {
  color: var(--red);
  border-color: rgba(255, 107, 107, 0.35);
}
.pill.brand {
  color: var(--wraith);
  border-color: rgba(155, 77, 224, 0.4);
}
.pill.teal {
  color: var(--teal);
  border-color: rgba(111, 227, 210, 0.35);
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.metric b {
  font-family: var(--mono);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.metric span {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dimmer);
}

.dev-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.price {
  font-family: var(--mono);
  font-size: 21px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.price small {
  font-size: 11.5px;
  color: var(--dim);
}
.ring-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
canvas.ring {
  width: 34px;
  height: 34px;
}
canvas.repbar {
  width: 100%;
  height: 8px;
  display: block;
}

/* ------------------------------------------------------------------- earnings */

.earnings {
  margin-top: 22px;
}
.earn-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 14px;
}
.earn-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  background: var(--panel);
}
.earn-row b {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.earn-row .grow {
  flex: 1;
}

/* -------------------------------------------------------------------- dialogs */

dialog {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  width: min(470px, 94vw);
  max-height: 88vh;
  overflow-y: auto;
}
dialog.wide {
  width: min(860px, 94vw);
}
dialog::backdrop {
  background: rgba(3, 4, 7, 0.82);
  backdrop-filter: blur(5px);
}
.dlg-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  color: var(--dim);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.dlg-close:hover {
  color: var(--ink);
}
dialog h4 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dimmer);
  margin: 26px 0 12px;
}

label {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 16px 0 6px;
}
input,
select {
  width: 100%;
  background: var(--ground);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 11px 13px;
  border-radius: 9px;
  font-family: var(--mono);
  font-size: 14px;
}
input:focus,
select:focus {
  border-color: var(--teal);
  outline: none;
}

.dev-head {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.dev-art {
  width: 132px;
  height: 132px;
  flex: none;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--ground);
}
.dev-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dev-head h3 {
  margin: 2px 0 4px;
  font-size: 23px;
}
.dev-body {
  display: grid;
  gap: 26px;
  grid-template-columns: 1.15fr 0.85fr;
  margin-top: 26px;
}
@media (max-width: 680px) {
  .dev-body {
    grid-template-columns: 1fr;
  }
  .dev-head {
    flex-direction: column;
  }
}
canvas.plot {
  width: 100%;
  height: 190px;
  display: block;
}

dl.spec {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px 18px;
  margin: 0;
  font-size: 13.5px;
}
dl.spec dt {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dimmer);
  align-self: center;
}
dl.spec dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
dl.wide-spec {
  grid-template-columns: auto 1fr;
}
dl.spec dd .note {
  display: block;
  font-family: var(--display);
  font-size: 12px;
  color: var(--dim);
  margin-top: 3px;
}

.dev-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.rent-summary {
  display: grid;
  gap: 8px;
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ground);
}
.rent-summary div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}
.rent-summary span {
  color: var(--dim);
}
.rent-summary b {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.ep-urls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.ep-url {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ground);
  font-family: var(--mono);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.ep-url .name {
  color: var(--teal);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.12em;
  flex: none;
}
pre.code {
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink);
}

/* --------------------------------------------------------------------- tables */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table th {
  text-align: left;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dimmer);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}
table td button {
  margin-right: 6px;
}
.tbl-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: color-mix(in srgb, var(--panel) 70%, transparent);
}

/* --------------------------------------------------------------------- toasts */

#toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 80;
}
.toast {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  padding: 13px 17px;
  border-radius: 10px;
  max-width: 380px;
  font-size: 13.5px;
  animation: toastIn 0.25s var(--ease);
}
.toast.err {
  border-left-color: var(--red);
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(14px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .toast {
    animation: none;
  }
  .dev-card:hover {
    transform: none;
  }
}

.muted {
  color: var(--dim);
}
.small {
  font-size: 12.5px;
  line-height: 1.6;
}
.empty {
  grid-column: 1 / -1;
  padding: 44px 20px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--r);
  color: var(--dim);
}
.empty b {
  display: block;
  color: var(--ink);
  font-family: var(--display);
  margin-bottom: 6px;
}

/* A machine with no on-chain art still needs a face. */
.thumb-mark {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--teal);
  background: linear-gradient(150deg, rgba(155, 77, 224, 0.22), rgba(111, 227, 210, 0.1));
}
.thumb-mark.big-mark {
  font-size: 26px;
}

/* Collateral controls sit inline: token, amount, and the two things you can do with it. */
.stake-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr auto auto;
  gap: 8px;
  align-items: center;
}
.stake-row select,
.stake-row input {
  min-width: 0;
}
@media (max-width: 520px) {
  .stake-row {
    grid-template-columns: 1fr 1fr;
  }
}
