/* SPDX-License-Identifier: LicenseRef-Proprietary */
/* Hosted-only styles. Colors come from the theme variables built by scripts/build_themes.py. */
.hosted-staging-badge {
  position: relative;
  width: fit-content;
  max-width: calc(100% - 1rem);
  margin: 0.5rem auto;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--text);
  border: 2px solid var(--warning);
  font-size: 0.8rem;
  font-weight: 700;
  pointer-events: none;
}

/* A native details menu works with keyboard, touch and without JavaScript. */
.legal-page { max-width: 48rem; margin-inline: auto; overflow-wrap: anywhere; }
/* Public reading/marketing pages should not inherit upstream's 32rem sign-in card. */
body:not(.has-bottom-nav) main.page:has(.landing-hero) { max-width: 72rem; }
body:not(.has-bottom-nav) main.page:has(.legal-page) { max-width: 52rem; }
.landing-hero { display: grid; gap: 2rem; padding-block: 1.5rem 2.5rem; align-items: center; }
.landing-hero h1 { font-size: clamp(2.3rem, 6vw, 4rem); line-height: 1.08; margin-block: 0.75rem 1.25rem; }
.landing-eyebrow { font-weight: 700; color: var(--text); }
.landing-intro { max-width: 38rem; font-size: 1.15rem; }
.landing-preview { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; min-width: 0; }
.landing-preview-head { display: flex; align-items: center; gap: 0.75rem; }
.landing-preview-head img { flex: none; }
.landing-preview-head p { margin-block: 0.25rem; }
.landing-stages { list-style: none; padding: 0; display: grid; gap: 1rem; }
.landing-stages li { display: flex; gap: 0.75rem; align-items: center; }
.landing-stages p { margin: 0; }
.landing-step { display: grid; place-items: center; flex: none; width: 2rem; height: 2rem; border-radius: 50%; background: var(--accent-soft); color: var(--text); font-weight: 700; }
.landing-features { display: grid; gap: 1.5rem; margin-block: 1.5rem; }
.landing-features article { border-top: 1px solid var(--line); padding-top: 0.5rem; min-width: 0; }
@media (min-width: 60rem) {
  .landing-hero { grid-template-columns: 1.2fr 1fr; }
  .landing-features { grid-template-columns: repeat(3, 1fr); }
}
/* Space switcher (owner review): names wrap to two lines, never cut early. */
.space-switcher { min-width: 0; flex: 1; margin-right: auto; }
.space-switcher > summary { display: flex; width: 100%; gap: 0.5rem; color: var(--text); font-weight: 750; text-align: left; }
.space-switcher-name { min-width: 0; flex: 1; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; line-height: 1.25; }
.space-switcher > ul { left: 0; right: auto; width: max-content; min-width: 100%; max-width: min(26rem, calc(100vw - 2rem)); max-height: 65vh; overflow-y: auto; }
.space-switcher li a { padding-block: 0.5rem; }
.space-switcher li .space-switcher-name { -webkit-line-clamp: 3; line-clamp: 3; }
.space-switcher-empty { max-width: 22rem; padding: 0.75rem; color: var(--muted); }
.space-switcher [aria-current="true"] { background: var(--accent-soft); }
.space-switcher .icon { flex: none; }
/* In the desktop sidebar the menu opens in place: the sidebar scrolls, which would clip a */
/* floating menu, so the list pushes the search and navigation down instead. */
@media (min-width: 48rem) {
  .sidebar > .space-switcher > ul { position: static; width: auto; min-width: 0; max-width: none; max-height: none; margin-top: 0.4rem; box-shadow: none; animation: none; }
  .sidebar > .space-switcher[open] > summary .icon { transform: rotate(90deg); }
}
.space-switcher > summary .icon { transition: transform 0.2s var(--ease, ease); }
/* Space settings: which space you're editing, and a way to change it. */
.settings-scope { margin: 0.25rem 0 0; color: var(--muted); }
.settings-space-pick { margin-top: 0.6rem; width: fit-content; max-width: 100%; }
.settings-space-pick > summary { display: flex; align-items: center; gap: 0.6rem; min-height: 52px; padding: 0.35rem 0.85rem 0.35rem 0.4rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 750; max-width: 100%; }
.settings-space-name { min-width: 0; overflow-wrap: anywhere; }
.settings-space-name .meta { display: block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.settings-space-change { display: inline-flex; align-items: center; gap: 0.2rem; margin-left: auto; padding-left: 0.5rem; color: var(--accent); font-size: 0.9rem; white-space: nowrap; }
.settings-space-pick > ul { min-width: 16rem; max-width: min(26rem, calc(100vw - 2rem)); }
.settings-space-pick li a { padding-block: 0.5rem; }
.settings-nav-foot { margin: 1rem 0 0; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.settings-nav-foot a { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; font-weight: 650; }
.settings-hub-note { margin-top: 1.25rem; }
.link-created { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-block: 1rem; background: var(--surface); }
.link-created input { width: 100%; min-width: 0; }
.link-created img { display: block; max-width: 100%; }
.stack-form { display: grid; gap: 1rem; max-width: 36rem; margin-block: 1rem 1.75rem; }
.stack-form > button { justify-self: start; }
.sec-main strong, .sec-main a { overflow-wrap: anywhere; }
/* Upstream hides the bar on holiday pages; sharing needs a space switcher there too. */
@media (max-width: 47.99rem) {
  body.no-app-bar .site-header .bar { display: flex; }
  .space-switcher { max-width: 100%; }
  .space-switcher > ul { min-width: min(16rem, calc(100vw - 2rem)); }
}
@media (min-width: 48rem) {
  .sidebar > .space-switcher { flex: none; }
}
.account-status.account-link { background: var(--surface); border-color: var(--line); }
.account-status.account-link:hover { background: var(--surface-2); }

/* Footer (owner review): the brand on one side, quiet links on the other. */
.site-footer { align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; padding: 0.75rem 1.25rem; border-radius: var(--radius); }
.footer-brand { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--text); }
.footer-brand img { flex: none; border-radius: 6px; }
.footer-version { color: var(--muted); font-size: 0.78rem; font-variant-numeric: tabular-nums; padding: 0.05rem 0.45rem; border: 1px solid var(--line); border-radius: 999px; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.1rem; }
.footer-links a { color: var(--muted); text-decoration: none; font-weight: 600; min-height: 32px; display: inline-flex; align-items: center; }
.footer-links a:hover, .footer-links a:focus-visible { color: var(--accent); text-decoration: underline; text-underline-offset: 0.2em; }
.footer-links .footer-credit { padding-left: 1.1rem; border-left: 1px solid var(--line); }
body:not(.has-bottom-nav) .site-footer { max-width: 44rem; }
@media (max-width: 40rem) {
  .site-footer { flex-direction: column; justify-content: center; text-align: center; }
  .footer-links { justify-content: center; }
  .footer-links .footer-credit { padding-left: 0; border-left: 0; flex-basis: 100%; justify-content: center; }
}

/* Operator console (owner review): one frame, tabs, cards and tables. */
.ops { display: grid; gap: 1.1rem; min-width: 0; }
.ops-head h1 { margin: 0.1rem 0 0.35rem; }
.ops-head .help { margin: 0; }
.ops-eyebrow { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--accent); }
.ops-eyebrow .icon { width: 1rem; height: 1rem; }
.ops-tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.3rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); width: fit-content; max-width: 100%; }
.ops-tabs a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 1rem; border-radius: 999px; color: var(--text); font-weight: 650; text-decoration: none; }
.ops-tabs a:hover { background: var(--surface-2); }
.ops-tabs a[aria-current="page"] { background: var(--accent); color: var(--accent-text); }
.ops-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; min-width: 0; }
.ops-card > h2, .ops-card-head h2 { font-size: 1.05rem; margin: 0 0 0.75rem; }
.ops-card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1rem; }
.ops-card-head a { font-weight: 650; }
.ops-alert { border-color: var(--warning); background: var(--warning-soft); }
.ops-alert h2 { margin-top: 0; }
.ops-columns { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.ops-tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.ops-tile { display: grid; gap: 0.2rem; padding: 0.9rem 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.ops-tile-label { font-size: 0.82rem; font-weight: 700; color: var(--muted); }
.ops-tile-value { font-size: 1.9rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ops-list { list-style: none; margin: 0; padding: 0; display: grid; }
.ops-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 1rem; padding: 0.55rem 0; border-top: 1px solid var(--line); }
.ops-list li:first-child { border-top: 0; }
.ops-list strong { font-variant-numeric: tabular-nums; }
.ops-flag { display: inline-grid; place-items: center; min-width: 1.8rem; padding: 0 0.45rem; border-radius: 999px; background: var(--warning-soft); color: var(--text); }
.ops-facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.45rem 1rem; margin: 0; }
.ops-facts dt { color: var(--muted); font-weight: 650; }
.ops-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.ops-table { font-size: 0.93rem; }
.ops-table th, .ops-table td { padding: 0.6rem 0.55rem; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.ops-table thead th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 750; }
.ops-table tbody tr:last-child > * { border-bottom: 0; }
.ops-table tbody tr:hover { background: var(--surface-2); }
.ops-table tbody th { font-weight: 600; }
.ops-table td.num, .ops-spark td.num { text-align: right; }
.ops-who { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--text); }
.ops-who > span:last-child { display: grid; }
.ops-who .meta { font-size: 0.82rem; }
.ops-email { overflow-wrap: anywhere; }
.ops-badge { display: inline-flex; align-items: center; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.78rem; font-weight: 700; background: var(--accent-soft); color: var(--text); white-space: nowrap; }
.ops-badge.is-off { background: var(--surface-2); color: var(--muted); }
.ops-badge.is-warn { background: var(--warning-soft); }
.ops-badge.is-op { background: var(--accent); color: var(--accent-text); }
.ops-badges { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.4rem 0 0; }
.ops-action { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 650; }
.ops-action::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--muted); flex: none; }
.ops-action-change::before { background: var(--accent); }
.ops-action-danger::before { background: var(--warning); }
.ops-details { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.ops-chip { display: inline-block; padding: 0.05rem 0.5rem; border-radius: 6px; background: var(--surface-2); font-size: 0.8rem; }
.ops-spark meter { width: 100%; min-width: 6rem; height: 0.7rem; }
.ops-spark td:first-child { white-space: nowrap; color: var(--muted); }
.ops-search { position: relative; display: flex; gap: 0.5rem; align-items: center; max-width: 40rem; }
.ops-search .icon { position: absolute; left: 0.9rem; color: var(--muted); pointer-events: none; }
.ops-search input { flex: 1; min-width: 0; padding-left: 2.5rem; border-radius: 999px; min-height: 48px; }
.ops-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.ops-filter select { width: auto; }
.ops-pager { display: flex; align-items: center; justify-content: center; gap: 0.75rem; margin-top: 0.75rem; }
.ops-profile { display: flex; align-items: center; gap: 1rem; }
.ops-profile h1 { margin: 0; overflow-wrap: anywhere; }
.ops-profile .meta { margin: 0.15rem 0 0; }
.ops-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.ops-disclosure { border-top: 1px solid var(--line); padding-top: 0.6rem; margin-top: 0.6rem; }
.ops-disclosure summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.ops-danger summary { color: var(--warning); }
.ops-switches { list-style: none; margin: 0; padding: 0; }
.ops-switches li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.65rem 0; border-top: 1px solid var(--line); }
.ops-switches li:first-child { border-top: 0; }
.ops-switch-main { display: grid; gap: 0.2rem; min-width: 0; }
.ops-switch-form { display: flex; gap: 0.4rem; align-items: center; }
.ops-switch-form select { width: auto; min-width: 8rem; }
.ops-empty { color: var(--muted); }
@media (max-width: 40rem) {
  .ops-table thead { display: none; }
  .ops-table tr { display: grid; gap: 0.2rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
  .ops-table th, .ops-table td { border: 0; padding: 0.1rem 0; }
  .ops-spark tr { grid-template-columns: 6rem 1fr 2rem; align-items: center; }
}
.ops-spark th, .ops-spark td { padding-block: 0.28rem; }
.ops-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; padding-bottom: 0.9rem; border-bottom: 1px solid var(--line); }

/* Invite: pick link or email first; the form shows only what that way needs. Without :has() */
/* support both stay visible and the server still follows the choice. */
.invite-how { border: 0; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.invite-how legend { font-weight: 750; margin-bottom: 0.4rem; padding: 0; }
.invite-option { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.8rem 0.95rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.invite-option > span { display: grid; gap: 0.15rem; }
.invite-option strong { display: inline-flex; align-items: center; gap: 0.4rem; }
.invite-option input { margin-top: 0.3rem; flex: none; }
.invite-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.invite-option:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.invite-cta-email { display: none; }
.invite-form:has(input[name="how"][value="link"]:checked) .invite-email { display: none; }
.invite-form:has(input[name="how"][value="email"]:checked) .invite-cta-link { display: none; }
.invite-form:has(input[name="how"][value="email"]:checked) .invite-cta-email { display: inline; }
.settings-back a { display: inline-flex; align-items: center; min-height: 44px; }
