/* =========================================================================
   ZynNFT — iOS design language on a white canvas.

   One accent (Pi purple) on white, the way a modern iPhone app looks: large
   titles, grouped lists with hairline separators, continuous-radius pills,
   soft shadows, and a translucent bottom tab bar. Deliberately not a crypto
   site: no dark theme, no gradients, no neon.
   ========================================================================= */

:root {
  /* Surfaces — iOS system colours on a white base. */
  --bg: #ffffff;
  --bg-grouped: #f2f2f7;
  --card: #ffffff;
  --fill: #f2f2f7;
  --fill-2: #e9e9ee;

  /* Text. */
  --label: #1c1c1e;
  --label-2: rgba(60, 60, 67, 0.6);
  --label-3: rgba(60, 60, 67, 0.3);

  /* A single hairline, the way UIKit draws a separator. */
  --separator: rgba(60, 60, 67, 0.12);
  --separator-strong: rgba(60, 60, 67, 0.22);

  /* The one accent. Pi purple, used sparingly. */
  --accent: #7c3aed;
  --accent-press: #6d28d9;
  --accent-soft: rgba(124, 58, 237, 0.1);
  --accent-soft-2: rgba(124, 58, 237, 0.16);

  --success: #34c759;
  --warning: #ff9500;
  --danger: #ff3b30;

  --radius: 16px;
  --radius-lg: 22px;
  --radius-pill: 980px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.05), 0 12px 28px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 1px 3px rgba(0, 0, 0, 0.06), 0 24px 60px rgba(0, 0, 0, 0.16);

  --tabbar-h: 58px;

  /* SF Pro is not on the web; the system stack resolves to it on Apple devices
     and to the platform's own face everywhere else. */
  --font: -apple-system, blinkmacsystemfont, "SF Pro Display", "SF Pro Text",
    "Segoe UI", "Helvetica Neue", inter, roboto, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg-grouped);
  color: var(--label);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
}

/* The app is a single column — a phone-width canvas centred on desktop, full
   bleed on mobile. Flex column so the tab bar sits below the scrolling view. */
/* The app canvas — full bleed on all screens */
#app {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  width: 100%;
  max-width: none;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
}

@media (min-width: 520px) {
  body {
    background: var(--bg-grouped);
  }
  #app {
    height: 100vh;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
}

/* ========================================================= iOS Status Bar */

.ios-status-bar {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px 6px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--label);
  user-select: none;
  flex: none;
}

.ios-time {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 14px;
  width: 48px;
}

.ios-dynamic-island {
  width: 112px;
  height: 26px;
  background: #000;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  box-shadow: inset 0 0 1px 1px rgba(255, 255, 255, 0.08);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: default;
}
.ios-dynamic-island:hover {
  transform: scale(1.03);
}

.island-lens {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #2a3556 0%, #0d111d 70%, #000 100%);
  border: 0.5px solid rgba(255, 255, 255, 0.15);
}

.island-sensor {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: #111;
}

.ios-status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 58px;
  justify-content: flex-end;
}

.ios-status-icons svg {
  height: 12px;
  width: auto;
  fill: currentColor;
}

.ios-battery {
  width: 22px;
  height: 11px;
  border: 1px solid currentColor;
  border-radius: 3px;
  padding: 1px;
  display: flex;
  align-items: center;
  position: relative;
}
.ios-battery::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 2.5px;
  width: 1.5px;
  height: 4px;
  background: currentColor;
  border-radius: 0 1px 1px 0;
}
.battery-level {
  width: 78%;
  height: 100%;
  background: currentColor;
  border-radius: 1.5px;
}

/* Home Indicator */
.ios-home-indicator {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  border-radius: 100px;
  background: rgba(0, 0, 0, 0.24);
  z-index: 35;
  pointer-events: none;
}

#view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  /* No `scroll-behavior: smooth`: `setTab` resets scrollTop after every render,
     and a smooth rule turned that one-line jump into an animated scrub the
     person's next flick has to fight. Wheel and touch scrolling were never
     smooth-scrolled by this property — it only governed programmatic jumps. */
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 12px);
}

/* =========================================================== large titles */

/* The sticky header a UIKit app shows before you scroll. */
.largetitle-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 8px 20px 8px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(25px) saturate(1.8);
  -webkit-backdrop-filter: blur(25px) saturate(1.8);
  border-bottom: 0.5px solid var(--separator);
}

.largetitle {
  margin: 0;
  font-size: 32px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.largetitle-bar .actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.largetitle-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

/* The home wordmark: gradient ribbon mark, wordmark with gradient "NFT", and badge pill. */
.zyn-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  user-select: none;
  white-space: nowrap;
}
.zyn-mark {
  display: block;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  filter: drop-shadow(0 2px 4px rgba(100, 40, 200, 0.15));
}
.zyn-mark svg { display: block; width: 100%; height: 100%; }
.zyn-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.6px;
}
.zyn-name {
  color: #0b0c10;
  font-size: 26px;
  line-height: 1;
  font-weight: 800;
}
.zyn-name .nft {
  background: linear-gradient(135deg, #a124db, #5263eb);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-weight: 800;
}
.zyn-beta {
  padding: 4px 9px;
  border-radius: 12px;
  background: linear-gradient(135deg, #d82be8, #7b3fe4);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0;
}
@media (max-width: 380px) {
  .zyn-logo { gap: 8px; }
  .zyn-mark { width: 34px; height: 34px; flex-basis: 34px; }
  .zyn-name { font-size: 22px; }
  .zyn-beta { font-size: 11px; padding: 4px 7px; }
}

/* Small inline header for pushed pages. */
.navbar {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: max(10px, env(safe-area-inset-top, 0px)) 12px 10px;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-bottom: 0.5px solid var(--separator);
}
.navbar .title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.iconbtn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--fill);
  color: var(--label);
  flex: none;
  transition: transform 0.12s, background 0.15s;
}
.iconbtn:active { transform: scale(0.92); background: var(--fill-2); }
.iconbtn svg { width: 19px; height: 19px; }

/* ================================================================ content */

.view {
  padding: 0 20px;
}

.home-banner {
  position: relative;
  margin: 10px -8px 4px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.home-banner > img {
  display: block;
  width: 100%;
  height: auto;
}
.banner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-left: 16px;
}
.banner-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  text-align: left;
}
.banner-line {
  margin: 0;
  color: #fff;
  font-size: clamp(14px, 3.4vw, 22px);
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.15;
  text-shadow: 0 1px 6px rgba(11, 7, 18, 0.45);
}
.banner-line-lead {
  font-size: clamp(19px, 4.6vw, 32px);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.banner-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin-top: 8px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #f472b6 0%, #38bdf8 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 2px rgba(11, 7, 18, 0.18);
  box-shadow: 0 2px 10px rgba(11, 7, 18, 0.25);
  transition: transform 0.12s, filter 0.15s;
}
.banner-cta:active { transform: scale(0.97); filter: brightness(0.94); }
.banner-mascot {
  display: block;
  flex: none;
  width: auto;
  height: 100%;
  pointer-events: none;
}

.sectionhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0 12px;
}
.sectionhead h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.03em;
}
.sectionhead .link {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
}

.eyebrow {
  margin: 20px 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--label-2);
}

p.lede {
  margin: 6px 0 0;
  color: var(--label-2);
  font-size: 15px;
}

/* Horizontal rail, the way iOS apps scroll a row of cards. */
.rail {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 2px 20px 6px;
  margin: 0 -20px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; flex: none; }

/* The Featured rail does not wait to be scrolled: it drifts left on its own,
   the way a marketplace ticker moves a row of recent buys. The track holds two
   identical copies side by side, so translateX(-50%) travels exactly one copy
   width and the loop has no seam. Each copy carries a trailing gap equal to the
   internal one, so the spacing across the join is the same 14px as everywhere
   else. Duration is set per rail from the card count so the drift speed stays
   constant whether there are three listings or thirty. */
.marquee {
  margin: 0 -20px;
  padding: 2px 0 6px;
  overflow-x: auto;
  overflow-y: hidden;
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee var(--marquee-dur, 46s) linear infinite;
  will-change: transform;
}
.marquee-copy {
  display: flex;
  gap: 14px;
  flex: none;
  padding-right: 14px;
}
.marquee-copy > * { flex: none; }
.marquee:hover .marquee-track,
.marquee:focus-within .marquee-track {
  animation-play-state: paused;
}
.marquee-track {
  pointer-events: none;
}
.marquee:hover .marquee-track {
  pointer-events: auto;
}
@keyframes marquee {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
}

/* ================================================================= cards */

.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 0.5px solid var(--separator);
  overflow: hidden;
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.16s;
}
.card:active {
  transform: scale(0.985);
}

/* An NFT card. Art on top, title and price under it. */
.nftcard {
  width: 180px;
  text-align: left;
  display: block;
  background: var(--card);
  border-radius: 6px;
  border: 0.5px solid var(--card-border-color, #7c3aed);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s;
  position: relative;
  /* No infinite animation here. The old `animation: pulse 2s` collided with a
     second `@keyframes pulse` lower in the file, and CSS keeps the LAST block,
     so every card was animating a box-shadow ring instead of a scale - a
     paint-per-frame cost spread across the whole grid for a rhythm nothing
     asked for. The hover/active transitions below are the feedback. */
}

.token-card {
  border: 1px solid #b83fc8;
  border-radius: 6px;
  overflow: hidden;
}
.nftcard:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.nftcard:active {
  transform: scale(0.975);
}
.nftcard .art { border-radius: 0; }
.nftcard .body { padding: 10px 12px 12px; }
.nftcard .nftname {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--label);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nftcard .name { font-size: 14px; font-weight: 700; letter-spacing: -0.02em; }
.nftcard .sub { margin-top: 2px; font-size: 12px; color: var(--label-2); }
.nftcard .price {
  margin-top: 8px;
  display: flex;
  align-items: baseline;
  gap: 4px;
  justify-content: space-between;
}
.nftcard .price .label { font-size: 11px; font-weight: 700; color: var(--label-3); text-transform: uppercase; letter-spacing: 0.05em; align-self: center; }
.nftcard .price .amt { font-size: 15px; font-weight: 800; letter-spacing: -0.02em; }
.nftcard .price .amt.none { font-size: 12px; font-weight: 650; color: var(--label-3); }
.nftcard .price .cur { font-size: 11px; font-weight: 700; color: var(--accent); }

/* The generative art tile. */
.art {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  display: block;
  overflow: hidden;
  background: var(--fill);
}
.art svg,
.art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.art .badge {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.82);
  /* Backdrop blur removed from card chips: the All grid held 300+ blur surfaces
     at once, each one a fresh backdrop root the compositor samples on every
     repaint, and on the Pi badge below the blur was invisible anyway (an opaque
     gradient sits behind it). Chips stay translucent — that is the visible part. */
  color: var(--label);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}
/* The creator / seller chip overlaid on the artwork, top-left. */
.art .who {
  position: absolute;
  left: 10px;
  top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 3px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-sm);
  max-width: calc(100% - 20px);
}
.art .who .avatar { width: 20px; height: 20px; font-size: 9px; }
.art .who .handle {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--label);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Pi badge in top-right corner */
.art .pi-badge {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.4);
}

.art .placeholder-tag {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.72);
  color: var(--label-2);
  font-size: 10px;
  font-weight: 600;
}

/* A grid for explore and profile. */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.grid .nftcard { width: 100%; }

/* =========================================================== grouped lists */
/* The inset white table with hairline rows — the most iOS shape there is. */

.group {
  margin-top: 12px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.group > .ghead {
  padding: 13px 14px 6px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--label-2);
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  min-height: 44px;
}
.row + .row { border-top: 0.5px solid var(--separator); }
.row .k { flex: 1; min-width: 0; font-size: 15px; }
.row .k .sub { color: var(--label-2); font-size: 12.5px; margin-top: 1px; }
.row .v { font-size: 14px; color: var(--label-2); text-align: right; word-break: break-all; }
.row .v.mono { font-variant-numeric: tabular-nums; }

/* =============================================================== buttons */

.btn {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 52px;
  border-radius: var(--radius-pill);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.28);
  transition: transform 0.12s, filter 0.15s, background 0.15s;
}
.btn:active { transform: scale(0.985); background: var(--accent-press); }
.btn[disabled] {
  background: var(--fill-2);
  color: var(--label-3);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn.ghost { background: var(--fill); color: var(--label); box-shadow: none; }
.btn.ghost:active { background: var(--fill-2); }

.btn.sm { min-height: 40px; font-size: 15px; }

.btnstack { display: flex; flex-direction: column; gap: 10px; }

/* =============================================================== sign-in */

/* The gate before any tab. Content is centred and the actions are pinned to the
   bottom, the way an iOS onboarding screen arranges itself: the art at eye
   level, the choice card under the thumb. */
#view.view-login {
  padding-bottom: 0;
  background: var(--bg) url("loginbg.webp") center / cover no-repeat;
}
.login {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: calc(env(safe-area-inset-top, 0px) + 42px) 24px calc(env(safe-area-inset-bottom, 0px) + 34px);
}
.login-icon {
  width: min(640px, calc(100% + 48px));
  height: auto;
  margin: 0 -24px;
  align-self: center;
}
.login-card {
  background: var(--card);
  border: 0.5px solid var(--separator);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 15px;
}
.login-mark {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 44px;
  line-height: 1;
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
}
.login-title {
  margin: 0;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-align: center;
  color: var(--label);
}
.login-subtitle {
  margin: -6px 0 0;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  color: var(--label-2);
}
.login-sub {
  margin: 0;
  max-width: 32ch;
  font-size: 15px;
  line-height: 1.5;
  color: var(--label-2);
}
.login-badge {
  display: flex;
  justify-content: center;
  margin-top: 2px;
}
.login-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-fine {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--label-3);
  text-align: center;
}
.login-note {
  font-size: 13px;
  line-height: 1.5;
}

/* The tab bar is a navigation for inside the app; the sign-in page is not
   inside it. `hidden` alone would lose to `display: flex` above. */
.tabbar[hidden] {
  display: none;
}

/* ============================================================= segmented */

.segmented {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 13px;
  background: var(--fill);
  margin: 14px 0 4px;
}
.segmented button {
  flex: 1;
  min-height: 34px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--label-2);
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.segmented button.on {
  background: #fff;
  color: var(--label);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ================================================================ inputs */

.field { margin-top: 14px; }
.field label {
  display: block;
  margin: 0 0 6px 2px;
  font-size: 13px;
  font-weight: 650;
  color: var(--label-2);
}
.field input,
.field textarea {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  background: var(--fill);
  border: 0.5px solid transparent;
  font-size: 16px;
  outline: none;
  transition: background 0.15s, border-color 0.15s;
}
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus,
.field textarea:focus { background: #fff; border-color: var(--accent); }
.field input::placeholder,
.field textarea::placeholder { color: var(--label-3); }
.field .hint { margin: 6px 0 0 2px; font-size: 12.5px; color: var(--label-3); }

/* ================================================================ search */

.searchbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--fill);
  color: var(--label-2);
}
.searchbar svg { width: 17px; height: 17px; flex: none; }
.searchbar input {
  flex: 1;
  border: 0;
  background: none;
  outline: none;
  font-size: 16px;
  min-width: 0;
}
.searchbar input::placeholder { color: var(--label-3); }

/* ======================================================== chips and tags */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: var(--fill);
  color: var(--label);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
  opacity: 0.85;
}

/* The Pi Testnet badge: small, calm, impossible to miss but never shouty. */
.testnet-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px 5px 9px;
  border-radius: var(--radius-pill);
  background: rgba(255, 149, 0, 0.1);
  color: #a35c00;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.testnet-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 0 rgba(255, 149, 0, 0.5);
  /* `pulseRing`, not `pulse`: two `@keyframes pulse` blocks used to exist and
     the last one won, silently retargeting every `.nftcard` animation to this
     ring. One keyframe name, one owner. */
  animation: pulseRing 2.6s infinite;
}
@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(255, 149, 0, 0.45); }
  70% { box-shadow: 0 0 0 6px rgba(255, 149, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 149, 0, 0); }
}

/* Mainnet badge: same shape, one colour shift. The dot stops pulsing because a
   chain that is not open has nothing live to announce. */
.testnet-badge.soon {
  background: var(--accent-soft);
  color: var(--accent);
}
.testnet-badge.soon::before {
  background: var(--accent);
  animation: none;
}

/* The global "chain coming soon" notice. It sits above the scrolling view, so
   it survives every tab and the login screen, and it is only rendered when the
   health read says the chain is actually unavailable. */
.netbanner {
  flex: none;
  padding: 9px 16px;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--separator);
  font-size: 12.5px;
  line-height: 1.35;
}
.netbanner[hidden] {
  display: none;
}
.netbanner-inner {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
}
.netbanner strong {
  color: var(--accent);
  font-weight: 800;
}
.netbanner span {
  color: var(--label-2);
}

/* ================================================================ avatar */

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  box-shadow: var(--shadow-sm);
}
.avatar.lg { width: 72px; height: 72px; font-size: 26px; }

/* ================================================================ sheet */

.sheet-host {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.24);
  display: flex;
  align-items: flex-end;
  animation: fade 0.18s ease;
}
.sheet-host[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }

.sheet {
  width: 100%;
  max-height: 92%;
  overflow-y: auto;
  background: var(--bg);
  border-radius: 26px 26px 0 0;
  padding: 8px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow-lg);
  animation: slideup 0.28s cubic-bezier(0.32, 0.72, 0.35, 1);
}
@keyframes slideup { from { transform: translateY(40%); opacity: 0.4; } }

.sheet .grabber {
  width: 38px;
  height: 5px;
  border-radius: 3px;
  background: var(--separator-strong);
  margin: 0 auto 14px;
}
.sheet h3 {
  margin: 2px 0 4px;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.03em;
}
.sheet .sheet-sub { margin: 0 0 12px; font-size: 14px; color: var(--label-2); }

/* ============================================================== overlay */

.overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: var(--bg);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.overlay.on { display: flex; animation: pushin 0.3s cubic-bezier(0.32, 0.72, 0.35, 1); }
@keyframes pushin { from { transform: translateX(28%); opacity: 0.5; } }
.overlay .scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ================================================================ tabbar */

.tabbar {
  position: relative;
  z-index: 20;
  display: flex;
  flex: none;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  border-top: 0.5px solid var(--separator);
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--label-2);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: color 0.16s;
}
.tab .ic { width: 24px; height: 24px; transition: transform 0.18s cubic-bezier(0.32, 0.72, 0.35, 1); }
.tab.on { color: var(--accent); }
.tab.on .ic { transform: scale(1.06); }
.tab:active .ic { transform: scale(0.9); }

/* ================================================================ states */

/* New Profile Page Styles */
.prof-new {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg);
}

.prof-body-new {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 20px calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 20px);
}

/* The Magic Eden shelf header: avatar and name side by side, badges under the
   name, and the bio slot below the whole row. The bio holds account facts —
   the wallet proof, checkable on the ledger — because there is no bio field
   in any of this app's data, and a made-up one would be the first invented
   line on a page this app keeps honest. */
.meprof-head {
  padding-top: 18px;
}
.meprof-id {
  display: flex;
  align-items: center;
  gap: 16px;
}
.meprof-meta {
  flex: 1;
  min-width: 0;
}
.meprof-name {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--label);
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.meprof-sub {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--label-2);
}
.meprof-bio {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--label-2);
}
.meprof-bio > div + div {
  margin-top: 8px;
}

.prof-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.prof-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.prof-badge svg {
  width: 12px;
  height: 12px;
}

.prof-badge-verified {
  background: rgba(124, 58, 237, 0.1);
  color: var(--accent);
}

.prof-badge-wallet {
  background: rgba(52, 199, 89, 0.1);
  color: var(--success);
}

.vip-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}

/* The tagline that used to sit under the badges was copy, not fact, and it is
   gone; the bio slot above takes its place with the wallet proof instead. */

/* Says out loud why a signed-in session is still showing an address. Hidden
   until Pi has actually answered, so it never pre-empts a name that was on its
   way. */
.prof-name-note {
  font-size: 12px;
  line-height: 1.35;
  color: var(--label-2);
  margin-top: 4px;
}

.prof-wallet-section {
  background: var(--fill);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 16px 0;
}

.prof-wallet-label {
  font-size: 12px;
  color: var(--label-2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.prof-wallet-address {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* The empty case: no address, so no copy button, because there is nothing on
   the clipboard that is anybody's. Same box and same radius as the real one, so
   the card does not change size or shape between the two states — a card that
   shrinks when it has nothing to say is how an empty state ends up looking
   like a mistake. */
.prof-wallet-none-label {
  font-size: 17px;
  font-weight: 600;
  color: var(--label-2);
  letter-spacing: -0.01em;
}

.prof-icon-btn {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  border: 0.5px solid var(--separator);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s;
}

.prof-icon-btn svg {
  width: 18px;
  height: 18px;
  color: var(--label);
}

.prof-icon-btn:active {
  transform: scale(0.92);
  background: var(--fill-2);
}

/* ME stat strip: Total Items / Active On, the two headline numbers. */
.meprof-stats {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.meprof-stat {
  min-width: 0;
  padding: 12px 14px;
  background: var(--card);
  border: 0.5px solid var(--separator);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.meprof-stat-value {
  display: block;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.meprof-stat-label {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--label-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.meprof-chains {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 27px;
}
/* The Active On chip. The dot is green only when this wallet has a real
   footprint (owns, mints, lists or trades); a gray dot claims nothing. */
.chainchip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: var(--fill);
  border: 0.5px solid var(--separator);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--label);
}
.chainchip .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}
.chainchip.off .dot {
  background: var(--label-3);
}
.chainchip.off {
  color: var(--label-2);
}

/* ME tab bar: labels with counts and an underline on the active tab. */
.meprof-tabs {
  display: flex;
  gap: 4px;
  margin-top: 18px;
  border-bottom: 0.5px solid var(--separator);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.meprof-tabs::-webkit-scrollbar {
  display: none;
}
.meprof-tabs button {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 12px 13px 11px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -0.5px;
  font-size: 14px;
  font-weight: 650;
  color: var(--label-2);
  cursor: pointer;
  transition: color 0.15s;
}
.meprof-tabs button em {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--fill);
  color: var(--label-3);
}
.meprof-tabs button.active {
  color: var(--label);
  border-bottom-color: var(--accent);
}
.meprof-tabs button.active em {
  background: var(--accent-soft);
  color: var(--accent);
}
.meprof-tabs button:active {
  opacity: 0.6;
}

/* The sort and status bar under the tabs. */
.meprof-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.meprof-sort {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-width: 0;
}
.meprof-sort::-webkit-scrollbar {
  display: none;
}
.meprof-status {
  display: flex;
  gap: 6px;
  flex: none;
}
.tchip {
  flex: none;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  background: var(--fill);
  border: 0.5px solid var(--separator);
  font-size: 12.5px;
  font-weight: 650;
  color: var(--label-2);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tchip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.tchip:active {
  transform: scale(0.96);
}

/* One-line provenance under the bar or a tab's grid: where the numbers came
   from. (The header's name column is `.meprof-meta` — a different thing.) */
.meprof-note {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--label-3);
}

/* The Account settings page's ME-style tab bar (the page is a pushed overlay,
   not a sheet): two real tabs (Profile, Wallets) with an underline bar snapped
   under the active one. "Marketplace" and "2FA
   Settings" are on the reference page and are not drawn: this app has no such
   settings, and a tab that can only sit empty is not a tab — the same rule
   that kept "Showcase" off the profile. */
.mestt-tabs {
  display: flex;
  gap: 28px;
  margin-top: 4px;
  border-bottom: 1px solid var(--separator);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.mestt-tabs::-webkit-scrollbar {
  display: none;
}
.mestt-tab {
  position: relative;
  flex: none;
  padding: 10px 2px 12px;
  background: none;
  border: 0;
  font-size: 14px;
  font-weight: 650;
  color: var(--label-3);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s;
}
.mestt-tab.active {
  color: var(--label);
}
.mestt-tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  height: 4px;
  width: 26px;
  border-radius: 9999px;
  background: var(--accent);
}
.mestt-panel[hidden] {
  display: none;
}
.mestt-panel > .prof-section:first-child {
  margin-top: 10px;
}
/* The one-line note at the top of a settings-page tab: what the tab is, in fact. */
.mestt-note {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--label-3);
}

/* The page itself: the overlay's scroll body has no padding of its own (the
   token and collection pages bring theirs), and the heading is the reference's
   "Account Settings" title, styled like the sheet's h3 with the sub beneath. */
.mestt-page {
  padding: 16px 20px 44px;
}
.mestt-page h3 {
  margin: 2px 0 4px;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.03em;
}
.mestt-page .mestt-sub {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--label-2);
}

.prof-section {
  margin-top: 20px;
}

/* The old section titles were how the four segments restated their labels;
   the ME tab bar carries the labels now, so the titles are gone. */

/* Create Page Styles
   ── these were silently unstyled once. A stray skeleton-class rule with an
   opening brace and no body sat above this comment and swallowed the whole block
   inside one rule, so every selector here was dead and the page rendered
   unstyled — CSS parses on, it does not error. If Create ever looks bare again,
   count the braces first. */
#view .create-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  border-bottom: 0.5px solid var(--separator);
  position: sticky;
  top: 0;
  z-index: 10;
}

#view .create-back-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: var(--fill);
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s;
}

#view .create-back-btn svg {
  width: 20px;
  height: 20px;
  color: var(--label);
}

#view .create-back-btn:active {
  transform: scale(0.92);
  background: var(--fill-2);
}

/* The back chevron points the way back, and in a right-to-left page that is the
   other way. Only the Create page is translated so far, so this is scoped to the
   `dir` attribute that page sets rather than to the document. */
[dir="rtl"] .create-back-btn svg {
  transform: scaleX(-1);
}

/* The Create page's upload limit, as derived text: the type list comes from
   `UPLOAD_TYPES` and the size from `UPLOAD_MAX_BYTES`, so the sentence and the
   `accept` attribute cannot disagree. */
#view .create-upload-progress {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--label-2);
}

/* The refusal sits under the box it is about, and only exists when it has
   something to say - it is `hidden` in the markup and `role="alert"`. The
   `[hidden]` rule has to be repeated: an author `display` beats the user
   agent's, so without it the empty box would be laid out on every page. */
#view #dzuploaderror {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
}

#view #dzuploaderror[hidden] {
  display: none;
}

/* What the network is, and what submitting will cost, above the button that
   spends it. Both figures are the server's: the badge comes from the health
   read and the fee from a simulation of this exact mint. */
#view .create-net {
  margin: 18px 0 4px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--fill);
}

#view .create-net-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--label);
}

#view .create-net .create-field-hint {
  margin-top: 4px;
}

#view .create-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

#view .create-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #4f46e5);
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

#view .create-logo-text {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--label);
}

#view .create-notification-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: var(--fill);
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s;
}

#view .create-notification-btn svg {
  width: 20px;
  height: 20px;
  color: var(--label);
}

#view .create-notification-btn:active {
  transform: scale(0.92);
  background: var(--fill-2);
}

#view .create-body {
  padding: 20px;
  max-width: 600px;
  margin: 0 auto;
}

#view .create-title-section {
  text-align: center;
  margin-bottom: 24px;
}

#view .create-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--label);
  margin: 0 0 8px;
}

#view .create-subtitle {
  font-size: 14px;
  color: var(--label-2);
  margin: 0;
}

#view .create-wallet-warning {
  background: #fff8eb;
  border: 1px solid #ffe2aa;
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

#view .create-warning-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: rgba(255, 149, 0, 0.1);
  display: grid;
  place-items: center;
  flex: none;
}

#view .create-warning-icon svg {
  width: 20px;
  height: 20px;
  color: #f59e0b;
}

#view .create-warning-content {
  flex: 1;
}

#view .create-warning-title {
  font-weight: 750;
  font-size: 14px;
  color: #92400e;
  margin-bottom: 4px;
}

#view .create-warning-text {
  font-size: 13px;
  color: #b45309;
}

#view .create-warning-btn {
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: #f59e0b;
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s;
}

#view .create-warning-btn:active {
  transform: scale(0.96);
  background: #d97706;
}

#view .create-section {
  margin-bottom: 32px;
}

#view .create-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

#view .create-section-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
}

#view .create-section-title {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--label);
}

#view .create-section-desc {
  font-size: 13px;
  color: var(--label-2);
  margin-bottom: 16px;
}

#view .create-upload {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

#view .create-upload-box {
  flex: 1;
  border: 2px dashed var(--separator);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}

#view .create-upload-box:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

#view .create-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

#view .create-upload-icon {
  width: 48px;
  height: 48px;
  color: var(--label-2);
}

#view .create-upload-text {
  font-weight: 650;
  font-size: 15px;
  color: var(--label);
}

#view .create-upload-formats {
  font-size: 12px;
  color: var(--label-2);
}

#view .create-upload-preview {
  width: 120px;
  height: 120px;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  flex: none;
  background: var(--fill);
}

#view .create-preview-image {
  width: 100%;
  height: 100%;
}

#view .create-preview-image img,
#view .create-preview-image svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#view .create-preview-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.12s;
}

#view .create-preview-remove svg {
  width: 14px;
  height: 14px;
  color: #fff;
}

#view .create-preview-remove:active {
  transform: scale(0.9);
}

#view .create-field {
  margin-bottom: 20px;
}

#view .create-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 650;
  color: var(--label);
}

#view .create-field input,
#view .create-field textarea,
#view .create-field select {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--fill);
  border: 1px solid var(--separator);
  font-size: 16px;
  color: var(--label);
  outline: none;
  transition: border-color 0.18s, background 0.18s;
}

#view .create-field input:focus,
#view .create-field textarea:focus,
#view .create-field select:focus {
  border-color: var(--accent);
  background: #fff;
}

#view .create-field textarea {
  resize: vertical;
  min-height: 100px;
}

#view .create-char-count {
  text-align: right;
  font-size: 12px;
  color: var(--label-3);
  margin-top: 4px;
}

#view .create-field-hint {
  font-size: 12px;
  color: var(--label-2);
  margin-top: 4px;
}

/*
 * The "Not available yet" block, and the disabled controls it explains.
 *
 * These exist because a control that accepts input and does nothing is worse than
 * one that is visibly unavailable: the first looks like a feature, and the page
 * cannot say so. So every field this section cannot honour is `disabled`, and the
 * reason is printed next to it in the ordinary type of the page rather than in a
 * tooltip nobody opens.
 *
 * `disabled` is also the accessible half. A greyed-out control is announced as
 * unavailable by VoiceOver and cannot be focused, so the reason beside it is not
 * decoration - for a screen reader it is the only way to find out why.
 */
#view .create-note {
  margin: 12px 0 18px;
  padding: 14px 16px;
  border-radius: var(--radius-md, 16px);
  font-size: 13px;
  line-height: 1.45;
  color: var(--label);
}
/* The colours come from `.note.warn` further down this file. Only the shape is
   here: copying the amber into a second rule would be a second copy of a colour
   that a change to the palette would then have to reach in two places. */

/* A disabled field: dimmed, and visibly not something to type into. */
#view .create-field input:disabled,
#view .create-field select:disabled,
#view .create-field textarea:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  -webkit-text-fill-color: var(--label-3);
}

/* The offers switch, off because nothing can turn it on. */
#view .create-toggle-off {
  cursor: not-allowed;
  opacity: 0.45;
}

#view .create-toggle {
  margin-top: 16px;
}

#view .create-toggle-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

#view .create-toggle-label input[type="checkbox"] {
  display: none;
}

#view .create-toggle-slider {
  width: 48px;
  height: 28px;
  border-radius: 14px;
  background: var(--fill);
  border: 1px solid var(--separator);
  position: relative;
  transition: background 0.18s, border-color 0.18s;
}

#view .create-toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: transform 0.18s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#view .create-toggle-label input:checked + .create-toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
}

#view .create-toggle-label input:checked + .create-toggle-slider::before {
  transform: translateX(20px);
}

#view .create-toggle-text {
  font-weight: 650;
  font-size: 15px;
  color: var(--label);
}

#view .create-toggle-desc {
  font-size: 13px;
  color: var(--label-2);
  margin-top: 6px;
  margin-left: 60px;
}

#view .create-security {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(79, 70, 229, 0.08));
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: var(--radius);
  padding: 20px;
  margin: 32px 0;
}

#view .create-security-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: rgba(124, 58, 237, 0.15);
  display: grid;
  place-items: center;
  flex: none;
}

#view .create-security-icon svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

#view .create-security-content {
  flex: 1;
}

#view .create-security-title {
  font-weight: 750;
  font-size: 15px;
  color: var(--label);
  margin-bottom: 4px;
}

#view .create-security-text {
  font-size: 13px;
  color: var(--label-2);
}

#view .create-security-pi {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #4f46e5);
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  flex: none;
}

#view .create-btn {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.01em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.12s, background 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.28);
}

#view .create-btn:active {
  transform: scale(0.985);
  background: var(--accent-press);
}

#view .create-btn:disabled {
  background: var(--fill-2);
  color: var(--label-3);
  box-shadow: none;
  cursor: not-allowed;
}

#view .create-btn-icon {
  width: 20px;
  height: 20px;
}

@media (max-width: 480px) {
  #view .create-upload {
    flex-direction: column;
  }

  #view .create-upload-preview {
    width: 100%;
    height: 200px;
  }
}

.skel {
  border-radius: 14px;
  background: linear-gradient(90deg, var(--fill) 22%, var(--fill-2) 42%, var(--fill) 62%);
  background-size: 300% 100%;
  animation: shimmer 1.15s ease-in-out infinite;
}

.empty {
  padding: 48px 28px;
  text-align: center;
}
.empty .mark {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
}
.empty .mark svg { width: 30px; height: 30px; }
.empty h4 { margin: 0 0 6px; font-size: 18px; font-weight: 750; letter-spacing: -0.02em; }
.empty p { margin: 0 auto 16px; max-width: 30ch; font-size: 14px; color: var(--label-2); }

.note {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--fill);
  color: var(--label-2);
  font-size: 13px;
  line-height: 1.5;
}
.note b { color: var(--label); }
.note.warn { background: rgba(255, 149, 0, 0.09); color: #8a5200; }
.note.warn b { color: #6e4200; }
.note.bad { background: rgba(255, 59, 48, 0.08); color: #a51d15; }
.note.bad b { color: #861710; }

/* The mint review: what will be minted, what it will cost, and who will own it.
   It lives in the sheet rather than the view, so it is not scoped to `#view`. */
.rev-art {
  margin: 4px 0 14px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--fill);
}

.rev-art img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}

.rev {
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: var(--fill);
  overflow: hidden;
}

.rev-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 14px;
  font-size: 14px;
}

.rev-row + .rev-row {
  border-top: 1px solid var(--separator, rgba(60, 60, 67, 0.12));
}

.rev-row > span:first-child {
  color: var(--label-2);
  flex: none;
}

.rev-row > span:last-child {
  font-weight: 600;
  text-align: end;
  overflow-wrap: anywhere;
}

/* Explore's controls: the filter button with its badge, the result count with a
   sort beside it, and Load more at the end of the grid. */
#view .explore-actions {
  display: flex;
  justify-content: flex-end;
  margin: -6px 0 10px;
}

#view .explore-badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

#view .explore-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 12px;
  font-size: 14px;
  color: var(--label);
}

#view .explore-count {
  font-weight: 600;
  color: var(--label-2);
}

#view .explore-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--label-2);
}

#view .explore-sort select {
  font-size: 14px;
  font-weight: 600;
  color: var(--label);
}

#view .explore-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 0 4px;
  color: var(--label-2);
}

/* Transaction step sheet. */
.steps { display: flex; flex-direction: column; gap: 2px; margin: 6px 0 14px; }
.step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 4px;
  min-height: 44px;
}
.step .dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--fill);
  color: var(--label-3);
}
.step .dot svg { width: 14px; height: 14px; }
.step .lbl { flex: 1; font-size: 15px; font-weight: 600; }
.step .lbl .sub { display: block; font-size: 12.5px; font-weight: 500; color: var(--label-2); margin-top: 1px; }
.step.doing .dot { background: var(--accent-soft); color: var(--accent); }
.step.doing .lbl { color: var(--accent); }
.step.done .dot { background: rgba(52, 199, 89, 0.14); color: var(--success); }
.step.failed .dot { background: rgba(255, 59, 48, 0.12); color: var(--danger); }
.step.failed .lbl { color: var(--danger); }

.spin {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid var(--accent-soft-2);
  border-top-color: var(--accent);
  animation: rot 0.75s linear infinite;
}
@keyframes rot { to { transform: rotate(360deg); } }

.hashbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--fill);
  font-size: 12.5px;
  color: var(--label-2);
}
.hashbox .mono {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hashbox .copy { color: var(--accent); font-weight: 700; font-size: 13px; flex: none; }

/* ============================================================= utilities */

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowlist { display: flex; flex-direction: column; gap: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.pad { padding: 0 20px; }
.mt { margin-top: 16px; }
.center { text-align: center; }

/* Activity row. */
.actrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

/* Keyframes animations - must be at top level */
@keyframes shimmer {
  from { background-position: 180% 0; }
  to { background-position: -60% 0; }
}

@keyframes rot {
  to { transform: rotate(360deg); }
}
.actrow + .actrow { border-top: 0.5px solid var(--separator); }
.actrow .ai {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  flex: none;
  display: grid;
  place-items: center;
}
.actrow .ai svg { width: 18px; height: 18px; }
.actrow .txt { flex: 1; min-width: 0; }
.actrow .txt .t { font-size: 15px; font-weight: 650; }
.actrow .txt .s { font-size: 12.5px; color: var(--label-2); margin-top: 1px; }
.actrow .when { font-size: 12px; color: var(--label-3); text-align: right; flex: none; }

/* ============================================================ token details
   Mobile-first, and the narrow case is the one designed for: the page is read
   on a phone, one column, thumb-reachable. Everything below the 520px mark is
   the default; the one breakpoint widens it for a desktop browser.

   These were inline `style=` attributes on the token page before. That cannot
   express a media query, so the layout could not change with the width at all —
   the two-column price block and the trait grid were frozen at whatever the
   phone happened to get.                                          */

.details { padding: 0 0 8px; }

/* Full-bleed artwork. Square because the artwork is: a 16:9 crop of a token
   image hides part of what the creator uploaded, and the image is the reason
   most people opened the page. */
.dhero {
  margin: 12px 16px 0;
  border-radius: 22px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--fill);
  box-shadow: var(--shadow-md);
}
.dhero .art { border-radius: 0; height: 100%; }

.dhead { padding: 16px 20px 0; }
.dname {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.dbyline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 7px;
  font-size: 13.5px;
  color: var(--label-2);
}
.dbyline .sep { color: var(--label-3); }
.dchips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 10px; }

/* Price. Always rendered, listed or not: a block that only appears when there is
   a price makes "not for sale" look like a section that failed to load. */
.dprice {
  margin: 16px 20px 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--fill);
}
.dprice .pl {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--label-2);
}
.dprice .pa {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.dprice .pa.on { color: var(--accent); }
.dprice .pa.off { color: var(--label-3); font-size: 22px; }
.dprice .pa .cur { font-size: 17px; font-weight: 700; color: var(--label-2); margin-left: 3px; }
.dprice .ps { font-size: 13px; color: var(--label-2); margin-top: 3px; }

.dactions { padding: 14px 20px 0; }

/* The two-column hero: the artwork on the left, the token's facts on the
   right. Stacked on a phone, split from 960px up - the item page shape
   marketplace sizes use, with the facts that describe the art beside it. */
.dtwo { display: block; }
.dinfo { min-width: 0; }

/* The market strip under the price: List price / Floor / Floor diff / Top
   offer. Two cells across on a phone, four once there is room, the same grid
   shape the trait cards sit in. */
.dstats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 12px 20px 0;
}
.dstat {
  padding: 11px 12px;
  border-radius: 13px;
  background: var(--fill);
  min-width: 0;
}
.dstat-k {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--label-2);
}
.dstat-v {
  font-size: 17px;
  font-weight: 800;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.dsection { padding: 0 20px; margin-top: 26px; }
.dsection > .dsh {
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--label-2);
  margin: 0 0 10px;
}
.ddesc {
  font-size: 15px;
  line-height: 1.55;
  color: var(--label);
  margin: 0;
  overflow-wrap: anywhere;
}

/* Traits. Two columns on a phone is the point: four properties fit in two rows
   instead of scrolling past four separate blocks. */
.dtraits {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.dtrait {
  padding: 11px 12px;
  border-radius: 13px;
  background: var(--fill);
  min-width: 0;
}
.dtrait .tk {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--label-2);
  font-weight: 700;
}
.dtrait .tv {
  font-size: 14.5px;
  font-weight: 750;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

/* The bounds of the activity window. It is a line of its own rather than part
   of a note because it is a fact about the record, not a warning: how far back
   the log reaches changes every time the node's retention window slides. */
.dbounds {
  font-size: 12.5px;
  color: var(--label-2);
  font-variant-numeric: tabular-nums;
  margin: 0 0 10px;
}
.dempty {
  padding: 14px 16px;
  border-radius: 13px;
  background: var(--fill);
  font-size: 14px;
  color: var(--label-2);
}

/* The failed read's raw text. Collapsed by default: it is there so anyone
   checking the failure can see exactly what the node said, and it is not the
   headline. `pre` has to be told to wrap, or a 400-character diagnostic becomes
   one line scrolled off the side of a phone. */
.derror { margin-top: 10px; }
.derror > summary {
  font-size: 12.5px;
  color: var(--label-2);
  cursor: pointer;
  padding: 6px 2px;
}
.derror > pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--label-2);
  background: var(--fill);
  border-radius: 12px;
  padding: 11px 12px;
  margin: 0;
}

@media (min-width: 520px) {
  .details { padding-bottom: 20px; }
  .dhero { margin: 16px 24px 0; border-radius: 26px; }
  .dhead { padding: 20px 28px 0; }
  .dname { font-size: 32px; }
  /* The price moves beside the name rather than below it: on a wide screen a
     number stacked under a title is a line the eye crosses to reach. */
  .dprice {
    margin: 18px 28px 0;
    display: flex;
    align-items: baseline;
    gap: 16px;
    flex-wrap: wrap;
  }
  .dprice .ps { margin-top: 0; }
  .dactions { padding: 16px 28px 0; }
  .dsection { padding: 0 28px; }
  .dtraits { grid-template-columns: repeat(4, 1fr); }
  .dstats { grid-template-columns: repeat(4, 1fr); margin: 12px 28px 0; }
}

/* The item page splits into two columns once there is room: the artwork on
   the left, the facts that describe it on the right. The sections below the
   hero keep their full width, so this is a two-lane hero, not a two-column
   page. */
@media (min-width: 960px) {
  .dtwo {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    padding: 0 28px;
  }
  .dtwo .dhero { margin: 16px 0 0; }
  .dtwo .dhead { padding: 4px 0 0; }
  .dtwo .dprice { margin: 16px 0 0; }
  .dtwo .dstats { margin: 12px 0 0; }
  .dtwo .dactions { padding: 14px 0 0; }
}

/* ==================================================== extra pieces used by
   the iOS rebuild: dropzone, collection header, padded cards, tappable rows. */

.pad-card { padding: 16px 16px 18px; }

button.row {
  width: 100%;
  text-align: left;
}

/* The create-page upload area: a local preview only, never stored. */
.dropzone {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px;
  cursor: pointer;
}
.dz-preview {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  overflow: hidden;
  background: var(--fill);
  /* Dashed border signals "drop zone" — classic upload affordance. */
  border: 2px dashed var(--separator-strong);
  transition: border-color 0.22s ease, background-color 0.22s ease;
}
.dz-preview:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dz-preview.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
  border-style: solid;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.dz-preview svg,
.dz-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
/* Upload states colour the whole tile. */
.dz-preview.ok { border-color: var(--success); border-style: solid; background: rgba(52,199,89,0.08); }
.dz-preview.busy { border-color: var(--warning); border-style: solid; background: rgba(245,158,11,0.08); }
.dz-preview.bad { border-color: var(--danger); border-style: solid; background: rgba(255,59,48,0.08); }

/* Placeholder overlay: centered upload icon + label inside the preview tile. */
.dz-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
  color: var(--label-2);
  padding: 20px;
  text-align: center;
}
.dz-placeholder .icon {
  width: 56px;
  height: 56px;
  stroke: currentColor;
  stroke-width: 1.6;
  opacity: 0.55;
}
.dz-placeholder .label {
  font-size: 14px;
  font-weight: 650;
  color: var(--label);
}
.dz-placeholder .hint {
  font-size: 11.5px;
  color: var(--label-3);
  max-width: 80%;
}
.dz-preview:not(.ok):not(.busy):not(.bad) .dz-placeholder { display: flex; }
.dz-preview.ok .dz-placeholder,
.dz-preview.busy .dz-placeholder,
.dz-preview.bad .dz-placeholder,
.dz-preview img + .dz-placeholder { display: none; }

/* The status pill, top-left of the artwork. */
.dz-status {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: var(--label);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}
.dz-preview.ok .dz-status { background: var(--success); }
.dz-preview.busy .dz-status { background: var(--warning); }
.dz-preview.bad .dz-status { background: var(--danger); }

.dz-text b { font-size: 14px; }
.dz-text span {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--label-2);
  line-height: 1.45;
}
.dz-preview.ok ~ .dz-text b { color: #1e7a34; }
.dz-preview.bad ~ .dz-text b { color: var(--danger); }

/* Collection page header. */
.collbanner {
  height: 132px;
  border-bottom-left-radius: 26px;
  border-bottom-right-radius: 26px;
}
.colllogo {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  flex: none;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: var(--shadow-md);
  border: 3px solid #fff;
}

/* ------------------------------------------------ collection items page */
/* The Magic Eden shelf: a header with the owner's name, a stat strip, then a
   tight grid of item cards. The name below is the *owner's* Pi username — a
   collection is an address, and the address sits under the name elided. */

.collhead {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: -34px;
}
.collhead-info {
  min-width: 0;
  padding-top: 34px;
}
.collhead-name {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.collhead-sub {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--label-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collstats {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.collstat {
  min-width: 0;
  padding: 10px 12px;
  background: var(--card);
  border: 0.5px solid var(--separator);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.collstat b {
  display: block;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.collstat span {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--label-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Tighter shelf than the explore grid, one card per little tile. */
.collgrid {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.mecard .price.last {
  margin-top: 3px;
}
.mecard .price.last .amt {
  color: var(--label-2);
}

/* ================================================================= profile */
/* The profile is a portfolio and nothing else: a bar with back on the left and
   settings on the right, one value card, quick actions, and the collection
   grid. No title, no avatar, no hero gradient — each of those was a place a
   number or a name got printed a second time. */

.prof {
  --prof-r: var(--radius);
  --prof-sh: var(--shadow-sm);
  padding-bottom: 28px;
}

/* ---- bar: back on the left, settings on the right, nothing between -------- */

.prof-bar {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 10px;
  padding: 2px 4px 10px;
}
.prof-bar-label {
  min-width: 0;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--label);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prof-bar-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  /* Black, like an iOS nav bar — these are chrome, not calls to action, and
     the accent purple made them read as the primary button of the page. */
  color: #000;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.prof-bar-btn:active { background: var(--fill); opacity: 0.4; }
.prof-bar-btn svg { width: 23px; height: 23px; }

/* ---- body ----------------------------------------------------------------- */

.prof-body {
  padding: 0 16px;
}

.prof-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--prof-sh);
  overflow: hidden;
}

/* ---- section headers and menu lists -------------------------------------- */

.prof-section {
  margin: 4px 0 -4px;
  padding: 0 4px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--label-2);
}

.prof-row {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  text-align: left;
  padding: 13px 14px;
  background: none;
  border: 0;
  cursor: default;
  color: inherit;
  font: inherit;
}
button.prof-row { cursor: pointer; }
button.prof-row:active { background: var(--fill); }
.prof-row + .prof-row { border-top: 0.5px solid var(--separator); }
.prof-row-ico {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  flex: none;
  display: grid;
  place-items: center;
  color: #fff;
}
.prof-row-ico svg { width: 17px; height: 17px; }
.prof-row-texts { flex: 1; min-width: 0; }
.prof-row-ttl { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.prof-row-sub {
  margin-top: 1px;
  font-size: 12.5px;
  color: var(--label-2);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* The right-hand cell of a row. A plain span is read-only; as a button it is
   an action, which is why the copy affordance is a small tinted pill rather
   than the whole row — clicking the row would read as "navigate". */
.prof-row-val {
  font-size: 14px;
  color: var(--label-2);
  text-align: right;
  flex: none;
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
button.prof-row-val {
  padding: 5px 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--fill);
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  max-width: none;
}
button.prof-row-val.copied { background: rgba(52, 199, 89, 0.14); color: #1e7a34; }

/* The tick and the `.prof-row.active` tint below belonged to the role switcher:
   one row per backend keypair, each with an avatar and a tick on the selected
   one. The switcher went — there was never more than one correct key for an
   action, so the choice was a way to get it wrong — and the rules went with it
   rather than staying to look authoritative. A brace-balance check now guards
   this file; a rule that no longer matches anything is a different failure and
   is caught by scripts/check-profile-css.mjs. */

/* `.nameinput` used to live here, for the field that let somebody type a name
   for a wallet. There is no such field: a name now comes from Pi's servers or
   it is not shown, and a text input is the one control that can only ever
   produce the other kind. The styles went with it rather than being left to
   look authoritative to the next person reading this file. */

/* ---- portfolio grid ------------------------------------------------------ */

.prof-empty {
  padding: 34px 20px;
  text-align: center;
  font-size: 14px;
  color: var(--label-2);
}

/* The ranked Collections table on Home, following the ranked-reference panel: a
   title bar carrying a (deliberately inert) 1d/7d/30d window control, then a
   four-column table — rank, Collection, Floor as a pill, and the sales total
   under the reference's "Lucky Buys" label. Same iOS hairline card as `.group`.
   The table scrolls sideways on narrow screens rather than squashing its
   figures, and the Collection column stays pinned on the left while it does. */
.collcard {
  margin: 2px 0 0;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.collbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 8px;
}
.colltitle {
  margin: 0;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.collcontrols {
  display: flex;
  align-items: center;
  gap: 12px;
}
.collseg {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: var(--radius-pill);
  background: var(--fill);
}
.collseg .seg {
  height: 26px;
  min-width: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  font-size: 12.5px;
  font-weight: 650;
  font-family: inherit;
  color: var(--label-2);
}
.collseg .seg.on {
  background: var(--card);
  color: var(--label);
  box-shadow: var(--shadow-sm);
}
.collseg .seg:disabled {
  cursor: default;
}
.colltable {
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 100%;
}
.colltable::-webkit-scrollbar { display: none; }
.collhead,
.collrow {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 480px;
  padding: 0 16px;
}
.collhead {
  padding-top: 10px;
  padding-bottom: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--label-2);
}
.collrow {
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  border: 0;
  border-top: 0.5px solid var(--separator);
  background: none;
  cursor: pointer;
  transition: background 0.12s;
}
.collrow:hover,
.collrow:active { background: var(--fill); }
.collhead .cc-rank,
.collrow .cc-rank {
  width: 28px;
  flex: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--label-2);
  font-variant-numeric: tabular-nums;
}
.collhead .cc-name {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.collhead .cc-num,
.collrow .cc-num {
  width: 90px;
  flex: none;
  text-align: right;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* Floor and Lucky Buys are wider than the generic figure column, on the head
   and the rows alike, so numbers line up over their headers. */
.collhead .cc-num.cc-floor,
.collrow .cc-num.cc-floor { width: 116px; }
.collhead .cc-num.cc-lucky,
.collrow .cc-num.cc-lucky { width: 96px; }
.collrow .cc-name {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--card);
}
.collrow:hover .cc-name,
.collrow:active .cc-name { background: var(--fill); }
.collrow .cc-thumb {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  flex: none;
}
.collrow .cc-body { min-width: 0; }
.collrow .cc-title {
  display: block;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.collrow .cc-sub {
  display: block;
  margin-top: 1px;
  font-size: 12px;
  color: var(--label-2);
}
/* The floor is a quiet pill, the way the reference draws it as a button; this
   one is a span because the whole row is the tappable surface. */
.collrow .cc-floorpill {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: var(--fill);
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
}
.collrow .cc-floorpill b { font-weight: 700; color: var(--label); }
.collrow .cc-floorpill i { font-style: normal; color: var(--label-2); font-size: 11.5px; }

/* A name on a detail row, and how it got there.
   The row itself is unstyled on purpose — it only exists to carry the title, so
   hovering or long-pressing a handle can say whether Pi and the ledger both
   confirmed it or whether somebody just typed it. The one visible mark is the dot
   on a typed name, and it is a dot rather than a badge because this sits inline
   after a handle: anything with a background or colour would read as an alert on
   every seller line and stop meaning anything by the third card. */
.named { cursor: help; }
.named.decl .decl {
  color: var(--label-2);
  margin-left: 3px;
  font-weight: 700;
}
