/* Invictus hub finish. Load after premium-ui.css; presentation only. */

html body #im-root {
  --im-gold: #e4cba4;
  --im-text: #f1eee7;
  --im-muted: #b0b3b5;
  --im-line: #d8c5a329;
  --iv-craft-surface: #070d14ed;
  --iv-craft-border: #d8c5a329;
  --iv-craft-focus: #ecd5ae;
  color: var(--im-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Light controls, measured spacing and a visible keyboard focus. */
html body #im-root button {
  min-height: 44px;
  min-width: 44px;
  line-height: 1.4;
  font-weight: 400;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}
html body #im-root :is(button, a, summary, input, select, textarea):focus-visible,
html body #im-root :is(.im-screen, .im-sheet, .im-universe-bar) :is(button, a, summary, input, select, textarea):focus-visible {
  outline: 2px solid var(--iv-craft-focus);
  outline-offset: 3px;
}
html body #im-root button:disabled {
  opacity: .5;
}
html body #im-root :is(.im-muted, .im-empty, .im-form-status) {
  line-height: 1.7;
}
html body #im-root .im-muted {
  color: var(--im-muted);
}
html body #im-root :is(.im-form-status, .im-receipt, .im-address) {
  overflow-wrap: anywhere;
}
html body #im-root .im-gold {
  background: linear-gradient(110deg, #e5d2b3, #d0b58e);
  border-color: #e5d2b3;
  color: #11171c;
  box-shadow: inset 0 1px 0 #fff5;
  font-weight: 500;
}

/* Preserve the approved ocean and living light. Give flat screens one rhythm. */
html body #im-root .im-page-content {
  width: 100%;
  max-width: 560px;
  padding-inline: clamp(22px, 6vw, 32px);
}
html body #im-root .im-page-content > .im-lead {
  font-size: clamp(34px, 9vw, 48px);
  line-height: 1.15;
  letter-spacing: -.025em;
  margin: 16px 0 28px;
  text-wrap: balance;
}
html body #im-root :is(.im-page-content, .im-sheet-content) h3 {
  font-size: 24px;
  line-height: 1.3;
  margin: 30px 0 16px;
}
html body #im-root .im-card {
  padding: 24px 0;
  margin: 24px 0;
  border-color: var(--iv-craft-border);
  background: linear-gradient(140deg, #080e16a3, #03080dc2);
  box-shadow: none;
}
html body #im-root .im-balance {
  font-variant-numeric: tabular-nums;
  letter-spacing: -.035em;
  line-height: 1.15;
  color: #eee2ce;
  overflow-wrap: anywhere;
}
html body #im-root .im-actions {
  gap: 10px;
  flex-wrap: wrap;
}
html body #im-root .im-actions > * {
  min-width: 110px;
  min-height: 48px;
}
html body #im-root .im-pair {
  padding: 17px 0;
  gap: 18px;
  font-size: 13px;
  line-height: 1.55;
}
html body #im-root .im-pair > span {
  flex: 1;
  min-width: 0;
}
html body #im-root .im-pair > strong {
  min-width: 0;
  max-width: 62%;
  font-variant-numeric: tabular-nums;
  color: #e5d3b5;
}
html body #im-root .im-history-list {
  gap: 10px;
}
html body #im-root .im-history-list > button {
  padding: 17px 18px;
  border: 1px solid var(--iv-craft-border);
  border-radius: 16px;
  background: #060c13bd;
  box-shadow: inset 0 1px 0 #fff04;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
html body #im-root .im-history-list > button small {
  font-size: 12px;
  color: #b0b1ad;
}

/* The existing toolbar can wrap gracefully when text or the viewport grows. */
html body #im-root .im-screen-bar {
  gap: 4px 10px;
  flex-wrap: wrap;
  align-items: center;
}
html body #im-root .im-screen-bar > button {
  min-width: 44px;
  min-height: 44px !important;
}
html body #im-root .iv-i-tools[open] > div {
  border-color: var(--iv-craft-border);
  background: var(--iv-craft-surface);
  max-width: calc(100vw - 44px);
}
html body #im-root .iv-i-tools div button {
  min-height: 44px;
  padding: 11px 14px;
  border-radius: 10px;
  white-space: normal;
  line-height: 1.5;
}

/* Forms retain their real labels, validation and wallet review. */
html body #im-root :is(input, textarea, select):not([type='checkbox']):not([type='range']) {
  min-width: 0;
  min-height: 48px;
  border-color: #d8c5a33b;
  border-radius: 14px;
  background-color: #030910c7;
  color: #f1eee7;
  font-size: 16px;
  line-height: 1.45;
  box-shadow: inset 0 1px 0 #0006;
}
html body #im-root :is(input, textarea)::placeholder {
  color: #a4a9ae;
  opacity: 1;
}
html body #im-root :is(input, textarea, select):disabled {
  opacity: .65;
}
html body #im-root label {
  font-size: 12px;
  line-height: 1.6;
  color: #c0bbae;
}
html body #im-root :is(.im-sheet-content, .im-account) label input {
  margin-top: 7px;
}
html body #im-root .im-search input {
  min-height: 44px;
  border-radius: 0;
  border-color: transparent;
  border-bottom-color: #d8c5a33b;
  background-color: transparent;
  box-shadow: none;
  font-size: 16px;
}
html body #im-root[data-page='i'] .im-chat-composer textarea {
  border: 0;
  border-radius: 30px;
  background-color: transparent;
  box-shadow: none;
}
html body #im-root[data-page='i'] .im-chat-composer {
  background: #050c13c9;
  border-color: #d8c5a347;
}
html body #im-root .im-amount-options {
  gap: 8px;
  flex-wrap: wrap;
}
html body #im-root .im-amount-options > button {
  min-height: 44px !important;
  min-width: 64px;
  font-size: 13px;
}
html body #im-root .im-bot-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
html body #im-root .im-bot-actions button {
  min-height: 48px;
  padding: 10px 12px;
  font-size: 13px;
}
html body #im-root #im-bot-form label:has(input[type='checkbox']) {
  min-height: 44px;
  cursor: pointer;
}
html body #im-root input[type='checkbox']:not(#im-motion):not(#im-hints) {
  appearance: auto;
  -webkit-appearance: checkbox;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  margin: 0;
  flex: 0 0 24px;
  accent-color: #d8c5a3;
}

/* A small switch with a full thumb-sized hit area. */
html body #im-root .im-settings-row {
  gap: 18px;
  margin: 0;
  padding-block: 18px;
  min-height: 72px;
  font-size: 14px;
  cursor: pointer;
}
html body #im-root .im-settings-row input[type='checkbox'] {
  width: 56px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  position: relative;
}
html body #im-root .im-settings-row input[type='checkbox']::after {
  content: '';
  position: absolute;
  inset: 8px 2px;
  border: 1px solid #b7bdbb44;
  border-radius: 30px;
  background: #101a23;
  transition: background-color 160ms ease, border-color 160ms ease;
}
html body #im-root .im-settings-row input[type='checkbox']::before {
  z-index: 1;
  width: 20px;
  height: 20px;
  top: 12px;
  left: 6px;
  background: #aeb6bb;
}
html body #im-root .im-settings-row input[type='checkbox']:checked::after {
  background: #d8c5a3;
  border-color: #d8c5a3;
}
html body #im-root .im-settings-row input[type='checkbox']:checked::before {
  background: #151d24;
  transform: translateX(24px);
}

/* One clean sheet material, without adding overlays or hiding controls. */
html body #im-root .im-sheet {
  background: linear-gradient(145deg, #0b131df7, #03080dfc) !important;
  border-color: var(--iv-craft-border);
  box-shadow: 0 16px 60px #0009;
}
html body #im-root .im-sheet-top {
  border-top-color: #ffffff09;
}
html body #im-root .im-handle {
  min-height: 44px !important;
}
html body #im-root .im-handle::after {
  width: 32px;
  height: 3px;
  background: #c5c2b755;
}
html body #im-root .im-sheet-label p {
  font-size: 12px;
  letter-spacing: .04em;
  color: #d2c7b2;
}
html body #im-root .im-sheet-content {
  padding-inline: clamp(22px, 6vw, 30px);
  scrollbar-width: thin;
  scrollbar-color: #d8c5a33b transparent;
}
html body #im-root .im-sheet-content > h2 {
  font-size: clamp(28px, 8vw, 36px);
  line-height: 1.2;
  letter-spacing: -.02em;
  margin: 14px 0 24px;
  text-wrap: balance;
}
html body #im-root .im-sheet-content summary {
  min-height: 44px;
  padding-block: 12px;
  font-size: 13px;
  line-height: 1.5;
}
html body #im-root .im-sheet-content .is-comment button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  line-height: 1.5;
}
html body #im-root .im-requested {
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
html body #im-root .im-toast {
  background: #07111cf5;
  border-color: var(--iv-craft-border);
  color: #eee2cc;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
html body #im-root .im-support-grid {
  gap: 10px;
}
html body #im-root .im-support-grid > button {
  min-height: 64px;
  padding: 18px 20px;
  border: 1px solid var(--iv-craft-border);
  border-radius: 16px;
  background: #060c13bd;
  gap: 16px;
  color: #e9e3d8;
  line-height: 1.5;
}
html body #im-root .im-support-links {
  gap: 12px 24px;
  flex-wrap: wrap;
}
html body #im-root .im-support-links :is(a, button) {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* 29 retains its edge-to-edge posts, animation and directional feed behavior. */
html body #im-root .is-social-action {
  min-height: 44px;
  min-width: 44px;
}
html body #im-root .is-home-tools button {
  min-height: 44px;
}
html body #im-root:not([data-standalone='29']) .is-home-tools {
  bottom: calc(144px + env(safe-area-inset-bottom, 0px));
  left: max(20px, env(safe-area-inset-left, 0px));
  right: max(20px, env(safe-area-inset-right, 0px));
  gap: 8px;
  padding-inline: 0;
}
html body #im-root .is-home-tools #im-swipe-hint {
  position: absolute;
  bottom: 52px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  line-height: 1.4;
  color: #bebbb2;
  pointer-events: none;
}
html body #im-root:not([data-standalone='29']) .is-feed-copy {
  bottom: calc(228px + env(safe-area-inset-bottom, 0px));
}
html body #im-root:not([data-standalone='29']) .is-feed-actions {
  bottom: calc(228px + env(safe-area-inset-bottom, 0px));
}
html body #im-root .is-home-tools #im-i-scroll {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 1 1 102px;
  min-width: 102px;
  max-width: 170px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #d8c5a33b;
  border-radius: 24px;
  background: #040a12b8;
  color: #ccc7bc;
  font: 11px/1.4 -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 #fff04;
}
html body #im-root .is-home-tools #im-i-scroll::before {
  content: '';
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: #a3aaa8;
}
html body #im-root .is-home-tools #im-i-scroll[data-i-scroll-state='on'] {
  color: #f0debd;
  border-color: #d8c5a36b;
  background: #d8c5a310;
}
html body #im-root .is-home-tools #im-i-scroll[data-i-scroll-state='on']::before {
  background: #f0d6a9;
  box-shadow: 0 0 8px #e1be8066;
}
html body #im-root .is-home-tools #im-i-scroll[data-i-scroll-state='paused'] {
  color: #ccd8e1;
  border-color: #bad0e34a;
}
html body #im-root .is-home-tools #im-i-scroll[data-i-scroll-state='paused']::before {
  background: #afc4d5;
}
html body #im-root .is-feed-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}
html body #im-root .is-feed-copy p {
  line-height: 1.6;
}
html body #im-root .is-feed-copy .is-feed-author {
  min-height: 44px;
}

/* Wallet review is a separate existing dialog outside the hub root. */
body.im-mobile #wallet-dialog {
  color: #f1eee7;
  border-color: #d8c5a33b;
  background: #060d15;
  scrollbar-width: thin;
  scrollbar-color: #d8c5a33b transparent;
}
body.im-mobile #wallet-dialog :is(button, .action) {
  min-height: 44px;
  min-width: 44px;
  line-height: 1.4;
}
body.im-mobile #wallet-dialog .buttons {
  gap: 10px;
}
body.im-mobile #wallet-dialog .wallet-top > div {
  min-width: 0;
}
body.im-mobile #wallet-dialog #wallet-state {
  font-size: 12px;
  line-height: 1.6;
  color: #b3b7bc;
}

@media (hover: hover) and (pointer: fine) {
  html body #im-root :is(.im-history-list > button, .im-support-grid > button):hover {
    border-color: #d8c5a35c;
    background: #0d1620d9;
  }
  html body #im-root .im-gold:hover {
    background: #e8d5b6;
    color: #11171c;
  }
}
@media (max-width: 360px) {
  html body #im-root .im-page-content {
    padding-inline: 20px;
  }
  html body #im-root .im-sheet-content {
    padding-inline: 20px;
  }
  html body #im-root .im-pair {
    gap: 12px;
    font-size: 12px;
  }
  html body #im-root .im-actions > * {
    padding-inline: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html body #im-root :is(button, input, textarea, select),
  html body #im-root .im-settings-row input[type='checkbox']::before,
  html body #im-root .im-settings-row input[type='checkbox']::after {
    transition: none !important;
  }
}
html body #im-root[data-motion='off'] .im-settings-row input[type='checkbox']::before,
html body #im-root[data-motion='off'] .im-settings-row input[type='checkbox']::after {
  transition: none !important;
}

/* The WRLD iframe owns its HUD; parent controls must not cover the scene. */
html body #im-root[data-page='world'][data-signed-in='true'] > :is(.im-feed-dock, .im-universe-bar, .iv-viewbar, .iv-explore-toggle, .iv-omni-handle, .iv-omni-preview, .im-orbit, .im-related, .iv-main-wallet-hud) {
  display: none !important;
}
body:has(#im-root[data-page='world'][data-signed-in='true']) > :is(.iv-topbar-toggle, #invictus-privacy-settings) {
  display: none !important;
}

