/* Shared runtime layer for localization, review links, and dashboard sizing. */

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

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/*
 * The landing-page withdrawal activity card is rendered inside React's root
 * tree. Keep it in the same top-level fixed layer as the Shop and Chat
 * launchers instead of letting page sections with their own stacking contexts
 * cover it until the user scrolls.
 */
.ttinc-withdrawal-notification {
  position: fixed !important;
  z-index: 2147483647 !important;
  left: 16px !important;
  bottom: 80px !important;
  width: min(288px, calc(100vw - 32px)) !important;
  max-width: calc(100vw - 32px) !important;
  pointer-events: auto;
  isolation: isolate;
}

img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  max-width: 100%;
  font: inherit;
}

:where(a, button) {
  -webkit-tap-highlight-color: transparent;
}

:where(a, button):not(:disabled) {
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease,
    opacity 160ms ease;
}

::selection {
  color: #fff;
  background: #e31937;
}

:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid #fbbf24;
  outline-offset: 3px;
}

.trace-skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 2147483001;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 8px;
  color: #111827;
  background: #fbbf24;
  font-weight: 800;
  text-decoration: none;
  transition: transform 160ms ease;
}

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

.trace-disclosure {
  width: 100%;
  padding: 9px 18px;
  color: #cbd5e1;
  background: linear-gradient(90deg, #121722, #171c28 50%, #121722);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  font: 600 12px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: center;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.025);
}

.trace-disclosure.trace-disclosure-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 24px;
  padding: 13px 0 0;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  border-bottom: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
}

.trace-disclosure strong {
  color: #f8fafc;
}

.trace-language-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  color: #94a3b8;
  white-space: nowrap;
}

.trace-language-control select {
  width: auto;
  min-height: 30px;
  padding: 4px 24px 4px 8px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 6px;
  color: #f8fafc;
  background: #1f2937;
  font-size: 12px;
}

.trace-onsite-review-cta {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 22px;
  min-height: 70px;
  padding: 14px 18px;
  border: 1px solid rgba(0, 182, 122, 0.28);
  border-radius: 4px;
  color: #fff;
  background: #07073b;
}

.trace-onsite-review-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  color: #00b67a;
  font-size: 16px;
  font-weight: 800;
}

.trace-trustpilot-mark {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: #fff;
  background: #00b67a;
  border-radius: 3px;
  font-size: 13px !important;
  line-height: 1;
}

.trace-onsite-review-brand span {
  color: #fff;
  font-size: 13px;
}

.trace-onsite-review-copy {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 12px;
  min-width: 0;
}

.trace-onsite-review-copy strong {
  color: #f8fafc;
  font-size: 13px;
}

.trace-onsite-review-stars {
  display: inline-flex;
  gap: 3px;
  white-space: nowrap;
}

.trace-onsite-review-stars i {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: #fff;
  background: #00b67a;
  font-size: 12px;
  font-style: normal;
  line-height: 1;
}

.trace-onsite-review-rating {
  color: #cbd5e1;
  font-size: 12px;
  white-space: nowrap;
}

html:not(.ttinc-home-route) .trace-disclosure { display: none; }

@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;
  }
}

#trace-fund-translate-host {
  position: fixed !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  left: -9999px !important;
  top: -9999px !important;
}

.goog-te-banner-frame,
.skiptranslate iframe,
body > .skiptranslate {
  display: none !important;
}

body {
  top: 0 !important;
}

#trace-fund-review-prompt {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.78);
  font-family: Arial, sans-serif;
}

#trace-fund-review-prompt[hidden] {
  display: none;
}

.trace-fund-review-card {
  width: min(100%, 410px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 28px 24px 22px;
  color: #f8fafc;
  background:
    radial-gradient(circle at top right, rgba(227, 25, 55, 0.17), transparent 42%),
    #111318;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.trace-fund-review-brand {
  margin-bottom: 18px;
  color: #00b67a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.trace-fund-review-card h2 {
  margin: 0;
  color: #fff;
  font-size: 22px;
  line-height: 1.25;
}

.trace-fund-review-card p {
  margin: 12px 0 22px;
  color: #aeb7c5;
  font-size: 14px;
  line-height: 1.6;
}

.trace-fund-review-stars {
  margin: 0 0 18px;
  color: #00b67a;
  font-size: 25px;
  letter-spacing: 0.08em;
}

.trace-fund-review-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.trace-fund-review-actions a,
.trace-fund-review-actions button {
  min-height: 44px;
  border-radius: 10px;
  padding: 11px 15px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.trace-fund-review-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #061711;
  background: #00b67a;
  text-decoration: none;
}

.trace-fund-review-actions button {
  border: 1px solid #35404d;
  color: #cbd5e1;
  background: transparent;
}

body.trace-dashboard-mobile {
  overflow-x: hidden;
}

body.trace-dashboard-mobile #root {
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0 auto;
  overflow-x: hidden;
}

html[data-trace-fund-dashboard="true"] #root {
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0 auto;
  overflow-x: hidden;
}

#ttinc-dashboard-addon-stack,
#ttinc-portfolio-plans {
  width: 100%;
  max-width: 1024px;
  box-sizing: border-box;
  margin-left: auto;
  margin-right: auto;
}

#ttinc-portfolio-plans > div {
  width: 100%;
  box-sizing: border-box;
}

#trace-fund-desktop-dashboard-gate {
  display: none !important;
}

@media (max-width: 767px) {
  body.trace-dashboard-mobile #root table {
    width: max-content;
    min-width: 560px !important;
    table-layout: auto;
  }

  body.trace-dashboard-mobile #root th,
  body.trace-dashboard-mobile #root td {
    max-width: none;
    padding: 8px 5px;
    overflow-wrap: normal;
    white-space: nowrap;
  }

  body.trace-dashboard-mobile #root [class~="overflow-x-auto"] {
    max-width: 100%;
    overflow-x: auto !important;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  body.trace-dashboard-mobile #root [class~="flex"] {
    min-width: 0;
  }

  body.trace-dashboard-mobile #root [class~="justify-between"] {
    flex-wrap: wrap;
    row-gap: 10px;
  }
}

@media (max-width: 420px) {
  /*
   * Keep the dashboard cards readable on compact phones. The holdings table
   * intentionally remains scrollable inside its card instead of widening the
   * entire page or collapsing financial values into unreadable fragments.
   */
  body.trace-dashboard-mobile #root [class~="max-w-5xl"] {
    padding-left: 14px;
    padding-right: 14px;
  }

  body.trace-dashboard-mobile #root [class~="grid-cols-2"] {
    gap: 8px;
  }

  body.trace-dashboard-mobile #root [class~="p-5"] {
    padding: 14px;
  }
}

@media (max-width: 767px) {
  #ttinc-dashboard-addon-stack {
    width: 100%;
    max-width: 100%;
    padding-left: 12px !important;
    padding-right: 12px !important;
    overflow-x: hidden;
  }

  #ttinc-portfolio-plans {
    width: 100%;
    max-width: 100%;
    margin: 12px 0;
    padding: 0 !important;
  }

  #ttinc-portfolio-plans > div {
    padding: 14px !important;
  }

  #ttinc-portfolio-plans > div > div:first-child {
    display: block !important;
    margin-bottom: 10px !important;
  }

  #ttinc-portfolio-plans h2 {
    font-size: 18px !important;
  }

  #ttinc-portfolio-plans > div > div:not(:first-child) {
    min-width: 0;
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .trace-disclosure {
    padding: 8px 12px;
  }

  .trace-disclosure.trace-disclosure-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    padding: 12px 0 0;
  }

  .trace-language-control {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 0 auto;
  }

  .trace-onsite-review-cta {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px 14px;
  }

  .trace-onsite-review-copy {
    flex: 1 1 180px;
  }

  #trace-fund-review-prompt {
    padding: 14px;
  }

  .trace-fund-review-card {
    padding: 24px 18px 18px;
  }

  .trace-fund-review-actions {
    flex-direction: column;
  }

  .trace-fund-review-actions a,
  .trace-fund-review-actions button {
    width: 100%;
  }
}