@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&display=swap');

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;600;700&display=swap');

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700;800&display=swap');




		:root{
			/* Build marker — bump on every CSS edit. Read at runtime via
			   getComputedStyle(documentElement).getPropertyValue('--katomia-css-build')
			   to detect whether the browser applied a stale (cached) stylesheet. */
			--katomia-css-build: "20260701-authpanel-1";

			--bg-color: #f5f5f5;

			--thumb-size: 48px;
			--thumb-overlap-ratio: 0.85;
			--asset-gap: 3px;

			--thumb-collapse-left: calc(var(--asset-gap) - (var(--thumb-size) * var(--thumb-overlap-ratio)));

      --font-main: 'Inter', system-ui, sans-serif;
      --zzfont-main: 'Work Sans', system-ui, sans-serif;
      --zzfont-main: 'Nunito', system-ui, sans-serif;
      --zzfont-main: 'Plus Jakarta Sans', system-ui, sans-serif;
      --zz-font-main: 'Manrope', system-ui, sans-serif;
      --zz-font-main: 'DM Sans', system-ui, sans-serif;
      --zznope-font-main: 'Outfit', system-ui, sans-serif;
      --zzfont-main: 'Source Sans 3', system-ui, sans-serif;

      --font-mono: 'JetBrains Mono', monospace;

  
			/* examples not in use */
			--text-color: #222;
			--accent: #4a90e2;
			--gap: 12px;
		}


    
    body .mode-debug, body .mode-order, body .mode-proposal{ display:none; }

    body[data-trading-mode="proposal"] .mode-proposal,
    body[data-trading-mode="debug"] .mode-proposal{ display:block; }

    body[data-trading-mode="debug"] .mode-debug{ display:block; }

    body[data-trading-mode="debug"] .mode-order,
    body[data-trading-mode="orderBook"] .mode-order{ display:block; }


    .debug-only{ display:none; }
    body[data-trading-mode="debug"] .debug-only{ display:inline-flex; }

    /* Nerd mode — user-facing detail toggle (mirrors KEA pro mode) */
    .nerd-only{ display:none !important; }
    body.nerd .nerd-only{ display:inline !important; }
    body.nerd .nerd-hide{ display:none !important; }

    .account-xproof-label{
      font-size:11px;
      color:#666;
      opacity:0.8;
      margin-top:2px;
    }


    body[data-network="mainnet"]{
      --network-color: #7A1B80;
    }

    body[data-network="testnet"]{
      --network-color: #FF4D00;
    }

    body[data-network="playnet"]{
      --network-color: #F4B400;
    }


    .tx-pending{
      display:flex;
      gap:4px;
      margin-top:2px;
      align-items:center;
    }

    .tx-pending a{
      font-size:12px;
      line-height:1;
    }


    .tx-pending{
      margin-top:0;
    }


    .tx-pending{
      margin-top:0;
    }



		.asset.thumb-only{
			padding:0;
			margin:2px;
			background:none;
			line-height:0;
		}

		.asset.thumb-only{
			padding-left:0;
		}

		.asset.thumb-only .asset-thumb{
			display:block;
			width:var(--thumb-size);
			height:var(--thumb-size);
			object-fit:cover;
			margin:0;
		}
		
    .asset:hover::after{
      content: attr(data-asset-name) " 🪙 " attr(data-asset-id);

      position:absolute;
      left:0;
      bottom:100%;

      display:block;

      background:#222;
      color:#fff;

      padding:6px 8px;
      font-size:11px;
      line-height:1.2;

      white-space:nowrap;

      border-radius:6px;                /* softer corners */
      box-shadow:0 4px 10px rgba(0,0,0,0.18);  /* floating feel */

      transform:translateY(-4px);       /* slight lift */

      zzbackground:#2a2a2a;

      z-index:1000;
    }

    /* Clamp horizontal overflow at the document level. Diagnostics proved the
       page sometimes overflows horizontally (docOverflowX up to ~180px), which
       inflates the layout viewport; the fixed full-screen create-order modal
       then sizes to that inflated width and looks "too wide" before snapping
       back. Clipping page-level x-overflow keeps the layout viewport == visible
       width so the modal is always correct. (overflow-x:hidden, not clip, for
       widest mobile support.) */
    html{ overflow-x:hidden; }

    body{
      background: var(--bg-color);
      font-family: var(--font-main);
      margin:16px;
      overflow-x:hidden;
    }

    label:has(#showTradingAccounts){ display:none; }
    body[data-trading-mode="debug"] label:has(#showTradingAccounts){ display:flex; }



    .section-controls{ display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin:0 0 10px 18px; font-size:12px; color:#666; }
    .section-controls-title{ font-size:11px; font-weight:600; opacity:.7; text-transform:uppercase; letter-spacing:.4px; }
    .section-controls label{ display:flex; align-items:center; gap:5px; cursor:pointer; }
    .section-controls input{ margin:0; }

    .section-controls button{
      min-width:26px;
      min-height:26px;
      padding:3px 7px;
      background:#eee;
      color:#555;
      border:none;
      border-radius:6px;
      font-size:12px;
    }

    .section-controls button:hover{
      background:#ddd;
    }

    @media (max-width:699px){ .section-controls-title{ width:100%; } }


    h2{
      margin-top:0;
      margin-bottom:10px;
    }


    .game-meta{
      margin:0 0 13px 0;
      font-size:10px;
      color:#555;
    }
		
		
    .controls{
      display:flex;
      flex-wrap:wrap;
      gap:12px;
      align-items:center;
      margin-bottom:12px;
    }


    .header{
      display:grid;
      grid-template-columns:1.4fr 0.8fr 3fr 3fr 3fr;
      gap:10px;
      font-weight:bold;
			border-bottom:2px solid #bbb;
      zzmargin-bottom:6px;
			
			margin-left:-16px;
			margin-right:-16px;
			padding-left:16px;
			padding-right:16px;
	
    }

    .header > div{
      padding:8px 10px;
			color:#666;
			font-weight:600;
    }

    .account-row{
      border-top:1px solid #ddd;
      padding:8px 0;
			zzborder-top:none;
			zzmargin-bottom:3px;
    }

		.account-row{
			margin-left:-16px;
			margin-right:-16px;
			padding-left:16px;
			padding-right:16px;
		}

		.account-row{
			border-top:1px solid #ddd;
			padding:8px 16px;
			margin-left:-16px;
			margin-right:-16px;
		}

		.account-row[data-mode="lock"]{
			zzpink_background:#ffe9ec;
		}

		.account-row[data-mode="shop"]{
			background:#e6f2ff; 
		}


		.account-row[data-mode="lock"]{
			zzbackground:#ffe9ec;   /* pale pink */
			zzbackground:#fad098;   /* pale amber */
			background:#fde9ce; 
			opacity:0.72;
		}


    body[data-view-mode="columns"][data-show-traded-only="true"] 
    .account-row > :nth-child(3){
      max-height:52px;
      overflow:hidden;
    }

    body[data-view-mode="columns"][data-show-traded-only="true"] 
    .account-row > :nth-child(3) .asset{
      opacity:0.12;
    }

    body[data-view-mode="columns"][data-show-traded-only="true"] 
    .account-row > :nth-child(3){
      --thumb-size: 24px;
    }


    body[data-view-mode="columns"] .hint-mobile{
      display:none;
    }

    body[data-view-mode="merged"] .hint-desktop{
      display:none;
    }

    .account-row.columns{
      display:grid;
      grid-template-columns:1.4fr 0.8fr 3fr 3fr 3fr;
      gap:10px;
      align-items:stretch;
    }

    .account-row.merged{
      display:block;
    }

		.account-row[data-mine="true"]:has(+ .account-row[data-mine="false"]),
		.account-row[data-mine="true"]:last-child{
			zzborder-bottom:3px solid #000;
			border-bottom:6px solid #bbb;
			zzmargin-bottom:8px;
			padding-bottom:12px;
		}


    .settings{
      display:flex;
      flex-wrap:wrap;
      gap:10px;
      align-items:center;
      margin-bottom:8px;
      font-weight:bold;
    }

		.settings .mode{
			margin-left:auto;
		}

		.account-row.columns > .name {
			cursor:pointer;
		}


		.name{
			display:flex;
			flex-direction:column;
			padding-left:8px;
		}


		.fill-btn{
			cursor:pointer;
			margin-left:6px;
			margin-bottom:6px;
			margin-top:auto;
      font-size:1.4em;

		}

    .fill-btn::before{
      content:"🚰";
    }
        
		.exit-btn{
			cursor:pointer;
			margin-left:6px;
			margin-bottom:6px;
			margin-top:auto;
		}


    .mode{
      font-size:0.8em;
      font-weight:300;
      padding:2px 6px;
      line-height:1.3;
      text-align:center;
      opacity:0.8;

      display:flex;
      justify-content:center;
    }

		.mode.clickable{
			cursor:pointer;
		}



    .column,
    .assets{
      min-height:68px;
      padding:6px;
      border:1px dashed #aaa;
      background:#fff;
    }


    .drop-target.drag-over{
      background:#f5f5f5;
    }

		.zzasset{
			display:inline-block;
			margin:3px;
			padding:4px 8px;
			background:#eee;
			user-select:none;
			vertical-align:top;
			position:relative;
			z-index:10;
		}
		
		.asset{
			border-radius:8px;
      overflow:visible;
			display:inline-block;
			margin:3px;
			padding:4px 8px;
			background:#eee;
			user-select:none;
			vertical-align:top;
			position:relative;
		}

    .asset.thumb-only{
      background:none;
    }
    
		.asset.basket{
			border-top-left-radius:0;
			border-bottom-left-radius:0;
		}

    .asset.clickable{
      cursor:pointer;
    }

		
    .asset.reserved{
      opacity:0.4;
    }

    .asset.basket{
      zzbackground:#dff6ff;
    }

    .asset.selected{
      outline:2px solid #000;
      outline-offset:1px;
    }

    .hint{
      font-size:12px;
      color:#555;
      margin-bottom:10px;
    }

    .subtle{
      color:#666;
      font-weight:normal;
      font-size:12px;
      margin-left:6px;
    }


    .orders-details > summary{
      font-size:13px;
      font-weight:600;
      opacity:.7;
      text-transform:uppercase;
      letter-spacing:.4px;
      cursor:pointer;
      margin-bottom:8px;
    }

    .muted{
      color:#666;
    }

    @media (max-width: 699px){
      .header{
        display:none !important;
      }

      .account-row.columns{
        display:block;
      }

      .account-row.columns > .name,
      .account-row.columns > .mode{
        display:none;
      }
    }
				
				
		#game{
			position:relative;
		}

		.trade-line-layer{
			position:absolute;
			inset:0;
			width:100%;
			height:100%;
			pointer-events:none;
			z-index:5;
		}

		.trade-line-layer line{
			stroke:#999;
			stroke-width:1;
			stroke-dasharray:4 4;
		}

.asset-modal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.45);
  display:flex;
	align-items:flex-start;
  justify-content:center;
  z-index:2000;
	padding-top:20px;
	padding-bottom:20px;
}

.asset-modal.hidden{
  display:none;
}

.asset-modal-card{
  position:relative;
}

.asset-modal-close{
  position:absolute;
  top:8px;
  right:10px;
  font-size:18px;
  cursor:pointer;
  opacity:0.6;
}

.asset-modal-close:hover{
  opacity:1;
}

.asset-modal-card{
  background:#fff;
  border-radius:8px;
  padding:16px;
  width:90%;
  max-width:360px;
  max-height:90vh;
  overflow-y:auto;
}

.asset-modal-preview img{
  width:72px;
  height:72px;
  object-fit:cover;
}

.asset-modal-target{
  padding:6px 8px;
  border:1px solid #ddd;
  border-left-width:8px;
  margin-top:6px;
  cursor:pointer;
}


.asset-modal-amount-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-top:8px;
}

.asset-modal-input input{
  width:80px;
}

.asset-modal-stop:hover{
  color:#000;
}

@media (max-width:699px){
  label:has(#viewToggle){
    display:none;
  }
}

.desktop-toggle{
  cursor:pointer;
}

@media (max-width:699px){
  .desktop-toggle{
    display:none;
  }
}
.asset.thumb-stack-item{
  position: relative;
}

.asset.thumb-stack-collapsed{
  margin:3px 3px 3px var(--thumb-collapse-left);
}

.asset.thumb-stack-first{
  margin-left: 3px;
}

.asset.thumb-stack-last{
  margin-right: 6px;
}



.asset-thumb{
  border-radius:6px;
  box-shadow:0 0 2px rgba(0,0,0,0.18);
}

.asset.thumb-stack-item .asset-thumb{
  border:2px solid #fff;
  box-sizing:border-box;
  background:#fff;
}



#notifications{
  position:fixed;
  top:10px;
  left:50%;
  transform:translateX(-50%);
  width:min(600px,90%);
  z-index:9999;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.notice{
  padding:10px 14px;
  border-radius:6px;
  font-family:sans-serif;
  color:white;
  display:flex;
  justify-content:space-between;
  align-items:center;
  backdrop-filter:blur(4px);

  zzopacity:0.95; /* slightly translucent */

  box-shadow:0 4px 10px rgba(0,0,0,0.15); /* gentle lift */
  border:1px solid rgba(0,0,0,0.08); /* subtle edge */

  transition:opacity .4s ease;
}

.notice.fade-out{
  opacity:0;
}

.notice.error{
  background:#F8D7DA;
  color:#842029;
}

.notice.warning{
  background:#FFF3CD;
  color:#664D03;
}

.notice.info,
.notice.event{
  background:#CFE2FF;
  color:#084298;
}


.notice.success{
  background:#D1E7DD;
  color:#0F5132;
}

.notice.debug{
  background:#E2E3E5;
  color:#41464B;
}
.notice button{
  background:none;
  border:none;
  color:inherit;
  font-size:16px;
  cursor:pointer;
  margin-left:10px;
}

.notice{
  animation:slideIn .2s ease;
}

@keyframes slideIn{
  from{ transform:translateY(-8px); opacity:0 }
  to{ transform:translateY(0); opacity:1 }
}



body[data-view-mode="merged"] .name{
  flex-direction:row;
  align-items:center;
  gap:6px;
}

body[data-view-mode="merged"] .tx-pending{
  margin-top:0;
}


body[data-view-mode="merged"] .exit-btn{
  display:none;
}

.exit-game-btn{
  display:flex;
  align-items:center;
  justify-content:center;

  margin:16px auto;

  font-size:20px;
  cursor:pointer;

  width:40px;
  height:40px;

  border-radius:6px;
  zzbackground:#eee;
}

body[data-view-mode="columns"] .exit-game-btn{
  display:none;
}

.exit-game-btn:hover{
  background:#ddd;
}

.asset-modal-name{
  font-weight:bold;
}


.game-meta{
  margin-bottom:14px;
}

.game-title-row{
  display:flex;
  align-items:baseline;
  gap:8px;   /* space between title + pill */
}

.game-title{
  font-size:20px;
  font-weight:700;
  color:#444;   /* softer than #000 */
}

/* network badge */
.game-network{
  font-size:16px;          /* bigger, closer to title */
  font-weight:700;

  padding:6px 10px;        /* more height */
  border-radius:8px;

  display:inline-flex;
  align-items:center;

  background: var(--network-color);
  color:#fff;

  line-height:1;           /* keeps it tight */
  letter-spacing:0.2px;

  box-shadow:0 1px 2px rgba(0,0,0,0.08);
  opacity:0.8;
}


/* small meta row */
.game-meta-row{
  margin-top:4px;
  font-size:11px;
  color:#666;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  row-gap:0;

}

/* default */
body{
  background:#f5f5f5;
}


body[data-network]{
  position:relative;
}

zz-distracting-body[data-network="playnet"]{
  background-color:#f5f5f5;
  background-image:
    url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='160' height='120' text-rendering='geometricPrecision'>\
<g transform='rotate(-30 80 60)' fill='rgba(0,0,0,0.06)' font-size='18' font-weight='700' font-family='Arial, Helvetica, sans-serif'>\
<text x='10' y='40'>playnet</text>\
<text x='90' y='80'>playnet</text>\
</g>\
</svg>");
}

.app-banner{
  background:#e8e8e8;
  border-bottom:1px solid #d8d8d8;

  /* Full-bleed to top/left/right. The plain -16px-sides approach does NOT work:
     `overflow-x:hidden` on html+body (the create-order-modal overflow clamp)
     makes the body a clipping box, so negative side margins get clipped at the
     body content edge and the 16px body margin shows as a gap on every side
     (regression 802b339). Instead pin width to the viewport and centre it with a
     calc margin that resolves to -bodyMargin regardless of the body's margin —
     immune to both the body margin and the overflow clamp. overflow:visible so
     the 42px caps are never clipped. (restored from db3914a) */
  box-sizing:border-box;
  width:100vw;
  margin:-16px 0 12px calc(50% - 50vw);
  padding:12px 16px;
  overflow:visible;
}


.app-banner h2{
  margin:0;

  display:flex;
  align-items:center;
  gap:10px;

  line-height:1;
}

.app-title{
  font-family:'Poppins', sans-serif;
  font-size:42px;
  font-weight:800;
  letter-spacing:0.12em;
  line-height:1.1;      /* was clipping the caps top/bottom at line-height:1 */
  color:#888;
}

.app-icons{
  font-size:24px;
  line-height:1;

  position:relative;
  top:-1px;
}

/* inner layout */
.app-banner-inner{
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;   /* so the nerd toggle can sit hard-right via margin-left:auto */
}

/* nerd toggle mirrored into the header (ORDERS-UI1) */
.banner-nerd{
  margin-left:auto;
  margin-right:36px;   /* clear the fixed 🔗 profile button (right:14px) */
  display:inline-flex;
  align-items:center;
  gap:4px;
  font-size:16px;
  color:#888;
  cursor:pointer;
  user-select:none;
}
.banner-nerd input{ cursor:pointer; margin:0; }

/* placeholder logo */
.app-logo{
  height:32px;
  min-width:32px;
  background:#ddd;
  border-radius:4px;
}



button{
  display:inline-flex;
  align-items:center;
  gap:6px;

  padding:6px 12px;
  font-size:13px;
  font-weight:600;

  background:#fff;
  color:#333;

  border:1px solid #ccc;
  border-radius:6px;

  cursor:pointer;
  transition:all .12s ease;
}

/* hover */
button:hover{
  background:#f3f3f3;
  border-color:#bbb;
}

/* active */
button:active{
  transform:translateY(1px);
}
button{
  display:inline-flex;
  align-items:center;
  gap:6px;

  padding:7px 14px;
  font-size:13px;
  font-weight:600;

  background:#4CAF50;          /* fresh green */
  color:#fff;

  border:none;
  border-radius:8px;

  cursor:pointer;
  transition:all .12s ease;
}

/* hover */
button:hover{
  background:#43a047;
}

/* active */
button:active{
  transform:translateY(1px);
}

/* icon */
button i{
  font-size:11px;
  opacity:0.9;
}

#accountLabelInput{
  padding:7px 10px;
  font-size:13px;

  border:1px solid #ccc;
  border-radius:8px;

  outline:none;
  transition:border .12s ease, box-shadow .12s ease;
}

/* focus */
#accountLabelInput:focus{
  border-color:#4CAF50;
  box-shadow:0 0 0 2px rgba(76,175,80,0.15);
}



/* LE = horizontal stack only */
.asset.asset-le{
  position: relative;
}

/* base image */
.asset.asset-le .asset-thumb{
  position: relative;
  z-index: 3;
}

/* ≥2 (base layer always present) */
.asset.asset-le[data-qty]:not([data-qty="1"]) .asset-thumb{
  box-shadow:
    -6px 2px 0 rgba(0,0,0,0.15);
}

/* ≥3 → add second layer */
.asset.asset-le[data-qty]:not([data-qty="1"]):not([data-qty="2"]) .asset-thumb{
  box-shadow:
    -6px 2px 0 rgba(0,0,0,0.15),
    -12px 4px 0 rgba(0,0,0,0.10);
}

/* ≥4 → add third layer (cap here) */
.asset.asset-le[data-qty]:not([data-qty="1"]):not([data-qty="2"]):not([data-qty="3"]) .asset-thumb{
  box-shadow:
    -6px 2px 0 rgba(0,0,0,0.15),
    -12px 4px 0 rgba(0,0,0,0.10),
    -18px 6px 0 rgba(0,0,0,0.06);
}

/* force LE assets to occupy more layout width */

.asset.asset-le[data-qty="2"]{
  width: calc(var(--thumb-size) + 8px);
}

.asset.asset-le[data-qty="3"]{
  width: calc(var(--thumb-size) + 14px);
}

.asset.asset-le[data-qty="4"]{
  width: calc(var(--thumb-size) + 20px);
}

.zzasset.asset-le{
  outline: 2px solid red;
  background: rgba(255,0,0,0.05);
}

.asset.asset-le{
  margin-left: 20px !important;
}

#ordersSection{
  --thumb-size: 24px;
}

#ordersSection .orders-list,
#transactionsSection .transactions-list{
  font-family: monospace;
  font-size: 12px;

  /* ORDERS-UI1: soft-card lists — vertical stack with consistent gap so each row
     reads as its own card rather than a dense table line. */
  display:flex;
  flex-direction:column;
  gap:8px;
}

/* ── soft cards: order + tx rows (ORDERS-UI1 Phase B) ────────────────────────
   Hairline border + subtle radius + white fill. The per-row identity colour is
   applied inline as a 4px left border (applyOwnerSleeve for orders), which wins
   over the hairline on the left edge and reads as an accent stripe. */
#ordersSection .order-row,
#transactionsSection .tx-row{
  border:1px solid #e6e6e6;
  border-left:4px solid #d8d8d8;   /* neutral by default; buy/sell colour it below */
  border-radius:7px;
  background:#fff;
  padding:7px 10px;
  transition:box-shadow .12s ease, border-color .12s ease, background .12s ease;
}

/* Left stripe = buy/sell side (green/red). Replaces the old per-player identity
   colour — the avatar already carries identity. Rows with no side (bare/settled
   txs, invalid orders) keep the neutral grey stripe. */
#ordersSection .order-row[data-order-side="buy"],
#transactionsSection .tx-row[data-order-side="buy"]{ border-left-color:#2ecc71; }
#ordersSection .order-row[data-order-side="sell"],
#transactionsSection .tx-row[data-order-side="sell"]{ border-left-color:#e74c3c; }

/* Nerd mode (ORDERS-UI1): the extra detail is revealed in-flow as a muted
   annotation — same card layout as normal mode, just more information. */
body.nerd .order-nerd-id,
body.nerd .order-nerd-type,
body.nerd .order-nerd-minfill,
body.nerd .order-fill-pending-detail,
body.nerd .order-fill-debug{ color:#9aa0a6; font-size:0.92em; }

/* The tx txid/pch link is a direct flex child of the row, so drop it onto its own
   wrapped line beneath the transfer chips — a long link never breaks the flow. */
body.nerd #transactionsSection .tx-row .tx-nerd-meta{
  display:block !important;
  flex-basis:100%;
  margin-top:3px;
  color:#9aa0a6;
  font-size:0.92em;
  word-break:break-all;
}
body.nerd .tx-nerd-meta a{ color:inherit; }

.order-tif{ opacity:0.6; font-size:0.9em; }
.order-market{ font-weight:500; }
.order-time{ font-size:0.82em; color:#aaa; margin-left:2px; }
.order-fill-settled{ font-size:0.9em; color:#888; }
.order-fill-pending{ font-size:0.9em; }
.tx-time{ font-size:0.82em; color:#aaa; }

/* Order type icon — inline SVG, inherits text colour, no status meaning */
.order-type-icon{
  display:inline-flex;
  align-items:center;
  vertical-align:middle;
  opacity:0.55;
  margin-right:2px;
  flex-shrink:0;
}
.order-type-icon svg{ display:block; }

/* Fill bar — 3px track beneath each order row */
.order-fill-bar{
  position:relative;
  height:3px;
  margin:2px 0 0;
  border-radius:2px;
  overflow:hidden;
  background:transparent;
}
.order-fill-bar-settled{
  position:absolute;
  left:0; top:0; height:100%;
  background:#4caf50;
  opacity:0.35;
  transition:width 0.4s;
}
.order-fill-bar-pending{
  position:absolute;
  top:0; height:100%;
  background:#ff9800;
  opacity:0.25;
  transition:width 0.4s, left 0.4s;
}

/* NFT chip in transaction rows */
.tx-nft-chip{
  font-variant-numeric:tabular-nums;
}

#ordersSection .order-row{
  margin-bottom: 0;   /* row separation now via the list's flex gap */
}

#ordersSection .order-row.order-fully-settled{
  color:#999;
  opacity:0.6;
}

/* Ghost: order cleared while its transaction is still pending; shown read-only
   from tx source for context. Dashed + dimmed to distinguish from live orders. */
#ordersSection .order-row.order-ghost{
  opacity:0.55;
  border:1px dashed #b0b0b0;
  border-radius:4px;
  cursor:default;
  font-style:italic;
}


#ordersSection .order-row-inner{
  display:flex;
  align-items:center;
  gap:6px;
}

#ordersSection .order-offer,
#ordersSection .order-request{
  display:flex;
  align-items:center;
  gap:4px;
}



#marketHeatmapTooltip{
  position:absolute;

  display:none;

  pointer-events:none;

  z-index:9999;

  background:#222;
  color:#fff;

  padding:8px 10px;

  border-radius:6px;

  font-size:12px;
  line-height:1.4;

  font-family:monospace;

  box-shadow:
    0 4px 12px rgba(0,0,0,0.25);

  white-space:nowrap;
}

@media (max-width:699px){
  #marketHeatmapTooltip{
    display:none !important;
  }
}


.market-pair-label{
  font-size: 1.1em;
  font-weight: 700;
}

.multifill-btn{
  font-size: 0.9em;
  padding: 2px 6px;
  margin-right: 6px;
}

.tx-row{
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
  margin-bottom:0;   /* spacing via the list's flex gap */
  cursor:pointer;
}

.tx-row > *{
  display:flex;
  align-items:center;
}

.tx-assets{
  display:flex;
  align-items:center;
  gap:4px;
}

.tx-assets .asset{
  margin-top:0;
  margin-bottom:0;
}

.tx-arrow{
  display:flex;
  align-items:center;
  opacity:0.6;
}

.tx-row:hover,
.tx-row.tx-highlight{
  border-color:#cfcfcf;
  box-shadow:0 2px 8px rgba(0,0,0,0.10);
}

.tx-row *{
  cursor:pointer;
}

.tx-highlight.tx-buy{
  box-shadow: inset 4px 0 #2ecc71;
}

.tx-highlight.tx-sell{
  box-shadow: inset 4px 0 #e74c3c;
}

.tx-fx-chip{
  transition:all .12s ease;
}

.tx-chip-buy{
  outline:2px solid #2ecc71;
  background:rgba(46,204,113,.12);
}

.tx-chip-sell{
  outline:2px solid #e74c3c;
  background:rgba(231,76,60,.12);
}

svg .svg-buy{
  filter:drop-shadow(0 0 3px rgba(46,204,113,.9));
}

svg .svg-sell{
  filter:drop-shadow(0 0 3px rgba(231,76,60,.9));
}

.tx-row:has(.tx-highlight):has(a[href*="success"]) .tx-fx-chip,
.tx-row.success .tx-fx-chip{
  border-radius:1px;
}

.tx-row.success .tx-fx-chip{
  border-radius:1px;
}




.asset-modal{
  backdrop-filter:blur(6px);
}

.asset-modal-card{
  max-width:460px;
  padding:22px;
  border-radius:14px;

  box-shadow:
    0 18px 50px rgba(0,0,0,.15),
    0 2px 8px rgba(0,0,0,.08);

  border:1px solid rgba(0,0,0,.06);
}

.asset-modal-card label{
  display:block;
  margin-bottom:6px;
  font-size:12px;
  color:#666;
  font-weight:600;
}

.asset-modal-card input,
.asset-modal-card select,
.asset-modal-card textarea{
  width:100%;
  box-sizing:border-box;

  padding:10px 12px;

  border:1px solid #ddd;
  border-radius:8px;

  background:#fafafa;

  outline:none;

  transition:.12s;
}

.asset-modal-card input:focus,
.asset-modal-card select:focus,
.asset-modal-card textarea:focus{
  background:#fff;
  border-color:#4CAF50;

  box-shadow:
    0 0 0 3px rgba(76,175,80,.15);
}





.dev-help{
  margin-top:8px;
  font-size:11px;
  color:#777;
  line-height:1.5;
  font-family:var(--font-mono);
}


.order-context{
  margin-left:8px;
  font-size:11px;
  color:#999;
  font-weight:normal;
}

.order-action{
  cursor:pointer;
  margin-right:6px;
  opacity:0.5;
}

.order-action:hover{
  opacity:1;
}


.asset{
  border-radius:8px;
  overflow:visible;
  display:inline-block;
  margin:0;
  padding:1px 5px;
}

.order-row{
  margin:0 !important;   /* spacing handled by the list's flex gap */
  cursor:pointer;        /* padding now comes from the soft-card rule */
}


.order-row-inner{
  display:flex;
  align-items:center;
  gap:4px;
  flex-wrap:wrap;      /* let the asset chips wrap below the icon/time header */
  line-height:1;
  min-height:22px;
}


#ordersSection .order-row:hover,
#ordersSection .order-row.tx-highlight{
  border-color:#cfcfcf;
  box-shadow:0 2px 8px rgba(0,0,0,0.10);
}
.order-actions{
  display:flex;
  gap:8px;
  margin-top:4px;
}

.order-actions button{
  flex:1;
  justify-content:center;
  text-align:center;
}

#createOrderDev{
  margin-top:18px;
  zzborder-top:1px solid #eee;
  padding-top:14px;
}

#createOrderDev summary{
  cursor:pointer;
  color:#666;
  font-size:13px;
  user-select:none;
}

#createOrderDev textarea{
  margin-top:10px;
  font-family:var(--font-mono);
}




#createOrderModal .order-side{
  display:flex;
  gap:24px;
  align-items:center;
  margin:10px 0 18px 0;
}

#createOrderModal .order-side label{
  display:flex;
  align-items:center;
  gap:8px;
  margin:0;
  cursor:pointer;
}

#createOrderModal .order-side input{
  width:auto;
  margin:0;
  flex:none;
}

/* Collectible modal inline pairs */
.collectible-token-row,
.collectible-price-row{
  display:flex;
  gap:8px;
  align-items:flex-start;
  margin-bottom:10px;
}
.collectible-token-id{
  flex:2;
  min-width:0;
}
.collectible-serial{
  flex:1;
  min-width:0;
}
.collectible-price{
  flex:3;
  min-width:0;
}
.collectible-currency{
  flex:2;
  min-width:0;
}
.collectible-token-row input,
.collectible-token-row select,
.collectible-price-row input,
.collectible-price-row select{
  width:100%;
  box-sizing:border-box;
  margin:0;
}
.collectible-hint{
  font-size:11px;
  min-height:14px;
  margin-top:3px;
}
.collectible-label-note{
  font-weight:normal;
  font-size:11px;
  color:#999;
}

#createOrderExit{
  margin-top:10px;
  width:100%;

  background:#eee;
  color:#555;
}


#createOrderExit:hover{
  background:#ddd;
}

#createOrderSubmit{
  background:#6ea875;
}

#createOrderEdit{
  background:#6d8fb3;
}

#createOrderDelete{
  background:#b78383;
}

#createOrderTruncate{
  background:#999;
}

#createOrderSubmit:hover{
  background:#639a69;
}

#createOrderEdit:hover{
  background:#6485a7;
}

#createOrderDelete:hover{
  background:#aa7676;
}

#createOrderTruncate:hover{
  background:#8d8d8d;
}

@media (max-width:768px){
  #createOrderModal{
    padding:0;
    align-items:stretch;
  }

  #createOrderModal .modal-content,
  #createOrderModal .asset-modal-card{
    box-sizing:border-box;
    width:100%;
    height:100vh;
    max-width:none;
    max-height:none;
    margin:0;
    border-radius:0;
    overflow:auto;
  }
}


#createOrderModal .account-picker{
  display:flex;
  align-items:center;
  gap:6px;
}

#createOrderModal .account-picker select{
  flex:1;
  min-width:0;
}

#createOrderModal .account-picker button{
  min-width:26px;
  min-height:26px;

  padding:3px 7px;

  background:#eee;
  color:#555;

  border:none;
  border-radius:6px;

  font-size:12px;

  flex:none;
}

#createOrderModal .account-picker button:hover{
  background:#ddd;
}



.order-action-help{
  margin-bottom:10px;
  min-height:16px;

  font-size:11px;
  color:#777;

  text-align:center;
}

.order-actions + .order-action-help{
  order:-1;
}

button,
input,
select,
textarea{
  outline:none;
  -webkit-tap-highlight-color:transparent;
}

button:focus,
input:focus,
select:focus,
textarea:focus{
  outline:none;
  box-shadow:none;
}

*{
  -webkit-tap-highlight-color:transparent !important;
}

*:focus,
*:focus-visible,
*:active{
  outline:none !important;
  box-shadow:none !important;
  -webkit-box-shadow:none !important;
}


/* account asset spacing only */

.account-row.columns .asset,
.account-row.columns .asset-thumb,
.account-row.merged .asset,
.account-row.merged .asset-thumb{
  margin:2px 4px;
}


.profile-btn{
  position:fixed;
  top:20px;
  right:14px;
  z-index:1200;

  display:block;
  width:auto;
  height:auto;
  min-width:0;
  min-height:0;

  padding:0;
  margin:0;

  background:transparent;
  color:#555;
  border:0;
  border-radius:0;
  box-shadow:none;

  font-size:24px;
  line-height:1;
  cursor:pointer;
}

.profile-btn:hover{
  background:transparent;
  color:#222;
}

.profile-btn:active{
  transform:none;
}

.profile-modal{
  position:fixed;
  inset:0;
  z-index:2000;

  display:flex;
  align-items:center;
  justify-content:center;

  background:rgba(0,0,0,0.42);
  padding:18px;
}

.profile-modal.hidden{
  display:none;
}

.profile-card{
  position:relative;

  width:min(520px, 100%);
  max-height:88vh;
  overflow:auto;

  background:white;
  color:#222;

  border-radius:16px;
  padding:20px;

  box-shadow:0 18px 50px rgba(0,0,0,0.32);
}

.profile-card .subtle{
  text-align:center;
  margin-left:0;
}

.profile-close{
  position:absolute;
  top:14px;
  right:16px;
  z-index:2;

  cursor:pointer;
  font-size:24px;
  line-height:1;
  opacity:0.65;
}

.profile-list{
  margin:14px 0;
}

.profile-label{
  margin-top:12px;
  font-weight:700;
  font-size:13px;
  opacity:0.75;
}

.profile-scope{
  margin-top:3px;
  color:#777;
  font-size:12px;
  word-break:break-word;
}

.profile-mono,
.profile-link{
  font-family:var(--font-mono);
  word-break:break-all;
  font-size:12px;
}

.profile-link{
  display:block;
  color:#777;
  text-decoration:none;
  cursor:pointer;
  padding:6px 8px;
  border-radius:8px;
  transition:background .12s ease, color .12s ease;
}

.profile-link:hover{
  color:#222;
  background:#f1f1f1;
}

.profile-qr-link{
  display:inline-block;
  line-height:0;
  border-radius:10px;
  transition:transform .12s ease, box-shadow .12s ease;
}

.profile-qr-link:hover{
  transform:translateY(-1px);
  box-shadow:0 4px 14px rgba(0,0,0,0.12);
}

.profile-qr{
  display:flex;
  justify-content:center;
  margin:18px 0 10px;
}

.profile-card button{
  margin-top:12px;
}
/* ── kemoji face avatars ─────────────────────────────────────────────────── */

.kemoji{
  display:inline-flex;
  flex-shrink:0;
  vertical-align:middle;
}

.kemoji svg{
  display:block;
}

/* Own avatar — square SVG shape + a clean hairline ring. The heavy 3px blue
   halo read as clunky and duplicated the per-row identity sleeve; a 1.5px ring
   + soft shadow is enough to say "this is you". */
.kemoji-self{
  border-radius:7px;
  box-shadow:0 0 0 1.5px rgba(74,144,226,0.9), 0 1px 4px rgba(0,0,0,0.12);
}

/* In the profile modal the avatar is the hero element, so give it a touch more
   presence than the inline list version. */
.profile-avatar .kemoji-self{
  box-shadow:0 0 0 2px rgba(74,144,226,0.9), 0 2px 8px rgba(0,0,0,0.14);
}

.profile-avatar{
  display:flex;
  justify-content:center;
  margin:10px 0 4px;
}

/* ─────────────────────────────────────────────────────────────────────────── */

/* ── two-column game layout: trading left, chat right ───────────────────── */

.game-layout{
  /* padding-right reserves space for the fixed chat panel (260px + 16px gap) */
  padding-right:276px;
}

.game-left{
  min-width:0;
}

/* ORDERS-UI1: orders | transactions side-by-side on desktop, auto-wrapping to a
   single column when there isn't room for two ~360px tracks. align-items:start so
   the two columns don't stretch each other's height. */
.trade-cols{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(360px, 1fr));
  gap:16px;
  align-items:start;
}
.trade-cols > div{ min-width:0; }
.trade-cols #transactionsSection{ margin-top:0; }

/* fixed panel: out of flow entirely so it can never cause page overflow.
   top/height are set by positionChatPanel() in JS after first render. */
#chatSection{
  position:fixed;
  top:0;
  right:16px;
  width:260px;
  height:100vh;
  overflow:hidden;
  visibility:hidden; /* hidden until JS positions it */
}

#chatSection.chat-ready{
  visibility:visible;
}

#chatSection .orders-details{
  height:100%;
  overflow:hidden;
}

#chatSection .chat-list{
  overflow-y:auto;
  padding:2px 0;
}

@media (max-width:899px){
  .game-layout{
    padding-right:0;
  }
  #chatSection{
    position:static;
    width:100%;
    height:auto;
    margin-top:8px;
  }
  #chatSection .chat-list{
    height:auto;
    max-height:300px;
  }
}

/* ── chat messages ─────────────────────────────────────────────────────────── */

.chat-msg{
  display:flex;
  gap:7px;
  align-items:flex-start;
  padding:5px 6px 5px 8px;
  margin-bottom:2px;
  border-radius:4px;
}

.chat-msg:hover{
  background:#f0f0f0;
}

.chat-body{
  flex:1;
  min-width:0;
}

.chat-meta{
  display:flex;
  gap:6px;
  align-items:baseline;
  margin-bottom:1px;
}

.chat-who{
  font-size:11px;
  font-weight:600;
  color:#444;
}

.chat-time{
  font-size:10px;
  color:#aaa;
  white-space:nowrap;
}

.chat-text{
  font-size:12px;
  color:#333;
  word-break:break-word;
  line-height:1.4;
}

/* ─────────────────────────────────────────────────────────────────────────── */

/* PROFILE-AUTH1 — wallet Authenticate panel */
.profile-auth{
  margin-top:16px;
  padding-top:12px;
  border-top:1px solid #eee;
}
.profile-auth-account{
  margin-top:10px;
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
}
.profile-auth-account > .profile-label{ flex:0 0 auto; }
.profile-auth-account select,
.profile-auth-select{
  flex:1 1 140px;
  min-width:0;
  padding:6px 8px;
  font-family:var(--font-mono);
  font-size:12px;
}
.profile-auth-x{
  flex:0 0 auto;
  padding:4px 8px;
  border:1px solid #e3e6ea;
  border-radius:6px;
  background:#fff;
  cursor:pointer;
  line-height:1;
}
.profile-auth-x:hover{ background:#f6f7f9; }
/* Commitment options (expiry / scope / publish) — PROFILE-AUTH wireframe */
.profile-auth-options{
  margin-top:10px;
  display:flex;
  flex-wrap:wrap;
  gap:10px 14px;
  align-items:center;
  font-size:12px;
}
.profile-auth-options select{
  margin-left:4px;
  padding:4px 6px;
  font-size:12px;
}
.profile-auth-publish{ display:flex; align-items:center; gap:6px; }
.profile-auth-statement{
  margin-top:10px;
  padding:8px 10px;
  background:#f6f7f9;
  border:1px solid #e3e6ea;
  border-radius:8px;
  font-size:12px;
  line-height:1.4;
  color:#333;
}
.profile-auth-status{
  margin-top:8px;
  min-height:1em;
  font-size:12px;
}
.profile-auth-output{
  margin-top:10px;
  max-height:240px;
  overflow:auto;
  padding:10px;
  background:#f6f7f9;
  border:1px solid #e3e6ea;
  border-radius:8px;
  font-family:var(--font-mono);
  font-size:11px;
  white-space:pre-wrap;
  word-break:break-all;
}

.profile-debug{
  margin-top:16px;
  padding-top:12px;
  border-top:1px solid #eee;
}
.profile-debug-label{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  color:#888;
  cursor:pointer;
  user-select:none;
}

@media (max-width:640px){
  .profile-btn{
    top:90px;
    right:30px;
  }

  .profile-modal{
    display:block;
    padding:0;
    background:white;
  }

  .profile-card{
    width:100vw;
    height:100vh;
    max-width:none;
    max-height:none;

    margin:0;
    padding:18px;
    box-sizing:border-box;

    border-radius:0;
    box-shadow:none;
    overflow:auto;
  }

  .profile-close{
    position:fixed;
    top:12px;
    right:30px;
    font-size:28px;
  }

  .profile-card h2{
    padding-right:34px;
  }
}