:root {
  color-scheme: light;
  --bg: #f6f5f1;
  --ink: #171717;
  --muted: #6f716d;
  --line: #d9d8d1;
  --surface: #fffef9;
  --surface-strong: #ecebe4;
  --accent: #2f7d68;
  --accent-ink: #08392f;
  --danger: #a34335;
  --mono: "SFMono-Regular", "JetBrains Mono", ui-monospace, monospace;
  --sans: "Geist", "Satoshi", "Avenir Next", system-ui, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-bottom-offset: calc(16px + var(--safe-bottom));
  --sheet-bottom-offset: calc(18px + var(--safe-bottom));
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--sans);
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(47, 125, 104, 0.08), transparent 38%),
    var(--bg);
}

html {
  scroll-padding-bottom: calc(112px + var(--safe-bottom));
}

button,
input {
  font: inherit;
}

input {
  scroll-margin-bottom: calc(112px + var(--safe-bottom));
}

button {
  color: inherit;
}

.app-shell {
  width: min(1180px, 100%);
  min-height: var(--tg-viewport-stable-height, 100dvh);
  margin: 0 auto;
  padding: 18px 18px calc(96px + var(--safe-bottom));
}

.topbar,
.section-head,
.detail-title-row,
.sheet-head,
.wallet-strip,
.quote-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  min-height: 64px;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(28px, 6vw, 44px);
  line-height: 1;
}

h2 {
  font-size: clamp(19px, 4vw, 27px);
  line-height: 1.08;
}

h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: 0;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.icon-button:active,
.primary-action:active,
.market-row:active,
.price-tile:active {
  transform: translateY(1px) scale(0.99);
}

.icon-button svg,
.bottom-nav svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ghost {
  background: transparent;
}

.wallet-strip {
  justify-content: flex-start;
  margin: 12px 0 18px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 249, 0.72);
  color: var(--muted);
  font-size: 13px;
}

[data-wallet-label] {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}

.wallet-copy-button {
  width: 34px;
  height: 34px;
  margin-left: auto;
  flex: 0 0 auto;
}

.wallet-copy-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(111, 113, 109, 0.12);
}

[data-wallet-state="connected"] .status-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 125, 104, 0.14);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.78fr);
  gap: 16px;
}

.feed-panel,
.detail-panel,
.sheet-panel,
.portfolio-panel,
.create-panel,
.wallet-panel,
.claim-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 249, 0.86);
  box-shadow: 0 22px 46px -34px rgba(23, 23, 23, 0.5);
}

.feed-panel,
.detail-panel,
.portfolio-panel,
.create-panel,
.wallet-panel {
  box-sizing: border-box;
  min-width: 0;
  min-height: 620px;
  padding: 16px;
}

.app-view {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.app-view > * {
  min-width: 0;
}

.segmented {
  display: inline-flex;
  max-width: 100%;
  overflow-x: auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  scrollbar-width: none;
}

.segmented::-webkit-scrollbar {
  display: none;
}

.segmented button,
.action-grid button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.segmented button {
  flex: 0 0 auto;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.segmented button.active,
.action-grid button.active {
  background: var(--ink);
  color: var(--surface);
}

.market-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: 14px 0 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 249, 0.9);
}

.market-search svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.market-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.market-search input::placeholder {
  color: var(--muted);
}

.market-search-clear {
  border: 0;
  background: transparent;
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.market-search-summary,
.market-empty {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.market-empty {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(236, 235, 228, 0.5);
}

.market-list {
  display: grid;
  gap: 10px;
  margin-top: 0;
}

.market-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms ease, transform 180ms ease;
}

.market-row.active {
  border-color: rgba(47, 125, 104, 0.62);
}

.market-row > span:first-child {
  min-width: 0;
}

.market-question {
  display: block;
  margin: 0 0 10px;
  line-height: 1.2;
}

.market-meta,
.market-side,
.quote-row,
.share-presets,
.trade-economics,
.slippage-controls,
.receipt-rail,
.metric-grid dt {
  color: var(--muted);
  font-size: 12px;
}

.market-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.market-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.market-context-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid rgba(47, 125, 104, 0.18);
  border-radius: 7px;
  background: rgba(47, 125, 104, 0.08);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.market-context-badge.status {
  border-color: rgba(32, 33, 31, 0.12);
  background: rgba(236, 235, 228, 0.72);
  color: var(--ink);
}

.market-context-badge.custody {
  border-color: rgba(124, 92, 46, 0.24);
  background: rgba(124, 92, 46, 0.08);
  color: #6d5229;
}

.market-price {
  font-family: var(--mono);
  font-size: 28px;
  line-height: 1;
}

.detail-empty {
  display: grid;
  align-content: center;
  min-height: 540px;
  color: var(--muted);
}

.detail-empty h2 {
  color: var(--ink);
}

.detail-body {
  display: grid;
  gap: 18px;
}

.pill {
  flex: 0 0 auto;
  padding: 7px 9px;
  border: 1px solid rgba(47, 125, 104, 0.22);
  border-radius: 999px;
  color: var(--accent-ink);
  background: rgba(47, 125, 104, 0.1);
  font-size: 12px;
  font-weight: 700;
}

.price-lane {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.price-lane[data-outcome-count="3"] {
  grid-template-columns: repeat(3, 1fr);
}

.price-tile {
  display: grid;
  gap: 10px;
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.price-tile strong {
  font-family: var(--mono);
  font-size: 40px;
  line-height: 1;
}

.detail-position {
  display: grid;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid rgba(47, 125, 104, 0.24);
  border-radius: 8px;
  background: rgba(47, 125, 104, 0.08);
}

.detail-position-head {
  align-items: center;
}

.detail-position-values {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  text-align: left;
}

.detail-position .primary-action {
  justify-self: start;
}

.yes strong {
  color: var(--accent);
}

.no strong {
  color: #4b5563;
}

.maybe strong {
  color: #7c5c2e;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  min-width: 0;
}

.metric-grid div {
  padding: 12px;
  border-top: 1px solid var(--line);
}

.metric-grid dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 15px;
}

.resolution-panel {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.resolution-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

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

.resolution-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.resolution-grid div {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 249, 0.68);
}

.resolution-grid dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.resolution-grid dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.35;
}

.portfolio-summary,
.wallet-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.creator-economics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.creator-metadata {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.creator-metadata-boundary {
  margin-top: -4px;
}

.creator-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.creator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.creator-question-field {
  grid-column: span 2;
}

.creator-command-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.creator-command-block {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.creator-command-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.creator-command-head .eyebrow {
  margin: 0;
}

.creator-command-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.creator-command {
  max-height: 180px;
}

.creator-form .field input {
  font-size: 13px;
}

.portfolio-list,
.wallet-actions,
.activity-list {
  display: grid;
  gap: 10px;
}

.portfolio-economics-note {
  margin: -2px 0 0;
}

.wallet-subhead {
  margin-top: 6px;
}

.position-row,
.wallet-action-row,
.activity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  box-sizing: border-box;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.position-row > *,
.wallet-action-row > *,
.activity-row > * {
  min-width: 0;
}

.final-state-check-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.activity-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.operator-runbook-row {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: start;
}

.operator-readiness-row {
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: start;
}

.operator-readiness-row[data-status="verified"] {
  border-left: 4px solid var(--accent);
}

.operator-readiness-row[data-status="blocked"] {
  border-left: 4px solid var(--danger);
}

.operator-readiness-row[data-status="requiresInput"] {
  border-left: 4px solid #9a6a2c;
}

.operator-readiness-values {
  min-width: 0;
}

.operator-readiness-next-steps {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.operator-readiness-next-step {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.portfolio-list .position-row {
  cursor: pointer;
}

.portfolio-list .position-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.operator-command-list {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.operator-command {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 6px;
  align-items: start;
}

.operator-command-list code {
  display: block;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}

.operator-command-copy {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.operator-command-copy svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.position-row strong,
.wallet-action-row strong,
.activity-row strong {
  display: block;
  line-height: 1.22;
}

.position-row small,
.wallet-action-row small,
.activity-row small,
.inline-note {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.wallet-action-warning {
  color: var(--danger);
  font-weight: 700;
}

.wallet-action-receipt,
.wallet-action-error {
  overflow-wrap: anywhere;
}

.wallet-action-receipt {
  color: var(--accent-ink);
}

.wallet-action-error {
  color: var(--danger);
  font-weight: 700;
}

.position-values {
  display: grid;
  justify-items: end;
  gap: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  text-align: right;
}

.wallet-action-button {
  min-width: 96px;
}

.wallet-recovery {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid rgba(158, 68, 55, 0.28);
  border-radius: 8px;
  background: rgba(158, 68, 55, 0.08);
}

.wallet-recovery strong {
  display: block;
  font-size: 16px;
  line-height: 1.2;
}

.wallet-recovery small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.wallet-recovery-side {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-shrink: 0;
}

.wallet-recovery .pill {
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

.claim-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid rgba(47, 125, 104, 0.28);
  border-radius: 8px;
  background: rgba(47, 125, 104, 0.08);
}

.claim-banner strong {
  display: block;
  font-size: 16px;
  line-height: 1.2;
}

.claim-banner small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.claim-banner-side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.claim-banner-side span {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.claim-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.primary-action.compact {
  min-height: 40px;
  padding: 0 13px;
  font-size: 13px;
}

.price-context {
  display: grid;
  gap: 10px;
}

.price-context-head {
  margin-bottom: 0;
}

.price-context-head h3 {
  margin: 0;
  font-family: var(--mono);
  font-size: 18px;
}

.price-context-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.35;
}

.price-context-meta span:last-child {
  text-align: right;
}

.chart-strip {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  align-items: end;
  gap: 5px;
  height: 132px;
  padding: 14px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(47, 125, 104, 0.08), transparent),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(24, 24, 24, 0.05) 31px 32px);
}

.chart-strip span {
  display: block;
  height: var(--h);
  border-radius: 5px 5px 2px 2px;
  background: var(--accent);
  transform-origin: bottom;
  animation: rise 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.bottom-nav {
  position: fixed;
  right: 50%;
  bottom: var(--nav-bottom-offset);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  width: min(430px, calc(100% - 28px));
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 18px 44px -24px rgba(23, 23, 23, 0.45);
  transform: translateX(50%);
}

.bottom-nav button {
  display: grid;
  place-items: center;
  gap: 2px;
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.bottom-nav button.active {
  color: var(--ink);
  background: var(--surface-strong);
}

.bottom-nav span {
  font-size: 11px;
}

.trade-sheet,
.share-sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.scrim {
  position: absolute;
  inset: 0;
  background: rgba(23, 23, 23, 0.42);
}

.sheet-panel {
  position: absolute;
  right: max(18px, calc((100vw - 1180px) / 2 + 18px));
  bottom: var(--sheet-bottom-offset);
  display: grid;
  gap: 14px;
  width: min(430px, calc(100% - 36px));
  max-height: calc(100dvh - 36px - var(--safe-bottom));
  overflow: auto;
  padding: 12px;
  will-change: transform;
}

.sheet-grip {
  justify-self: center;
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  cursor: grab;
  touch-action: none;
}

.sheet-panel[data-sheet-drag-state="dragging"] .sheet-grip {
  cursor: grabbing;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.action-grid button {
  min-height: 38px;
  font-size: 13px;
}

.field {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 21px;
}

.receipt-rail {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.receipt-rail span {
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  text-align: center;
}

.receipt-rail span.active {
  border-color: rgba(47, 125, 104, 0.6);
  color: var(--accent-ink);
  background: rgba(47, 125, 104, 0.1);
}

.payload-preview {
  max-height: 132px;
  margin: 0;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #20211f;
  color: #f3f1e8;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.55;
}

.share-panel {
  gap: 13px;
}

.share-preview {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(47, 125, 104, 0.08), rgba(255, 254, 249, 0.9));
}

.share-preview-head,
.share-prices,
.share-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.share-preview-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.share-preview h3 {
  font-size: 20px;
  line-height: 1.18;
}

.share-prices {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.share-prices span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.share-prices strong {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 18px;
}

.share-prices .yes strong {
  color: var(--accent);
}

.share-prices .maybe strong {
  color: #7c5c2e;
}

.share-preview p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.slippage-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.share-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.trade-economics {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.trade-economics span {
  min-width: 0;
  font-weight: 800;
}

.trade-economics span:nth-child(2) {
  font-family: var(--mono);
  color: var(--ink);
}

.trade-economics span:last-child {
  text-align: right;
}

.slippage-options {
  display: inline-grid;
  grid-template-columns: repeat(4, minmax(46px, 1fr));
  gap: 6px;
}

.share-presets button,
.slippage-options button {
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.share-presets button.active,
.slippage-options button.active {
  border-color: rgba(47, 125, 104, 0.62);
  background: rgba(47, 125, 104, 0.1);
  color: var(--accent-ink);
}

.share-channels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.share-channels button {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.share-channels svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.share-channels span {
  font-size: 12px;
  font-weight: 800;
}

.share-link {
  min-height: 46px;
  padding: 8px 8px 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(236, 235, 228, 0.58);
}

.share-link span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-link button {
  flex: 0 0 auto;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.receipt-summary {
  display: grid;
  gap: 8px;
  min-height: 48px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(236, 235, 228, 0.58);
}

.receipt-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.receipt-summary-head strong {
  font-size: 13px;
  line-height: 1.2;
}

.receipt-summary-head span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  text-align: right;
}

.receipt-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}

.receipt-summary-grid div {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(217, 216, 209, 0.78);
  border-radius: 7px;
  background: rgba(255, 254, 249, 0.74);
}

.receipt-summary-grid dt {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.receipt-summary-grid dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.2;
}

.primary-action {
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
  cursor: pointer;
  font-weight: 800;
  transition: transform 180ms ease, background 180ms ease;
}

.primary-action:disabled {
  cursor: wait;
  opacity: 0.72;
}

.inline-error,
.inline-note {
  margin: 0;
}

.inline-error {
  color: var(--danger);
  font-size: 13px;
}

[hidden] {
  display: none !important;
}

@keyframes rise {
  from {
    transform: scaleY(0.3);
    opacity: 0.4;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

@media (max-width: 840px) {
  .app-shell {
    padding: 14px 12px calc(92px + var(--safe-bottom));
  }

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

  .feed-panel,
  .detail-panel,
  .create-panel {
    min-height: auto;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .wallet-panel-actions {
    justify-content: flex-start;
  }

  .detail-panel {
    order: -1;
  }

  .detail-empty {
    min-height: 260px;
  }

  .portfolio-summary,
  .wallet-summary,
  .creator-economics,
  .creator-metadata {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .creator-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .creator-command-grid {
    grid-template-columns: 1fr;
  }

  .position-row,
  .wallet-action-row {
    grid-template-columns: 1fr;
  }

  .position-values {
    justify-items: start;
    text-align: left;
  }

  .wallet-action-button {
    width: 100%;
  }

  .wallet-recovery {
    align-items: stretch;
    flex-direction: column;
  }

  .wallet-recovery-side {
    align-items: stretch;
    flex-direction: column;
  }

  .wallet-recovery-side .primary-action {
    width: 100%;
  }

  .claim-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .claim-banner-side {
    justify-content: space-between;
  }

  .receipt-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .resolution-head {
    flex-direction: column;
  }

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

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

@media (max-width: 560px) {
  .creator-metadata {
    grid-template-columns: 1fr;
  }

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

  .creator-question-field {
    grid-column: span 1;
  }

  .creator-actions {
    width: 100%;
  }

  .creator-actions .primary-action {
    flex: 1 1 150px;
  }

  .creator-economics {
    grid-template-columns: 1fr;
  }
}
