/* Home — one column, one rhythm (Claude Code 2026-11-16, owner: "homepage ui all align row column space gap — to be professional").
   The search row, the Word-of-the-day card and the six feature cards share the same left / right edges (already true) and now the
   same spacing: one gap between the blocks and inside the card grid (16 px tablet / PC, 12 px phones). Older rules that pushed the
   cards to the bottom (margin-top: auto), pulled the hero up (-10 px) or added room under the search bar are neutralised here.
   Loaded last. */
html body #v-home#v-home#v-home { --ha-gap: 16px; row-gap: var(--ha-gap) !important; }
@media (max-width: 599px) { html body #v-home#v-home#v-home { --ha-gap: 12px; } }
html body #v-home#v-home#v-home > :is(.home-search, .ms-slot, section.card.myspace, .shortcuts) { margin-top: 0 !important; margin-bottom: 0 !important; }
html body #v-home#v-home#v-home > .home-search { min-height: 0 !important; height: auto !important; padding-bottom: 0 !important; }
html body #v-home#v-home#v-home > .home-search > * { margin-bottom: 0 !important; }
html body #v-home#v-home#v-home > .shortcuts { gap: var(--ha-gap) !important; }
/* the search bar is an inline box: its text line left ~14 px of empty "descender" room under it — a flex row has none */
html body #v-home#v-home#v-home > .home-search { display: flex !important; flex-direction: column; }
/* phones: the logo row → search bar gap follows the same 12 px rhythm (it was 16) */
@media (max-width: 599px) { html body #v-home#v-home#v-home { padding-top: 0 !important; } }

/* wide screens (≥ 1600 px, the two-column Home with the dictionary panel): the top row follows the same two columns —
   the search bar spans exactly the main column (ends where the hero ends), Upgrade + Khmer share exactly the panel's width,
   and the column gap uses the same 16 px rhythm as the rows */
@media (min-width: 1600px) and (((hover: hover) and (pointer: fine)) or (orientation: landscape)) {
  html body #v-home#v-home#v-home:not([hidden]) { column-gap: var(--ha-gap) !important; }
  html body #v-home#v-home#v-home > .home-search { grid-column: 1 !important; padding-right: 0 !important; }
  body[data-route="home"] #brandHeader { width: 470px !important; }
  body[data-route="home"] #brandHeader .lang-row { width: 100% !important; display: flex !important; gap: var(--ha-gap, 16px) !important; justify-content: stretch; }
  body[data-route="home"] #brandHeader .lang-row > * { flex: 1 1 0 !important; min-width: 0 !important; justify-content: center; margin: 0 !important; }
}
/* the search form kept a 14 px bottom margin under the 60 px bar */
html body #v-home#v-home#v-home > .home-search .search { margin-bottom: 0 !important; }
@media (min-width: 1600px) and (((hover: hover) and (pointer: fine)) or (orientation: landscape)) {
  /* the grid spread leftover screen height into its rows (the top row grew from 60 to 85 px): rows keep their own height */
  html body #v-home#v-home#v-home:not([hidden]) { align-content: start !important; }
}
