/* Dalla Edge Props — visual system v1.0
   Cross-module alignment for desktop, tablet and installed PWA. */

:root{
  --content-max:1600px;
  --surface-radius:16px;
  --control-height:42px;
  --section-gap:24px;
}

html{scroll-padding-bottom:112px}
body{line-height:1.45}
button,a,input,select,textarea{touch-action:manipulation}
:where(button,a,input,select,textarea,summary):focus-visible{
  outline:2px solid var(--brand-gold-highlight,#e4c179);
  outline-offset:2px;
}

/* Keep very wide displays readable instead of stretching cards edge to edge. */
.main>.topbar,
.main>[data-view]{
  width:min(100%,var(--content-max));
  margin-inline:auto;
}
.main>[data-view]{padding-bottom:12px}
.overview-heading{margin-block:4px 16px}
.overview-heading h2,.section-heading h3{letter-spacing:-.015em}
.overview-heading p,.section-heading p,.downloads-intro p{max-width:72ch}

/* Shared controls and surfaces. */
.btn{min-height:var(--control-height);display:inline-flex;align-items:center;justify-content:center;line-height:1.2}
.icon-btn{display:inline-grid;place-items:center;flex:0 0 auto}
:where(input,select,textarea){min-height:var(--control-height)}
textarea{line-height:1.5}
:where(.card,.account-card,.challenge-card,.report-account,.payout-rule-card,.security-card,.system-health){
  border-radius:var(--surface-radius);
}
.metrics,.accounts-grid,.analytics-grid,.profile-grid,.report-accounts-grid{gap:12px}
.metric{min-height:122px;padding:16px}
.metric small{line-height:1.45}
.account-info strong,.insight-row strong{font-variant-numeric:tabular-nums}
.data-table-wrap{scrollbar-width:thin;scrollbar-color:#42576b transparent}
.data-table th{z-index:2}

/* Account and challenge cards: primary state first, secondary metadata after it. */
.account-card{padding:17px}
.account-balance{margin:16px 0 13px}
.account-info-grid{gap:8px 14px}
.risk-block{margin-top:15px;padding-top:13px}
.payout-eligibility{margin-top:14px}
.record-actions{gap:8px;margin-top:13px;padding-top:12px}
.record-actions .btn{padding:9px 11px}
.challenge-consistency{margin:10px 0;padding:12px}

/* Long forms and dialogs retain their heading/actions while the body scrolls. */
.record-dialog,.observer-modal-panel,.edge-journal-modal-panel{overscroll-behavior:contain}
.record-fields{align-items:start}
.record-fields .field{min-width:0}
.record-fields label{line-height:1.35}
.record-copy-source,.account-cycle-reset{padding:14px}
.dashboard-dialog{max-height:min(88dvh,720px);overflow:auto}

/* Observer: operational connections remain prominent; setup tools remain compact. */
[data-view="observer"] .observer-safety-line{margin-bottom:12px}
[data-view="observer"] .observer-summary{gap:10px;margin-bottom:18px}
[data-view="observer"] .observer-mini{min-height:92px;padding:14px}
[data-view="observer"] .observer-section{margin-top:18px}
[data-view="observer"] .observer-card{min-height:0}
[data-view="observer"] .observer-info{margin-top:15px;padding-top:13px}
[data-view="observer"] .observer-disclosure>summary{min-height:58px}
[data-view="observer"] .observer-tools{margin-top:14px}

/* Downloads: remove dead space and make release metadata scan faster. */
[data-view="downloads"] .downloads-intro{margin-bottom:20px}
[data-view="downloads"] .dc-index{margin-bottom:44px}
[data-view="downloads"] .dc-group{padding-bottom:52px}
[data-view="downloads"] .dc-group-head{margin-bottom:18px}
[data-view="downloads"] .dc-app{min-height:210px;padding:21px}
[data-view="downloads"] .dc-app-copy{margin:15px 0}
[data-view="downloads"] .dc-tool{padding:20px}
[data-view="downloads"] .dc-release{gap:7px}
[data-view="downloads"] .dc-release div{padding:7px 9px}
[data-view="downloads"] .dc-roadmap article{min-height:82px}

/* Operations workspaces use the same compact control rhythm. */
.trade-workspace-tabs{gap:7px;margin:12px 0 15px}
.trade-workspace-tabs button{min-height:38px}
.edge-journal-kpis,.behavioral-kpis,.calendar-kpis{gap:9px}
.edge-journal-card{min-width:0}
.edge-journal-notes-grid textarea{min-height:112px}
.trading-calendar{box-shadow:none}
.calendar-day{transition:background-color .15s ease,box-shadow .15s ease}

/* Notifications must never hide a modal title. */
.dashboard-toasts{z-index:900}
.record-modal,.observer-modal,.edge-journal-modal{z-index:1000}

@media screen and (min-width:821px){
  .sidebar{width:240px}
  .sidebar nav button{min-height:42px}
  .main{padding:26px clamp(22px,2.2vw,34px)}
  .topbar{margin-bottom:22px}
  .accounts-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  [data-view="downloads"] .dc-apps{grid-template-columns:repeat(3,minmax(0,1fr))}
}

@media screen and (max-width:820px){
  :root{--section-gap:20px;--control-height:44px}
  html{scroll-padding-bottom:126px}
  .main{
    padding-top:calc(14px + env(safe-area-inset-top));
    padding-inline:12px;
    padding-bottom:calc(122px + env(safe-area-inset-bottom));
  }
  .main>[data-view]{padding-bottom:18px}
  .topbar{margin-bottom:19px}
  .topbar h1{font-size:clamp(21px,6vw,24px)}
  .overview-heading{margin-bottom:14px}
  .overview-heading h2{font-size:17px}
  .overview-heading>.heading-actions{gap:8px}
  .heading-actions .btn{min-height:44px}
  .metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  .metric{min-height:108px;padding:13px}
  .metric strong{font-size:clamp(19px,5.7vw,24px)}
  .metric small{padding-top:9px}
  .card,.account-card{border-radius:15px}
  .account-card{padding:14px}
  .account-balance{margin:14px 0 12px}
  .account-info{min-height:22px}
  .risk-block{margin-top:13px;padding-top:12px}
  .record-actions .btn{min-height:44px}

  /* The bottom bar stays reachable without covering the final controls. */
  .mobile-nav{
    left:50%;right:auto;bottom:calc(8px + env(safe-area-inset-bottom));
    width:min(calc(100vw - 16px),520px);
    transform:translateX(-50%);
    grid-auto-columns:78px;
    min-height:64px;
    padding:5px;
    background:rgba(8,19,30,.985);
    border-color:#2a4054;
    box-shadow:0 12px 38px rgba(0,0,0,.56);
  }
  .mobile-nav button{min-height:52px;padding:5px 4px}
  .mobile-nav button b{font-size:9px;line-height:1.1}
  .mobile-nav button [data-icon] svg{width:17px;height:17px}

  /* Feedback appears above navigation and below modal titles. */
  .dashboard-toasts{
    top:auto;right:12px;bottom:calc(82px + env(safe-area-inset-bottom));left:12px;
    width:auto;max-height:28vh;
  }
  .dashboard-toast{border-radius:11px}
  .modal-open .dashboard-toasts{bottom:calc(86px + env(safe-area-inset-bottom))}

  /* Dialogs behave as bottom sheets, with one stable header and action row. */
  .record-modal,.observer-modal,.edge-journal-modal{align-items:end;padding:0}
  .record-dialog,.observer-modal-panel,.edge-journal-modal-panel{
    width:100%;max-width:none;max-height:94dvh;
    border-right:0;border-bottom:0;border-left:0;
    border-radius:22px 22px 0 0;
  }
  .record-modal-head{top:-17px}
  .record-form-actions{gap:8px}

  /* Observer summary remains a single, compact row on phones. */
  [data-view="observer"] .observer-safety-line{display:grid;grid-template-columns:auto 1fr;align-items:start;gap:7px}
  [data-view="observer"] .observer-summary{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
  [data-view="observer"] .observer-mini{min-height:84px;padding:11px}
  [data-view="observer"] .observer-mini span{font-size:9px;line-height:1.25}
  [data-view="observer"] .observer-mini strong{font-size:22px}
  [data-view="observer"] .observer-section-head{margin-bottom:10px}
  [data-view="observer"] .observer-disclosure-copy small{white-space:normal}

  /* Downloads keeps useful release data in two columns on mobile. */
  [data-view="downloads"] .dc-index{margin-bottom:34px}
  [data-view="downloads"] .dc-group{padding-bottom:42px}
  [data-view="downloads"] .dc-app{padding:17px}
  [data-view="downloads"] .dc-tool{padding:16px}
  [data-view="downloads"] .dc-release{grid-template-columns:repeat(2,minmax(0,1fr))}
  [data-view="downloads"] .dc-release .dc-requirements,
  [data-view="downloads"] .dc-release .dc-checksum{grid-column:1/-1}
  [data-view="downloads"] .dc-roadmap article{padding:14px 16px}

  /* Calendar stays fully visible; empty-day metadata is visually secondary. */
  .trading-calendar{padding:10px}
  .calendar-kpis article{min-height:58px}
  .calendar-day{min-height:84px}
  .calendar-day>small{opacity:.72}
  .calendar-day.outside{opacity:.25}
  .calendar-day-detail{margin-top:10px}

  .filters-bar,.analytics-controls{gap:8px}
  .behavioral-controls{gap:8px}
  .profile-grid,.report-accounts-grid{gap:10px}
}

@media screen and (max-width:430px){
  .main{padding-inline:10px}
  .metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
  .metric{min-height:104px}
  .mobile-nav{grid-auto-columns:76px}
  .top-actions{gap:5px}
  .icon-btn,.top-actions .btn{width:36px;height:36px;min-height:36px}
  .record-form-actions .btn{min-width:0;padding-inline:10px}
  [data-view="downloads"] .dc-app-heading,
  [data-view="downloads"] .dc-tool-heading{gap:7px}
  [data-view="downloads"] .dc-status{max-width:112px}
}

@media screen and (max-width:350px){
  .metrics{grid-template-columns:1fr}
  [data-view="observer"] .observer-summary{grid-template-columns:repeat(3,minmax(0,1fr))}
  [data-view="observer"] .observer-mini{padding:9px}
}

@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}
}

/* V1.1 — desktop typography and content alignment
   Text roles use a readable scale instead of inheriting isolated 9–11px values. */
@media screen and (min-width:821px){
  :root{
    --copy-xs:11px;
    --copy-sm:12px;
    --copy-md:13px;
    --copy-lg:14px;
  }

  .main>[data-view]{font-size:var(--copy-lg)}
  .sidebar nav button{font-size:14px;line-height:1.25}
  .topbar .eyebrow{font-size:12px}
  .overview-heading h2{font-size:20px}
  .overview-heading p,.overview-status,.section-heading p{font-size:var(--copy-md)}
  .readonly-badge,.editable-badge{font-size:10px}

  .metric>span{font-size:var(--copy-sm);line-height:1.35}
  .metric small{font-size:var(--copy-sm)}
  .recent-section h3,.performance-head h3{font-size:17px}
  .trade-meta strong,.trade-row>strong{font-size:var(--copy-md)}
  .trade-meta span,.performance-head p{font-size:var(--copy-sm)}

  .account-head h3{font-size:17px;line-height:1.25}
  .account-head p,.account-balance span{font-size:var(--copy-sm);line-height:1.45}
  .account-info{font-size:var(--copy-sm);line-height:1.45}
  .account-info strong{font-size:12.5px}
  .risk-evidence small,.account-cycle-note,.challenge-stage-targets{font-size:var(--copy-sm)!important}
  .payout-state,.props-quality-badge{font-size:var(--copy-xs)}
  .payout-rule-card>strong,.payout-eligibility-head strong{font-size:16px}
  .payout-eligibility-head small{font-size:var(--copy-sm)}
  .payout-criterion strong{font-size:12.5px}
  .payout-criterion small{font-size:11.5px;line-height:1.45}
  .payout-eligibility-meta .account-info{font-size:var(--copy-sm)}
  .challenge-rule-box small,.challenge-consistency small,.challenge-consistency-help{font-size:var(--copy-sm)}
  .challenge-rule-badge{font-size:11px}

  .btn,.filters-bar :where(input,select,button),.analytics-controls select{font-size:var(--copy-md)}
  .field label,.record-fields label{font-size:var(--copy-sm)}
  .data-table th{font-size:11px}
  .data-table td{font-size:var(--copy-md);line-height:1.45}

  .system-banner{min-height:48px;padding:10px 15px;font-size:var(--copy-md);line-height:1.4}
  .system-banner .link-btn{font-size:var(--copy-sm)}

  /* Account tools share one compact control row and no artificial empty area. */
  .props-health-disclosure[open]{min-height:0}
  .props-health-summary{min-height:72px;padding:15px 18px}
  .props-health-summary-copy strong{font-size:16px;line-height:1.3}
  .props-health-summary-copy small{font-size:var(--copy-sm);line-height:1.5}
  .props-health-body{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:0 16px;
    padding:0 18px 18px;
  }
  .props-health-body .props-health-head{
    grid-column:2;
    grid-row:1;
    padding-top:14px;
  }
  .props-health-body .props-health-tabs{
    grid-column:1;
    grid-row:1;
    margin:14px 0;
  }
  .props-health-body>.props-health-grid,
  .props-health-body>p,
  .props-health-body>.message{grid-column:1/-1}
  .props-health-body>p{margin:2px 0 0;font-size:var(--copy-md);line-height:1.5}
  .props-health-head select{min-width:230px;font-size:var(--copy-md)}
  .props-health-tabs .btn{font-size:var(--copy-md)}
  .props-health-card h4{font-size:15px}
  .props-health-metric,.props-health-comparison{font-size:var(--copy-sm)}
  .props-health-metric strong{font-size:var(--copy-md)}

  [data-view="observer"] :where(.observer-title p,.observer-status-card p,.observer-section-head p,.observer-boundary p){font-size:var(--copy-sm)}
  [data-view="observer"] .observer-disclosure-copy strong{font-size:var(--copy-lg)}
  [data-view="observer"] .observer-disclosure-copy small{font-size:var(--copy-xs);line-height:1.45}
  [data-view="observer"] .observer-platform-row strong{font-size:var(--copy-sm)}
  [data-view="observer"] .observer-platform-row small{font-size:var(--copy-xs)}

  [data-view="downloads"] :where(.dc-app p,.dc-tool p,.dc-roadmap p,.dc-group-head p){font-size:var(--copy-md)}
  [data-view="downloads"] .dc-note{font-size:var(--copy-xs)!important}
  [data-view="downloads"] .dc-release dd{font-size:var(--copy-xs)}

  .trade-workspace-tabs button,.calendar-filters button{font-size:var(--copy-sm)}
  .calendar-weekday,.calendar-day>small{font-size:var(--copy-xs)}
  .calendar-day>strong{font-size:14px}
  .calendar-kpis span{font-size:var(--copy-xs)}
  .calendar-detail-list article>div:first-child span{font-size:var(--copy-sm)}
  .behavioral-kpi span,.edge-journal-kpi span{font-size:var(--copy-xs)}
  .behavioral-row,.insight-row{font-size:var(--copy-sm)}
  .report-header p,.report-account p{font-size:var(--copy-sm)}
}

@media screen and (max-width:820px){
  .props-health-body{display:block}
  .props-health-body>p{margin:12px 0 0}
}
