/* Page gutter, card radius, type scale — one language for Lite, Pro phone, Pro wide. */

@media (max-width: 760px) {
  :root {
    --ui-page-gutter: var(--ui-gutter);
  }
}

.ecosystem-card,
.rcard,
.collap,
.card,
.fin-card,
.dash-sec,
.dash-usdt,
.dash-now,
.dash-cash-link,
.ui-surface,
.rf-row-compact,
.rf-card-edit,
.dc-card,
#hdr,
#deals-command-bar,
#deal-bar,
#led-sheets,
#led-balances,
#led-filters,
#led-sheet-chrome,
#ref-kinds,
#ref-context,
#grid-wrap {
  border-radius: var(--ui-card-radius);
}

.lh-bal-value,
.lh-cur-tile.usdt .lh-cur-v,
.dash-usdt-value {
  font-size: var(--ui-hero-size);
  letter-spacing: -.02em;
}

#dash.dash-home-fit .dash-usdt-value {
  font-size: clamp(28px, 8vw, var(--ui-hero-size));
}

.workspace-empty,
.ref-empty-state,
.fin-empty,
.admin-state {
  border-style: solid;
  color: var(--ui-muted-strong, var(--tg-theme-hint-color, #6d7582));
}

.workspace-empty-icon,
.ref-empty-icon {
  opacity: .42;
}

.workspace-empty-icon:has(.search-glyph),
.ref-empty-icon:has(.search-glyph) {
  width: auto; height: auto; min-width: 1em; min-height: 1em;
  padding: 0; background: transparent; opacity: 1;
}

.plus-glyph,
.new-btn-ico,
.ui-action-icon.plus-glyph,
.lh-tile .ico {
  color: inherit;
  -webkit-text-fill-color: inherit;
  font-weight: 700;
  line-height: 1;
}

.personal-cabinet #pt-add {
  color: var(--ui-on-pos, #111);
  background: var(--pos, #1a8d3e);
  border-color: color-mix(in srgb, var(--pos, #1a8d3e) 70%, #04120a);
  font-size: 16px;
}

body[data-cabinet-nav="personal"] #tabs .tab .ti { display: none; }

@media (max-width: 760px) {
  body.lite #deals-cards.cards:not(.registry-mode),
  body.lite #deals-cards.list:not(.registry-mode) {
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-card-radius);
    background: var(--ui-surface-raised);
    overflow: hidden;
  }

  body.lite #deals-cards.cards:not(.registry-mode) .dcard,
  body.lite #deals-cards.list:not(.registry-mode) .dcard {
    margin: 0;
    border: 0;
    border-bottom: 1px solid var(--ui-border);
    border-radius: 0;
    box-shadow: none;
  }

  body.lite #deals-cards .dcard:last-of-type {
    border-bottom: 0;
  }

  body.lite #refs-list.refs-view-compact:has(.rf-row-compact) {
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-card-radius);
    overflow: hidden;
    background: var(--ui-surface-raised);
  }

  body.lite #refs-list.refs-view-compact .rf-row-compact {
    margin: 0;
    border: 0;
    border-bottom: 1px solid var(--ui-border);
    border-radius: 0;
    box-shadow: none;
  }

  body.lite #refs-list.refs-view-compact .rf-row-compact:last-of-type {
    border-bottom: 0;
  }
}

html[data-theme="dark"] {
  --ui-surface: color-mix(in srgb, var(--tg-theme-bg-color, #0e141b) 70%, #07090c);
  --ui-surface-raised: color-mix(
    in srgb, var(--tg-theme-secondary-bg-color, #1c2733) 78%, #0a0c10
  );
}

html[data-theme="dark"] body {
  background: var(--ui-surface);
}

#led-sheets .rk,
.led-focus-tabs .rk,
.cash-tasks-view-toggle .rk,
.cash-create-btn,
.pf-cab-view-toggle .rk,
.lh-actions .rk,
#new-btn,
.led-top-actions .rk,
.led-recon-btn,
.fin-cap-act {
  min-height: var(--ui-control-h);
  padding: 0 var(--ui-space-3);
  border-radius: var(--ui-radius-sm);
  font-size: 14px;
  font-weight: 650;
}

.cash-create-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
  color: #fff;
  background: var(--pos, #1a8d3e);
  border: none;
  border-color: color-mix(in srgb, var(--pos, #1a8d3e) 70%, #04120a);
}
html[data-theme="dark"] .cash-create-btn {
  color: var(--ui-on-pos, #111);
}

.dash-new-deal,
#new-btn,
#ca-newdeal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--ui-on-accent, #fff);
  background: var(--ui-accent-solid, var(--tg-theme-button-color, #3390ec));
  border: none;
}

/* Phone Now: full-width CTA. Do not gate on dash-home-fit — Lite never gets that class. */
body.lite #dash .dash-new-deal,
html.tg-phone #dash .dash-new-deal,
#dash.dash-home-fit .dash-new-deal {
  display: flex;
  width: 100%;
  box-sizing: border-box;
}
body.lite #dash .dash-shift-footer,
body.lite #dash .dash-shift-footer-main,
html.tg-phone #dash .dash-shift-footer,
html.tg-phone #dash .dash-shift-footer-main {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
}
@media (max-width: 700px) {
  #dash .dash-shift-footer,
  #dash .dash-shift-footer-main {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
  #dash .dash-new-deal {
    display: flex;
    width: 100%;
    box-sizing: border-box;
  }
}

.led-sep {
  display: none;
}

.dash-onboard-card,
.dash-now,
.dash-usdt,
.dash-estimate,
.dash-cash-link {
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-card-radius);
  background: var(--ui-surface-raised);
  box-shadow: var(--ui-shadow);
  padding: 12px 16px;
}
.dash-onboard-card {
  overflow: visible;
}
#dash.dash-home-fit {
  gap: 12px;
  padding-top: 10px;
}
#dash.dash-home-fit .dash-onboard-card {
  overflow: visible;
}
.dash-onboard-hide {
  background: transparent;
  box-shadow: none;
  border: none;
}

#deal-bar {
  padding: 10px 12px;
}
@media (min-width: 761px) {
  #deal-bar.deal-bar-row {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 12px;
  }
}
#f-seg,
.deal-pres {
  flex-wrap: wrap;
  overflow: visible;
  padding: 4px;
  border-radius: var(--ui-radius-sm);
  background: var(--ui-surface-muted);
}

.led-focus-tabs,
.led-grps,
.led-shs {
  flex-wrap: wrap;
  overflow: visible;
}
.led-focus-tabs {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.led-shs:empty {
  display: none;
}
.led-focus-tabs .led-shs {
  margin-left: 0;
  padding-left: 0;
  border-left: 0;
}
.led-network-cards {
  grid-column: 1 / -1;
}
.led-network-card {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.led-network-card .rq-acts-wrap,
.led-network-card .ui-actions {
  justify-content: flex-start;
}
.led-shift-cards,
.fin-cap-list,
.cash-balance-cards,
.dash-sec-cards {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.led-shift-cards .shift-intro,
.led-shift-cards .shift-onchain-row,
.led-shift-cards .shift-close-bar {
  display: grid;
  gap: 10px;
}
.led-shift-cards .sc-cnt,
.fin-cap-asset-row {
  min-width: 0;
}
.dash-kv-card {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
}
#dash .dash-usdt .rk.dash-usdt-hero,
#dash .dash-usdt .rk.dash-usdt-row {
  background: transparent;
  box-shadow: none;
}

@media (min-width: 761px) {
  body.pro:not(.focus-workspace) #led-sheets .rk {
    min-height: 36px;
    font-size: 13px;
  }
}

html[data-theme="dark"] :where(
  .rcard, .collap, .card, .fin-card, .dash-sec, .dash-usdt, .dash-now,
  .dash-estimate, .dash-cash-link, .ecosystem-card
) {
  background: var(--ui-surface-raised) !important;
}

/* Native OS carets sit on the trailing border. Draw one inset chevron instead. */
select:not([multiple]) {
  appearance: none;
  -webkit-appearance: none;
  padding-inline-end: var(--ui-select-pad-end) !important;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5 L6 6.5 L11 1.5' stroke='%2368717d' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: right var(--ui-select-caret-inset) center !important;
  background-size: 12px 8px !important;
}
html[data-theme="dark"] select:not([multiple]) {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5 L6 6.5 L11 1.5' stroke='%23c5cdd6' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>") !important;
}
select.cm.pager-size {
  min-width: 64px;
  max-width: 72px;
}
#grid td select,
.mini td select {
  appearance: auto;
  -webkit-appearance: menulist;
  padding-inline-end: 0 !important;
  background-image: none !important;
}
