/* ============================================================================
   V4 dashboard (W08) on top of v4.css
   ----------------------------------------------------------------------------
   Page additions from webapp-v4/seiten/01-dashboard.html (mockup prefix
   dashboard- is bl-dash- here), plus the pieces the page shares with the V4
   shell: notices on every page (Google banner, AI reply run pills), the
   Premium-trial panel, the countdown pill and the welcome-credits dialog.
   Same scope rule as v4.css: everything needs .bl-v4 on an ancestor, so the
   old shell is not touched.
   ========================================================================= */

/* ---------- Notices on top ---------- */
.bl-v4 .bl-dash-top { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
/* Google banner and run pills come from the layout, above every page */
.bl-v4 .bl-main > .bl-shell-notice { margin-bottom: 12px; }
.bl-v4 .bl-main-legacy > .bl-shell-notice { margin: 16px 16px 0; }
/* intro_countdown_controller.js hides an expired banner with Tailwind's .hidden */
.bl-v4 .bl-banner.hidden { display: none; }

/* AI reply run (live: business/shared/_ai_reply_bulk_run_pills) */
.bl-v4 .bl-runs { display: flex; flex-wrap: wrap; gap: 8px; }
.bl-v4 .bl-run { border-radius: 14px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); font-size: 13.5px; }
.bl-v4 .bl-run summary { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 14px; cursor: pointer; list-style: none; user-select: none; }
.bl-v4 .bl-run summary::-webkit-details-marker { display: none; }
.bl-v4 .bl-run-name { font-weight: 700; color: var(--ink); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-v4 .bl-run-progress { color: var(--muted); font-variant-numeric: tabular-nums; }
.bl-v4 .bl-run-pct { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.bl-v4 .bl-run summary .bl-ic { color: var(--muted); transition: transform .15s ease; }
.bl-v4 .bl-run[open] summary .bl-ic { transform: rotate(180deg); }
.bl-v4 .bl-run-body { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 14px 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); }
.bl-v4 .bl-run-body .bl-link { font-size: 12.5px; }

/* Start window: countdown pill */
.bl-v4 .bl-countdown { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--accent-line); font-size: 12px; font-weight: 600; color: var(--accent-ink); white-space: nowrap; }
.bl-v4 .bl-countdown .bl-mono { font-size: 12px; font-variant-numeric: tabular-nums; }

/* ---------- Premium trial (live: business/shared/_premium_trial_panel) ---------- */
.bl-v4 .bl-trial { border-color: var(--accent-line); }
.bl-v4 .bl-trial-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 24px; }
.bl-v4 .bl-trial-head .button_to { flex: none; margin: 0; }
.bl-v4 .bl-trial-eyebrow { color: var(--accent-ink); }
.bl-v4 .bl-trial-title { margin-top: 4px; font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.bl-v4 .bl-trial--compact .bl-trial-head { align-items: center; }
.bl-v4 .bl-trial--compact .bl-trial-title { margin-top: 0; }
.bl-v4 .bl-trial-sub { margin-top: 2px; font-size: 13.5px; color: var(--muted); }
.bl-v4 .bl-trial-toggle { display: none; }
.bl-v4 .bl-trial-toggle .bl-ic { transition: transform .15s ease; }
.bl-v4 .bl-trial-toggle[aria-expanded="true"] .bl-ic { transform: rotate(180deg); }
.bl-v4 .bl-trial-body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; padding: 0 24px 20px; }
.bl-v4 .bl-trial-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; border-radius: 12px; overflow: hidden; background: var(--line); border: 1px solid var(--line); }
.bl-v4 .bl-trial-facts > div { padding: 12px 14px; background: var(--surface); min-width: 0; }
.bl-v4 .bl-trial-facts dt { font-size: 12px; font-weight: 700; color: var(--ink); }
.bl-v4 .bl-trial-facts dd { margin-top: 4px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.bl-v4 .bl-trial .bl-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); align-self: start; }
.bl-v4 .bl-trial .bl-metrics dd { font-size: 18px; }
.bl-v4 .bl-trial-older { padding: 16px 24px 20px; border-top: 1px solid var(--line); }
.bl-v4 .bl-trial-older-title { font-size: 14px; font-weight: 700; }
.bl-v4 .bl-trial-older-text { margin-top: 2px; font-size: 13px; color: var(--muted); }
.bl-v4 .bl-trial-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.bl-v4 .bl-trial-option { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); min-width: 0; }
.bl-v4 .bl-trial-option-title { font-size: 13.5px; font-weight: 700; }
.bl-v4 .bl-trial-option-text { flex: 1 1 auto; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.bl-v4 .bl-trial-option .bl-btn { align-self: flex-start; margin-top: 8px; }
.bl-v4 .bl-trial-legal { padding: 0 24px 20px; font-size: 12px; color: var(--muted); }

/* ---------- Band and to-do ---------- */
.bl-v4 .bl-dash-anchor { scroll-margin-top: 24px; }
.bl-v4 .bl-todo--warn { --edge: var(--warn); }
.bl-v4 .bl-dash-change { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 2px 8px; margin-top: 10px; font-size: 13px; }
.bl-v4 .bl-dash-change dt { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.bl-v4 .bl-dash-change dd { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.bl-v4 .bl-dash-change dd.bl-is-old { color: var(--muted); font-weight: 500; text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.bl-v4 .bl-dash-todo-more { display: flex; justify-content: center; margin-top: 12px; }
.bl-v4 .bl-dash-todo-more .bl-ic { transition: transform .15s ease; }
.bl-v4 .bl-dash-todo-more [aria-expanded="true"] .bl-ic { transform: rotate(180deg); }
.bl-v4 .bl-dash-clear { display: flex; flex-direction: row; align-items: center; gap: 14px; padding: 20px; overflow: hidden; }
.bl-v4 .bl-dash-clear::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--good); }
.bl-v4 .bl-dash-clear > .bl-ic { color: var(--good); }
.bl-v4 .bl-dash-clear-title { font-size: 15px; font-weight: 700; }
.bl-v4 .bl-dash-clear-sub { margin-top: 2px; font-size: 13px; color: var(--muted); }

/* ---------- B4: sentence left, comparison bar right ---------- */
.bl-v4 .bl-dash-bench { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-areas: "eyebrow scale" "text scale" "meta scale"; column-gap: 48px; row-gap: 6px; align-items: center; padding: 20px 24px; }
.bl-v4 .bl-dash-bench .bl-eyebrow { grid-area: eyebrow; }
.bl-v4 .bl-dash-bench .bl-bench-text { grid-area: text; }
.bl-v4 .bl-dash-bench .bl-bench-meta { grid-area: meta; }
.bl-v4 .bl-dash-bench .bl-bench-scale { grid-area: scale; margin: 0 12px; }
.bl-v4 .bl-dash-bench-lock { grid-area: scale; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.5; color: var(--muted); }

/* ---------- Charts, reports, activity ---------- */
.bl-v4 .bl-dash-cols--single { grid-template-columns: minmax(0, 1fr); }
/* The old global dark styles give every select a fill; the V4 field has its own */
.dark .bl-v4 .bl-combo .bl-field select { background: transparent; color: var(--ink); }
.bl-v4 .bl-dash-nodata { padding: 40px 24px; text-align: center; }
.bl-v4 .bl-dash-nodata .bl-empty-ic { width: 24px; height: 24px; }
.bl-v4 .bl-dash-nodata-title { margin-top: 12px; font-size: 14px; font-weight: 700; }
.bl-v4 .bl-dash-nodata-sub { margin-top: 4px; font-size: 13px; color: var(--muted); }
.bl-v4 .bl-dash-funnel-empty { margin-top: 16px; font-size: 14px; color: var(--ink-2); }
.bl-v4 .bl-ref .bl-tip.hidden { display: none; }

/* ---------- Without a location ---------- */
.bl-v4 .bl-dash-noloc .bl-empty { padding: 72px 24px; margin-top: 0; }
.bl-v4 .bl-dash-noloc .bl-empty-ic { width: 40px; height: 40px; color: var(--accent); }
.bl-v4 .bl-dash-noloc .bl-empty-title { font-size: 22px; letter-spacing: -.01em; }
.bl-v4 .bl-dash-noloc .bl-empty-sub { max-width: 44ch; }

/* ---------- Welcome credits (live: shared/_signup_credits_welcome, native <dialog>) ---------- */
.bl-v4 dialog.bl-welcome { margin: auto; padding: 0; border: 0; background: transparent; color: var(--ink); width: calc(100% - 32px); max-width: 420px; max-height: none; overflow: visible; }
.bl-v4 dialog.bl-welcome::backdrop { background: rgba(8, 22, 24, .44); backdrop-filter: blur(3px); }
.dark .bl-v4 dialog.bl-welcome::backdrop { background: rgba(0, 0, 0, .58); }
.bl-v4 .bl-welcome-panel { max-width: none; text-align: center; padding: 32px 28px 28px; }
.bl-v4 .bl-welcome-ic { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.bl-v4 .bl-welcome h2 { margin-top: 16px; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.bl-v4 .bl-welcome p { margin-top: 10px; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.bl-v4 .bl-welcome p.bl-welcome-exp { font-weight: 600; color: var(--ink); }
.bl-v4 .bl-welcome .bl-btn { width: 100%; margin-top: 24px; }

@media (min-width: 1024px) {
  .bl-v4 .bl-main-legacy > .bl-shell-notice { margin: 16px 32px 0; }
}

@media (max-width: 1023.98px) {
  .bl-v4 .bl-dash-top { margin-bottom: 16px; }
  .bl-v4 .bl-dash-anchor { scroll-margin-top: 72px; }
  .bl-v4 .bl-run { width: 100%; }
  .bl-v4 .bl-run summary { min-height: 44px; }
  .bl-v4 .bl-run-name { max-width: none; flex: 1 1 auto; min-width: 0; }
  .bl-v4 .bl-countdown { height: 32px; }

  .bl-v4 .bl-trial-head { flex-direction: column; padding: 16px; }
  .bl-v4 .bl-trial-head > .bl-btn,
  .bl-v4 .bl-trial-head .button_to,
  .bl-v4 .bl-trial-head .button_to .bl-btn { width: 100%; height: 44px; }
  .bl-v4 .bl-trial-toggle { display: inline-flex; align-self: center; margin-top: -4px; min-height: 40px; }
  .bl-v4 .bl-trial:not(.bl-is-expanded) .bl-trial-details { display: none; }
  .bl-v4 .bl-trial-body { grid-template-columns: minmax(0, 1fr); padding: 0 16px 16px; }
  .bl-v4 .bl-trial-facts { grid-template-columns: minmax(0, 1fr); }
  .bl-v4 .bl-trial-older { padding: 16px; }
  .bl-v4 .bl-trial-options { grid-template-columns: minmax(0, 1fr); }
  .bl-v4 .bl-trial-option .bl-btn { align-self: stretch; height: 44px; }
  .bl-v4 .bl-trial-legal { padding: 0 16px 16px; }

  .bl-v4 .bl-dash-todo-more .bl-textbtn { min-height: 44px; }
  .bl-v4 .bl-dash-bench { grid-template-columns: minmax(0, 1fr); grid-template-areas: "eyebrow" "text" "scale" "meta"; padding: 16px; }
  .bl-v4 .bl-dash-bench .bl-bench-scale { margin: 22px 12px; }
  .bl-v4 .bl-dash-bench-lock { margin-top: 6px; }

  .bl-v4 .bl-dash-noloc .bl-empty { padding: 48px 20px; }
  .bl-v4 .bl-dash-noloc .bl-empty .bl-btn { width: 100%; height: 44px; }

  .bl-v4 dialog.bl-welcome { width: 100%; max-width: none; margin: auto 0 0; }
  .bl-v4 .bl-welcome-panel { padding: 8px 16px calc(20px + env(safe-area-inset-bottom, 0px)); }
  .bl-v4 .bl-welcome .bl-btn { height: 44px; }
}
