:root {
  --desk-bg: #121116;
  --desk-panel: #1b1922;
  --desk-panel-edge: #40394d;
  --desk-soft-edge: #383241;
  --desk-accent: #cdb0fb;
  --desk-caption: #c7bece;
  --desk-rail: 4.1rem;
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.auth-page, .workbench-page {
  background: linear-gradient(180deg, #1c1724, var(--desk-bg) 30rem);
}
.auth-page .icon, .workbench-page .icon { flex-shrink: 0; }
.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.6rem;
  width: min(calc(100% - 3rem), 1160px);
  margin-inline: auto;
  border-bottom: 1px solid #876bac;
}
.auth-home { color: var(--desk-caption); font-size: .9rem; }
.auth-home:hover { color: var(--text); }
.auth-layout {
  width: min(calc(100% - 3rem), 1080px);
  margin: 0 auto;
  padding: clamp(2.6rem, 7vw, 6.5rem) 0;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 6.3rem);
}
.auth-intro h1 { font-size: clamp(2.65rem, 5.1vw, 4.45rem); }
.auth-intro > p:not(.eyebrow) { color: var(--desk-caption); margin-top: 1.1rem; max-width: 36ch; }
.auth-preview {
  margin-top: 2.15rem;
  max-width: 26rem;
  padding: 1.1rem;
  border: 1px solid #8063a5;
  border-radius: .85rem;
  background: linear-gradient(125deg, #251d36, #1a1527);
  box-shadow: 0 20px 65px #0906116e, inset 0 1px 0 #dac1ff16;
}
.auth-preview-head { display: flex; justify-content: space-between; align-items: center; gap: .7rem; font-weight: 680; }
.auth-preview-head > span:first-child { display: inline-flex; gap: .65rem; align-items: center; }
.auth-preview-head > span:first-child .icon { color: var(--desk-accent); }
.auth-preview ol { list-style: none; padding: 0; margin: 1rem 0 .6rem; }
.auth-preview li { position: relative; display: grid; align-items: center; grid-template-columns: auto minmax(0,1fr) auto; gap: .65rem; min-height: 2rem; font-size: .86rem; }
.auth-preview li:not(:last-child)::before { content: ""; width: 1px; height: 100%; position: absolute; top: 50%; left: .29rem; background: #b489f078; }
.auth-preview li .trace-dot { width: .62rem; height: .62rem; }
.auth-preview li strong { font: 400 .88rem/1.3 var(--mono); }
.auth-preview > p { border-top: 1px solid #8b72ac71; padding-top: .68rem; color: var(--desk-caption); font: 400 .78rem/1.2 var(--mono); }
.auth-card {
  min-width: 0;
  padding: clamp(1.25rem, 3.6vw, 2.45rem);
  border-radius: 1rem;
  border: 1px solid #8665ad;
  background: linear-gradient(145deg, #251c35, #191523 70%);
  box-shadow: 0 1.1rem 4rem #09070c90, inset 0 1px 0 #d9b4ff21;
}
.auth-card-icon {
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem; margin-bottom: .9rem;
  color: #eddbff; background: #56397b; border: 1px solid #a27ec5; border-radius: .75rem;
}
.auth-card h2 { font-size: clamp(1.95rem, 3.2vw, 2.65rem); }
.auth-description { color: var(--desk-caption); margin-top: .5rem; }
.auth-form, .workspace-form { display: grid; gap: .48rem; margin-top: 1.32rem; }
.auth-form label, .workspace-form > label { font-size: .9rem; font-weight: 650; }
.auth-form label:not(:first-of-type), .workspace-form > label:not(:first-of-type) { margin-top: .45rem; }
.auth-form :is(input,select,textarea), .workspace-form :is(input,select), .workspace-dialog > input {
  min-width: 0; width: 100%; min-height: 2.95rem; padding: .63rem .78rem; border: 1px solid #766387; border-radius: .52rem;
  font: inherit; color: var(--text); background: #120f1c; outline-offset: 2px;
}
.auth-form input::placeholder, .workspace-dialog input::placeholder { color: #9d8eae; }
.password-input { position: relative; }
.password-input input { padding-right: 3rem; }
.icon-button { display: grid; place-items: center; border: 1px solid #75628f; border-radius: .46rem; background: #302542; color: #fbf1ff; inline-size: 2.55rem; block-size: 2.55rem; flex: 0 0 auto; }
.icon-button:hover { background: #462f61; }
.show-password { position: absolute; right: .29rem; top: 50%; transform: translateY(-50%); inline-size: 2.38rem; block-size: 2.25rem; border: 0; background: transparent; color: #ddc6ff; }
.auth-form small { color: #d2bfe5; font-size: .8rem; }
.auth-submit { margin-top: .63rem; min-height: 2.95rem; }
.auth-switch { margin-top: 1.1rem; font-size: .91rem; color: var(--desk-caption); }
.auth-switch a { color: #d7adff; font-weight: 680; text-underline-offset: .2rem; text-decoration: underline; }
.form-message { border: 1px solid #746287; border-radius: .5rem; padding: .65rem .85rem; margin: .9rem 0; font-size: .9rem; }
.form-message.error { color: #ffcfdb; background: #4b283e; border-color: #ad708a; }
.form-message.success { color: #c9f4bc; background: #23372d; border-color: #60865f; }

.workbench-rail { position: fixed; inset: 0 auto 0 0; width: var(--desk-rail); z-index: 2; border-right: 1px solid #3c3547; background: #16131f; }
.rail-logo { min-height: 3.7rem; display: grid; place-items: center; border-bottom: 1px solid #3c3547; }
.workbench-rail nav { display: grid; justify-items: center; align-content: start; gap: .45rem; padding: .95rem .5rem; }
.workbench-rail nav > * { width: 2.7rem; height: 2.7rem; display: grid; place-items: center; color: #ebe0f5; background: transparent; border: 1px solid transparent; border-radius: .55rem; }
.workbench-rail nav > *:hover, .workbench-rail .is-active { color: #ead6ff; background: #3b2755; border-color: #7957a3; }
.workbench-rail nav .icon { width: 1.42rem; height: 1.42rem; }
.workbench-shell { width: min(calc(100% - var(--desk-rail)), 1440px); min-height: 100vh; margin-inline: auto; padding-inline: clamp(.9rem, 2.1vw, 1.8rem); position: relative; left: calc(var(--desk-rail) / 2); }
.workbench-top { display: flex; gap: 1.35rem; align-items: center; min-height: 3.7rem; border-bottom: 1px solid #44394e; }
.workbench-brand { font-size: 1.25rem; font-weight: 750; letter-spacing: -.045em; line-height: 1.1; white-space: nowrap; padding-right: 1.35rem; border-right: 1px solid #6c567f; }
.workbench-brand img { display: none; }
.workbench-nav { display: flex; align-items: center; gap: .45rem; }
.workbench-nav a { white-space: nowrap; font-size: .91rem; padding: .43rem .73rem; border-radius: .4rem; color: #ddd2e6; }
.workbench-nav a:hover { background: #332341; }
.workbench-nav a.active { background: #3b2d4b; box-shadow: inset 0 -2px #ba92ef; color: #f3e6ff; font-weight: 650; }
.workbench-profile { margin-left: auto; display: flex; align-items: center; gap: .9rem; }
.env-pill, .tag { white-space: nowrap; display: inline-flex; justify-content: center; align-items: center; border: 1px solid #a486c5; border-radius: .36rem; min-height: 1.8rem; padding: .2rem .55rem; font-size: .82rem; background: #30253e; }
.env-pill { color: #ebd6ff; background: #342247; }
.avatar { min-width: 2.32rem; height: 2.32rem; padding: 0 .38rem; border: 1px solid #d1aaff; border-radius: 50%; background: #bd93f7; color: #231235; font-weight: 800; font-size: .87rem; }
.avatar:hover { background: #d3b0ff; }
.workbench-main { padding-top: 1.2rem; padding-bottom: 1rem; display: grid; gap: 1rem; }
.workbench-heading { display: grid; grid-template-columns: minmax(0,1fr) minmax(16rem,.72fr); align-items: start; column-gap: 1rem; row-gap: .65rem; padding: .25rem .14rem .38rem; }
.workbench-heading > div:first-child { grid-row: span 2; align-self: center; }
.workbench-heading h1 { font-size: clamp(2rem, 3.55vw, 3.4rem); letter-spacing: -.047em; }
.workbench-heading p { margin-top: .33rem; color: #e4d9ee; }
.heading-actions { display: flex; justify-content: end; gap: .68rem; }
.heading-actions > * { min-width: 8.4rem; }
.ghost-button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.65rem;
  padding: .46rem .8rem; border: 1px solid #b3a2c7; border-radius: .44rem; background: #171320;
  color: #fbf5ff; font-size: .89rem; font-weight: 620; line-height: 1.1;
}
.ghost-button:hover { background: #32233f; border-color: var(--desk-accent); }
.find-trigger {
  display: flex; align-items: center; gap: .58rem; text-align: left; min-width: 0; min-height: 2.42rem; border: 1px solid #947caa;
  background: #191522; color: #f1e9f7; border-radius: .42rem; padding: .3rem .55rem .3rem .65rem; font-size: .87rem;
}
.find-trigger:hover { background: #292034; }
.find-trigger span { min-width: 0; flex: 1; }
.find-trigger kbd { border: 1px solid #665778; border-radius: .3rem; padding: .2rem .3rem; background: #2e2538; font: 400 .7rem/1 var(--mono); white-space: nowrap; color: #e0cee9; }
.wb-panel { min-width: 0; padding: .82rem .9rem; border: 1px solid var(--desk-panel-edge); border-radius: .67rem; background: var(--desk-panel); }
.balance-panel { display: grid; grid-template-columns: minmax(11.3rem,.95fr) minmax(0,2.55fr); gap: .8rem; align-items: center; padding: 1rem 1.15rem; }
.balance-label { display: flex; align-items: center; gap: .82rem; }
.balance-label > .icon { width: 2.15rem; height: 2.15rem; color: var(--desk-accent); }
.balance-label h2 { font-size: .93rem; font-weight: 640; letter-spacing: 0; line-height: 1.35; }
.balance-active { display: flex; align-items: center; gap: .43rem; color: #aaf0a2; font-size: .85rem; margin-top: .22rem; }
.balance-active i, .sandbox-flag i { display: inline-block; width: .58rem; height: .58rem; border-radius: 50%; background: #a7efa0; }
.balance-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
.balance-metrics div { padding-inline: clamp(.6rem, 2.15vw, 1.85rem) .35rem; border-left: 1px solid #a78ab9; }
.balance-metrics dt { font-size: .83rem; color: #eadff3; }
.balance-metrics dd { margin-top: .14rem; font-size: clamp(1.22rem, 2.5vw, 2rem); font-weight: 760; letter-spacing: -.035em; line-height: 1.02; overflow-wrap: anywhere; }

.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: .6rem 1.1rem; margin-bottom: .67rem; }
.panel-heading h2 { font-size: clamp(1.45rem, 2.55vw, 2.12rem); letter-spacing: -.041em; }
.debug-meta { display: flex; gap: .58rem; align-items: center; }
.state-pill { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; white-space: nowrap; border: 1px solid #a786c2; border-radius: .4rem; padding: .17rem .52rem; font-size: .81rem; font-weight: 600; color: #e9d6ff; background: #342746; }
.state-pill.good { background: #2d4436; border-color: #86b588; color: #b9f6a9; }
.state-pill.pending { background: #433722; border-color: #a48a56; color: #f7deaa; }
.state-pill .icon { inline-size: .95rem; block-size: .95rem; }
.debug-grid { display: grid; grid-template-columns: minmax(0,.94fr) minmax(0,1.3fr) minmax(0,1.02fr); align-items: stretch; gap: .55rem; }
.debug-pane { min-width: 0; border: 1px solid #78658b; border-radius: .57rem; background: #181423; }
.debug-activities { padding: .72rem .55rem .65rem; }
.debug-activities h3 { font-size: clamp(1rem, 1.85vw, 1.35rem); padding-inline: .35rem; margin: .14rem 0 .65rem; }
.activity-list { display: grid; align-content: start; max-height: 18.4rem; overflow: auto; }
.activity-button {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; text-align: left;
  min-height: 3.5rem; gap: .57rem; padding: .48rem .53rem; color: #f1e7f8; background: transparent; border: 1px solid transparent; border-radius: .42rem;
}
.activity-button + .activity-button { border-top-color: #4e405f; }
.activity-button > .icon { color: #e1c6ff; width: 1.18rem; height: 1.18rem; }
.activity-button span { display: grid; gap: .16rem; min-width: 0; }
.activity-button strong { font-size: .87rem; line-height: 1.2; }
.activity-button small { color: #d7c5e3; font-size: .78rem; }
.activity-button .activity-check { visibility: hidden; }
.activity-button[aria-pressed="true"], .activity-button:hover { border-color: #8362aa; background: linear-gradient(100deg,#513570,#362649); }
.activity-button[aria-pressed="true"] .activity-check { visibility: visible; }

.debug-trace { padding: .5rem .55rem .68rem; }
.trace-tabs { display: grid; grid-template-columns: 1.25fr .86fr .85fr; gap: .2rem; padding: .2rem; border: 1px solid #60506f; border-radius: .46rem; margin-bottom: .63rem; }
.trace-tabs button { padding: .42rem .25rem; min-height: 2.1rem; font-size: .81rem; line-height: 1.2; border: 1px solid transparent; border-radius: .34rem; color: var(--text); background: #221a2d; }
.trace-tabs button[aria-selected=true] { color: #1a0e27; font-weight: 680; background: linear-gradient(110deg, #c39dfb, #ab7bed); border-color: #d3aefa; }
.trace-list { list-style: none; padding: 0; }
.trace-list li { position: relative; }
.trace-list li:not(:last-child)::before { content: ""; position: absolute; pointer-events: none; z-index: 1; left: 1.14rem; top: 50%; height: 100%; width: 2px; background: #b48aef; }
.trace-button { width: 100%; display: grid; align-items: center; grid-template-columns: 1.18rem minmax(0,1fr) auto; gap: .53rem; text-align: left; min-height: 3.25rem; padding: .32rem .55rem; color: #f7edfb; background: transparent; border: 1px solid transparent; border-radius: .4rem; }
.trace-button:hover, .trace-button[aria-pressed=true] { background: linear-gradient(100deg,#462e63,#39294d); border-color: #8869ac; }
.trace-dot { position: relative; z-index: 2; width: .8rem; height: .8rem; margin-inline: auto; display: block; background: #bf94f6; border-radius: 50%; }
.trace-button[aria-pressed=true] .trace-dot { border: 2px solid #d6b4ff; background: #a665ea; box-shadow: 0 0 0 .22rem #d7b6ff46; }
.trace-button strong { display: block; font-size: .89rem; font-weight: 650; line-height: 1.16; }
.trace-button time { font: 400 .74rem/1.35 var(--mono); color: #e3d3ed; }
.trace-amount { justify-self: end; font: 400 .9rem/1.1 var(--mono); white-space: nowrap; }
.trace-summary { padding: .75rem .45rem; }
.trace-summary h3 { margin-bottom: .65rem; }
.trace-summary p { color: var(--desk-caption); margin-bottom: .75rem; }
.trace-summary dl { display: grid; gap: .48rem; margin-bottom: .75rem; }
.trace-summary dl div { display: flex; justify-content: space-between; gap: .8rem; font-size: .9rem; }

.selected-event {
  min-width: 0; display: grid; align-content: start; justify-items: start; gap: .38rem;
  padding: clamp(.85rem,1.65vw,1.25rem); border: 1px solid #fff9; border-radius: .61rem;
  background: linear-gradient(125deg,#f9f5ff,#eee7fa);
  color: #1b1330; box-shadow: inset 0 1px 0 #fff;
}
.selected-event h3 { font-size: .97rem; font-weight: 760; margin-bottom: .39rem; }
.selected-event > strong { font-size: clamp(1.19rem,2.4vw,1.83rem); line-height: 1.06; font-weight: 800; letter-spacing: -.042em; }
.event-amount { font-size: clamp(1.65rem,3.5vw,2.65rem); line-height: 1.03; font-weight: 800; letter-spacing: -.045em; color: #7134de; }
.event-reference { font: 400 .8rem/1.4 var(--mono); color: #5e4876; }
.event-breakdown, .event-detail { width: 100%; border-block: 1px solid #c7b4df; padding-block: .47rem; margin: .37rem 0 .2rem; }
.event-breakdown div { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .86rem; }
.event-breakdown div + div { margin-top: .18rem; }
.event-breakdown dd { font: 400 .86rem/1.2 var(--mono); white-space: nowrap; }
.event-detail { color: #514067; font-size: .87rem; }
.text-button { display: inline-flex; align-items: center; min-height: 2rem; padding: .14rem 0; text-align: left; color: #d9afff; background: none; border: 0; font-size: .89rem; font-weight: 610; }
.text-button:hover { text-decoration: underline; text-underline-offset: .22rem; }
.selected-event .text-button { color: #5921bf; font-weight: 700; }

.select-control { position: relative; display: inline-flex; align-items: center; min-width: 7rem; }
.select-control select { width: 100%; appearance: none; padding: .29rem 1.85rem .29rem .55rem; min-height: 2rem; border-radius: .36rem; border: 1px solid #a18ab5; background: #221a2c; color: var(--text); font-size: .82rem; }
.select-control > .icon { position: absolute; pointer-events: none; right: .53rem; width: .9rem; height: .9rem; }
.positions .panel-heading { border-bottom: 1px solid #695578; padding-bottom: .53rem; }
.positions > .select-control { min-width: 11rem; }
.position-table { width: 100%; border-collapse: collapse; margin-top: .15rem; font-size: .89rem; text-align: left; }
.position-table :is(th,td) { border-bottom: 1px solid #635071; padding: .45rem .55rem; }
.position-table thead th { color: #e3d8eb; font-weight: 500; font-size: .82rem; }
.position-table tbody th { font-weight: 600; }
.position-table tbody th .icon { width: 1.17rem; height: 1.17rem; margin-right: .52rem; vertical-align: -.24rem; color: var(--desk-accent); }
.position-table tbody td:nth-child(2) { font-family: var(--mono); white-space: nowrap; }
.pool-usage { color: var(--desk-caption); }
.pool-usage::before { content: ""; display: inline-block; width: .48rem; height: .48rem; border-radius: 50%; margin-right: .5rem; background: #c396f7; vertical-align: .09rem; }

.policy-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 1rem; padding: .5rem; border: 1px solid #655375; border-radius: .48rem; }
.policy-editor { min-width: 0; overflow: hidden; border: 1px solid #806898; border-radius: .46rem; }
.policy-editor > div { display: flex; align-items: center; gap: .55rem; border-bottom: 1px solid #69577c; background: #2b2237; padding: .34rem .6rem; font: 400 .83rem/1.25 var(--mono); }
.policy-editor .icon { width: 1rem; height: 1rem; color: #e0bbff; }
.policy-editor .code-lines { padding: .38rem .52rem; overflow: auto; color: #edc0ff; font-size: .84rem; }
.policy-facts { min-width: 0; border-left: 1px solid #76608b; padding: .4rem .55rem .35rem .98rem; }
.policy-facts h3 { font-size: 1.06rem; margin-bottom: .42rem; }
.policy-facts dl > div { display: flex; align-items: center; justify-content: space-between; gap: .55rem; padding: .49rem .05rem; font-size: .88rem; }
.policy-facts dl > div + div { border-top: 1px solid #5a466c; }
.policy-facts dt { display: flex; align-items: center; gap: .57rem; }
.policy-facts dt .icon { color: var(--desk-accent); }
.policy-facts dd { font-weight: 685; white-space: nowrap; }
.copy-status, .muted-note { color: var(--desk-caption); margin-top: .45rem; font-size: .82rem; }
.log-heading, .log-actions { display: flex; align-items: center; gap: .62rem; }
.log-actions .ghost-button { min-height: 2rem; font-size: .82rem; }
.log-actions .icon { width: .91rem; height: .91rem; }
.workspace-log { counter-reset: event; list-style: none; max-height: 9rem; overflow: auto; scrollbar-color: #ab75e9 #2b2039; border: 1px solid #735d89; border-radius: .45rem; background: #171321; padding: .55rem .65rem; font: 400 .86rem/1.45 var(--mono); }
.workspace-log li { display: grid; grid-template-columns: 1.55rem 5.75rem minmax(0, 17rem) minmax(0,1fr); gap: .5rem; padding-block: .17rem; }
.workspace-log li::before { counter-increment: event; content: counter(event, decimal-leading-zero); color: #bca7cf; }
.workspace-log time { color: #d8afff; }
.workspace-log li span { overflow-wrap: anywhere; }
.workspace-log strong { font-weight: 400; white-space: nowrap; }
.workbench-footer { display: flex; justify-content: space-between; align-items: center; gap: .7rem; border-top: 1px solid #44394e; padding: .75rem .2rem 1rem; }
.sandbox-flag { display: inline-flex; align-items: center; gap: .5rem; font-size: .82rem; }
.sandbox-flag i { background: #bc88f9; }
.workbench-footer nav { display: flex; align-items: center; gap: .7rem; }
.workbench-footer nav > * { min-height: 2rem; display: inline-flex; gap: .4rem; align-items: center; color: #f1e7f6; border: 0; padding: 0; background: transparent; font-size: .81rem; }
.workbench-footer nav > *:hover { color: var(--desk-accent); }
.workbench-footer nav > * + * { border-left: 1px solid #726083; padding-left: .7rem; }
.mobile-workbench-nav { display: none; }

.workspace-dialog { width: min(29rem, calc(100% - 1.5rem)); max-height: calc(100dvh - 2rem); overflow: auto; padding: clamp(1rem, 4vw, 1.5rem); border: 1px solid #a183bf; border-radius: .85rem; background: #231b31; color: var(--text); box-shadow: 0 18px 70px #080511bb; }
.workspace-dialog::backdrop { background: #0d0813c9; backdrop-filter: blur(4px); }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: .8rem; margin-bottom: .75rem; }
.dialog-heading h2 { font-size: clamp(1.55rem, 4.6vw, 2rem); align-self: center; }
.workspace-dialog > p { color: var(--desk-caption); font-size: .93rem; }
.workspace-dialog > p + :is(a,input) { margin-top: .8rem; }
.workspace-dialog .button { justify-self: start; margin-top: .55rem; }
.workspace-form { margin-top: 1rem; }
.workspace-form .checkbox-row { display: flex; align-items: center; gap: .56rem; min-height: 2.5rem; }
.workspace-form input[type=checkbox] { width: 1.15rem; height: 1.15rem; min-height: 0; accent-color: #ba90f7; }
.dialog-facts { margin-block: .85rem; border-block: 1px solid #634c7d; }
.dialog-facts > div { display: flex; justify-content: space-between; align-items: start; gap: .8rem; padding-block: .5rem; }
.dialog-facts > div + div { border-top: 1px solid #543e6c; }
.dialog-facts dt { white-space: nowrap; color: var(--desk-caption); font-size: .88rem; }
.dialog-facts dd { text-align: right; overflow-wrap: anywhere; font-size: .91rem; }
.resource-row { display: flex; align-items: center; gap: .55rem; min-height: 2.6rem; padding: .46rem .58rem; margin-top: .55rem; border: 1px solid #6e5687; border-radius: .39rem; background: #2b2039; color: var(--text); text-align: left; font-size: .9rem; }
.resource-row:hover { background: #3a2850; border-color: #a97add; }
.resource-row small { color: var(--desk-caption); font-size: .78rem; }
.resource-row > span > small { display: block; }
.search-results { display: grid; }
.search-results .resource-row { display: grid; gap: .08rem; }

@media (max-width: 1020px) {
  :root { --desk-rail: 3.65rem; }
  .workbench-top { gap: .9rem; }
  .workbench-brand { padding-right: .9rem; }
  .workbench-nav { gap: .22rem; }
  .workbench-nav a { padding-inline: .55rem; }
}
@media (max-width: 880px) {
  .workbench-rail { display: none; }
  .workbench-shell { width: 100%; left: 0; }
  .workbench-brand img { display: block; }
  .workbench-brand { display: inline-flex; align-items: center; gap: .42rem; }
  .debug-grid { grid-template-columns: minmax(0,.9fr) minmax(0,1.25fr); }
  .selected-event { grid-column: 1/-1; grid-template-columns: auto 1fr; column-gap: 1.1rem; }
  .selected-event h3 { grid-column: 1/-1; }
  .event-reference { grid-column: 1; }
  .event-breakdown, .event-detail { grid-column: 2; grid-row: 3 / span 2; }
}
@media (max-width: 760px) {
  .auth-top { width: calc(100% - 2rem); min-height: 4rem; }
  .auth-home { font-size: .78rem; }
  .auth-layout { width: min(calc(100% - 2rem), 31rem); grid-template-columns: minmax(0,1fr); gap: 1.25rem; padding-block: 1.6rem 2rem; }
  .auth-intro .eyebrow { font-size: .74rem; margin-bottom: .4rem; }
  .auth-intro h1 { max-width: none; font-size: clamp(1.75rem, 6.8vw, 2.6rem); }
  .auth-intro > p:not(.eyebrow) { font-size: .91rem; margin-top: .42rem; }
  .auth-break, .auth-preview { display: none; }
  .auth-card { padding: 1.12rem; }
  .auth-card h2 { font-size: clamp(1.75rem, 6.5vw, 2.28rem); }
  .auth-card-icon { width: 2.35rem; height: 2.35rem; margin-bottom: .65rem; }
  .auth-description { font-size: .91rem; }
  .auth-form { margin-top: 1.02rem; }

  .workbench-shell { padding: 0 .78rem calc(4.2rem + env(safe-area-inset-bottom)); }
  .workbench-top { min-height: 3.65rem; }
  .workbench-brand { border: 0; padding: 0; font-size: 1.16rem; }
  .workbench-nav { display: none; }
  .workbench-profile { gap: .55rem; }
  .workbench-top .env-pill { font-size: .75rem; min-height: 1.67rem; }
  .workbench-main { padding-top: .77rem; gap: .75rem; }
  .workbench-heading { grid-template-columns: minmax(0,1fr); gap: .54rem; }
  .workbench-heading > div:first-child { grid-row: auto; }
  .workbench-heading h1 { max-width: none; font-size: clamp(1.85rem, 7.5vw, 2.55rem); }
  .workbench-heading p { font-size: .9rem; margin-top: .28rem; }
  .heading-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .52rem; margin-top: .37rem; }
  .heading-actions > * { min-width: 0; min-height: 2.82rem; font-size: .86rem; }
  .find-trigger { min-height: 2.64rem; }
  .find-trigger kbd { display: none; }
  .wb-panel { padding: .67rem; }
  .balance-panel { display: block; padding: .77rem; }
  .balance-label { gap: .59rem; margin-bottom: .7rem; }
  .balance-label > .icon { width: 1.67rem; height: 1.67rem; }
  .balance-label > div { display: flex; justify-content: space-between; flex: 1; gap: .5rem; align-items: center; }
  .balance-label h2 { font-size: .86rem; }
  .balance-active { margin-top: 0; font-size: .76rem; }
  .balance-active i { width: .48rem; height: .48rem; }
  .balance-metrics { border-top: 1px solid #705485; padding-top: .6rem; }
  .balance-metrics div { padding-inline: .46rem .07rem; border-left-color: #705485; }
  .balance-metrics div:first-child { padding-left: 0; border-left: 0; }
  .balance-metrics dt { font-size: .68rem; min-height: 2em; line-height: 1.16; }
  .balance-metrics dd { font-size: clamp(1rem, 4.65vw, 1.45rem); margin-top: .24rem; }
  .panel-heading { gap: .44rem .63rem; margin-bottom: .54rem; }
  .panel-heading h2 { font-size: clamp(1.4rem, 5.8vw, 1.82rem); }
  .debugger > .panel-heading { align-items: start; flex-direction: column; }
  .debug-meta .tag, .debug-meta .state-pill { min-height: 1.58rem; font-size: .75rem; }
  .debug-grid { grid-template-columns: minmax(0,1fr); gap: .55rem; }
  .debug-activities { padding: .58rem .45rem .48rem; }
  .debug-activities h3 { font-size: .96rem; margin-bottom: .48rem; }
  .activity-list { display: flex; overflow: auto; scrollbar-width: thin; scrollbar-color: #986fc5 #241b32; padding-bottom: .16rem; gap: .38rem; scroll-snap-type: x proximity; }
  .activity-button { width: min(72%, 13.4rem); flex: 0 0 auto; scroll-snap-align: start; border-color: #665173; min-height: 3.45rem; gap: .44rem; }
  .activity-button + .activity-button { border-top-color: #665173; }
  .activity-button strong { font-size: .8rem; }
  .activity-button small { font-size: .72rem; }
  .activity-button .activity-check { width: .9rem; height: .9rem; }
  .debug-trace { padding: .43rem; }
  .trace-tabs button { min-height: 2.38rem; font-size: .8rem; }
  .trace-button { min-height: 3.08rem; }
  .trace-button strong { font-size: .84rem; }
  .selected-event { grid-column: auto; padding: .78rem; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .37rem .62rem; align-items: baseline; }
  .selected-event h3 { grid-column: 1/-1; margin-bottom: .16rem; }
  .selected-event > strong { font-size: 1.25rem; }
  .event-amount { justify-self: end; font-size: 1.76rem; }
  .event-reference { grid-column: 1/-1; }
  .event-breakdown, .event-detail { grid-column: 1/-1; grid-row: auto; margin-block: .27rem .07rem; }
  .selected-event .text-button { grid-column: 1/-1; }
  .positions .panel-heading, .policy-preview .panel-heading { align-items: start; flex-wrap: wrap; }
  .positions .text-button, .policy-preview .text-button { min-height: 1.6rem; font-size: .82rem; }
  .position-table, .position-table tbody { display: block; width: 100%; }
  .position-table thead { width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); position: absolute; }
  .position-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .24rem .64rem; align-items: start; margin-top: .43rem; padding: .62rem .5rem; border: 1px solid #5f4c75; border-radius: .4rem; }
  .position-table :is(th,td) { padding: 0; border: 0; }
  .position-table .pool-usage { grid-column: 1; grid-row: 2; font-size: .78rem; }
  .position-table td:last-child { text-align: right; }
  .position-table td:nth-child(2) { text-align: right; font-size: .84rem; }
  .pool-usage::before { display: none; }
  .policy-grid { grid-template-columns: minmax(0,1fr); gap: .52rem; }
  .policy-facts { border-left: 0; padding: .38rem .27rem .12rem; }
  .live-log > .panel-heading { flex-wrap: wrap; }
  .log-heading .env-pill { font-size: .72rem; min-height: 1.4rem; padding: .12rem .32rem; }
  .log-actions { margin-left: auto; }
  .log-actions :is(.ghost-button,select) { min-height: 2.55rem; }
  .workspace-log { padding-inline: .4rem; font-size: .75rem; }
  .workspace-log li { grid-template-columns: minmax(3.6rem,auto) minmax(0,1fr) auto; column-gap: .36rem; }
  .workspace-log li::before { display: none; }
  .workbench-footer { flex-wrap: wrap; justify-content: start; padding-top: .62rem; }
  .workbench-footer nav { flex-wrap: wrap; }
  .workbench-footer nav > * { font-size: .74rem; }
  .workbench-footer nav .icon { width: .93rem; height: .93rem; }
  .mobile-workbench-nav {
    position: fixed; inset: auto 0 0; z-index: 3; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); align-items: stretch;
    padding: .33rem .5rem calc(.3rem + env(safe-area-inset-bottom)); gap: .16rem; border-top: 1px solid #4d405c; background: #1a1621f7; backdrop-filter: blur(16px);
  }
  .mobile-workbench-nav > * { display: grid; justify-items: center; align-content: center; gap: .22rem; min-height: 2.97rem; border: 0; border-radius: .35rem; background: transparent; color: #e7d8f2; font-size: .73rem; }
  .mobile-workbench-nav > *:hover, .mobile-workbench-nav .active { color: #f1d9ff; background: #3a2753; }
  .mobile-workbench-nav .icon { width: 1.12rem; height: 1.12rem; }
}

.workbench-shell { display: flex; flex-direction: column; }
.workbench-main { flex: 1; align-content: start; }
.avatar { display: inline-grid; place-items: center; flex: none; }
.avatar[aria-current=page] { outline: 1px solid #e4c5ff; outline-offset: 3px; }
.workbench-footer [aria-current=page] { color: #e5c2ff; }
.workbench-page .button { background: #c7a9f8; border-color: #dec5ff; color: #1b1126; box-shadow: inset 0 1px 0 #fff3; }
.workbench-page .ghost-button { border-color: #635672; background: #221d2b; }
.workbench-page .ghost-button:hover { border-color: #a280c9; background: #30253c; }

.section-page-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; padding: .53rem .12rem .66rem; }
.section-page-heading h1 { max-width: none; font-size: clamp(2.2rem, 4.2vw, 3.58rem); letter-spacing: -.06em; }
.section-page-heading p { margin-top: .46rem; color: #d8cedf; max-width: 60ch; }
.section-page-heading > :is(a,button) { flex: none; }
.desk-icon {
  display: inline-grid; place-items: center; flex: 0 0 auto; width: 2.5rem; height: 2.5rem;
  border: 1px solid #574667; border-radius: .55rem; color: #dfc1fc; background: #30263b;
}
.desk-icon .icon { width: 1.16rem; height: 1.16rem; }

.overview-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .66rem; }
.overview-card { display: flex; align-items: center; gap: .65rem; padding: .72rem; scroll-margin-top: .65rem; transition: border-color .18s, background .18s; }
.overview-card:hover { border-color: #9976b8; background: #2b2235; }
.overview-card > span:last-child, .transfer-name, .ledger-event > span:last-child { min-width: 0; display: grid; gap: .2rem; }
.overview-card strong, .transfer-name strong, .ledger-event strong { font-size: .97rem; font-weight: 680; line-height: 1.2; }
.overview-card small, .transfer-name small, .ledger-event small { font-size: .82rem; color: var(--desk-caption); line-height: 1.3; }

/* Wallet */
.wallet-layout { display: grid; grid-template-columns: minmax(0,1.85fr) minmax(16rem,1fr); gap: .85rem; align-items: start; }
.wallet-statement { padding: 0; overflow: hidden; background: #1d1926; }
.wallet-value {
  padding: clamp(1rem,3vw,2.1rem);
  background: linear-gradient(108deg, #282035 0%, #30243e 66%, #392a48 100%);
  border-bottom: 1px solid #4b3d59;
}
.wallet-value > div { display: flex; align-items: center; justify-content: space-between; gap: .65rem; }
.wallet-value h2 { font-size: .96rem; letter-spacing: 0; font-weight: 620; color: #e1d2ed; }
.wallet-value .tag { min-height: 1.55rem; border-color: #715a85; font: 400 .78rem/1.15 var(--mono); }
.wallet-total { display: block; font-size: clamp(2.65rem,5vw,4.7rem); font-weight: 775; letter-spacing: -.067em; line-height: .99; margin-top: .67rem; font-variant-numeric: tabular-nums; }
.wallet-breakdown { padding: .86rem clamp(1rem,3vw,2.1rem) 1.03rem; display: grid; gap: .66rem; }
.wallet-breakdown-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: baseline; gap: .25rem .58rem; }
.wallet-breakdown-row + .wallet-breakdown-row { padding-top: .63rem; border-top: 1px solid #3e3449; }
.wallet-breakdown-row dt { font-size: .94rem; font-weight: 650; }
.wallet-breakdown-row > dd:not(.wallet-meter) { font: 400 .98rem/1.2 var(--mono); white-space: nowrap; }
.wallet-meter { grid-column: 1/-1; display: grid; grid-template-columns: minmax(3rem,.95fr) minmax(0,1fr); align-items: center; gap: .78rem; }
.wallet-meter meter { display: block; appearance: none; width: 100%; height: .28rem; background: #3b3046; border: 0; border-radius: .24rem; }
.wallet-meter meter::-webkit-meter-bar { background: #3b3046; border: 0; border-radius: .24rem; }
.wallet-meter meter::-webkit-meter-optimum-value { background: var(--meter-color,#bb99ef); border-radius: .24rem; }
.wallet-meter meter::-moz-meter-bar { background: var(--meter-color,#bb99ef); border-radius: .24rem; }
.wallet-breakdown-row.available { --meter-color: #b3d5ae; }
.wallet-breakdown-row.pending { --meter-color: #dcbb8f; }
.wallet-balance-note { color: var(--desk-caption); font-size: .79rem; line-height: 1.3; }
.wallet-actions { padding: .91rem; display: grid; gap: .58rem; }
.wallet-actions h2 { font-size: 1.45rem; padding: .12rem .14rem .35rem; }
.movement-option { display: flex; gap: .74rem; align-items: center; width: 100%; text-align: left; padding: .77rem; border: 1px solid #51425e; border-radius: .5rem; color: var(--text); background: #231c2d; }
.movement-option:hover { border-color: #9875b9; background: #2e233a; }
.movement-option > span:last-child { display: grid; gap: .2rem; }
.movement-option strong { font-size: .97rem; }
.movement-option small { color: var(--desk-caption); font-size: .86rem; line-height: 1.3; }
.movement-option:first-of-type .desk-icon { background: #bfa0ed; color: #251636; border-color: #d0b4f6; }
.wallet-transfers { padding: .92rem; }
.transfer-stack { display: grid; }
.transfer-row { display: grid; align-items: center; grid-template-columns: auto minmax(0,1fr) auto minmax(5.6rem,auto); gap: .76rem; padding: .65rem .52rem; border-top: 1px solid #453950; }
.transfer-row:hover { background: #2b2335; }
.transfer-row > strong { font: 400 .95rem/1.25 var(--mono); }
.transfer-row > .state-pill { justify-self: end; }

/* Allocations */
.allocation-workspace { display: grid; grid-template-columns: minmax(16rem,.75fr) minmax(0,2fr); gap: .85rem; align-items: start; }
.allocation-sidebar { padding: .72rem; }
.allocation-sidebar-heading { display: flex; justify-content: space-between; align-items: center; margin: .18rem .28rem .55rem; gap: .42rem; }
.allocation-sidebar-heading h2 { font-size: 1.38rem; }
.allocation-sidebar .tag { min-height: 1.6rem; font: 400 .79rem/1.1 var(--mono); border-color: #685479; }
.allocation-switcher { display: none; }
.allocation-options { display: grid; gap: .25rem; max-height: 26rem; overflow: auto; }
.allocation-option { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; text-align: left; gap: .37rem; min-height: 3.5rem; padding: .57rem .54rem; border: 1px solid transparent; border-left-width: 2px; border-radius: .39rem; background: none; color: var(--text); }
.allocation-option[aria-pressed=true] { background: #332742; border-color: #665079; border-left-color: #c5a0f5; }
.allocation-option:hover { background: #2d2538; }
.allocation-option > span:first-child { display: grid; gap: .13rem; }
.allocation-option strong { font-size: .87rem; line-height: 1.2; font-weight: 665; }
.allocation-option small, .allocation-reference { color: #d4bde7; font: 400 .77rem/1.3 var(--mono); }
.allocation-tone { color: #d8bbfb; font-size: .72rem; white-space: nowrap; }
.allocation-tone.good { color: #b6d8a9; }
.allocation-tone.pending { color: #eed1a8; }
.allocation-inspector { padding: clamp(.9rem,2vw,1.45rem); display: grid; gap: .8rem; }
.allocation-inspector-head { display: flex; align-items: start; justify-content: space-between; gap: .7rem; }
.allocation-inspector-head h2 { margin-top: .27rem; font-size: clamp(1.55rem,3vw,2.35rem); }
.allocation-inspector .selected-event {
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .31rem .7rem; align-items: center;
  background: #2b2136; color: #f8f1ff; border: 1px solid #574565; box-shadow: none;
  padding: .78rem .85rem; border-radius: .49rem;
}
.allocation-inspector .selected-event h3 { grid-column: 1/-1; color: #d8c5e5; font-size: .81rem; font-weight: 600; margin: 0; }
.allocation-inspector .selected-event > strong { font-size: clamp(1.08rem,2.25vw,1.65rem); }
.allocation-inspector .event-amount { grid-column: 2; grid-row: 2; justify-self: end; color: #dac2fb; font-size: clamp(1.25rem,2.65vw,2.12rem); }
.allocation-inspector .event-reference { display: none; }
.allocation-inspector :is(.event-breakdown,.event-detail){ grid-column: 1/-1; grid-row: auto; color: #e8d9f1; margin: .1rem 0 0; padding: .39rem 0 .27rem; border: 0; border-top: 1px solid #5e4b6b; }
.allocation-inspector .selected-event .text-button { grid-column: 1/-1; color: #e2c5ff; }
.allocation-inspector .debug-trace { padding: 0; border: 0; margin: 0; background: none; }
.allocation-inspector .trace-tabs { border: 0; border-bottom: 1px solid #534360; background: transparent; padding: 0; gap: .6rem; grid-template-columns: repeat(3,minmax(0,1fr)); margin-bottom: .35rem; }
.allocation-inspector .trace-tabs button { background: none; border: 0; border-radius: .43rem .43rem 0 0; padding: .42rem .2rem; min-height: 2.6rem; color: #d9c9e5; }
.allocation-inspector .trace-tabs button[aria-selected=true] { color: #f5e8ff; background: #352841; box-shadow: inset 0 -2px #bf9aee; }
.allocation-inspector .trace-list li::before { display: none; }
.allocation-inspector .trace-button { border-radius: .36rem; min-height: 3.14rem; }
.allocation-inspector .trace-list li + li { border-top: 1px solid #3c3246; }
.allocation-inspector .trace-dot { border-radius: .15rem; width: .67rem; height: .67rem; }
.allocation-inspector .trace-button[aria-pressed=true] { background: #30243c; border-color: #6d5584; }
.allocation-inspector .trace-button[aria-pressed=true] .trace-dot { box-shadow: none; }
.allocation-details { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(0,1fr); gap: .85rem; align-items: start; }
.allocation-details .policy-grid { grid-template-columns: minmax(0,1fr); gap: .5rem; }
.allocation-details .policy-facts { border-left: 0; padding: .35rem .32rem; }

/* Transactions */
.ledger-panel { padding: 0; overflow: hidden; }
.ledger-heading { display: flex; justify-content: space-between; align-items: center; gap: .65rem; padding: 1.03rem 1rem .74rem; }
.ledger-heading h2 { font-size: clamp(1.42rem,2.55vw,2.1rem); }
.ledger-heading .tag { border-color: #675477; background: #2a2233; }
.ledger-filters { display: flex; align-items: end; gap: .58rem; padding: .15rem 1rem .94rem; border-bottom: 1px solid #4a3b55; }
.ledger-filters > div { min-width: 0; }
.ledger-filters .ledger-search-field { flex: 0 1 26rem; }
.ledger-filters label { display: block; margin-bottom: .24rem; font-size: .85rem; font-weight: 650; }
.ledger-filters input, .referral-input-row input { width: 100%; min-height: 2.75rem; min-width: 0; padding: .48rem .63rem; border: 1px solid #716181; border-radius: .42rem; background: #17131e; color: var(--text); font: inherit; }
.ledger-filters input::placeholder { color: #bcaac9; }
.ledger-filters .select-control select, .ledger-filters .text-button { min-height: 2.75rem; }
.ledger-table { border-collapse: collapse; width: 100%; text-align: left; }
.ledger-table th, .ledger-table td { padding: .67rem 1rem; border-bottom: 1px solid #3b3245; }
.ledger-table tbody tr:last-child :is(th,td) { border-bottom: 0; }
.ledger-table thead th { white-space: nowrap; color: #d7c8e2; background: #231c2c; font-size: .83rem; font-weight: 580; border-bottom-color: #4a3b55; }
.ledger-table :is(th,td):last-child { text-align: right; }
.ledger-event { display: flex; align-items: center; gap: .64rem; }
.ledger-event .desk-icon { width: 2.2rem; height: 2.2rem; border-radius: .46rem; }
.ledger-event .desk-icon .icon { width: 1rem; height: 1rem; }
.ledger-reference, .ledger-time, .ledger-amount { font: 400 .88rem/1.35 var(--mono); }
.ledger-reference a { color: #e2baff; text-decoration: underline; text-underline-offset: .16em; }
.ledger-time { color: var(--desk-caption); }
.ledger-amount { white-space: nowrap; }
.ledger-pages { display: flex; align-items: center; justify-content: end; flex-wrap: wrap; gap: .56rem; padding: .82rem 1rem; border-top: 1px solid #4a3b55; font-size: .88rem; color: var(--desk-caption); }
.workspace-empty { display: grid; justify-items: center; gap: .48rem; padding: clamp(1.4rem,5vw,2.4rem) .5rem; text-align: center; }
.workspace-empty p { color: var(--desk-caption); font-size: .91rem; }

/* Referrals */
.invite-sheet { display: grid; gap: .78rem; justify-items: stretch; padding: clamp(1.1rem,3vw,1.9rem); border: 1px solid #ded0f1; border-radius: .69rem; color: #21182b; background: #e4d7f5; }
.invitation-copy { display: flex; align-items: center; gap: .6rem; }
.invitation-copy .icon { width: 1.54rem; height: 1.54rem; color: #60437d; }
.invitation-copy h2 { font-size: clamp(1.52rem,3vw,2.32rem); }
.referral-input-row { width: min(100%, 51rem); display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .55rem; }
.referral-input-row input { background: #f6effe; color: #2c2037; border-color: #9e84b5; font: 400 .84rem/1.2 var(--mono); }
.invite-sheet .button { background: #342240; border-color: #4f3560; color: #fbf0ff; }
.invite-code-line { display: flex; align-items: center; gap: .65rem; font-size: .9rem; color: #443351; }
.invite-code-line code { border-left: 1px solid #b59fc8; padding-left: .65rem; font: 400 .85rem/1.3 var(--mono); color: #2a1c34; }
.invite-sheet .copy-status { margin: 0; color: #493657; }
.invitation-details { display: grid; grid-template-columns: minmax(13rem,.85fr) minmax(0,1.4fr); gap: .84rem; align-items: start; }
.referral-stats, .invitation-flow { padding: clamp(.92rem,2.4vw,1.45rem); }
.referral-count { display: grid; gap: .23rem; margin-top: .82rem; }
.referral-count strong { color: #d9b8fa; font-size: clamp(2.5rem,5vw,3.7rem); line-height: .98; }
.referral-count span { color: var(--desk-caption); font-size: .94rem; }
.referral-facts { margin-top: 1rem; border-top: 1px solid #4b3d56; }
.referral-facts > div { display: flex; gap: .57rem; justify-content: space-between; padding-block: .49rem; font-size: .91rem; }
.referral-facts dt { color: var(--desk-caption); }
.referral-facts dd { text-align: right; overflow-wrap: anywhere; }
.invitation-steps { list-style: none; padding: 0; }
.invitation-steps li { display: flex; align-items: start; gap: .59rem; padding: .62rem .12rem; border-top: 1px solid #473950; }
.invitation-steps li .icon { color: #d5acfb; width: 1.1rem; height: 1.1rem; margin-top: .13rem; }
.invitation-steps h3 { font-size: 1rem; }
.invitation-steps p { color: var(--desk-caption); font-size: .86rem; margin-top: .18rem; }

/* Account and support */
.settings-layout { display: grid; gap: .78rem; width: min(100%, 62rem); }
.settings-profile { display: grid; grid-template-columns: minmax(0,.78fr) minmax(0,1.6fr); gap: 1rem; padding: clamp(.95rem,2.5vw,1.5rem); }
.settings-profile-head { display: flex; align-items: start; gap: .65rem; }
.settings-profile-head .avatar { width: 2.78rem; height: 2.78rem; font-size: .96rem; }
.settings-profile-head h2, .settings-session h2, .help-resources h2 { font-size: clamp(1.37rem,2.6vw,1.9rem); }
.settings-profile-head p, .settings-session p { color: var(--desk-caption); margin-top: .22rem; font-size: .9rem; overflow-wrap: anywhere; }
.profile-form { margin: 0; padding-left: 1rem; border-left: 1px solid #4a3c55; }
.profile-form input[readonly] { color: #d7c7e3; background: #282031; }
.profile-form small { color: var(--desk-caption); font-size: .83rem; }
.profile-form button { justify-self: start; margin-top: .41rem; }
.settings-session { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: .72rem; padding: .9rem; }
.help-layout { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(0,1fr); gap: .82rem; align-items: start; }
.help-questions, .help-resources { padding: clamp(.93rem,2.4vw,1.45rem); }
.help-questions details { border-top: 1px solid #534362; }
.help-questions summary { cursor: pointer; display: list-item; min-height: 2.7rem; padding: .62rem .18rem; font-size: .95rem; font-weight: 650; }
.help-questions details p { color: var(--desk-caption); font-size: .92rem; padding: .02rem .19rem .78rem; }
.help-questions details p a { color: #e0bafc; text-decoration: underline; text-underline-offset: .2em; }
.help-resources { background: #2f233a; border-color: #62506f; }
.help-resources h2 { margin-top: .68rem; }
.help-resources p { margin: .44rem 0 .85rem; color: var(--desk-caption); }
.help-resources .text-button { display: flex; width: fit-content; margin-top: .47rem; }

@media (max-width: 1040px) {
  .allocation-details { grid-template-columns: minmax(0,1fr); }
  .allocation-details .policy-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .allocation-details .policy-facts { padding-left: .68rem; border-left: 1px solid #5b4969; }
}
@media (max-width: 920px) {
  .overview-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .section-page-heading { align-items: start; flex-direction: column; gap: .62rem; padding-bottom: .31rem; }
  .section-page-heading h1 { font-size: clamp(1.96rem,7.9vw,2.8rem); }
  .section-page-heading p { margin-top: .32rem; font-size: .92rem; }
  .section-page-heading > :is(a,button) { min-height: 2.75rem; }
  .desk-icon { width: 2.24rem; height: 2.24rem; }
  .overview-grid { gap: .42rem; }
  .overview-card { min-height: 3.85rem; padding: .5rem; gap: .43rem; align-items: start; }
  .overview-card .desk-icon { width: 1.75rem; height: 1.75rem; }
  .overview-card .desk-icon .icon { width: 1rem; height: 1rem; }
  .overview-card strong { font-size: .86rem; }
  .overview-card small { font-size: .77rem; }

  .wallet-layout, .allocation-workspace, .invitation-details, .help-layout { grid-template-columns: minmax(0,1fr); gap: .7rem; }
  .wallet-value { padding: .86rem .86rem 1.05rem; }
  .wallet-total { font-size: clamp(2.5rem,10vw,3.55rem); }
  .wallet-breakdown { padding: .72rem .85rem; }
  .wallet-meter { grid-template-columns: minmax(2.3rem,1fr) minmax(0,1.2fr); gap: .44rem; }
  .wallet-breakdown-row > dd:not(.wallet-meter) { font-size: .89rem; }
  .wallet-balance-note { font-size: .74rem; }
  .wallet-actions { gap: .44rem; padding: .7rem; }
  .movement-option { padding: .55rem; gap: .55rem; min-height: 3.3rem; }
  .movement-option small { font-size: .82rem; }
  .wallet-transfers { padding: .7rem; }
  .transfer-row { grid-template-columns: auto minmax(0,1fr) auto; gap: .24rem .48rem; padding-inline: .08rem; }
  .transfer-row > .desk-icon { grid-row: span 2; }
  .transfer-row > .state-pill { grid-column: span 2; font-size: .73rem; }

  .allocation-options { display: none; }
  .allocation-switcher { display: flex; }
  .allocation-switcher select { min-height: 2.75rem; font-size: .86rem; }
  .allocation-sidebar-heading { margin: .03rem .02rem .4rem; }
  .allocation-sidebar-heading h2 { font-size: 1.13rem; }
  .allocation-inspector { padding: .72rem; gap: .57rem; }
  .allocation-inspector-head h2 { font-size: 1.46rem; }
  .allocation-inspector-head .state-pill { padding-inline: .36rem; font-size: .72rem; }
  .allocation-inspector .selected-event { padding: .61rem; }
  .allocation-inspector :is(.event-detail,.event-breakdown) { font-size: .82rem; }
  .allocation-inspector .trace-tabs { gap: .2rem; }
  .allocation-details { gap: .7rem; }
  .allocation-details .policy-grid { grid-template-columns: minmax(0,1fr); }
  .allocation-details .policy-facts { padding-left: .32rem; border-left: 0; }

  .ledger-heading { padding: .75rem .65rem .48rem; }
  .ledger-filters { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .43rem; padding: .13rem .65rem .66rem; }
  .ledger-filters .ledger-search-field { grid-column: 1/-1; }
  .ledger-filters .select-control { display: flex; }
  .ledger-filters > .button { min-height: 2.75rem; font-size: .85rem; }
  .ledger-filters .text-button { grid-column: 1/-1; min-height: 2rem; }
  .ledger-table, .ledger-table tbody { display: block; width: 100%; }
  .ledger-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .ledger-table tr { display: grid; align-items: center; grid-template-columns: minmax(0,1fr) auto; gap: .17rem .45rem; border-bottom: 1px solid #3e3449; padding: .55rem .64rem; }
  .ledger-table tbody tr:last-child { border-bottom: 0; }
  .ledger-table th, .ledger-table td, .ledger-table :is(th,td):last-child { padding: 0; border: 0; }
  .ledger-event { gap: .38rem; }
  .ledger-event .desk-icon { width: 1.7rem; height: 1.7rem; }
  .ledger-event .desk-icon .icon { width: .9rem; height: .9rem; }
  .ledger-event strong { font-size: .88rem; }
  .ledger-event small { font-size: .76rem; }
  .ledger-amount { grid-column: 2; grid-row: 1; justify-self: end; font-size: .86rem; }
  .ledger-time { text-align: right; font-size: .71rem; }
  .ledger-reference { padding-left: 2.08rem !important; font-size: .76rem; }

  .invite-sheet { padding: .83rem; gap: .6rem; }
  .referral-input-row { gap: .36rem; }
  .referral-input-row button { padding-inline: .49rem; gap: .35rem; font-size: .82rem; }
  .referral-input-row .icon { width: .93rem; height: .93rem; }
  .invite-code-line { font-size: .81rem; }
  .referral-facts { margin-top: .71rem; }
  .referral-count { margin-top: .51rem; }

  .settings-profile { grid-template-columns: minmax(0,1fr); gap: .7rem; }
  .profile-form { padding: .7rem 0 0; border-left: 0; border-top: 1px solid #4d4056; }
  .settings-session { grid-template-columns: auto minmax(0,1fr); }
  .settings-session form { grid-column: 2; }
  .mobile-workbench-nav > * { font-size: .71rem; }
}

.auth-top-actions { display: flex; align-items: center; gap: .8rem; }
.theme-toggle {
  display: inline-grid; place-items: center; flex: none; width: 2.75rem; height: 2.75rem;
  border: 1px solid #635672; border-radius: .56rem; background: #221d2b; color: #f3e3ff;
}
.theme-toggle:hover { background: #352943; border-color: #ac8bc8; }
.theme-toggle .icon { width: 1.22rem; height: 1.22rem; }
@media (min-width: 761px) and (max-width: 880px) {
  .workbench-profile { gap: .54rem; }
  .workbench-top .env-pill { display: none; }
}
@media (max-width: 760px) {
  .auth-top-actions { gap: .5rem; }
  .workbench-profile { gap: .46rem; }
}

.auth-form textarea{font:inherit;resize:vertical;min-height:7rem;width:100%}.workbench-footer nav{flex-wrap:wrap}.commerce-card code{overflow-wrap:anywhere}

@media (max-width: 420px) { .workbench-top .workbench-profile .env-pill { display:none; } .workbench-profile { flex-shrink:0; } }
