/* Dashboard, redesigned (flag new_ui): diseno/new-ui/handoff-dashboard.md.
   Grid, cards and controls come from layout.css and controls.css; this file
   only has what is particular to this page. Colors from css/ui-tokens.css. */
body.new-ui #dashUi { font: 14.5px/1.55 var(--ui-font); color: var(--ui-ink); }
body.new-ui #dashUi h1, body.new-ui #dashUi h2, body.new-ui #dashUi h3 { font-family: var(--ui-font); color: var(--ui-ink); }

/* Header */
body.new-ui .dui-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 4px 0 22px; }
body.new-ui .dui-id { display: flex; gap: 14px; align-items: center; min-width: 0; }
body.new-ui .dui-fav { width: 44px; height: 44px; border-radius: 10px; flex: none; border: 1px solid var(--ui-line); background: var(--ui-card); }
body.new-ui .dui-head h1 { margin: 0; font-size: 26px; line-height: 1.15; letter-spacing: -.03em; font-weight: 600; }
body.new-ui .dui-head p { margin: 3px 0 0; color: var(--ui-ink-2); font-size: 14px; }
body.new-ui .dui-acts { display: flex; gap: 8px; flex: none; flex-wrap: wrap; }
body.new-ui .dui-mon { position: relative; display: inline-block; }
body.new-ui .dui-menu {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 170px; padding: 4px;
  display: flex; flex-direction: column; background: var(--ui-card); border: 1px solid var(--ui-line);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(14, 15, 17, .12);
}
body.new-ui .dui-menu button {
  background: none; color: var(--ui-ink); border: 0; border-radius: 7px; padding: 8px 10px;
  text-align: left; font: 400 14px var(--ui-font); box-shadow: none;
}
body.new-ui .dui-menu button:hover:not(:disabled) { background: var(--ui-hover); }
body.new-ui .dui-menu button.on { font-weight: 600; }

/* KPI row */
body.new-ui .dui-kpi-lead .big { font-size: 56px; }
body.new-ui .dui-sq { display: inline-flex; flex-wrap: wrap; gap: 3px; margin: 6px 0 2px; }
body.new-ui .dui-sq i { width: 12px; height: 12px; border-radius: 2px; background: var(--ui-rival-soft); }
body.new-ui .dui-sq i.on { background: var(--ui-accent); }
body.new-ui .dui-kpi2 {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-top: auto; padding-top: 14px; border-top: 1px solid var(--ui-line-2);
}
body.new-ui .dui-kpi2 + .dui-kpi2 { margin-top: 0; padding-top: 10px; }
body.new-ui .dui-kpi2 b { font: 500 15px var(--ui-font); }
/* Lead KPI: the words in sans, only the numbers in mono (dashboard-ui.js duiNums). */
body.new-ui .dui-kpi-lead .big small { font-family: var(--ui-font); }
body.new-ui .dui-kpi-lead :is(.big small, .dui-kpi2 b) .num { font-family: var(--ui-mono); }
body.new-ui #dashUi .ui-kpi { height: 100%; box-sizing: border-box; }

/* Trend */
body.new-ui .dui-lg { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ui-ink-2); }
body.new-ui .dui-lg span { display: inline-flex; align-items: center; gap: 6px; }
/* On a phone the logos at each line's end already say which AI it is. */
@media (max-width: 600px) { body.new-ui .dui-lg { display: none; } }
body.new-ui .dui-chart { padding: 6px 12px 6px 6px; }
body.new-ui .dg-chart { width: 100%; height: auto; display: block; }
body.new-ui .dg-chart.dg-phone { display: none; }
body.new-ui :is(.dg-chart, .dui-sample-svg) .dg-grid line { stroke: var(--ui-line); }
body.new-ui .dg-chart text { font: 11px var(--ui-mono); fill: var(--ui-ink-3); }
body.new-ui .dg-chart text.dg-lab { font: 500 12px var(--ui-mono); fill: var(--ui-ink); }
body.new-ui .dg-chart text.dg-lab .dg-rng { font-size: 10.5px; fill: var(--ui-ink-3); }
body.new-ui .dg-end.old { opacity: .55; }
body.new-ui .dg-lead { fill: none; stroke: var(--ui-line); stroke-dasharray: 2 3; }
/* The margin of error: only while the reader points at, taps or tabs to the chart. */
body.new-ui .dg-band { fill: var(--ui-ink-3); fill-opacity: .1; opacity: 0; transition: opacity .15s; }
body.new-ui .dg-chart:is(:hover, :focus) .dg-band { opacity: 1; }
body.new-ui .dg-chart:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 4px; border-radius: 6px; }
/* Each AI in its own color, never the accent (that is the brand); the stroke differs too, for color-blind readers. */
body.new-ui .dg-line { fill: none; stroke: var(--ui-ink-3); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
body.new-ui .dg-line.dg-s1 { stroke-dasharray: 6 4; }
body.new-ui .dg-line.dg-s2 { stroke-dasharray: 2 4; }
body.new-ui .dg-line.dg-s3 { stroke-dasharray: 9 3 2 3; }
body.new-ui .dg-line.dg-s4 { stroke-dasharray: 1 3; }
body.new-ui .dg-line.dg-s5 { stroke-dasharray: 12 4; }
body.new-ui .dg-dot { fill: var(--ui-card); stroke: var(--ui-ink-3); stroke-width: 2; }
body.new-ui .dg-dot.end { fill: var(--ui-ink-3); }
body.new-ui .dg-k-chatgpt { --dg-c: var(--ui-ai-chatgpt); }
body.new-ui .dg-k-gemini { --dg-c: var(--ui-ai-gemini); }
body.new-ui .dg-k-claude { --dg-c: var(--ui-ai-claude); }
body.new-ui .dg-k-perplexity { --dg-c: var(--ui-ai-perplexity); }
body.new-ui .dg-k-mistral { --dg-c: var(--ui-ai-mistral); }
body.new-ui .dg-k-grok { --dg-c: var(--ui-ai-grok); }
body.new-ui :is(.dg-line, .dg-dot)[class*="dg-k-"] { stroke: var(--dg-c, var(--ui-ink-3)); }
body.new-ui .dg-dot.end[class*="dg-k-"] { fill: var(--dg-c, var(--ui-ink-3)); }
body.new-ui .dg-band[class*="dg-k-"] { fill: var(--dg-c, var(--ui-ink-3)); }
/* No AI named the brand: the sentence instead of flat lines at 0. */
body.new-ui .dui-zero { display: flex; flex-direction: column; gap: 14px; }
body.new-ui .ui-card:has(> .dui-zero) { align-self: start; }
body.new-ui .dui-zero-h { margin: 0; font: 600 20px/1.35 var(--ui-font); letter-spacing: -.01em; color: var(--ui-ink); max-width: 34ch; }
body.new-ui .dui-zero ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; }
body.new-ui .dui-zero li { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ui-ink-2); }
body.new-ui #dashUi .ui-card-f { color: var(--ui-ink-2); }

/* Since the last update */
body.new-ui .dui-chg { list-style: none; margin: 0; padding: 0; }
body.new-ui .dui-chg li {
  display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; padding: 9px 0;
  border-bottom: 1px solid var(--ui-line-2); font-size: 14px;
}
body.new-ui .dui-chg li:last-child { border-bottom: 0; }
body.new-ui .dui-chg svg {
  width: 16px; height: 16px; margin-top: 3px; fill: none; stroke: var(--ui-ink-3);
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
body.new-ui .dui-paste {
  margin-top: 12px; padding: 12px 14px; border: 1px solid var(--ui-line); border-radius: 10px;
  background: var(--ui-paper-2); font-size: 14px; line-height: 1.5;
}
body.new-ui .dui-paste p { margin: 0; }
body.new-ui .dui-paste .pk {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px;
  font-size: 12.5px; color: var(--ui-ink-3);
}
body.new-ui .dui-paste .ui-link { font-size: 12.5px; }

/* Question by question */
body.new-ui .dui-mxg { display: grid; grid-template-columns: minmax(0, 1fr) repeat(var(--cols), 72px); font-size: 13.5px; }
body.new-ui .dui-mxg > div { padding: 7px 0; border-bottom: 1px solid var(--ui-line-2); display: flex; align-items: center; }
body.new-ui .dui-mxg .hd {
  justify-content: center; text-align: center; padding-bottom: 9px; line-height: 1.2;
  font-size: 12px; color: var(--ui-ink-3);
}
body.new-ui .dui-mxg .hd:first-child { justify-content: flex-start; }
body.new-ui .dui-mxg .q { display: block; padding-right: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.new-ui .dui-mxg .qn { display: inline-block; min-width: 18px; margin-right: 8px; font-size: 12px; color: var(--ui-ink-3); font-variant-numeric: tabular-nums; }
body.new-ui .dui-mxg .c { justify-content: center; }
body.new-ui :is(.dui-mxg .c i, .dui-sw) { width: 14px; height: 14px; border-radius: 3px; background: var(--ui-rival-soft); display: inline-block; }
body.new-ui :is(.dui-mxg .c i, .dui-sw).on { background: var(--ui-accent); }
body.new-ui :is(.dui-mxg .c i, .dui-sw).r { background: var(--ui-rival); }
body.new-ui .dui-sw { width: 9px; height: 9px; border-radius: 2px; margin: 0 6px 0 14px; vertical-align: -1px; }
body.new-ui .dui-sw:first-child { margin-left: 0; }
body.new-ui .dui-mx-foot {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  padding-top: 12px; font-size: 13px; color: var(--ui-ink-3);
}
body.new-ui .dui-mx-foot .ui-link { font-size: 13px; }
body.new-ui .dui-mx-open { display: none; }

/* Next step and rivals */
body.new-ui .dui-next { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
body.new-ui .dui-next .k { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--ui-ink-2); }
body.new-ui .dui-next h3 { margin: 0; font-size: 19px; line-height: 1.3; letter-spacing: -.02em; font-weight: 600; }
body.new-ui .dui-next p { margin: 0; color: var(--ui-ink-2); font-size: 14px; }
body.new-ui .dui-next-acts { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
body.new-ui .dui-rvs { padding-top: 4px; }
body.new-ui .dui-rv {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center;
  padding: 11px 0; border-bottom: 1px solid var(--ui-line-2); font-size: 14px;
}
body.new-ui .dui-rv:last-child { border-bottom: 0; }
body.new-ui .dui-rv .ct { font: 13px var(--ui-mono); color: var(--ui-ink-2); text-align: right; }
body.new-ui .dui-rv .tie { grid-column: 1 / -1; display: flex; }
body.new-ui .dui-rv.me b { font-weight: 600; }
body.new-ui .dui-verdict {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px;
  border: 1px solid var(--ui-line); font-size: 12px; color: var(--ui-ink-2); white-space: nowrap;
}
body.new-ui .dui-verdict.gap { background: var(--ui-paper-2); color: var(--ui-ink); }

/* Runs */
body.new-ui .dui-chg-c { font-size: 13px; color: var(--ui-ink-3); }
body.new-ui .dui-chg-c.up { color: var(--ui-accent-ink); font-weight: 500; }
body.new-ui .dui-chg-c.down { color: var(--ui-neg); font-weight: 500; }
body.new-ui #dashUi .ui-tbl { margin-top: 6px; }

/* Loading and error */
body.new-ui .dui-skel .skel { background: var(--ui-paper-2); }
body.new-ui .dui-err .ui-error { display: flex; flex-direction: column; align-items: center; gap: 6px; }

/* First use */
body.new-ui .dui-cta {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center;
  padding: 30px 32px; margin-bottom: 26px;
}
body.new-ui .dui-cta h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.025em; line-height: 1.25; }
body.new-ui .dui-cta p { margin: 0; color: var(--ui-ink-2); max-width: 62ch; }
body.new-ui .dui-cta ol { margin: 14px 0 0; padding-left: 18px; color: var(--ui-ink-2); font-size: 14px; }
body.new-ui .dui-sample { position: relative; }
body.new-ui .dui-sample > .fx { opacity: .42; filter: grayscale(.6); pointer-events: none; user-select: none; }
body.new-ui .dui-sample-tag {
  position: absolute; top: -11px; left: 20px; z-index: 2; padding: 2px 10px;
  border: 1px solid var(--ui-line); border-radius: 999px; background: var(--ui-bg);
  font-size: 12.5px; color: var(--ui-ink-2);
}
body.new-ui .dui-sample-box { height: 220px; }
body.new-ui .dui-sample-svg { width: 100%; height: auto; display: block; padding: 6px 12px; box-sizing: border-box; }

@media (max-width: 900px) {
  body.new-ui .dui-head { flex-direction: column; align-items: stretch; margin-bottom: 16px; }
  body.new-ui .dui-head h1 { font-size: 22px; }
  body.new-ui .dui-acts { width: 100%; flex-wrap: nowrap; }
  body.new-ui .dui-acts .ui-btn { flex: 1; min-width: 0; height: 44px; padding: 0 10px; overflow: hidden; text-overflow: ellipsis; }
  /* Free plan: "Run again · from USD 49" needs the whole row to be read. */
  body.new-ui .dui-acts:has(.ct-locked) { flex-wrap: wrap; }
  body.new-ui .dui-acts .ui-btn.ct-locked { flex: 1 1 100%; }
  body.new-ui .dui-kpi-lead .big { font-size: 40px; }
  body.new-ui .dui-sq i { width: 9px; height: 9px; }
  body.new-ui .dg-chart.dg-wide { display: none; }
  body.new-ui .dg-chart.dg-phone { display: block; }
  body.new-ui .dui-chart { padding: 4px 8px; }
  body.new-ui .dui-mxg { grid-template-columns: minmax(0, 1fr) repeat(var(--cols), 48px); }
  body.new-ui .dui-mx .ui-card-b { display: none; }
  body.new-ui .dui-mx.open .ui-card-b { display: block; }
  body.new-ui .dui-mx .ui-card-h { padding-bottom: 16px; }
  body.new-ui .dui-mx-open { display: inline-flex; }
  body.new-ui #dashUi .hide-m { display: none; }
  body.new-ui #dashUi .ui-tbl :is(th, td) { padding-left: 10px; padding-right: 10px; white-space: nowrap; }
  body.new-ui #dashUi .ui-tbl :is(th, td):first-child { padding-left: 14px; }
  body.new-ui :is(.dui-paste .pk, .dui-mx-foot, .dui-next-acts) .ui-link,
  body.new-ui .dui-head .ui-link { min-height: 44px; display: inline-flex; align-items: center; }
  body.new-ui .dui-cta { grid-template-columns: 1fr; padding: 22px; }
  body.new-ui .dui-cta .ui-btn { width: 100%; }
  body.new-ui .dui-sample-tag { position: static; display: inline-block; margin-bottom: 10px; border-radius: 10px; }
  body.new-ui .dui-sample .ui-g12 + .ui-g12 { display: none; }   /* empty boxes say nothing on a phone */
}

/* The dashboard's other states (a brand being added, the first run in
   progress, a report opened below the page) keep the app's 920px column. */
body.new-ui .wrap.ui-wide #viewDashboard > :not(#dashUi) { max-width: 920px; margin-left: auto; margin-right: auto; }

/* Automatic measurement (monitor-status-ui.js). On: a line in the header,
   "● Gemini every week · next Oct 19 · Change". Off: a card under it. */
body.new-ui .dui-mm { display: inline; }
body.new-ui .dui-mm-dot { display: inline-block; vertical-align: middle; margin: -2px 7px 0 0; width: 7px; height: 7px; border-radius: 50%; background: var(--dui-mon-good); }
body.new-ui .dui-mm-dot.warn { background: var(--ui-warn); }
body.new-ui .dui-mm-spin {
  display: inline-block; vertical-align: middle; margin: -2px 7px 0 0;
  width: 9px; height: 9px; border-radius: 50%; border: 1.6px solid var(--dui-mon-good); border-right-color: transparent;
  animation: dui-mm-spin .9s linear infinite;
}
@keyframes dui-mm-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { body.new-ui .dui-mm-spin { animation: none; border-right-color: var(--dui-mon-good); } }
body.new-ui .dui-mm .ui-link { font-size: inherit; }
body.new-ui .dui-head .dui-mm .dui-menu { min-width: 280px; }
body.new-ui .dui-menu-info { margin: 0 0 4px; padding: 8px 10px 10px; font-size: 13px; line-height: 1.45; color: var(--ui-ink-2); border-bottom: 1px solid var(--ui-line-2); max-width: 320px; }
body.new-ui .dui-mb { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; margin: 0 0 18px; }
body.new-ui .dui-mb-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 13.5px; color: var(--ui-ink-2); }
body.new-ui .dui-mb-txt b { font-weight: 600; font-size: 14.5px; color: var(--ui-ink); }
body.new-ui .dui-mb-act { flex: none; }
body.new-ui .dui-mb-ro { font-size: 13px; color: var(--ui-ink-3); }
/* The green is quieter in dark mode, where the saturated tone glares (Valentina). */
body.new-ui { --dui-mon-good: var(--ui-good); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.new-ui { --dui-mon-good: color-mix(in srgb, var(--ui-good) 62%, var(--ui-ink-3)); }
}
:root[data-theme="dark"] body.new-ui { --dui-mon-good: color-mix(in srgb, var(--ui-good) 62%, var(--ui-ink-3)); }
@media (max-width: 900px) {
  body.new-ui .dui-mb { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px; margin-bottom: 12px; }
  body.new-ui .dui-mb-act .ui-btn { width: 100%; }
  /* The menu opens under the header text, full width, instead of off the screen's edge. */
  body.new-ui .dui-head .dui-id > div { position: relative; min-width: 0; }
  body.new-ui .dui-head .dui-mm .dui-mon { position: static; }
  body.new-ui .dui-head .dui-mm .dui-menu { left: -58px; right: 0; min-width: 0; }
  body.new-ui .dui-head .dui-mm .ui-link { min-height: 0; display: inline; }
}
/* Turn-on confirm: the report on screen is from another AI (monitor-status-ui.js monConfirmNote). */
.mon-cf-note { display: block; margin-top: 12px; padding: 10px 12px; border-radius: 8px; font-size: 13px;
  background: var(--ui-paper-2, rgba(127, 127, 127, .08)); color: var(--ui-ink-2, inherit); }
.mon-cf-note button.ui-link, body.new-ui #confirmModal .mon-cf-note button.ui-link, body.new-ui #confirmModal .mon-cf-note button.ui-link:hover:not(:disabled) {
  display: inline; margin: 0 0 0 4px; padding: 0; min-height: 0; height: auto; border: 0; border-radius: 0; box-shadow: none;
  background: none; color: var(--ui-ink, inherit); filter: none; font: inherit; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
