/***********************************************************************************
 * stfwHdl.css - Fusion HDL Setups (stfwHdl.js). Builds on stfwFbdi.css (fb-* / ex-*).
 ***********************************************************************************/
.hd-small { font-size: 12px; }
.hd-irow { display: grid; grid-template-columns: minmax(200px, 1.3fr) 210px 150px 90px 110px 100px minmax(190px, auto);
  align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--ob-line); font-size: 13.5px; min-width: 1050px; }
.hd-irow:last-child { border-bottom: 0; }
.hd-irow.fb-th { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ob-muted); background: var(--ob-head); padding-top: 8px; padding-bottom: 8px; }
.hd-inst-body { overflow-x: auto; }
.hd-acts { display: flex; gap: 6px; justify-content: flex-end; }

/* Stepper: 7 nodes (6 phases + result) */
.hd-stepper { grid-template-columns: repeat(7, minmax(0, 1fr)); }
@media (max-width: 760px) { .hd-stepper { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Browse */
.hd-grid-browse { grid-template-columns: 320px 200px; }
@media (max-width: 640px) { .hd-grid-browse { grid-template-columns: 1fr; } }
/* Shadow table names (component detail) */
.hd-shadow { padding: 10px 16px; border-bottom: 1px solid var(--ob-line); font-size: 13px; }
.hd-shadow:empty { display: none; }
.hd-shadow-cur { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.hd-tname { user-select: all; }
.hd-shadow .hd-err { color: var(--ob-err, #b42318); }
.hd-shadow-list { margin-top: 8px; display: grid; gap: 2px; max-height: 180px; overflow: auto; }
.hd-shadow-row { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 12px; padding: 4px 8px; border-radius: 6px; font-size: 12.5px; }
.hd-shadow-row.fb-sel { background: var(--ob-info-bg); }
.hd-shadow-row.hd-click { cursor: pointer; }
.hd-shadow-row.hd-click:hover { background: var(--ob-hover); }
.hd-shadow-row:focus-visible { outline: none; box-shadow: inset var(--ob-ring); }
.hd-shadow-ctx { color: var(--ob-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-crumbs { margin-top: 10px; font-size: 13px; }
.hd-crumbs:empty { display: none; }
.hd-browse { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
@media (max-width: 1000px) { .hd-browse { grid-template-columns: 1fr; } }
.hd-obj-filter { padding: 8px 12px; border-bottom: 1px solid var(--ob-line); }
.hd-obj-filter input { width: 100%; box-sizing: border-box; }
/* Object tree: objects with their components as children */
.hd-obj-list { max-height: max(460px, calc(100vh - 300px)); overflow: auto; }
.hd-objects { position: sticky; top: 12px; }
.hd-obj { display: flex; gap: 6px; align-items: baseline; padding: 8px 12px 8px 8px; border-bottom: 1px solid var(--ob-line); cursor: pointer; font-size: 13px; }
.hd-obj.hd-on-path { font-weight: 600; }
.hd-caret { flex: none; width: 18px; text-align: center; color: var(--ob-muted); border-radius: 4px; font-size: 12px; }
.hd-caret:hover { background: var(--ob-line); color: var(--ob-ink); }
.hd-obj .hd-count, .hd-comp .hd-count { margin-left: auto; padding-left: 8px; white-space: nowrap; }
.hd-comp { display: flex; gap: 8px; align-items: baseline; padding-top: 6px; padding-bottom: 6px; padding-right: 12px;
  border-bottom: 1px solid var(--ob-line); cursor: pointer; font-size: 12.5px; background: var(--ob-surface); }
.hd-comp .fb-mono { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-comp-msg { padding: 6px 12px 6px 34px; border-bottom: 1px solid var(--ob-line); font-size: 12.5px; }
.hd-comp-msg.hd-err { color: var(--ob-err, #b42318); }
.hd-obj:hover, .hd-comp:hover { background: var(--ob-hover); }
.hd-obj.fb-sel, .hd-comp.fb-sel { background: var(--ob-info-bg); }
.hd-obj:focus-visible, .hd-comp:focus-visible { outline: none; box-shadow: inset var(--ob-ring); }
.hd-ord { flex: none; min-width: 20px; text-align: right; color: var(--ob-muted); font-size: 11px; }
/* Component detail (right) */
.hd-detail { min-width: 0; }
.hd-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 10px 16px; border-bottom: 1px solid var(--ob-line); font-size: 13px; }
.hd-meta > div { display: flex; gap: 6px; align-items: baseline; }
.hd-ctx { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--ob-line); font-size: 13px; }
.hd-ctx-label { font-weight: 600; display: flex; gap: 6px; align-items: baseline; }
.hd-ctx-sel { min-width: 240px; max-width: 420px; }
.hd-ctx-btn { border: 1px solid var(--ob-line-strong); background: var(--ob-surface); color: var(--ob-ink-2); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; cursor: pointer; }
.hd-ctx-btn:hover { background: var(--ob-hover); }
.hd-ctx-btn.fb-on { background: var(--ob-brand); border-color: var(--ob-brand); color: #fff; }
.hd-ctx-btn.fb-on .ex-muted { color: rgba(255,255,255,.8); }
/* Fields grid: widths come from --hd-fcols / --hd-fmin (set by applyFieldWidths) */
.hd-frow { display: grid; grid-template-columns: var(--hd-fcols, 56px 320px 116px 100px 80px 104px 130px minmax(220px, 1fr));
  align-items: center; min-height: 36px; border-bottom: 1px solid var(--ob-line); font-size: 13px; min-width: var(--hd-fmin, 1126px); }
.hd-ftools { display: flex; gap: 10px; align-items: center; padding: 8px 16px; border-bottom: 1px solid var(--ob-line); }
.hd-fsearch { width: 280px; max-width: 100%; box-sizing: border-box; }
.hd-frow.fb-th { position: sticky; top: 0; z-index: 2; }
.hd-fth { position: relative; display: flex; align-items: center; gap: 4px; cursor: pointer; user-select: none; align-self: stretch; }
.hd-fth:hover { color: var(--ob-ink); }
.hd-fth:focus-visible { outline: none; box-shadow: inset var(--ob-ring); }
.hd-fth.hd-sorted { color: var(--ob-brand); }
.hd-fth-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-sort-ind { font-size: 9px; }
.hd-col-grip { position: absolute; top: 0; right: 0; bottom: 0; width: 8px; cursor: col-resize; touch-action: none; }
.hd-col-grip::after { content: ""; position: absolute; top: 25%; bottom: 25%; right: 3px; width: 2px; border-radius: 1px; background: var(--ob-line-strong); }
.hd-col-grip:hover::after, .hd-resizing .hd-col-grip::after { background: var(--ob-brand); }
.hd-resizing, .hd-resizing * { cursor: col-resize !important; user-select: none; }
.hd-frow > div { padding: 4px 10px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.hd-frow.fb-th { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ob-muted); background: var(--ob-head); min-height: 32px; }
.hd-frow:last-child { border-bottom: 0; }
.hd-fname { white-space: pre; }                 /* exact HDL name: no whitespace collapsing */
.hd-note { white-space: normal; color: var(--ob-ink-2); font-size: 12.5px; }
.hd-excluded { color: var(--ob-muted); background: var(--ob-head); }
.hd-excluded .hd-fname { text-decoration: line-through; }
.hd-srcref { color: var(--ob-muted); opacity: .8; }

/* Refreshes tab */
.hd-rrow { display: grid; grid-template-columns: 150px minmax(180px, 1.2fr) 230px 90px 110px 100px 100px 150px;
  align-items: center; min-height: 46px; border-bottom: 1px solid var(--ob-line); font-size: 13.5px; min-width: 1110px; cursor: pointer; }
.hd-rrow > div { padding: 0 10px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-rrow.fb-th { cursor: default; min-height: 32px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ob-muted); background: var(--ob-head); }
.hd-rrow:not(.fb-th):hover { background: var(--ob-hover); }
.hd-rrow.fb-sel { background: var(--ob-info-bg); }
.hd-rrow:last-child { border-bottom: 0; }
.hd-rrow:focus-visible { outline: none; box-shadow: inset var(--ob-ring); }
