/* Bravendal owner console (HOD-630) -- the console's own pieces, on top of portal.css and (on its own pages and Home) home.css:
   the header with the household switcher, the DEMO DATA notice, the sign-in card and the owner home's cards (Saga's mock
   035a4d60). Classes only (CSP style-src 'self'); no url(), no @import, no font of its own. Every target is at least 44px (switcher
   rows 48px, the sign-in button 56px, cards 160px); nothing scrolls sideways at 320 or 375; no text under 12px. The header is the
   portal's ink bar in both themes, so its pieces use the portal's :root tokens; the console's own pages use home.css's v2 tokens,
   which follow the theme toggle. */

/* ---- the header: an ink bar in both themes ---- */
.ch { position: relative; background: var(--ink); border-bottom: 1px solid var(--rule); padding: .7rem 1.5rem; }
.ch-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; }
.ch-right { display: flex; align-items: center; gap: .6rem; margin-left: auto; }
a.wordmark { display: inline-flex; align-items: center; min-height: 44px; padding-bottom: 0; color: var(--ivory); text-decoration: none; }
a.wordmark:focus, a.wordmark:focus-visible { outline: 3px solid var(--ivory); outline-offset: 3px; }
.ch-out { min-width: 44px; min-height: 44px; padding: .4rem .9rem; border: 1px solid var(--ivory-dim); border-radius: 6px; background: transparent;
  color: var(--ivory); font: inherit; font-weight: 600; cursor: pointer; }
.ch-out:hover { border-color: var(--ivory); }
.ch-out:focus, .ch-out:focus-visible { outline: 3px solid var(--ivory); outline-offset: 3px; }
.ch .theme { margin-left: 0; min-height: 44px; min-width: 44px; padding: .4rem .9rem; border: 1px solid var(--ivory-dim); background: transparent; color: var(--ivory); }
.ch .theme:focus-visible { outline: 3px solid var(--ivory); outline-offset: 3px; }
.ch .theme[aria-pressed="true"] { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.ch .theme[hidden] { display: none; }

/* a household's header: row 1 the wordmark, the switcher beside it, then the theme and Sign out (Menu on a phone); row 2 the
   portal's sections under a hairline. Grid areas, never `order`: the DOM order is the focus order at every width. */
.hh-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "word sw right"; align-items: center; gap: .6rem 1rem; }
.hh-row > .wordmark { grid-area: word; }
.hh-row > .sw-wrap { grid-area: sw; justify-self: start; min-width: 0; max-width: 100%; }
.hh-row > .ch-right { grid-area: right; }
.hh-menu { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; margin-top: .6rem; padding-top: .5rem; border-top: 1px solid var(--rule); }
.ch-nav { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin: 0; padding: 0; }
.ch-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ivory); font-weight: 600; text-decoration: none;
  border-bottom: 2px solid transparent; }
.ch-nav a:hover { border-bottom-color: var(--ivory-dim); }
.ch-nav a[aria-current] { color: var(--accent); border-bottom-color: var(--accent); }
.ch-nav a:focus, .ch-nav a:focus-visible { outline: 3px solid var(--ivory); outline-offset: 3px; }
.hh-menu-btn, .phone-only { display: none; }
.hh-menu-btn { align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: .4rem .9rem; border: 1px solid var(--ivory-dim);
  border-radius: 6px; background: transparent; color: var(--ivory); font: inherit; font-weight: 600; }
.hh-menu-btn:focus-visible { outline: 3px solid var(--ivory); outline-offset: 3px; }
.hh nav.plan { margin-top: .5rem; padding-top: .5rem; }
.hh nav.plan a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---- the household switcher: a disclosure of links (never role=menu); its open panel sits above the sticky OWNER PREVIEW banner ---- */
.sw-wrap { position: relative; }
.sw-btn { display: inline-flex; align-items: center; max-width: 100%; min-height: 44px; padding: .35rem .85rem; border: 2px solid var(--accent);
  border-radius: 8px; background: transparent; color: var(--ivory); font: inherit; cursor: pointer; }
.sw-btn:focus, .sw-btn:focus-visible { outline: 3px solid var(--ivory); outline-offset: 3px; }
.sw-face { display: flex; align-items: baseline; gap: .4rem; min-width: 0; }
.sw-verb { flex: none; color: var(--ivory-dim); }
.sw-name { min-width: 0; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.sw-chev { flex: none; margin-left: .2rem; font-size: .75rem; }
.sw-wrap.open .sw-chev { transform: rotate(180deg); }
.sw-list { position: absolute; top: calc(100% + .45rem); left: 0; z-index: 60; width: 24rem; max-width: calc(100vw - 2rem); margin: 0; padding: .35rem;
  list-style: none; background: var(--ink); border: 1px solid var(--ivory-dim); border-radius: 10px; }
.sw-list[hidden] { display: none; }
.sw-cap { padding: .55rem .75rem .35rem; color: var(--ivory-dim); font-size: .875rem; }
.sw-link { display: flex; flex-direction: column; justify-content: center; min-height: 48px; padding: .45rem .75rem; border-radius: 6px; color: var(--ivory);
  text-decoration: none; }
.sw-link:hover { background: var(--notice-bg); }
.sw-link:focus, .sw-link:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.sw-n { font-weight: 600; }
.sw-p { color: var(--ivory-dim); font-size: .875rem; line-height: 1.35; }
.sw-div { height: 1px; margin: .3rem .5rem; background: var(--rule); }

/* ---- the DEMO DATA notice: accent-filled, right after the header; a region, never a live region ---- */
.dd-bar { margin: 0; padding: .6rem 1.5rem; background: var(--accent); color: var(--ink); border-bottom: 2px solid var(--ink); }
.dd-bar p { margin: 0; font-size: .9375rem; font-weight: 600; line-height: 1.4; }
.dd-bar strong { font-weight: 800; letter-spacing: .06em; }

/* ---- sign-in and enrol: one card ---- */
.si-card { max-width: 32rem; margin: 1.5rem auto 2rem; padding: 1.5rem 1.6rem 1.3rem; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 14px; }
html.v2 .si-card h1 { margin: 0 0 .6rem; font-size: 2rem; }
.si-line { margin: 0 0 1rem; }
.si-btn { display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%; min-height: 56px; margin: 1rem 0 .9rem; padding: .5rem 1rem;
  border: 2px solid var(--accent2); border-radius: 10px; background: var(--accent2); color: var(--on-accent); font: inherit; font-size: 1.0625rem;
  font-weight: 700; cursor: pointer; }
.si-btn:hover { filter: brightness(1.08); }
.si-btn:focus, .si-btn:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }
.si-btn[hidden] { display: none; }
.si-btn .key { flex: none; width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.si-alert, .si-status { margin: 1rem 0 0; padding: .75rem 1rem; border-radius: 6px; background: var(--bg); color: var(--text); }
.si-alert { border-left: 4px solid var(--fall); }
.si-status { border-left: 4px solid var(--accent2); }
.si-alert:empty, .si-status:empty { display: none; }
.si-alert p { margin: 0; }
.si-alert p + p { margin-top: .3rem; }
.si-alert .si-alert-t { font-weight: 700; }
.si-help { margin: 0; padding-left: 1.2rem; color: var(--muted); font-size: .9375rem; }
.si-help li { margin: .25rem 0; }
.go-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1.1rem; border: 2px solid var(--accent2); border-radius: 999px;
  color: var(--accent2); font-weight: 600; text-decoration: none; }
.go-link:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }

/* ---- the owner home: three whole-card links ---- */
html.v2 .lede { color: var(--muted); }
.hcards { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 1.25rem 0; padding: 0; }
.hcards > li { display: flex; min-width: 0; }
.hcard { display: flex; flex: 1 1 auto; flex-direction: column; gap: .5rem; min-width: 0; min-height: 160px; padding: 1.1rem 1.2rem 1rem;
  background: var(--surface); color: var(--text); text-decoration: none; border: 1px solid var(--line); border-top: 4px solid var(--accent2);
  border-radius: 14px; }
.hcard:hover { border-color: var(--accent2); }
.hcard:focus, .hcard:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.hc-name { font-family: var(--display); font-size: 1.4rem; font-weight: 600; line-height: 1.2; }
.hc-persona { color: var(--muted); }
.hc-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip { display: inline-block; padding: .1rem .6rem; border: 1px solid var(--line); border-radius: 999px; font-size: .8125rem; font-weight: 600; }
.chip[hidden] { display: none; }
.hc-skel, .hc-state { display: none; }
.hc-skel span { display: block; height: .8rem; border-radius: 4px; background: var(--track); }
.hc-skel span + span { width: 60%; margin-top: .45rem; }
.hc-state-t { display: block; font-weight: 700; }
.hc-state-b { display: block; color: var(--muted); }
.hc-go { display: inline-flex; align-self: flex-start; align-items: center; min-height: 44px; margin-top: auto; padding: 0 1.1rem; border: 2px solid var(--accent2);
  border-radius: 999px; background: var(--accent2); color: var(--on-accent); font-weight: 600; }
.hcard.loading .hc-chips { display: none; }
.hcard.loading .hc-skel, .hcard.loading .hc-state, .hcard.down .hc-state { display: block; }
.hcard.down { border-top-color: var(--dim); }
.hcard.down .hc-go { background: transparent; color: var(--text); border-color: var(--dim); }
.foot-note { color: var(--muted); font-size: .9375rem; }
@media (prefers-reduced-motion: no-preference) { .hcard.loading .hc-skel span { animation: hc-pulse 1.4s ease-in-out infinite; } }
@keyframes hc-pulse { 50% { opacity: .55; } }

/* ---- narrow screens ---- */
@media (max-width: 48rem) {
  .hcards { grid-template-columns: minmax(0, 1fr); }
  .hh-row { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "word . right" "sw sw sw"; }
  .hh-row > .sw-wrap { justify-self: stretch; }
  .sw-wrap { position: static; }
  .sw-btn { display: flex; width: 100%; }
  .sw-face { flex: 1 1 auto; }
  .sw-chev { margin-left: auto; }
  .sw-list { top: auto; left: 1rem; right: 1rem; width: auto; max-width: none; margin-top: .45rem; }
  .wide-only { display: none; }
  .phone-only { display: inline-flex; align-self: flex-start; }
  html.cjs .hh-menu-btn { display: inline-flex; }
  html.cjs .hh-menu:not(.open) { display: none; }
  .hh-menu { flex-direction: column; align-items: stretch; }
}
@media (max-width: 30rem) {
  .ch { padding-left: 1rem; padding-right: 1rem; }
  .dd-bar { padding-left: 1rem; padding-right: 1rem; }
  .si-card { margin: 1rem 0 1.5rem; padding: 1.2rem 1.1rem 1.1rem; }
  html.v2 .ch .wordmark { font-size: .95rem; letter-spacing: .04em; }
  .ch-out, .hh-menu-btn { padding: .4rem .7rem; }
}
@media print { .ch-out, .hh-menu-btn, .sw-wrap { display: none; } }

/* =============================================================================================================================
   The Clients section (the tailnet console; Saga's mock 39c2b0fa). The OWNER PREVIEW banner is THE one inverted band on the page:
   navy with ivory words on a light page, ivory with ink words in the dark theme and on the portal's navy pages; contrast >= 12:1
   both ways; sticky, never dismissable; its meaning in the words (the striped left edge is decoration). The CLIENTS switcher and
   cards are navy where the Demo ones are the accent, and every section carries a text tag (CLIENTS / DEMO), never colour alone.
   ============================================================================================================================= */
html:has(.pv-bar) { scroll-padding-top: 5.5rem; }
.pv-bar { position: sticky; top: 0; z-index: 40; margin: 0; padding: .55rem 1.5rem .6rem 2.1rem; background: #0c2240; color: #f3ecd8;
  border-bottom: 2px solid #f3ecd8; }
.pv-bar::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: .6rem;
  background: repeating-linear-gradient(-45deg, #f3ecd8 0 5px, #0c2240 5px 10px); }
.pv-bar p { margin: 0; }
.pv-l1 { font-size: 1rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.pv-l2 { font-size: .9375rem; line-height: 1.4; }
html[data-theme="dark"] .pv-bar, html:not(.v2) .pv-bar { background: #f3ecd8; color: #04080f; border-bottom-color: #04080f; }
html[data-theme="dark"] .pv-bar::before, html:not(.v2) .pv-bar::before { background: repeating-linear-gradient(-45deg, #04080f 0 5px, #f3ecd8 5px 10px); }
.pv-note { margin: 0; padding: .55rem 1.5rem; border-bottom: 2px dashed currentColor; font-size: .9375rem; }
.ro-note { margin: .8rem 0; padding: .6rem .85rem; border: 2px dashed currentColor; border-radius: 8px; font-weight: 600; }
.na-tiles { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin: 1rem 0; padding: 0; }
.na-tiles li { padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.na-tiles .k { display: block; font-weight: 700; }

/* the console's text tags (CLIENTS / DEMO), confined to the console's own containers: console.css also loads beside a
   household's portal page (portal.console_pages.household), and a bare .tag here used to win portal.css's base .tag while
   portal.css's .tag.loan / .tag.plain kept their ivory words -- ivory on this cream fill is a blank chip (HOD-936). Scoping
   leaves every portal chip on portal.css's own ink-and-accent rules. */
.sec-tabs .tag, .sec-group .tag, .sw-wrap.clients .tag { display: inline-block; padding: .05rem .45rem; border-radius: 4px;
  background: #f3ecd8; color: #0c2240; font-size: .75rem; font-weight: 800; letter-spacing: .08em; line-height: 1.5;
  vertical-align: middle; }
.sec-tabs .tag.demo, .sec-group .tag.demo, .sw-wrap.clients .tag.demo { background: var(--accent); color: var(--ink); }

/* the section tabs under the console's header: at least 48px, the current one with a rule on top and the word in aria-current */
.sec-tabs { margin-top: .6rem; }
.sec-tabs ul { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; }
.sec-tab { display: inline-flex; flex-wrap: wrap; align-items: center; column-gap: .45rem; min-height: 48px; padding: .4rem 1rem; color: var(--ivory);
  text-decoration: none; border: 1px solid var(--rule); border-top: 4px solid transparent; border-radius: 6px 6px 0 0; }
.sec-tab:hover { border-color: var(--ivory-dim); }
.sec-tab[aria-current] { background: var(--navy); border-color: var(--rule); border-top-color: #f3ecd8; }
.sec-tab:focus, .sec-tab:focus-visible { outline: 3px solid var(--ivory); outline-offset: 3px; }
.sec-name { font-weight: 700; }
.sec-sub { color: var(--ivory-dim); font-size: .875rem; }

/* the Clients cards: a navy double rule and a navy button (ivory in the dark theme); four to a row on a desk */
.ccards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ccard { border-top: 6px double #0c2240; }
.ccard .hc-go { background: #0c2240; border-color: #0c2240; color: #f3ecd8; }
.ccard.down .hc-go { background: transparent; color: var(--text); border-color: var(--dim); }
.chip.ro { border-color: #0c2240; }
.chip.demo { background: var(--accent2); border-color: var(--accent2); color: var(--on-accent); }
html[data-theme="dark"] .ccard { border-top-color: #f3ecd8; }
html[data-theme="dark"] .ccard .hc-go { background: #f3ecd8; border-color: #f3ecd8; color: #04080f; }
html[data-theme="dark"] .chip.ro { border-color: #f3ecd8; }
.sec-group { margin: 1.5rem 0 0; }
html.v2 .sec-group h2 { margin: 0 0 .3rem; font-size: 1.5rem; }
.sec-group > p { margin: 0 0 .5rem; color: var(--muted); }

/* the CLIENTS switcher: an ivory button with navy words and a navy CLIENTS tag on the ink header (navy with an ivory border in the
   dark theme and on the portal's navy pages); 'Previewing'; a navy band heads its panel */
.sw-wrap.clients .sw-btn { border-color: #0c2240; background: #f3ecd8; color: #0c2240; }
.sw-wrap.clients .sw-verb { color: #4f5b6b; }
.sw-wrap.clients .sw-btn .tag { background: #0c2240; color: #f3ecd8; }
html[data-theme="dark"] .sw-wrap.clients .sw-btn, html:not(.v2) .sw-wrap.clients .sw-btn { border-color: #f3ecd8; background: #0c2240; color: #f3ecd8; }
html[data-theme="dark"] .sw-wrap.clients .sw-verb, html:not(.v2) .sw-wrap.clients .sw-verb { color: #c9c1ab; }
html[data-theme="dark"] .sw-wrap.clients .sw-btn .tag, html:not(.v2) .sw-wrap.clients .sw-btn .tag { background: #f3ecd8; color: #0c2240; }
.sw-head { margin: -.35rem -.35rem .3rem; padding: .55rem .75rem; border-radius: 10px 10px 0 0; background: #0c2240; color: #f3ecd8;
  font-size: .875rem; font-weight: 700; border-bottom: 1px solid #f3ecd8; }

@media (max-width: 64rem) { .ccards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 48rem) {
  .ccards, .na-tiles { grid-template-columns: minmax(0, 1fr); }
  .sec-tabs ul { flex-direction: column; }
  .sec-tab { display: flex; }
}
@media (max-width: 30rem) { .pv-bar { padding-left: 1.5rem; padding-right: 1rem; } .pv-note { padding-left: 1rem; padding-right: 1rem; } }
@media print { .pv-bar { position: static; } }
