/* ==========================================================================
   Home customization (docs/home-customization-contract.md,
   design_handoff_custom_home H1-H8, S1-S2).

   Everything is hc-*. The only rules that reach outside are the two blocks
   under "Standard Home", which hide the existing page while a custom layout
   shows. Nothing restyles an xf-/xh- element.

   Tokens follow the Home language: paper #eceef1, ink #101418, Inter, a
   strong hairline at 38% and a row hairline at 14%. Dark is the base and
   html.si-light overrides, as on every other themed page.
   ========================================================================== */

.hc-root, .hc-dialog {
  --hc-ink: 241, 243, 245;
  --hc-bg: #14171b;
  --hc-raise: #1d2126;
  --hc-on: #14171b;
  --hc-line: rgba(255, 255, 255, 0.1);
  --hc-line-strong: rgba(255, 255, 255, 0.24);
  --hc-danger: #e2776c;
  --hc-up: #35c66b;
  --hc-down: #e5595b;
  --hc-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  color: rgb(var(--hc-ink));
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  -webkit-text-size-adjust: 100%;
}
html.si-light :is(.hc-root, .hc-dialog) {
  --hc-ink: 16, 20, 24;
  --hc-bg: #eceef1;
  --hc-raise: #fff;
  --hc-on: #fff;
  --hc-line: rgba(16, 20, 24, 0.14);
  --hc-line-strong: rgba(16, 20, 24, 0.38);
  --hc-danger: #bf5349;
  --hc-up: #16a34a;
  --hc-down: #dc2626;
  --hc-shadow: 0 14px 34px rgba(16, 20, 24, 0.22);
}

/* ---- Standard Home ---------------------------------------------------------
   Hidden, never removed, while a custom layout shows (or is about to: the
   inline script in the component sets html.hc-pending before first paint).
   The fixed control bar, the Wire and the closing plans section are page
   chrome and stay. The conference chips only scope Standard Home modules. */
#xhPage.hc-custom-on > :not(.hc-root):not(.xf-cbar):not(.om-wire):not(.home-plans):not(script),
html.hc-pending #xhPage > :not(.hc-root):not(.xf-cbar):not(.om-wire):not(.home-plans):not(script) {
  display: none !important;
}
#xhPage.hc-custom-on .xf-cbar-scope,
html.hc-pending #xhPage .xf-cbar-scope { visibility: hidden; }

/* ---- reset: keep Pico out ---------------------------------------------------
   Checked against pico@2.0.6. The element reset scopes with :where(), so it
   weighs the same as Pico's element rules (0,0,1), wins by coming later, and
   is outranked by every hc- class below. Buttons and links are the exception:
   Pico styles those by attribute, so their reset carries a class and the
   component rules carry two.
   Pico gives every <section> a bottom margin. The root takes none, so an
   empty root adds nothing above Standard Home. */
.hc-root { position: relative; margin: 0; padding: 0 40px; min-width: 0; }
/* Same gutters as the Standard Home sections (40px, 20px from 900px down). */
@media (max-width: 900px) { .hc-root { padding: 0 20px; } }

:is(.hc-root, .hc-dialog) *, :is(.hc-root, .hc-dialog) *::before, :is(.hc-root, .hc-dialog) *::after { box-sizing: border-box; }
:is(.hc-root, .hc-dialog) [hidden] { display: none !important; }
:where(.hc-root, .hc-dialog) :is(h1, h2, h3, p, ul, ol, li, header, footer, label, article, aside) {
  margin: 0; padding: 0; color: inherit; background: none; border: 0; border-radius: 0; box-shadow: none;
  font-family: inherit; font-size: inherit; font-weight: inherit; line-height: inherit; text-align: inherit;
}
/* Pico turns [role=group] into a joined button group and [aria-busy] into a
   spinner. Neither is wanted on a widget toolbar or a segmented control. */
:is(.hc-root, .hc-dialog) [role="group"] { width: auto; margin-bottom: 0; box-shadow: none !important; }
:is(.hc-root, .hc-dialog) [role="group"] > *, :is(.hc-root, .hc-dialog) [role="group"] button { margin-left: 0 !important; }
:is(.hc-root, .hc-dialog) [role="group"] .hc-tool { border-radius: 9px !important; }
:is(.hc-root, .hc-dialog) [role="group"] .hc-seg-btn { border-radius: 999px !important; }
:is(.hc-root, .hc-dialog) :is(ul, ol), :is(.hc-root, .hc-dialog) li { list-style: none !important; }
:is(.hc-root, .hc-dialog) button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: auto; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 0;
  background: transparent; background-image: none; box-shadow: none;
  color: inherit; font: inherit; line-height: 1.3; cursor: pointer;
}
:is(.hc-root, .hc-dialog) button:disabled { cursor: default; opacity: 0.4; }
:is(.hc-root, .hc-dialog) a { color: inherit; text-decoration: none; box-shadow: none; background: none; }
:is(.hc-root, .hc-dialog) :is(button, a, input, select, .hc-w):focus-visible {
  outline: 2px solid rgba(var(--hc-ink), 0.75); outline-offset: 2px; box-shadow: none;
}
:is(.hc-root, .hc-dialog) :is(button, a):focus:not(:focus-visible) { outline: none; box-shadow: none; }
:is(.hc-root, .hc-dialog) img { background: transparent !important; box-shadow: none !important; max-width: 100%; }
.hc-icon { flex: none; display: block; }

.hc-sr {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ---- buttons ---------------------------------------------------------------- */
:is(.hc-root, .hc-dialog) .hc-btn {
  min-height: 36px; padding: 0 16px; border: 1px solid var(--hc-line-strong); border-radius: 999px;
  font-size: 13px; font-weight: 700; white-space: nowrap; color: rgb(var(--hc-ink));
  transition: background 0.15s, border-color 0.15s;
}
:is(.hc-root, .hc-dialog) .hc-btn:hover:not(:disabled) { background: rgba(var(--hc-ink), 0.06); border-color: rgba(var(--hc-ink), 0.6); }
:is(.hc-root, .hc-dialog) .hc-btn--solid { background: rgb(var(--hc-ink)); border-color: transparent; color: var(--hc-on); }
:is(.hc-root, .hc-dialog) .hc-btn--solid:hover:not(:disabled) { background: rgba(var(--hc-ink), 0.84); border-color: transparent; }
:is(.hc-root, .hc-dialog) .hc-btn--danger { border-color: var(--hc-danger); color: var(--hc-danger); }
:is(.hc-root, .hc-dialog) .hc-btn--danger:hover:not(:disabled) { background: var(--hc-danger); border-color: var(--hc-danger); color: #fff; }
:is(.hc-root, .hc-dialog) .hc-btn--small { min-height: 32px; padding: 0 11px; border-radius: 9px; font-size: 12.5px; }
:is(.hc-root, .hc-dialog) a.hc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; line-height: 1.3; }

:is(.hc-root, .hc-dialog) .hc-tool {
  width: 32px; height: 32px; flex: none; border: 1px solid var(--hc-line-strong); border-radius: 9px;
}
:is(.hc-root, .hc-dialog) .hc-tool:hover:not(:disabled) { background: rgba(var(--hc-ink), 0.06); border-color: rgba(var(--hc-ink), 0.6); }

:is(.hc-root, .hc-dialog) .hc-seg { display: inline-flex; flex: none; width: auto; padding: 2px; border: 1px solid var(--hc-line-strong); border-radius: 999px; }
:is(.hc-root, .hc-dialog) .hc-seg-btn { flex: none; min-height: 26px; padding: 0 11px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: rgba(var(--hc-ink), 0.7); }
:is(.hc-root, .hc-dialog) .hc-seg-btn[aria-pressed="true"] { background: rgb(var(--hc-ink)); color: var(--hc-on); }

.hc-badge {
  display: inline-block; padding: 1px 6px; border: 1px solid var(--hc-line-strong); border-radius: 999px;
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.6px; line-height: 1.5; text-transform: uppercase;
  color: rgba(var(--hc-ink), 0.72); white-space: nowrap; vertical-align: 1px;
}
.hc-badge.is-live { border-color: var(--hc-down); color: var(--hc-down); }
.hc-tag {
  display: inline-block; padding: 2px 6px; border-radius: 4px; background: rgb(var(--hc-ink)); color: var(--hc-on);
  font-size: 9px; font-weight: 800; letter-spacing: 0.8px; line-height: 1.4; text-transform: uppercase; vertical-align: 2px;
}

/* ---- call to action (S2) --------------------------------------------------- */
.hc-cta {
  display: flex; align-items: center; gap: 18px; margin: 0 0 22px; padding: 14px 18px;
  border: 1px solid var(--hc-line-strong); border-radius: 14px;
}
html.hc-cta-off .hc-cta, html.hc-pending .hc-cta { display: none; }
.hc-cta-copy { flex: 1 1 auto; min-width: 0; }
.hc-cta-title { font-size: 15px; font-weight: 800; letter-spacing: -0.2px; line-height: 1.3; }
.hc-cta-text { margin-top: 2px; font-size: 13px; line-height: 1.5; color: rgba(var(--hc-ink), 0.66); }
.hc-cta-actions { flex: none; display: flex; align-items: center; gap: 16px; }
.hc-root .hc-cta-dismiss { font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; min-height: 36px; padding: 0 2px; }
@media (max-width: 640px) {
  .hc-cta { flex-direction: column; align-items: stretch; gap: 12px; }
  .hc-cta-actions { justify-content: space-between; }
}

/* ---- header (H1): HOME, rule, layout switcher, Edit Home -------------------- */
.hc-head { margin: 0 0 18px; }
.hc-head-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hc-head-label { flex: none; font-size: 12px; font-weight: 800; letter-spacing: 1.4px; line-height: 1.3; text-transform: uppercase; color: rgba(var(--hc-ink), 0.8); }
.hc-head-rule { flex: 1 1 24px; min-width: 24px; height: 1px; background: var(--hc-line-strong); }
.hc-switch { position: relative; flex: 0 1 auto; min-width: 0; }
.hc-root .hc-switch-btn { max-width: 100%; gap: 8px; }
.hc-switch-name { overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.hc-switch-btn[aria-expanded="true"] .hc-icon { transform: rotate(180deg); }

.hc-menu {
  position: absolute; z-index: 60; top: calc(100% + 8px); right: 0; width: 320px; max-width: calc(100vw - 28px);
  padding: 6px; border: 1px solid var(--hc-line-strong); border-radius: 14px; background: var(--hc-raise); box-shadow: var(--hc-shadow);
}
.hc-root .hc-menu-item {
  display: flex; align-items: flex-start; justify-content: flex-start; gap: 10px; width: 100%;
  padding: 9px 10px; border-radius: 9px; text-align: left;
}
.hc-root .hc-menu-item:hover, .hc-root .hc-menu-item:focus-visible { background: rgba(var(--hc-ink), 0.06); }
.hc-root .hc-menu-item[aria-disabled="true"] { opacity: 0.45; cursor: default; }
.hc-menu-mark { flex: none; width: 16px; height: 18px; display: grid; place-items: center; }
.hc-menu-copy { display: flex; flex-direction: column; min-width: 0; }
.hc-menu-text { font-size: 13.5px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.hc-menu-note { font-size: 11.5px; font-weight: 600; color: rgba(var(--hc-ink), 0.55); }
.hc-menu-rule { display: block; height: 1px; margin: 6px 4px; background: var(--hc-line); }
@media (max-width: 640px) {
  /* Anchor the menu to the row, not the pill, so it cannot leave the screen. */
  .hc-head-row { position: relative; }
  .hc-switch { position: static; }
  .hc-menu { left: 0; right: 0; width: auto; max-width: none; }
  .hc-switch-name { max-width: 130px; }
}

.hc-note {
  display: flex; align-items: center; gap: 14px; margin-top: 12px; padding: 12px 16px;
  border: 1px solid var(--hc-line-strong); border-radius: 14px;
}
.hc-note.is-ink { border-color: rgb(var(--hc-ink)); }
.hc-note.is-alert { border-color: var(--hc-danger); }
.hc-note-text { flex: 1 1 auto; min-width: 0; font-size: 13px; line-height: 1.5; color: rgba(var(--hc-ink), 0.72); }
.hc-note-text b { font-weight: 800; color: rgb(var(--hc-ink)); }
.hc-note.is-alert .hc-note-text { color: rgb(var(--hc-ink)); }
.hc-note > .hc-btn { flex: none; }
@media (max-width: 640px) { .hc-note { flex-direction: column; align-items: stretch; } }

/* ---- grid ------------------------------------------------------------------- */
.hc-stage { margin: 0 0 40px; }
.hc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
.hc-grid.is-narrow { grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (max-width: 1099px) { .hc-grid { gap: 18px; } }
@media (max-width: 839px) { .hc-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; } }

.hc-w {
  position: relative; grid-column: 1 / -1; min-width: 0; display: flex; flex-direction: column;
  border: 1px solid var(--hc-line-strong); border-radius: 16px; background: var(--hc-bg);
}
.hc-w.is-half { grid-column: span 1; }
.hc-grid.is-narrow .hc-w { grid-column: 1 / -1; }
@media (max-width: 839px) { .hc-w.is-half { grid-column: 1 / -1; } }
.hc-w-preview { flex: 1 1 auto; min-width: 0; padding: 18px 20px 16px; }
@media (max-width: 640px) { .hc-w-preview { padding: 16px 16px 14px; } }

.hc-w-head { display: flex; align-items: center; gap: 12px; margin: 0 0 8px; min-width: 0; }
.hc-root .hc-w-title { flex: none; max-width: 70%; font-size: 12px; font-weight: 800; letter-spacing: 1.4px; line-height: 1.3; text-transform: uppercase; }
.hc-w-meta {
  flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: rgba(var(--hc-ink), 0.62);
}
.hc-w-meta:empty { display: none; }
.hc-w-rule { flex: 1 1 12px; min-width: 12px; height: 1px; background: var(--hc-line-strong); }
.hc-w-more { flex: none; }
.hc-w-more:empty { display: none; }
.hc-root .hc-w-link { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.hc-root .hc-w-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.hc-w-link .hc-icon, .hc-btn .hc-icon { width: 13px; height: 13px; }
.hc-w-foot { margin-top: 10px; font-size: 11px; font-weight: 600; line-height: 1.5; color: rgba(var(--hc-ink), 0.55); }

/* ---- rows ------------------------------------------------------------------- */
.hc-row { border-bottom: 1px solid var(--hc-line); break-inside: avoid; min-width: 0; }
.hc-row-in { display: flex; align-items: center; gap: 10px; padding: 8px 0; min-width: 0; }
.hc-root a.hc-row-in:hover .hc-row-title, .hc-root a.hc-lead-in:hover .hc-row-title { text-decoration: underline; text-underline-offset: 3px; }
.hc-row-lead { flex: none; width: 20px; font-size: 12.5px; font-weight: 700; color: rgba(var(--hc-ink), 0.5); }
.hc-row-img { flex: none; width: 20px; height: 20px; display: grid; place-items: center; overflow: hidden; }
.hc-row-img img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 0; }
.hc-row-img.is-mono { border-radius: 50%; background: rgba(var(--hc-ink), 0.08); font-size: 10px; font-weight: 800; color: rgba(var(--hc-ink), 0.7); }
.hc-row-img.is-empty { display: none; }
.hc-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.hc-row-title { font-size: 13px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.hc-row-sub { font-size: 11.5px; font-weight: 600; line-height: 1.45; color: rgba(var(--hc-ink), 0.6); overflow-wrap: anywhere; }
.hc-row-meta { font-size: 11px; font-weight: 600; line-height: 1.45; color: rgba(var(--hc-ink), 0.55); }
.hc-row-meta .hc-icon { display: inline-block; width: 11px; height: 11px; vertical-align: -1px; }
.hc-row-kicker { font-size: 10px; font-weight: 800; letter-spacing: 1px; line-height: 1.4; text-transform: uppercase; color: rgba(var(--hc-ink), 0.6); }
.hc-row-trail { flex: none; display: flex; align-items: baseline; gap: 10px; max-width: 46%; text-align: right; font-size: 13px; }
.hc-row-trail b { font-weight: 800; white-space: nowrap; }
.hc-row-trail i { font-style: normal; font-size: 11px; font-weight: 600; color: rgba(var(--hc-ink), 0.55); white-space: nowrap; }
.hc-row-trail b.is-up { color: var(--hc-up); font-size: 11.5px; }
.hc-row-trail b.is-down { color: var(--hc-down); font-size: 11.5px; }

/* rank, standings: one line per team */
.hc-row--rank .hc-row-main { flex-direction: row; align-items: baseline; gap: 8px; }
.hc-row--rank .hc-row-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; }
.hc-row--rank .hc-row-sub { flex: none; white-space: nowrap; }
.hc-row--rank .hc-row-trail b:first-child { font-weight: 600; color: rgba(var(--hc-ink), 0.8); }

/* trending: name, then the hook on the same line when it fits */
.hc-row--entity .hc-row-main { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
.hc-row--entity .hc-row-kicker { order: 2; }
.hc-row--entity .hc-row-sub { order: 3; flex: 1 1 200px; }
.hc-row--entity .hc-row-img, .hc-row--take .hc-row-img { width: 26px; height: 26px; }
.hc-row--take .hc-row-img, .hc-row--stat .hc-row-img { border-radius: 50%; }
.hc-row--take .hc-row-img img, .hc-row--stat .hc-row-img img { object-fit: cover; }
.hc-row--take .hc-row-in { align-items: flex-start; }
.hc-row--take .hc-row-title {
  font-weight: 600; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}

/* my teams */
.hc-row--team .hc-row-in { align-items: flex-start; gap: 12px; padding: 10px 0; }
.hc-row--team .hc-row-img { width: 36px; height: 36px; }
.hc-row--team .hc-row-img.is-mono { font-size: 14px; }
.hc-row--team .hc-row-title { font-size: 14px; font-weight: 800; }
.hc-row--team .hc-row-trail { flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; }

/* news, saved, brief */
.hc-row--news .hc-row-in, .hc-row--brief .hc-row-in { align-items: flex-start; gap: 12px; padding: 10px 0; }
.hc-row-thumb { flex: none; width: 64px; aspect-ratio: 16 / 10; border-radius: 6px; overflow: hidden; background: rgba(var(--hc-ink), 0.07); }
.hc-row-thumb img, .hc-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hc-row-thumb.is-empty { display: none; }
.hc-row--brief .hc-row-lead { padding-top: 1px; }
.hc-row--brief .hc-row-title { font-size: 15px; font-weight: 800; letter-spacing: -0.2px; line-height: 1.3; }
.hc-row--brief .hc-row-sub {
  font-size: 12.5px; font-weight: 500; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}

/* tasks */
.hc-row--task .hc-row-trail { align-items: center; }
.hc-row--task.is-done .hc-row-main, .hc-row--task.is-done .hc-row-trail b { opacity: 0.55; }

/* games: two sides, their scores, then the status column */
.hc-row.is-matchup .hc-row-in { gap: 10px; }
.hc-game-sides { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hc-game-side { display: flex; align-items: baseline; gap: 6px; min-width: 0; font-size: 13px; }
.hc-game-side b { flex: 1 1 auto; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-game-side em { flex: none; font-style: normal; font-weight: 800; }
.hc-game-side.is-trail { color: rgba(var(--hc-ink), 0.5); }
.hc-game-rank { flex: none; min-width: 14px; font-size: 10.5px; font-weight: 700; color: rgba(var(--hc-ink), 0.5); text-align: right; }
.hc-game-rank:empty { display: none; }
.hc-game-status { flex: none; width: 84px; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; text-align: right; }
.hc-game-status b { font-size: 10.5px; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase; color: rgba(var(--hc-ink), 0.6); }
.hc-game-status i { font-style: normal; font-size: 10.5px; font-weight: 600; color: rgba(var(--hc-ink), 0.5); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-game-status.is-live b:first-child { color: var(--hc-down); }

/* video */
.hc-row--video .hc-row-in { align-items: flex-start; gap: 12px; padding: 10px 0; }
.hc-media { position: relative; flex: none; display: block; width: 104px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: rgba(var(--hc-ink), 0.09); }
.hc-media-play {
  position: absolute; inset: 0; margin: auto; width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 50%; background: rgba(16, 20, 24, 0.72); color: #fff;
}
.hc-media-play .hc-icon { width: 14px; height: 14px; }
.hc-media-copy { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

/* full width: the first story leads */
.hc-split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.hc-lead-in { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hc-lead .hc-media { width: 100%; border-radius: 12px; }
.hc-lead .hc-media-play { width: 56px; height: 56px; }
.hc-lead .hc-media-play .hc-icon { width: 26px; height: 26px; }
.hc-lead .hc-row-title { font-size: 18px; font-weight: 800; letter-spacing: -0.3px; line-height: 1.25; }
@media (max-width: 1099px) { .hc-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; } }

/* full width: two columns of rows, games in three */
.hc-w.is-wide .hc-list:is(.hc-list--rank, .hc-list--stat, .hc-list--entity, .hc-list--team, .hc-list--take, .hc-list--list),
.hc-w.is-wide .hc-w-body > .hc-list:is(.hc-list--news, .hc-list--video) { columns: 2; column-gap: 36px; }
.hc-w.is-wide .hc-list--score { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 28px; }
@media (max-width: 1099px) { .hc-w.is-wide .hc-list--score { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- widget states (S1) ------------------------------------------------------ */
.hc-state { padding: 14px 0 6px; }
.hc-state-title { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 800; letter-spacing: -0.2px; line-height: 1.35; }
.hc-state-text { margin-top: 4px; max-width: 60ch; font-size: 12.5px; line-height: 1.55; color: rgba(var(--hc-ink), 0.62); }
.hc-state > .hc-btn, .hc-state-actions { margin-top: 12px; }
.hc-state-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.hc-skel { padding: 2px 0; }
.hc-skel-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--hc-line); }
.hc-skel-row i { display: block; height: 9px; border-radius: 999px; background: rgba(var(--hc-ink), 0.08); animation: hc-pulse 1.4s ease-in-out infinite; }
.hc-skel-row i:nth-child(1) { width: 18px; }
.hc-skel-row i:nth-child(2) { width: 16px; height: 16px; border-radius: 50%; }
.hc-skel-row i:nth-child(3) { flex: 1 1 auto; }
.hc-skel-row i:nth-child(4) { width: 36px; }
@keyframes hc-pulse { 50% { opacity: 0.45; } }

.hc-pending-skel { display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 0 0 40px; }
html.hc-pending .hc-pending-skel { display: grid; }
/* The custom page has nothing else to show until the layout arrives. */
.hc-root:not(.is-ready) .hc-pending-skel.is-first { display: grid; }
.hc-pending-card { display: flex; flex-direction: column; gap: 16px; padding: 22px 20px; border: 1px solid var(--hc-line-strong); border-radius: 16px; }
.hc-pending-card span { display: block; height: 9px; border-radius: 999px; background: rgba(var(--hc-ink), 0.08); animation: hc-pulse 1.4s ease-in-out infinite; }
.hc-pending-card span:first-child { width: 38%; }
@media (max-width: 839px) { .hc-pending-skel { grid-template-columns: minmax(0, 1fr); gap: 14px; } }

.hc-empty, .hc-add-tile {
  grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 84px; padding: 16px 20px; border: 1.5px dashed var(--hc-line-strong); border-radius: 16px; text-align: center;
}
.hc-add-tile.is-empty, .hc-empty { align-items: flex-start; padding: 28px 24px; text-align: left; }
.hc-empty > .hc-btn, .hc-add-tile > .hc-btn { margin-top: 12px; }
.hc-root .hc-add-btn { min-height: 44px; padding: 0 18px; border-radius: 999px; font-size: 13.5px; font-weight: 700; }
.hc-root .hc-add-btn:hover:not(:disabled) { background: rgba(var(--hc-ink), 0.06); }

/* ---- edit mode (H2) ----------------------------------------------------------- */
.hc-editbar {
  position: fixed; z-index: 880; top: calc(var(--site-nav-h, 57px) + 66px);
  left: calc(var(--rail-w, 76px) + 40px); right: 40px;
  padding: 12px 16px; border: 1px solid rgb(var(--hc-ink)); border-radius: 14px;
  background: var(--hc-bg); box-shadow: 0 8px 24px rgba(16, 20, 24, 0.14);
}
body:has(.om-wire) .hc-editbar { top: calc(var(--site-nav-h, 57px) + 103px); }
/* The bar is fixed (body{overflow-x:hidden} unsticks sticky here), so the page
   reserves its height. It overlaps the content start by its height less 10px. */
.hc-root.is-editing { padding-top: calc(var(--hc-editbar-h, 62px) + 8px); }
.hc-editbar-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hc-editbar-info { flex: 1 1 200px; min-width: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.hc-editbar-name { font-size: 15px; font-weight: 800; letter-spacing: -0.2px; overflow-wrap: anywhere; }
.hc-editbar-status { font-size: 12.5px; font-weight: 600; color: rgba(var(--hc-ink), 0.62); }
.hc-editbar-actions { flex: none; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hc-editbar .hc-note { margin-top: 10px; padding: 10px 14px; }
@media (max-width: 900px) { .hc-editbar { left: calc(var(--rail-w, 0px) + 20px); right: 20px; } }
@media (max-width: 719px) {
  /* Phones: the controls dock above the section bar, two by two (H8). */
  .hc-editbar {
    top: auto !important; left: 10px; right: 10px;
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    padding: 10px 12px 12px; box-shadow: 0 -6px 24px rgba(16, 20, 24, 0.16);
  }
  .hc-root.is-editing { padding-top: 0; }
  .hc-root.is-editing .hc-stage { margin-bottom: calc(var(--hc-editbar-h, 150px) + 28px); }
  .hc-editbar-info { flex-basis: 100%; }
  .hc-editbar-actions { flex: 1 1 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .hc-editbar-actions .hc-btn { min-height: 44px; font-size: 14px; }
}

.hc-w.is-editable { border: 1.5px dashed var(--hc-line-strong); }
.hc-root .hc-w-tools {
  display: flex; width: auto; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px;
  border-bottom: 1px solid var(--hc-line); border-radius: 15px 15px 0 0; background: rgba(var(--hc-ink), 0.035);
}
.hc-drag { flex: none; display: grid; place-items: center; width: 20px; height: 32px; color: rgba(var(--hc-ink), 0.5); cursor: grab; }
.hc-drag:active { cursor: grabbing; }
@media (hover: none), (max-width: 839px) { .hc-drag { display: none; } }
.hc-w-id { flex: 1 1 140px; min-width: 0; display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 8px; row-gap: 1px; }
.hc-w-name { font-size: 13.5px; font-weight: 800; }
.hc-w-summary { font-size: 11.5px; font-weight: 600; color: rgba(var(--hc-ink), 0.6); }
.hc-w-note { font-size: 11px; font-weight: 600; color: rgba(var(--hc-ink), 0.5); }
.hc-w-flag { font-size: 11px; font-weight: 800; color: var(--hc-danger); }
.hc-w-only { flex: none; padding: 0 4px; font-size: 11px; font-weight: 700; color: rgba(var(--hc-ink), 0.6); }
.hc-w-btns { flex: none; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hc-grid.is-narrow .hc-w-tools .hc-seg, .hc-grid.is-narrow .hc-w-note { display: none; }
@media (max-width: 839px) { .hc-w-tools .hc-seg, .hc-w-note { display: none; } }
@media (max-width: 719px) { .hc-root .hc-w-tools .hc-tool { width: 44px; height: 44px; } }

.hc-w-preview.is-preview { max-height: 170px; overflow: hidden; opacity: 0.55; }
.hc-w-preview.is-preview:not([inert]) { max-height: none; opacity: 1; }
.hc-w-preview[inert] { pointer-events: none; -webkit-user-select: none; user-select: none; }

.hc-w.is-dragging {
  border: 1.5px solid rgb(var(--hc-ink)); background: var(--hc-raise);
  box-shadow: 0 14px 34px rgba(16, 20, 24, 0.18); transform: rotate(-0.6deg);
}
/* The drop line marks a place in the LIST, never a free position. */
.hc-w.is-drop-before::before, .hc-w.is-drop-after::after {
  content: ""; position: absolute; left: 0; right: 0; height: 4px; border-radius: 2px; background: rgb(var(--hc-ink));
}
.hc-w.is-drop-before::before { top: -14px; }
.hc-w.is-drop-after::after { bottom: -14px; }
.hc-grid:not(.is-narrow) .hc-w.is-half.is-drop-before::before,
.hc-grid:not(.is-narrow) .hc-w.is-half.is-drop-after::after { top: 0; bottom: 0; right: auto; width: 4px; height: auto; }
.hc-grid:not(.is-narrow) .hc-w.is-half.is-drop-before::before { left: -14px; }
.hc-grid:not(.is-narrow) .hc-w.is-half.is-drop-after::after { left: auto; right: -14px; }

/* ---- dialogs ------------------------------------------------------------------- */
.hc-dialog:not([open]) { display: none !important; }
.hc-dialog[open] {
  display: flex; flex-direction: column; position: fixed; inset: 0; margin: auto;
  width: min(440px, calc(100vw - 28px)); min-width: 0; max-width: none;
  height: fit-content; min-height: 0; max-height: calc(100dvh - 48px);
  padding: 0; overflow: hidden; border: 1px solid var(--hc-line-strong); border-radius: 16px;
  background: var(--hc-raise); box-shadow: var(--hc-shadow);
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.hc-dialog::backdrop { background: rgba(16, 20, 24, 0.38); }
.hc-dialog--small[open] { width: min(400px, calc(100vw - 28px)); }
.hc-dialog--manager[open] { width: min(540px, calc(100vw - 28px)); }
.hc-dialog--sheet[open] { width: min(520px, calc(100vw - 28px)); }
.hc-dialog--drawer[open] {
  inset: 0 0 0 auto; margin: 0; width: min(420px, 100vw); height: 100dvh; max-height: 100dvh;
  border-width: 0 0 0 1px; border-radius: 0;
}
.hc-dialog-head { flex: none; display: flex; align-items: center; gap: 12px; padding: 18px 20px 6px; }
.hc-dialog .hc-dialog-title { flex: 1 1 auto; min-width: 0; font-size: 17px; font-weight: 800; letter-spacing: -0.3px; line-height: 1.3; overflow-wrap: anywhere; }
.hc-dialog-count { flex: none; font-size: 11.5px; font-weight: 700; color: rgba(var(--hc-ink), 0.6); }
.hc-dialog-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 20px 8px; }
.hc-dialog-text { font-size: 13px; line-height: 1.55; color: rgba(var(--hc-ink), 0.68); }
.hc-dialog-text + .hc-dialog-text { margin-top: 8px; }
.hc-dialog-reason { font-weight: 700; color: rgb(var(--hc-ink)); }
.hc-dialog .hc-dialog-error { flex: none; padding: 4px 20px 0; font-size: 12.5px; font-weight: 700; line-height: 1.5; color: var(--hc-danger); }
.hc-dialog-foot { flex: none; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 12px 20px 18px; }
.hc-dialog-foot:empty { padding: 0 0 12px; }
.hc-dialog-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-right: auto; }
.hc-dialog-hint { font-size: 11.5px; font-weight: 600; color: rgba(var(--hc-ink), 0.55); }

@media (max-width: 719px) {
  /* Phones: every dialog is a bottom sheet that clears the home indicator. */
  .hc-dialog[open], .hc-dialog--drawer[open] {
    inset: auto 0 0 0; margin: 0; width: 100%; max-width: 100%; height: auto; max-height: 88dvh;
    border-width: 1px 0 0; border-radius: 16px 16px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .hc-dialog-head::before {
    content: ""; position: absolute; top: 7px; left: 50%; width: 36px; height: 4px; margin-left: -18px;
    border-radius: 2px; background: rgba(var(--hc-ink), 0.22);
  }
  .hc-dialog-head { padding-top: 22px; }
  .hc-dialog-foot .hc-btn { flex: 1 1 auto; min-height: 44px; }
  .hc-dialog .hc-tool { width: 44px; height: 44px; }
  .hc-dialog :is(.hc-input, .hc-select) { font-size: 16px !important; }
}

/* forms */
.hc-field { margin: 0 0 14px; }
.hc-field-label { display: block; margin: 0 0 6px; font-size: 12.5px; font-weight: 800; line-height: 1.3; }
.hc-field-hint { margin-top: 6px; font-size: 11.5px; line-height: 1.5; color: rgba(var(--hc-ink), 0.58); }
.hc-field-hint.is-warn { font-weight: 700; color: var(--hc-danger); }
.hc-form-note { font-size: 11.5px; line-height: 1.55; color: rgba(var(--hc-ink), 0.58); }
.hc-dialog .hc-input, .hc-dialog .hc-select {
  display: block; width: 100% !important; height: 40px !important; margin: 0 !important; padding: 0 12px !important;
  border: 1px solid var(--hc-line-strong) !important; border-radius: 10px !important;
  background-color: transparent !important; color: rgb(var(--hc-ink)) !important;
  font-family: inherit; font-size: 14px; font-weight: 500; line-height: 1.3; box-shadow: none !important;
}
.hc-dialog .hc-input { background-image: none !important; }
.hc-dialog .hc-select {
  padding-right: 34px !important; appearance: none; -webkit-appearance: none;
  /* A neutral chevron that reads on paper and on the night palette. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23808893' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 12px center !important; background-size: 14px !important;
}
.hc-dialog .hc-select option { background: var(--hc-raise); color: rgb(var(--hc-ink)); }
.hc-dialog .hc-input.is-invalid { border-color: var(--hc-danger) !important; }

.hc-pills { display: flex; flex-wrap: wrap; gap: 2px; padding: 2px; border: 1px solid var(--hc-line-strong); border-radius: 18px; }
.hc-dialog .hc-pill { position: relative; display: inline-flex; margin: 0; cursor: pointer; }
.hc-dialog .hc-pill-input {
  position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; margin: 0 !important;
  opacity: 0; cursor: pointer; appearance: none; -webkit-appearance: none;
}
.hc-pill-text { padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; line-height: 1.3; color: rgba(var(--hc-ink), 0.7); white-space: nowrap; }
.hc-pill-input:checked + .hc-pill-text { background: rgb(var(--hc-ink)); color: var(--hc-on); }
.hc-pill-input:focus-visible + .hc-pill-text { outline: 2px solid rgba(var(--hc-ink), 0.75); outline-offset: 2px; }
.hc-pill-input:disabled + .hc-pill-text { opacity: 0.35; }

.hc-radio { display: flex; flex-direction: column; margin: 0 0 12px; }
.hc-dialog .hc-radio-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--hc-line); cursor: pointer; }
.hc-dialog .hc-radio-input {
  flex: none; appearance: none; -webkit-appearance: none; width: 18px !important; height: 18px !important;
  margin: 1px 0 0 !important; padding: 0 !important; border: 1.5px solid var(--hc-line-strong) !important; border-radius: 50% !important;
  background: transparent none !important; box-shadow: none !important; cursor: pointer;
}
.hc-dialog .hc-radio-input:checked {
  border-color: rgb(var(--hc-ink)) !important;
  background: radial-gradient(circle, rgb(var(--hc-ink)) 0 4.5px, transparent 5px) !important;
}
.hc-radio-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.hc-radio-name { font-size: 13.5px; font-weight: 700; line-height: 1.35; }
.hc-radio-note { font-size: 11.5px; font-weight: 500; line-height: 1.45; color: rgba(var(--hc-ink), 0.58); }

/* widget picker (H3) */
.hc-pick { margin-top: 10px; }
.hc-pick-item { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--hc-line); }
.hc-pick-copy { flex: 1 1 auto; min-width: 0; }
.hc-pick-name { font-size: 14.5px; font-weight: 800; line-height: 1.35; }
.hc-pick-used { font-size: 10.5px; font-weight: 700; color: rgba(var(--hc-ink), 0.55); }
.hc-pick-text { margin-top: 2px; font-size: 12.5px; line-height: 1.5; color: rgba(var(--hc-ink), 0.68); }
.hc-pick-sizes { margin-top: 4px; font-size: 10.5px; font-weight: 700; color: rgba(var(--hc-ink), 0.55); }

/* layout manager (H5) */
.hc-layouts { margin: 2px -8px 10px; }
.hc-layout-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 10px; flex-wrap: wrap; }
.hc-layout-row.is-current { background: rgba(var(--hc-ink), 0.05); }
.hc-layout-pick { flex: none; width: 18px; display: grid; place-items: center; }
.hc-dialog .hc-layout-copy { flex: 1 1 150px; min-width: 0; display: flex; flex-direction: column; gap: 1px; margin: 0; cursor: pointer; }
.hc-layout-row.is-standard .hc-layout-copy { cursor: default; }
.hc-layout-name { font-size: 14px; font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
.hc-layout-note { font-size: 11.5px; font-weight: 500; color: rgba(var(--hc-ink), 0.6); }
.hc-layout-tag { flex: none; font-size: 11px; font-weight: 700; color: rgba(var(--hc-ink), 0.55); }
.hc-layout-tools { flex: none; display: flex; gap: 6px; flex-wrap: wrap; }

/* reorder sheet (H8) */
.hc-order { margin-top: 8px; }
.hc-order-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 0; border-bottom: 1px solid var(--hc-line); font-size: 13px; }
.hc-order-copy { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.hc-order-name { font-size: 14px; font-weight: 800; }

@media (prefers-reduced-motion: reduce) {
  .hc-skel-row i, .hc-pending-card span { animation: none; }
  :is(.hc-root, .hc-dialog) .hc-btn { transition: none; }
  .hc-w.is-dragging { transform: none; }
}
@media (forced-colors: active) {
  .hc-pill-input:checked + .hc-pill-text, .hc-seg-btn[aria-pressed="true"] { outline: 2px solid CanvasText; }
}

/* Runtime design review: stable two-line edit labels and a clear edit boundary. */
.hc-w-id { flex-direction: column; align-items: flex-start; flex-wrap: nowrap; }
.hc-w-summary { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-w-preview.is-preview .hc-w-more { visibility: hidden; }
.xh:has(.hc-root.is-editing) .home-plans { display: none; }
