/* Also load mir-db-common.css for DB browsers */
/* Kill legacy purple FOUC from old static site CSS */
body.mir-evolved {
  background-image: none !important;
}
body.mir-evolved.api-page {
  background: transparent !important;
}

/* Mir tools — Godlike dark skin for api-pages widgets */
.mir-app .api-card { max-width: none; background: transparent; box-shadow: none; padding: 0; color: #e8e8e8; }
.mir-app .api-card h1 { display: none; } /* shell title */
.mir-app .api-card .sub, .mir-app .sub { color: rgba(255,255,255,.65); }
.mir-app .api-search, .mir-app input[type=search], .mir-app input[type=text], .mir-app input[type=password], .mir-app input[type=number], .mir-app select {
  background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.15); color: #fff; border-radius: 4px; padding: 10px 12px;
}
.mir-app .api-table { width: 100%; border-collapse: collapse; color: #e8e8e8; }
.mir-app .api-table th { text-align: left; padding: 10px; border-bottom: 1px solid rgba(255,255,255,.15); color: rgba(255,255,255,.85); background: rgba(0,0,0,.35); }
.mir-app .api-table td { padding: 10px; border-bottom: 1px solid rgba(255,255,255,.06); color: rgba(255,255,255,.88); }
.mir-app .api-table thead { background: rgba(0,0,0,.35); }
.mir-app .market-toolbar { display:flex; flex-wrap:wrap; gap:12px; align-items:center; margin:8px 0 14px; }
.mir-app .modal-img { width:72px; height:72px; object-fit:contain; background:rgba(0,0,0,.45); border:1px solid rgba(255,255,255,.12); border-radius:8px; padding:6px; }
.mir-app .modal-meta { color:rgba(255,255,255,.65); font-size:.92rem; line-height:1.5; }
.mir-app .modal-top { display:flex; gap:16px; align-items:flex-start; }
.mir-app .modal-field label { display:block; font-weight:700; font-size:.85rem; margin-bottom:6px; color:rgba(255,255,255,.75); }
.mir-app .modal-actions { display:flex; gap:10px; align-items:center; justify-content:space-between; flex-wrap:wrap; }
.mir-app .modal-price { font-size:1.15rem; font-weight:800; color:#fbbf24; }
.mir-app .modal-gold { font-size:.9rem; color:#fdba74; font-weight:700; }
.mir-app .login-hint { color:#fbbf24; font-size:.9rem; }
.mir-app .buy-inline { background:#b42828; color:#fff; border:0; border-radius:6px; padding:6px 12px; font-weight:700; cursor:pointer; }

/* Account / market stats — readable value + label */
.mir-app .stat-grid-top {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px 14px;
  margin: 12px 0 20px;
  padding-bottom: 4px;
}
.mir-app .stat {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #fff;
  line-height: 1.35;
}
.mir-app .stat b {
  color: #fff;
  font-weight: 800;
}
.mir-app .stat-label {
  color: rgba(255, 255, 255, 0.62);
  font-weight: 500;
  font-size: 0.92rem;
}
.mir-app .dash-panel {
  padding-bottom: 28px;
  margin-bottom: 12px;
  min-height: 140px;
}
.mir-app .api-card {
  padding-bottom: 28px;
}
.mir-app .api-card > .sub {
  margin-bottom: 18px;
  line-height: 1.5;
  overflow: visible;
}

/* Discord link panel on Account */
.mir-app .discord-link-panel {
  margin: 8px 0 22px;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}
.mir-app .discord-link-panel h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: #fff;
}
.mir-app .discord-link-copy {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.5;
}
.mir-app .discord-link-copy code,
.mir-app .discord-link-panel code {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 1px 6px;
  color: #fbbf24;
  font-size: 0.92em;
}
.mir-app .discord-code {
  color: #fbbf24;
  letter-spacing: 0.06em;
  font-size: 1.15em;
}
.mir-app .discord-id {
  color: rgba(255, 255, 255, 0.55);
  font-weight: 500;
}
.mir-app .discord-link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.mir-app .discord-link-panel .api-msg {
  margin-top: 10px;
}

/* Modals live on <body> (moved out of overflow:hidden ancestors).
   Use mir-modal-* — never Bootstrap's .modal / .modal-backdrop (display:none conflict). */
body.mir-evolved .mir-modal-backdrop,
#itemModal.mir-modal-backdrop,
#consignModal.mir-modal-backdrop,
#modal.mir-modal-backdrop {
  display: none;
  position: fixed !important;
  inset: 0 !important;
  z-index: 100050 !important;
  background: rgba(0, 0, 0, 0.72) !important;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}
body.mir-evolved .mir-modal-backdrop.open,
#itemModal.mir-modal-backdrop.open,
#consignModal.mir-modal-backdrop.open,
#modal.mir-modal-backdrop.open {
  display: flex !important;
}
body.mir-evolved .mir-modal-panel,
#itemModal .mir-modal-panel,
#consignModal .mir-modal-panel,
#modal .mir-modal-panel {
  display: block !important;
  background: #12151c !important;
  border: 1px solid rgba(180, 40, 40, 0.45) !important;
  border-radius: 12px !important;
  width: min(560px, 100%) !important;
  color: #eee !important;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  max-height: min(90vh, 720px);
  overflow-y: auto;
}
body.mir-modal-open {
  overflow: hidden;
}
body.mir-evolved .modal-close {
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
}
body.mir-evolved .modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
body.mir-evolved .mir-modal-body {
  padding: 16px 18px;
  display: grid;
  gap: 12px;
}
body.mir-evolved .stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  padding: 12px;
  color: rgba(255, 255, 255, 0.85);
}
.mir-app .api-table tbody tr { cursor: pointer; }
.mir-app .api-table tbody tr:hover, .mir-app .api-table tbody tr.selected { background: rgba(180,40,40,.25); }
.mir-app .gold-pill { background: rgba(245,158,11,.15); border: 1px solid rgba(245,158,11,.45); color: #fbbf24; padding: 8px 14px; border-radius: 999px; font-weight: 700; }
.mir-app .buy-inline, .mir-app .api-btn, .mir-app .modal-buy {
  background: #b42828; color: #fff; border: 0; border-radius: 6px; padding: 8px 14px; font-weight: 700; cursor: pointer;
}
.mir-app .api-btn.secondary { background: rgba(255,255,255,.1); }
.mir-app .mir-modal-backdrop { display:none; position:fixed; inset:0; z-index:3000; background:rgba(0,0,0,.7); align-items:center; justify-content:center; padding:20px; }
.mir-app .mir-modal-backdrop.open { display:flex; }
.mir-app .mir-modal-panel { display:block; background:#12151c; border:1px solid rgba(180,40,40,.4); border-radius:12px; width:min(560px,100%); color:#eee; overflow:hidden; }
.mir-app .modal-head { display:flex; justify-content:space-between; gap:12px; padding:16px 18px; border-bottom:1px solid rgba(255,255,255,.1); }
.mir-app .mir-modal-body { padding:16px 18px; display:grid; gap:12px; }
.mir-app .modal-close { border:0; background:rgba(255,255,255,.08); color:#fff; width:36px; height:36px; border-radius:8px; cursor:pointer; }
.mir-app .stat-grid { display:grid; grid-template-columns:1fr 1fr; gap:6px 12px; background:rgba(0,0,0,.35); border-radius:8px; padding:12px; }
.mir-app .api-msg { margin-top:10px; }
.mir-app .api-msg.err { color:#ff8a80; }
.mir-app .api-msg.ok { color:#86efac; }
.mir-app .dash-tabs { display:flex; flex-wrap:wrap; gap:8px; margin:16px 0; }
.mir-app .dash-tabs button { background:rgba(0,0,0,.4); border:1px solid rgba(255,255,255,.12); color:#fff; padding:8px 14px; border-radius:4px; cursor:pointer; }
.mir-app .dash-tabs button.active { border-color:#b42828; background:rgba(180,40,40,.35); }
.mir-article img { max-width:100%; height:auto; }
.mir-guide-body { color:rgba(255,255,255,.85); line-height:1.65; }
.mir-guide-body a { color:#f0c14b; }

/* Public character profile */
.mir-app .mir-profile-heading {
  margin: 22px 0 10px;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,.78);
}
.mir-app .mir-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px 16px;
}
.mir-app .mir-profile-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
}
.mir-app .mir-profile-label {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
}
.mir-app .mir-profile-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  word-break: break-word;
}
.mir-app .mir-profile-value a { color: #8ab4ff; text-decoration: none; }
.mir-app .mir-profile-value a:hover { text-decoration: underline; }

