/* DENGELI APP SHELL — mobile edge-to-edge, desktop a single native device. */
:root {
  --status-h: 59px;
  --header-h: 56px;
  --bottom-safe: 26px;
  --dock-h: 80px;
  --ui-duration: 240ms;
  --sheet-duration: 420ms;
  --guide: #ffffff25;
}
html,
body {
  width: 100%;
  min-height: 100%;
  height: 100%;
  overflow: hidden;
}
body {
  padding: 0;
  display: grid;
  place-items: center;
  background: #ededee;
  overscroll-behavior: none;
}
.phone {
  width: 393px;
  height: min(852px, calc(100dvh - 52px));
  min-height: 620px;
  margin: 0;
  border-radius: 46px;
  box-shadow:
    0 0 0 5px #202022,
    0 0 0 7px #8b8b90,
    0 24px 60px #00000015;
  transform: none;
  isolation: isolate;
}
.status {
  height: var(--status-h);
}
.island {
  left: 50%;
  transform: translateX(-50%);
}
.home {
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}
.top {
  height: var(--header-h);
}
#app {
  position: absolute;
  inset: var(--status-h) 0 0;
  overflow: hidden;
}
.scroll-body {
  top: var(--header-h);
  bottom: calc(var(--bottom-safe) + 80px);
  padding-bottom: 28px;
  scroll-behavior: smooth;
}
.app-screen[data-screen="warrant"] .scroll-body {
  bottom: calc(var(--bottom-safe) + 110px);
}
.nav {
  bottom: var(--bottom-safe);
}
.trade {
  bottom: var(--bottom-safe);
  background: var(--bg);
}
.risk-fixed {
  bottom: calc(var(--bottom-safe) + 60px);
}
.stock-plot {
  width: calc(100% + var(--gutter) * 2);
}
.curve-foot {
  bottom: var(--bottom-safe);
}
.theme-light {
  --guide: #c8cdd5;
}
body.theme-light {
  background: #ededee;
}
.phone:before {
  content: "";
  position: absolute;
  left: -9px;
  top: 160px;
  width: 3px;
  height: 54px;
  background: #555;
  border-radius: 2px;
  pointer-events: none;
}
button,
input,
select {
  font-family: inherit;
}
input {
  font-size: 16px;
}
a,
button {
  -webkit-user-select: none;
  user-select: none;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--lightblue);
  outline-offset: 3px;
}
@media (max-width: 600px), (hover: none) and (pointer: coarse) {
  html,
  body {
    background: var(--bg) !important;
  }
  .phone {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    border-radius: 0;
    box-shadow: none;
    transform: none;
  }
  .status {
    display: none;
  }
  :root {
    --status-h: env(safe-area-inset-top, 0px);
    --bottom-safe: max(12px, env(safe-area-inset-bottom, 12px));
  }
  .home {
    display: none;
  }
  .phone:before {
    display: none;
  }
  .top {
    padding-top: 0;
  }
  .nav {
    bottom: var(--bottom-safe);
  }
  .scroll-body {
    scrollbar-width: none;
  }
}
@media (min-width: 601px) and (max-height: 700px) and (hover: hover) {
  .phone {
    height: calc(100dvh - 24px);
    min-height: 0;
  }
  .status {
    height: 49px;
  }
  :root {
    --status-h: 49px;
    --bottom-safe: 22px;
  }
  .island {
    top: 7px;
  }
}

/* Application surfaces; one density and one spacing rhythm. */
.right {
  text-align: right;
}
.volume small {
  font-size: 16px;
  color: var(--muted);
}
.market-hero .flow {
  margin-top: 20px;
}
.snapshot .icon {
  width: 12px;
  height: 12px;
  margin-left: 2px;
}
.text-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 13px;
  color: var(--lightblue);
  padding: 10px 2px;
}
.text-button .icon {
  width: 16px;
}
.list + .text-button {
  width: 100%;
  margin-top: 6px;
}
.full-button {
  width: 100%;
  text-align: left;
}
.bulletins {
  display: grid;
  gap: 16px;
}
.bulletin {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
}
.bulletin > span:nth-child(2) {
  flex: 1;
}
.bulletin small {
  font-size: 11px;
  color: var(--muted);
  display: block;
  margin-bottom: 5px;
}
.bulletin h3 {
  font-size: 14px;
}
.bulletin > .icon {
  width: 17px;
  color: var(--muted);
}
.category-logo {
  background: var(--raised) !important;
  color: var(--ink);
  display: grid;
  place-items: center;
}
.category-logo svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linejoin: round;
}
.category-logo.commodity {
  color: #a88b4b;
}
.category-logo.commodity svg {
  fill: #c7a45e20;
}
.legend-info {
  margin-left: auto;
  font-size: 10px;
}
.profile {
  width: 100%;
  text-align: left;
}
.profile-text {
  min-width: 0;
}
.radar {
  width: 164px;
  height: 128px;
}
.radar text {
  fill: var(--muted);
}
.radar .radar-value {
  fill: var(--ink) !important;
  font-size: 11px;
}
.research-panel {
  margin-top: 24px;
}
.research-top .tag {
  margin-left: auto;
}
.facts {
  margin: 10px 0 0;
  font-size: 13px;
}
.facts > div {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 12px 0;
}
.facts dt {
  color: var(--muted);
}
.facts dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.no-dock {
  bottom: var(--bottom-safe) !important;
}
.analysis-overview {
  text-align: center;
  padding-top: 10px;
}
.analysis-overview .score {
  font-size: 40px;
  font-weight: 400;
  letter-spacing: -1px;
  line-height: 52px;
}
.analysis-overview .score small {
  font-size: 15px;
  color: var(--muted);
  letter-spacing: 0;
  margin-left: 8px;
}
.large-radar {
  width: 100%;
  height: 225px;
  margin: 16px 0 24px;
}
.criterion {
  padding: 18px;
  background: var(--surface);
  border-radius: 20px;
  margin-bottom: 12px;
}
.criterion summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 15px;
}
.criterion summary::-webkit-details-marker {
  display: none;
}
.criterion summary small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 7px;
  line-height: 17px;
}
.criterion summary b {
  font-size: 23px;
  font-weight: 400;
}
.criterion p {
  font-size: 13px;
  line-height: 21px;
  color: var(--muted);
  margin-top: 14px;
}
.criterion .formula {
  font-size: 11px;
  line-height: 18px;
}
.criterion-bar {
  height: 4px;
  border-radius: 6px;
  background: var(--raised);
  overflow: hidden;
  margin-top: 18px;
}
.criterion-bar span {
  display: block;
  background: var(--blue);
  height: 100%;
}
.methodology {
  margin-top: 28px;
  padding: 0 3px;
}
.methodology h3 {
  font-size: 15px;
}
.methodology p {
  font-size: 12px;
  line-height: 20px;
  color: var(--muted);
  margin-top: 10px;
}
.intro-note {
  font-size: 13px;
  line-height: 21px;
  margin-bottom: 24px;
}
.empty {
  padding: 32px 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.empty > .icon {
  width: 38px;
  height: 38px;
  color: var(--muted);
}
.empty h2 {
  font-size: 21px;
}
.empty p {
  font-size: 13px;
  line-height: 21px;
  color: var(--muted);
}
.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 13px 20px;
  background: var(--blue);
  color: #fff;
  border-radius: 28px;
  font-weight: 500;
  font-size: 14px;
}
.history-unavailable {
  padding: 30px 0;
}
.mini-volume {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0;
}
.mini-volume strong {
  font-size: 24px;
  font-weight: 400;
}
.fundamentals {
  display: flex;
  gap: 30px;
  margin: 24px 0;
}
.fundamentals > div {
  flex: 1;
}
.fundamentals span {
  color: var(--muted);
  font-size: 12px;
}
.fundamentals strong {
  display: block;
  font-size: 24px;
  font-weight: 400;
  margin-top: 8px;
}
.fundamentals i {
  display: block;
  background: var(--blue);
  opacity: 0.7;
  width: var(--bar);
  height: 4px;
  border-radius: 4px;
  margin-top: 15px;
}
.expiry-heading {
  margin-top: 24px;
}
.expiry-heading .field-label {
  margin: 0;
}
.selector-dates {
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.selector-dates .date {
  flex: 0 0 70px;
}
.selector-results h2 small {
  font-size: 12px;
  margin-left: 3px;
}
.theme-options {
  display: flex;
  gap: 12px;
  margin: 24px 0 30px;
}
.theme-options button {
  flex: 1;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 12px;
  min-height: 140px;
  border-radius: 20px;
  padding: 18px 8px;
  font-size: 13px;
  background: var(--surface);
}
.theme-options button.active {
  box-shadow: inset 0 0 0 2px var(--blue);
}
.theme-options .icon {
  width: 15px;
  height: 15px;
  color: var(--lightblue);
}
.theme-swatch {
  display: block;
  width: 40px;
  height: 60px;
  border-radius: 10px;
  box-shadow: 0 0 0 1px #8884;
}
.theme-swatch.light {
  background: #fff;
}
.theme-swatch.dark {
  background: #141516;
}
.theme-swatch.system {
  background: linear-gradient(90deg, #fff 50%, #141516 50%);
}
.settings-row {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  min-height: 58px;
  font-size: 14px;
}
.settings-row > .icon {
  color: var(--muted);
  width: 18px;
}
.top > h1 {
  font-size: 24px;
}
.calculator-screen {
  position: absolute;
  inset: var(--header-h) 0 calc(var(--bottom-safe) + 65px);
  display: flex;
  flex-direction: column;
  overflow: auto;
  scrollbar-width: none;
}
.calculator-screen .curve-mode {
  flex: 0 0 38px;
  margin: 10px 20px 20px;
}
.calculator-screen .curve-summary {
  flex-shrink: 0;
}
.calculator-screen .chart-date {
  margin: 22px 24px 8px;
  flex-shrink: 0;
}
#curve-plot {
  flex: 1;
  min-height: 180px;
  width: 100%;
  touch-action: none;
  cursor: crosshair;
}
#curve-plot .curve-graph {
  height: 100%;
  width: 100%;
  min-height: 180px;
}
.calculator-screen .price-control {
  flex-shrink: 0;
  padding-top: 14px;
}
.calculator-screen .scenario-info {
  flex-shrink: 0;
  font-size: 10px;
  margin-bottom: 14px;
}
.scenario-info .icon {
  width: 12px;
  height: 12px;
}
.calculator-panel {
  padding: 26px 24px;
  gap: 18px;
}
.calculator-panel input {
  width: 118px;
  font-variant-numeric: tabular-nums;
  font-size: 16px;
}
.curve-summary .pnl {
  font-size: 28px;
}
.price-control strong {
  white-space: nowrap;
}
.curve-foot {
  z-index: 12;
  background: var(--bg);
  padding-top: 8px;
}
.ruler-wrap:before,
.ruler-wrap:after {
  background: linear-gradient(90deg, var(--bg), transparent);
}
.ruler-wrap input:focus-visible {
  outline: 0;
}
.ruler-wrap:focus-within {
  box-shadow: 0 0 0 2px var(--blue);
  border-radius: 8px;
}
/* Modal sheets stay within the iPhone on desktop and the safe viewport on mobile. */
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: #0007;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  backdrop-filter: blur(3px);
}
.sheet {
  width: 100%;
  max-height: calc(100% - var(--status-h) - 12px);
  border-radius: 28px 28px 0 0;
  background: var(--surface);
  padding: 8px 22px max(24px, var(--bottom-safe));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -10px 60px #0002;
}
.sheet-handle {
  height: 4px;
  width: 34px;
  border-radius: 4px;
  background: var(--muted);
  opacity: 0.4;
  margin: 0 auto 12px;
  flex-shrink: 0;
}
.sheet header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-shrink: 0;
}
.sheet h2 {
  font-size: 21px;
}
.sheet header .round {
  background: var(--raised);
  width: 32px;
  height: 32px;
}
.sheet header .icon {
  width: 17px;
}
.sheet-content {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.sheet-content > p {
  font-size: 14px;
  line-height: 23px;
  margin: 0 0 18px;
  color: var(--muted);
}
.sheet-content .primary-button {
  margin-top: 22px;
}
.sheet-content .panel {
  background: var(--raised);
  margin: 20px 0;
}
.sheet-content .panel p {
  font-size: 13px;
  line-height: 21px;
  color: var(--muted);
  margin-top: 10px;
}
.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--raised);
  padding: 12px 14px;
  border-radius: 16px;
  margin-bottom: 10px;
}
.search-field > .icon {
  width: 19px;
  color: var(--muted);
}
.search-field input {
  border: none;
  outline: 0;
  background: none;
  color: var(--ink);
  width: 100%;
  min-width: 0;
  font-size: 16px;
  line-height: 22px;
}
#search-results .asset-row {
  height: 72px;
}
#search-results .asset-value b {
  font-size: 13px;
}
.sort-options {
  display: grid;
  gap: 6px;
}
.sort-options button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 50px;
  font-size: 15px;
  text-align: left;
}
.sort-options .icon {
  color: var(--lightblue);
  width: 18px;
}
.ticket-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 10px 0 24px;
}
.ticket-head span {
  font-size: 16px;
}
.ticket-head small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}
.input-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--muted);
}
.input-row input {
  width: 130px;
  min-width: 0;
  background: var(--raised);
  border: 0;
  border-radius: 14px;
  padding: 12px;
  color: var(--ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ticket-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 25px 0 22px;
  font-size: 14px;
}
.ticket-total strong {
  font-size: 26px;
  font-weight: 400;
}
.info-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--raised);
  border-radius: 18px;
  padding: 16px;
  margin: 18px 0;
}
.info-note > .icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--lightblue);
}
.info-note p {
  font-size: 12px;
  line-height: 19px;
  color: var(--muted);
  margin: 0;
}
.confirmation-symbol {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--raised);
  color: var(--lightblue);
  margin-bottom: 20px;
}
.toast {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: calc(var(--bottom-safe) + 90px);
  z-index: 100;
  background: var(--ink);
  color: var(--bg);
  border-radius: 18px;
  padding: 15px 18px;
  font-size: 13px;
  text-align: center;
  box-shadow: 0 5px 25px #0002;
  pointer-events: none;
}
#app[inert] {
  pointer-events: none;
}
.theme-light .calculator-panel input {
  color: var(--ink);
}
@media (prefers-reduced-motion: no-preference) {
  .sheet {
    animation: sheet-in var(--sheet-duration) var(--ease) both;
  }
  .sheet-backdrop {
    animation: backdrop-in 0.22s ease both;
  }
  .toast {
    animation: toast-in 0.25s var(--ease) both;
  }
  @keyframes sheet-in {
    from {
      transform: translateY(100%);
    }
    to {
      transform: none;
    }
  }
  @keyframes backdrop-in {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
  @keyframes toast-in {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}
@media (max-width: 360px) {
  :root {
    --gutter: 16px;
  }
  .tabs button {
    padding-left: 10px;
    padding-right: 10px;
  }
  .asset-name b {
    font-size: 13px;
  }
  .asset-value b {
    font-size: 13px;
  }
  .asset-name small {
    font-size: 10px;
  }
  .profile {
    padding-left: 4px;
    padding-right: 0;
  }
  .radar {
    width: 154px;
  }
  .top-title {
    font-size: 15px;
  }
  .curve-summary {
    margin-left: 20px;
    margin-right: 20px;
  }
  .curve-summary .pnl {
    font-size: 25px;
  }
}

.stock-plot {
  margin-right: calc(-1 * var(--gutter));
}
.scroll-body {
  overflow-x: hidden;
}
