/* web/polish-home.css: the home area in the new view (release 350). Every rule under html[data-ux="new"]; the Classic view is untouched.
   Home (web/home.js, .hm-*) and its sibling tab Hits ([data-view-panel="hits"], web/hits.js). Theme tokens only, light and dark alike;
   overrides the first-cut .hm rules in shell.css. Calm cards, one blue accent, 14px base, numbers in the sans, tabular in columns. */

/* ---- the page ---------------------------------------------------------------------------------------------------- */
html[data-ux="new"] .hm { max-width: 1240px; font-size: var(--ds-text); color: var(--ink); }
html[data-ux="new"] .hm.is-busy .hm-tiles, html[data-ux="new"] .hm.is-busy .hm-grid { opacity: .6; transition: opacity var(--t-fast, .15s ease); }
html[data-ux="new"] .hm-loading { padding: 32px 0; text-align: center; }
html[data-ux="new"] .hm-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 8px 0 16px; }
html[data-ux="new"] .hm-head-txt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; min-width: 0; }
html[data-ux="new"] .hm-title { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; color: var(--ink); }
html[data-ux="new"] .hm-sub { font-size: 13px; color: var(--ink-soft); }
html[data-ux="new"] .hm-head-act { display: flex; align-items: center; gap: 8px; margin-left: auto; }
html[data-ux="new"] .hm-updated { font-size: 12.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
html[data-ux="new"] .hm-refresh { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink-soft); cursor: pointer; }
html[data-ux="new"] .hm-refresh:hover { color: var(--blue); border-color: var(--blue); background: var(--blue-tint); }
html[data-ux="new"] .hm-refresh:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---- the four tiles ---------------------------------------------------------------------------------------------- */
html[data-ux="new"] .hm-tiles { gap: 12px; margin-bottom: 16px; }
html[data-ux="new"] .hm-tile { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: var(--ds-radius); background: var(--card); color: var(--ink); text-decoration: none;
  transition: border-color var(--t-fast, .15s ease), box-shadow var(--t-fast, .15s ease); }
html[data-ux="new"] a.hm-tile:hover { border-color: var(--blue); box-shadow: var(--shadow); text-decoration: none; }
html[data-ux="new"] a.hm-tile:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
html[data-ux="new"] .hm-tile-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
html[data-ux="new"] .hm-tile-ico { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 28px; height: 28px;
  border-radius: 8px; background: var(--blue-tint); color: var(--blue); }
html[data-ux="new"] .hm-tile.is-none .hm-tile-ico { background: var(--slate-tint, var(--surface-soft)); color: var(--ink-soft); }
html[data-ux="new"] .hm-tile-label { min-width: 0; font-size: 13px; font-weight: 600; color: var(--ink-soft); overflow-wrap: anywhere; }
html[data-ux="new"] .hm-tile-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; min-width: 0; }
html[data-ux="new"] .hm-tile-num { margin: 2px 0 0; font-size: 30px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em;
  color: var(--ink); font-variant-numeric: normal; }
html[data-ux="new"] .hm-tile-num.is-none { color: var(--ink-faint); font-weight: 500; }
html[data-ux="new"] .hm-tile-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
html[data-ux="new"] .hm-tile-note { font-size: 12.5px; color: var(--ink-soft); overflow-wrap: anywhere; }
html[data-ux="new"] .hm-tile-extra { font-size: 12.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
html[data-ux="new"] .hm-delta { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 700; line-height: 18px; font-variant-numeric: tabular-nums; white-space: nowrap;
  background: var(--slate-tint, var(--surface-soft)); color: var(--ink-soft); }
html[data-ux="new"] .hm-delta.is-up { background: var(--green-tint); color: var(--green); }
html[data-ux="new"] .hm-delta.is-down { background: var(--red-tint); color: var(--red); }
html[data-ux="new"] .hm-arrow { display: block; flex: 0 0 auto; }
html[data-ux="new"] .hm-spark { display: block; flex: 0 0 auto; margin-bottom: 2px; overflow: visible; }
html[data-ux="new"] .hm-spark path { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
html[data-ux="new"] .hm-spark-old { stroke: var(--ink-faint); opacity: .7; }
html[data-ux="new"] .hm-spark-now { stroke: var(--blue); }
html[data-ux="new"] .hm-spark-dot { fill: var(--blue); stroke: var(--card); stroke-width: 2; }

/* ---- cards ------------------------------------------------------------------------------------------------------- */
html[data-ux="new"] .hm-grid { gap: 16px; }
html[data-ux="new"] .hm-card { min-width: 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--ds-radius); background: var(--card); }
html[data-ux="new"] .hm-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
html[data-ux="new"] .hm-h { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.3; color: var(--ink); }
html[data-ux="new"] .hm-card-sub { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-soft); }
html[data-ux="new"] .hm-total { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
html[data-ux="new"] .hm-total-n { font-size: 20px; font-weight: 700; line-height: 1.2; color: var(--ink); }
html[data-ux="new"] .hm-total-l { font-size: 12px; color: var(--ink-soft); }
html[data-ux="new"] .hm-count { flex: 0 0 auto; min-width: 26px; padding: 2px 9px; border-radius: 999px; background: var(--blue-fill, var(--blue)); color: #fff;
  font-size: 12.5px; font-weight: 700; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
html[data-ux="new"] .hm-count[hidden] { display: none; }
html[data-ux="new"] .hm-empty { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); overflow-wrap: anywhere; }

/* an empty part: says what it is and where its numbers come from */
html[data-ux="new"] .hm-emptybox { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px 16px; text-align: center;
  border-radius: var(--ds-radius); background: var(--surface-soft); }
html[data-ux="new"] .hm-emptybox .hm-empty { max-width: 46ch; }
html[data-ux="new"] .hm-emptybox-ico { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-bottom: 2px;
  border-radius: 999px; background: var(--blue-tint); color: var(--blue); }
html[data-ux="new"] .hm-emptybox-t { margin: 0; font-size: 14.5px; font-weight: 700; color: var(--ink); }
html[data-ux="new"] .hm-emptybox-a { display: inline-flex; align-items: center; min-height: 36px; margin-top: 6px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--blue); font-size: 13px; font-weight: 600; text-decoration: none; }
html[data-ux="new"] .hm-emptybox-a:hover { border-color: var(--blue); background: var(--blue-tint); text-decoration: none; }
/* the chart's empty state keeps the chart's height, so the page does not jump when numbers arrive */
html[data-ux="new"] .hm-empty-chart { min-height: 200px; justify-content: center; }

/* ---- the chart --------------------------------------------------------------------------------------------------- */
html[data-ux="new"] .hm-plot-host { position: relative; width: 100%; min-height: 190px; }
html[data-ux="new"] .hm-plot { display: block; overflow: visible; touch-action: pan-y; }
html[data-ux="new"] .hm-plot:focus { outline: none; }
html[data-ux="new"] .hm-plot:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 4px; }
html[data-ux="new"] .hm-grid-line { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
html[data-ux="new"] .hm-base-line { stroke: var(--ink-faint); stroke-opacity: .5; stroke-width: 1; shape-rendering: crispEdges; }
html[data-ux="new"] .hm-tick { fill: var(--ink-soft); font-size: 11.5px; font-variant-numeric: tabular-nums; }
html[data-ux="new"] .hm-area { fill: var(--blue); fill-opacity: .1; stroke: none; }
html[data-ux="new"] .hm-line { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
html[data-ux="new"] .hm-dot { fill: var(--blue); stroke: var(--card); stroke-width: 2; }
html[data-ux="new"] .hm-peak { fill: var(--ink); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
html[data-ux="new"] .hm-cross { stroke: var(--ink-faint); stroke-width: 1; shape-rendering: crispEdges; }
html[data-ux="new"] .hm-day { fill: transparent; cursor: crosshair; }
html[data-ux="new"] .hm-tip { position: absolute; z-index: 2; display: flex; flex-direction: column; gap: 1px; padding: 7px 10px; pointer-events: none;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card); box-shadow: var(--shadow); white-space: nowrap; }
html[data-ux="new"] .hm-tip[hidden] { display: none; }
html[data-ux="new"] .hm-tip-v { font-size: 15px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
html[data-ux="new"] .hm-tip-d { font-size: 12px; color: var(--ink-soft); }

/* ---- the to-dos -------------------------------------------------------------------------------------------------- */
html[data-ux="new"] .hm-todos { padding-bottom: 10px; }
html[data-ux="new"] .hm-todo { margin: 0 -10px; padding: 0; list-style: none; }
html[data-ux="new"] .hm-todo li { padding: 0; border: 0; font-size: var(--ds-text); }
html[data-ux="new"] .hm-todo li + li { border-top: 1px solid var(--line); }
html[data-ux="new"] .hm-todo li.is-warn { padding-left: 0; border-left: 0; }
html[data-ux="new"] .hm-todo li.is-warn + li.is-warn, html[data-ux="new"] .hm-todo li.is-warn + li { border-top-color: transparent; }
html[data-ux="new"] .hm-row, html[data-ux="new"] .hm-alert { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 10px;
  border-radius: 8px; color: var(--ink); font-weight: 500; text-decoration: none; }
html[data-ux="new"] .hm-row:hover { background: var(--blue-tint); text-decoration: none; }
html[data-ux="new"] .hm-row:focus-visible, html[data-ux="new"] .hm-alert:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
html[data-ux="new"] .hm-row-ico { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 32px; height: 32px;
  border-radius: 8px; background: var(--surface-soft); color: var(--ink-soft); }
html[data-ux="new"] .hm-row:hover .hm-row-ico { background: var(--card); color: var(--blue); }
html[data-ux="new"] .hm-row-txt { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
html[data-ux="new"] .hm-row-n { flex: 0 0 auto; min-width: 28px; padding: 2px 9px; border-radius: 999px; background: var(--blue-tint); color: var(--blue);
  font-size: 13px; font-weight: 700; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
html[data-ux="new"] .hm-chev { flex: 0 0 auto; color: var(--ink-faint); }
html[data-ux="new"] .hm-row:hover .hm-chev { color: var(--blue); }
html[data-ux="new"] .hm-todo li.is-quiet .hm-row-txt { color: var(--ink-soft); }
html[data-ux="new"] .hm-alert { align-items: flex-start; margin: 2px 0 6px; padding: 10px 12px; border: 1px solid var(--amber-line);
  background: var(--amber-tint); }
html[data-ux="new"] .hm-alert:hover { border-color: var(--amber); text-decoration: none; }
html[data-ux="new"] .hm-alert-ico { display: inline-flex; flex: 0 0 auto; margin-top: 1px; color: var(--amber); }
html[data-ux="new"] .hm-alert-txt { display: flex; flex: 1 1 auto; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
html[data-ux="new"] .hm-alert-txt strong { font-size: 14px; font-weight: 700; color: var(--ink); }
html[data-ux="new"] .hm-alert-txt span { font-size: 13px; color: var(--ink-soft); }
html[data-ux="new"] .hm-alert .hm-chev { align-self: center; }

/* ---- the best posts ---------------------------------------------------------------------------------------------- */
html[data-ux="new"] .hm-top { margin: 0; padding: 0; list-style: none; counter-reset: none; }
html[data-ux="new"] .hm-top li { display: flex; flex-wrap: nowrap; align-items: flex-start; justify-content: flex-start; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--line); font-size: var(--ds-text); }
html[data-ux="new"] .hm-top li:first-child { padding-top: 2px; }
html[data-ux="new"] .hm-top li:last-child { padding-bottom: 2px; border-bottom: 0; }
html[data-ux="new"] .hm-rank { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 26px; height: 26px;
  border-radius: 999px; background: var(--surface-soft); border: 1px solid var(--line); color: var(--ink-soft);
  font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
html[data-ux="new"] .hm-top li:first-child .hm-rank { background: var(--blue-fill, var(--blue)); border-color: var(--blue-fill, var(--blue)); color: #fff; }
html[data-ux="new"] .hm-top-main { display: flex; flex: 1 1 auto; flex-direction: column; gap: 4px; min-width: 0; }
html[data-ux="new"] .hm-top-title { min-width: 0; font-weight: 600; line-height: 1.4; color: var(--ink); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
html[data-ux="new"] .hm-top-title a { color: var(--ink); text-decoration: none; }
html[data-ux="new"] .hm-top-title a:hover { color: var(--blue); text-decoration: underline; }
html[data-ux="new"] .hm-top-when { font-size: 12px; color: var(--ink-soft); }
html[data-ux="new"] .hm-top-bar { display: block; height: 4px; margin-top: 2px; border-radius: 999px; background: var(--blue-tint); overflow: hidden; }
html[data-ux="new"] .hm-top-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--blue); }
html[data-ux="new"] .hm-top-num { display: flex; flex: 0 0 auto; flex-direction: column; align-items: flex-end; min-width: 64px; text-align: right; white-space: nowrap; }
html[data-ux="new"] .hm-top-num strong { font-size: 16px; font-weight: 700; line-height: 1.3; color: var(--ink); font-variant-numeric: tabular-nums; }
html[data-ux="new"] .hm-top-num > span { font-size: 12px; color: var(--ink-soft); }
html[data-ux="new"] .hm-top-num > span.sr-only { position: absolute; }

/* ---- layout ------------------------------------------------------------------------------------------------------ */
@media (min-width: 900px) {
  html[data-ux="new"] .hm-grid { grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); grid-template-areas: "chart todo" "best todo"; align-items: start; }
  html[data-ux="new"] .hm-chart { grid-area: chart; }
  html[data-ux="new"] .hm-todos { grid-area: todo; }
  html[data-ux="new"] .hm-best { grid-area: best; }
}
@media (max-width: 640px) {
  html[data-ux="new"] .hm-head { margin: 4px 0 12px; }
  html[data-ux="new"] .hm-title { font-size: 22px; }
  html[data-ux="new"] .hm-updated { display: none; }
  html[data-ux="new"] .hm-refresh { width: 44px; height: 44px; }
  html[data-ux="new"] .hm-tiles { gap: 10px; margin-bottom: 12px; }
  html[data-ux="new"] .hm-tile { padding: 14px; gap: 4px; }
  html[data-ux="new"] .hm-tile-ico { display: none; }
  html[data-ux="new"] .hm-tile-num { font-size: 26px; }
  html[data-ux="new"] .hm-tile .hm-spark { display: none; }
  html[data-ux="new"] .hm-tile-note { font-size: 12px; }
  html[data-ux="new"] .hm-grid { gap: 12px; }
  html[data-ux="new"] .hm-card { padding: 16px; }
  html[data-ux="new"] .hm-todo { margin: 0 -8px; }
  html[data-ux="new"] .hm-row { min-height: 52px; padding: 8px; }
}

/* ---- Hits, the sibling tab (new view only; web/hits.js and its markup unchanged) ------------------------------------ */
html[data-ux="new"] [data-view-panel="hits"] { max-width: 1240px; margin: 0 auto; }
html[data-ux="new"] [data-view-panel="hits"] > .section-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 8px 0 6px; padding: 0; border: 0; }
html[data-ux="new"] [data-view-panel="hits"] > .section-head h2 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2;
  text-transform: none; color: var(--ink); }
html[data-ux="new"] [data-view-panel="hits"] > .section-head .field--inline { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; margin: 0; }
html[data-ux="new"] [data-view-panel="hits"] > .section-head .field--inline > span { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
html[data-ux="new"] [data-view-panel="hits"] > .section-head select { min-height: 40px; width: auto; min-width: 120px; margin: 0; }
html[data-ux="new"] [data-view-panel="hits"] > .section-head .btn { min-height: 40px; }
html[data-ux="new"] [data-view-panel="hits"] > #hits-note { max-width: 78ch; margin: 0 0 16px; font-size: 13px; line-height: 1.5; color: var(--ink-soft); }
html[data-ux="new"] #hits-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
html[data-ux="new"] #hits-list > .hint { grid-column: 1 / -1; margin: 0; padding: 10px 14px; border-radius: var(--ds-radius); background: var(--surface-soft);
  border: 1px solid var(--line); font-size: 13px; color: var(--ink-soft); }
html[data-ux="new"] #hits-list > .empty { grid-column: 1 / -1; margin: 0; padding: 32px 16px; border: 1px solid var(--line); border-radius: var(--ds-radius);
  background: var(--card); text-align: center; color: var(--ink-soft); }
html[data-ux="new"] #hits-list .hit-card { display: flex; flex-direction: column; gap: 4px; min-width: 0; margin: 0; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: var(--ds-radius); background: var(--card); box-shadow: none; }
html[data-ux="new"] #hits-list .hit-card.is-top { border-color: var(--line); box-shadow: inset 3px 0 0 var(--amber); }
html[data-ux="new"] #hits-list .hit-card__head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
html[data-ux="new"] #hits-list .hit-card__mark { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 4px;
  border-radius: 6px; font-size: 11px; font-weight: 800; }
html[data-ux="new"] #hits-list .hit-card__brand { font-weight: 600; color: var(--ink); }
html[data-ux="new"] #hits-list .hit-card__when { margin-left: auto; font-size: 12.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
html[data-ux="new"] #hits-list .hit-card__title { margin: 6px 0 0; font-size: 16px; font-weight: 700; line-height: 1.35; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
html[data-ux="new"] #hits-list a.hit-card__title:hover { color: var(--blue); text-decoration: underline; }
html[data-ux="new"] #hits-list .hit-card__label { align-self: flex-start; margin-top: 2px; padding: 2px 8px; border-radius: 999px;
  background: var(--amber-tint); color: var(--amber); font-size: 12px; font-weight: 700; }
html[data-ux="new"] #hits-list .hit-card__label:empty { display: none; }
html[data-ux="new"] #hits-list .hit-card__counts { font-size: 12.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
html[data-ux="new"] #hits-list .hit-card__text { margin-top: 6px; font-size: var(--ds-text); line-height: 1.5; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
html[data-ux="new"] #hits-list .hit-card__actions { margin-top: 10px; }
html[data-ux="new"] #hits-list .hit-card__actions .btn { min-height: 36px; }
html[data-ux="new"] #hits-list .hit-card__sheet { gap: 8px; margin-top: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--ds-radius);
  background: var(--surface-soft); }
html[data-ux="new"] #hits-list .hit-card__sheet.hidden { display: none; }
html[data-ux="new"] #hits-list .hit-card__sheet .cmp-dest { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: var(--ds-text); color: var(--ink); cursor: pointer; }
html[data-ux="new"] #hits-list .hit-card__sheet .cmp-dest input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }
html[data-ux="new"] #hits-list .hit-card__sheet > .btn--primary { align-self: flex-start; width: auto; min-height: 40px; padding: 0 18px; }
html[data-ux="new"] #hits-list .hit-card__note { font-size: 12.5px; }
@media (min-width: 900px) {
  html[data-ux="new"] #hits-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  html[data-ux="new"] [data-view-panel="hits"] > .section-head h2 { font-size: 22px; flex: 1 1 100%; }
  html[data-ux="new"] [data-view-panel="hits"] > .section-head .spacer { display: none; }
  html[data-ux="new"] [data-view-panel="hits"] > .section-head select, html[data-ux="new"] [data-view-panel="hits"] > .section-head .btn { min-height: 44px; }
  html[data-ux="new"] #hits-list .hit-card { padding: 14px; }
  html[data-ux="new"] #hits-list .hit-card__actions .btn { min-height: 44px; }
}
