/* Fluid space from issue #36 revision 4. Plates stay in backgrounds.css. */
:root{
  --step-3:clamp(2.1rem,1.6rem + 2.2vw,3.5rem);
  --space-1:clamp(.5rem,.45rem + .25vw,.75rem);
  --space-2:clamp(.75rem,.6rem + .6vw,1.25rem);
  --space-3:clamp(1rem,.8rem + 1vw,1.75rem);
  --space-4:clamp(1.5rem,1rem + 2vw,3rem);
  --content-max:72rem;
  /* The signed-in column from 1100px: 60rem, then two thirds of the screen, so the page keeps one composition
     at every size. 67vw is the widest that leaves the wide plates' heads whole in the margins (art-two-sides.test.ts). */
  --col:clamp(60rem,67vw,96rem);
  --side-art:clamp(16rem,22vw,22rem);
  --flag-h:clamp(36px,4.5vw,56px);
}
html{-webkit-text-size-adjust:100%}
/* Sticky and fixed layers on phones (Josh, 29 Oct: the Rooms chips stuck 60px under the header and the page
   scrolled through the gap). --mast-h is the header's measured height (useMastHeight, app.tsx); the values here
   are only the first-paint guess. --tabbar-h (the phone tab bar without the home-indicator inset) is declared once,
   in the phone tab bar block below (#119); it is unset on wider screens, where each use keeps its own fallback. */
/* One signed-in row, shared by the bar and the first paint. A 16px default is
   about 80px; it grows with the reader's font. The phone's wrapped row is
   already this tall at a large default, so a second copy would open an empty
   band and jump the page when the door gives way to the board. */
:root{--mast-guess:5rem;--mast-h:var(--mast-guess)}
/* A 320px window at a 24px default wraps Sign out under the name, and the
   one-row guess is one button short. 13em is 312px there and 416px at 32px,
   so this does not fire at 16px or at a 32px default. */
@media (min-width:13em) and (max-width:13.6em){:root{--mast-guess:6.5rem}}
/* Shared tokens: the chip row height and the page gutter the chip row bleeds through (Design lows on #121). */
:root{--chips-h:3.75rem;--gutter-l:max(clamp(16px,2vw,28px),env(safe-area-inset-left));--gutter-r:max(clamp(16px,2vw,28px),env(safe-area-inset-right))}
/* The overscroll bounce shows the page colour, not white, and anchors and focus land below the header. */
html{background:var(--bg);scroll-padding-top:calc(var(--mast-h) + .5rem)}
/* A call card showing (--call-card-h, set by call-rings.tsx) is reserved at the bottom on every screen, so a
   focused field can scroll clear of it. The phone rules below replace these under 768px. */
html{scroll-padding-bottom:var(--call-card-h,0px)}
/* Focus not obscured (WCAG 2.4.11): on phones a focused control clears the tab bar, and on Rooms below 1024px it
   clears the sticky chip row too (--chips-h, 3.75rem: 44px chips plus py-2). */
@media (max-width:47.99em){html{scroll-padding-bottom:calc(var(--tabbar-h) + env(safe-area-inset-bottom) + .5rem + var(--call-card-h,0px))}}
@media (max-width:63.99em){html:has(.room-chips){scroll-padding-top:calc(var(--mast-h) + var(--chips-h) + .5rem)}}
/* The header's and the sticky chip row's own controls are never "obscured by the header": cancel the scroll padding on them, or focusing a
   header control (Tab, the desktop More dialog returning focus) scrolls the page (QA B1 on #121, 1200 to 745 at 1280). */
.mast-bar,.mast-bar *{scroll-margin-top:calc(-1 * (var(--mast-h) + .5rem))}
@media (max-width:63.99em){html:has(.room-chips) :is(.mast-bar,.mast-bar *,.room-chips,.room-chips *){scroll-margin-top:calc(-1 * (var(--mast-h) + var(--chips-h) + .5rem))}}
/* An open modal dialog or sheet holds the page still behind it. The gutter keeps the page from shifting sideways. */
html:has(dialog:modal){overflow:hidden;scrollbar-gutter:stable}
dialog{overscroll-behavior:contain}
/* Landscape iPhone: the fixed 20-minute line keeps its text clear of the notch on either side. */
.session-line{padding-inline:max(1rem,env(safe-area-inset-left)) max(1rem,env(safe-area-inset-right))}
body{line-height:1.6;min-height:100dvh;overflow-x:clip}

/* Content column. Outer art fills the margins from 1600px up. */
.shell{min-height:100dvh;position:relative}
.shell-body{
  display:grid;
  /* Side tracks are auto, so an empty margin collapses instead of leaving a blank column.
     The centre track stays the content width. justify-content keeps that column centred. */
  grid-template-columns:auto min(var(--content-max),100%) auto;
  justify-content:center;
  width:100%;
  contain:layout;
}
/* The plate stays sticky and one screen tall (backgrounds.css). Containment
   keeps a late glow from shifting the rooms, without stretching the plate
   to the page or wider than the screen. */
[data-entered] .plate-figure>.plate-ground{contain:strict}
[data-entered] .plate-figure>.plate-ground::before,[data-entered] .plate-figure>.plate-ground::after{contain:layout}
/* Three skeleton rows, and never tall enough to push the plate credit under the tab bar. */
.catalog-retry{
  box-sizing:border-box;
  /* The focus scroll clears the sticky mast. The height floor is in px so a
     32px root cannot shrink the card to nothing, and the card does not scroll
     inside itself. */
  scroll-margin-top:var(--mast-h, 0px);
  padding-top:0.75rem;
  min-height:min(360px, calc(100svh - var(--mast-h, 0px) - var(--tabbar-h, 0px) - 128px));
  overflow:visible;
}
@media (max-width:47.99em){
  .catalog-retry{
    min-height:min(360px, calc(100svh - var(--mast-h, 0px) - var(--tabbar-h, 57px) - 128px));
    max-height:none;
    overflow:visible;
    /* The caption now scales with the font, so the card gives that room back. */
    padding-top:0;
    padding-bottom:0;
  }
  .pc-credit{margin-top:1rem}
}
.shell-body > main{
  grid-column:2;
  grid-row:1;
  min-width:0;
  width:100%;
  padding:var(--space-3);
  padding-inline:var(--gutter-l) var(--gutter-r);
  padding-bottom:var(--space-4);
}
.shell-body > main{padding-bottom:calc(var(--space-4) + var(--call-card-h,0px))}
/* The column's ground (Josh, 12 Nov: on Rooms the cards met the bright middle of the plate and clashed with it).
   From 1100px the signed-in column is --col wide (page-craft.css) and the plate shows at both sides. A band of
   the page's solid colour sits under the whole column, feathered at its edges and never wider than the margin,
   so cards and type always meet a calm ground and the art stays in the margins. The band is the column's own
   size, not the screen's, and it scrolls with the page like everything else in it. The column's own gutter is
   wider here (--col-pad), so every card sits well inside the solid part of the band and none rides its
   feathered edge. layout-gaps.test.ts keeps this breakpoint and width in step with page-craft.css. */
@media (min-width:1100px){
  [data-entered]{--col-pad:clamp(1.75rem,2.6vw,3rem)}
  [data-entered] .shell-body{grid-template-columns:auto min(var(--col),100%) auto;justify-content:center}
  [data-entered] .shell-body>main{position:relative;isolation:isolate;padding-inline:var(--col-pad)}
  [data-entered] .shell-body>main::before{
    content:"";position:absolute;z-index:-1;pointer-events:none;
    --ground-bleed:clamp(0px,calc((100vw - var(--col)) / 2 - 1rem),3rem);
    --ground:color-mix(in srgb,var(--pc-solid,#14100c) 64%,transparent);
    inset:0 calc(-1 * var(--ground-bleed));
    background:linear-gradient(90deg,transparent,var(--ground) var(--ground-bleed),var(--ground) calc(100% - var(--ground-bleed)),transparent);
  }
}
/* From 48em (768px at the usual default, with Tailwind md) the card sits 1.5rem up (md:bottom-6), which --call-card-h does not count. min(var,...) is 0 with no
   card, so nothing changes then. */
@media (min-width:48em){
  html{scroll-padding-bottom:calc(var(--call-card-h,0px) + min(var(--call-card-h,0px),2rem))}
  .shell-body > main{padding-bottom:calc(var(--space-4) + var(--call-card-h,0px) + min(var(--call-card-h,0px),1.5rem))}
}
.outer-art,.side-art{display:none}
@media (min-width:1600px){
  .outer-art{
    display:block;
    position:sticky;
    top:0;
    height:100dvh;
    overflow:hidden;
    background-repeat:no-repeat;
    background-size:cover;
    background-position:var(--focal,50% 30%);
  }
  .outer-art.l{
    grid-column:1;
    grid-row:1;
    -webkit-mask-image:linear-gradient(90deg,#000 55%,transparent);
    mask-image:linear-gradient(90deg,#000 55%,transparent);
  }
  .outer-art.r{
    grid-column:3;
    grid-row:1;
    -webkit-mask-image:linear-gradient(270deg,#000 55%,transparent);
    mask-image:linear-gradient(270deg,#000 55%,transparent);
  }
  [data-section="week"] .outer-art{background-image:var(--art-week-side);--focal:62% 40%}
  [data-section="rooms"] .outer-art{background-image:var(--art-rooms-side);--focal:58% 30%}
  [data-section="messages"] .outer-art{background-image:var(--art-messages-side);--focal:50% 20%}
}

/* Side column only between 1100 and 1599. Below that the page is one column. */
.with-side{display:grid;gap:var(--space-4);grid-template-columns:minmax(0,1fr)}
.with-side > div{min-width:0;width:100%}
@media (min-width:1100px) and (max-width:1599px){
  .with-side{grid-template-columns:minmax(0,1fr) var(--side-art)}
  .side-art{
    display:block;
    position:sticky;
    top:var(--space-3);
    align-self:start;
    height:calc(100dvh - 2*var(--space-3));
    background:center 20%/contain no-repeat;
    border-left:1px solid var(--line);
  }
  [data-section="week"] .side-art{background-image:var(--art-week-side)}
  [data-section="rooms"] .side-art{background-image:var(--art-rooms-side)}
  [data-section="messages"] .side-art{background-image:var(--art-messages-side)}
  /* Rooms keep the 72rem column. The 14rem list sits inside it, not beside the side art. */
  [data-section="rooms"] .with-side{grid-template-columns:minmax(0,1fr)}
  [data-section="rooms"] .side-art{display:none}
}

.hero-band{width:100%;height:clamp(140px,20vw,300px)}
@media (max-width:47.99em){.hero-band{height:clamp(140px,46vw,180px)}}

/* The title plate is a block. inline-block shrank it to a narrow column. */
.plate{display:block;width:100%;container-type:normal}
/* .plate would otherwise show a closed dialog and stretch it across the page. */
dialog.plate:not([open]){display:none}
dialog.plate{position:fixed;inset:0;width:min(28rem,calc(100% - 2rem));max-width:28rem;height:fit-content;margin:auto}

.cards{display:grid;gap:var(--space-2);grid-template-columns:repeat(auto-fit,minmax(min(100%,22rem),1fr))}

/* Find: the list and the add form share a container, so two columns open only when
   that column can hold a 22rem form plus a list, not just a 1024px viewport (a 32px
   root made lg:minmax(22rem,28rem) blow the cards out of the column, #182). */
.find-shell{container-type:inline-size;min-width:0}
.find-page{display:grid;gap:2rem;grid-template-columns:minmax(0,1fr);min-width:0}
.find-page>.find-list,.find-page>aside{min-width:0;max-width:100%}
@container (min-width:48rem){
  .find-page{grid-template-columns:minmax(0,1fr) minmax(min(100%,22rem),28rem);column-gap:3rem}
}
.find-cards{display:grid;gap:0.75rem;grid-template-columns:repeat(auto-fit,minmax(min(100%,22rem),1fr));min-width:0}
.card{min-width:0;max-width:100%}
.card :is(h3,p,span){overflow-wrap:anywhere}

/* Room cards are not .plate. The plate hero margin stays on the title only. */
.room-column{container-type:inline-size;min-width:0}
.town-filter{container:town-filter / inline-size}
.town-filter-select{display:none}
@container town-filter (inline-size < 36rem){
  .town-filter-chips{display:none}
  .town-filter-select{display:block}
}
.room-browse{display:block}
@media (min-width:64em){
  .room-browse{
    display:grid;
    grid-template-columns:14rem minmax(0,1fr);
    align-items:start;
    column-gap:2rem;
  }
}
.room-grid{
  display:grid;
  gap:var(--space-2);
  grid-template-columns:repeat(auto-fill,minmax(min(100%,16rem),1fr));
}

/* Joined rooms: the name and Leave share a fit-content row. A wide page does not
   stretch a gap between them. The list is the container, so the name scales with
   the space it actually has. */
.joined-list{container:joined / inline-size;min-inline-size:0}
.joined-row{inline-size:fit-content;max-inline-size:100%;min-inline-size:0;justify-content:flex-start}
.joined-name{min-inline-size:0;max-inline-size:100%;overflow-wrap:anywhere;text-wrap:pretty}
.joined-leave{flex:0 0 auto}
.joined-tools-row,.joined-kinds{flex-wrap:wrap}
@container joined (inline-size > 28rem){
  .joined-name{max-inline-size:36rem}
}
.room-card{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:.5rem;
  box-sizing:border-box;
  margin:0;
  min-width:0;
  width:100%;
  min-height:44px;
  padding:14px 22px;
  text-align:left;
  background:var(--card);
  color:var(--fg);
  border:1px solid var(--line);
  border-radius:6px;
}
.room-card-top{display:flex;align-items:flex-start;gap:.5rem;width:100%;min-width:0}
.room-card-name{
  flex:1;
  min-width:0;
  font-family:"EB Garamond","Iowan Old Style","Palatino Linotype",Georgia,serif;
  font-size:1.25rem;
  line-height:1.3;
  overflow-wrap:anywhere;
}
.room-card-what{
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:1;
  overflow:hidden;
  max-width:100%;
  color:var(--muted);
  font-size:.875rem;
  line-height:1.4;
}
.room-card-meta{color:var(--muted);font-size:.875rem;line-height:1.4}
.room-joined-dot{
  width:8px;
  height:8px;
  margin-top:.45rem;
  border-radius:999px;
  background:var(--gold);
  flex:none;
}
/* The phone chip row sticks flush under the header, whatever height the header has. html's scroll-padding covers
   the header; this covers the chips under it. */
/* top tucks the row 1px under the header's gold rule: --mast-h rounds the header up, so a flush top left a
   sub-pixel sliver where scrolled text showed through (Design, #121). The header paints above at z 40.
   The row runs to the screen edge so the next chip is always cut off, a sign that it scrolls. No fade over
   chip text: text sits only on solid grounds. */
.room-chips{top:calc(var(--mast-h) - 1px);overscroll-behavior-x:contain;margin-inline:calc(-1 * var(--gutter-l)) calc(-1 * var(--gutter-r));padding-inline:var(--gutter-l) var(--gutter-r);scroll-padding-inline:var(--gutter-l) var(--gutter-r);scroll-snap-type:x proximity}
.room-chips>*{scroll-snap-align:start;flex:none}
#your-rooms{scroll-margin-top:4.5rem}
@media (min-width:64em){#your-rooms{scroll-margin-top:0}}

/* Phone: five slots in one row. The rest sit in the More sheet. In em, so it switches with Tailwind's md (48rem). */
.tabbar{display:none}
@media (max-width:47.99em){
  /* The tab bar: a 56px row plus its 1px top line. Things that must clear it read this. */
  :root{--tabbar-h:57px}
  .topnav{display:none}
  .tabbar{
    display:flex;
    flex-wrap:nowrap;
    position:fixed;
    inset:auto 0 0 0;
    z-index:30;
    background:var(--surface);
    border-top:1px solid var(--line);
    padding-bottom:env(safe-area-inset-bottom);
    padding-inline:env(safe-area-inset-left) env(safe-area-inset-right);
  }
  /* While the keyboard is up, iOS pins fixed bars to the layout viewport, so the tab bar and the 20-minute line
     float over the composer and jump as the page scrolls. They step aside while the visual viewport says the
     keyboard is open (useMastHeight sets data-keyboard), and, as a fallback, while a text field has focus. */
  html[data-keyboard="open"] :is(.tabbar,.session-line){display:none}
  /* With the tab bar gone, the call card drops into its space instead of floating a tab bar's height up. */
  html[data-keyboard="open"] .call-rings{--tabbar-h:0px}
  @media (pointer:coarse){
    body:has(:is(textarea,select,[contenteditable="true"],input:not([type="checkbox"],[type="radio"],[type="button"],[type="submit"],[type="reset"],[type="range"],[type="file"],[type="color"],[type="image"])):focus) :is(.tabbar,.session-line){display:none}
    body:has(:is(textarea,select,[contenteditable="true"],input:not([type="checkbox"],[type="radio"],[type="button"],[type="submit"],[type="reset"],[type="range"],[type="file"],[type="color"],[type="image"])):focus) .call-rings{--tabbar-h:0px}
  }
  .tabbar button{
    flex:1;
    min-width:44px;
    min-height:max(44px,56px);
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:2px;
    padding:6px 4px;
    border:0;
    border-top:2px solid transparent;
    background:transparent;
    color:var(--muted);
    font-size:min(.75rem,15px);
    font-weight:500;
    line-height:1.15;
    text-align:center;
    white-space:normal;
  }
  .tabbar button svg{width:24px;height:24px}
  .tabbar button[aria-current="page"]{color:var(--fg);border-top:2px solid var(--gold)}
  /* The bar runs to the screen edge: draw the focus ring inside each tab so the first and last are not cut off. */
  .tabbar button:focus-visible{outline-offset:-3px}
  /* --call-card-h: a call card showing above the tab bar (call-rings.tsx), so the last field can scroll clear of it. */
  /* The solid footer scrolls above the tab bar with the rest of the document. */
  .shell-body > main{padding-bottom:calc(var(--tabbar-h,56px) + env(safe-area-inset-bottom) + var(--call-card-h,0px))}
  .more-sheet[open]{
    position:fixed;
    inset:auto 0 0 0;
    width:100%;
    max-width:none;
    margin:0;
    padding:8px 0 calc(8px + env(safe-area-inset-bottom));
    border:0;
    border-top:1px solid var(--gold);
    border-radius:16px 16px 0 0;
    background:var(--surface);
    color:var(--fg);
  }
  .more-sheet::backdrop{background:color-mix(in srgb,var(--bg) 55%,transparent)}
  .more-grab{width:2.5rem;height:4px;margin:4px auto 8px;border-radius:999px;background:var(--line-strong)}
  .more-sheet ul{list-style:none;margin:0;padding:0}
  .more-row{
    min-height:max(44px,48px);
    width:100%;
    display:flex;
    align-items:center;
    gap:12px;
    padding:8px 16px;
    border:0;
    background:transparent;
    color:var(--fg);
    font-size:1rem;
    font-weight:500;
    text-align:left;
  }
  .more-row svg{width:24px;height:24px}
  .more-row[aria-current="page"]{box-shadow:inset 2px 0 0 var(--gold)}
}
@media (prefers-reduced-data:reduce){
  .hero-band,.outer-art,.side-art{background-image:none}
}

/* Signed-out header. The bar is the same centred 72rem column as the page. */
.mast-bar{
  position:sticky;
  top:0;
  z-index:40;
  contain:layout;
  display:grid;
  grid-template-columns:auto min(var(--content-max),100%) auto;
  justify-content:center;
  width:100%;
  background:var(--bg);
  border-bottom:1px solid #c9a45c;
  /* With viewport-fit=cover, a home-screen app's status bar sits over the header's own colour, not the page. */
  padding-top:env(safe-area-inset-top);
  container-name:mast;
  container-type:inline-size;
}
.mast{
  grid-column:2;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px 16px;
  box-sizing:border-box;
  width:100%;
  max-width:72rem;
  margin-inline:auto;
  min-width:0;
  padding-block:0.75rem;
  padding-inline:var(--gutter-l) var(--gutter-r);
  flex-wrap:wrap;
}
.mast-brand{
  display:flex;
  align-items:center;
  gap:10px;
  flex:1 1 auto;
  min-width:min-content;
}
.mast-titles{min-width:0}
.mast-name{
  margin:0;
  font-family:var(--font-display),"EB Garamond",Georgia,serif;
  font-size:clamp(1.05rem,0.35rem + 3vw,2.5rem);
  line-height:1.05;
  color:var(--fg);
  overflow-wrap:break-word;
}
.mast-tagline{
  margin:0.25rem 0 0;
  font-size:0.95rem;
  line-height:1.35;
  color:#bcae94;
  overflow-wrap:break-word;
}
.mast-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:12px;
  margin-left:auto;
  min-width:0;
  max-width:100%;
}
.topnav{max-width:calc(100% + 8px);padding:4px;margin:-4px;overflow-x:auto}
/* Hidden, not removed: the signed-in row keeps Sign out's width while the
   session is still arriving, so More does not wrap and unwrap. */
.mast-door[inert]{visibility:hidden;pointer-events:none}
.mast-door{
  display:inline-flex;
  align-items:center;
  flex:none;
  min-height:44px;
  padding:0 2px;
  border:0;
  background:none;
  color:#f0e7d3;
  font:inherit;
  font-size:1rem;
  line-height:1.2;
  text-decoration:underline;
  text-underline-offset:0.18em;
  white-space:nowrap;
  cursor:pointer;
}
.mast-flag{
  display:block;
  height:var(--flag-h);
  width:auto;
  flex:none;
  background:none;
  border:0;
}
/* Signed-in title. min(2rem, 6.5cqi) keeps the whole wordmark, with no ellipsis.
   The mast and the section nav wrap to another row, the way the base header does. */
/* Once the column is the wider of the two (67vw passes the mast's 72rem at 121em of the reader's default size),
   the mast takes the column's width and gutter, so the mark and the first card share a left edge. Below that
   the mast keeps its 72rem: at the column's 60rem the sections would wrap onto a second row. */
@media (min-width:121em){
  [data-entered] .mast-bar{grid-template-columns:auto min(var(--col),100%) auto;justify-content:center}
  [data-entered] .mast{max-width:var(--col);padding-inline:var(--col-pad)}
}
.mast[data-entered="true"]{flex-wrap:wrap;align-items:flex-start}
.mast[data-entered="true"] .mast-actions{flex-wrap:wrap;max-width:100%}
.mast[data-entered="true"] .topnav{overflow:visible;max-width:100%}
.mast[data-entered="true"] .mast-name{
  font-size:min(2rem, 6.5cqi);
  line-height:1;
  text-overflow:clip;
}
/* Same guess as --mast-h, so the bar does not grow when the hook measures it. */
.shell[data-entered]>.mast-bar{min-height:var(--mast-guess)}
/* While the phone tab bar is on screen, a rem caption and its 2.5rem margin
   grow with a large default and land under the bar. vw caps the type on a
   narrow screen; .95rem keeps the usual size once the screen is wider. */
@media (max-width:47.99em){
  .shell[data-entered] .pc-credit{
    margin:0;
    padding:0;
    font-size:clamp(0.75rem, 3.6vw, 0.95rem);
    line-height:1.4;
  }
}
.mast-county-button{
  display:inline-flex;
  align-items:center;
  gap:0.5rem;
  min-height:44px;
  max-width:100%;
  padding:0;
  border:0;
  border-radius:3px;
  background:transparent;
  color:#bcae94;
  font-size:0.875rem;
  cursor:pointer;
}
.mast-county-button:hover{color:var(--gold)}
.mast-county-button[aria-expanded="true"] svg{transform:rotate(180deg)}
/* JS sets top and left under the button. */
.county-menu{
  position:fixed;
  inset:auto;
  width:min(14rem,calc(100vw - 16px));
  margin:0;
  padding:6px;
  border:1px solid var(--gold);
  border-radius:8px;
  background:var(--surface);
  color:var(--fg);
  box-shadow:0 12px 32px rgb(0 0 0 / 0.5);
}
.county-menu::backdrop{background:transparent}
.county-menu ul{list-style:none;margin:0;padding:0}
.county-menu button{
  display:flex;
  align-items:center;
  justify-content:space-between;
  width:100%;
  min-height:44px;
  padding:0 12px;
  border:0;
  border-radius:6px;
  background:transparent;
  color:var(--muted);
  font-family:var(--font-display);
  font-size:1.125rem;
  text-align:left;
  cursor:pointer;
}
.county-menu button:hover,.county-menu button:focus-visible{background:var(--card-raised);color:var(--fg)}
.county-menu button[aria-current="true"]{color:var(--fg)}
.county-menu button svg{color:var(--gold)}
.mast[data-entered="true"] .mast-tagline{
  margin-top:0.25rem;
  font-size:0.875rem;
  line-height:1;
  white-space:nowrap;
}
@media (max-width:79.99em){
  .mast[data-entered="true"] .mast-tagline{display:none}
}
/* Narrow header: two tagline lines, so the bar stays at 94px or less. */
@container mast (max-width:26.25em){
  .mast-tagline{
    font-size:.85rem;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;
  }
}
/* html's scroll-padding-top already clears the measured header. */
#open-the-door,#sign-in{scroll-margin-top:.5rem}
/* The door column starts with Invite only, rather than sitting in the vertical centre. */
.door-columns{align-items:start}
/* Phones and tablets: the way in comes first, as it did before the relayout, so "Enter invite code" is on the
   first screen at 320x568 (Design D3); the hero and the county line follow it. */
@media (max-width:63.99em){
  .door-main{display:contents}
  .door-side{order:-1}
}
/* Desktop door: the local promise and the two entry actions stand side by side. The county line sits in the side
   column under the entry actions (Design D1/D2), so the hero has no dead band beside it; the existing explanations
   keep their full-width rows. */
@media (min-width:64em){
  body:has(.door-columns){position:relative}
  body:has(.door-columns) .plate-ground{position:absolute;inset:0;height:auto;margin-bottom:0;contain:layout;-webkit-mask-image:linear-gradient(#000 70%,transparent);mask-image:linear-gradient(#000 70%,transparent)}
  body:has(.door-columns) .scrim{position:absolute}
  /* The county line stands in the side column under the way in, so the hero's height is not left as a dead band
     beside it (Design D2) and the heading sits next to its names, not across the page (D1). */
  .door-columns{grid-template-areas:"hero side" "hero counties" "week week" "rooms rooms";grid-template-rows:auto 1fr;row-gap:2rem}
  .door-main{display:contents}
  .door-side{grid-area:side;position:static;align-self:start}
  .door-hero{grid-area:hero;align-self:start}
  .door-counties{grid-area:counties}
  .door-columns .door-counties{align-self:start;flex-direction:column;align-items:flex-start;gap:.5rem;justify-content:flex-start}
  /* One county a line, a column under its heading, so the side column runs as tall as the hero beside it. */
  .door-columns .door-counties ul{display:flex;flex-direction:column;gap:.35rem;width:100%}
  .door-columns .door-counties li{padding:.1rem 0}
  .door-columns .door-counties li+li{border-left:0}
  .door-week{grid-area:week;align-self:start}
  .door-rooms{grid-area:rooms;align-self:start}
}
/* Reserve the signed-out plate before its engraving paints. The light and the motes
   sit absolutely in this box; contain:layout keeps them from moving the page, and the
   phone landing crop is the same 62lvh the picture uses once data-section is set. */
.shell[data-door] > .plate-ground{contain:layout}
@media (max-width:640px){
  .shell[data-door="landing"] > .plate-ground{height:62lvh;margin-bottom:-62lvh}
}
/* A live call with chat. The pane sits beside the video once the call itself
   is wide enough to hold both (a desktop column). On a phone it stays under
   the video, behind Video / Chat. A call with no chat source does not use this. */
.call-frame{
  container-type:inline-size;
  container-name:call;
  min-width:0;
}
.call-live{
  display:flex;
  flex-direction:column;
  gap:.75rem;
  min-width:0;
}
.call-stage{
  container-type:inline-size;
  container-name:call-stage;
  display:flex;
  flex-direction:column;
  gap:.75rem;
  min-width:0;
}
.call-tiles{
  display:grid;
  gap:.75rem;
  grid-template-columns:minmax(0,1fr);
  min-width:0;
}
@container call-stage (min-width:28rem){
  .call-tiles{grid-template-columns:repeat(2,minmax(0,1fr))}
}
.call-tiles figure,.call-tiles video{min-width:0;max-width:100%}
.call-controls,.call-switch{
  display:flex;
  flex-wrap:wrap;
  gap:.5rem;
  min-width:0;
}
.call-chat{
  display:flex;
  flex-direction:column;
  gap:.5rem;
  min-width:0;
}
@container call (max-width:47.99rem){
  .call-live[data-pane="video"] .call-chat{display:none}
  .call-live[data-pane="chat"] .call-stage{display:none}
}
@container call (min-width:48rem){
  .call-live:has([data-call-lines]){
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(16rem,22rem);
    align-items:start;
    column-gap:1rem;
    row-gap:.75rem;
  }
  .call-live:has([data-call-lines]) .call-stage,
  .call-live:has([data-call-lines]) .call-chat{display:flex}
  .call-live:has([data-call-lines]) .call-switch{display:none}
}
.call-chat:not(:has([data-call-lines])){display:none}
.call-live:not(:has([data-call-lines])){display:flex}
.call-live:not(:has([data-call-lines])) .call-switch{display:none}
/* The rooms list on the door reads at body size. */
.door-rooms p{font-size:0.95rem;line-height:1.6}
.door-what{max-width:70ch}

/* Skip link: Tailwind sr-only uses overflow:hidden on a 1px box, which the
   elastic UI geometry gate reads as silent clipping. Keep clip-path hiding
   until focus; drop overflow so the unfocused skip link is not flagged. */
.skip-link.sr-only:not(:focus):not(:focus-visible) {
  overflow: visible;
}

/* At 125% browser zoom a 320px screen is 256 CSS px: controls use the whole column. */
@media (max-width:20em){
  [aria-label="Your account"]{display:grid;grid-template-columns:minmax(0,1fr)}
  [aria-label="Your account"] button{width:100%}
  .dm-setup-actions button{flex:1 1 100%}
  .account-removal button{width:100%}
  [data-entered] main :is(p,label){width:100%}
}

/* Message setup. A column, not a spread-out bar: a wide justify-between
   would open an empty gap. Sizes are rem so 16, 24 and 32px roots stay whole. */
.dm-setup,
.dm-wait{
  container-type:inline-size;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:.75rem;
  min-width:0;
  max-width:100%;
  box-sizing:border-box;
}
.dm-setup{
  position:fixed;
  z-index:40;
  top:calc(var(--mast-h, 5rem) + .75rem);
  left:max(1rem, env(safe-area-inset-left));
  right:max(1rem, env(safe-area-inset-right));
  width:auto;
  max-width:36rem;
  margin-inline:auto;
  max-height:calc(100dvh - var(--mast-h, 5rem) - 1.5rem);
  overflow:auto;
  padding:1rem;
  border:1px solid var(--line);
  border-radius:.5rem;
  background:var(--surface);
  color:var(--fg);
}
.dm-setup h2,
.dm-wait p,
.dm-setup p,
.dm-wait label{
  margin:0;
  min-width:0;
  max-width:100%;
  overflow-wrap:anywhere;
}
.dm-setup h2{
  font-size:clamp(1.5rem, 1.15rem + 1.6cqi, 2.25rem);
  line-height:1.2;
  text-wrap:balance;
  font-weight:600;
}
.dm-setup p,
.dm-wait p{font-size:1rem;line-height:1.45}
.dm-setup-actions,
.dm-wait-row{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:.5rem;
  min-width:0;
  max-width:100%;
  width:100%;
}
.dm-setup button,
.dm-wait button{
  font:inherit;
  font-size:1rem;
  font-weight:600;
  line-height:1.3;
  min-height:2.75rem;
  min-width:0;
  max-width:100%;
  padding:.5rem 1rem;
  border-radius:.375rem;
  overflow-wrap:anywhere;
  white-space:normal;
  text-align:center;
}
.dm-setup-primary,
.dm-wait-primary,
.dm-setup-quiet,
.dm-wait-quiet{
  font:inherit;
  font-size:1rem;
  font-weight:600;
  line-height:1.3;
  min-height:2.75rem;
  min-width:2.75rem;
  max-width:100%;
  padding:.5rem 1rem;
  border-radius:.375rem;
  overflow-wrap:anywhere;
  white-space:normal;
  text-align:center;
}
.dm-setup-primary,
.dm-wait-primary{
  background:var(--fg);
  color:var(--bg);
  border:1px solid var(--fg);
}
.dm-setup-quiet,
.dm-wait-quiet{
  background:transparent;
  color:var(--fg);
  border:1px solid var(--line);
}
.dm-setup button:disabled,
.dm-setup button[aria-disabled="true"],
.dm-wait button:disabled,
.dm-wait button[aria-disabled="true"]{opacity:.55}
.dm-setup input,
.dm-wait input,
.dm-wait textarea{
  box-sizing:border-box;
  width:100%;
  min-width:0;
  min-height:2.75rem;
  max-width:100%;
  padding:.5rem .75rem;
  font:inherit;
  font-size:1rem;
  line-height:1.4;
  color:var(--fg);
  background:var(--card, var(--surface));
  border:1px solid var(--line-strong);
  border-radius:.375rem;
}
.dm-wait-row input,
.dm-wait-row label{flex:1 1 10rem;width:auto;min-width:0}
.dm-wait-row label input{width:100%}
.dm-wait-row button{flex:0 1 auto}
.dm-setup label,
.dm-wait label{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:.5rem;
  min-width:0;
  width:100%;
  max-width:100%;
  font-size:1rem;
  overflow-wrap:anywhere;
}

/* Group chat sizes itself from its own box, so the group page and a narrow call pane
   share one component. A container query never styles the container itself. */
.group-chat{container:group-chat / inline-size;min-width:0}
.group-chat-form{display:flex;flex-direction:column;gap:.5rem;min-width:0}
.group-chat-field{flex:1 1 auto;min-width:0}
.group-chat-send{flex:0 0 auto}
.group-chat-transcript{max-height:24rem;min-width:0}
.group-chat-line{max-width:100%;width:fit-content}
.group-chat-lede-short{display:none}
.group-chat button{flex-shrink:0;white-space:nowrap}
@container group-chat (min-width:24rem){
  .group-chat-form{flex-direction:row;align-items:center}
  .group-chat .group-chat-line{max-width:36rem}
}
@container group-chat (max-width:23.999rem){
  .group-chat .group-chat-lede-long{display:none}
  .group-chat .group-chat-lede-short{display:block}
  .group-chat .group-chat-transcript{max-height:12rem}
  .group-chat .group-chat-title{font-size:1.25rem;line-height:1.3}
}
.group-chat[data-compact] .group-chat-lede-long{display:none}
.group-chat[data-compact] .group-chat-lede-short{display:block}
.group-chat[data-compact] .group-chat-transcript{max-height:12rem}
.group-chat[data-compact] .group-chat-title{font-size:1.25rem;line-height:1.3}
[data-group-slot="call"]:empty{display:none}
/* Under 40em the switch stays on the brand's row instead of wrapping onto its own (Design L1, Nov 27): the brand
   takes what is left and wraps its own words, and the mast gives back 4px above and below. */
@media (max-width:39.99em){
  /* Signed in too: .mast[data-entered="true"] wraps (above), which put the switch and the hidden Sign out on a
     second row and grew the sticky mast over the page's headline at 320 (Design M2, Nov 27). */
  .mast,.mast[data-entered="true"]{flex-wrap:nowrap;align-items:flex-start;padding-block:calc(.75rem - 4px)}
  .mast-brand{flex:1 1 auto;min-width:0}
  .mast-actions,.mast[data-entered="true"] .mast-actions{flex:none;flex-wrap:nowrap}
  /* Sign out held hidden while the session arrives keeps its width only where the nav row could re-wrap. */
  .mast-door[inert]{display:none}
}
