@font-face {
  font-family: "Louis George Cafe";
  src: url("../assets/fonts/louis-george-cafe/Louis%20George%20Cafe%20Light.ttf") format("truetype");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "Louis George Cafe";
  src: url("../assets/fonts/louis-george-cafe/Louis%20George%20Cafe.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Louis George Cafe";
  src: url("../assets/fonts/louis-george-cafe/Louis%20George%20Cafe%20Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --font: "Louis George Cafe", "Segoe UI", sans-serif;
  --bg: #0d0e10;
  --bg-raised: #111214;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-hover: rgba(255, 255, 255, 0.062);
  --surface-strong: rgba(255, 255, 255, 0.075);
  --glass: rgba(20, 21, 23, 0.74);
  --glass-solid: #17181a;
  --text: #eee9df;
  --text-strong: #f5f1e9;
  --muted: #aaa399;
  --dim: #777168;
  --line: rgba(232, 229, 220, 0.13);
  --line-strong: rgba(192, 164, 122, 0.38);
  --accent: #c0a47a;
  --accent-strong: #d2b78d;
  --accent-soft: rgba(192, 164, 122, 0.13);
  --yes: #b9a273;
  --yes-soft: rgba(185, 162, 115, 0.14);
  --no: #8f9b9f;
  --no-soft: rgba(143, 155, 159, 0.14);
  --danger: #d18a70;
  --danger-soft: rgba(209, 138, 112, 0.12);
  --success: #9eb495;
  --success-soft: rgba(158, 180, 149, 0.12);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
  --shadow-soft: 0 10px 32px rgba(0, 0, 0, 0.12);
  --radius-xs: 9px;
  --radius-sm: 13px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --header-h: 72px;
  --content: 1240px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #ede9df;
  --bg-raised: #e7e2d7;
  --surface: rgba(255, 255, 255, 0.42);
  --surface-hover: rgba(255, 255, 255, 0.66);
  --surface-strong: rgba(255, 255, 255, 0.78);
  --glass: rgba(240, 236, 227, 0.76);
  --glass-solid: #f0ece3;
  --text: #292a2b;
  --text-strong: #17181a;
  --muted: #6e685e;
  --dim: #8a8378;
  --line: rgba(23, 24, 26, 0.13);
  --line-strong: rgba(128, 104, 70, 0.4);
  --accent: #806846;
  --accent-strong: #685237;
  --accent-soft: rgba(128, 104, 70, 0.11);
  --yes: #876f47;
  --yes-soft: rgba(135, 111, 71, 0.12);
  --no: #5f7176;
  --no-soft: rgba(95, 113, 118, 0.11);
  --danger: #a65339;
  --danger-soft: rgba(166, 83, 57, 0.1);
  --success: #55704e;
  --success-soft: rgba(85, 112, 78, 0.1);
  --shadow: 0 24px 70px rgba(49, 43, 34, 0.12);
  --shadow-soft: 0 10px 30px rgba(49, 43, 34, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 76% -12%, var(--accent-soft), transparent 34%),
    linear-gradient(180deg, var(--bg-raised), var(--bg) 28%);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  transition: background-color 220ms ease, color 220ms ease;
}

body::-webkit-scrollbar {
  width: 8px;
}

body::-webkit-scrollbar-track {
  background: transparent;
}

body::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 2px solid transparent;
  border-radius: 8px;
  background-clip: padding-box;
}

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

button,
a,
input,
select,
textarea,
[tabindex] {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  transition:
    background-color 190ms ease,
    border-color 190ms ease,
    color 190ms ease,
    opacity 190ms ease,
    transform 190ms var(--ease),
    box-shadow 190ms ease;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}

h1,
h2,
h3 {
  color: var(--text-strong);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.14;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.35rem);
}

h2 {
  font-size: clamp(1.55rem, 2.5vw, 2.15rem);
}

h3 {
  font-size: 1.08rem;
}

small,
.small {
  font-size: 0.82rem;
}

.numeral {
  font-variant-numeric: tabular-nums lining-nums;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  background: var(--text-strong);
  color: var(--bg);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.app-header {
  position: sticky;
  z-index: 50;
  top: 0;
  padding: 10px 18px 0;
}

.header-shell {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  width: min(var(--content), 100%);
  min-height: 58px;
  margin: 0 auto;
  padding: 7px 8px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--glass);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.07), inset 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
}

.brand-mark:hover {
  background: var(--surface-hover);
}

.brand-mark img {
  width: 30px;
  height: 30px;
  opacity: 0.86;
}

html[data-theme="dark"] .brand-mark img {
  filter: brightness(0) invert(1);
  opacity: 0.72;
}

.primary-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.primary-nav a {
  position: relative;
  min-height: 42px;
  padding: 11px 13px;
  border-radius: 11px;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.primary-nav a::after {
  position: absolute;
  right: 13px;
  bottom: 6px;
  left: 13px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  content: "";
  opacity: 0;
  transform: scaleX(0.2);
  transition: opacity 190ms ease, transform 190ms ease;
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  background: var(--surface-hover);
  color: var(--text-strong);
}

.primary-nav a[aria-current="page"]::after {
  opacity: 0.72;
  transform: scaleX(1);
}

.mobile-docs-link {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.network-status,
.icon-button,
.wallet-button {
  min-height: 44px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
}

.network-status:hover,
.icon-button:hover,
.wallet-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.network-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.75rem;
}

.network-status > span:first-child {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.icon-button {
  display: grid;
  width: 44px;
  padding: 0;
  place-items: center;
  border-radius: 12px;
}

.theme-icon {
  position: relative;
  width: 17px;
  height: 17px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.theme-icon::after {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--glass-solid);
  content: "";
}

html[data-theme="light"] .theme-icon::after {
  top: 3px;
  right: 3px;
  width: 7px;
  height: 7px;
  background: currentColor;
}

.wallet-button {
  min-width: 132px;
  padding: 0 15px;
  border-radius: 12px;
  color: var(--text-strong);
  font-size: 0.8rem;
}

.wallet-connected {
  display: grid;
  gap: 1px;
  text-align: left;
}

.wallet-connected [data-wallet-balance] {
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

.wallet-connected [data-wallet-party] {
  color: var(--dim);
  font-size: 0.66rem;
}

#app-main {
  width: min(var(--content), calc(100% - 36px));
  min-height: calc(100vh - var(--header-h));
  margin: 0 auto;
  padding: 44px 0 96px;
}

.page-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 26px;
}

.page-intro-copy {
  display: grid;
  gap: 8px;
  max-width: 690px;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.lead {
  max-width: 660px;
  color: var(--muted);
  font-size: 1rem;
}

.prototype-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--dim);
  font-size: 0.74rem;
  white-space: nowrap;
}

.prototype-note::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.discovery-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  margin-bottom: 15px;
}

.search-field {
  position: relative;
}

.search-field::before {
  position: absolute;
  top: 50%;
  left: 16px;
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  content: "";
  transform: translateY(-58%);
}

.search-field::after {
  position: absolute;
  top: 53%;
  left: 27px;
  width: 6px;
  height: 1.5px;
  background: var(--muted);
  content: "";
  transform: rotate(45deg);
}

.search-field input,
.select-control,
.field-control {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-strong);
}

.search-field input {
  padding: 0 16px 0 42px;
}

.search-field input::placeholder,
.field-control::placeholder {
  color: var(--dim);
}

.select-control {
  min-width: 180px;
  padding: 0 40px 0 14px;
}

.search-field input:hover,
.select-control:hover,
.field-control:hover {
  border-color: var(--line-strong);
}

.search-field input:focus,
.select-control:focus,
.field-control:focus {
  border-color: var(--accent);
  background: var(--surface-hover);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.filter-strip {
  display: flex;
  gap: 7px;
  margin-bottom: 26px;
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-strip::-webkit-scrollbar {
  display: none;
}

.filter-button,
.segmented-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  white-space: nowrap;
}

.filter-button:hover,
.filter-button[aria-pressed="true"],
.segmented-button:hover,
.segmented-button[aria-selected="true"] {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  color: var(--text-strong);
}

.market-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.market-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.46fr);
  gap: 34px;
  padding: 23px 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.market-row:hover {
  padding-right: 14px;
  padding-left: 14px;
  background: linear-gradient(90deg, transparent, var(--surface), transparent);
}

.market-primary {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.market-kicker,
.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 13px;
  color: var(--dim);
  font-size: 0.73rem;
}

.market-kicker .category {
  color: var(--accent);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-open {
  color: var(--success);
}

.status-ending {
  color: var(--accent);
}

.status-resolved {
  color: var(--muted);
}

.status-void,
.status-invalid {
  color: var(--danger);
}

.market-question {
  max-width: 780px;
  color: var(--text-strong);
  font-size: clamp(1.02rem, 1.8vw, 1.25rem);
  line-height: 1.36;
}

.market-secondary {
  display: grid;
  align-content: center;
  gap: 9px;
}

.split-labels {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}

.split-labels .yes-label {
  color: var(--yes);
}

.split-labels .no-label {
  color: var(--no);
}

.split-track {
  display: flex;
  height: 5px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--line);
}

.split-track > span {
  display: block;
  height: 100%;
  transition: width 260ms var(--ease);
}

.split-track .yes-fill {
  background: var(--yes);
}

.split-track .no-fill {
  background: var(--no);
}

.split-note {
  color: var(--dim);
  font-size: 0.7rem;
}

.empty-panel {
  display: grid;
  min-height: 260px;
  place-items: center;
  padding: 44px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
  text-align: center;
}

.detail-back {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 0.82rem;
}

.detail-back::before {
  margin-right: 8px;
  content: "←";
}

.detail-back:hover {
  color: var(--text-strong);
  transform: translateX(-2px);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
  gap: 42px;
}

.detail-content {
  min-width: 0;
}

.detail-head {
  display: grid;
  gap: 16px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.detail-head h1 {
  max-width: 860px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 24px 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.metric {
  min-width: 0;
  padding: 18px;
  border-right: 1px solid var(--line);
}

.metric:last-child {
  border-right: 0;
}

.metric dt {
  margin-bottom: 6px;
  color: var(--dim);
  font-size: 0.68rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.metric dd {
  overflow: hidden;
  color: var(--text-strong);
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-tabs,
.portfolio-tabs {
  display: flex;
  gap: 2px;
  margin-top: 28px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.detail-tabs::-webkit-scrollbar,
.portfolio-tabs::-webkit-scrollbar {
  display: none;
}

.tab-button {
  position: relative;
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  white-space: nowrap;
}

.tab-button::after {
  position: absolute;
  right: 14px;
  bottom: -1px;
  left: 14px;
  height: 1px;
  background: var(--accent);
  content: "";
  opacity: 0;
  transform: scaleX(0.2);
  transition: opacity 180ms ease, transform 180ms ease;
}

.tab-button[aria-selected="true"] {
  color: var(--text-strong);
}

.tab-button[aria-selected="true"]::after {
  opacity: 1;
  transform: scaleX(1);
}

.tab-panel {
  display: grid;
  gap: 22px;
  padding: 26px 0;
}

.content-block {
  display: grid;
  gap: 9px;
}

.content-block p,
.content-block li {
  max-width: 760px;
  color: var(--muted);
}

.content-block ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
}

.source-list {
  display: grid;
  gap: 9px;
}

.source-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.source-row span:first-child {
  color: var(--dim);
  font-size: 0.78rem;
}

.source-row span:last-child {
  color: var(--text);
}

.lifecycle {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  margin: 8px 0;
}

.lifecycle-step {
  position: relative;
  display: grid;
  gap: 8px;
  padding-right: 8px;
  color: var(--dim);
  font-size: 0.68rem;
}

.lifecycle-step::before {
  position: relative;
  z-index: 1;
  width: 8px;
  height: 8px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--line-strong);
  box-shadow: 0 0 0 1px var(--line);
  content: "";
}

.lifecycle-step::after {
  position: absolute;
  top: 4px;
  right: 0;
  left: 8px;
  height: 1px;
  background: var(--line);
  content: "";
}

.lifecycle-step:last-child::after {
  display: none;
}

.lifecycle-step.is-complete,
.lifecycle-step.is-current {
  color: var(--text-strong);
}

.lifecycle-step.is-complete::before,
.lifecycle-step.is-current::before {
  background: var(--accent);
}

.lifecycle-step.is-current::before {
  box-shadow: 0 0 0 5px var(--accent-soft);
}

.trade-panel {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--glass);
  box-shadow: var(--shadow-soft), inset 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px) saturate(115%);
  -webkit-backdrop-filter: blur(18px) saturate(115%);
}

.trade-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.trade-panel-head span {
  color: var(--dim);
  font-size: 0.7rem;
}

.side-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.side-button {
  display: grid;
  min-height: 58px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.side-button span {
  display: block;
  font-size: 0.72rem;
}

.side-button strong {
  font-size: 1rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.side-button.yes-side:hover,
.side-button.yes-side[aria-pressed="true"] {
  border-color: var(--yes);
  background: var(--yes-soft);
  color: var(--yes);
}

.side-button.no-side:hover,
.side-button.no-side[aria-pressed="true"] {
  border-color: var(--no);
  background: var(--no-soft);
  color: var(--no);
}

.field {
  display: grid;
  gap: 7px;
}

.field > label,
.field-label {
  color: var(--muted);
  font-size: 0.76rem;
}

.amount-field {
  position: relative;
}

.amount-field input {
  padding: 0 56px 0 14px;
  font-variant-numeric: tabular-nums;
}

.amount-field span {
  position: absolute;
  top: 50%;
  right: 14px;
  color: var(--dim);
  font-size: 0.75rem;
  transform: translateY(-50%);
}

.quick-amounts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.quick-amounts button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.73rem;
}

.quick-amounts button:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  color: var(--text-strong);
}

.estimate {
  display: grid;
  gap: 9px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.estimate-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 0.78rem;
}

.estimate-row strong {
  color: var(--text-strong);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 13px;
  cursor: pointer;
}

.primary-button {
  border: 1px solid var(--text-strong);
  background: var(--text-strong);
  color: var(--bg);
}

.primary-button:hover:not(:disabled) {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--text-strong), var(--accent-strong));
  box-shadow: 0 12px 30px var(--accent-soft);
  transform: translateY(-1px);
}

.secondary-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}

.secondary-button:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.danger-button {
  border: 1px solid var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

button:disabled,
.is-disabled {
  cursor: not-allowed;
  opacity: 0.46;
  transform: none !important;
}

.inline-notice {
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
}

.inline-notice strong {
  color: var(--text-strong);
  font-weight: 400;
}

.inline-notice.warning {
  border-color: color-mix(in srgb, var(--danger) 48%, transparent);
  background: var(--danger-soft);
}

.fine-print {
  color: var(--dim);
  font-size: 0.7rem;
  line-height: 1.5;
}

.wizard-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 760px);
  align-items: start;
  gap: 46px;
}

.wizard-progress {
  position: sticky;
  top: 100px;
  display: grid;
  gap: 4px;
}

.wizard-step {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  text-align: left;
}

.wizard-step:disabled {
  cursor: default;
  opacity: 0.48;
}

.wizard-step span:first-child {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 0.7rem;
}

.wizard-step[aria-current="step"] {
  background: var(--surface);
  color: var(--text-strong);
}

.wizard-step[aria-current="step"] span:first-child {
  border-color: var(--accent);
  color: var(--accent);
}

.wizard-form {
  display: grid;
  gap: 24px;
}

.form-section {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.form-section-head {
  display: grid;
  gap: 6px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.form-section-head p {
  color: var(--muted);
  font-size: 0.86rem;
}

.field-control {
  padding: 0 14px;
}

textarea.field-control {
  min-height: 122px;
  padding: 12px 14px;
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field-help,
.field-error {
  font-size: 0.71rem;
}

.field-help {
  color: var(--dim);
}

.field-error {
  color: var(--danger);
}

.wizard-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wizard-actions .right-actions {
  display: flex;
  gap: 9px;
}

.review-market {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.review-market h3 {
  font-size: 1.25rem;
}

.sp-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.sp-item {
  padding: 16px;
  border-right: 1px solid var(--line);
}

.sp-item:last-child {
  border-right: 0;
}

.sp-item span {
  display: block;
  color: var(--dim);
  font-size: 0.67rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sp-item strong {
  display: block;
  margin-top: 4px;
  color: var(--text-strong);
  font-size: 1.1rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.checklist {
  display: grid;
  gap: 9px;
}

.check-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 9px;
  color: var(--muted);
  font-size: 0.82rem;
}

.check-row input {
  width: 16px;
  height: 16px;
  margin: 3px 0 0;
  accent-color: var(--accent);
}

.portfolio-tabs {
  margin-top: 0;
}

.portfolio-list {
  display: grid;
}

.portfolio-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(90px, 0.25fr)) auto;
  align-items: center;
  gap: 20px;
  padding: 18px 8px;
  border-bottom: 1px solid var(--line);
}

.portfolio-market {
  display: grid;
  gap: 5px;
}

.portfolio-market strong {
  color: var(--text-strong);
  font-weight: 400;
  line-height: 1.35;
}

.portfolio-label {
  display: block;
  margin-bottom: 3px;
  color: var(--dim);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.portfolio-value {
  color: var(--text);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}

.claim-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
  font-size: 0.74rem;
}

.claim-button.is-static {
  background: transparent;
  color: var(--dim);
  cursor: default;
}

.passport-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
}

.identity-card,
.passport-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.identity-card {
  display: grid;
  align-content: start;
  gap: 20px;
  padding: 24px;
}

.identity-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--accent-soft);
}

.identity-mark img {
  width: 34px;
  height: 34px;
}

html[data-theme="dark"] .identity-mark img {
  filter: brightness(0) invert(1);
  opacity: 0.74;
}

.identity-copy {
  display: grid;
  gap: 5px;
}

.identity-copy p {
  color: var(--muted);
  font-size: 0.82rem;
}

.identity-stats {
  display: grid;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.identity-stat {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 0.8rem;
}

.identity-stat strong {
  color: var(--text-strong);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.passport-card {
  overflow: hidden;
}

.passport-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
}

.passport-metric {
  min-height: 130px;
  padding: 20px;
  border-right: 1px solid var(--line);
}

.passport-metric:last-child {
  border-right: 0;
}

.passport-metric span {
  color: var(--dim);
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.passport-metric strong {
  display: block;
  margin-top: 10px;
  color: var(--text-strong);
  font-size: clamp(1.15rem, 2.2vw, 1.75rem);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.passport-metric small {
  display: block;
  margin-top: 5px;
  color: var(--dim);
}

.passport-body {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
}

.calibration-panel,
.category-panel {
  padding: 24px;
}

.calibration-panel {
  border-right: 1px solid var(--line);
}

.section-label {
  margin-bottom: 18px;
  color: var(--dim);
  font-size: 0.69rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.calibration-chart {
  position: relative;
  height: 210px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(to right, transparent calc(25% - 0.5px), var(--line) 25%, transparent calc(25% + 0.5px)),
    linear-gradient(to right, transparent calc(50% - 0.5px), var(--line) 50%, transparent calc(50% + 0.5px)),
    linear-gradient(to right, transparent calc(75% - 0.5px), var(--line) 75%, transparent calc(75% + 0.5px)),
    linear-gradient(to bottom, transparent calc(50% - 0.5px), var(--line) 50%, transparent calc(50% + 0.5px));
}

.calibration-line {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
}

.calibration-line svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.calibration-line polyline {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.7;
  vector-effect: non-scaling-stroke;
}

.calibration-line line {
  stroke: var(--dim);
  stroke-width: 1;
  stroke-dasharray: 4 6;
  opacity: 0.55;
  vector-effect: non-scaling-stroke;
}

.calibration-line circle {
  fill: var(--bg);
  stroke: var(--accent);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.chart-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--dim);
  font-size: 0.65rem;
}

.category-performance {
  display: grid;
  gap: 14px;
}

.performance-row {
  display: grid;
  gap: 6px;
}

.performance-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.76rem;
}

.performance-head strong {
  color: var(--text);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.performance-track {
  height: 4px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--line);
}

.performance-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 50%, var(--muted)));
}

.tooltip-trigger {
  display: inline-grid;
  width: 18px;
  height: 18px;
  margin-left: 4px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--dim);
  cursor: help;
  font-size: 0.65rem;
  vertical-align: middle;
}

.tooltip-trigger:hover,
.tooltip-trigger:focus-visible {
  border-color: var(--line-strong);
  color: var(--text-strong);
}

.skeleton {
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
}

.skeleton::after {
  display: block;
  width: 45%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--surface-strong), transparent);
  content: "";
  animation: skeleton 1.2s ease-in-out infinite;
}

@keyframes skeleton {
  from {
    transform: translateX(-120%);
  }
  to {
    transform: translateX(260%);
  }
}

.dialog-layer {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  padding-top: max(20px, env(safe-area-inset-top));
  padding-right: max(20px, env(safe-area-inset-right));
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  padding-left: max(20px, env(safe-area-inset-left));
}

.dialog-layer[hidden] {
  display: none;
}

.dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 6, 7, 0.56);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: fade-in 180ms ease both;
}

.dialog-panel {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  max-height: min(760px, calc(100dvh - max(20px, env(safe-area-inset-top)) - max(20px, env(safe-area-inset-bottom))));
  padding: 24px;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--glass-solid);
  box-shadow: var(--shadow);
  animation: dialog-in 200ms var(--ease) both;
}

.dialog-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.dialog-head-copy {
  display: grid;
  gap: 5px;
}

.dialog-head-copy p {
  color: var(--muted);
  font-size: 0.82rem;
}

.dialog-close {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.dialog-close:hover {
  border-color: var(--line-strong);
  color: var(--text-strong);
}

.wallet-options {
  display: grid;
  gap: 9px;
}

.wallet-option {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.wallet-option:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.wallet-option:disabled {
  cursor: default;
}

.wallet-option:disabled:hover {
  border-color: var(--line-strong);
  background: linear-gradient(120deg, var(--surface-hover), var(--accent-soft));
  transform: none;
}

.wallet-option-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.76rem;
}

.wallet-option-copy {
  display: grid;
  gap: 2px;
}

.wallet-option-copy strong {
  color: var(--text-strong);
  font-size: 0.86rem;
  font-weight: 400;
}

.wallet-option-copy span,
.wallet-option > span:last-child {
  color: var(--dim);
  font-size: 0.7rem;
}

.wallet-summary {
  display: grid;
  gap: 13px;
}

.wallet-balance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.wallet-balance-item {
  padding: 13px;
  border-right: 1px solid var(--line);
}

.wallet-balance-item:last-child {
  border-right: 0;
}

.wallet-balance-item span {
  display: block;
  color: var(--dim);
  font-size: 0.65rem;
}

.wallet-balance-item strong {
  display: block;
  margin-top: 4px;
  color: var(--text-strong);
  font-size: 0.88rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.party-reference {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  font-size: 0.75rem;
}

.copy-button {
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 0.7rem;
}

.dialog-summary {
  display: grid;
  gap: 0;
  margin: 18px 0;
  border-top: 1px solid var(--line);
}

.dialog-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}

.dialog-summary-row strong {
  color: var(--text-strong);
  font-weight: 400;
  text-align: right;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 20px;
}

.transaction-progress {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.transaction-step {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  color: var(--dim);
  font-size: 0.8rem;
}

.transaction-step::before {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  content: "";
}

.transaction-step.is-active {
  color: var(--text-strong);
}

.transaction-step.is-active::before {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 4px var(--glass-solid);
  background: var(--accent);
}

.transaction-step.is-complete::before {
  border-color: var(--success);
  background: var(--success);
  content: "✓";
  color: var(--bg);
  font-size: 0.68rem;
}

.toast-region {
  position: fixed;
  z-index: 300;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100% - 36px));
}

.toast {
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--glass-solid);
  color: var(--text);
  box-shadow: var(--shadow-soft);
  font-size: 0.8rem;
  animation: toast-in 200ms var(--ease) both;
}

.mobile-nav {
  display: none;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .header-shell,
  .trade-panel {
    background: var(--glass-solid);
  }
}

@media (max-width: 1020px) {
  .primary-nav {
    gap: 0;
  }

  .primary-nav a {
    padding-inline: 9px;
    font-size: 0.72rem;
  }

  .network-status {
    display: none;
  }

  .detail-layout {
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 26px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric:nth-child(2) {
    border-right: 0;
  }

  .metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .wizard-shell {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 28px;
  }

  .passport-layout {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .passport-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .passport-metric:nth-child(2) {
    border-right: 0;
  }

  .passport-metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .passport-body {
    grid-template-columns: 1fr;
  }

  .calibration-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  :root {
    --header-h: 68px;
  }

  body {
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
  }

  .app-header {
    padding: max(8px, env(safe-area-inset-top)) 10px 0;
  }

  .header-shell {
    grid-template-columns: auto 1fr;
    min-height: 56px;
    padding: 6px 7px 6px 10px;
    border-radius: 18px;
  }

  .primary-nav {
    display: none;
  }

  .header-actions {
    grid-column: 2;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .brand-mark img {
    width: 29px;
    height: 29px;
  }

  .network-status {
    display: none;
  }

  .mobile-docs-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 9px;
    border-radius: 11px;
    color: var(--muted);
    font-size: 0.72rem;
  }

  .mobile-docs-link:hover {
    background: var(--surface-hover);
    color: var(--text-strong);
  }

  .wallet-button {
    min-width: 112px;
    padding: 0 12px;
  }

  .wallet-connected [data-wallet-party] {
    display: none;
  }

  #app-main {
    width: min(100% - 24px, var(--content));
    padding-top: 32px;
    padding-bottom: 28px;
  }

  .page-intro {
    align-items: start;
    flex-direction: column;
    gap: 13px;
    margin-bottom: 22px;
  }

  .page-intro h1 {
    font-size: 2.1rem;
  }

  .discovery-bar {
    grid-template-columns: 1fr;
  }

  .select-control {
    min-width: 0;
  }

  .filter-strip {
    margin-right: -12px;
    margin-left: -12px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .filter-button,
  .segmented-button,
  .quick-amounts button,
  .claim-button,
  .copy-button {
    min-height: 44px;
  }

  .market-row {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 20px 3px;
  }

  .market-row:hover {
    padding-right: 7px;
    padding-left: 7px;
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .trade-panel {
    position: static;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .source-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .lifecycle {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .lifecycle-step {
    grid-template-columns: 14px 1fr;
    align-items: start;
    min-height: 40px;
    padding: 0;
  }

  .lifecycle-step::after {
    top: 8px;
    right: auto;
    bottom: 0;
    left: 4px;
    width: 1px;
    height: auto;
  }

  .wizard-shell {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .wizard-progress {
    position: static;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
  }

  .wizard-step {
    grid-template-columns: auto 1fr;
    gap: 7px;
    min-height: 44px;
    padding: 5px;
    font-size: 0.72rem;
  }

  .wizard-step:disabled {
  cursor: default;
  opacity: 0.48;
}

.wizard-step span:first-child {
    width: 23px;
    height: 23px;
  }

  .form-section {
    padding: 19px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .sp-summary {
    grid-template-columns: 1fr;
  }

  .sp-item {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sp-item:last-child {
    border-bottom: 0;
  }

  .portfolio-row {
    grid-template-columns: 1fr 1fr;
    gap: 13px 20px;
    padding: 18px 4px;
  }

  .portfolio-market {
    grid-column: 1 / -1;
  }

  .portfolio-row > :last-child {
    justify-self: end;
  }

  .passport-layout {
    grid-template-columns: 1fr;
  }

  .passport-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .calibration-chart {
    height: 190px;
  }

  .mobile-nav {
    position: fixed;
    z-index: 80;
    right: 10px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 10px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: 62px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--glass);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px) saturate(120%);
    -webkit-backdrop-filter: blur(18px) saturate(120%);
  }

  .mobile-nav a {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    min-height: 50px;
    border-radius: 13px;
    color: var(--dim);
    font-size: 0.62rem;
  }

  .mobile-nav a:hover,
  .mobile-nav a[aria-current="page"] {
    background: var(--surface-hover);
    color: var(--text-strong);
  }

  .mobile-nav-icon {
    position: relative;
    display: block;
    width: 18px;
    height: 18px;
  }

  .market-icon::before {
    position: absolute;
    inset: 2px;
    border: 1px solid currentColor;
    border-radius: 3px;
    content: "";
  }

  .market-icon::after {
    position: absolute;
    top: 6px;
    right: 5px;
    left: 5px;
    height: 1px;
    background: currentColor;
    box-shadow: 0 4px currentColor;
    content: "";
  }

  .create-icon::before,
  .create-icon::after {
    position: absolute;
    top: 8px;
    left: 3px;
    width: 12px;
    height: 1px;
    background: currentColor;
    content: "";
  }

  .create-icon::after {
    transform: rotate(90deg);
  }

  .portfolio-icon::before {
    position: absolute;
    top: 3px;
    right: 2px;
    bottom: 3px;
    left: 2px;
    border: 1px solid currentColor;
    border-radius: 3px;
    content: "";
  }

  .portfolio-icon::after {
    position: absolute;
    top: 7px;
    right: 2px;
    left: 2px;
    height: 1px;
    background: currentColor;
    content: "";
  }

  .passport-icon::before {
    position: absolute;
    inset: 2px 3px;
    border: 1px solid currentColor;
    border-radius: 3px;
    content: "";
  }

  .passport-icon::after {
    position: absolute;
    top: 6px;
    right: 6px;
    left: 6px;
    height: 1px;
    background: currentColor;
    box-shadow: 0 4px currentColor;
    content: "";
  }

  .profile-icon::before {
    position: absolute;
    top: 2px;
    left: 6px;
    width: 6px;
    height: 6px;
    border: 1px solid currentColor;
    border-radius: 50%;
    content: "";
  }

  .profile-icon::after {
    position: absolute;
    right: 2px;
    bottom: 1px;
    left: 2px;
    height: 7px;
    border: 1px solid currentColor;
    border-radius: 9px 9px 3px 3px;
    content: "";
  }

  .toast-region {
    right: 12px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    width: calc(100% - 24px);
  }
}

@media (max-width: 430px) {
  .header-actions {
    gap: 5px;
  }

  .icon-button {
    width: 44px;
  }

  .wallet-button {
    min-width: 104px;
    padding: 0 10px;
    font-size: 0.74rem;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .metric,
  .metric:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric:last-child {
    border-bottom: 0;
  }

  .detail-tabs,
  .portfolio-tabs {
    margin-right: -12px;
    margin-left: -12px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .wizard-step {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .wizard-step span:last-child {
    display: none;
  }

  .wizard-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .wizard-actions .right-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .passport-metrics {
    grid-template-columns: 1fr;
  }

  .passport-metric,
  .passport-metric:nth-child(2) {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .passport-metric:last-child {
    border-bottom: 0;
  }

  .passport-body {
    grid-template-columns: 1fr;
  }

  .wallet-balance-grid {
    grid-template-columns: 1fr;
  }

  .wallet-balance-item {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .wallet-balance-item:last-child {
    border-bottom: 0;
  }

  .dialog-panel {
    padding: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* App refinement: navigation, branded controls, profile, and footer */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

#app-main:focus,
#app-main:focus-visible {
  outline: none;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 9px 0 2px;
  border-radius: 13px;
}

.app-brand:hover {
  background: linear-gradient(90deg, var(--surface-hover), transparent);
}

.app-brand .brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 11px;
}

.app-brand:hover .brand-mark {
  background: transparent;
}

.brand-word {
  color: var(--text-strong);
  font-size: 0.78rem;
  font-weight: 300;
  letter-spacing: 0.2em;
}

.primary-nav a {
  overflow: hidden;
  border: 1px solid transparent;
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  border-color: var(--line);
  background: linear-gradient(145deg, var(--surface-hover), transparent 88%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.045);
  transform: translateY(-1px);
}

.primary-nav a:hover::after,
.primary-nav a[aria-current="page"]::after {
  opacity: 0.72;
  transform: scaleX(1);
}

.network-status {
  min-height: 40px;
  padding: 0 9px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--dim);
  letter-spacing: 0.025em;
}

.network-status:hover {
  border-color: transparent;
  background: var(--surface);
  color: var(--text-strong);
}

.theme-toggle {
  position: relative;
  width: 62px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.045);
}

.theme-toggle:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.theme-track {
  position: absolute;
  inset: 3px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  justify-items: center;
}

.theme-thumb {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--glass-solid);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.16), inset 0 1px rgba(255, 255, 255, 0.08);
  transform: translateX(22px);
  transition: transform 260ms var(--ease), background-color 220ms ease;
}

.theme-toggle[data-mode="light"] .theme-thumb {
  transform: translateX(0);
}

.theme-sun,
.theme-moon {
  position: relative;
  z-index: 1;
  width: 13px;
  height: 13px;
  pointer-events: none;
}

.theme-sun {
  border: 1.5px solid currentColor;
  border-radius: 50%;
  color: var(--accent);
  box-shadow: 0 -6px 0 -5px currentColor, 0 6px 0 -5px currentColor, 6px 0 0 -5px currentColor, -6px 0 0 -5px currentColor;
}

.theme-moon {
  border: 1.5px solid currentColor;
  border-radius: 50%;
  color: var(--text);
}

.theme-moon::after {
  position: absolute;
  top: -2px;
  left: -4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--glass-solid);
  content: "";
}

.wallet-button {
  min-width: 150px;
  min-height: 46px;
  padding: 0 15px;
  overflow: hidden;
  border-radius: 15px;
  background: linear-gradient(145deg, var(--surface-strong), var(--surface));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.055);
}

.wallet-button:hover {
  border-color: var(--line-strong);
  background: linear-gradient(145deg, var(--surface-hover), var(--accent-soft));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1), inset 0 1px rgba(255, 255, 255, 0.075);
  transform: translateY(-1px);
}

.wallet-disconnected,
.wallet-connected {
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.wallet-disconnected {
  display: flex;
  white-space: nowrap;
}

.wallet-symbol {
  position: relative;
  width: 17px;
  height: 13px;
  border: 1.4px solid currentColor;
  border-radius: 4px;
  opacity: 0.82;
}

.wallet-symbol::before {
  position: absolute;
  top: -5px;
  left: 2px;
  width: 11px;
  height: 5px;
  border: 1.4px solid currentColor;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  content: "";
}

.wallet-symbol::after {
  position: absolute;
  top: 4px;
  right: 2px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.wallet-connected {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  text-align: left;
}

.wallet-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent-soft), var(--surface-hover));
  color: var(--accent);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
}

.wallet-connected-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.wallet-connected [data-wallet-name] {
  overflow: hidden;
  color: var(--text-strong);
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-connected [data-wallet-balance] {
  color: var(--dim);
  font-size: 0.64rem;
}

/* Branded dropdowns */
.custom-select {
  position: relative;
  z-index: 5;
  min-width: 188px;
}

.custom-select-trigger,
.date-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(145deg, var(--surface), transparent);
  color: var(--text-strong);
  cursor: pointer;
  text-align: left;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
}

.custom-select-trigger:hover,
.custom-select.is-open .custom-select-trigger,
.date-control:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.custom-select.is-open .custom-select-trigger,
.date-control:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-soft), inset 0 1px rgba(255, 255, 255, 0.055);
}

.select-chevron {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  color: var(--muted);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 220ms var(--ease);
}

.custom-select.is-open .select-chevron {
  transform: translateY(2px) rotate(225deg);
}

.custom-select-menu {
  position: absolute;
  z-index: 90;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  display: grid;
  gap: 3px;
  min-width: max-content;
  padding: 6px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: color-mix(in srgb, var(--glass-solid) 94%, transparent);
  box-shadow: var(--shadow-soft), inset 0 1px rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(22px) saturate(125%);
  -webkit-backdrop-filter: blur(22px) saturate(125%);
  animation: select-in 160ms var(--ease) both;
}

.custom-select-menu[hidden] {
  display: none;
}

.custom-select-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  gap: 14px;
  min-width: 180px;
  min-height: 42px;
  padding: 0 11px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}

.custom-select-option:hover,
.custom-select-option:focus-visible {
  background: var(--surface-hover);
  color: var(--text-strong);
  outline: none;
}

.custom-select-option[aria-selected="true"] {
  background: linear-gradient(100deg, var(--accent-soft), transparent);
  color: var(--text-strong);
}

.option-check {
  position: relative;
  width: 15px;
  height: 15px;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.custom-select-option[aria-selected="true"] .option-check {
  border-color: var(--accent);
}

.custom-select-option[aria-selected="true"] .option-check::after {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.field-label {
  color: var(--muted);
  font-size: 0.78rem;
}

.field .custom-select {
  width: 100%;
}

.date-control-copy {
  display: grid;
  gap: 2px;
}

.date-control-copy strong {
  font-size: 0.86rem;
  font-weight: 400;
}

.date-control-copy small {
  color: var(--dim);
  font-size: 0.68rem;
}

.calendar-icon {
  position: relative;
  width: 17px;
  height: 16px;
  border: 1.4px solid var(--muted);
  border-radius: 4px;
}

.calendar-icon::before {
  position: absolute;
  top: 3px;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--muted);
  content: "";
}

.calendar-icon::after {
  position: absolute;
  top: -3px;
  right: 3px;
  left: 3px;
  height: 4px;
  border-right: 1.4px solid var(--muted);
  border-left: 1.4px solid var(--muted);
  content: "";
}

/* Date picker */
.dialog-panel:has(.date-picker) {
  width: min(560px, 100%);
}

.date-picker {
  display: grid;
  gap: 14px;
}

.calendar-toolbar {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 10px;
}

.calendar-toolbar strong {
  text-align: center;
  font-weight: 400;
}

.calendar-nav {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.calendar-nav:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.calendar-nav span {
  width: 8px;
  height: 8px;
  border-bottom: 1.5px solid currentColor;
  border-left: 1.5px solid currentColor;
  transform: translateX(2px) rotate(45deg);
}

.calendar-nav.next span {
  transform: translateX(-2px) rotate(225deg);
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-weekdays span {
  padding: 5px 0;
  color: var(--dim);
  font-size: 0.64rem;
  text-align: center;
}

.calendar-day,
.calendar-blank {
  aspect-ratio: 1;
}

.calendar-day {
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
}

.calendar-day:hover,
.calendar-day:focus-visible {
  border-color: var(--line);
  background: var(--surface-hover);
  color: var(--text-strong);
  outline: none;
}

.calendar-day[aria-selected="true"] {
  border-color: var(--accent);
  background: linear-gradient(145deg, var(--accent-strong), var(--accent));
  color: var(--bg);
  box-shadow: 0 8px 20px var(--accent-soft);
}

.time-editor {
  display: grid;
  grid-template-columns: 1fr 76px 12px 76px;
  align-items: end;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.time-editor-copy {
  display: grid;
  align-self: center;
  gap: 2px;
}

.time-editor-copy span {
  color: var(--text-strong);
  font-size: 0.82rem;
}

.time-editor-copy small,
.time-editor label span {
  color: var(--dim);
  font-size: 0.64rem;
}

.time-editor label {
  display: grid;
  gap: 5px;
}

.time-editor input {
  width: 100%;
  min-height: 44px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text-strong);
  text-align: center;
  -moz-appearance: textfield;
}

.time-editor input::-webkit-inner-spin-button,
.time-editor input::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.time-separator {
  align-self: center;
  color: var(--dim);
  text-align: center;
}

.minute-presets {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.minute-presets button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  font-size: 0.68rem;
}

.minute-presets button:hover,
.minute-presets button[aria-pressed="true"] {
  border-color: var(--line-strong);
  background: var(--accent-soft);
  color: var(--text-strong);
}

/* Market interactions */
.market-row {
  position: relative;
  overflow: hidden;
  transition: background-color 220ms ease, border-color 220ms ease;
}

.market-row::before {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--accent), transparent);
  content: "";
  opacity: 0;
  transform: scaleY(0.35);
  transition: opacity 220ms ease, transform 280ms var(--ease);
}

.market-row:hover {
  padding-right: 8px;
  padding-left: 8px;
  background: linear-gradient(90deg, var(--accent-soft), transparent 22%, transparent 80%, var(--surface));
}

.market-row:hover::before {
  opacity: 0.9;
  transform: scaleY(1);
}

.market-question {
  transition: color 200ms ease, transform 260ms var(--ease);
}

.market-row:hover .market-question {
  color: var(--accent-strong);
  transform: translateX(4px);
}

.filter-button,
.segmented-button {
  border-radius: 999px;
  transition: background-color 220ms ease, border-color 220ms ease, color 220ms ease, transform 220ms var(--ease), box-shadow 220ms ease;
}

.filter-button:hover,
.filter-button[aria-pressed="true"] {
  background: linear-gradient(130deg, var(--surface-hover), var(--accent-soft));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.market-state-message {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 11px;
  padding: 12px 2px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.market-state-message::before {
  position: absolute;
  top: -1px;
  bottom: -1px;
  left: 0;
  width: 1px;
  background: var(--accent);
  content: "";
}

.market-state-message.is-owner::before {
  background: var(--danger);
}

.market-state-message > div {
  display: grid;
  gap: 2px;
}

.market-state-message strong {
  color: var(--text-strong);
  font-size: 0.78rem;
  font-weight: 400;
}

.market-state-message span {
  font-size: 0.72rem;
}

.market-state-icon {
  position: relative;
  display: grid;
  width: 20px;
  height: 20px;
  margin-left: 2px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.market-state-icon::before {
  width: 6px;
  height: 6px;
  border: 1px solid currentColor;
  border-radius: 50%;
  content: "";
}

.is-owner .market-state-icon {
  color: var(--danger);
}

/* Dialog and wallet polish */
.dialog-panel {
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0, var(--accent-soft), transparent 38%),
    var(--glass-solid);
  scrollbar-width: none;
}

.dialog-panel::-webkit-scrollbar {
  display: none;
}

.dialog-close {
  position: relative;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface);
}

.dialog-close:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  transform: rotate(90deg);
}

.close-glyph,
.close-glyph::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 1px;
  background: currentColor;
  content: "";
}

.close-glyph {
  transform: translate(-50%, -50%) rotate(45deg);
}

.close-glyph::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.wallet-option {
  grid-template-columns: 46px minmax(0, 1fr) auto;
  min-height: 76px;
  padding: 12px 13px;
  border-radius: 17px;
  background: linear-gradient(145deg, var(--surface), transparent);
}

.wallet-option:hover {
  background: linear-gradient(120deg, var(--surface-hover), var(--accent-soft));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.055);
  transform: translateY(-1px);
}

.wallet-option.is-selected {
  border-color: var(--line-strong);
  background: linear-gradient(120deg, var(--surface-hover), var(--accent-soft));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.065);
}

.wallet-option-mark {
  position: relative;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, var(--surface-hover), var(--accent-soft));
}

.participant-mark::before,
.participant-mark::after,
.creator-mark::before,
.creator-mark::after,
.participant-mark span,
.creator-mark span {
  position: absolute;
  content: "";
}

.participant-mark::before {
  top: 9px;
  left: 15px;
  width: 10px;
  height: 10px;
  border: 1.4px solid var(--accent);
  border-radius: 50%;
}

.participant-mark::after {
  right: 9px;
  bottom: 8px;
  left: 9px;
  height: 10px;
  border: 1.4px solid var(--accent);
  border-radius: 12px 12px 5px 5px;
}

.creator-mark::before {
  top: 10px;
  left: 9px;
  width: 23px;
  height: 22px;
  border: 1.4px solid var(--accent);
  border-radius: 6px;
}

.creator-mark::after {
  top: 15px;
  left: 15px;
  width: 11px;
  height: 1px;
  background: var(--accent);
  box-shadow: 0 5px var(--accent), 0 10px var(--accent);
}

.credential-note {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 11px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.credential-note > div {
  display: grid;
  gap: 3px;
}

.credential-note strong {
  color: var(--text-strong);
  font-size: 0.78rem;
  font-weight: 400;
}

.credential-note span {
  font-size: 0.72rem;
}

.credential-mark {
  position: relative;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1px solid var(--accent);
  border-radius: 50%;
}

.credential-mark::before {
  position: absolute;
  top: 4px;
  left: 5px;
  width: 5px;
  height: 3px;
  border-bottom: 1.5px solid var(--accent);
  border-left: 1.5px solid var(--accent);
  content: "";
  transform: rotate(-45deg);
}

.wallet-dialog-actions {
  flex-wrap: wrap;
}

/* Signal Passport */
.passport-intro {
  align-items: center;
}

.passport-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.utility-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.76rem;
}

.utility-button:hover {
  border-color: var(--line-strong);
  background: linear-gradient(135deg, var(--surface-hover), var(--accent-soft));
  color: var(--text-strong);
  transform: translateY(-1px);
}

.save-icon,
.share-icon {
  position: relative;
  width: 15px;
  height: 15px;
}

.save-icon {
  border: 1.3px solid currentColor;
  border-radius: 3px;
}

.save-icon::before {
  position: absolute;
  top: 2px;
  right: 3px;
  left: 3px;
  height: 3px;
  border: 1px solid currentColor;
  content: "";
}

.save-icon::after {
  position: absolute;
  right: 3px;
  bottom: 2px;
  left: 3px;
  height: 4px;
  border: 1px solid currentColor;
  border-radius: 2px 2px 0 0;
  content: "";
}

.share-icon::before {
  position: absolute;
  right: 3px;
  bottom: 1px;
  left: 3px;
  height: 8px;
  border: 1.3px solid currentColor;
  border-top: 0;
  border-radius: 0 0 3px 3px;
  content: "";
}

.share-icon::after {
  position: absolute;
  top: 1px;
  left: 5px;
  width: 6px;
  height: 6px;
  border-top: 1.3px solid currentColor;
  border-left: 1.3px solid currentColor;
  content: "";
  transform: rotate(45deg);
}

.identity-mark {
  display: block;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.identity-mark img {
  width: 48px;
  height: 48px;
}

.identity-copy > span {
  color: var(--dim);
  font-size: 0.75rem;
  line-height: 1.55;
}

.calibration-chart {
  height: 250px;
  overflow: hidden;
  border-radius: 0 14px 0 0;
}

.calibration-line {
  inset: 0;
}

.calibration-point {
  position: absolute;
  z-index: 2;
  top: var(--point-y);
  left: var(--point-x);
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--glass-solid);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 5px 14px rgba(0, 0, 0, 0.18);
  transform: translate(-50%, -50%);
}

.passport-note {
  margin-top: 22px;
}

/* Editable profile */
.profile-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
  align-items: start;
  gap: 24px;
}

.profile-preview,
.profile-editor {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
}

.profile-preview {
  position: sticky;
  top: 98px;
  display: grid;
  gap: 22px;
  min-height: 420px;
  padding: 28px;
  overflow: hidden;
}

.profile-preview::after {
  position: absolute;
  right: -90px;
  bottom: -120px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 68%);
  content: "";
  pointer-events: none;
}

.profile-avatar-large {
  position: relative;
  z-index: 1;
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent-soft), var(--surface-hover));
  color: var(--accent);
  font-size: 1rem;
  letter-spacing: 0.06em;
}

.profile-preview-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
}

.profile-preview-copy > span {
  color: var(--dim);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
}

.profile-preview-copy p,
.profile-preview > p,
.profile-verified {
  color: var(--muted);
  font-size: 0.8rem;
}

.profile-preview > p {
  position: relative;
  z-index: 1;
  line-height: 1.65;
}

.profile-verified {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.profile-verified .credential-mark {
  flex: 0 0 auto;
}

.profile-editor {
  display: grid;
  gap: 22px;
  padding: 28px;
}

.profile-role-badge {
  width: fit-content;
  margin-top: 5px;
  padding: 6px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-role-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(145deg, var(--surface-hover), transparent);
}

.profile-role-row > div {
  display: grid;
  gap: 4px;
}

.profile-role-row span,
.profile-role-row small {
  color: var(--dim);
  font-size: 0.69rem;
}

.profile-role-row span {
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.profile-role-row strong {
  color: var(--text-strong);
  font-size: 0.9rem;
  font-weight: 400;
}

.profile-role-row .secondary-button {
  flex: 0 0 auto;
}

.profile-bio {
  min-height: 150px;
}

.profile-party-reference > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-actions {
  margin-top: 2px;
}

.profile-empty > div {
  display: grid;
  justify-items: center;
  max-width: 520px;
  gap: 12px;
}

.profile-empty p {
  margin-bottom: 6px;
}

.profile-empty-mark {
  position: relative;
  width: 54px;
  height: 54px;
  margin-bottom: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.profile-empty-mark::before {
  position: absolute;
  top: 11px;
  left: 19px;
  width: 14px;
  height: 14px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  content: "";
}

.profile-empty-mark::after {
  position: absolute;
  right: 10px;
  bottom: 9px;
  left: 10px;
  height: 13px;
  border: 1px solid var(--accent);
  border-radius: 15px 15px 5px 5px;
  content: "";
}

/* App footer */
.app-footer {
  padding: 54px 18px 30px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, var(--surface));
}

.footer-shell {
  width: min(var(--content), 100%);
  margin: 0 auto;
}

.footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 42px 70px;
}

.footer-identity {
  display: grid;
  max-width: 360px;
  gap: 16px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
}

.footer-brand img {
  width: 46px;
  height: 46px;
}

html[data-theme="dark"] .footer-brand img {
  filter: brightness(0) invert(1);
  opacity: 0.74;
}

.footer-brand span {
  color: var(--text-strong);
  font-size: 0.8rem;
  font-weight: 300;
  letter-spacing: 0.2em;
}

.footer-identity p {
  color: var(--dim);
  font-size: 0.78rem;
  line-height: 1.65;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 34px 66px;
}

.footer-column {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 120px;
}

.footer-column > span {
  margin-bottom: 4px;
  color: var(--dim);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
}

.footer-column a,
.footer-column button {
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.75rem;
  text-align: left;
}

.footer-column a:hover,
.footer-column button:hover {
  color: var(--accent-strong);
  transform: translateX(2px);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 50px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 0.62rem;
  letter-spacing: 0.13em;
}

@keyframes select-in {
  from { opacity: 0; transform: translateY(-5px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 1020px) {
  .brand-word {
    font-size: 0.72rem;
    letter-spacing: 0.16em;
  }

  .wallet-button {
    min-width: 138px;
  }

  .footer-top {
    flex-direction: column;
  }
}

@media (max-width: 760px) {
  .header-shell {
    grid-template-columns: auto 1fr;
  }

  .app-brand {
    gap: 6px;
    padding-right: 6px;
  }

  .app-brand .brand-mark {
    width: 36px;
    height: 40px;
  }

  .app-brand .brand-mark img {
    width: 27px;
    height: 27px;
  }

  .brand-word {
    font-size: 0.66rem;
    letter-spacing: 0.12em;
  }

  .header-actions {
    gap: 6px;
  }

  .theme-toggle {
    width: 58px;
  }

  .theme-thumb {
    width: 30px;
    height: 30px;
    transform: translateX(22px);
  }

  .wallet-button {
    min-width: 116px;
    padding: 0 11px;
  }

  .wallet-connected {
    grid-template-columns: 27px minmax(0, 1fr);
  }

  .wallet-avatar {
    width: 27px;
    height: 27px;
  }

  .wallet-connected [data-wallet-name] {
    max-width: 74px;
  }

  .custom-select {
    width: 100%;
    min-width: 0;
  }

  .custom-select-menu {
    min-width: 100%;
  }

  .market-row:hover {
    padding-right: 3px;
    padding-left: 3px;
  }

  .passport-intro {
    align-items: flex-start;
  }

  .passport-actions {
    justify-content: flex-start;
  }

  .calibration-chart {
    height: 230px;
  }

  .profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-preview {
    position: static;
    min-height: 350px;
  }

  .profile-preview::after {
    display: none;
  }

  .profile-role-row {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-role-row .secondary-button {
    width: 100%;
  }

  .app-footer {
    padding-right: 14px;
    padding-bottom: calc(104px + env(safe-area-inset-bottom));
    padding-left: 14px;
  }

  .footer-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 30px 24px;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 430px) {
  .brand-word {
    max-width: 48px;
    overflow: hidden;
    font-size: 0.6rem;
    letter-spacing: 0.08em;
  }

  .theme-toggle {
    width: 52px;
    height: 38px;
  }

  .theme-thumb {
    width: 30px;
    height: 30px;
    transform: translateX(16px);
  }

  .wallet-button {
    min-width: 98px;
    font-size: 0.68rem;
  }

  .wallet-disconnected {
    gap: 6px;
  }

  .wallet-symbol {
    width: 15px;
  }

  .wallet-connected [data-wallet-name] {
    max-width: 54px;
  }

  .time-editor {
    grid-template-columns: 1fr 64px 10px 64px;
  }

  .minute-presets {
    justify-content: stretch;
  }

  .minute-presets button {
    flex: 1;
    padding-inline: 6px;
  }

  .passport-actions,
  .utility-button {
    width: 100%;
  }

  .utility-button {
    flex: 1;
  }

  .profile-preview,
  .profile-editor {
    padding: 20px;
  }

  .footer-links {
    grid-template-columns: 1fr 1fr;
  }
}
.network-status > span:first-child {
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.footer-bottom-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}

.footer-socials {
  display: flex;
  align-items: center;
  gap: 7px;
}

.footer-socials button {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
}

.footer-socials button:hover {
  border-color: var(--line-strong);
  background: linear-gradient(145deg, var(--surface-hover), var(--accent-soft));
  transform: translateY(-2px);
}

.footer-socials img {
  width: 15px;
  height: 15px;
  opacity: 0.76;
  transition: opacity 180ms ease, transform 240ms var(--ease);
}

html[data-theme="dark"] .footer-socials img {
  filter: brightness(0) invert(1);
}

.footer-socials button:hover img {
  opacity: 1;
  transform: scale(1.06);
}

@media (max-width: 760px) {
  .footer-bottom-end {
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
  }
}

@media (max-width: 430px) {
  .footer-bottom-end {
    flex-direction: column;
  }
}
/* Requested control alignment refinement */
.filter-strip {
  padding-block: 3px 7px;
}

.filter-button:hover,
.filter-button[aria-pressed="true"] {
  transform: none;
}

.search-field::before {
  top: 50%;
  left: 17px;
  width: 13px;
  height: 13px;
  transform: translateY(-50%);
}

.search-field::after {
  top: 50%;
  left: 29px;
  width: 7px;
  height: 1.5px;
  border-radius: 999px;
  transform: translateY(4px) rotate(45deg);
  transform-origin: left center;
}

.search-field::before,
.search-field::after {
  pointer-events: none;
}

.search-field input {
  padding-left: 46px;
}

.theme-toggle {
  width: 50px;
  height: 30px;
  border-color: var(--line);
  background: transparent;
  box-shadow: none;
}

.theme-toggle:hover {
  background: var(--surface);
}

.theme-track {
  inset: 2px;
}

.theme-thumb {
  width: 24px;
  height: 24px;
  border: 0;
  background: var(--surface-strong);
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.18);
  transform: translateX(20px);
}

.theme-toggle[data-mode="light"] .theme-thumb {
  transform: translateX(0);
}

.theme-sun,
.theme-moon {
  width: 10px;
  height: 10px;
  opacity: 0.42;
  transition: opacity 180ms ease;
}

.theme-sun {
  border-width: 1.2px;
  box-shadow: 0 -5px 0 -4px currentColor, 0 5px 0 -4px currentColor, 5px 0 0 -4px currentColor, -5px 0 0 -4px currentColor;
}

.theme-moon {
  border-width: 1.2px;
}

.theme-moon::after {
  top: -2px;
  left: -3px;
  width: 10px;
  height: 10px;
  background: var(--surface-strong);
}

.theme-toggle[data-mode="light"] .theme-sun,
.theme-toggle[data-mode="dark"] .theme-moon {
  opacity: 1;
}

.wallet-disconnected[hidden],
.wallet-connected[hidden] {
  display: none !important;
}

.wallet-button {
  min-width: 136px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
}

.wallet-button[data-connected] {
  min-width: 154px;
  padding: 4px 10px;
  border-radius: 14px;
  background: var(--surface);
}

.wallet-button:hover {
  background: var(--surface-hover);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05);
  transform: none;
}

.wallet-symbol {
  width: 17px;
  height: 13px;
  border-width: 1.3px;
  border-radius: 4px;
}

.wallet-symbol::before {
  top: 3px;
  right: -1px;
  left: auto;
  width: 7px;
  height: 6px;
  border: 1.3px solid currentColor;
  border-right: 0;
  border-radius: 3px 0 0 3px;
  background: var(--bg);
}

.wallet-symbol::after {
  top: 6px;
  right: 2px;
  width: 2px;
  height: 2px;
}

.save-icon,
.share-icon {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 0;
}

.save-icon::before,
.share-icon::before {
  position: absolute;
  top: 0;
  right: auto;
  bottom: auto;
  left: 4px;
  width: 8px;
  height: 9px;
  border: 0;
  background: currentColor;
  content: "";
}

.save-icon::before {
  clip-path: polygon(42% 0, 58% 0, 58% 52%, 100% 52%, 50% 100%, 0 52%, 42% 52%);
}

.share-icon::before {
  clip-path: polygon(50% 0, 100% 48%, 58% 48%, 58% 100%, 42% 100%, 42% 48%, 0 48%);
}

.save-icon::after,
.share-icon::after {
  position: absolute;
  top: auto;
  right: 1px;
  bottom: 0;
  left: 1px;
  width: auto;
  height: 5px;
  border: 1.3px solid currentColor;
  border-top: 0;
  border-radius: 0 0 3px 3px;
  content: "";
  transform: none;
}

.tooltip-trigger {
  width: 20px;
  height: 20px;
  padding: 0;
  place-items: center;
  font-size: 0.7rem;
  line-height: 1;
  vertical-align: -0.18em;
}

.check-row {
  align-items: center;
  min-height: 32px;
}

.check-row input {
  display: grid;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  place-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  appearance: none;
  background: transparent;
}

.check-row input::before {
  width: 6px;
  height: 3px;
  border-bottom: 1.5px solid var(--accent);
  border-left: 1.5px solid var(--accent);
  content: "";
  transform: translateY(-1px) rotate(-45deg) scale(0);
  transition: transform 160ms var(--ease);
}

.check-row input:checked {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.check-row input:checked::before {
  transform: translateY(-1px) rotate(-45deg) scale(1);
}

.claim-button {
  border-radius: 999px;
  background: transparent;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms var(--ease);
}

.claim-button:not(.is-static):hover,
.claim-button:not(.is-static):focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text-strong);
  outline: none;
  box-shadow: 0 8px 20px var(--accent-soft);
  transform: translateY(-1px);
}
@media (max-width: 760px) {
  .wallet-button {
    min-width: 116px;
    padding-inline: 11px;
  }

  .wallet-button[data-connected] {
    min-width: 132px;
  }
}

@media (max-width: 430px) {
  .wallet-button {
    min-width: 104px;
    padding-inline: 9px;
  }

  .wallet-button[data-connected] {
    min-width: 118px;
  }
}
/* Requested icon precision refinement */
.footer-socials button {
  width: 42px;
  height: 42px;
  border-color: var(--line);
  background: var(--surface);
}

.footer-socials button:hover {
  border-color: var(--line-strong);
  background: linear-gradient(135deg, var(--surface-hover), var(--accent-soft));
}

.footer-socials img,
html[data-theme="dark"] .footer-socials img {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
  opacity: 1;
  filter: none;
}

.theme-toggle {
  width: 46px;
  height: 26px;
  background: var(--surface);
  box-shadow: none;
}

.theme-track {
  inset: 2px;
  display: block;
}

.theme-thumb {
  top: 0;
  left: 0;
  width: 22px;
  height: 22px;
  border: 0;
  background: var(--surface-strong);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transform: translateX(20px);
}

.theme-toggle[data-mode="light"] .theme-thumb {
  transform: translateX(0);
}

.theme-sun,
.theme-moon {
  position: absolute;
  z-index: 2;
  top: 50%;
  width: 11px;
  height: 11px;
  border: 0;
  background: currentColor;
  box-shadow: none;
  opacity: 0.36;
  transform: translateY(-50%);
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
}

.theme-sun {
  left: 5.5px;
  -webkit-mask-image: url("../assets/icons/bayzen-sun.svg");
  mask-image: url("../assets/icons/bayzen-sun.svg");
}

.theme-moon {
  right: 5.5px;
  -webkit-mask-image: url("../assets/icons/bayzen-moon.svg");
  mask-image: url("../assets/icons/bayzen-moon.svg");
}

.theme-moon::after {
  content: none;
}

.theme-toggle[data-mode="light"] .theme-sun,
.theme-toggle[data-mode="dark"] .theme-moon {
  color: var(--accent);
  opacity: 1;
}

.check-row input {
  display: grid;
  place-items: center;
}

.check-row input::before {
  width: 8px;
  height: 6px;
  border: 0;
  background: var(--accent);
  clip-path: polygon(13% 43%, 0 58%, 37% 100%, 100% 18%, 84% 5%, 36% 73%);
  transform: scale(0);
  transform-origin: center;
}

.check-row input:checked::before {
  transform: scale(1);
}
/* Email access gate */
body.is-authenticating {
  min-height: 100svh;
  padding-bottom: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 8%, rgba(216, 189, 145, 0.16), transparent 31%),
    radial-gradient(circle at 86% 84%, rgba(13, 14, 16, 0.28), transparent 36%),
    linear-gradient(128deg, #0d0e10 0%, #3c4245 54%, #9a8061 100%);
}

body.is-authenticating .skip-link,
body.is-authenticating .app-header,
body.is-authenticating .app-footer,
body.is-authenticating .mobile-nav {
  display: none;
}

body.is-authenticating #app-main {
  width: 100%;
  height: 100dvh;
  min-height: 100svh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

body.is-authenticating #app-main:focus,
body.is-authenticating #app-main:focus-visible {
  outline: 0;
}

.auth-gate {
  --auth-ink: #f2eee5;
  --auth-muted: rgba(242, 238, 229, 0.66);
  --auth-dim: rgba(242, 238, 229, 0.45);
  --auth-line: rgba(242, 238, 229, 0.15);
  --auth-line-strong: rgba(216, 189, 145, 0.5);
  --auth-champagne: #d8bd91;
  --auth-shift-x: 0px;
  --auth-shift-y: 0px;
  --auth-counter-x: 0px;
  --auth-counter-y: 0px;
  position: relative;
  width: 100%;
  min-height: 100dvh;
  overflow: hidden;
  color: var(--auth-ink);
  background:
    radial-gradient(circle at 82% 84%, rgba(154, 128, 97, 0.2), transparent 31%),
    linear-gradient(128deg, #0d0e10 0%, #3c4245 54%, #9a8061 100%);
}

.auth-gate::before,
.auth-gate::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

.auth-gate::before {
  inset: -12%;
  background: linear-gradient(122deg, rgba(13, 14, 16, 0.28), rgba(13, 14, 16, 0.03) 47%, rgba(13, 14, 16, 0.22));
  filter: blur(44px);
  opacity: 0.78;
  transform: translate3d(var(--auth-shift-x), var(--auth-shift-y), 0);
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-gate::after {
  inset: -8%;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(13, 14, 16, 0.28) 100%);
  transform: translate3d(var(--auth-counter-x), var(--auth-counter-y), 0);
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-layout {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  width: 100%;
  min-height: 100dvh;
}

.auth-access-pane {
  display: grid;
  place-items: center;
  width: min(100%, 620px);
  min-height: 100dvh;
  padding:
    max(22px, env(safe-area-inset-top))
    max(22px, env(safe-area-inset-right))
    max(28px, env(safe-area-inset-bottom))
    max(22px, env(safe-area-inset-left));
}

.auth-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 64px;
  padding: 8px 10px 8px 14px;
  border: 1px solid rgba(242, 238, 229, 0.17);
  border-radius: 19px;
  background: rgba(17, 18, 20, 0.42);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.07),
    0 18px 48px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(22px) saturate(125%);
  -webkit-backdrop-filter: blur(22px) saturate(125%);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 8px;
  border-radius: 12px;
}

.auth-brand:hover {
  background: rgba(255, 255, 255, 0.05);
}

.auth-brand img {
  width: 34px;
  height: 34px;
  filter: brightness(0) invert(1);
  opacity: 0.8;
}

.auth-brand span {
  color: var(--auth-ink);
  font-size: 0.76rem;
  font-weight: 300;
  letter-spacing: 0.2em;
}

.auth-docs-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(242, 238, 229, 0.16);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--auth-muted);
  font-size: 0.78rem;
}

.auth-docs-link:hover {
  border-color: rgba(216, 189, 145, 0.62);
  background: linear-gradient(135deg, rgba(60, 66, 69, 0.72), rgba(154, 128, 97, 0.58));
  color: var(--auth-ink);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.1),
    0 10px 28px rgba(13, 14, 16, 0.18);
  transform: translateY(-1px);
}

.auth-form-wrap {
  display: grid;
  align-items: center;
  justify-items: center;
  width: 100%;
  padding: clamp(38px, 7vh, 76px) 0;
}

.auth-panel {
  position: relative;
  display: grid;
  width: min(100%, 440px);
  gap: 24px;
  padding: clamp(28px, 4vw, 36px);
  overflow: hidden;
  border: 1px solid rgba(242, 238, 229, 0.18);
  border-radius: 30px;
  background:
    linear-gradient(148deg, rgba(242, 238, 229, 0.13), rgba(242, 238, 229, 0.045) 42%, rgba(13, 14, 16, 0.14)),
    rgba(19, 21, 22, 0.61);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.1),
    0 34px 86px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(28px) saturate(118%);
  -webkit-backdrop-filter: blur(28px) saturate(118%);
}

.auth-panel::after {
  display: none;
}

.auth-panel-brand,
.auth-brand-lockup {
  display: flex;
  align-items: center;
}

.auth-panel-brand {
  justify-content: space-between;
  min-height: 34px;
  gap: 18px;
}

.auth-brand-lockup {
  gap: 10px;
}

.auth-brand-lockup img {
  width: 26px;
  height: 26px;
  filter: brightness(0) invert(1);
  opacity: 0.78;
}

.auth-brand-lockup span {
  color: var(--auth-muted);
  font-size: 0.69rem;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

#app-main[data-auth-view="email"] .auth-panel {
  gap: 25px;
}

#app-main[data-auth-view="code"] .auth-panel {
  gap: 20px;
}

.auth-copy {
  display: grid;
  gap: 9px;
}

.auth-copy h1 {
  margin: 0;
  color: var(--auth-ink);
  font-size: clamp(1.9rem, 3vw, 2.35rem);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.auth-copy p {
  margin: 0;
  color: var(--auth-muted);
  font-size: 0.92rem;
}

.auth-copy strong {
  color: var(--auth-ink);
  font-weight: 400;
  overflow-wrap: anywhere;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  color: var(--auth-dim);
  font-size: 0.69rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.auth-input-shell {
  position: relative;
}

.auth-input-shell input,
.auth-code-input {
  width: 100%;
  min-height: 54px;
  border: 1px solid rgba(242, 238, 229, 0.18);
  border-radius: 18px;
  outline: 0;
  background: rgba(13, 14, 16, 0.29);
  color: var(--auth-ink);
  caret-color: var(--auth-champagne);
  font-size: 1rem;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.auth-input-shell input {
  padding: 0 16px 0 48px;
}

.auth-code-input {
  padding: 0 17px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3em;
  text-align: center;
}

.auth-input-shell input::placeholder {
  color: rgba(242, 238, 229, 0.38);
}

.auth-code-input::placeholder {
  color: rgba(242, 238, 229, 0.42);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 1.04rem;
  letter-spacing: 0.08em;
  opacity: 1;
}

.auth-input-shell input:hover,
.auth-code-input:hover {
  border-color: rgba(216, 189, 145, 0.4);
  background: rgba(13, 14, 16, 0.41);
}

.auth-input-shell input:focus,
.auth-code-input:focus {
  border-color: rgba(216, 189, 145, 0.68);
  background: rgba(13, 14, 16, 0.48);
  box-shadow: 0 0 0 4px rgba(216, 189, 145, 0.11);
}

.auth-input-shell input[aria-invalid="true"],
.auth-code-input[aria-invalid="true"] {
  border-color: rgba(209, 138, 112, 0.68);
}

.auth-email-icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 17px;
  width: 19px;
  height: 14px;
  border: 1.25px solid rgba(242, 238, 229, 0.62);
  border-radius: 3px;
  pointer-events: none;
  transform: translateY(-50%);
}

.auth-email-icon::before,
.auth-email-icon::after {
  position: absolute;
  top: 2px;
  width: 10px;
  height: 1px;
  background: rgba(242, 238, 229, 0.62);
  content: "";
}

.auth-email-icon::before {
  left: 1px;
  transform: rotate(34deg);
  transform-origin: left center;
}

.auth-email-icon::after {
  right: 1px;
  transform: rotate(-34deg);
  transform-origin: right center;
}

.auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  margin-top: 3px;
  padding: 0 20px;
  border: 1px solid rgba(242, 238, 229, 0.25);
  border-radius: 18px;
  background: linear-gradient(135deg, #f2eee5, #ded5c5);
  color: #17181a;
  cursor: pointer;
  font-size: 0.83rem;
  letter-spacing: 0.08em;
}

.auth-submit:hover:not(:disabled) {
  border-color: rgba(216, 189, 145, 0.78);
  background: linear-gradient(135deg, #17181a 0%, #3c4245 54%, #9a8061 100%);
  color: #f5f1e9;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.12),
    0 14px 34px rgba(13, 14, 16, 0.25),
    0 0 0 1px rgba(216, 189, 145, 0.08);
  transform: translateY(-1px);
}

.auth-submit:disabled {
  border-color: rgba(242, 238, 229, 0.08);
  background: rgba(242, 238, 229, 0.11);
  color: rgba(242, 238, 229, 0.33);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.auth-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 34px;
  margin: 0;
  padding: 4px 9px;
  border: 1px solid rgba(242, 238, 229, 0.12);
  border-radius: 11px;
  background: transparent;
  color: var(--auth-muted);
  cursor: pointer;
  font-size: 0.76rem;
}

.auth-back:hover {
  border-color: rgba(216, 189, 145, 0.62);
  background: linear-gradient(135deg, rgba(23, 24, 26, 0.84) 0%, rgba(60, 66, 69, 0.82) 54%, rgba(154, 128, 97, 0.78) 100%);
  color: #f5f1e9;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.1),
    0 10px 26px rgba(13, 14, 16, 0.2);
}

.auth-demo-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid rgba(216, 189, 145, 0.24);
  border-radius: 11px;
  background: rgba(13, 14, 16, 0.26);
  color: var(--auth-muted);
  font-size: 0.72rem;
}

.auth-demo-code strong {
  color: var(--auth-champagne);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.16em;
}

.auth-role-field {
  display: grid;
  gap: 9px;
  margin-top: 3px;
}

.auth-role-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-role-heading span {
  color: var(--auth-dim);
  font-size: 0.69rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.auth-role-heading small {
  color: var(--auth-muted);
  font-size: 0.68rem;
}

.auth-role-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.auth-role-option {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 66px;
  padding: 9px;
  border: 1px solid rgba(242, 238, 229, 0.16);
  border-radius: 14px;
  background: rgba(13, 14, 16, 0.24);
  color: var(--auth-ink);
  cursor: pointer;
  text-align: left;
}

.auth-role-option:hover,
.auth-role-option.is-selected {
  border-color: rgba(216, 189, 145, 0.58);
  background: linear-gradient(145deg, rgba(60, 66, 69, 0.62), rgba(154, 128, 97, 0.3));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
}

.auth-role-option.is-selected {
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.08),
    0 0 0 2px rgba(216, 189, 145, 0.09);
}


.auth-role-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.auth-role-copy strong {
  color: var(--auth-ink);
  font-size: 0.76rem;
  font-weight: 400;
}

.auth-role-copy span {
  color: var(--auth-muted);
  font-size: 0.65rem;
  line-height: 1.35;
}

.auth-error,
.auth-progress {
  min-height: 20px;
  margin: -3px 0 0;
  font-size: 0.76rem;
}

.auth-error {
  color: #e5a38b;
}

.auth-progress {
  color: #bfd0b5;
}

.auth-error[hidden],
.auth-progress[hidden] {
  display: none;
}

@media (max-width: 760px) {
  .auth-access-pane {
    width: 100%;
    padding:
      max(14px, env(safe-area-inset-top))
      max(14px, env(safe-area-inset-right))
      max(22px, env(safe-area-inset-bottom))
      max(14px, env(safe-area-inset-left));
  }

  .auth-bar {
    min-height: 58px;
    padding: 6px 7px 6px 10px;
    border-radius: 17px;
  }

  .auth-brand {
    gap: 9px;
    min-height: 42px;
  }

  .auth-brand img {
    width: 31px;
    height: 31px;
  }

  .auth-brand span {
    font-size: 0.7rem;
    letter-spacing: 0.17em;
  }

  .auth-docs-link {
    min-height: 42px;
    padding: 0 15px;
  }

  .auth-form-wrap {
    padding: 31px 8px 22px;
  }

  .auth-panel {
    gap: 21px;
    padding: 26px 23px;
    border-radius: 26px;
  }

  .auth-input-shell input,
  .auth-code-input {
    min-height: 54px;
    font-size: 16px;
  }
}

@media (max-width: 430px) {
  .auth-panel {
    width: calc(100vw - 28px);
    padding: 23px 19px;
  }

  .auth-copy h1 {
    font-size: 1.88rem;
  }

  .auth-role-options {
    grid-template-columns: 1fr;
  }

  .auth-role-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .wallet-option {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .wallet-option > span:last-child {
    grid-column: 2;
  }
}

@media (max-height: 650px) {
  .auth-form-wrap {
    align-items: start;
    padding-top: 22px;
    padding-bottom: 22px;
  }

  .auth-panel {
    gap: 18px;
  }
}

@media (hover: none), (pointer: coarse) {
  .auth-gate {
    --auth-shift-x: 0px;
    --auth-shift-y: 0px;
    --auth-counter-x: 0px;
    --auth-counter-y: 0px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-gate::before,
  .auth-gate::after {
    transition: none;
    transform: none;
  }

  .auth-docs-link,
  .auth-submit,
  .auth-back {
    transition: none;
  }
}
