/* TOR ANONYMOUS WALLET - the dashboard pop-up and its nested windows.
 *
 * §19 of TORanonymouschat.md.  One overlay holds two layers: the dashboard card
 * and a stage of floating windows (TOKEN HOLDINGS, NFT HOLDINGS, TRANSACTION
 * HISTORY, SEND / RECEIVE, API KEY MANAGEMENT, BUY TOR).  A window is positioned
 * absolutely inside the stage, draggable by its header, and closes on its own -
 * the card behind it is never re-rendered or reset.
 *
 * The palette is the console's own (style.css :root): cyan for the wallet, green
 * for "true", red for "refused", amber for "read this".  Below 760 px the windows
 * stop floating and stack, so the same markup works on a phone.
 */
/* ABOVE THE DOOR.  style.css puts the WALLET REQUIRED cover at z-index 95, and
 * this overlay used to sit at 90: SIGN IN / REGISTER on the cover opened the
 * wallet *behind* the cover, so both buttons looked dead ("nothing moves, the
 * widget will not close").  The wallet is the way through that door, so it is
 * painted over it - 130 - and every nested window stays above its own card. */
.anonw-overlay {
  position: fixed; inset: 0; z-index: 130; overflow-y: auto;
  background: rgba(3, 5, 9, .82); backdrop-filter: blur(6px);
  padding: 18px; display: block;
}
.anonw-overlay[hidden] { display: none; }
.anonw-shell {
  position: relative; width: min(1180px, 100%); margin: 0 auto;
  min-height: calc(100vh - 36px); display: flex; align-items: flex-start;
  justify-content: flex-start; gap: 16px; pointer-events: none;
}
.anonw-card {
  pointer-events: auto; flex: 0 1 600px; min-width: 320px;
  border: 1px solid rgba(41, 224, 255, .22); border-radius: 16px;
  background: linear-gradient(180deg, #0a1017, #070a10);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .7);
  color: #d8e8ff; font: 14px/1.6 "Inter", "Segoe UI", system-ui, sans-serif;
}
.anonw-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; }
.anonw-head h2 {
  margin: 0; font-size: 13px; letter-spacing: .18em; text-transform: uppercase;
  color: #29e0ff; flex: 1;
}
.anonw-brand {
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: #6f7c90;
}
.anonw-x {
  background: none; border: 1px solid rgba(41, 224, 255, .25); color: #9aa6bb;
  border-radius: 8px; padding: 4px 10px; cursor: pointer; font: inherit;
  font-size: 11px; letter-spacing: .08em;
}
.anonw-x:hover { color: #fff; border-color: #29e0ff; }
.anonw-body { padding: 0 18px 18px; }
.anonw-pane[hidden] { display: none; }
.anonw-h3 {
  margin: 4px 0 8px; font-size: 12px; letter-spacing: .16em; color: #7fa4c8;
  text-transform: uppercase;
}
.anonw-h4 {
  margin: 18px 0 6px; font-size: 11.5px; letter-spacing: .14em;
  text-transform: uppercase; color: #29e0ff;
}
.anonw-state {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border: 1px solid rgba(41, 224, 255, .14); border-radius: 12px;
  padding: 10px 12px; margin: 10px 0; background: #080d13;
}
.anonw-who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.anonw-user { color: #ffffff; font-weight: 600; }
.anonw-addr { font-family: "Cascadia Code", Consolas, monospace; color: #7dffb2; }
.anonw-addr-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
                   margin: 6px 0; }
.anonw-addr-line code {
  font: 12.5px/1.5 "Cascadia Code", Consolas, monospace; color: #7dffb2;
  word-break: break-all;
}
.anonw-facts { display: flex; flex-direction: column; gap: 2px; margin: 10px 0 4px;
               color: #8fa3ba; font-size: 12.5px; }
.anonw-badge {
  border-radius: 999px; padding: 2px 9px; font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; border: 1px solid rgba(41, 224, 255, .3); color: #9aa6bb;
}
.anonw-badge.ok { color: #7dffb2; border-color: rgba(125, 255, 178, .45); }
.anonw-badge.bad { color: #ff8aa8; border-color: rgba(255, 138, 168, .45); }
.anonw-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.anonw-btn {
  border-radius: 10px; padding: 9px 14px; cursor: pointer; font: inherit;
  border: 1px solid rgba(41, 224, 255, .3); background: #0c141c; color: #cfe6ff;
  letter-spacing: .06em; font-size: 12.5px;
}
.anonw-btn:hover { border-color: #29e0ff; color: #fff; }
.anonw-btn.primary {
  background: linear-gradient(180deg, rgba(41, 224, 255, .9), rgba(23, 169, 196, .9));
  color: #04060c; font-weight: 700; border-color: #29e0ff;
}
.anonw-btn.danger { border-color: rgba(255, 138, 168, .45); color: #ff8aa8; }
.anonw-btn[disabled] { opacity: .45; cursor: default; }
.anonw-link {
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit;
  font-size: 11.5px; color: #29e0ff; text-decoration: underline;
}
.anonw-field { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.anonw-label { font-size: 10.5px; letter-spacing: .12em; color: #6f7c90; }
.anonw-input, .anonw-field input, .anonw-field textarea {
  width: 100%; border-radius: 10px; border: 1px solid rgba(41, 224, 255, .22);
  background: #060a10; color: #d8e8ff; padding: 9px 12px;
  font: 13px/1.5 "Cascadia Code", Consolas, monospace;
}
.anonw-field textarea, .anonw-pane textarea { min-height: 62px; resize: vertical; }
.anonw-secret {
  border: 1px dashed rgba(255, 204, 102, .5); border-radius: 10px;
  background: rgba(255, 204, 102, .07); padding: 10px 12px; margin: 10px 0;
  font: 12.5px/1.55 "Cascadia Code", Consolas, monospace; word-break: break-all;
  color: #ffe1a8;
}
.anonw-secret-card { margin: 8px 0; }
.anonw-note { color: #9aa6bb; font-size: 12.5px; margin: 6px 0; }
.anonw-note.warn { color: #ffcc66; }
.anonw-out {
  border-left: 3px solid #29e0ff; background: #080d13; border-radius: 8px;
  padding: 10px 12px; margin: 10px 0;
  font: 12px/1.5 "Cascadia Code", Consolas, monospace;
  word-break: break-all; white-space: pre-wrap; max-height: 260px; overflow: auto;
}
.anonw-foot {
  border-top: 1px solid rgba(41, 224, 255, .12); padding: 12px 18px 16px;
  color: #6f7c90; font-size: 11.5px;
}

/* ---- the six tiles ---- */
.anonw-tiles {
  display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 14px 0 10px;
}
.anonw-tile {
  text-align: left; cursor: pointer; border-radius: 12px; padding: 12px 14px;
  border: 1px solid rgba(41, 224, 255, .2); background: #0a1118; color: #d8e8ff;
  display: flex; flex-direction: column; gap: 4px; font: inherit;
}
.anonw-tile:hover { border-color: #29e0ff; background: #0c1720; }
.anonw-tile-name {
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #29e0ff;
}
.anonw-tile-note { font-size: 11.5px; color: #8fa3ba; }

/* ---- the nested windows: a column of their own beside the dashboard ---- */
.anonw-stage {
  pointer-events: none; position: relative; flex: 1 1 460px;
  min-height: calc(100vh - 36px);
}
.anonw-window {
  pointer-events: auto; position: absolute; right: 0; z-index: 40;
  width: min(520px, 100%); max-height: min(74vh, 660px);
  display: flex; flex-direction: column;
  border: 1px solid rgba(41, 224, 255, .3); border-radius: 14px;
  background: linear-gradient(180deg, #0b131b, #070c12);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .75);
  color: #d8e8ff; font: 13.5px/1.55 "Inter", "Segoe UI", system-ui, sans-serif;
}
.anonw-window-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-bottom: 1px solid rgba(41, 224, 255, .16); cursor: grab;
  touch-action: none;
}
.anonw-window-head h4 {
  margin: 0; flex: 1; font-size: 11.5px; letter-spacing: .14em;
  text-transform: uppercase; color: #29e0ff;
}
.anonw-window-tools { display: flex; gap: 6px; }
.anonw-window-body { padding: 12px 14px 16px; overflow: auto; }
.anonw-scroll { overflow: auto; max-height: 44vh; }
.anonw-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.anonw-table th {
  text-align: left; font-size: 10.5px; letter-spacing: .1em; color: #6f7c90;
  text-transform: uppercase; border-bottom: 1px solid rgba(41, 224, 255, .16);
  padding: 6px 8px; position: sticky; top: 0; background: #0b131b;
}
.anonw-table td {
  padding: 6px 8px; border-bottom: 1px solid rgba(41, 224, 255, .07);
  vertical-align: top;
}
.anonw-nft-grid {
  display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr));
}
.anonw-nft-card {
  border: 1px solid rgba(41, 224, 255, .18); border-radius: 12px; padding: 10px;
  background: #0a1118; display: flex; flex-direction: column; gap: 4px;
  font-size: 12.5px;
}
.anonw-nft-card img { width: 100%; border-radius: 8px; display: block; }
.anonw-nft-blank {
  border-radius: 8px; background: #060a10; color: #6f7c90; text-align: center;
  padding: 26px 8px; font-size: 11.5px;
}

/* ---- narrow screens: one column, the windows stack under the dashboard ---- */
@media (max-width: 1000px) {
  .anonw-overlay { padding: 8px; }
  .anonw-shell { min-height: 0; display: block; }
  .anonw-card { border-radius: 12px; flex: none; min-width: 0; }
  .anonw-tiles { grid-template-columns: 1fr; }
  .anonw-nft-grid { grid-template-columns: 1fr; }
  .anonw-stage { min-height: 0; display: block; }
  .anonw-window {
    position: static !important; width: 100% !important; max-height: none;
    margin: 10px 0 0;
  }
  .anonw-window-head { cursor: default; }
  .anonw-scroll { max-height: none; }
}

