/* Enerdex dashboard: component precision pass (2026-11-09).
   Every rule below corrects a defect measured against the live baseline (evidence in REPORT.md).
   No colour, type-scale or layout redesign; selectors are scoped to the dashboard shell. */

/* 1. App switcher: restore the designed 52px two-line rows on desktop. A generic 36px menu-item rule had collapsed
      the link rows so title and description filled each row edge to edge, while the current row kept its height. */
@media (min-width: 1024px) {
  body.dashboard-page .enerdex-dashboard .app-switcher .app-switcher-menu .app-switcher-row { min-height: 52px; }
}

/* 2. Expanded table rows: the detail grid inherited `nowrap` from its table cell, so a 64-character hash ran over
      the neighbouring values, and the grid was as wide as the scrolled table instead of the visible region. */
body.dashboard-page .enerdex-dashboard .table-scroll:has(.row-detail) { container-type: inline-size; }
body.dashboard-page .enerdex-dashboard .row-detail-grid {
  position: sticky;
  left: 0;
  box-sizing: border-box;
  width: 100cqw;
  max-width: 100%;
  white-space: normal;
}
body.dashboard-page .enerdex-dashboard .row-detail-grid .detail-list dd { min-width: 0; overflow-wrap: anywhere; }
body.dashboard-page .enerdex-dashboard .row-detail-grid .detail-list .platform-address { white-space: normal; overflow-wrap: anywhere; }

/* 3. Workspace connections: the already shortened receipt hash (12...7) was ellipsised a second time. The label
      gets the 9px it needs without changing the node box that React Flow measures or the shared type scale.
      Compact cards have no spare width, so the hash is tracked 0.35px tighter there (the readability layer pins
      letter-spacing with !important, hence the matching priority). */
body.dashboard-page .enerdex-dashboard .rel-canvas .react-flow__node[data-id^="TX-"] .rel-node strong { width: calc(100% + 24px); margin-inline: -12px; }
body.dashboard-page .enerdex-dashboard .rel-canvas.rel-compact .react-flow__node[data-id^="TX-"] .rel-node strong { width: auto; margin-inline: 0; letter-spacing: -0.35px !important; }

/* 4. Receipt activity statistics: in the four-column layout (1024px) the date range lost its year to an ellipsis.
      It now wraps, as it already does in the two-column phone layout. */
body.dashboard-page .enerdex-dashboard .edx-skyline .grid > .min-w-0 > .truncate { overflow: visible; text-overflow: clip; white-space: normal; }

/* 5. Timeline axis: the "Now" chip (20px) and the tick labels (18px) shared a 34px axis and collided whenever the
      last tick sat under the chip. The axis is 6px taller so both fit with a 2px gap at the shared readability scale. */
body.dashboard-page .enerdex-dashboard .gantt-axis,
body.dashboard-page .enerdex-dashboard .gantt-axis .gantt-track-col { height: 40px; }
body.dashboard-page .enerdex-dashboard .gantt-axis .gantt-past { top: 28px; }

/* 6. Delivery windows at 320px: every contract reference was cut to "EDX-1000-SOLAR..." and became indistinguishable. */
@media (max-width: 340px) {
  body.dashboard-page .enerdex-dashboard .gantt-row { padding-inline: 0; column-gap: 4px; }
}

/* 6b. Delivery windows from 640px up: the 140px label column was 0.41px narrower than an 18-character reference
       at the shared 13px mono size, so every row ended in an ellipsis ("EDX-1000-SOLAR-0..."). */
@media (min-width: 640px) {
  body.dashboard-page .enerdex-dashboard .gantt.is-compact { --label: 148px; }
}

/* 7. Contract toolbar: selects (32px), search (36px) and the view switch (34px, top-aligned) sat on different
      centre lines. The selects match the 36px search field wherever both use desktop metrics (768px and up);
      the view switch joins them at the desktop control height. */
@media (min-width: 768px) {
  body.dashboard-page .enerdex-dashboard .epoch-tools .select-field { height: 36px; }
}
@media (min-width: 1024px) {
  body.dashboard-page .enerdex-dashboard .epoch-tools > .segmented { box-sizing: border-box; height: var(--quality-control); align-items: center; }
  body.dashboard-page .enerdex-dashboard .epoch-tools > .segmented button { height: 32px; min-height: 32px; }
}

/* 8. Contract toolbar on phones: the search field stopped at 280px under two full-width selects. */
@media (max-width: 767px) {
  body.dashboard-page .enerdex-dashboard .table-filters .filter-search { width: 100%; }
}

/* 9. Contract drawer: a record without terms showed an expanded "Terms" heading with nothing under it. */
body.dashboard-page .enerdex-dashboard .drawer-section:has(> .drawer-section-body > .platform-terms:only-child:empty) { display: none; }

/* 10. Tablet and landscape widths (768-1023px): the site header scrolls away there, but the console bar still
       stuck 48px below the top edge, so scrolled content showed through the gap above it. */
@media (min-width: 768px) and (max-width: 1023px) {
  body.dashboard-page .enerdex-dashboard .dashboard-toolbar.console-bar { top: 0; }
}

/* 11. Command palette: the search field fills its clipped header row, so the outer focus ring lost its top edge
       and rendered as a three-sided frame. The same 2px ring is drawn inside the field instead. */
body.dashboard-page .enerdex-dashboard .palette .edx-command-input input:focus-visible { outline-offset: -2px; box-shadow: none; }

/* 12. Explorer: the transactions table needs 946px, but its 8/12 column is only 480-912px wide at every desktop
       width, so "Fee" was cut and "Status" sat partly or wholly off-screen (747px region at 1440px). From 1600px
       the split is 9/3 (table region 962px or more). From 1024px to 1599px the audit trail follows the table, as it
       already does below 1024px. With rule 12b every column is visible from 1024px up. */
@media (min-width: 1024px) and (max-width: 1599px) {
  body.dashboard-page .enerdex-dashboard .explorer-columns > :is(.edx-span-8, .edx-span-4) { grid-column: 1 / -1; }
  body.dashboard-page .enerdex-dashboard .explorer-columns .explorer-audit-scroll { position: static; max-height: 560px; }
}
@media (min-width: 1600px) {
  body.dashboard-page .enerdex-dashboard .explorer-columns > .edx-span-8 { grid-column: span 9; }
  body.dashboard-page .enerdex-dashboard .explorer-columns > .edx-span-4 { grid-column: span 3; }
}

/* 12b. Explorer between 1024px and 1243px: the table region is 728-946px wide and the table still scrolled sideways
        (218px at 1024px). The region now measures itself (container units), so the table follows the space it really
        has instead of the viewport. Region 848-947px: the cell padding shrinks from 16px towards 8px. Region below
        848px: the shortened hash puts its last six characters on a second line (rows are two lines tall already, so
        they keep their height), the "Transaction hash" and "Fee (drops)" titles may wrap, and below 754px the padding
        shrinks further, to 6px at 728px. No column, value or font size changes; from 948px nothing changes at all. */
@media (min-width: 1024px) {
  body.dashboard-page .enerdex-dashboard .explorer-columns .table-scroll { container-type: inline-size; }
  body.dashboard-page .enerdex-dashboard .explorer-columns .platform-table > :is(thead, tbody) > tr:not(.row-detail) > :is(th, td) { padding-left: clamp(8px, calc((100cqw - 744px) / 13), 16px); }
  body.dashboard-page .enerdex-dashboard .explorer-columns .platform-table > :is(thead, tbody) > tr:not(.row-detail) > :is(th, td):not(:first-child) { padding-right: clamp(8px, calc((100cqw - 744px) / 13), 16px); }
  @container (max-width: 847px) {
    body.dashboard-page .enerdex-dashboard .explorer-columns .platform-table { min-width: 0; }
    body.dashboard-page .enerdex-dashboard .explorer-columns .platform-table > :is(thead, tbody) > tr:not(.row-detail) > :is(th, td) { padding-left: clamp(6px, calc((100cqw - 650px) / 13), 8px); }
    body.dashboard-page .enerdex-dashboard .explorer-columns .platform-table > :is(thead, tbody) > tr:not(.row-detail) > :is(th, td):not(:first-child) { padding-right: clamp(6px, calc((100cqw - 650px) / 13), 8px); }
    body.dashboard-page .enerdex-dashboard .explorer-columns .platform-table thead :is(th, .sort-button) { white-space: normal; }
    body.dashboard-page .enerdex-dashboard .explorer-columns .platform-table thead .sort-button { text-align: inherit; }
    body.dashboard-page .enerdex-dashboard .explorer-columns .platform-table .hash-chip > a { display: block; max-width: 11.5ch; white-space: normal; overflow-wrap: anywhere; }
    body.dashboard-page .enerdex-dashboard .explorer-columns .platform-table .hash-chip > a > svg { margin-left: 3px; vertical-align: -2px; }
  }
}

/* 13. Workspace connections toolbar at 768-1023px: a 48px view switch sat beside the 44px search field. The buttons
       are 40px tall so both controls share one height; each button's pointer target extends over the control's 2px
       padding, so it remains 44 x 44px. */
@media (min-width: 768px) and (max-width: 1023px) {
  body.dashboard-page .enerdex-dashboard .rel-toolbar .rel-modes button { position: relative; height: 40px; }
  body.dashboard-page .enerdex-dashboard .rel-toolbar .rel-modes button::after { content: ""; position: absolute; inset: -2px 0; }
}

/* 14. App switcher: the check mark takes 32px of the 300px menu, so only the current row wrapped its description
       (56px beside 52px rows). 24px more width keeps every row on two lines wherever the viewport allows it. */
body.dashboard-page .enerdex-dashboard .app-switcher .app-switcher-menu { width: min(324px, calc(100vw - 16px)); }

/* 14b. Viewports below 340px: the menu cannot reach 324px (304px at 320px), so the current row still wrapped its
        description (56px beside 44px rows). The menu and its rows give up 4px of padding per side and 4px per gap;
        heading and footer follow, so every left edge stays on one line. */
@media (max-width: 339px) {
  body.dashboard-page .enerdex-dashboard .app-switcher .app-switcher-menu { padding-inline: 4px; }
  body.dashboard-page .enerdex-dashboard .app-switcher .app-switcher-menu .app-switcher-row { gap: 8px; padding-inline: 6px; }
  body.dashboard-page .enerdex-dashboard .app-switcher .app-switcher-menu :is(.app-switcher-head, .app-switcher-foot) { padding-inline: 6px; }
}

/* 15. Footer: the third label is hidden when it is empty (the workspace notice was removed on request). */
body.dashboard-page .enerdex-dashboard .workspace-footer > span[hidden] { display: none; }

/* 16. Workspace graph, orbit layout: top and bottom connection points sit on the node edge instead of the icon
       centre, so a spoke does not run through its own node (only the orbit layout uses these two sides). */
body.dashboard-page .enerdex-dashboard .rel-canvas .rel-node .react-flow__handle-top { top: -4px; }
body.dashboard-page .enerdex-dashboard .rel-canvas .rel-node .react-flow__handle-bottom { top: auto; }

/* 17. Settlements: the table needs 1172px but its region is 1128px at 1440px, so the copy-hash control in the last
       column sat off-screen behind a 44px sideways scroll. As in 12b the region measures itself: while it is between
       1068px and 1171px wide the cell padding eases from 16px towards 8px, so every column and control is visible
       (viewports from about 1380px). No column, value or font size changes. From 1172px nothing changes, and a
       narrower region keeps the original padding and its labelled, focusable scroll region. */
@media (min-width: 1024px) {
  body.dashboard-page .enerdex-dashboard .table-scroll:has(> [data-table="settlements"]) { container-type: inline-size; }
  @container (min-width: 1068px) {
    body.dashboard-page .enerdex-dashboard [data-table="settlements"] > :is(thead, tbody) > tr:not(.row-detail) > :is(th, td) { padding-left: clamp(8px, calc((100cqw - 964px) / 13), 16px); }
    body.dashboard-page .enerdex-dashboard [data-table="settlements"] > :is(thead, tbody) > tr:not(.row-detail) > :is(th, td):not(:first-child) { padding-right: clamp(8px, calc((100cqw - 964px) / 13), 16px); }
  }
}

/* 18. Settlements search: the 280px field also holds a submit button, leaving 174px for a 184px placeholder
       ("Contract, hash or accoun"). The field keeps its 280px basis, so the toolbar wraps exactly where it did, and
       takes up to 20px of space that is free on its own line. Phones already use the full width. */
@media (min-width: 768px) {
  body.dashboard-page .enerdex-dashboard .table-filters .filter-search:has(> button[type="submit"]) { flex: 1 1 280px; max-width: 300px; }
}

/* 19. Pointer targets on desktop. Three controls were smaller to press than they look: a column title could only be
       pressed on its 21px text line inside a 43px header cell, the search shortcut hint on 26x20px, and the heat-map
       legend swatches on 11x11px. The pressable area now covers the header cell's height, 38x36px around the hint and
       17x25px per swatch (their 17px spacing allows no more). Nothing moves or changes size on screen. Touch widths
       already give these controls 44px. */
@media (min-width: 1024px) {
  body.dashboard-page .enerdex-dashboard .platform-table thead .sort-button { padding-block: 10px; margin-block: -10px; }
  body.dashboard-page .enerdex-dashboard .search-kbd,
  body.dashboard-page .enerdex-dashboard #enerdex-component-overview button[aria-label^="Highlight "] { position: relative; }
  body.dashboard-page .enerdex-dashboard .search-kbd::after { content: ""; position: absolute; inset: -8px -6px; }
  body.dashboard-page .enerdex-dashboard #enerdex-component-overview button[aria-label^="Highlight "]::after { content: ""; position: absolute; inset: -7px -3px; }
}

/* 20. Touch widths: the column chooser's rows were 34px tall and the site menu button 40px wide on the dashboard
       (44px on every other page). Both now meet the 44px used by the rest of the workspace. */
@media (max-width: 1023px) {
  body.dashboard-page .enerdex-dashboard .edx-column-menu label { min-height: 44px; }
  body.dashboard-page #header.site-header .menu-toggle { width: 44px; min-width: 44px; }
}
