/* datahub-ai.css (V1.60): Filon's AI pages: Ask Filon (Client\Apps\DataHub\Ask), My pages and the page editor
   (Apps\DataHub\MyPages), the Dictionary and glossary (Apps\DataHub\Dictionary). Prefix dha-. Colours only through the tokens of
   :root (app.css: light and dark); the brand gold for the AI's marks. Layouts: two columns from 1100 px (Ask: the chat and the
   conversations; the editor: the grid and the visual's settings), one below; checked at 390, 1024 and 1680 px. */

:root { --dha-row: 34px; --dha-ai: var(--gold-text); --dha-ai-soft: var(--gold-soft); }

[class^="dha-"] .btn, [class*=" dha-"] .btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
[class^="dha-"] .btn.primary, [class*=" dha-"] .btn.primary { border-color: var(--os-accent-fill); background: var(--os-accent-fill); color: var(--os-on-accent-fill); }
[class^="dha-"] .btn.primary:hover:not(:disabled), [class*=" dha-"] .btn.primary:hover:not(:disabled) { background: var(--os-accent-fill-hover); }
[class^="dha-"] .btn.small, [class*=" dha-"] .btn.small { padding: 5px 9px; font-size: 0.8rem; }
[class^="dha-"] .btn.danger, [class*=" dha-"] .btn.danger { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.dha-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dha-wrap, .dha-page, .dha-editor-bar, .dha-ai-box, .dha-editor, .dha-view-bar, .dha-view-desc { position: relative; width: 100%; max-width: none; margin-right: 0; margin-left: 0; box-sizing: border-box; }
.dha-wrap { display: flex; flex-direction: column; gap: 14px; }
[class^="dha-"] .spacer, [class*=" dha-"] .spacer { flex: 1; }

/* ---- Common pieces ---- */
.dha-input {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}
.dha-input:focus, .dha-select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.dha-input.small { padding: 6px 9px; font-size: 0.86rem; border-radius: 8px; }
.dha-input.area { resize: vertical; line-height: 1.4; }
.dha-input.title { padding: 6px 9px; font-size: 1.15rem; font-weight: 800; }
.dha-select { padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--field); color: var(--text); font: inherit; font-size: 0.86rem; }
.dha-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border: 0; border-radius: 999px; background: var(--chip); color: var(--chip-text);
  font-family: inherit; font-size: 0.76rem; font-weight: 700; white-space: nowrap; text-decoration: none;
}
.dha-chip.info { background: var(--info-soft); color: var(--info); }
.dha-chip.good { background: var(--good-soft); color: var(--good-text); }
.dha-chip.dev { background: var(--dha-ai-soft); color: var(--dha-ai); }
.dha-chip.kpi { background: var(--accent-soft); color: var(--accent-strong); }
.dha-chip.link { cursor: pointer; }
.dha-chip.link:hover { background: var(--chip-hover); }
.dha-chip button { padding: 0 0 0 2px; border: 0; background: none; color: inherit; cursor: pointer; font-size: 0.95rem; line-height: 1; }
.dha-count { margin-left: 4px; padding: 0 7px; border-radius: 999px; background: var(--chip); color: var(--chip-text); font-size: 0.72rem; font-weight: 800; }
.dha-link { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--accent-strong); cursor: pointer; font: inherit; font-size: 0.84rem; font-weight: 700; }
.dha-link:hover { text-decoration: underline; }
.dha-icon { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.dha-icon:hover { background: var(--chip); color: var(--text); }
.dha-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.dha-tab { padding: 6px 12px; border: 1px solid transparent; border-radius: 999px; background: none; color: var(--muted); cursor: pointer; font: inherit; font-size: 0.86rem; font-weight: 700; }
.dha-tab:hover { background: var(--chip); color: var(--text); }
.dha-tab.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.dha-intro-icon, .dha-setup-icon {
  display: grid; flex: none; place-items: center; width: 46px; height: 46px; border-radius: 14px;
  background: linear-gradient(135deg, var(--dha-ai-soft), var(--accent-soft)); color: var(--dha-ai);
}
.dha-spinner { display: inline-block; flex: none; width: 14px; height: 14px; border: 2px solid var(--chip-hover); border-top-color: var(--accent); border-radius: 50%; animation: dha-spin 0.8s linear infinite; }
.dha-spinner.light { border-color: color-mix(in srgb, var(--os-on-accent-fill) 25%, transparent); border-top-color: var(--os-on-accent-fill); }   /* inside gold buttons */
@keyframes dha-spin { to { transform: rotate(360deg); } }
.dha-skeleton { height: 14px; width: 55%; margin: 6px 0; border-radius: 6px; background: linear-gradient(90deg, var(--chip) 0%, var(--chip-hover) 50%, var(--chip) 100%); background-size: 200% 100%; animation: dha-shimmer 1.4s infinite linear; }
.dha-skeleton.wide { width: 85%; height: 18px; }
@keyframes dha-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.dha-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px; color: var(--muted); text-align: center; }
.dha-modal-back { position: fixed; inset: 0; z-index: 1200; background: rgba(0, 0, 0, 0.35); }
.dha-modal { position: fixed; z-index: 1201; top: 18vh; left: 50%; width: min(460px, 92vw); border-radius: 14px; box-shadow: var(--shadow); transform: translateX(-50%); }
.dha-modal h3 { margin: 0 0 4px; }
.dha-modal-foot { display: flex; justify-content: flex-end; margin-top: 10px; }
.dha-pick { display: flex; flex-direction: column; gap: 4px; max-height: 46vh; margin: 8px 0 0; padding: 0; overflow: auto; list-style: none; }
.dha-pick-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--field); color: var(--text); cursor: pointer; font: inherit; text-align: left; }
.dha-pick-item:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.dha-pick-item.new { border-style: dashed; color: var(--accent-strong); }

/* ---- Ask Filon ---- */
.dha-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 1100px) { .dha-page { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; } }
.dha-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.dha-intro { display: flex; flex-direction: column; gap: 14px; padding: 20px 22px; background: linear-gradient(180deg, var(--panel-2), var(--panel)); }
.dha-intro-head, .dha-describe-head { display: flex; align-items: flex-start; gap: 14px; }
.dha-intro h2, .dha-describe h2, .dha-dict-head h2 { margin: 2px 0 4px; font-size: 1.35rem; font-weight: 900; }
.dha-intro-text { margin: 0; color: var(--muted); max-width: 76ch; }
.dha-facts-row { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 0.84rem; }
.dha-facts-row > span { display: inline-flex; align-items: center; gap: 5px; }
.dha-examples-label { color: var(--muted); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase; }
.dha-examples { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.dha-example {
  display: flex; align-items: flex-start; justify-content: flex-start; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--field);
  color: var(--text); cursor: pointer; font: inherit; font-size: 0.88rem; line-height: 1.35; text-align: left; transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.dha-example .mud-icon-root { flex: none; margin-top: 1px; color: var(--dha-ai); }
.dha-example:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.dha-example:disabled { cursor: default; opacity: 0.55; }
.dha-example.small { padding: 4px 10px; border-radius: 999px; font-size: 0.8rem; }
.dha-setup { display: flex; align-items: flex-start; gap: 14px; padding: 18px 20px; border-left: 5px solid var(--brand-gold); }
.dha-setup h2 { margin: 2px 0 6px; font-size: 1.1rem; }
.dha-dev { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--dha-ai-soft); color: var(--dha-ai); font-size: 0.86rem; font-weight: 600; }

.dha-conversation { display: flex; flex-direction: column; gap: 22px; }
.dha-turn { display: flex; flex-direction: column; gap: 10px; }
.dha-question { align-self: flex-end; max-width: min(78%, 720px); }
.dha-question-text { padding: 11px 15px; border-radius: 16px 16px 4px 16px; background: var(--os-accent); color: var(--os-on-accent); font-weight: 600; line-height: 1.4; box-shadow: var(--shadow); }
.dha-question-meta { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; color: var(--muted); font-size: 0.76rem; }
.dha-question-meta span { display: inline-flex; align-items: center; gap: 3px; }
.dha-answer { display: flex; align-items: flex-start; gap: 12px; }
.dha-avatar { display: grid; flex: none; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--os-accent); color: var(--os-on-accent); box-shadow: var(--shadow); }
.dha-answer-body { flex: 1; min-width: 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: 4px 16px 16px 16px; background: var(--panel); box-shadow: var(--shadow); }
.dha-answer.running .dha-answer-body { background: var(--panel-2); }
.dha-steps { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; font-size: 0.88rem; list-style: none; }
.dha-steps li { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.dha-steps li.current { color: var(--text); font-weight: 600; }
.dha-steps li .mud-icon-root { color: var(--good); }
.dha-running-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.dha-status { display: inline-flex; margin-bottom: 8px; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 800; }
.dha-status.warn { background: var(--warn-soft); color: var(--warn); }
.dha-status.bad { background: var(--bad-soft); color: var(--bad); }
.dha-status.muted { background: var(--chip); color: var(--chip-text); }
.dha-text { font-size: 0.98rem; line-height: 1.55; }
.dha-text p { margin: 0 0 6px; }
.dha-text ul { margin: 4px 0 8px; padding-left: 20px; }
.dha-text li { margin: 2px 0; }
.dha-check { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; padding: 7px 10px; border-radius: 8px; background: var(--note-soft); color: var(--warn); font-size: 0.84rem; }
.dha-chart-box { margin-top: 12px; padding: 10px 12px 2px; border: 1px solid var(--rule); border-radius: 12px; background: var(--panel-2); }
.dha-chart-title { color: var(--text); font-size: 0.86rem; font-weight: 800; }
.dha-chart-empty { padding: 18px; color: var(--muted); font-size: 0.86rem; text-align: center; }
.dha-how { margin-top: 12px; }
.dha-how > summary { display: flex; align-items: center; gap: 6px; color: var(--accent-strong); cursor: pointer; font-size: 0.86rem; font-weight: 800; list-style: none; }
.dha-how > summary::-webkit-details-marker { display: none; }
.dha-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; margin-top: 8px; }
.dha-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 12px; border: 1px solid var(--border); border-left: 4px solid var(--brand-gold); border-radius: 10px; background: var(--panel-2); }
.dha-card-values { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.dha-card-value { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dha-card-kpi { color: var(--muted); cursor: help; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; }
.dha-card-value b { font-size: 1.35rem; font-variant-numeric: tabular-nums; font-weight: 900; }
.dha-card-plan { color: var(--muted); font-size: 0.78rem; }
.dha-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 10px; margin: 0; font-size: 0.8rem; }
.dha-facts dt { color: var(--muted); font-weight: 700; }
.dha-facts dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.dha-formula { color: var(--muted); font-family: ui-monospace, Consolas, monospace; font-size: 0.76rem; }
.dha-rows { overflow-x: auto; }
.dha-rows table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.dha-rows th { padding: 4px 6px; border-bottom: 1px solid var(--border); color: var(--muted); font-weight: 700; text-align: left; white-space: nowrap; }
.dha-rows td { padding: 3px 6px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.dha-rows .num { font-variant-numeric: tabular-nums; text-align: right; }
.dha-card-actions { display: flex; justify-content: flex-end; }
.dha-defs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.dha-def { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 0.8rem; font-weight: 700; text-decoration: none; }
.dha-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--rule); }

.dha-ask { display: flex; gap: 8px; padding: 8px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); }
.dha-ask.sticky { position: sticky; bottom: 10px; z-index: 5; }
.dha-ask .dha-input { border: 0; background: transparent; font-size: 1rem; }
.dha-ask .dha-input:focus { outline: none; }
.dha-send { display: inline-flex; align-items: center; gap: 6px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--os-accent-fill); color: var(--os-on-accent-fill); cursor: pointer; font: inherit; font-weight: 800; }
.dha-send:disabled { cursor: not-allowed; opacity: 0.5; }
@media (max-width: 600px) { .dha-send-text { display: none; } .dha-question { max-width: 92%; } .dha-avatar { display: none; } }

.dha-side { display: flex; flex-direction: column; gap: 8px; }
.dha-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dha-side-head h3 { margin: 0; }
.dha-convs { display: flex; flex-direction: column; gap: 2px; max-height: 70vh; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.dha-convs li { display: flex; align-items: center; gap: 4px; border-radius: 10px; }
.dha-convs li:hover, .dha-convs li.active { background: var(--accent-soft); }
.dha-convs a { display: flex; flex: 1; flex-direction: column; min-width: 0; padding: 7px 9px; color: var(--text); text-decoration: none; }
.dha-conv-title { overflow: hidden; font-size: 0.86rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.dha-conv-meta { color: var(--muted); font-size: 0.74rem; }
.dha-conv-actions { display: none; }
.dha-convs li:hover .dha-conv-actions, .dha-convs li.active .dha-conv-actions { display: inline-flex; }
.dha-rename { display: flex; align-items: center; gap: 6px; width: 100%; padding: 4px; }

/* ---- My pages ---- */
.dha-describe { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; background: linear-gradient(180deg, var(--panel-2), var(--panel)); }
.dha-describe-form { display: flex; flex-direction: column; gap: 8px; }
.dha-describe-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dha-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dha-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.dha-toolbar .dha-input { max-width: 280px; }
.dha-grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.dha-page-card { display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; border-radius: 14px; transition: transform 0.15s, box-shadow 0.15s; }
.dha-page-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.dha-sketch { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; height: 128px; padding: 12px; overflow: hidden; border-bottom: 1px solid var(--rule); background: var(--panel-2); }
.dha-sketch-cell { border-radius: 4px; background: var(--chip-hover); }
.dha-sketch-cell.dha-t-card, .dha-sketch-cell.dha-t-gauge { border: 1px solid var(--accent); background: var(--accent-soft); }
.dha-sketch-cell.dha-t-line, .dha-sketch-cell.dha-t-area, .dha-sketch-cell.dha-t-combo { border: 1px solid var(--info); background: linear-gradient(160deg, transparent 45%, var(--info-soft) 46%), var(--panel); }
.dha-sketch-cell.dha-t-column, .dha-sketch-cell.dha-t-bar, .dha-sketch-cell.dha-t-stacked { border: 1px solid var(--brand-gold); background: repeating-linear-gradient(90deg, var(--gold-soft) 0 6px, var(--panel) 6px 10px); }
.dha-sketch-cell.dha-t-table, .dha-sketch-cell.dha-t-matrix { border: 1px solid var(--border); background: repeating-linear-gradient(180deg, var(--panel) 0 5px, var(--chip) 5px 6px); }
.dha-sketch-cell.dha-t-donut { background: radial-gradient(circle, var(--panel) 30%, var(--good-soft) 31% 60%, transparent 61%); }
.dha-page-card-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; }
.dha-page-card-body h3 { margin: 0; font-size: 1rem; }
.dha-page-card-body h3 a { color: var(--text); text-decoration: none; }
.dha-page-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--muted); font-size: 0.78rem; }
.dha-page-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }

.dha-view-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; max-width: none; margin: 0 0 10px; }
.dha-view-title h2 { margin: 0; font-size: 1.3rem; font-weight: 900; }
.dha-back { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--chip); color: var(--text); }
.dha-view-desc { max-width: none; margin: 0 0 10px; color: var(--muted); }

/* ---- The editor ---- */
.dha-editor-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; max-width: none; margin: 0 0 12px; }
.dha-titles { display: flex; flex: 1 1 320px; flex-direction: column; gap: 4px; min-width: 0; }
.dha-field { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 0.8rem; font-weight: 700; }
.dha-field > span:first-child { display: inline-flex; align-items: center; gap: 4px; }
.dha-check-label { display: inline-flex; align-items: center; gap: 6px; font-size: 0.86rem; font-weight: 600; }
.dha-ai-box { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; max-width: none; margin: 0 0 12px; border-left: 4px solid var(--brand-gold); }
.dha-ai-icon { margin-top: 8px; color: var(--dha-ai); }
.dha-ai-form { display: flex; flex: 1; gap: 8px; min-width: 260px; }
.dha-ai-notes { flex-basis: 100%; color: var(--muted); font-size: 0.84rem; }
.dha-ai-notes p { margin: 0 0 4px; color: var(--text); }
.dha-editor { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; max-width: none; margin: 0; }
@media (min-width: 1100px) {
  .dha-editor { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  .dha-props { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
}
.dha-editor-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dha-gallery { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; }
.dha-gallery-label { margin-right: 4px; color: var(--muted); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.3px; text-transform: uppercase; }
.dha-gallery-item { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--field); color: var(--text); cursor: pointer; font: inherit; font-size: 0.82rem; font-weight: 600; }
.dha-gallery-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.dha-canvas-head { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.84rem; font-weight: 700; }
.dha-canvas {
  position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; min-height: 280px; padding: 10px; padding-bottom: 46px;
  border: 1px dashed var(--border); border-radius: 14px; background: var(--panel-2);
}
.dha-cell { border-radius: 6px; background: var(--rule); opacity: 0.55; }
.dha-cell:hover { opacity: 1; }
.dha-box {
  position: relative; z-index: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 8px 10px; overflow: hidden; border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); cursor: grab; outline: none;
}
.dha-box:hover { border-color: var(--accent); }
.dha-box.selected { z-index: 2; overflow: visible; border: 2px solid var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.dha-box:focus-visible { box-shadow: 0 0 0 3px var(--accent); }
.dha-box.dha-t-card, .dha-box.dha-t-gauge { border-top: 3px solid var(--accent); }
.dha-box.dha-t-line, .dha-box.dha-t-area, .dha-box.dha-t-combo { border-top: 3px solid var(--info); }
.dha-box.dha-t-column, .dha-box.dha-t-bar, .dha-box.dha-t-stacked, .dha-box.dha-t-donut { border-top: 3px solid var(--brand-gold); }
.dha-box-head { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--text); font-size: 0.84rem; font-weight: 800; }
.dha-box-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dha-box-body { display: flex; flex-direction: column; gap: 2px; overflow: hidden; color: var(--muted); font-size: 0.76rem; }
.dha-box-tools { position: absolute; z-index: 3; right: 4px; bottom: -36px; display: flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); }
.dha-box-tools button { display: inline-grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 7px; background: none; color: var(--text); cursor: pointer; }
.dha-box-tools button:hover { background: var(--accent-soft); }
.dha-sep { width: 1px; height: 18px; margin: 0 2px; background: var(--border); }
.dha-canvas-empty { text-align: center; }
.dha-preview { padding: 10px; }
.dha-preview-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dha-props { display: flex; flex-direction: column; gap: 10px; }
.dha-props h3 { display: flex; align-items: center; gap: 8px; margin: 0; }
.dha-kpi-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dha-picker { display: flex; flex-direction: column; gap: 4px; max-height: 360px; padding: 8px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); }
.dha-picker-domain { margin-top: 6px; color: var(--accent-strong); font-size: 0.74rem; font-weight: 800; letter-spacing: 0.3px; text-transform: uppercase; }
.dha-picker-item { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; border: 1px solid transparent; border-radius: 8px; background: var(--field); color: var(--text); cursor: pointer; font: inherit; text-align: left; }
.dha-picker-item:hover:not(:disabled) { border-color: var(--accent); }
.dha-picker-item:disabled { cursor: default; opacity: 0.45; }
.dha-picker-name { font-size: 0.84rem; font-weight: 700; }
.dha-picker-def { color: var(--muted); font-size: 0.74rem; line-height: 1.3; }
.dha-filter-add { display: flex; gap: 6px; }
.dha-values { display: flex; flex-wrap: wrap; gap: 4px; max-height: 160px; overflow: auto; }
@media (max-width: 700px) { .dha-box-tools { flex-wrap: wrap; right: 0; left: 0; bottom: auto; top: 100%; } :root { --dha-row: 26px; } }

/* ---- The dictionary ---- */
.dha-dict-head { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; background: linear-gradient(180deg, var(--panel-2), var(--panel)); }
.dha-dict-search { display: flex; align-items: center; gap: 8px; padding: 4px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--field); }
.dha-dict-search .dha-input { border: 0; background: transparent; font-size: 1.05rem; }
.dha-dict-search .dha-input:focus { outline: none; }
.dha-entries { display: flex; flex-direction: column; gap: 8px; }
.dha-group { margin: 14px 2px 2px; color: var(--accent-strong); font-size: 0.86rem; font-weight: 900; letter-spacing: 0.3px; text-transform: uppercase; }
.dha-entry { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px; border-left: 4px solid var(--chip-hover); }
.dha-entry.kpi { border-left-color: var(--accent); }
.dha-entry.term { border-left-color: var(--brand-gold); }
.dha-entry.table, .dha-entry.schema { border-left-color: var(--info); }
.dha-entry.focus { border-left-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dha-entry-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dha-entry-title { margin: 0; font-size: 1rem; font-weight: 800; }
.dha-title-link { padding: 0; border: 0; background: none; color: var(--text); cursor: pointer; font: inherit; text-align: left; }
.dha-title-link:hover { color: var(--accent-strong); text-decoration: underline; }
.dha-other { color: var(--muted); font-size: 0.84rem; font-style: italic; }
.dha-kind { padding: 2px 8px; border-radius: 6px; background: var(--chip); color: var(--chip-text); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.3px; text-transform: uppercase; }
.dha-kind.kpi { background: var(--accent-soft); color: var(--accent-strong); }
.dha-kind.term { background: var(--gold-soft); color: var(--gold-text); }
.dha-kind.table, .dha-kind.column, .dha-kind.schema { background: var(--info-soft); color: var(--info); }
.dha-entry-text { max-width: 110ch; margin: 0; line-height: 1.5; }
.dha-formula-box { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; padding: 7px 10px; border-radius: 8px; background: var(--code-bg); }
.dha-formula-label { color: var(--muted); font-size: 0.74rem; font-weight: 800; letter-spacing: 0.3px; text-transform: uppercase; }
.dha-formula-box code { color: var(--text); font-family: ui-monospace, Consolas, monospace; font-size: 0.86rem; white-space: pre-wrap; }
.dha-uses { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.dha-uses-label { margin-left: 4px; color: var(--muted); font-size: 0.74rem; font-weight: 800; letter-spacing: 0.3px; text-transform: uppercase; }
.dha-uses-label:first-child { margin-left: 0; }
.dha-entry-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.dha-explain { padding: 10px 12px; border-left: 4px solid var(--brand-gold); border-radius: 10px; background: var(--dha-ai-soft); }
.dha-explain p { margin: 0 0 6px; }

/* V1.61: every detail of one Dictionary item (Apps\DataHub\Dictionary\DictionaryDetails.razor): the full width of the page,
   a main column and a side column (one column on a narrow screen) */
.dhd { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.dhd-hero { display: flex; flex-direction: column; gap: 8px; padding: 16px 20px; border-left: 5px solid var(--chip-hover); background: linear-gradient(180deg, var(--panel-2), var(--panel)); }
.dhd-hero.kpi { border-left-color: var(--accent); }
.dhd-hero.term { border-left-color: var(--brand-gold); }
.dhd-hero.table, .dhd-hero.schema, .dhd-hero.column { border-left-color: var(--info); }
.dhd-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: 0.82rem; }
.dhd-crumbs a { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-strong); font-weight: 700; text-decoration: none; }
.dhd-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.dhd-title-row h2 { margin: 0; font-size: 1.5rem; font-weight: 900; overflow-wrap: anywhere; }
.dhd-id { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.78rem; }
.dhd-id code, .dhd-sql-inline { padding: 1px 6px; border-radius: 6px; background: var(--code-bg); color: var(--text); font-family: ui-monospace, Consolas, monospace; font-size: 0.8rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.dhd-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); gap: 12px; align-items: start; }
.dhd-main, .dhd-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.dhd-sec { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 14px 18px; }
.dhd-sec h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-size: 0.98rem; font-weight: 900; }
.dhd-sec h4 { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; color: var(--muted); font-size: 0.74rem; font-weight: 800; letter-spacing: 0.3px; text-transform: uppercase; }
.dhd-sec p { margin: 0; }
.dhd-text { max-width: 110ch; font-size: 1rem; line-height: 1.55; }
.dhd-other-text { max-width: 110ch; color: var(--muted); font-size: 0.86rem; font-style: italic; line-height: 1.45; }
.dhd-lang { margin-right: 4px; padding: 0 5px; border-radius: 4px; background: var(--chip); color: var(--chip-text); font-size: 0.66rem; font-style: normal; font-weight: 800; }
.dhd-list { display: flex; flex-direction: column; gap: 5px; margin: 0; padding-left: 18px; font-size: 0.88rem; }
.dhd-list a, .dhd-sec p a, .dhd-facts a, .dhd-table a, .dhd-factsrc-head a { color: var(--accent-strong); font-weight: 700; text-decoration: none; }
.dhd-list a:hover, .dhd-sec p a:hover, .dhd-facts a:hover, .dhd-table a:hover, .dhd-factsrc-head a:hover, .dhd-crumbs a:hover { text-decoration: underline; }
.dhd-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 0.88rem; }
.dhd-facts.wide { grid-template-columns: minmax(140px, max-content) minmax(0, 1fr); }
.dhd-facts.compact { font-size: 0.82rem; }
.dhd-fact { display: contents; }
.dhd-fact dt { color: var(--muted); font-weight: 700; }
.dhd-fact dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.dhd-part { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dhd-group { display: flex; flex-direction: column; gap: 4px; }
.dhd-group + .dhd-group { margin-top: 6px; }
.dhd-group-name { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 0.74rem; font-weight: 800; letter-spacing: 0.3px; text-transform: uppercase; }
.dhd-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.dhd-card { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); color: var(--text); text-decoration: none; }
.dhd-card:hover { border-color: var(--accent); }
.dhd-card-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 800; }
.dhd-card-text { color: var(--muted); font-size: 0.84rem; line-height: 1.4; }
.dhd-card-formula { font-family: ui-monospace, Consolas, monospace; font-size: 0.76rem; }
.dhd-factsrc { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.dhd-factsrc-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.dhd-columns { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.dhd-colgroup { display: flex; flex-direction: column; gap: 5px; padding: 8px 10px; border-radius: 8px; background: var(--panel-2); }
.dhd-colgroup-table { color: var(--accent-strong); font-family: ui-monospace, Consolas, monospace; font-size: 0.8rem; font-weight: 800; text-decoration: none; }
.dhd-sql summary { color: var(--accent-strong); font-size: 0.86rem; font-weight: 800; cursor: pointer; }
.dhd-sql pre, .dhd-code { margin: 6px 0; padding: 10px 12px; border-radius: 8px; background: var(--code-bg); color: var(--text); font-family: ui-monospace, Consolas, monospace; font-size: 0.78rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.dhd-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.dhd-table th { position: sticky; top: 0; padding: 6px 8px; border-bottom: 2px solid var(--border); background: var(--panel); color: var(--muted); font-size: 0.72rem; font-weight: 800; text-align: left; text-transform: uppercase; white-space: nowrap; }
.dhd-table td { padding: 6px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.dhd-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.dhd-table tr.current td { background: var(--accent-soft); }
.dhd-scroll { max-height: 560px; overflow: auto; }
.dhd-values { display: flex; flex-wrap: wrap; gap: 6px; }
.dhd-value { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 8px; background: var(--chip); color: var(--chip-text); font-size: 0.8rem; }
.dhd-value b { color: var(--accent-strong); }
.dhd-sec .dh-sheet-body h3 { margin-top: 0; }
@media (max-width: 1100px) { .dhd-grid { grid-template-columns: minmax(0, 1fr); } }
