/*
 * HEDGERON Corrective UI Pass v1.0
 * Local fixes only. The approved Desktop Dark Master and identity assets remain locked.
 */

html,body{max-width:100%;overflow-x:clip}
body[data-surface] [hidden]{display:none!important}
body[data-surface="admin"] button:disabled{opacity:.38!important;cursor:not-allowed!important;filter:saturate(.25)!important;box-shadow:none!important}

/* P0.1 — Yield: keep the approved card language, remove the conflicting full-card pseudo overlay. */
body[data-surface="landing"] .product.featured::before{
  content:""!important;
  position:absolute!important;
  inset:5px!important;
  z-index:-1!important;
  border:1px solid rgba(205,236,239,.055)!important;
  border-radius:inherit!important;
  pointer-events:none!important;
  transform:none!important;
  padding:0!important;
  background:radial-gradient(420px 220px at 12% 8%,rgba(34,226,192,.09),transparent 72%),linear-gradient(115deg,rgba(255,255,255,.03),transparent 20% 78%,rgba(34,226,192,.035))!important;
}
body[data-surface="landing"] .verification-ribbon{
  position:absolute;z-index:4;right:-37px;top:23px;display:block;width:154px;padding:6px 0;
  transform:rotate(40deg);background:var(--cp-emerald);color:#03110e;
  text-align:center;font:800 10px/1 var(--cp-display);letter-spacing:.1em;pointer-events:none;
}

/* Every compact account dialog stays inside the mobile viewport. Grid children
 * must be allowed to shrink instead of widening the dialog to min-content. */
body[data-surface="cabinet"] dialog:not(.onboarding-dialog)>form{
  width:100%;min-width:0;max-width:100%;overflow-wrap:anywhere;
}
body[data-surface="cabinet"] dialog:not(.onboarding-dialog) :is(input,select,button,code){min-width:0;max-width:100%}

/* P1.1 — zero capital uses the same legible typography token as populated capital. */
body[data-surface="cabinet"] .capital-value{
  -webkit-text-fill-color:#f0f4f5!important;-webkit-text-stroke:0!important;
  color:#f0f4f5!important;opacity:1!important;filter:none!important;
}

/* P2.1 — secondary replay link remains secondary but readable. */
body[data-surface="landing"] .hero-actions .button.text{color:#a2b1b5!important}

/* Replay canvas interaction and compact empty chart. */
body[data-surface="replay"] .chart-stage canvas{touch-action:pan-y}
body[data-surface="cabinet"] .performance-chart.is-empty{height:230px!important}
body[data-surface="cabinet"] .performance-chart.is-empty .performance-gridlines{height:160px!important}
body[data-surface="cabinet"] .recent-console .trade-list{position:absolute!important;z-index:1;top:62px;right:20px;bottom:66px;left:20px;max-height:none!important;overflow:auto;scroll-padding-bottom:12px}
body[data-surface="cabinet"] .recent-console .journal-button{position:absolute!important;top:auto!important;right:16px!important;bottom:13px!important;left:16px!important;z-index:2}

@media(max-width:767px){
  /* P1.6 — content clears both the fixed navigation and the iPhone home indicator. */
  body[data-surface="cabinet"] .premium-sidebar{
    height:calc(72px + env(safe-area-inset-bottom))!important;
    padding-bottom:env(safe-area-inset-bottom)!important;
  }
  body[data-surface="cabinet"] .command-main{
    padding-bottom:calc(72px + env(safe-area-inset-bottom) + 28px)!important;
  }
  body[data-surface="cabinet"] dialog{
    width:min(440px,calc(100vw - 28px));max-width:calc(100vw - 28px);
    max-height:calc(100dvh - 24px);overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;
  }

  /* P0.5 — mobile ledger rows expose every required field without horizontal scrolling. */
  body[data-surface="replay"] .trade-table-wrap{overflow:visible!important;max-height:none!important}
  body[data-surface="replay"] .trade-table-wrap table,
  body[data-surface="replay"] .trade-table-wrap tbody{display:block;width:100%}
  body[data-surface="replay"] .trade-table-wrap thead{display:none}
  body[data-surface="replay"] .trade-table-wrap tr{
    display:grid;grid-template-columns:1fr 1fr;margin:10px 0;padding:12px;
    border:1px solid var(--line);background:color-mix(in srgb,var(--panel-solid) 72%,transparent);
  }
  body[data-surface="replay"] .trade-table-wrap td{
    display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:6px;
    min-width:0;padding:9px 0;border-top:1px solid var(--line);white-space:normal;
    overflow-wrap:anywhere;text-align:left;font-size:11px;line-height:1.35;
  }
  body[data-surface="replay"] .trade-table-wrap td:nth-child(1),
  body[data-surface="replay"] .trade-table-wrap td:nth-child(2){border-top:0}
  body[data-surface="replay"] .trade-table-wrap td::before{
    content:attr(data-label);color:var(--muted);text-align:left;text-transform:uppercase;
    font-size:10px;line-height:1.2;letter-spacing:.08em;
  }
  body[data-surface="replay"] .trade-table-wrap td:last-child{grid-column:1/-1}

  /* P1.2 / 6 / 7 — content determines mobile height. */
  body[data-surface="cabinet"] .premium-bot-grid .bot-card{
    min-height:unset!important;height:auto!important;padding:26px!important;
  }
  body[data-surface="cabinet"] .settings-card,
  body[data-surface="cabinet"] .membership-card{
    min-height:unset!important;height:auto!important;align-self:start!important;
  }
  body[data-surface="cabinet"] .membership-card{padding-bottom:26px!important}
  body[data-surface="cabinet"] .performance-chart.is-empty{height:220px!important}
  body[data-surface="cabinet"] .performance-chart.is-empty .performance-gridlines{height:150px!important}

  /* P1.4 — two deliberate two-line phrases, never a six-line headline. */
  body[data-surface="landing"] .hero h1{
    max-width:100%!important;font-size:clamp(36px,9.4vw,40px)!important;
    line-height:1.02!important;letter-spacing:-.038em!important;
  }

  /* P1.5 — reduce only excessive mobile transitions between major sections. */
  body[data-surface="landing"] .products{padding-bottom:62px!important}
  body[data-surface="landing"] .shield-section{padding-top:62px!important;padding-bottom:62px!important;gap:34px!important}
  body[data-surface="landing"] .audit{padding-top:56px!important;padding-bottom:18px!important}
  body[data-surface="landing"] #pricing{padding-top:58px!important;padding-bottom:54px!important}
  body[data-surface="landing"] .final-cta{margin-bottom:48px!important}
}

@media(max-width:430px){
  body[data-surface="landing"] .hero{padding-top:48px!important;padding-bottom:54px!important}
  body[data-surface="landing"] .hero-visual{margin-inline:-10px!important;transform:scale(.88)!important}
  body[data-surface="landing"] .product{min-height:0!important;height:auto!important;padding:24px!important}
  body[data-surface="landing"] .big-metric{align-items:flex-start!important;flex-direction:column!important;gap:8px!important}
  body[data-surface="landing"] .big-metric strong{font-size:48px!important;max-width:100%;white-space:nowrap}
  body[data-surface="landing"] .capital{gap:12px}.capital span{min-width:0}.capital b{flex:none}
  body[data-surface="landing"] .verification-ribbon{right:-39px;top:24px}
  body[data-surface="replay"] .chart-legend{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  body[data-surface="replay"] .chart-legend b{grid-column:1/-1;margin-left:0}
  body[data-surface="replay"] .chart-stage{height:240px!important}
  body[data-surface="replay"] .monthly-map{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  body[data-surface="replay"] .month-cell{aspect-ratio:auto;min-height:54px}
}

@media(max-width:375px){
  body[data-surface="landing"] .hero h1{font-size:36px!important}
  body[data-surface="landing"] .hero-actions{display:grid!important;grid-template-columns:1fr!important}
  body[data-surface="landing"] .hero-actions .button{width:100%}
  body[data-surface="landing"] .hero-visual{margin-inline:0!important;transform:scale(.84)!important;transform-origin:center top}
  body[data-surface="replay"] .trade-table-wrap tr{grid-template-columns:1fr}
  body[data-surface="replay"] .trade-table-wrap td:nth-child(2){border-top:1px solid var(--line)}
  body[data-surface="replay"] .trade-table-wrap td:last-child{grid-column:auto}
}

html[data-theme="light"] body[data-surface="cabinet"] .capital-value{
  -webkit-text-fill-color:#142127!important;color:#142127!important;text-shadow:none!important;
}

/* Light mode keeps these controls deliberately dark; their labels must remain foil-bright. */
html[data-theme="light"] body[data-surface="cabinet"] .theme-selector button :is(b,small),
html[data-theme="light"] body[data-surface="cabinet"] .theme-selector button span:not(.theme-preview),
html[data-theme="light"] body[data-surface="cabinet"] .membership-plans .plan-button.secondary :is(span,b){
  color:#dfe8e9!important;
}
html[data-theme="light"] body[data-surface="cabinet"] .membership-plans .plan-button.primary :is(span,b){
  color:#075f53!important;
}

/* Accessible mobile replacement for the desktop landing navigation. */
.mobile-nav{display:none;position:relative;margin-left:auto}.mobile-nav summary{list-style:none;min-width:58px;padding:10px 12px;border:1px solid rgba(75,213,185,.35);border-radius:3px;color:#dfe9e8;background:#041116;font:650 10px Inter,Arial,sans-serif;letter-spacing:.12em;text-transform:uppercase;cursor:pointer}.mobile-nav summary::-webkit-details-marker{display:none}.mobile-nav>div{position:absolute;z-index:30;right:0;top:calc(100% + 10px);min-width:230px;padding:8px;border:1px solid rgba(75,213,185,.38);background:rgba(3,13,17,.98);box-shadow:0 28px 70px #000d}.mobile-nav a{display:block;padding:13px 12px;border-bottom:1px solid rgba(86,123,131,.22);color:#b9c7ca;text-decoration:none;font-size:11px;letter-spacing:.08em;text-transform:uppercase}.mobile-nav a:last-child{border-bottom:0;color:#23e2c0}
@media(max-width:760px){body[data-surface="landing"] .mobile-nav{display:block}body[data-surface="landing"] .nav-shell>.button.ghost{display:none!important}}

/* Gold is reserved for Shield; account identity remains polished silver. */
body[data-surface="cabinet"] .premium-user .user-crest{background:linear-gradient(145deg,#fff,#b9c5ca 42%,#46555b 70%,#edf3f4)!important;color:#071015!important;filter:drop-shadow(0 0 9px rgba(210,224,228,.22))!important}
body[data-surface="paper"] #paperChartSummary{margin:8px 0 0;color:var(--muted);font-size:10px;line-height:1.45;letter-spacing:.025em}

/* Administrative evidence IDs stay compact, but never drop below the 10 px release gate. */
.admin-shell small{font-size:10px!important;line-height:1.35!important;overflow-wrap:anywhere}
html[data-theme="light"] .admin-shell .metric-card strong{color:#142127!important;text-shadow:none!important}
html[data-theme="light"] .admin-shell .alert-row{background:linear-gradient(145deg,#fbfcfb,#e7eeeb)!important;border-color:rgba(61,91,94,.28)!important;color:#142127!important}
html[data-theme="light"] .admin-shell .alert-row :is(strong,span){color:#23373d!important}
html[data-theme="light"] .admin-shell .alert-row small{color:#5d7278!important}
html[data-theme="light"] .admin-shell .alert-row.warning>strong{color:#795a10!important}
html[data-theme="light"] .admin-shell .alert-row.critical>strong{color:#b23831!important}

/* Acceptance v2: legible command labels and a dedicated Membership destination. */
body[data-surface="cabinet"] :is(.console-label,.view-kpi-strip span,.premium-bot-grid .bot-state,.premium-bot-grid h3 small,.premium-bot-grid .bot-card dt,.performance-summary dt,.activity-grid .activity-title span,.journal-filters button,.journal-head,.protection-ready,.sentinel-command dt,.shield-command dt,.sentinel-command dd,.shield-command dd,.settings-card .calculator label,.membership-plans span){font-size:max(10px,.625rem)!important;line-height:1.35!important}
body[data-surface="cabinet"] :is(#systemLabel,.system-state small,.command-header small,.selected-engine small,.subscription-state,.command-main>footer,.command-main>footer span){font-size:10px!important;line-height:1.35!important}
.membership-route-layout{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(300px,.7fr);gap:10px;margin-top:10px}
.membership-route-layout>.console-panel{min-height:560px;padding:34px!important}
.membership-assurance h2{max-width:520px;margin:22px 0 16px;font-size:29px;line-height:1.08;letter-spacing:.02em}
.membership-assurance ul{display:grid;gap:0;margin:34px 0;padding:0;list-style:none;border-top:1px solid var(--console-line-soft)}
.membership-assurance li{padding:17px 0;border-bottom:1px solid var(--console-line-soft);color:var(--console-muted);font-size:12px;letter-spacing:.035em}
.membership-assurance li:before{content:"✓";margin-right:11px;color:var(--console-emerald)}
.membership-action{display:flex!important;align-items:center;justify-content:center;min-height:48px;margin-top:28px;text-decoration:none!important;font-size:10px;letter-spacing:.13em}

@media(max-width:760px){
  .membership-route-layout{grid-template-columns:1fr}
  .membership-route-layout>.console-panel{min-height:0;padding:24px!important}
  body[data-surface="cabinet"] .premium-sidebar nav{grid-template-columns:repeat(5,1fr)!important}
  body[data-surface="cabinet"] .premium-sidebar nav>.nav-link,
  body[data-surface="cabinet"] .premium-sidebar .mobile-command-menu>summary{
    min-width:44px!important;
    min-height:44px!important;
    height:100%!important;
    align-self:stretch!important;
    padding:8px 4px!important;
  }
  body[data-surface="cabinet"] .premium-sidebar .nav-link:nth-child(5),
  body[data-surface="cabinet"] .premium-sidebar .nav-link:nth-child(6){display:flex!important}
  body[data-surface="cabinet"] .premium-sidebar .nav-link.replay-link,
  body[data-surface="cabinet"] .premium-sidebar .nav-link.settings-link{display:none!important}
}

/* WCAG 2.5.8: compact text actions still provide a reliable pointer target. */
body[data-surface="cabinet"] .recent-console header>a{
  display:inline-flex;
  min-width:24px;
  min-height:24px;
  align-items:center;
  justify-content:center;
}
