html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden !important;
}

:root {
  --profile-sidebar-width: clamp(176px, 12.5vw, 205px);
  --profile-sidebar-pad-left: 12px;
  --profile-sidebar-right-gap: 10px;
}

#app {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#lcm-header {
  flex: 0 0 auto;
  width: 100%;
  box-sizing: border-box;
  z-index: 20;
  position: sticky;
  top: 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 10px 16px;
  font-family: "Segoe UI", "Roboto", "Arial", sans-serif;
  color: #000;
  --lcm-header-nav-size: 14px;
}

#lcm-header .lcm-side {
  min-width: 0;
  display: flex;
  align-items: center;
}

#lcm-header .lcm-header-left {
  flex: 0 1 24%;
  justify-content: flex-start;
}

#lcm-header .lcm-header-center {
  flex: 0 1 52%;
  justify-content: center;
  padding: 0 6px;
}

#lcm-header .lcm-header-right {
  flex: 0 1 24%;
  justify-content: flex-end;
}

#lcm-header .lcm-title,
#lcm-header .lcm-nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.1;
}

#lcm-header .lcm-title {
  font-size: calc(var(--lcm-header-nav-size) + 1px);
  font-weight: 700;
  cursor: pointer;
}

#lcm-header .lcm-nav-label {
  font-size: var(--lcm-header-nav-size);
  font-weight: 600;
  cursor: pointer;
}

#lcm-header .lcm-right-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

#lcm-header .lcm-avatar-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #111;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f2f2f2 0%, #dcdcdc 100%);
  color: #111;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  flex: 0 0 auto;
}

#lcm-finance-bar,
#finance-banner-placeholder {
  width: 100%;
}

#lcm-main-scroll {
  flex: 1 1 auto;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  border: 0 !important;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

#lcm-main-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

#lcm-footer {
  flex: 0 0 auto;
  width: 100%;
  box-sizing: border-box;
  z-index: 10;
  border-top: 1px solid #d0d0d0 !important;
  box-shadow: none !important;
  min-height: 64px;
  padding: 8px 14px 10px 14px;
  margin: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  font-size: 13px;
  color: #666;
  font-family: "Segoe UI", "Roboto", "Arial", sans-serif;
}

#lcm-footer .lcm-footer-links {
  max-width: 1000px;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-top: 0;
  line-height: 1.2;
}

#lcm-footer .lcm-footer-links a {
  color: inherit;
  text-decoration: none;
}

#lcm-footer .lcm-footer-sep {
  color: #ccc;
}

#lcm-footer .lcm-footer-copy {
  margin-top: 6px;
  color: #999;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
}

@media (min-width: 901px) {
  #lcm-header {
    padding: calc(env(safe-area-inset-top, 0px) + 14px) 18px 12px 18px;
    --lcm-header-nav-size: 21px;
  }

  #lcm-header .lcm-header-left {
    flex-basis: 23%;
  }

  #lcm-header .lcm-header-center {
    flex-basis: 54%;
  }

  #lcm-header .lcm-header-right {
    flex-basis: 23%;
  }

}

@media (min-width: 431px) and (max-width: 900px) {
  #lcm-header {
    --lcm-header-nav-size: 16px;
  }
}

@media (max-width: 440px) {
  #lcm-header {
    padding: calc(env(safe-area-inset-top, 0px) + 10px) 4px 6px 4px;
    align-items: center;
    --lcm-header-nav-size: clamp(11px, 2.9vw, 13px);
    gap: 4px;
  }

  #lcm-header .lcm-header-left {
    flex-basis: 20%;
    min-width: 0;
  }

  #lcm-header .lcm-header-center {
    flex-basis: 48%;
    padding: 0 1px;
    min-width: 0;
  }

  #lcm-header .lcm-header-right {
    flex-basis: 32%;
    min-width: 0;
  }

  #lcm-header .lcm-nav-label {
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.08;
    max-width: none;
    font-size: clamp(11px, 2.9vw, 13px);
  }

  #lcm-header .lcm-title {
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.06;
    text-align: center;
    font-size: clamp(11px, 3.1vw, 14px);
    letter-spacing: -0.1px;
  }

  #lcm-header .lcm-header-left .lcm-nav-label {
    text-align: left;
    max-width: 100%;
  }

  #lcm-header .lcm-header-right .lcm-nav-label {
    text-align: right;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    max-width: none;
  }

  #lcm-header .lcm-right-cluster {
    gap: 3px;
    min-width: 0;
    max-width: 100%;
  }

  #lcm-header .lcm-avatar-btn {
    width: 27px;
    height: 27px;
    font-size: 10px;
    flex: 0 0 27px;
  }

  #lcm-footer {
    min-height: 50px;
    padding: 4px 8px 6px 8px;
  }

  #lcm-footer .lcm-footer-links {
    gap: 6px;
    line-height: 1.08;
    font-size: 11px;
  }

  #lcm-footer .lcm-footer-copy {
    margin-top: 2px;
    font-size: 10px;
    line-height: 1.1;
  }

  .profile-graph-shell {
    top: calc(72px + env(safe-area-inset-top, 0px));
    bottom: calc(246px + env(safe-area-inset-bottom, 0px));
  }

  .profile-graph-frame {
    top: 10px;
    right: 6px;
    bottom: 2px;
    left: 0;
    overflow: hidden;
    clip-path: inset(0 0 0 0);
  }

  .profile-graph-tabs {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: calc(156px + env(safe-area-inset-bottom, 0px));
    z-index: 18;
    white-space: nowrap;
  }

  .profile-nav-divider {
    bottom: calc(228px + env(safe-area-inset-bottom, 0px));
  }

  .profile-performance-label {
    bottom: calc(210px + env(safe-area-inset-bottom, 0px));
    font-size: 11px;
  }

  .profile-portfolio-readout {
    bottom: calc(192px + env(safe-area-inset-bottom, 0px));
    font-size: 11px;
  }

  .profile-balance-readout {
    bottom: calc(160px + env(safe-area-inset-bottom, 0px));
    font-size: 18px;
  }

  .profile-balance-actions {
    bottom: calc(120px + env(safe-area-inset-bottom, 0px));
    gap: 12px;
  }

  .profile-toc-horizontal {
    bottom: calc(62px + env(safe-area-inset-bottom, 0px));
    gap: 14px;
  }

  .profile-nav-divider-bottom {
    bottom: calc(52px + env(safe-area-inset-bottom, 0px));
  }

  .profile-toc-btn {
    width: 92px;
    font-size: 0.86rem;
    padding: 8px 0;
  }

  #depositBtn,
  #withdrawBtn {
    width: 84px;
    font-size: 0.84rem;
    padding: 8px 0;
  }
}

.legal-page {
  font-family: "Segoe UI", "Roboto", "Arial", sans-serif;
  padding: 32px;
  max-width: 900px;
  margin: 0 auto;
}

.legal-card {
  background: #fafafa;
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 24px;
}

.legal-back-btn {
  margin-top: 18px;
  padding: 10px 14px;
  background: #eee;
  border: 0;
  border-radius: 6px;
}

.profile-dashboard {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 400px;
  display: block;
  font-family: "Segoe UI", "Roboto", "Arial", sans-serif;
}

.profile-balance-box {
  border: 2px solid #222;
  min-width: 320px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 1.3em;
  background: #f9f9f9;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
  padding: 32px 28px;
  margin: 0 auto;
}

.profile-graph-shell {
  position: fixed;
  left: 0;
  right: calc(
    var(--profile-sidebar-right-gap) + var(--profile-sidebar-width) - var(--profile-sidebar-pad-left)
  );
  top: calc(84px + env(safe-area-inset-top, 0px));
  bottom: calc(262px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  overflow: hidden;
  z-index: 15;
}

.profile-graph-frame {
  position: absolute;
  top: 2px;
  right: 12px;
  bottom: 5px;
  left: 0;
  overflow: hidden;
}

.profile-sidebar {
  position: fixed;
  top: calc(106px + env(safe-area-inset-top, 0px));
  right: var(--profile-sidebar-right-gap);
  width: var(--profile-sidebar-width);
  bottom: calc(263px + env(safe-area-inset-bottom, 0px));
  padding: 16px 0 2px var(--profile-sidebar-pad-left);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: transparent;
  box-shadow: none;
  box-sizing: border-box;
  z-index: 16;
}

.symbol-widget {
  border: 1px solid #d5d5d5;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px 12px;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  box-sizing: border-box;
}

.symbol-widget-title {
  font-size: 13px;
  font-weight: 700;
  color: #222;
  margin-bottom: 4px;
}

.symbol-widget-list {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.symbol-widget-list::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.symbol-widget-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #ececec;
}

.symbol-widget-item:last-child {
  border-bottom: none;
}

.symbol-widget-item .symbol {
  font-size: 13px;
  font-weight: 700;
  color: #111;
  letter-spacing: 0.2px;
}

.symbol-widget-item .price-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
}

.symbol-widget-item .price {
  color: #222;
  font-size: 13px;
  font-weight: 700;
}

.symbol-widget-item .delta {
  color: #666;
  font-size: 12px;
  margin-top: 2px;
}

.symbol-widget-item.up .price,
.symbol-widget-item.up .delta {
  color: #137333;
}

.symbol-widget-item.down .price,
.symbol-widget-item.down .delta {
  color: #b42318;
}

.symbol-widget-item .error {
  color: #b42318;
  font-size: 12px;
}

.symbol-widget-loading,
.symbol-widget-error {
  font-size: 13px;
  color: #555;
}

.profile-graph-tabs {
  position: fixed;
  right: calc(
    var(--profile-sidebar-right-gap) + var(--profile-sidebar-width) - var(--profile-sidebar-pad-left) + 14px
  );
  bottom: calc(263px + env(safe-area-inset-bottom, 0px));
  z-index: 16;
  display: flex;
  gap: 8px;
}

.profile-graph-tabs {
  position: fixed;
  right: calc(
    var(--profile-sidebar-right-gap) + var(--profile-sidebar-width) - var(--profile-sidebar-pad-left) + 14px
  );
  bottom: calc(263px + env(safe-area-inset-bottom, 0px));
  z-index: 16;
  display: flex;
  gap: 8px;
}

.profile-graph-tab {
  border: 1px solid #d0d0d0;
  background: #fff;
  color: #222;
  border-radius: 8px;
  padding: 6px 14px;
  font-family: "Segoe UI", "Roboto", "Arial", sans-serif;
  font-size: 13px;
  cursor: pointer;
}

.profile-graph-tab.active {
  background: #222;
  color: #fff;
  border-color: #222;
}

.profile-graph-canvas {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-sizing: border-box;
  pointer-events: auto;
}

.profile-graph-canvas svg {
  width: 100%;
  height: 100%;
  display: block;
}

.profile-graph-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #777;
  font-size: 13px;
}

.profile-graph-legend {
  display: none;
}

.profile-graph-legend .line {
  display: inline-block;
  width: 20px;
  height: 2px;
  vertical-align: middle;
  margin-right: 6px;
}

.profile-graph-legend .line.portfolio {
  background: #111;
}

.profile-graph-legend .line.performance {
  background: #666;
}

.profile-toc-horizontal {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  justify-items: center;
  align-items: center;
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  z-index: 15;
  width: min(500px, calc(100vw - 16px));
  padding: 8px 10px;
  border-radius: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.profile-nav-divider {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(258px + env(safe-area-inset-bottom, 0px));
  border-top: 4px solid #000;
  z-index: 14;
}

.profile-portfolio-readout {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(226px + env(safe-area-inset-bottom, 0px));
  z-index: 15;
  font-size: 13px;
  font-weight: 500;
  color: #444;
  white-space: nowrap;
}

.profile-nav-divider-bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  border-top: 4px solid #000;
  z-index: 14;
}

.profile-balance-readout {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(198px + env(safe-area-inset-bottom, 0px));
  z-index: 15;
  font-size: 22px;
  font-weight: 600;
  color: #222;
  white-space: nowrap;
}

.profile-performance-label {
  position: fixed;
  left: 50%;
  transform: translateX(calc(-50% + 2px));
  bottom: calc(244px + env(safe-area-inset-bottom, 0px));
  z-index: 15;
  font-size: 13px;
  font-weight: 500;
  color: #444;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.profile-menu {
  position: fixed;
  top: calc(76px + env(safe-area-inset-top, 0px));
  right: 14px;
  min-width: 240px;
  max-width: min(320px, calc(100vw - 28px));
  background: #fff;
  border: 1px solid #d2d2d2;
  border-radius: 12px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.16);
  padding: 12px;
  z-index: 40;
}

.profile-menu-title {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  margin-bottom: 6px;
}

.profile-menu-row {
  font-size: 13px;
  color: #333;
  margin-bottom: 6px;
  word-break: break-word;
}

.profile-menu-link {
  margin-top: 4px;
  color: #111;
  font-weight: 600;
  cursor: pointer;
}

.profile-balance-actions {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(150px + env(safe-area-inset-bottom, 0px));
  width: min(500px, calc(100vw - 16px));
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  justify-items: center;
  align-items: center;
  z-index: 15;
}

#depositBtn {
  grid-column: 2;
}

#withdrawBtn {
  grid-column: 3;
}

.profile-toc-btn {
  font-size: 1.1em;
  cursor: pointer;
  color: #222;
  background: #eee;
  border: none;
  border-radius: 6px;
  width: 112px;
  padding: 10px 0;
  transition: background 0.2s;
  font-family: "Segoe UI", "Roboto", "Arial", sans-serif;
  text-align: center;
}

.profile-toc-btn:hover {
  background: #ddd;
}

.stripe-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.stripe-sheet {
  width: min(640px, 100vw);
  max-height: 86vh;
  height: 34vh;
  overflow-y: auto;
  background: #fff;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom, 0px)) 16px;
  font-family: "Segoe UI", "Roboto", "Arial", sans-serif;
  transition: height 180ms ease;
}

.stripe-sheet-handle {
  width: 48px;
  height: 5px;
  border-radius: 999px;
  background: #c7c7c7;
  margin: 2px auto 12px auto;
  touch-action: none;
  cursor: ns-resize;
}

.stripe-sheet-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.stripe-sheet-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin: 8px 0 6px 0;
}

.stripe-sheet-input,
.stripe-sheet-select {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #d8d8d8;
  border-radius: 10px;
  font-size: 16px;
  background: #fff;
}

.stripe-sheet-element {
  border: 1px solid #d8d8d8;
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 8px;
}

.stripe-sheet-primary {
  width: 100%;
  margin-top: 12px;
  padding: 11px 14px;
  border: 0;
  border-radius: 10px;
  background: #111;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.stripe-sheet-close {
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #d8d8d8;
  border-radius: 10px;
  background: #fff;
  color: #222;
  font-size: 15px;
  cursor: pointer;
}

.stripe-sheet-error {
  min-height: 20px;
  margin-top: 8px;
  color: #b00020;
  font-size: 14px;
}

.side-btn {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1em;
}

.side-btn.active {
  background: #222;
  color: #fff;
}

.profile-center {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.projections-row,
.performance-row {
  width: 100%;
  margin-bottom: 0;
}

.chart-box {
  border: 2px solid #222;
  width: 120px;
  background: #f9f9f9;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
  font-size: 1.1em;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.projection-box {
  width: 120px;
  height: 120px;
  padding: 10px;
}

.performance-box {
  height: 70px;
  padding: 12px;
}

.projections-page {
  width: 100%;
  min-height: calc(100vh - 150px);
  box-sizing: border-box;
  padding: 8px 20px 190px 20px;
  display: grid;
  grid-template-rows: 1.35fr 1fr;
  gap: 16px;
  font-family: "Segoe UI", "Roboto", "Arial", sans-serif;
}

.projections-half {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.projection-card {
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 14px 8px 12px 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  min-height: 160px;
}

.projection-card canvas {
  width: 100%;
  height: 72px;
  display: block;
  margin-bottom: 6px;
}

.projections-bottom-half .projection-card {
  min-height: 130px;
}

.projection-graph {
  width: 100%;
  height: 72px;
  margin-bottom: 6px;
}

.projection-graph svg {
  width: 100%;
  height: 100%;
}

.projection-graph polyline,
.projection-graph line {
  fill: none;
  stroke: #222;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.projection-value {
  font-size: 1.85rem;
  font-weight: 700;
  color: #111;
  line-height: 1.1;
  margin-bottom: 6px;
  font-family: "Segoe UI", "Roboto", "Arial", sans-serif;
  text-align: center;
}

.projection-label {
  font-size: 13px;
  font-weight: 500;
  color: #444;
  letter-spacing: 0.2px;
  font-family: "Segoe UI", "Roboto", "Arial", sans-serif;
  text-align: center;
}

@media (max-width: 700px) {
  :root {
    --profile-sidebar-width: min(180px, 42vw);
    --profile-sidebar-pad-left: 8px;
    --profile-sidebar-right-gap: 6px;
  }

  .dashboard-grid {
    flex-direction: column;
  }

  .dashboard-side {
    width: 100%;
  }

  .side-btn {
    text-align: center;
  }

  .profile-balance-box {
    margin-bottom: 18px;
  }

  .profile-sidebar {
    top: calc(96px + env(safe-area-inset-top, 0px));
    width: var(--profile-sidebar-width);
    bottom: calc(265px + env(safe-area-inset-bottom, 0px));
    padding: 10px 8px 8px var(--profile-sidebar-pad-left);
  }

  .profile-graph-shell {
    left: 0;
    right: calc(
      var(--profile-sidebar-right-gap) + var(--profile-sidebar-width) - var(--profile-sidebar-pad-left)
    );
    top: calc(64px + env(safe-area-inset-top, 0px));
    bottom: calc(258px + env(safe-area-inset-bottom, 0px));
    padding: 0;
    margin: 0;
  }

  .profile-graph-frame {
    top: 14px;
    right: 8px;
    bottom: 3px;
  }

  .profile-graph-tabs {
    right: calc(
      var(--profile-sidebar-right-gap) + var(--profile-sidebar-width) - var(--profile-sidebar-pad-left) + 8px
    );
    bottom: calc(270px + env(safe-area-inset-bottom, 0px));
    gap: 6px;
  }

  .profile-graph-canvas {
    height: 100%;
  }

  .profile-graph-canvas svg {
    height: 100%;
  }

  .profile-toc-horizontal {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    width: min(500px, calc(100vw - 12px));
    justify-items: center;
    padding-bottom: 4px;
    bottom: calc(102px + env(safe-area-inset-bottom, 0px));
  }

  .profile-nav-divider {
    bottom: calc(264px + env(safe-area-inset-bottom, 0px));
  }

  .profile-portfolio-readout {
    bottom: calc(232px + env(safe-area-inset-bottom, 0px));
    font-size: 12px;
  }

  .profile-nav-divider-bottom {
    bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  }

  .profile-balance-readout {
    bottom: calc(204px + env(safe-area-inset-bottom, 0px));
    font-size: 20px;
  }

  .profile-performance-label {
    bottom: calc(250px + env(safe-area-inset-bottom, 0px));
    font-size: 12px;
  }

  .profile-menu {
    top: calc(62px + env(safe-area-inset-top, 0px));
    right: 8px;
    min-width: 210px;
  }

  .profile-balance-actions {
    bottom: calc(156px + env(safe-area-inset-bottom, 0px));
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: min(500px, calc(100vw - 12px));
    gap: 6px;
    justify-items: center;
  }

  .profile-toc-btn {
    width: 112px;
    text-align: center;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .chart-box {
    min-width: 180px;
  }

  .projections-page {
    min-height: calc(100vh - 130px);
    padding: 8px 8px 192px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
  }

  .projections-half {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .projection-card {
    min-height: 110px;
    margin-bottom: 10px;
    padding: 10px 4px;
  }

  .projection-card canvas {
    height: 64px;
  }

  .projections-bottom-half .projection-card {
    min-height: 100px;
  }

  .projection-value {
    font-size: 1.5rem;
  }
}

@media (min-width: 701px) and (max-width: 1024px) {
  :root {
    --profile-sidebar-width: min(188px, 32vw);
    --profile-sidebar-pad-left: 8px;
    --profile-sidebar-right-gap: 8px;
  }

  .profile-graph-shell {
    top: calc(82px + env(safe-area-inset-top, 0px));
    bottom: calc(254px + env(safe-area-inset-bottom, 0px));
  }

  .profile-graph-frame {
    top: 2px;
    right: 8px;
  }

  .profile-sidebar {
    top: calc(112px + env(safe-area-inset-top, 0px));
    bottom: calc(255px + env(safe-area-inset-bottom, 0px));
    padding: 10px 8px 8px var(--profile-sidebar-pad-left);
  }

  .profile-graph-tabs {
    bottom: calc(264px + env(safe-area-inset-bottom, 0px));
    right: calc(
      var(--profile-sidebar-right-gap) + var(--profile-sidebar-width) - var(--profile-sidebar-pad-left) + 10px
    );
  }

  .profile-graph-tab {
    padding: 5px 10px;
    font-size: 12px;
  }
}

@media (max-width: 900px) {
  #lcm-header {
    --lcm-header-nav-size: 15px;
  }

  #lcm-header .lcm-header-left {
    flex-basis: 28%;
  }

  #lcm-header .lcm-header-center {
    flex-basis: 44%;
  }

  #lcm-header .lcm-header-right {
    flex-basis: 28%;
  }

  #lcm-header .lcm-title,
  #lcm-header .lcm-nav-label {
    overflow: visible;
    text-overflow: clip;
    max-width: none;
    white-space: nowrap;
  }

  #lcm-header .lcm-right-cluster {
    gap: 4px;
  }

  .profile-graph-tabs {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    bottom: calc(264px + env(safe-area-inset-bottom, 0px)) !important;
    top: auto !important;
    z-index: 22 !important;
  }

  .profile-graph-shell {
    overflow: hidden;
    top: calc(76px + env(safe-area-inset-top, 0px));
    contain: layout paint;
  }

  .profile-graph-frame {
    overflow: hidden;
    clip-path: inset(0 0 0 0);
    contain: paint;
  }

  .profile-graph-canvas {
    display: block;
  }

  .projections-row,
  .performance-row {
    flex-direction: column;
    gap: 18px;
  }

  .chart-box {
    width: 100%;
  }
}

@media (max-width: 440px) {
  .profile-graph-tabs {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    bottom: calc(228px + env(safe-area-inset-bottom, 0px)) !important;
    top: auto !important;
    z-index: 22 !important;
  }
}

@media (max-width: 440px) {
  .profile-graph-shell {
    top: calc(80px + env(safe-area-inset-top, 0px));
    bottom: calc(276px + env(safe-area-inset-bottom, 0px));
  }

  .profile-graph-frame {
    top: 12px;
    right: 5px;
    bottom: 8px;
    left: 0;
    overflow: hidden;
    clip-path: inset(0 0 0 0);
  }

  .profile-graph-canvas,
  .profile-graph-canvas svg {
    width: 100%;
    height: 100%;
    display: block;
  }

  .profile-toc-horizontal {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    width: calc(100vw - 16px) !important;
    max-width: 100% !important;
    gap: 9px !important;
    padding: 0 10px 4px 10px !important;
    bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .profile-toc-btn {
    width: calc(100% - 6px) !important;
    min-width: 0 !important;
    justify-self: center !important;
    font-size: 0.78rem !important;
    padding: 10px 0 !important;
  }

  .profile-balance-actions {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 11px !important;
    width: calc(100vw - 16px) !important;
    max-width: 100% !important;
    padding: 0 10px !important;
    bottom: calc(156px + env(safe-area-inset-bottom, 0px)) !important;
  }

  #depositBtn {
    grid-column: 2 !important;
  }

  #withdrawBtn {
    grid-column: 3 !important;
  }

  .profile-toc-btn {
    grid-column: auto !important;
  }

  .profile-toc-btn,
  #depositBtn,
  #withdrawBtn {
    width: calc(100% - 2px) !important;
    min-width: 0 !important;
    justify-self: center !important;
    max-width: none !important;
    font-size: 1rem !important;
    padding: 8px 0 !important;
    min-height: 42px !important;
  }

}
